2021-01-25 08:26:54 +00:00
|
|
|
{ lib
|
2018-04-11 17:25:50 +01:00
|
|
|
, buildPythonPackage
|
|
|
|
, python
|
2021-03-05 15:20:31 +00:00
|
|
|
, fetchpatch
|
2018-04-11 17:25:50 +01:00
|
|
|
, fetchPypi
|
|
|
|
, pari
|
|
|
|
, gmp
|
|
|
|
, cython
|
|
|
|
, cysignals
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "cypari2";
|
2018-10-22 12:26:13 +01:00
|
|
|
# upgrade may break sage, please test the sage build or ping @timokau on upgrade
|
2021-03-05 15:20:31 +00:00
|
|
|
version = "2.1.2";
|
2018-04-11 17:25:50 +01:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-03-05 15:20:31 +00:00
|
|
|
sha256 = "03cd45edab8716ebbfdb754e65fea72e873c73dc91aec098fe4a01e35324ac7a";
|
2018-04-11 17:25:50 +01:00
|
|
|
};
|
|
|
|
|
2021-03-05 15:20:31 +00:00
|
|
|
patches = [
|
|
|
|
# patch to avoid some segfaults in sage's totallyreal.pyx test.
|
|
|
|
# (https://trac.sagemath.org/ticket/27267). depends on Cython patch.
|
|
|
|
(fetchpatch {
|
|
|
|
name = "use-trashcan-for-gen.patch";
|
|
|
|
url = "https://git.sagemath.org/sage.git/plain/build/pkgs/cypari/patches/trashcan.patch?id=b6ea17ef8e4d652de0a85047bac8d41e90b25555";
|
|
|
|
sha256 = "sha256-w4kktWb9/aR9z4CjrUvAMOxEwRN2WkubaKzQttN8rU8=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2018-04-11 17:25:50 +01:00
|
|
|
# This differs slightly from the default python installPhase in that it pip-installs
|
|
|
|
# "." instead of "*.whl".
|
|
|
|
# That is because while the default install phase succeeds to build the package,
|
|
|
|
# it fails to generate the file "auto_paridecl.pxd".
|
|
|
|
installPhase = ''
|
2019-01-14 21:50:27 +00:00
|
|
|
export PYTHONPATH="$out/${python.sitePackages}:$PYTHONPATH"
|
2018-04-11 17:25:50 +01:00
|
|
|
|
|
|
|
# install "." instead of "*.whl"
|
2020-12-14 22:26:12 +00:00
|
|
|
${python.pythonForBuild.pkgs.bootstrapped-pip}/bin/pip install . --no-index --no-warn-script-location --prefix="$out" --no-cache
|
2018-04-11 17:25:50 +01:00
|
|
|
'';
|
|
|
|
|
2019-02-15 08:42:51 +00:00
|
|
|
nativeBuildInputs = [
|
2018-04-11 17:25:50 +01:00
|
|
|
pari
|
2019-02-15 08:42:51 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2018-04-11 17:25:50 +01:00
|
|
|
gmp
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
cysignals
|
|
|
|
cython
|
|
|
|
];
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
make check
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-04-11 17:25:50 +01:00
|
|
|
description = "Cython bindings for PARI";
|
2021-03-05 15:20:31 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2020-11-17 19:41:33 +00:00
|
|
|
maintainers = teams.sage.members;
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/defeo/cypari2";
|
2018-04-11 17:25:50 +01:00
|
|
|
};
|
|
|
|
}
|