summaryrefslogtreecommitdiffstats
path: root/pkgs
diff options
context:
space:
mode:
authorTimo Kaufmann <timokau@zoho.com>2020-03-31 14:56:56 +0000
committerGitHub <noreply@github.com>2020-03-31 14:56:56 +0000
commitda0fc069c3f420dd392149dbc126483674592dbd (patch)
treeb362549905508a3572c9f07c199c03450f7c4343 /pkgs
parentd2774425f3839a78d1d4477af5a708fe1d163601 (diff)
parenta0c9e953c7e03deb59c39990801db76e97f29a3a (diff)
Merge pull request #82003 from ymeister/master
alsaequal: init at 0.6
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/tools/audio/alsaequal/caps_9.x.patch21
-rw-r--r--pkgs/tools/audio/alsaequal/default.nix43
-rw-r--r--pkgs/tools/audio/alsaequal/false_error.patch13
-rw-r--r--pkgs/tools/audio/alsaequal/makefile.patch13
-rw-r--r--pkgs/top-level/all-packages.nix2
5 files changed, 92 insertions, 0 deletions
diff --git a/pkgs/tools/audio/alsaequal/caps_9.x.patch b/pkgs/tools/audio/alsaequal/caps_9.x.patch
new file mode 100644
index 000000000000..282e04049747
--- /dev/null
+++ b/pkgs/tools/audio/alsaequal/caps_9.x.patch
@@ -0,0 +1,21 @@
+--- ./ctl_equal.c
++++ ./ctl_equal.c
+@@ -167,7 +167,7 @@
+ snd_ctl_equal_t *equal;
+ const char *controls = ".alsaequal.bin";
+ const char *library = "/usr/lib/ladspa/caps.so";
+- const char *module = "Eq";
++ const char *module = "Eq10";
+ long channels = 2;
+ const char *sufix = " Playback Volume";
+ int err, i, index;
+--- ./pcm_equal.c
++++ ./pcm_equal.c
+@@ -151,7 +151,7 @@
+ snd_config_t *sconf = NULL;
+ const char *controls = ".alsaequal.bin";
+ const char *library = "/usr/lib/ladspa/caps.so";
+- const char *module = "Eq";
++ const char *module = "Eq10";
+ long channels = 2;
+ int err;
diff --git a/pkgs/tools/audio/alsaequal/default.nix b/pkgs/tools/audio/alsaequal/default.nix
new file mode 100644
index 000000000000..9498baca991b
--- /dev/null
+++ b/pkgs/tools/audio/alsaequal/default.nix
@@ -0,0 +1,43 @@
+{ stdenv, fetchurl
+, alsaLib, caps
+}:
+
+stdenv.mkDerivation rec {
+ name = "alsaequal";
+ version = "0.6";
+
+ src = fetchurl {
+ url = "https://thedigitalmachine.net/tools/alsaequal-${version}.tar.bz2";
+ sha256 = "1w3g9q5z3nrn3mwdhaq6zsg0jila8d102dgwgrhj9vfx58apsvli";
+ };
+
+ buildInputs = [ alsaLib ];
+
+ makeFlags = [ "DESTDIR=$(out)" ];
+
+ # Borrowed from Arch Linux's AUR
+ patches = [
+ # Adds executable permissions to resulting libraries
+ # and changes their destination directory from "usr/lib/alsa-lib" to "lib/alsa-lib" to better align with nixpkgs filesystem hierarchy.
+ ./makefile.patch
+ # Fixes control port check, which resulted in false error.
+ ./false_error.patch
+ # Fixes name change of an "Eq" to "Eq10" method in version 9 of caps library.
+ ./caps_9.x.patch
+ ];
+
+ postPatch = ''
+ sed -i 's#/usr/lib/ladspa/caps\.so#${caps}/lib/ladspa/caps\.so#g' ctl_equal.c pcm_equal.c
+ '';
+
+ preInstall = ''
+ mkdir -p "$out/lib/alsa-lib"
+ '';
+
+ meta = with stdenv.lib; {
+ description = "Real-time adjustable equalizer plugin for ALSA";
+ homepage = "https://thedigitalmachine.net/alsaequal.html";
+ license = licenses.gpl2;
+ maintainers = with maintainers; [ ymeister ];
+ };
+}
diff --git a/pkgs/tools/audio/alsaequal/false_error.patch b/pkgs/tools/audio/alsaequal/false_error.patch
new file mode 100644
index 000000000000..1a8413da2741
--- /dev/null
+++ b/pkgs/tools/audio/alsaequal/false_error.patch
@@ -0,0 +1,13 @@
+--- ./ctl_equal.c
++++ ./ctl_equal.c
+@@ -263,8 +263,8 @@
+ for(i = 0; i < equal->num_input_controls; i++) {
+ if(equal->control_data->control[i].type == LADSPA_CNTRL_INPUT) {
+ index = equal->control_data->control[i].index;
+- if(equal->klass->PortDescriptors[index] !=
+- (LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL)) {
++ if(equal->klass->PortDescriptors[index] &
++ (LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL) == 0) {
+ SNDERR("Problem with control file %s, %d.", controls, index);
+ return -1;
+ }
diff --git a/pkgs/tools/audio/alsaequal/makefile.patch b/pkgs/tools/audio/alsaequal/makefile.patch
new file mode 100644
index 000000000000..ee8aa170d60b
--- /dev/null
+++ b/pkgs/tools/audio/alsaequal/makefile.patch
@@ -0,0 +1,13 @@
+--- ./Makefile
++++ ./Makefile
+@@ -45,8 +45,8 @@
+
+ install: all
+ @echo Installing...
+- $(Q)install -m 644 $(SND_PCM_BIN) ${DESTDIR}/usr/lib/alsa-lib/
+- $(Q)install -m 644 $(SND_CTL_BIN) ${DESTDIR}/usr/lib/alsa-lib/
++ $(Q)install -m 755 $(SND_PCM_BIN) ${DESTDIR}/lib/alsa-lib/
++ $(Q)install -m 755 $(SND_CTL_BIN) ${DESTDIR}/lib/alsa-lib/
+
+ uninstall:
+ @echo Un-installing...
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 37de16cdf16d..e12ecbd41379 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -525,6 +525,8 @@ in
acoustidFingerprinter = callPackage ../tools/audio/acoustid-fingerprinter {
ffmpeg = ffmpeg_2;
};
+
+ alsaequal = callPackage ../tools/audio/alsaequal { };
acpica-tools = callPackage ../tools/system/acpica-tools { };