1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 libpulseaudio,
6 glibc,
7 replaceVars,
8 stdenv,
9 pulseaudio,
10 unittestCheckHook,
11}:
12
13buildPythonPackage rec {
14 pname = "pulsectl";
15 version = "24.12.0";
16 format = "setuptools";
17
18 src = fetchPypi {
19 inherit pname version;
20 hash = "sha256-KI1nFSMqxvPc2xI/vsqiwLmlDqQIfm6Hw/hBqwqKB/w=";
21 };
22
23 patches = [
24 # substitute library paths for libpulse and librt
25 (replaceVars ./library-paths.patch {
26 libpulse = "${libpulseaudio.out}/lib/libpulse${stdenv.hostPlatform.extensions.sharedLibrary}";
27 librt = "${glibc.out}/lib/librt${stdenv.hostPlatform.extensions.sharedLibrary}";
28 })
29 ];
30
31 pythonImportsCheck = [ "pulsectl" ];
32
33 nativeCheckInputs = [
34 unittestCheckHook
35 pulseaudio
36 ];
37
38 preCheck = ''
39 export HOME=$TMPDIR
40 '';
41
42 meta = with lib; {
43 description = "Python high-level interface and ctypes-based bindings for PulseAudio (libpulse)";
44 homepage = "https://github.com/mk-fg/python-pulse-control";
45 license = licenses.mit;
46 maintainers = with maintainers; [ hexa ];
47 };
48}