1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, cython
5, cmake
6, symengine
7, pytest
8, sympy
9, python
10}:
11
12buildPythonPackage rec {
13 pname = "symengine";
14 version = "0.4.0";
15
16 src = fetchFromGitHub {
17 owner = "symengine";
18 repo = "symengine.py";
19 rev = "v${version}";
20 sha256 = "07i9rwxphi4zgwc7y6f6qvq73iym2cx4k1bpd7rmd3wkpgrrfxqx";
21 };
22
23 postConfigure = ''
24 substituteInPlace setup.py \
25 --replace "\"cmake\"" "\"${cmake}/bin/cmake\""
26
27 substituteInPlace cmake/FindCython.cmake \
28 --replace "SET(CYTHON_BIN cython" "SET(CYTHON_BIN ${cython}/bin/cython"
29 '';
30
31 buildInputs = [ cython cmake ];
32
33 checkInputs = [ pytest sympy ];
34
35 setupPyBuildFlags = [
36 "--symengine-dir=${symengine}/"
37 "--define=\"CYTHON_BIN=${cython}/bin/cython\""
38 ];
39
40 checkPhase = ''
41 mkdir empty
42 cd empty
43 ${python.interpreter} ../bin/test_python.py
44 '';
45
46 meta = with lib; {
47 description = "Python library providing wrappers to SymEngine";
48 homepage = "https://github.com/symengine/symengine.py";
49 license = licenses.mit;
50 maintainers = [ maintainers.costrouc ];
51 broken = true;
52 };
53}