1{ lib, buildPythonPackage, fetchPypi, libpulseaudio, glibc, substituteAll, stdenv, pulseaudio, python }:
2
3buildPythonPackage rec {
4 pname = "pulsectl";
5 version = "20.5.1";
6
7 src = fetchPypi {
8 inherit pname version;
9 sha256 = "39b0a0e7974a7d6468d826a838822f78b00ac9c3803f0d7bfa9b1cad08ee22db";
10 };
11
12 patches = [
13 (substituteAll {
14 src = ./library-paths.patch;
15 libpulse = "${libpulseaudio.out}/lib/libpulse${stdenv.hostPlatform.extensions.sharedLibrary}";
16 librt = "${glibc.out}/lib/librt${stdenv.hostPlatform.extensions.sharedLibrary}";
17 })
18 ];
19
20 checkInputs = [ pulseaudio ];
21 checkPhase = ''
22 ${python.interpreter} -m unittest pulsectl.tests.all
23 '';
24
25 meta = with lib; {
26 description = "Python high-level interface and ctypes-based bindings for PulseAudio (libpulse)";
27 homepage = "https://pypi.python.org/pypi/pulsectl/";
28 license = licenses.mit;
29 maintainers = with maintainers; [ hexa ];
30 };
31}