2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2022-03-10 19:12:11 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, numpy
|
|
|
|
, libsndfile
|
|
|
|
, cffi
|
|
|
|
, isPyPy
|
|
|
|
, stdenv
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "soundfile";
|
2023-03-04 12:14:45 +00:00
|
|
|
version = "0.12.1";
|
2022-03-10 19:12:11 +00:00
|
|
|
# https://github.com/bastibe/python-soundfile/issues/157
|
|
|
|
disabled = isPyPy || stdenv.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
|
|
|
};
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
patches = [
|
|
|
|
./0001-Fix-build-on-linux-arm64.patch
|
|
|
|
];
|
|
|
|
|
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 ];
|
2022-03-10 19:12:11 +00:00
|
|
|
propagatedBuildInputs = [ numpy libsndfile cffi ];
|
|
|
|
propagatedNativeBuildInputs = [ cffi ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-03-10 19:12:11 +00:00
|
|
|
meta = {
|
|
|
|
description = "An audio library based on libsndfile, CFFI and NumPy";
|
|
|
|
license = lib.licenses.bsd3;
|
|
|
|
homepage = "https://github.com/bastibe/python-soundfile";
|
|
|
|
maintainers = with lib.maintainers; [ fridh ];
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|