1{ lib, buildPythonPackage, fetchPypi, libpulseaudio, glibc, substituteAll, stdenv, pulseaudio, unittestCheckHook }: 2 3buildPythonPackage rec { 4 pname = "pulsectl"; 5 version = "23.5.2"; 6 7 src = fetchPypi { 8 inherit pname version; 9 hash = "sha256-6RHTmOrwU5zzxjtCFzV7UaPRt+SlBgfRWRzytJ9dLGo="; 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 nativeCheckInputs = [ 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://github.com/mk-fg/python-pulse-control"; 34 license = licenses.mit; 35 maintainers = with maintainers; [ hexa ]; 36 }; 37}