mpg123: fix cross-compile to windows
This commit is contained in:
parent
bb9d0c3038
commit
897c8e6982
@ -1,9 +1,9 @@
|
|||||||
{ lib, stdenv
|
{ lib, stdenv
|
||||||
, fetchurl
|
, fetchurl
|
||||||
, makeWrapper
|
, makeWrapper
|
||||||
|
|
||||||
, alsaLib
|
, alsaLib
|
||||||
, perl
|
, perl
|
||||||
|
, withConplay ? !stdenv.targetPlatform.isWindows
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
@ -14,35 +14,36 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "sha256-UCqX4Nk1vn432YczgCHY8wG641wohPKoPVnEtSRm7wY=";
|
sha256 = "sha256-UCqX4Nk1vn432YczgCHY8wG641wohPKoPVnEtSRm7wY=";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = [ "out" "conplay" ];
|
outputs = [ "out" ] ++ lib.optionals withConplay [ "conplay" ];
|
||||||
|
|
||||||
nativeBuildInputs = [ makeWrapper ];
|
nativeBuildInputs = lib.optionals withConplay [ makeWrapper ];
|
||||||
|
|
||||||
buildInputs = [ perl ] ++ lib.optional (!stdenv.isDarwin) alsaLib;
|
buildInputs = lib.optionals withConplay [ perl ]
|
||||||
|
++ lib.optionals (!stdenv.isDarwin && !stdenv.targetPlatform.isWindows) [ alsaLib ];
|
||||||
|
|
||||||
configureFlags = lib.optional
|
configureFlags = lib.optional
|
||||||
(stdenv.hostPlatform ? mpg123)
|
(stdenv.hostPlatform ? mpg123)
|
||||||
"--with-cpu=${stdenv.hostPlatform.mpg123.cpu}";
|
"--with-cpu=${stdenv.hostPlatform.mpg123.cpu}";
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = lib.optionalString withConplay ''
|
||||||
mkdir -p $conplay/bin
|
mkdir -p $conplay/bin
|
||||||
mv scripts/conplay $conplay/bin/
|
mv scripts/conplay $conplay/bin/
|
||||||
'';
|
'';
|
||||||
|
|
||||||
preFixup = ''
|
preFixup = lib.optionalString withConplay ''
|
||||||
patchShebangs $conplay/bin/conplay
|
patchShebangs $conplay/bin/conplay
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postFixup = ''
|
postFixup = lib.optionalString withConplay ''
|
||||||
wrapProgram $conplay/bin/conplay \
|
wrapProgram $conplay/bin/conplay \
|
||||||
--prefix PATH : $out/bin
|
--prefix PATH : $out/bin
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = with lib; {
|
||||||
description = "Fast console MPEG Audio Player and decoder library";
|
description = "Fast console MPEG Audio Player and decoder library";
|
||||||
homepage = "http://mpg123.org";
|
homepage = "https://mpg123.org";
|
||||||
license = lib.licenses.lgpl21;
|
license = licenses.lgpl21;
|
||||||
maintainers = [ lib.maintainers.ftrvxmtrx ];
|
maintainers = [ maintainers.ftrvxmtrx ];
|
||||||
platforms = lib.platforms.unix;
|
platforms = platforms.all;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user