diff options
author | OPNA2608 <christoph.neidahl@gmail.com> | 2021-08-16 18:42:23 +0200 |
---|---|---|
committer | OPNA2608 <christoph.neidahl@gmail.com> | 2021-08-21 10:42:27 +0200 |
commit | 8f4c7af8aa7b47dabeb3cccd30bf1ff51f1127b7 (patch) | |
tree | 50b3479f9440a6dc23a0d0decb6e7e5bc52130ab /pkgs/applications/audio/mpg123/default.nix | |
parent | d416e6878c0cd46d2831b7a19398692978377ac7 (diff) |
mpg123: Refactor
* Adds support for more audio APIs * Explicitly requires APIs for sane order of preference * Enables parallel building
Diffstat (limited to 'pkgs/applications/audio/mpg123/default.nix')
-rw-r--r-- | pkgs/applications/audio/mpg123/default.nix | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/pkgs/applications/audio/mpg123/default.nix b/pkgs/applications/audio/mpg123/default.nix index 09a588857e334..1023c9ab2b460 100644 --- a/pkgs/applications/audio/mpg123/default.nix +++ b/pkgs/applications/audio/mpg123/default.nix @@ -1,10 +1,18 @@ -{ lib, stdenv +{ lib +, stdenv , fetchurl , makeWrapper +, pkg-config +, perl +, withAlsa ? stdenv.hostPlatform.isLinux , alsa-lib +, withPulse ? stdenv.hostPlatform.isLinux +, libpulseaudio +, withCoreAudio ? stdenv.hostPlatform.isDarwin , AudioUnit , AudioToolbox -, perl +, withJack ? stdenv.hostPlatform.isUnix +, jack , withConplay ? !stdenv.hostPlatform.isWindows }: @@ -19,15 +27,26 @@ stdenv.mkDerivation rec { outputs = [ "out" ] ++ lib.optionals withConplay [ "conplay" ]; - nativeBuildInputs = lib.optionals withConplay [ makeWrapper ]; + nativeBuildInputs = lib.optionals withConplay [ makeWrapper ] + ++ lib.optionals (withPulse || withJack) [ pkg-config ]; buildInputs = lib.optionals withConplay [ perl ] - ++ lib.optionals (stdenv.hostPlatform.isLinux) [ alsa-lib ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ AudioUnit AudioToolbox ]; + ++ lib.optionals withAlsa [ alsa-lib ] + ++ lib.optionals withPulse [ libpulseaudio ] + ++ lib.optionals withCoreAudio [ AudioUnit AudioToolbox ] + ++ lib.optionals withJack [ jack ]; + + configureFlags = [ + "--with-audio=${lib.strings.concatStringsSep "," ( + lib.optional withJack "jack" + ++ lib.optional withPulse "pulse" + ++ lib.optional withAlsa "alsa" + ++ lib.optional withCoreAudio "coreaudio" + ++ [ "dummy" ] + )}" + ] ++ lib.optional (stdenv.hostPlatform ? mpg123) "--with-cpu=${stdenv.hostPlatform.mpg123.cpu}"; - configureFlags = lib.optional - (stdenv.hostPlatform ? mpg123) - "--with-cpu=${stdenv.hostPlatform.mpg123.cpu}"; + enableParallelBuilding = true; postInstall = lib.optionalString withConplay '' mkdir -p $conplay/bin |