@@ -1,4 +1,4 @@
1−{ stdenv, fetchFromGitHub }:
1+{ stdenv, fetchFromGitHub, fetchpatch }:
22
33stdenv.mkDerivation {
44 name = "aacgain-1.9.0";
@@ -12,7 +12,19 @@ stdenv.mkDerivation {
1212
1313 hardeningDisable = [ "format" ];
1414
15+ postPatch = ''
16+ (
17+ cd mp4v2
18+ patch -p0 < ${fetchpatch {
19+ name = "fix_missing_ptr_deref.patch";
20+ url = "https://aur.archlinux.org/cgit/aur.git/plain/fix_missing_ptr_deref.patch?h=aacgain-cvs&id=e1a19c920f57063e64bab75cb0d8624731f6e3d7";
21+ sha256 = "1cq7r005nvmwdjb25z80grcam7jv6k57jnl2bh349mg3ajmslbq9";
22+ }}
23+ )
24+ '';
25+
1526 configurePhase = ''
27+ runHook preConfigure
1628 cd mp4v2
1729 ./configure
1830
@@ -21,9 +33,11 @@ stdenv.mkDerivation {
2133
2234 cd ..
2335 ./configure
36+ runHook postConfigure
2437 '';
2538
2639 buildPhase = ''
40+ runHook preBuild
2741 cd mp4v2
2842 make libmp4v2.la
2943
@@ -32,18 +46,18 @@ stdenv.mkDerivation {
3246
3347 cd ..
3448 make
49+ runHook postBuild
3550 '';
3651
3752 installPhase = ''
38− strip -s aacgain/aacgain
39− install -vD aacgain/aacgain "$out/bin/aacgain"
53+ install -D aacgain/aacgain "$out/bin/aacgain"
4054 '';
4155
42− meta = {
56+ meta = with stdenv.lib; {
4357 description = "ReplayGain for AAC files";
4458 homepage = https://github.com/mulx/aacgain;
45− license = stdenv.lib.licenses.gpl2;
46− platforms = stdenv.lib.platforms.linux;
47− maintainers = [ stdenv.lib.maintainers.robbinch ];
59+ license = licenses.gpl2;
60+ platforms = platforms.linux;
61+ maintainers = [ maintainers.robbinch ];
4862 };
4963}