2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
isPy27,
|
|
|
|
cffi,
|
|
|
|
numpy,
|
|
|
|
portaudio,
|
|
|
|
substituteAll,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "sounddevice";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "0.4.7";
|
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;
|
2024-06-05 15:53:02 +00:00
|
|
|
hash = "sha256-abOGgY1QotUYYH1LlzRC6NUkdgx81si4vgPYyY/EvOc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
cffi
|
|
|
|
numpy
|
|
|
|
portaudio
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# 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 ];
|
|
|
|
};
|
|
|
|
}
|