depot/third_party/nixpkgs/pkgs/development/python-modules/soundcard/default.nix
Default email 159e378cbb Project import generated by Copybara.
GitOrigin-RevId: c04d5652cfa9742b1d519688f65d1bbccea9eb7e
2024-09-19 17:19:46 +03:00

50 lines
1.1 KiB
Nix

{
buildPythonPackage,
cffi,
fetchPypi,
lib,
libpulseaudio,
numpy,
setuptools,
testers,
}:
let
version = "0.4.3";
in
buildPythonPackage {
inherit version;
pname = "soundcard";
pyproject = true;
src = fetchPypi {
inherit version;
pname = "SoundCard";
hash = "sha256-QQg1UUuhCAmAPLmIfUJw85K1nq82WRW7lFFq8/ix0Dc=";
};
patchPhase = ''
substituteInPlace soundcard/pulseaudio.py \
--replace "'pulse'" "'${libpulseaudio}/lib/libpulse.so'"
'';
build-system = [ setuptools ];
dependencies = [
cffi
numpy
];
# doesn't work because there are not many soundcards in the
# sandbox. See VM-test
# pythonImportsCheck = [ "soundcard" ];
passthru.tests.vm-with-soundcard = testers.runNixOSTest ./test.nix;
meta = {
description = "Pure-Python Real-Time Audio Library";
homepage = "https://github.com/bastibe/SoundCard";
changelog = "https://github.com/bastibe/SoundCard/blob/${version}/README.rst#changelog";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ matthiasdotsh ];
};
}