diff --git a/srcpkgs/sagemath/patches/40594-Fix_segfault_in_libgap.patch b/srcpkgs/sagemath/patches/40594-Fix_segfault_in_libgap.patch deleted file mode 100644 index b26ac2f691c429..00000000000000 --- a/srcpkgs/sagemath/patches/40594-Fix_segfault_in_libgap.patch +++ /dev/null @@ -1,51 +0,0 @@ -diff --git a/src/sage/libs/gap/element.pyx b/src/sage/libs/gap/element.pyx -index f52a73c2ded..2ef40fd0a69 100644 ---- a/src/sage/libs/gap/element.pyx -+++ b/src/sage/libs/gap/element.pyx -@@ -2498,11 +2498,17 @@ cdef class GapElement_Function(GapElement): - cdef Obj result = NULL - cdef Obj arg_list - cdef int n = len(args) -- cdef volatile Obj v2 -- -- if n > 0 and n <= 3: -- libgap = self.parent() -- a = [x if isinstance(x, GapElement) else libgap(x) for x in args] -+ cdef Obj a[3] -+ -+ if n <= 3: -+ if not all(isinstance(x, GapElement) for x in args): -+ libgap = self.parent() -+ args = tuple(x if isinstance(x, GapElement) else libgap(x) for x in args) -+ for i in range(n): -+ x = args[i] -+ a[i] = (x).value -+ else: -+ arg_list = make_gap_list(args) - - try: - sig_GAP_Enter() -@@ -2510,20 +2516,12 @@ cdef class GapElement_Function(GapElement): - if n == 0: - result = GAP_CallFunc0Args(self.value) - elif n == 1: -- result = GAP_CallFunc1Args(self.value, -- (a[0]).value) -+ result = GAP_CallFunc1Args(self.value, a[0]) - elif n == 2: -- result = GAP_CallFunc2Args(self.value, -- (a[0]).value, -- (a[1]).value) -+ result = GAP_CallFunc2Args(self.value, a[0], a[1]) - elif n == 3: -- v2 = (a[2]).value -- result = GAP_CallFunc3Args(self.value, -- (a[0]).value, -- (a[1]).value, -- v2) -+ result = GAP_CallFunc3Args(self.value, a[0], a[1], a[2]) - else: -- arg_list = make_gap_list(args) - result = GAP_CallFuncList(self.value, arg_list) - sig_off() - finally: diff --git a/srcpkgs/sagemath/patches/41021-Refactor_atexit.pyx_for_python_3.14.patch b/srcpkgs/sagemath/patches/41021-Refactor_atexit.pyx_for_python_3.14.patch deleted file mode 100644 index 2adf116fcf59d6..00000000000000 --- a/srcpkgs/sagemath/patches/41021-Refactor_atexit.pyx_for_python_3.14.patch +++ /dev/null @@ -1,138 +0,0 @@ -diff --git a/src/sage/cpython/atexit.pyx b/src/sage/cpython/atexit.pyx -index c74c1d0308a..e6ecad9eadc 100644 ---- a/src/sage/cpython/atexit.pyx -+++ b/src/sage/cpython/atexit.pyx -@@ -144,51 +144,99 @@ cdef class restore_atexit: - _set_exithandlers(self._exithandlers) - - from cpython.ref cimport PyObject -+import sys - --# Implement "_atexit_callbacks()" for each supported python version -+# Implement a uniform interface for getting atexit callbacks - cdef extern from *: - """ -+ #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE -+ #endif - #undef _PyGC_FINALIZED - #include "internal/pycore_interp.h" - #include "internal/pycore_pystate.h" -- #if PY_VERSION_HEX >= 0x030c0000 -- // struct atexit_callback was renamed in 3.12 to atexit_py_callback -- #define atexit_callback atexit_py_callback -- #endif -- static atexit_callback ** _atexit_callbacks(PyObject *self) { -+ -+ // Always define this struct for Cython's use -+ typedef struct { -+ PyObject *func; -+ PyObject *args; -+ PyObject *kwargs; -+ } atexit_callback_struct; -+ -+ #if PY_VERSION_HEX >= 0x030e0000 -+ // Python 3.14+: atexit uses a PyList -+ static PyObject* get_atexit_callbacks_list(PyObject *self) { - PyInterpreterState *interp = _PyInterpreterState_GET(); - struct atexit_state state = interp->atexit; - return state.callbacks; - } -+ -+ // Dummy function for Python 3.14+ (never called) -+ static atexit_callback_struct** get_atexit_callbacks_array(PyObject *self) { -+ PyErr_SetString(PyExc_RuntimeError, "Python >= 3.14 has no atexit array"); -+ return NULL; -+ } -+ #else -+ // Python < 3.14: atexit uses C array -+ static atexit_callback_struct** get_atexit_callbacks_array(PyObject *self) { -+ PyInterpreterState *interp = _PyInterpreterState_GET(); -+ struct atexit_state state = interp->atexit; -+ // Cast from atexit_callback** to our struct type -+ return (atexit_callback_struct**)state.callbacks; -+ } -+ -+ // Dummy function for Python < 3.14 (never called) -+ static PyObject* get_atexit_callbacks_list(PyObject *self) { -+ PyErr_SetString(PyExc_RuntimeError, "Python < 3.14 has no atexit list"); -+ return NULL; -+ } -+ #endif - """ -- ctypedef struct atexit_callback: -+ # Declare both functions - they exist in all Python versions (one is dummy) -+ object get_atexit_callbacks_list(object module) -+ -+ ctypedef struct atexit_callback_struct: - PyObject* func - PyObject* args - PyObject* kwargs -- atexit_callback** _atexit_callbacks(object module) -+ atexit_callback_struct** get_atexit_callbacks_array(object module) except NULL - - - def _get_exithandlers(): - """Return list of exit handlers registered with the atexit module.""" -- cdef atexit_callback ** callbacks -- cdef atexit_callback callback -- cdef list exithandlers -+ cdef list exithandlers = [] -+ cdef atexit_callback_struct ** callbacks -+ cdef atexit_callback_struct callback - cdef int idx - cdef object kwargs -- -- exithandlers = [] -- callbacks = _atexit_callbacks(atexit) -- -- for idx in range(atexit._ncallbacks()): -- callback = callbacks[idx][0] -- if callback.kwargs: -- kwargs = callback.kwargs -- else: -- kwargs = {} -- exithandlers.append((callback.func, -- callback.args, -- kwargs)) -+ -+ # Python 3.14+ uses a PyList directly -+ if sys.version_info >= (3, 14): -+ callbacks_list = get_atexit_callbacks_list(atexit) -+ if callbacks_list is None: -+ return exithandlers -+ # callbacks is a list of tuples: [(func, args, kwargs), ...] -+ # Normalize kwargs to ensure it's always a dict (not None) -+ # Note: In Python 3.14+, atexit stores callbacks in LIFO order -+ # (most recently registered first), but we return them in FIFO -+ # order (registration order) for consistency with earlier versions -+ for item in reversed(callbacks_list): -+ func, args, kwargs = item -+ if kwargs is None: -+ kwargs = {} -+ exithandlers.append((func, args, kwargs)) -+ else: -+ # Python < 3.14 uses C array -+ callbacks = get_atexit_callbacks_array(atexit) -+ for idx in range(atexit._ncallbacks()): -+ callback = callbacks[idx][0] -+ if callback.kwargs: -+ kwargs = callback.kwargs -+ else: -+ kwargs = {} -+ exithandlers.append((callback.func, -+ callback.args, -+ kwargs)) - return exithandlers - - -@@ -203,6 +251,9 @@ def _set_exithandlers(exithandlers): - - # We could do this more efficiently by directly rebuilding the array - # of atexit_callbacks, but this is much simpler -+ # Note: exithandlers is in registration order (FIFO). -+ # In Python 3.14+, atexit.register prepends to the list (LIFO), -+ # so registering in forward order gives us the correct execution order. - for callback in exithandlers: - atexit.register(callback[0], *callback[1], **callback[2]) - diff --git a/srcpkgs/sagemath/patches/41141-Fix_ipython_9.7.0.patch b/srcpkgs/sagemath/patches/41141-Fix_ipython_9.7.0.patch deleted file mode 100644 index 5f05574f06a237..00000000000000 --- a/srcpkgs/sagemath/patches/41141-Fix_ipython_9.7.0.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 18efb69e53590586b22dd0f63559845d4676feeb Mon Sep 17 00:00:00 2001 -From: Chenxin Zhong -Date: Thu, 6 Nov 2025 21:56:57 +0800 -Subject: [PATCH] Removed the unicode_to_str conversion from the - SagePrettyPrinter initialization. - -Removed the unicode_to_str conversion from the SagePrettyPrinter initialization. ---- - src/sage/repl/display/formatter.py | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/src/sage/repl/display/formatter.py b/src/sage/repl/display/formatter.py -index 3b73674dd48..ceea50f36eb 100644 ---- a/src/sage/repl/display/formatter.py -+++ b/src/sage/repl/display/formatter.py -@@ -62,7 +62,6 @@ - from io import StringIO - - from IPython.core.formatters import DisplayFormatter, PlainTextFormatter --from IPython.utils.py3compat import unicode_to_str - from IPython.core.display import DisplayObject - - from ipywidgets import Widget -@@ -311,7 +310,7 @@ def __call__(self, obj): - print('---- calling ipython formatter ----') - stream = StringIO() - printer = SagePrettyPrinter( -- stream, self.max_width, unicode_to_str(self.newline)) -+ stream, self.max_width, self.newline) - printer.pretty(obj) - printer.flush() - return stream.getvalue() diff --git a/srcpkgs/sagemath/patches/sphinx.patch b/srcpkgs/sagemath/patches/sphinx.patch deleted file mode 100644 index be52a132cbcd16..00000000000000 --- a/srcpkgs/sagemath/patches/sphinx.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- a/sage/sagemath_standard.egg-info/PKG-INFO -+++ b/sage/sagemath_standard.egg-info/PKG-INFO -@@ -39,7 +39,7 @@ Requires-Dist: requests>=2.13.0 - Requires-Dist: typing_extensions>=4.4.0; python_version < "3.11" - Requires-Dist: ipython>=7.13.0 - Requires-Dist: pexpect>=4.8.0 --Requires-Dist: sphinx<9,>=5.2 -+Requires-Dist: sphinx<10,>=5.2 - Requires-Dist: networkx>=2.4 - Requires-Dist: scipy>=1.12 - Requires-Dist: sympy<2.0,>=1.6 ---- a/sage/sagemath_standard.egg-info/requires.txt -+++ b/sage/sagemath_standard.egg-info/requires.txt -@@ -12,7 +12,7 @@ primecountpy>=0.1.1 - requests>=2.13.0 - ipython>=7.13.0 - pexpect>=4.8.0 --sphinx<9,>=5.2 -+sphinx<10,>=5.2 - networkx>=2.4 - scipy>=1.12 - sympy<2.0,>=1.6 ---- a/sage/setup.cfg -+++ b/sage/setup.cfg -@@ -46,7 +46,7 @@ install_requires = - typing_extensions >= 4.4.0; python_version<'3.11' - ipython >=7.13.0 - pexpect >=4.8.0 -- sphinx >=5.2, <9 -+ sphinx >=5.2, <10 - networkx >=2.4 - scipy >=1.12 - sympy >=1.6, <2.0 diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template index 800fe7adf4448e..cf281ad0ec421e 100644 --- a/srcpkgs/sagemath/template +++ b/srcpkgs/sagemath/template @@ -1,49 +1,64 @@ # Template file for 'sagemath' pkgname=sagemath -version=10.7 -revision=4 +version=10.8 +revision=1 _pypi_version=${version/.beta/b} _pypi_version=${_pypi_version/.rc/rc} build_style=python3-pep517 -hostmakedepends="pkg-config python3-Cython python3-Jinja2 - python3-pkgconfig python3-setuptools python3-wheel - python3-gmpy2 python3-memory_allocator python3-numpy ecl - python3-cypari2 python3-cysignals python3-devel" +make_build_args="-C setup-args=-Dbuild-docs=false" +hostmakedepends="pkg-config + python3-Jinja2 python3-pkgconfig python3-setuptools + python3-wheel python3-meson-python" makedepends="boost-headers brial-devel cliquer-devel ecl eclib-devel ecm-devel fflas-ffpack flintlib-devel gap-devel gd-devel glpk-devel gsl-devel iml-devel lcalc-devel libbraiding-devel libhomfly-devel libmpc-devel libpng-devel linbox-devel m4ri-devel m4rie-devel mpfi-devel - mpfr-devel ntl-devel openblas-devel pari-devel planarity-devel python3-cypari2 - python3-cysignals python3-devel python3-gmpy2 python3-memory_allocator - python3-numpy rankwidth-devel singular symmetrica-devel" -depends="eclib-devel fflas-ffpack flintlib-devel gcc-fortran meson gd-devel - gfan gsl-devel gzip libpng-devel linbox-devel m4ri-devel maxima-ecl - mpfr-devel nauty ntl-devel palp pari-devel pari-elldata-small pari-galdata - pari-galpol-small pari-seadata-small pkg-config python3-Cython python3-cypari2 - python3-cysignals python3-devel python3-fpylll python3-ipython python3-lrcalc + mpfr-devel ntl-devel openblas-devel pari-devel planarity-devel + singular symmetrica-devel rankwidth-devel + maxima-ecl nauty gfan + gcc-fortran palp pari-elldata-small pari-galdata + pari-galpol-small pari-seadata-small + sage-data-combinatorial_designs + sage-data-combinatorial_designs + sage-data-elliptic_curves + sage-data-graphs + sage-data-polytopes_db + sympow tachyon threejs-sage + python3-cypari2 python3-cysignals python3-devel python3-gmpy2 + python3-memory_allocator python3-numpy python3-Cython + python3-fpylll python3-ipython python3-lrcalc python3-ipython_ipykernel python3-jupyter_ipywidgets python3-matplotlib - python3-memory_allocator python3-networkx python3-pip python3-pkgconfig + python3-networkx python3-pip python3-pplpy python3-primecountpy python3-requests python3-scipy - python3-sympy python3-traitlets sage-data-combinatorial_designs - python3-conway-polynomials sage-data-elliptic_curves sage-data-graphs - sage-data-polytopes_db sympow tachyon threejs-sage - python3-six python3-gmpy2 python3-numpy python3-pexpect python3-Sphinx - python3-Pillow python3-mpmath python3-jupyter_client python3-ptyprocess" -checkdepends="$depends python3-pytest pythran python3-Sphinx gdb" + python3-sympy python3-traitlets + python3-conway-polynomials + python3-six python3-pexpect python3-Sphinx + python3-Pillow python3-mpmath python3-jupyter_client python3-ptyprocess + python3-platformdirs python3-pytest" +depends="gzip + python3-Cython python3-Pillow python3-Sphinx python3-conway-polynomials + python3-cypari2 python3-cysignals python3-fpylll python3-gmpy2 + python3-ipython python3-ipython_ipykernel python3-jupyter_client + python3-jupyter_ipywidgets python3-matplotlib python3-memory_allocator + python3-mpmath python3-networkx python3-numpy python3-pexpect + python3-pkgconfig python3-platformdirs python3-pplpy python3-primecountpy + python3-ptyprocess python3-requests python3-scipy python3-six + python3-sympy python3-traitlets" +checkdepends="${depends} python3-pytest pythran python3-Sphinx gdb" short_desc="Open source mathematics software" maintainer="Gonzalo TornarĂ­a " license="GPL-2.0-or-later" homepage="https://www.sagemath.org/" changelog="https://github.com/sagemath/sage/releases" -distfiles="${PYPI_SITE}/s/sagemath-standard/sagemath_standard-${_pypi_version}.tar.gz" -checksum=f6ec41913a745b94e20ceae69c2c54a7c8e549b3dc8b4a01dbd874c772924149 +distfiles="${PYPI_SITE}/s/sagemath/sagemath-${_pypi_version}.tar.gz" +checksum=864c21a84bfad05f586ccdc45bf685552cd87a236bf56bc30163de474569f82c nocross="due to ntl (eclib, singular), fflas-ffpack, givaro, linbox, sympow, maxima" # main repo `.../src/sage/` is `.../sage/` here patch_args=-Np2 # parallel build -export SAGE_NUM_THREADS="$XBPS_MAKEJOBS" +export SAGE_NUM_THREADS="${XBPS_MAKEJOBS}" post_install() { # move scripts to /usr/libexec @@ -57,33 +72,3 @@ post_install() { vmkdir usr/bin ln -s /usr/libexec/sagemath/sage ${DESTDIR}/usr/bin } - -do_check() { - local testdir="${wrksrc}/.xbps-testdir/$(date +%s)" - python3 -m installer -d "${testdir}" dist/*.whl - - # this makes for nicer (shorter) relative paths in output - cd ${testdir}/${py3_sitelib} - - if [ -f ${XBPS_DISTDIR}/sagemath-check ] ; then - _sed='s|#.*||;/^\s*$/d;s|^\s*\([^ ]*/\)\?sage/|sage/|g' \ - _test_files=$(sed -e "$_sed" ${XBPS_DISTDIR}/sagemath-check) - fi - if [ -z "$_test_files" ]; then - _test_files=--all - fi - cp ${FILESDIR}/timings2.json . - _test_args="--stats_path=timings2.json" - if [ "$XBPS_CHECK_PKGS" = full ]; then - _test_args+=" --long --warn-long 30.0" - else - _test_args+=" --warn-long 10.0" - fi - if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then - # for CI use a predictable random seed - _test_args+=" --random-seed=0" - fi - - PATH="${testdir}/usr/bin:${PATH}" PYTHONPATH="${testdir}/${py3_sitelib}" \ - sage -tp ${XBPS_MAKEJOBS} ${_test_args} ${_test_files} -}