about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/wavefile/default.nix
blob: 4ced79638a82688eb1c9b13f835bde13786a557a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{ lib
, stdenv
, buildPythonPackage
, fetchFromGitHub
, setuptools
, pyaudio
, numpy
, libsndfile
, substituteAll
}:

buildPythonPackage rec {
  pname = "wavefile";
  version = "1.5";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "vokimon";
    repo = "python-wavefile";
    rev = "python-wavefile-${version}";
    sha256 = "9sHj1gb93mCVpejRGSdLJzeFDCeTflZctE7kMWfqFrE=";
  };

  nativeBuildInputs = [
    setuptools
  ];

  buildInputs = [
    pyaudio
    libsndfile
  ];

  propagatedBuildInputs = [
    numpy
  ];

  nativeCheckInputs = [
    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;
  };
}