2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch, autoconf }:
|
2004-04-02 16:36:14 +01:00
|
|
|
|
2013-07-04 08:07:30 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-11-11 16:45:28 +00:00
|
|
|
pname = "libmad";
|
|
|
|
version = "0.15.1b";
|
|
|
|
|
2003-12-03 21:58:16 +00:00
|
|
|
src = fetchurl {
|
2019-11-11 16:45:28 +00:00
|
|
|
url = "mirror://sourceforge/mad/${pname}-${version}.tar.gz";
|
|
|
|
sha256 = "14460zhacxhswnzb36qfpd1f2wbk10qvksvm6wyq5hpvdgnw7ymv";
|
2008-02-11 21:02:38 +00:00
|
|
|
};
|
|
|
|
|
2019-11-11 16:45:28 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/openwrt/packages/raw/openwrt-19.07/libs/libmad/patches/001-mips_removal_h_constraint.patch";
|
|
|
|
sha256 = "0layswr6qg6axf4vyz6xrv73jwga34mkma3ifk9w9vrk41454hr5";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/KaOSx/main/raw/1270b8080f37fb6cca562829a521991800b0a497/libmad/libmad.patch";
|
|
|
|
sha256 = "0rysq0sn3dfdz6pa6bfqkmk4ymc4rzk5ym7p16dyk37sldg1pbzs";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/KaOSx/main/raw/1270b8080f37fb6cca562829a521991800b0a497/libmad/amd64-64bit.diff";
|
|
|
|
sha256 = "0mx56dmkbvw3zxnqd2hjng48q0d7q7473pns4n0ksdam29b0c5ar";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "CVE-2017-8372-CVE-2017-8373.patch";
|
|
|
|
url = "https://github.com/openwrt/packages/raw/openwrt-19.07/libs/libmad/patches/102-CVE-2017-8373-CVE-2017-8372-md-size.patch";
|
|
|
|
sha256 = "0p6mkpn66h1ds8jvww28q4vlr58jwm58m9vb7pkvvyvy764agqnk";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "CVE-2017-8374.patch";
|
|
|
|
url = "https://github.com/openwrt/packages/raw/openwrt-19.07/libs/libmad/patches/101-CVE-2017-8374-length-check.patch";
|
|
|
|
sha256 = "1j1ssxwmx9nfahzl62frbzck93xrjc2v3w30c12vmk29iflf1890";
|
|
|
|
})
|
|
|
|
]
|
2015-03-05 21:05:22 +00:00
|
|
|
# optimize.diff is taken from https://projects.archlinux.org/svntogit/packages.git/tree/trunk/optimize.diff?h=packages/libmad
|
|
|
|
# It is included here in order to fix a build failure in Clang
|
|
|
|
# But it may be useful to fix other, currently unknown problems as well
|
2021-01-21 17:00:13 +00:00
|
|
|
++ lib.optionals stdenv.cc.isClang [
|
2019-11-11 16:45:28 +00:00
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/KaOSx/main/raw/1270b8080f37fb6cca562829a521991800b0a497/libmad/optimize.diff";
|
2020-01-04 09:20:00 +00:00
|
|
|
sha256 = "0hcxzz9ql1fizyqbsgdchdwi7bvchfr72172j43hpyj53p0yabc6";
|
2019-11-11 16:45:28 +00:00
|
|
|
})
|
|
|
|
];
|
2010-04-18 19:07:03 +01:00
|
|
|
|
2009-02-03 16:31:11 +00:00
|
|
|
# The -fforce-mem flag has been removed in GCC 4.3.
|
2019-11-11 16:45:28 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace configure.ac --replace "-fforce-mem" ""
|
|
|
|
substituteInPlace configure.ac --replace "arch=\"-march=i486\"" ""
|
2009-02-03 16:31:11 +00:00
|
|
|
'';
|
2008-02-11 21:02:38 +00:00
|
|
|
|
2019-11-11 16:45:28 +00:00
|
|
|
nativeBuildInputs = [ autoconf ];
|
|
|
|
|
|
|
|
preConfigure = "autoconf";
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://sourceforge.net/projects/mad/";
|
2009-03-03 13:27:40 +00:00
|
|
|
description = "A high-quality, fixed-point MPEG audio decoder supporting MPEG-1 and MPEG-2";
|
2015-03-05 21:05:22 +00:00
|
|
|
license = licenses.gpl2;
|
2013-07-04 08:07:30 +01:00
|
|
|
maintainers = with maintainers; [ lovek323 ];
|
|
|
|
platforms = platforms.unix;
|
2003-12-03 21:58:16 +00:00
|
|
|
};
|
|
|
|
}
|