From cf5d5a6f50ad7f592405777519281fd468e08e76 Mon Sep 17 00:00:00 2001 From: Zhong Jianxin Date: Thu, 24 Feb 2022 22:28:33 +0800 Subject: [PATCH 1/4] soundfile: Fix indent --- .../python-modules/soundfile/default.nix | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/pkgs/development/python-modules/soundfile/default.nix b/pkgs/development/python-modules/soundfile/default.nix index 9a1d614062b7..91d35a1bfec2 100644 --- a/pkgs/development/python-modules/soundfile/default.nix +++ b/pkgs/development/python-modules/soundfile/default.nix @@ -19,22 +19,22 @@ buildPythonPackage rec { sha256 = "0yqhrfz7xkvqrwdxdx2ydy4h467sk7z3gf984y1x2cq7cm1gy329"; }; - checkInputs = [ pytest ]; - propagatedBuildInputs = [ numpy libsndfile cffi ]; - propagatedNativeBuildInputs = [ cffi ]; + checkInputs = [ pytest ]; + propagatedBuildInputs = [ numpy libsndfile cffi ]; + propagatedNativeBuildInputs = [ 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 ]; - }; + 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 ]; + }; - postPatch = '' - substituteInPlace soundfile.py --replace "_find_library('sndfile')" "'${libsndfile.out}/lib/libsndfile${stdenv.hostPlatform.extensions.sharedLibrary}'" - ''; + postPatch = '' + substituteInPlace soundfile.py --replace "_find_library('sndfile')" "'${libsndfile.out}/lib/libsndfile${stdenv.hostPlatform.extensions.sharedLibrary}'" + ''; - # https://github.com/bastibe/PySoundFile/issues/157 - disabled = isPyPy || stdenv.isi686; + # https://github.com/bastibe/PySoundFile/issues/157 + disabled = isPyPy || stdenv.isi686; } From 955c24d11fca946d9ad33f003e2d4f1a261d5977 Mon Sep 17 00:00:00 2001 From: Zhong Jianxin Date: Wed, 5 Jan 2022 10:48:46 +0800 Subject: [PATCH 2/4] soundfile: Fix build on aarch64-darwin --- .../python-modules/soundfile/default.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/development/python-modules/soundfile/default.nix b/pkgs/development/python-modules/soundfile/default.nix index 91d35a1bfec2..f64dd6ec9b2f 100644 --- a/pkgs/development/python-modules/soundfile/default.nix +++ b/pkgs/development/python-modules/soundfile/default.nix @@ -1,6 +1,7 @@ { lib , buildPythonPackage , fetchPypi +, fetchpatch , pytest , numpy , libsndfile @@ -19,10 +20,22 @@ buildPythonPackage rec { sha256 = "0yqhrfz7xkvqrwdxdx2ydy4h467sk7z3gf984y1x2cq7cm1gy329"; }; + patches = [ + # Fix build on macOS arm64, https://github.com/bastibe/python-soundfile/pull/332 + (fetchpatch { + url = "https://github.com/bastibe/python-soundfile/commit/e554e9ce8bed96207d587e6aa661e4b08f1c6a79.patch"; + sha256 = "sha256-vu/7s5q4I3yBnoNHmmFmcXvOLFcPwY9ri9ri6cKLDwU="; + }) + ]; + checkInputs = [ pytest ]; propagatedBuildInputs = [ numpy libsndfile cffi ]; propagatedNativeBuildInputs = [ cffi ]; + # Test fails on aarch64-darwin with `MemoryError`, 53 failed, 31 errors, see + # https://github.com/bastibe/python-soundfile/issues/331 + doCheck = stdenv.system != "aarch64-darwin"; + meta = { description = "An audio library based on libsndfile, CFFI and NumPy"; license = lib.licenses.bsd3; From 3a8720c6cda7af879afdbf84af93a8b548aa19b3 Mon Sep 17 00:00:00 2001 From: Zhong Jianxin Date: Fri, 25 Feb 2022 21:44:28 +0800 Subject: [PATCH 3/4] soundfile: Reorder attributes and update homepage --- .../python-modules/soundfile/default.nix | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/soundfile/default.nix b/pkgs/development/python-modules/soundfile/default.nix index f64dd6ec9b2f..018312e52b48 100644 --- a/pkgs/development/python-modules/soundfile/default.nix +++ b/pkgs/development/python-modules/soundfile/default.nix @@ -13,6 +13,8 @@ buildPythonPackage rec { pname = "soundfile"; version = "0.10.3.post1"; + # https://github.com/bastibe/python-soundfile/issues/157 + disabled = isPyPy || stdenv.isi686; src = fetchPypi { pname = "SoundFile"; @@ -28,6 +30,10 @@ buildPythonPackage rec { }) ]; + postPatch = '' + substituteInPlace soundfile.py --replace "_find_library('sndfile')" "'${libsndfile.out}/lib/libsndfile${stdenv.hostPlatform.extensions.sharedLibrary}'" + ''; + checkInputs = [ pytest ]; propagatedBuildInputs = [ numpy libsndfile cffi ]; propagatedNativeBuildInputs = [ cffi ]; @@ -39,15 +45,7 @@ buildPythonPackage rec { meta = { description = "An audio library based on libsndfile, CFFI and NumPy"; license = lib.licenses.bsd3; - homepage = "https://github.com/bastibe/PySoundFile"; + homepage = "https://github.com/bastibe/python-soundfile"; maintainers = with lib.maintainers; [ fridh ]; }; - - postPatch = '' - substituteInPlace soundfile.py --replace "_find_library('sndfile')" "'${libsndfile.out}/lib/libsndfile${stdenv.hostPlatform.extensions.sharedLibrary}'" - ''; - - # https://github.com/bastibe/PySoundFile/issues/157 - disabled = isPyPy || stdenv.isi686; - } From cc7fe816c31d1a32fc1046e0e8b456a43cfdd6d7 Mon Sep 17 00:00:00 2001 From: Zhong Jianxin Date: Thu, 10 Mar 2022 20:40:44 +0800 Subject: [PATCH 4/4] soundfile: replace pytest with pytestCheckHook --- pkgs/development/python-modules/soundfile/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/soundfile/default.nix b/pkgs/development/python-modules/soundfile/default.nix index 018312e52b48..c1b68e61088e 100644 --- a/pkgs/development/python-modules/soundfile/default.nix +++ b/pkgs/development/python-modules/soundfile/default.nix @@ -2,7 +2,7 @@ , buildPythonPackage , fetchPypi , fetchpatch -, pytest +, pytestCheckHook , numpy , libsndfile , cffi @@ -34,7 +34,7 @@ buildPythonPackage rec { substituteInPlace soundfile.py --replace "_find_library('sndfile')" "'${libsndfile.out}/lib/libsndfile${stdenv.hostPlatform.extensions.sharedLibrary}'" ''; - checkInputs = [ pytest ]; + checkInputs = [ pytestCheckHook ]; propagatedBuildInputs = [ numpy libsndfile cffi ]; propagatedNativeBuildInputs = [ cffi ];