summary refs log tree commit diff
path: root/pkgs/development/python-modules/soundfile/default.nix
blob: ff11e75a0de1365c757b6b72bf7375e11c80f47c (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
{ lib
, buildPythonPackage
, fetchPypi
, pytest
, numpy
, libsndfile
, cffi
, isPyPy
, stdenv
}:

buildPythonPackage rec {
  pname = "soundfile";
  version = "0.10.3.post1";

  src = fetchPypi {
    pname = "SoundFile";
    inherit version;
    sha256 = "0yqhrfz7xkvqrwdxdx2ydy4h467sk7z3gf984y1x2cq7cm1gy329";
  };

    checkInputs = [ pytest ];
    propagatedBuildInputs = [ numpy libsndfile cffi ];

    meta = {
      description = "An audio library based on libsndfile, CFFI and NumPy";
      license = lib.licenses.bsd3;
      homepage = https://github.com/bastibe/PySoundFile;
      maintainers = with lib.maintainers; [ fridh ];
    };

    postPatch = ''
      substituteInPlace soundfile.py --replace "_find_library('sndfile')" "'${libsndfile.out}/lib/libsndfile${stdenv.hostPlatform.extensions.sharedLibrary}'"
    '';

    # https://github.com/bastibe/PySoundFile/issues/157
    disabled = isPyPy ||  stdenv.isi686;

}