python3Packages.wavefile: init at 1.5

Co-authored-by: Jonathan Ringer <jonringer117@gmail.com>
Co-authored-by: Sandro Jäckel <sandro.jaeckel@gmail.com>
Co-authored-by: Thiago K. Okada <thiagokokada@gmail.com>
This commit is contained in:
yuu 2021-11-09 10:31:22 -03:00
parent 331c462c8d
commit 5fd4c742d8
No known key found for this signature in database
GPG Key ID: 416F303B43C20AC3
3 changed files with 84 additions and 0 deletions

View File

@ -0,0 +1,64 @@
{ lib
, stdenv
, buildPythonPackage
, fetchFromGitHub
, setuptools
, pyaudio
, numpy
, libsndfile
, substituteAll
}:
buildPythonPackage rec {
pname = "wavefile";
version = "1.5";
src = fetchFromGitHub {
owner = "vokimon";
repo = "python-wavefile";
rev = "python-wavefile-${version}";
sha256 = "9sHj1gb93mCVpejRGSdLJzeFDCeTflZctE7kMWfqFrE=";
};
nativeBuildInputs = [
setuptools
];
buildInputs = [
pyaudio
libsndfile
];
propagatedBuildInputs = [
numpy
];
checkInputs = [
pyaudio
numpy
libsndfile
];
patches = [
# Fix check error
# OSError: libsndfile.so.1: cannot open shared object file: No such file or directory
(substituteAll {
src = ./libsndfile.py.patch;
libsndfile = "${lib.getLib libsndfile}/lib/libsndfile${stdenv.hostPlatform.extensions.sharedLibrary}";
})
];
doCheck = false; # all test files (test/wavefileTest.py) are failing
pythonImportsCheck = [
"wavefile"
];
meta = with lib; {
description = "Pythonic libsndfile wrapper to read and write audio files";
homepage = "https://github.com/vokimon/python-wavefile";
changelog = "https://github.com/vokimon/python-wavefile#version-history";
maintainers = with maintainers; [ yuu ];
license = licenses.gpl3Plus;
};
}

View File

@ -0,0 +1,18 @@
diff --git a/wavefile/libsndfile.py b/wavefile/libsndfile.py
index 67f0a46..ce066ee 100644
--- a/wavefile/libsndfile.py
+++ b/wavefile/libsndfile.py
@@ -19,11 +19,11 @@ import numpy as np
if sys.platform == "win32":
dllName = 'libsndfile-1'
elif "linux" in sys.platform:
- dllName = 'libsndfile.so.1'
+ dllName = '@libsndfile@'
elif "cygwin" in sys.platform:
dllName = 'libsndfile-1.dll'
elif "darwin" in sys.platform:
- dllName = 'libsndfile.dylib'
+ dllName = '@libsndfile@'
else:
dllName = 'libsndfile'

View File

@ -9782,6 +9782,8 @@ in {
wavedrom = callPackage ../development/python-modules/wavedrom { };
wavefile = callPackage ../development/python-modules/wavefile { };
wazeroutecalculator = callPackage ../development/python-modules/wazeroutecalculator { };
wcmatch = callPackage ../development/python-modules/wcmatch { };