1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 setuptools,
7 pyaudio,
8 numpy,
9 libsndfile,
10 replaceVars,
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 tag = "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 (replaceVars ./libsndfile.py.patch {
44 libsndfile = "${lib.getLib libsndfile}/lib/libsndfile${stdenv.hostPlatform.extensions.sharedLibrary}";
45 })
46 ];
47
48 doCheck = false; # all test files (test/wavefileTest.py) are failing
49
50 pythonImportsCheck = [ "wavefile" ];
51
52 meta = with lib; {
53 description = "Pythonic libsndfile wrapper to read and write audio files";
54 homepage = "https://github.com/vokimon/python-wavefile";
55 changelog = "https://github.com/vokimon/python-wavefile#version-history";
56 maintainers = with maintainers; [ ];
57 license = licenses.gpl3Plus;
58 };
59}