depot/third_party/nixpkgs/pkgs/development/python-modules/pulsectl/default.nix
Default email 472aeafc57 Project import generated by Copybara.
GitOrigin-RevId: c31898adf5a8ed202ce5bea9f347b1c6871f32d1
2024-10-04 18:56:33 +02:00

49 lines
1.1 KiB
Nix

{
lib,
buildPythonPackage,
fetchPypi,
libpulseaudio,
glibc,
substituteAll,
stdenv,
pulseaudio,
unittestCheckHook,
}:
buildPythonPackage rec {
pname = "pulsectl";
version = "24.8.0";
format = "setuptools";
src = fetchPypi {
inherit pname version;
hash = "sha256-sFFQbQ1z08xDV879PeF7uFnX7PAE6ZSw98+oeFG8cVY=";
};
patches = [
# substitute library paths for libpulse and librt
(substituteAll {
src = ./library-paths.patch;
libpulse = "${libpulseaudio.out}/lib/libpulse${stdenv.hostPlatform.extensions.sharedLibrary}";
librt = "${glibc.out}/lib/librt${stdenv.hostPlatform.extensions.sharedLibrary}";
})
];
pythonImportsCheck = [ "pulsectl" ];
nativeCheckInputs = [
unittestCheckHook
pulseaudio
];
preCheck = ''
export HOME=$TMPDIR
'';
meta = with lib; {
description = "Python high-level interface and ctypes-based bindings for PulseAudio (libpulse)";
homepage = "https://github.com/mk-fg/python-pulse-control";
license = licenses.mit;
maintainers = with maintainers; [ hexa ];
};
}