2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2022-04-27 09:35:20 +00:00
|
|
|
, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, cython
|
|
|
|
, cmake
|
|
|
|
, symengine
|
|
|
|
, pytest
|
|
|
|
, sympy
|
|
|
|
, python
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "symengine";
|
2022-03-30 09:31:56 +00:00
|
|
|
version = "0.9.2";
|
2022-04-27 09:35:20 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "symengine";
|
|
|
|
repo = "symengine.py";
|
|
|
|
rev = "v${version}";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-ZHplYEG97foy/unOdSokFFkDl4LK5TI4kypHSLpcCM4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
# setuptools 61 compat
|
|
|
|
url = "https://github.com/symengine/symengine.py/commit/987e665e71cf92d1b021d7d573a1b9733408eecf.patch";
|
|
|
|
hash = "sha256-2QbNdw/lKYRIRpOU5BiwF2kK+5Lh2j/Q82MKUIvl0+c=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
substituteInPlace setup.py \
|
2021-09-22 15:38:15 +00:00
|
|
|
--replace "\"cmake\"" "\"${cmake}/bin/cmake\"" \
|
|
|
|
--replace "'cython>=0.29.24'" "'cython'"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2020-11-30 08:33:03 +00:00
|
|
|
nativeBuildUnputs = [ cmake ];
|
|
|
|
|
|
|
|
buildInputs = [ cython ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytest sympy ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
setupPyBuildFlags = [
|
|
|
|
"--symengine-dir=${symengine}/"
|
|
|
|
"--define=\"CYTHON_BIN=${cython}/bin/cython\""
|
|
|
|
];
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
mkdir empty
|
|
|
|
cd empty
|
|
|
|
${python.interpreter} ../bin/test_python.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python library providing wrappers to SymEngine";
|
|
|
|
homepage = "https://github.com/symengine/symengine.py";
|
|
|
|
license = licenses.mit;
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|