nixpkgs/pkgs/tools/audio/volctl/default.nix

57 lines
1.5 KiB
Nix
Raw Normal View History

{ lib, python3Packages, fetchFromGitHub, wrapGAppsHook, gobject-introspection, libpulseaudio, glib, gtk3, pango, xorg }:
2019-12-19 15:05:27 +00:00
2020-11-28 01:58:06 +00:00
python3Packages.buildPythonApplication rec {
2019-12-19 15:05:27 +00:00
pname = "volctl";
2021-05-13 16:13:43 +00:00
version = "0.8.2";
2019-12-19 15:05:27 +00:00
src = fetchFromGitHub {
owner = "buzz";
repo = pname;
2020-11-28 01:58:06 +00:00
rev = "v${version}";
2021-05-13 16:13:43 +00:00
sha256 = "1cx27j83pz2qffnzb85fbl1x6pp3irv1kbw7g1hri7kaw6ky4xiz";
2019-12-19 15:05:27 +00:00
};
2020-11-28 01:58:06 +00:00
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
'';
2019-12-19 15:05:27 +00:00
nativeBuildInputs = [
gobject-introspection
wrapGAppsHook
];
2020-11-28 01:58:06 +00:00
propagatedBuildInputs = [ pango gtk3 ] ++ (with python3Packages; [
click
pycairo
2019-12-19 15:05:27 +00:00
pygobject3
2020-11-28 01:58:06 +00:00
pyyaml
]);
2019-12-19 15:05:27 +00:00
2020-11-28 01:58:06 +00:00
# with strictDeps importing "gi.repository.Gtk" fails with "gi.RepositoryError: Typelib file for namespace 'Pango', version '1.0' not found"
2019-12-19 15:05:27 +00:00
strictDeps = false;
2020-11-28 01:58:06 +00:00
# no tests included
doCheck = false;
pythonImportsCheck = [ "volctl" ];
2019-12-19 15:05:27 +00:00
preFixup = ''
glib-compile-schemas ${glib.makeSchemaPath "$out" "${pname}-${version}"}
2020-11-28 01:58:06 +00:00
gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : "${libpulseaudio}/lib")
2019-12-19 15:05:27 +00:00
'';
meta = with lib; {
2019-12-19 15:05:27 +00:00
description = "PulseAudio enabled volume control featuring per-app sliders";
2020-03-20 15:20:00 +00:00
homepage = "https://buzz.github.io/volctl/";
2019-12-19 15:05:27 +00:00
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = [ maintainers.romildo ];
};
}