2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
2022-01-13 20:06:32 +00:00
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2020-09-25 04:45:31 +00:00
|
|
|
, isPy27
|
2020-04-24 23:36:52 +00:00
|
|
|
, cffi
|
|
|
|
, numpy
|
|
|
|
, portaudio
|
|
|
|
, substituteAll
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "sounddevice";
|
2023-03-04 12:14:45 +00:00
|
|
|
version = "0.4.6";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2020-09-25 04:45:31 +00:00
|
|
|
disabled = isPy27;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-Mja3jxXwQVvfAGpiDO8HPQwFIoUdZvSpYe1tjrFIL+k=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ cffi numpy portaudio ];
|
|
|
|
|
|
|
|
# No tests included nor upstream available.
|
|
|
|
doCheck = false;
|
|
|
|
|
2021-08-27 14:25:00 +00:00
|
|
|
pythonImportsCheck = [ "sounddevice" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./fix-portaudio-library-path.patch;
|
2022-01-13 20:06:32 +00:00
|
|
|
portaudio = "${portaudio}/lib/libportaudio${stdenv.hostPlatform.extensions.sharedLibrary}";
|
2020-04-24 23:36:52 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Play and Record Sound with Python";
|
|
|
|
homepage = "http://python-sounddevice.rtfd.org/";
|
|
|
|
license = with lib.licenses; [ mit ];
|
|
|
|
};
|
|
|
|
}
|