1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 setuptools,
7 pyaudio,
8 numpy,
9 libsndfile,
10 substituteAll,
11}:
12
13buildPythonPackage rec {
14 pname = "wavefile";
15 version = "1.6.2";
16 pyproject = true;
17
18 src = fetchFromGitHub {
19 owner = "vokimon";
20 repo = "python-wavefile";
21 rev = "refs/tags/python-wavefile-${version}";
22 hash = "sha256-TLSWhLARY+3sHkl2p3d3LDGzLu6DggjTJWFpyrwRXSI=";
23 };
24
25 nativeBuildInputs = [ setuptools ];
26
27 buildInputs = [
28 pyaudio
29 libsndfile
30 ];
31
32 propagatedBuildInputs = [ numpy ];
33
34 nativeCheckInputs = [
35 pyaudio
36 numpy
37 libsndfile
38 ];
39
40 patches = [
41 # Fix check error
42 # OSError: libsndfile.so.1: cannot open shared object file: No such file or directory
43 (substituteAll {
44 src = ./libsndfile.py.patch;
45 libsndfile = "${lib.getLib libsndfile}/lib/libsndfile${stdenv.hostPlatform.extensions.sharedLibrary}";
46 })
47 ];
48
49 doCheck = false; # all test files (test/wavefileTest.py) are failing
50
51 pythonImportsCheck = [ "wavefile" ];
52
53 meta = with lib; {
54 description = "Pythonic libsndfile wrapper to read and write audio files";
55 homepage = "https://github.com/vokimon/python-wavefile";
56 changelog = "https://github.com/vokimon/python-wavefile#version-history";
57 maintainers = with maintainers; [ yuu ];
58 license = licenses.gpl3Plus;
59 };
60}