1{
2 lib,
3 stdenv,
4 fetchurl,
5 fetchpatch,
6 unzip,
7 mpg123,
8}:
9
10stdenv.mkDerivation rec {
11 pname = "mp3gain";
12 version = "1.6.2";
13 src = fetchurl {
14 url = "mirror://sourceforge/${pname}/${pname}-${
15 lib.replaceStrings [ "." ] [ "_" ] version
16 }-src.zip";
17 sha256 = "0varr6y7k8zarr56b42r0ad9g3brhn5vv3xjg1c0v19jxwr4gh2w";
18 };
19
20 nativeBuildInputs = [ unzip ];
21 buildInputs = [ mpg123 ];
22
23 sourceRoot = ".";
24
25 patches = [
26 (fetchpatch {
27 name = "0001-fix-security-bugs.patch";
28 url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-sound/mp3gain/files/mp3gain-1.6.2-CVE-2019-18359-plus.patch?id=36f8689f7903548f5d89827a6e7bdf70a9882cee";
29 sha256 = "10n53wm0xynlcxqlnaqfgamjzcpfz41q1jlg0bhw4kq1kzhs4yyw";
30 })
31 ];
32
33 buildFlags = [ "OSTYPE=linux" ];
34
35 installPhase = ''
36 install -vD mp3gain "$out/bin/mp3gain"
37 '';
38
39 meta = with lib; {
40 description = "Lossless mp3 normalizer with statistical analysis";
41 homepage = "https://mp3gain.sourceforge.net/";
42 license = licenses.lgpl21;
43 platforms = platforms.unix;
44 maintainers = with maintainers; [ devhell ];
45 mainProgram = "mp3gain";
46 };
47}