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