tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
python3Packages.soxr: 0.3.7 -> 0.5.0.post1
Martin Weinelt
1 year ago
67c3a115
2d713d2c
+51
-18
2 changed files
expand all
collapse all
unified
split
pkgs
development
python-modules
soxr
cmake-nanobind.patch
default.nix
+16
pkgs/development/python-modules/soxr/cmake-nanobind.patch
reviewed
···
1
1
+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2
2
+
index eb701aa..6cb4b02 100644
3
3
+
--- a/CMakeLists.txt
4
4
+
+++ b/CMakeLists.txt
5
5
+
@@ -32,6 +32,11 @@ find_package(Python 3.9
6
6
+
REQUIRED COMPONENTS Interpreter Development.Module
7
7
+
OPTIONAL_COMPONENTS Development.SABIModule)
8
8
+
9
9
+
+execute_process(
10
10
+
+ COMMAND "${Python_EXECUTABLE}" -m nanobind --cmake_dir
11
11
+
+ OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE NB_DIR)
12
12
+
+list(APPEND CMAKE_PREFIX_PATH "${NB_DIR}")
13
13
+
+
14
14
+
find_package(nanobind CONFIG REQUIRED)
15
15
+
16
16
+
if (USE_SYSTEM_LIBSOXR)
+35
-18
pkgs/development/python-modules/soxr/default.nix
reviewed
···
2
2
lib,
3
3
buildPythonPackage,
4
4
fetchFromGitHub,
5
5
+
pythonOlder,
5
6
6
7
# build-system
7
7
-
cython,
8
8
-
numpy,
9
9
-
oldest-supported-numpy,
8
8
+
cmake,
9
9
+
nanobind,
10
10
+
ninja,
11
11
+
scikit-build-core,
10
12
setuptools,
11
13
setuptools-scm,
12
12
-
gnutar,
14
14
+
typing-extensions,
13
15
14
14
-
# native
16
16
+
# native dependencies
15
17
libsoxr,
16
18
19
19
+
# dependencies
20
20
+
numpy,
21
21
+
17
22
# tests
18
23
pytestCheckHook,
19
24
}:
20
25
21
26
buildPythonPackage rec {
22
27
pname = "soxr";
23
23
-
version = "0.3.7";
24
24
-
format = "pyproject";
28
28
+
version = "0.5.0.post1";
29
29
+
pyproject = true;
25
30
26
31
src = fetchFromGitHub {
27
32
owner = "dofuuz";
28
33
repo = "python-soxr";
29
34
rev = "refs/tags/v${version}";
30
35
fetchSubmodules = true;
31
31
-
hash = "sha256-HGtoMfMQ5/2iEIFtik7mCrSxFnLXkSSx2W8wBul0+jk=";
36
36
+
hash = "sha256-Fpayc+MOpDUCdpoyJaIqSbMzuO0jYb6UN5ARFaxxOHk=";
32
37
};
33
38
34
34
-
postPatch = ''
35
35
-
substituteInPlace setup.py \
36
36
-
--replace "SYS_LIBSOXR = False" "SYS_LIBSOXR = True"
37
37
-
'';
39
39
+
patches = [ ./cmake-nanobind.patch ];
38
40
39
41
nativeBuildInputs = [
40
40
-
cython
41
41
-
gnutar
42
42
-
numpy
43
43
-
oldest-supported-numpy
44
44
-
setuptools
45
45
-
setuptools-scm
42
42
+
cmake
43
43
+
ninja
44
44
+
];
45
45
+
46
46
+
dontUseCmakeConfigure = true;
47
47
+
48
48
+
pypaBuildFlags = [
49
49
+
"--config=cmake.define.USE_SYSTEM_LIBSOXR=ON"
46
50
];
47
51
52
52
+
build-system =
53
53
+
[
54
54
+
scikit-build-core
55
55
+
nanobind
56
56
+
setuptools
57
57
+
setuptools-scm
58
58
+
]
59
59
+
++ lib.optionals (pythonOlder "3.11") [
60
60
+
typing-extensions
61
61
+
];
62
62
+
48
63
buildInputs = [ libsoxr ];
64
64
+
65
65
+
dependencies = [ numpy ];
49
66
50
67
pythonImportsCheck = [ "soxr" ];
51
68