Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / symengine / default.nix
blob599b2e74566bc10b6ccaa9a58369ecb5c90a9f27
1 { lib
2 , buildPythonPackage
3 , fetchFromGitHub
4 , cython
5 , cmake
6 , symengine
7 , pytest
8 , sympy
9 , python
12 buildPythonPackage rec {
13   pname = "symengine";
14   version = "0.10.0";
15   format = "setuptools";
17   src = fetchFromGitHub {
18     owner = "symengine";
19     repo = "symengine.py";
20     rev = "refs/tags/v${version}";
21     hash = "sha256-03lHip0iExfptrUe5ObA6xXrsfS4QJPrh1Z0v7q2lDI=";
22   };
24   postPatch = ''
25     substituteInPlace setup.py \
26       --replace "\"cmake\"" "\"${cmake}/bin/cmake\"" \
27       --replace "'cython>=0.29.24'" "'cython'"
28   '';
30   nativeBuildUnputs = [ cmake ];
32   buildInputs = [ cython ];
34   nativeCheckInputs = [ pytest sympy ];
36   setupPyBuildFlags = [
37     "--symengine-dir=${symengine}/"
38     "--define=\"CYTHON_BIN=${cython}/bin/cython\""
39   ];
41   checkPhase = ''
42     mkdir empty
43     cd empty
44     ${python.interpreter} ../bin/test_python.py
45   '';
47   meta = with lib; {
48     description = "Python library providing wrappers to SymEngine";
49     homepage = "https://github.com/symengine/symengine.py";
50     license = licenses.mit;
51     maintainers = [ ];
52   };