1{
2 buildPythonPackage,
3 cffi,
4 fetchPypi,
5 lib,
6 libpulseaudio,
7 numpy,
8 setuptools,
9 testers,
10}:
11let
12 pname = "soundcard";
13 version = "0.4.5";
14in
15buildPythonPackage {
16 inherit pname version;
17 pyproject = true;
18
19 src = fetchPypi {
20 inherit pname version;
21 hash = "sha256-BycrqSfjLK/fY05KHKU7mjIYMhpgx9Lgj1S4MqVpRqo=";
22 };
23
24 patchPhase = ''
25 substituteInPlace soundcard/pulseaudio.py \
26 --replace "'pulse'" "'${libpulseaudio}/lib/libpulse.so'"
27 '';
28
29 build-system = [ setuptools ];
30
31 dependencies = [
32 cffi
33 numpy
34 ];
35
36 # doesn't work because there are not many soundcards in the
37 # sandbox. See VM-test
38 # pythonImportsCheck = [ "soundcard" ];
39
40 passthru.tests.vm-with-soundcard = testers.runNixOSTest ./test.nix;
41
42 meta = {
43 description = "Pure-Python Real-Time Audio Library";
44 homepage = "https://github.com/bastibe/SoundCard";
45 changelog = "https://github.com/bastibe/SoundCard/blob/${version}/README.rst#changelog";
46 license = lib.licenses.bsd3;
47 maintainers = with lib.maintainers; [ matthiasdotsh ];
48 };
49}