2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
setuptools,
|
|
|
|
pyaudio,
|
|
|
|
numpy,
|
|
|
|
libsndfile,
|
|
|
|
substituteAll,
|
2021-12-06 16:07:01 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "wavefile";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "1.6.2";
|
|
|
|
pyproject = true;
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "vokimon";
|
|
|
|
repo = "python-wavefile";
|
2024-01-13 08:15:51 +00:00
|
|
|
rev = "refs/tags/python-wavefile-${version}";
|
|
|
|
hash = "sha256-TLSWhLARY+3sHkl2p3d3LDGzLu6DggjTJWFpyrwRXSI=";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools ];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
pyaudio
|
|
|
|
libsndfile
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [ numpy ];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-12-06 16:07:01 +00:00
|
|
|
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
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "wavefile" ];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|