mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-16 09:03:42 +00:00
python312Packages.symengine: fix build
This commit is contained in:
parent
25f5ac0100
commit
a3ca2bbfc4
@ -1,18 +1,23 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchFromGitHub
|
||||
, cython
|
||||
, cmake
|
||||
, symengine
|
||||
, pytest
|
||||
, sympy
|
||||
, python
|
||||
{
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
fetchFromGitHub,
|
||||
fetchpatch,
|
||||
cython,
|
||||
cmake,
|
||||
symengine,
|
||||
pytest,
|
||||
sympy,
|
||||
python,
|
||||
setuptools,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "symengine";
|
||||
version = "0.11.0";
|
||||
format = "setuptools";
|
||||
|
||||
build-system = [ setuptools ];
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "symengine";
|
||||
@ -21,26 +26,39 @@ buildPythonPackage rec {
|
||||
hash = "sha256-uUMcNnynE2itIwc7IGFwxveqLRL8f4dAAcaD6FUWJaY=";
|
||||
};
|
||||
|
||||
env = {
|
||||
SymEngine_DIR = "${symengine}";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Distutils has been removed in python 3.12
|
||||
# See https://github.com/symengine/symengine.py/pull/478
|
||||
(fetchpatch {
|
||||
name = "no-distutils.patch";
|
||||
url = "https://github.com/symengine/symengine.py/pull/478/commits/e72006d5f7425cd50c54b22766e0ed4bcd2dca85.patch";
|
||||
hash = "sha256-kGJRGkBgxOfI1wf88JwnSztkOYd1wvg62H7wA6CcYEQ=";
|
||||
})
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace setup.py \
|
||||
--replace "\"cmake\"" "\"${cmake}/bin/cmake\"" \
|
||||
--replace "'cython>=0.29.24'" "'cython'"
|
||||
--replace-fail "\"cmake\"" "\"${lib.getExe' cmake "cmake"}\"" \
|
||||
--replace-fail "'cython>=0.29.24'" "'cython'"
|
||||
|
||||
export PATH=${cython}/bin:$PATH
|
||||
'';
|
||||
|
||||
nativeBuildUnputs = [ cmake ];
|
||||
|
||||
buildInputs = [ cython ];
|
||||
|
||||
nativeCheckInputs = [ pytest sympy ];
|
||||
|
||||
setupPyBuildFlags = [
|
||||
"--symengine-dir=${symengine}/"
|
||||
"--define=\"CYTHON_BIN=${cython}/bin/cython\""
|
||||
nativeCheckInputs = [
|
||||
pytest
|
||||
sympy
|
||||
];
|
||||
|
||||
checkPhase = ''
|
||||
mkdir empty
|
||||
cd empty
|
||||
mkdir empty && cd empty
|
||||
${python.interpreter} ../bin/test_python.py
|
||||
'';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user