mpg123: add lib-only derivation not depending on sound servers
This commit is contained in:
parent
d384095645
commit
dd922563af
2 changed files with 21 additions and 9 deletions
|
@ -3,7 +3,7 @@
|
|||
, fetchurl
|
||||
, makeWrapper
|
||||
, pkg-config
|
||||
, perl
|
||||
, libOnly ? false # whether to build only the library
|
||||
, withAlsa ? stdenv.hostPlatform.isLinux
|
||||
, alsa-lib
|
||||
, withPulse ? stdenv.hostPlatform.isLinux
|
||||
|
@ -14,29 +14,36 @@
|
|||
, withJack ? stdenv.hostPlatform.isUnix
|
||||
, jack
|
||||
, withConplay ? !stdenv.hostPlatform.isWindows
|
||||
, perl
|
||||
}:
|
||||
|
||||
assert withConplay -> !libOnly;
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "mpg123";
|
||||
pname = "${lib.optionalString libOnly "lib"}mpg123";
|
||||
version = "1.31.2";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.bz2";
|
||||
url = "mirror://sourceforge/mpg123/mpg123-${version}.tar.bz2";
|
||||
sha256 = "sha256-sX8ikF4x9DtrQB399qce0Ru30Fb2jbRJ1wufmug5x94=";
|
||||
};
|
||||
|
||||
outputs = [ "out" ] ++ lib.optionals withConplay [ "conplay" ];
|
||||
outputs = [ "out" ] ++ lib.optional withConplay "conplay";
|
||||
|
||||
nativeBuildInputs = lib.optionals withConplay [ makeWrapper ]
|
||||
++ lib.optionals (withPulse || withJack) [ pkg-config ];
|
||||
nativeBuildInputs = lib.optionals (!libOnly) (
|
||||
lib.optionals withConplay [ makeWrapper ]
|
||||
++ lib.optionals (withPulse || withJack) [ pkg-config ]
|
||||
);
|
||||
|
||||
buildInputs = lib.optionals withConplay [ perl ]
|
||||
buildInputs = lib.optionals (!libOnly) (
|
||||
lib.optionals withConplay [ perl ]
|
||||
++ lib.optionals withAlsa [ alsa-lib ]
|
||||
++ lib.optionals withPulse [ libpulseaudio ]
|
||||
++ lib.optionals withCoreAudio [ AudioUnit AudioToolbox ]
|
||||
++ lib.optionals withJack [ jack ];
|
||||
++ lib.optionals withJack [ jack ]
|
||||
);
|
||||
|
||||
configureFlags = [
|
||||
configureFlags = lib.optionals (!libOnly) [
|
||||
"--with-audio=${lib.strings.concatStringsSep "," (
|
||||
lib.optional withJack "jack"
|
||||
++ lib.optional withPulse "pulse"
|
||||
|
|
|
@ -31843,6 +31843,11 @@ with pkgs;
|
|||
jack = libjack2;
|
||||
};
|
||||
|
||||
libmpg123 = mpg123.override {
|
||||
libOnly = true;
|
||||
withConplay = false;
|
||||
};
|
||||
|
||||
mpg321 = callPackage ../applications/audio/mpg321 { };
|
||||
|
||||
mpc-cli = callPackage ../applications/audio/mpc {
|
||||
|
|
Loading…
Reference in a new issue