1{ stdenv
2, bootstrapped-pip
3, buildPythonPackage
4, python
5, fetchPypi
6, pari
7, gmp
8, cython
9, cysignals
10}:
11
12buildPythonPackage rec {
13 pname = "cypari2";
14 version = "1.2.1";
15
16 src = fetchPypi {
17 inherit pname version;
18 sha256 = "0v2kikwf0advq8j76nwzhlacwj1yys9cvajm4fqgmasjdsnf1q4k";
19 };
20
21 # This differs slightly from the default python installPhase in that it pip-installs
22 # "." instead of "*.whl".
23 # That is because while the default install phase succeeds to build the package,
24 # it fails to generate the file "auto_paridecl.pxd".
25 installPhase = ''
26 mkdir -p "$out/lib/${python.libPrefix}/site-packages"
27 export PYTHONPATH="$out/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
28
29 # install "." instead of "*.whl"
30 ${bootstrapped-pip}/bin/pip install --no-index --prefix=$out --no-cache --build=tmpdir .
31 '';
32
33 buildInputs = [
34 pari
35 gmp
36 ];
37
38 propagatedBuildInputs = [
39 cysignals
40 cython
41 ];
42
43 checkPhase = ''
44 make check
45 '';
46
47 meta = with stdenv.lib; {
48 description = "Cython bindings for PARI";
49 license = licenses.gpl2;
50 maintainers = with maintainers; [ timokau ];
51 homepage = https://github.com/defeo/cypari2;
52 };
53}