nixpkgs/pkgs/development/python-modules/symengine/default.nix
Guillaume Girol 33afbf39f6 treewide: switch to nativeCheckInputs
checkInputs used to be added to nativeBuildInputs. Now we have
nativeCheckInputs to do that instead. Doing this treewide change allows
to keep hashes identical to before the introduction of
nativeCheckInputs.
2023-01-21 12:00:00 +00:00

63 lines
1.3 KiB
Nix

{ lib
, buildPythonPackage
, fetchpatch
, fetchFromGitHub
, cython
, cmake
, symengine
, pytest
, sympy
, python
}:
buildPythonPackage rec {
pname = "symengine";
version = "0.9.2";
format = "setuptools";
src = fetchFromGitHub {
owner = "symengine";
repo = "symengine.py";
rev = "v${version}";
sha256 = "sha256-ZHplYEG97foy/unOdSokFFkDl4LK5TI4kypHSLpcCM4=";
};
patches = [
(fetchpatch {
# setuptools 61 compat
url = "https://github.com/symengine/symengine.py/commit/987e665e71cf92d1b021d7d573a1b9733408eecf.patch";
hash = "sha256-2QbNdw/lKYRIRpOU5BiwF2kK+5Lh2j/Q82MKUIvl0+c=";
})
];
postPatch = ''
substituteInPlace setup.py \
--replace "\"cmake\"" "\"${cmake}/bin/cmake\"" \
--replace "'cython>=0.29.24'" "'cython'"
'';
nativeBuildUnputs = [ cmake ];
buildInputs = [ cython ];
nativeCheckInputs = [ pytest sympy ];
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;
maintainers = [ maintainers.costrouc ];
};
}