2019-11-11 16:50:37 +00:00
|
|
|
{stdenv, fetchurl, fetchpatch, libao, libmad, libid3tag, zlib, alsaLib
|
2017-10-26 01:33:55 +01:00
|
|
|
# Specify default libao output plugin to use (e.g. "alsa", "pulse" …).
|
|
|
|
# If null, it will use the libao system default.
|
|
|
|
, defaultAudio ? null
|
|
|
|
}:
|
2008-02-11 21:02:38 +00:00
|
|
|
|
2011-07-07 16:10:33 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "mpg321";
|
2015-01-10 12:51:15 +00:00
|
|
|
version = "0.3.2";
|
2011-07-07 16:10:33 +01:00
|
|
|
|
2008-02-11 21:02:38 +00:00
|
|
|
src = fetchurl {
|
2015-01-10 12:51:15 +00:00
|
|
|
url = "mirror://sourceforge/mpg321/${version}/mpg321_${version}.orig.tar.gz";
|
|
|
|
sha256 = "0ki8mh76bbmdh77qsiw682dvi8y468yhbdabqwg05igmwc1wqvq5";
|
2008-02-11 21:02:38 +00:00
|
|
|
};
|
|
|
|
|
2019-11-11 16:50:37 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "CVE-2018-7263.patch";
|
|
|
|
url = "https://sources.debian.org/data/main/m/mpg321/0.3.2-3/debian/patches/handle_illegal_bitrate_value.patch";
|
|
|
|
sha256 = "15simp5fjvm9b024ryfh441rkh2d5bcrizqkzlrh07n9sm7fkw6x";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2016-02-26 17:38:15 +00:00
|
|
|
hardeningDisable = [ "format" ];
|
2015-12-23 01:59:47 +00:00
|
|
|
|
2017-10-26 01:33:55 +01:00
|
|
|
configureFlags =
|
|
|
|
[ ("--enable-alsa=" + (if stdenv.isLinux then "yes" else "no")) ]
|
|
|
|
++ (stdenv.lib.optional (defaultAudio != null)
|
|
|
|
"--with-default-audio=${defaultAudio}");
|
2008-02-11 21:02:38 +00:00
|
|
|
|
2015-01-10 12:51:15 +00:00
|
|
|
buildInputs = [libao libid3tag libmad zlib]
|
|
|
|
++ stdenv.lib.optional stdenv.isLinux alsaLib;
|
|
|
|
|
|
|
|
installTargets = "install install-man";
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2014-08-24 15:21:08 +01:00
|
|
|
description = "Command-line MP3 player";
|
2008-02-11 21:02:38 +00:00
|
|
|
homepage = http://mpg321.sourceforge.net/;
|
2015-01-10 12:51:15 +00:00
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = [ maintainers.rycee ];
|
2018-04-30 23:43:54 +01:00
|
|
|
platforms = platforms.gnu ++ platforms.linux;
|
2008-02-11 21:02:38 +00:00
|
|
|
};
|
|
|
|
}
|