1{ lib, buildPythonPackage, fetchPypi, libpulseaudio, glibc, substituteAll, stdenv, pulseaudio, unittestCheckHook }:
2
3buildPythonPackage rec {
4 pname = "pulsectl";
5 version = "22.3.2";
6
7 src = fetchPypi {
8 inherit pname version;
9 sha256 = "sha256-zBdOHO69TmIixbePT0FfEugHU8mrdas1QVm0y1lQsIQ=";
10 };
11
12 patches = [
13 # substitute library paths for libpulse and librt
14 (substituteAll {
15 src = ./library-paths.patch;
16 libpulse = "${libpulseaudio.out}/lib/libpulse${stdenv.hostPlatform.extensions.sharedLibrary}";
17 librt = "${glibc.out}/lib/librt${stdenv.hostPlatform.extensions.sharedLibrary}";
18 })
19 ];
20
21 pythonImportsCheck = [
22 "pulsectl"
23 ];
24
25 checkInputs = [ unittestCheckHook pulseaudio ];
26
27 preCheck = ''
28 export HOME=$TMPDIR
29 '';
30
31 meta = with lib; {
32 description = "Python high-level interface and ctypes-based bindings for PulseAudio (libpulse)";
33 homepage = "https://pypi.python.org/pypi/pulsectl/";
34 license = licenses.mit;
35 maintainers = with maintainers; [ hexa ];
36 };
37}