git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #120076 from Radvendii/mpg123-windows

mpg123: fix cross-compile to windows

commit093b406afc29f9108949d264c11db413cd48faea authorJörg Thalheim <Mic92@users.noreply.github.com> dateThu 22 Apr 2021, 07:05 (6 years ago) parent75fd67d897c8e6
1 file changed+13−12
pkgs/applications/audio/mpg123/default.nix+13−12
pkgs/applications/audio/mpg123/default.nix+13−12
@@ -1,9 +1,9 @@
11{ lib, stdenv
22, fetchurl
33, makeWrapper
4−
54, alsaLib
65, perl
6+, withConplay ? !stdenv.targetPlatform.isWindows
77}:
88
99stdenv.mkDerivation rec {
@@ -14,35 +14,36 @@ stdenv.mkDerivation rec {
1414 sha256 = "sha256-UCqX4Nk1vn432YczgCHY8wG641wohPKoPVnEtSRm7wY=";
1515 };
1616
17− outputs = [ "out" "conplay" ];
17+ outputs = [ "out" ] ++ lib.optionals withConplay [ "conplay" ];
1818
19− nativeBuildInputs = [ makeWrapper ];
19+ nativeBuildInputs = lib.optionals withConplay [ makeWrapper ];
2020
21− buildInputs = [ perl ] ++ lib.optional (!stdenv.isDarwin) alsaLib;
21+ buildInputs = lib.optionals withConplay [ perl ]
22+ ++ lib.optionals (!stdenv.isDarwin && !stdenv.targetPlatform.isWindows) [ alsaLib ];
2223
2324 configureFlags = lib.optional
2425 (stdenv.hostPlatform ? mpg123)
2526 "--with-cpu=${stdenv.hostPlatform.mpg123.cpu}";
2627
27− postInstall = ''
28+ postInstall = lib.optionalString withConplay ''
2829 mkdir -p $conplay/bin
2930 mv scripts/conplay $conplay/bin/
3031 '';
3132
32− preFixup = ''
33+ preFixup = lib.optionalString withConplay ''
3334 patchShebangs $conplay/bin/conplay
3435 '';
3536
36− postFixup = ''
37+ postFixup = lib.optionalString withConplay ''
3738 wrapProgram $conplay/bin/conplay \
3839 --prefix PATH : $out/bin
3940 '';
4041
41− meta = {
42+ meta = with lib; {
4243 description = "Fast console MPEG Audio Player and decoder library";
43− homepage = "http://mpg123.org";
44− license = lib.licenses.lgpl21;
45− maintainers = [ lib.maintainers.ftrvxmtrx ];
46− platforms = lib.platforms.unix;
44+ homepage = "https://mpg123.org";
45+ license = licenses.lgpl21;
46+ maintainers = [ maintainers.ftrvxmtrx ];
47+ platforms = platforms.all;
4748 };
4849}