summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/soundfile/default.nix
blob: a2c86469efd92f9d293500a3ed3bd09f3d981ffd (plain)
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
{
  lib,
  buildPythonPackage,
  fetchPypi,
  setuptools,
  pytestCheckHook,
  numpy,
  libsndfile,
  cffi,
  isPyPy,
  stdenv,
}:

buildPythonPackage rec {
  pname = "soundfile";
  version = "0.13.1";
  pyproject = true;
  disabled = isPyPy;

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-ssaNqx4wKXMXCApbQ99X4wJYTEnilC3v3eCszMU/Dls=";
  };

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

  build-system = [
    setuptools
    cffi
  ];

  dependencies = [
    numpy
    cffi
  ];

  pythonImportsCheck = [ "soundfile" ];

  nativeCheckInputs = [ pytestCheckHook ];

  meta = {
    description = "Audio library based on libsndfile, CFFI and NumPy";
    license = lib.licenses.bsd3;
    homepage = "https://github.com/bastibe/python-soundfile";
    # https://github.com/bastibe/python-soundfile/issues/157
    broken = stdenv.hostPlatform.isi686;
  };
}