nixpkgs/pkgs/tools/audio/volctl/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

57 lines
1.5 KiB
Nix

{ lib, stdenv, python3Packages, fetchFromGitHub, wrapGAppsHook, gobject-introspection, libpulseaudio, glib, gtk3, pango, xorg }:
python3Packages.buildPythonApplication rec {
pname = "volctl";
version = "0.8.0";
src = fetchFromGitHub {
owner = "buzz";
repo = pname;
rev = "v${version}";
sha256 = "02scfscf4mdrphzrd7cbwbhpig9bhvaws8qk4zc81z8vvf3mcfv2";
};
postPatch = ''
substituteInPlace volctl/lib/xwrappers.py \
--replace 'libXfixes.so' "${xorg.libXfixes}/lib/libXfixes.so" \
--replace 'libXfixes.so.3' "${xorg.libXfixes}/lib/libXfixes.so.3"
'';
preBuild = ''
export LD_LIBRARY_PATH=${libpulseaudio}/lib
'';
nativeBuildInputs = [
gobject-introspection
wrapGAppsHook
];
propagatedBuildInputs = [ pango gtk3 ] ++ (with python3Packages; [
click
pycairo
pygobject3
pyyaml
]);
# with strictDeps importing "gi.repository.Gtk" fails with "gi.RepositoryError: Typelib file for namespace 'Pango', version '1.0' not found"
strictDeps = false;
# no tests included
doCheck = false;
pythonImportsCheck = [ "volctl" ];
preFixup = ''
glib-compile-schemas ${glib.makeSchemaPath "$out" "${pname}-${version}"}
gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : "${libpulseaudio}/lib")
'';
meta = with lib; {
description = "PulseAudio enabled volume control featuring per-app sliders";
homepage = "https://buzz.github.io/volctl/";
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = [ maintainers.romildo ];
};
}