2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, python
|
2021-03-20 04:20:00 +00:00
|
|
|
, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchPypi
|
|
|
|
, pari
|
|
|
|
, gmp
|
|
|
|
, cython
|
|
|
|
, cysignals
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "cypari2";
|
|
|
|
# upgrade may break sage, please test the sage build or ping @timokau on upgrade
|
2022-11-21 17:40:18 +00:00
|
|
|
version = "2.1.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-11-21 17:40:18 +00:00
|
|
|
sha256 = "17beb467d3cb39fffec3227c468f0dd8db8a09129faeb95a6bb4c84b2b6c6683";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-03-20 04:20:00 +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";
|
2023-10-09 19:29:22 +00:00
|
|
|
url = "https://raw.githubusercontent.com/sagemath/sage/b6ea17ef8e4d652de0a85047bac8d41e90b25555/build/pkgs/cypari/patches/trashcan.patch";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-w4kktWb9/aR9z4CjrUvAMOxEwRN2WkubaKzQttN8rU8=";
|
2021-03-20 04:20:00 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00: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 = ''
|
|
|
|
export PYTHONPATH="$out/${python.sitePackages}:$PYTHONPATH"
|
|
|
|
|
|
|
|
# install "." instead of "*.whl"
|
2023-10-09 19:29:22 +00:00
|
|
|
pip install . --no-index --no-warn-script-location --prefix="$out" --no-cache
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pari
|
2023-10-09 19:29:22 +00:00
|
|
|
python.pythonForBuild.pkgs.pip
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
gmp
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
cysignals
|
|
|
|
cython
|
|
|
|
];
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
make check
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Cython bindings for PARI";
|
2021-03-20 04:20:00 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2020-11-21 19:51:51 +00:00
|
|
|
maintainers = teams.sage.members;
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/defeo/cypari2";
|
|
|
|
};
|
|
|
|
}
|