tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
python312Packages.symengine: fix build
Moraxyc
2 years ago
a3ca2bbf
25f5ac01
+37
-19
1 changed file
expand all
collapse all
unified
split
pkgs
development
python-modules
symengine
default.nix
+37
-19
pkgs/development/python-modules/symengine/default.nix
···
1
1
-
{ lib
2
2
-
, buildPythonPackage
3
3
-
, fetchFromGitHub
4
4
-
, cython
5
5
-
, cmake
6
6
-
, symengine
7
7
-
, pytest
8
8
-
, sympy
9
9
-
, python
1
1
+
{
2
2
+
lib,
3
3
+
buildPythonPackage,
4
4
+
fetchFromGitHub,
5
5
+
fetchpatch,
6
6
+
cython,
7
7
+
cmake,
8
8
+
symengine,
9
9
+
pytest,
10
10
+
sympy,
11
11
+
python,
12
12
+
setuptools,
10
13
}:
11
14
12
15
buildPythonPackage rec {
13
16
pname = "symengine";
14
17
version = "0.11.0";
15
15
-
format = "setuptools";
18
18
+
19
19
+
build-system = [ setuptools ];
20
20
+
pyproject = true;
16
21
17
22
src = fetchFromGitHub {
18
23
owner = "symengine";
···
21
26
hash = "sha256-uUMcNnynE2itIwc7IGFwxveqLRL8f4dAAcaD6FUWJaY=";
22
27
};
23
28
29
29
+
env = {
30
30
+
SymEngine_DIR = "${symengine}";
31
31
+
};
32
32
+
33
33
+
patches = [
34
34
+
# Distutils has been removed in python 3.12
35
35
+
# See https://github.com/symengine/symengine.py/pull/478
36
36
+
(fetchpatch {
37
37
+
name = "no-distutils.patch";
38
38
+
url = "https://github.com/symengine/symengine.py/pull/478/commits/e72006d5f7425cd50c54b22766e0ed4bcd2dca85.patch";
39
39
+
hash = "sha256-kGJRGkBgxOfI1wf88JwnSztkOYd1wvg62H7wA6CcYEQ=";
40
40
+
})
41
41
+
];
42
42
+
24
43
postPatch = ''
25
44
substituteInPlace setup.py \
26
26
-
--replace "\"cmake\"" "\"${cmake}/bin/cmake\"" \
27
27
-
--replace "'cython>=0.29.24'" "'cython'"
45
45
+
--replace-fail "\"cmake\"" "\"${lib.getExe' cmake "cmake"}\"" \
46
46
+
--replace-fail "'cython>=0.29.24'" "'cython'"
47
47
+
48
48
+
export PATH=${cython}/bin:$PATH
28
49
'';
29
50
30
51
nativeBuildUnputs = [ cmake ];
31
52
32
53
buildInputs = [ cython ];
33
54
34
34
-
nativeCheckInputs = [ pytest sympy ];
35
35
-
36
36
-
setupPyBuildFlags = [
37
37
-
"--symengine-dir=${symengine}/"
38
38
-
"--define=\"CYTHON_BIN=${cython}/bin/cython\""
55
55
+
nativeCheckInputs = [
56
56
+
pytest
57
57
+
sympy
39
58
];
40
59
41
60
checkPhase = ''
42
42
-
mkdir empty
43
43
-
cd empty
61
61
+
mkdir empty && cd empty
44
62
${python.interpreter} ../bin/test_python.py
45
63
'';
46
64