1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchPypi,
6 isPy27,
7 setuptools,
8 cffi,
9 numpy,
10 portaudio,
11 replaceVars,
12}:
13
14buildPythonPackage rec {
15 pname = "sounddevice";
16 version = "0.5.2";
17 pyproject = true;
18 disabled = isPy27;
19
20 src = fetchPypi {
21 inherit pname version;
22 hash = "sha256-xjTVG9TpItbw+l4al1zIl8lH9h0x2p95un6jTf9Ei0k=";
23 };
24
25 build-system = [ setuptools ];
26
27 dependencies = [
28 cffi
29 numpy
30 portaudio
31 ];
32
33 nativeBuildInputs = [ cffi ];
34
35 # No tests included nor upstream available.
36 doCheck = false;
37
38 pythonImportsCheck = [ "sounddevice" ];
39
40 patches = [
41 (replaceVars ./fix-portaudio-library-path.patch {
42 portaudio = "${portaudio}/lib/libportaudio${stdenv.hostPlatform.extensions.sharedLibrary}";
43 })
44 ];
45
46 meta = {
47 description = "Play and Record Sound with Python";
48 homepage = "http://python-sounddevice.rtfd.org/";
49 license = with lib.licenses; [ mit ];
50 };
51}