1{ lib, buildPythonPackage, fetchPypi, libpulseaudio, glibc, substituteAll, stdenv, pulseaudio, python }:
2
3buildPythonPackage rec {
4 pname = "pulsectl";
5 version = "21.10.5";
6
7 src = fetchPypi {
8 inherit pname version;
9 sha256 = "b347983fb78baab168f4dc4804ab2c59ca5b813bf62f8146dfb5fcb6ab6c8ba2";
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 = [ pulseaudio ];
26
27 checkPhase = ''
28 export HOME=$TMPDIR
29 ${python.interpreter} -m unittest discover
30 '';
31
32 meta = with lib; {
33 description = "Python high-level interface and ctypes-based bindings for PulseAudio (libpulse)";
34 homepage = "https://pypi.python.org/pypi/pulsectl/";
35 license = licenses.mit;
36 maintainers = with maintainers; [ hexa ];
37 };
38}