1{ lib, stdenv, fetchurl
2, alsa-lib, caps
3}:
4
5stdenv.mkDerivation rec {
6 pname = "alsaequal";
7 version = "0.6";
8
9 src = fetchurl {
10 url = "https://thedigitalmachine.net/tools/alsaequal-${version}.tar.bz2";
11 sha256 = "1w3g9q5z3nrn3mwdhaq6zsg0jila8d102dgwgrhj9vfx58apsvli";
12 };
13
14 buildInputs = [ alsa-lib ];
15
16 makeFlags = [ "DESTDIR=$(out)" ];
17
18 # Borrowed from Arch Linux's AUR
19 patches = [
20 # Adds executable permissions to resulting libraries
21 # and changes their destination directory from "usr/lib/alsa-lib" to "lib/alsa-lib" to better align with nixpkgs filesystem hierarchy.
22 ./makefile.patch
23 # Fixes control port check, which resulted in false error.
24 ./false_error.patch
25 # Fixes name change of an "Eq" to "Eq10" method in version 9 of caps library.
26 ./caps_9.x.patch
27 ];
28
29 postPatch = ''
30 sed -i 's#/usr/lib/ladspa/caps\.so#${caps}/lib/ladspa/caps\.so#g' ctl_equal.c pcm_equal.c
31 '';
32
33 preInstall = ''
34 mkdir -p "$out/lib/alsa-lib"
35 '';
36
37 meta = with lib; {
38 description = "Real-time adjustable equalizer plugin for ALSA";
39 homepage = "https://thedigitalmachine.net/alsaequal.html";
40 license = licenses.gpl2;
41 maintainers = with maintainers; [ ymeister ];
42 };
43}