python3Packages.cypari: init at 2.5.5

This commit is contained in:
noiioiu 2025-05-22 19:58:22 -05:00
parent f98c76b988
commit 6f28c8729e
No known key found for this signature in database
GPG key ID: BF51F00D07482A89
2 changed files with 82 additions and 0 deletions

View file

@ -0,0 +1,80 @@
{
lib,
python,
buildPythonPackage,
fetchFromGitHub,
fetchurl,
setuptools,
cython,
bash,
perl,
gnum4,
texliveBasic,
}:
let
pariVersion = "2.15.4";
gmpVersion = "6.3.0";
pariSrc = fetchurl {
url = "https://pari.math.u-bordeaux.fr/pub/pari/OLD/${lib.versions.majorMinor pariVersion}/pari-${pariVersion}.tar.gz";
hash = "sha256-w1Rb/uDG37QLd/tLurr5mdguYAabn20ovLbPAEyMXA8=";
};
gmpSrc = fetchurl {
url = "https://ftp.gnu.org/gnu/gmp/gmp-${gmpVersion}.tar.bz2";
hash = "sha256-rCghGnz7YJuuLiyNYFjWbI/pZDT3QM9v4uR7AA0cIMs=";
};
in
buildPythonPackage rec {
pname = "cypari";
version = "2.5.5";
pyproject = true;
src = fetchFromGitHub {
owner = "3-manifolds";
repo = "CyPari";
tag = "${version}_as_released";
hash = "sha256-RJ9O1KsDHmMkTCIFUrcSUkA5ijTsxmoI939QCsCib0Y=";
};
postPatch = ''
substituteInPlace ./setup.py \
--replace-fail "/bin/bash" "${lib.getExe bash}"
# final character is stripped from PARI error messages for some reason
substituteInPlace ./cypari/handle_error.pyx \
--replace-fail "not a function in function call" "not a function in function cal"
ln -s ${pariSrc} ${pariSrc.name}
ln -s ${gmpSrc} ${gmpSrc.name}
'';
build-system = [
setuptools
cython
];
NIX_LDFLAGS = "-lc";
nativeBuildInputs = [
gnum4
perl
texliveBasic
];
pythonImportsCheck = [ "cypari" ];
checkPhase = ''
runHook preCheck
rm -r cypari
${python.interpreter} -m cypari.test
runHook postCheck
'';
meta = {
description = "Sage's PARI extension, modified to stand alone";
homepage = "https://github.com/3-manifolds/CyPari";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ noiioiu ];
changelog = "https://github.com/3-manifolds/CyPari/releases/tag/${src.tag}";
};
}

View file

@ -3128,6 +3128,8 @@ self: super: with self; {
cynthion = callPackage ../development/python-modules/cynthion { };
cypari = callPackage ../development/python-modules/cypari { };
cypari2 = callPackage ../development/python-modules/cypari2 { };
cypherpunkpay = callPackage ../development/python-modules/cypherpunkpay { };