1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchpatch,
6 setuptools,
7 numpy,
8 pytestCheckHook,
9 stdenv,
10 darwin,
11}:
12
13buildPythonPackage rec {
14 pname = "aubio";
15 version = "0.4.9";
16 pyproject = true;
17
18 src = fetchFromGitHub {
19 owner = "aubio";
20 repo = "aubio";
21 rev = version;
22 hash = "sha256-RvzhB1kQNP0IbAygwH2RBi/kSyuFPAHgsiCATPeMHTo=";
23 };
24
25 patches = [
26 (fetchpatch {
27 # fix "incompatible function pointer types initializing 'PyUFuncGenericFunction'"
28 name = "const-function-signature.patch";
29 url = "https://github.com/aubio/aubio/commit/95ff046c698156f21e2ca0d1d8a02c23ab76969f.patch";
30 hash = "sha256-qKcIPjpcZUizSN/t96WOiOn+IlsrlC0+g7gW77KejH0=";
31 })
32 ];
33
34 buildInputs = lib.optionals stdenv.hostPlatform.isDarwin (
35 with darwin.apple_sdk.frameworks;
36 [
37 Accelerate
38 AudioToolbox
39 CoreVideo
40 CoreGraphics
41 ]
42 );
43
44 build-system = [ setuptools ];
45
46 dependencies = [ numpy ];
47
48 nativeCheckInputs = [ pytestCheckHook ];
49
50 pythonImportsCheck = [ "aubio" ];
51
52 meta = with lib; {
53 description = "Library for audio and music analysis";
54 homepage = "https://aubio.org";
55 license = licenses.gpl3;
56 maintainers = [ ];
57 };
58}