about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/soxr/default.nix
blob: b000900d3a7b4b05c9248b188f42529225d11dab (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
, buildPythonPackage
, fetchFromGitHub

# build-system
, cython_3
, numpy
, oldest-supported-numpy
, setuptools
, setuptools-scm
, gnutar

# native
, libsoxr

# tests
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "soxr";
  version = "0.3.7";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "dofuuz";
    repo = "python-soxr";
    rev = "refs/tags/v${version}";
    fetchSubmodules = true;
    hash = "sha256-HGtoMfMQ5/2iEIFtik7mCrSxFnLXkSSx2W8wBul0+jk=";
  };

  postPatch = ''
    substituteInPlace setup.py \
      --replace "SYS_LIBSOXR = False" "SYS_LIBSOXR = True"
  '';

  nativeBuildInputs = [
    cython_3
    gnutar
    numpy
    oldest-supported-numpy
    setuptools
    setuptools-scm
  ];

  buildInputs = [
    libsoxr
  ];

  pythonImportsCheck = [
    "soxr"
  ];

  nativeCheckInputs = [
    pytestCheckHook
  ];

  meta = with lib; {
    description = "High quality, one-dimensional sample-rate conversion library";
    homepage = "https://github.com/dofuuz/python-soxr/tree/main";
    license = licenses.lgpl21Plus;
    maintainers = with maintainers; [ hexa ];
  };
}