diff --git a/pkgs/development/python-modules/pysoundfile/default.nix b/pkgs/development/python-modules/pysoundfile/default.nix new file mode 100644 index 00000000000..fe24f0203f0 --- /dev/null +++ b/pkgs/development/python-modules/pysoundfile/default.nix @@ -0,0 +1,38 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pytest +, numpy +, libsndfile +, cffi +, isPyPy +, stdenv +}: + +buildPythonPackage rec { + pname = "PySoundFile"; + name = "PySoundFile-${version}"; + version = "0.8.1"; + + src = fetchPypi { + inherit pname version; + sha256 = "72c3e23b7c9998460ec78176084ea101e3439596ab29df476bc8508708df84df"; + }; + + checkInputs = [ pytest ]; + propagatedBuildInputs = [ numpy libsndfile cffi ]; + + meta = { + description = "An audio library based on libsndfile, CFFI and NumPy"; + license = lib.licenses.bsd3; + homepage = https://github.com/bastibe/PySoundFile; + maintainers = with lib.maintainers; [ fridh ]; + }; + + prePatch = '' + substituteInPlace soundfile.py --replace "'sndfile'" "'${libsndfile.out}/lib/libsndfile.so'" + ''; + + # https://github.com/bastibe/PySoundFile/issues/157 + disabled = isPyPy || stdenv.isi686; +} \ No newline at end of file diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 39234f5b969..124dc0c3885 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15491,32 +15491,7 @@ in { }; }; - pysoundfile = buildPythonPackage rec { - name = "pysoundfile-${version}"; - version = "0.8.1"; - - src = pkgs.fetchurl { - url = "mirror://pypi/P/PySoundFile/PySoundFile-${version}.tar.gz"; - sha256 = "72c3e23b7c9998460ec78176084ea101e3439596ab29df476bc8508708df84df"; - }; - - buildInputs = with self; [ pytest ]; - propagatedBuildInputs = with self; [ numpy pkgs.libsndfile cffi ]; - - meta = { - description = "An audio library based on libsndfile, CFFI and NumPy"; - license = licenses.bsd3; - homepage = https://github.com/bastibe/PySoundFile; - maintainers = with maintainers; [ fridh ]; - }; - - prePatch = '' - substituteInPlace soundfile.py --replace "'sndfile'" "'${pkgs.libsndfile.out}/lib/libsndfile.so'" - ''; - - # https://github.com/bastibe/PySoundFile/issues/157 - disabled = isPyPy || stdenv.isi686; - }; + pysoundfile = callPackage ../development/python-modules/pysoundfile { }; python3pika = buildPythonPackage { name = "python3-pika-0.9.14";