2019-04-15 23:10:47 +02:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2019-04-15 23:12:04 +02:00
|
|
|
, fetchFromGitHub
|
2019-04-15 23:10:47 +02:00
|
|
|
, cython
|
|
|
|
, cmake
|
|
|
|
, symengine
|
2019-04-15 23:12:04 +02:00
|
|
|
, pytest
|
|
|
|
, sympy
|
|
|
|
, python
|
2019-04-15 23:10:47 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "symengine";
|
2019-04-15 23:12:04 +02:00
|
|
|
version = "0.4.0";
|
2019-04-15 23:10:47 +02:00
|
|
|
|
2019-04-15 23:12:04 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "symengine";
|
|
|
|
repo = "symengine.py";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "07i9rwxphi4zgwc7y6f6qvq73iym2cx4k1bpd7rmd3wkpgrrfxqx";
|
2019-04-15 23:10:47 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
postConfigure = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "\"cmake\"" "\"${cmake}/bin/cmake\""
|
|
|
|
|
|
|
|
substituteInPlace cmake/FindCython.cmake \
|
|
|
|
--replace "SET(CYTHON_BIN cython" "SET(CYTHON_BIN ${cython}/bin/cython"
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [ cython cmake ];
|
|
|
|
|
2019-04-15 23:12:04 +02:00
|
|
|
checkInputs = [ pytest sympy ];
|
|
|
|
|
|
|
|
setupPyBuildFlags = [
|
|
|
|
"--symengine-dir=${symengine}/"
|
|
|
|
"--define=\"CYTHON_BIN=${cython}/bin/cython\""
|
|
|
|
];
|
2019-04-15 23:10:47 +02:00
|
|
|
|
|
|
|
checkPhase = ''
|
2019-04-15 23:12:04 +02:00
|
|
|
mkdir empty
|
|
|
|
cd empty
|
|
|
|
${python.interpreter} ../bin/test_python.py
|
2019-04-15 23:10:47 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python library providing wrappers to SymEngine";
|
|
|
|
homepage = https://github.com/symengine/symengine.py;
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.costrouc ];
|
|
|
|
};
|
|
|
|
}
|