2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
pytestCheckHook,
|
|
|
|
numpy,
|
|
|
|
libsndfile,
|
|
|
|
cffi,
|
|
|
|
isPyPy,
|
|
|
|
stdenv,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "soundfile";
|
2023-03-04 12:14:45 +00:00
|
|
|
version = "0.12.1";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2022-03-10 19:12:11 +00:00
|
|
|
# https://github.com/bastibe/python-soundfile/issues/157
|
2024-09-26 11:04:55 +00:00
|
|
|
disabled = isPyPy || stdenv.hostPlatform.isi686;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
2023-02-09 11:40:11 +00:00
|
|
|
inherit pname version;
|
2023-03-04 12:14:45 +00:00
|
|
|
hash = "sha256-6OEBeyzx3adnrvGdL9nuXr4H4FDUMPd6Cnxmugi4za4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
patches = [ ./0001-Fix-build-on-linux-arm64.patch ];
|
2023-03-04 12:14:45 +00:00
|
|
|
|
2022-03-10 19:12:11 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace soundfile.py --replace "_find_library('sndfile')" "'${libsndfile.out}/lib/libsndfile${stdenv.hostPlatform.extensions.sharedLibrary}'"
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
numpy
|
|
|
|
libsndfile
|
|
|
|
cffi
|
|
|
|
];
|
2022-03-10 19:12:11 +00:00
|
|
|
propagatedNativeBuildInputs = [ cffi ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-03-10 19:12:11 +00:00
|
|
|
meta = {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Audio library based on libsndfile, CFFI and NumPy";
|
2022-03-10 19:12:11 +00:00
|
|
|
license = lib.licenses.bsd3;
|
|
|
|
homepage = "https://github.com/bastibe/python-soundfile";
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|