nixpkgs/pkgs/by-name/vi/viper4linux/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

61 lines
1.5 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, gst_all_1
, libviperfx
, makeWrapper
}:
let
gstPluginPath = lib.makeSearchPathOutput "lib" "lib/gstreamer-1.0" (with gst_all_1; [ gstreamer gst-plugins-viperfx gst-plugins-base gst-plugins-good ]);
in
stdenv.mkDerivation rec {
pname = "viper4linux";
version = "unstable-2022-03-13";
src = fetchFromGitHub {
owner = "Audio4Linux";
repo = "Viper4Linux";
rev = "5da25644824f88cf0db24378d2c84770ba4f6816";
sha256 = "sha256-CJNVr/1ehJzX45mxunXcRAypBBGEBdswOzAVG2H+ayg=";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [
gst_all_1.gstreamer
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good
gst_all_1.gst-plugins-viperfx
libviperfx
];
dontBuild = true;
postPatch = ''
substituteInPlace viper --replace "/etc/viper4linux" "$out/etc/viper4linux"
'';
installPhase = ''
runHook preInstall
install -D viper -t $out/bin
mkdir -p $out/etc/viper4linux
cp -r viper4linux/* $out/etc/viper4linux
runHook postInstall
'';
postFixup = ''
wrapProgram "$out/bin/viper" \
--prefix PATH : $out/bin:${lib.makeBinPath [ gst_all_1.gstreamer ]} \
--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : ${gstPluginPath} \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libviperfx ]}
'';
meta = with lib; {
description = "Adaptive Digital Sound Processor";
homepage = "https://github.com/Audio4Linux/Viper4Linux";
license = licenses.gpl3Plus;
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ rewine ];
};
}