nixpkgs/pkgs/tools/audio/alsaequal/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

44 lines
1.2 KiB
Nix

{ lib, 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 lib; {
description = "Real-time adjustable equalizer plugin for ALSA";
homepage = "https://thedigitalmachine.net/alsaequal.html";
license = licenses.gpl2;
maintainers = with maintainers; [ ymeister ];
};
}