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