mpg321: add pkg option to set libao default audio driver

Tested manually with "alsa" and "pulse" drivers.
This commit is contained in:
Profpatsch 2017-10-26 02:33:55 +02:00 committed by Robert Helgesson
parent a1f7aa1ceb
commit 948934864d
No known key found for this signature in database
GPG key ID: C3DB11069E65DC86

View file

@ -1,4 +1,8 @@
{stdenv, fetchurl, libao, libmad, libid3tag, zlib, alsaLib}:
{stdenv, fetchurl, libao, libmad, libid3tag, zlib, alsaLib
# Specify default libao output plugin to use (e.g. "alsa", "pulse" …).
# If null, it will use the libao system default.
, defaultAudio ? null
}:
stdenv.mkDerivation rec {
name = "mpg321-${version}";
@ -11,9 +15,10 @@ stdenv.mkDerivation rec {
hardeningDisable = [ "format" ];
configureFlags = [
("--enable-alsa=" + (if stdenv.isLinux then "yes" else "no"))
];
configureFlags =
[ ("--enable-alsa=" + (if stdenv.isLinux then "yes" else "no")) ]
++ (stdenv.lib.optional (defaultAudio != null)
"--with-default-audio=${defaultAudio}");
buildInputs = [libao libid3tag libmad zlib]
++ stdenv.lib.optional stdenv.isLinux alsaLib;