3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/python-modules/symengine/default.nix
Robert Scott 6169b45fd4 python3Packages.symengine: 0.7.2 -> 0.8.1
patching out cython version requirement as their choice seems to have
been arbitrary ("the latest")
2021-09-14 21:40:20 +01:00

56 lines
1.2 KiB
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, cython
, cmake
, symengine
, pytest
, sympy
, python
}:
buildPythonPackage rec {
pname = "symengine";
version = "0.8.1";
src = fetchFromGitHub {
owner = "symengine";
repo = "symengine.py";
rev = "v${version}";
sha256 = "0yyi3w03fk19i32jmns1baq3rpmf7xfykzkivc7dmnxmjmxvq2gr";
};
postConfigure = ''
substituteInPlace setup.py \
--replace "\"cmake\"" "\"${cmake}/bin/cmake\"" \
--replace "'cython>=0.29.24'" "'cython'"
substituteInPlace cmake/FindCython.cmake \
--replace "SET(CYTHON_BIN cython" "SET(CYTHON_BIN ${cython}/bin/cython"
'';
nativeBuildUnputs = [ cmake ];
buildInputs = [ cython ];
checkInputs = [ 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 ];
};
}