From e7295fa530792138b7489bbbcda17a9ea1c2a7d7 Mon Sep 17 00:00:00 2001 From: Alex Epelde Date: Mon, 8 Sep 2025 16:00:05 -0400 Subject: [PATCH 1/6] maintainers: add alejo7797 --- maintainers/maintainer-list.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 1e02001dab0b..bd1b00baa73c 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -1093,6 +1093,13 @@ githubId = 1078000; name = "Alejandro Sánchez Medina"; }; + alejo7797 = { + email = "alex@epelde.net"; + matrix = "@alex:epelde.net"; + github = "alejo7797"; + githubId = 17302493; + name = "Alex Epelde"; + }; aleksana = { email = "me@aleksana.moe"; github = "Aleksanaa"; From a3f1cfb8c415b30b3e145b830e21890883ec414e Mon Sep 17 00:00:00 2001 From: Alex Epelde Date: Mon, 8 Sep 2025 16:00:54 -0400 Subject: [PATCH 2/6] python3Packages.cypari: add alejo7797 to maintainers --- pkgs/development/python-modules/cypari/default.nix | 5 ++++- pkgs/development/python-modules/fxrays/default.nix | 5 ++++- .../python-modules/knot-floer-homology/default.nix | 5 ++++- pkgs/development/python-modules/low-index/default.nix | 5 ++++- pkgs/development/python-modules/plink/default.nix | 5 ++++- pkgs/development/python-modules/snappy-15-knots/default.nix | 5 ++++- pkgs/development/python-modules/snappy-manifolds/default.nix | 5 ++++- pkgs/development/python-modules/spherogram/default.nix | 5 ++++- pkgs/development/python-modules/tkinter-gl/default.nix | 5 ++++- 9 files changed, 36 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/cypari/default.nix b/pkgs/development/python-modules/cypari/default.nix index da8e988829ad..72ffd4b50b59 100644 --- a/pkgs/development/python-modules/cypari/default.nix +++ b/pkgs/development/python-modules/cypari/default.nix @@ -74,7 +74,10 @@ buildPythonPackage rec { 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 ]; + maintainers = with lib.maintainers; [ + noiioiu + alejo7797 + ]; changelog = "https://github.com/3-manifolds/CyPari/releases/tag/${src.tag}"; }; } diff --git a/pkgs/development/python-modules/fxrays/default.nix b/pkgs/development/python-modules/fxrays/default.nix index b7859e624117..8c83f4985514 100644 --- a/pkgs/development/python-modules/fxrays/default.nix +++ b/pkgs/development/python-modules/fxrays/default.nix @@ -37,6 +37,9 @@ buildPythonPackage rec { changelog = "https://github.com/3-manifolds/FXrays/releases/tag/${src.tag}"; homepage = "https://github.com/3-manifolds/FXrays"; license = lib.licenses.gpl2Plus; - maintainers = with lib.maintainers; [ noiioiu ]; + maintainers = with lib.maintainers; [ + noiioiu + alejo7797 + ]; }; } diff --git a/pkgs/development/python-modules/knot-floer-homology/default.nix b/pkgs/development/python-modules/knot-floer-homology/default.nix index b483f3146bf3..b2ed07a69094 100644 --- a/pkgs/development/python-modules/knot-floer-homology/default.nix +++ b/pkgs/development/python-modules/knot-floer-homology/default.nix @@ -37,6 +37,9 @@ buildPythonPackage rec { changelog = "https://github.com/3-manifolds/knot_floer_homology/releases/tag/${src.tag}"; homepage = "https://github.com/3-manifolds/knot_floer_homology"; license = lib.licenses.gpl2Plus; - maintainers = with lib.maintainers; [ noiioiu ]; + maintainers = with lib.maintainers; [ + noiioiu + alejo7797 + ]; }; } diff --git a/pkgs/development/python-modules/low-index/default.nix b/pkgs/development/python-modules/low-index/default.nix index 7d21f3602b02..c753e78d2ff5 100644 --- a/pkgs/development/python-modules/low-index/default.nix +++ b/pkgs/development/python-modules/low-index/default.nix @@ -33,6 +33,9 @@ buildPythonPackage rec { changelog = "https://github.com/3-manifolds/low_index/releases/tag/${src.tag}"; homepage = "https://github.com/3-manifolds/low_index"; license = lib.licenses.gpl2Plus; - maintainers = with lib.maintainers; [ noiioiu ]; + maintainers = with lib.maintainers; [ + noiioiu + alejo7797 + ]; }; } diff --git a/pkgs/development/python-modules/plink/default.nix b/pkgs/development/python-modules/plink/default.nix index 062d438058a4..63e47bf2828e 100644 --- a/pkgs/development/python-modules/plink/default.nix +++ b/pkgs/development/python-modules/plink/default.nix @@ -34,6 +34,9 @@ buildPythonPackage rec { homepage = "https://3-manifolds.github.io/PLink"; changelog = "https://github.com/3-manifolds/PLink/releases/tag/${src.tag}"; license = lib.licenses.gpl2Plus; - maintainers = with lib.maintainers; [ noiioiu ]; + maintainers = with lib.maintainers; [ + noiioiu + alejo7797 + ]; }; } diff --git a/pkgs/development/python-modules/snappy-15-knots/default.nix b/pkgs/development/python-modules/snappy-15-knots/default.nix index ec26a0bc8534..b08334eabebb 100644 --- a/pkgs/development/python-modules/snappy-15-knots/default.nix +++ b/pkgs/development/python-modules/snappy-15-knots/default.nix @@ -29,6 +29,9 @@ buildPythonPackage rec { homepage = "https://snappy.computop.org"; changelog = "https://github.com/3-manifolds/snappy_15_knots/releases/tag/${src.tag}"; license = licenses.gpl2Plus; - maintainers = with maintainers; [ noiioiu ]; + maintainers = with maintainers; [ + noiioiu + alejo7797 + ]; }; } diff --git a/pkgs/development/python-modules/snappy-manifolds/default.nix b/pkgs/development/python-modules/snappy-manifolds/default.nix index b5fb336f3b63..277924130b7f 100644 --- a/pkgs/development/python-modules/snappy-manifolds/default.nix +++ b/pkgs/development/python-modules/snappy-manifolds/default.nix @@ -26,6 +26,9 @@ buildPythonPackage rec { changelog = "https://github.com/3-manifolds/snappy_manifolds/releases/tag/${src.tag}"; homepage = "https://snappy.computop.org"; license = lib.licenses.gpl2Plus; - maintainers = with lib.maintainers; [ noiioiu ]; + maintainers = with lib.maintainers; [ + noiioiu + alejo7797 + ]; }; } diff --git a/pkgs/development/python-modules/spherogram/default.nix b/pkgs/development/python-modules/spherogram/default.nix index 0e4a3da679d5..e71af9540741 100644 --- a/pkgs/development/python-modules/spherogram/default.nix +++ b/pkgs/development/python-modules/spherogram/default.nix @@ -44,6 +44,9 @@ buildPythonPackage rec { homepage = "https://snappy.computop.org/spherogram.html"; changelog = "https://github.com/3-manifolds/Spherogram/releases/tag/${src.tag}"; license = lib.licenses.gpl2Plus; - maintainers = with lib.maintainers; [ noiioiu ]; + maintainers = with lib.maintainers; [ + noiioiu + alejo7797 + ]; }; } diff --git a/pkgs/development/python-modules/tkinter-gl/default.nix b/pkgs/development/python-modules/tkinter-gl/default.nix index 5e4902f2fe44..d10c824380ee 100644 --- a/pkgs/development/python-modules/tkinter-gl/default.nix +++ b/pkgs/development/python-modules/tkinter-gl/default.nix @@ -29,6 +29,9 @@ buildPythonPackage rec { changelog = "https://github.com/3-manifolds/tkinter_gl/releases/tag/${src.tag}"; homepage = "https://github.com/3-manifolds/tkinter_gl"; license = lib.licenses.gpl2Plus; - maintainers = with lib.maintainers; [ noiioiu ]; + maintainers = with lib.maintainers; [ + noiioiu + alejo7797 + ]; }; } From 7adef789ef45ff883df2b8a29639f1d2224c7742 Mon Sep 17 00:00:00 2001 From: Alex Epelde Date: Wed, 20 Aug 2025 20:42:49 -0400 Subject: [PATCH 3/6] python3Packages.cypari: build gmp and pari separately --- .../python-modules/cypari/default.nix | 34 +++++-------------- pkgs/top-level/python-packages.nix | 18 +++++++++- 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/pkgs/development/python-modules/cypari/default.nix b/pkgs/development/python-modules/cypari/default.nix index 72ffd4b50b59..7e96fde37fe6 100644 --- a/pkgs/development/python-modules/cypari/default.nix +++ b/pkgs/development/python-modules/cypari/default.nix @@ -3,29 +3,13 @@ python, buildPythonPackage, fetchFromGitHub, - fetchurl, setuptools, cython, - bash, + gmp, + pari, 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"; @@ -39,13 +23,15 @@ buildPythonPackage rec { }; 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} + ''; + + preBuild = '' + mkdir libcache + ln -s ${gmp} libcache/gmp + ln -s ${pari} libcache/pari ''; build-system = [ @@ -53,12 +39,8 @@ buildPythonPackage rec { cython ]; - NIX_LDFLAGS = "-lc"; - nativeBuildInputs = [ - gnum4 perl - texliveBasic ]; pythonImportsCheck = [ "cypari" ]; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 4703021f89a8..5227fcdcaa7c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3278,7 +3278,23 @@ self: super: with self; { cynthion = callPackage ../development/python-modules/cynthion { }; - cypari = callPackage ../development/python-modules/cypari { }; + cypari = callPackage ../development/python-modules/cypari { + + inherit (pkgs.pkgsStatic) gmp; + + pari = pkgs.pari.overrideAttrs rec { + version = "2.15.4"; + src = pkgs.fetchurl { + url = "https://pari.math.u-bordeaux.fr/pub/pari/OLD/${lib.versions.majorMinor version}/pari-${version}.tar.gz"; + hash = "sha256-w1Rb/uDG37QLd/tLurr5mdguYAabn20ovLbPAEyMXA8="; + }; + installTargets = [ + "install" + "install-lib-sta" + ]; + }; + + }; cypari2 = callPackage ../development/python-modules/cypari2 { }; From 4c2b94b7dee9106d42a7731d8dedb06d4241d187 Mon Sep 17 00:00:00 2001 From: Alex Epelde Date: Wed, 20 Aug 2025 22:49:08 -0400 Subject: [PATCH 4/6] python3Packages.cypari: less hostile checkPhase --- pkgs/development/python-modules/cypari/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/cypari/default.nix b/pkgs/development/python-modules/cypari/default.nix index 7e96fde37fe6..0e0b528ccad0 100644 --- a/pkgs/development/python-modules/cypari/default.nix +++ b/pkgs/development/python-modules/cypari/default.nix @@ -47,8 +47,7 @@ buildPythonPackage rec { checkPhase = '' runHook preCheck - rm -r cypari - ${python.interpreter} -m cypari.test + ${python.interpreter} -P -m cypari.test runHook postCheck ''; From 182971f37403397efe66f9e88656c3903b4777a2 Mon Sep 17 00:00:00 2001 From: Alex Epelde Date: Mon, 8 Sep 2025 15:46:48 -0400 Subject: [PATCH 5/6] python3Packages.cypari: add patch for aarch64 --- pkgs/development/python-modules/cypari/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/development/python-modules/cypari/default.nix b/pkgs/development/python-modules/cypari/default.nix index 0e0b528ccad0..987a2438dfb0 100644 --- a/pkgs/development/python-modules/cypari/default.nix +++ b/pkgs/development/python-modules/cypari/default.nix @@ -3,6 +3,7 @@ python, buildPythonPackage, fetchFromGitHub, + fetchpatch, setuptools, cython, gmp, @@ -27,6 +28,13 @@ buildPythonPackage rec { substituteInPlace ./cypari/handle_error.pyx \ --replace-fail "not a function in function call" "not a function in function cal" ''; + patches = [ + (fetchpatch { + name = "support-aarch64-linux.patch"; + url = "https://github.com/3-manifolds/CyPari/commit/6197171b52ee4f44a4954ddd0e2e36769b189dee.patch"; + hash = "sha256-j2P7DEGD2B8q9Hh4G2mQng76fQdUpeAdFYoTD7Ui/Dk="; + }) + ]; preBuild = '' mkdir libcache From 31a9f7bc131781ba340a78e88d8d5db5827bd7e4 Mon Sep 17 00:00:00 2001 From: Alex Epelde Date: Mon, 8 Sep 2025 15:47:06 -0400 Subject: [PATCH 6/6] python3Packages.cypari: fix build with cython 3.1 --- pkgs/development/python-modules/cypari/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/cypari/default.nix b/pkgs/development/python-modules/cypari/default.nix index 987a2438dfb0..7bba34e3a9a8 100644 --- a/pkgs/development/python-modules/cypari/default.nix +++ b/pkgs/development/python-modules/cypari/default.nix @@ -23,17 +23,17 @@ buildPythonPackage rec { hash = "sha256-RJ9O1KsDHmMkTCIFUrcSUkA5ijTsxmoI939QCsCib0Y="; }; - postPatch = '' - # 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" - ''; patches = [ (fetchpatch { name = "support-aarch64-linux.patch"; url = "https://github.com/3-manifolds/CyPari/commit/6197171b52ee4f44a4954ddd0e2e36769b189dee.patch"; hash = "sha256-j2P7DEGD2B8q9Hh4G2mQng76fQdUpeAdFYoTD7Ui/Dk="; }) + (fetchpatch { + name = "fix-build-with-cython-3_1.patch"; + url = "https://github.com/3-manifolds/CyPari/compare/622e112ffcf0383e2110954ff3ac3c42c006ebe1...50bcbd2b39177f5e4c5a3551a8a14f75ab05a5d6.patch"; + hash = "sha256-6ayvtHMS3YtzzklHaaLzl9d4zHJhm0lVZQZFS9ykFY4="; + }) ]; preBuild = ''