Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [RFC] sagemath: update to 10.0.rc0.
@ 2023-04-28 20:25 tornaria
  2023-04-28 20:38 ` icp1994
                   ` (39 more replies)
  0 siblings, 40 replies; 41+ messages in thread
From: tornaria @ 2023-04-28 20:25 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1695 bytes --]

There is a new pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages sagemath-next
https://github.com/void-linux/void-packages/pull/43659

[RFC] sagemath: update to 10.0.rc0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

This builds on top of #43225 for convenience.

#### Testing the changes
- I tested the changes in this PR: **briefly**

I've been following beta releases and now rc0 includes all of our patches :muscle:

All doctests pass with the version of packages in void except for `python-Babel` which must be updated (as in #43497) and is included  here as part of #43225.

I've switched my system sagemath to this version as everything seems to be working ok. The testsuite is 10-15% faster.

@dkwo: enjoy.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/43659.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-sagemath-next-43659.patch --]
[-- Type: text/x-diff, Size: 155783 bytes --]

From 0db430c0f57e9689dafc3d12004c909722a0f1f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 17 Apr 2023 14:31:03 -0300
Subject: [PATCH 1/4] python3-Babel: update to 2.12.1.

---
 srcpkgs/python3-Babel/template | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/python3-Babel/template b/srcpkgs/python3-Babel/template
index 4f2dc8425795..9255e8537f4e 100644
--- a/srcpkgs/python3-Babel/template
+++ b/srcpkgs/python3-Babel/template
@@ -1,18 +1,25 @@
 # Template file for 'python3-Babel'
 pkgname=python3-Babel
-version=2.10.3
-revision=2
+version=2.12.1
+revision=1
 build_style=python3-module
 hostmakedepends="python3-setuptools"
-depends="python3-pytz"
-checkdepends="python3-pytest python3-pytz python3-freezegun"
+checkdepends="python3-pytest python3-freezegun faketime"
 short_desc="Tools for internationalizing Python applications (Python3)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://babel.pocoo.org"
 changelog="https://raw.githubusercontent.com/python-babel/babel/master/CHANGES.rst"
 distfiles="${PYPI_SITE}/B/Babel/Babel-${version}.tar.gz"
-checksum=7614553711ee97490f732126dc077f8d0ae084ebc6a96e23db1482afabdb2c51
+checksum=cc2d99999cd01d44420ae725a21c9e3711b3aadc7976d6147f622d8581963455
+
+do_check() {
+	# If you see this is hanging, remove faketime
+	# it has problem with python's time.sleep
+	LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 \
+		FAKETIME="@2023-01-01 00:00:00" \
+		python3 -m pytest
+}
 
 post_install() {
 	vlicense LICENSE

From eab3ab61ba58950442dc4914881f29dc5e1404ac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 27 Mar 2023 00:31:35 -0300
Subject: [PATCH 2/4] singular: update to 4.3.2.

---
 common/shlibs             | 10 +++++-----
 srcpkgs/singular/template |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index e282bbd1f588..08dac21a5b3e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4099,11 +4099,11 @@ libumfpack.so.6 SuiteSparse-6.0.1_1
 libecl.so.21.2 ecl-21.2.1_1
 libecm.so.1 ecm-7.0.4_3
 libcliquer.so.1 cliquer-1.22_1
-libSingular-4.3.1.so singular-4.3.1p2_1
-libfactory-4.3.1.so singular-4.3.1p2_1
-libpolys-4.3.1.so singular-4.3.1p2_1
-libomalloc-0.9.6.so singular-4.3.1p2_1
-libsingular_resources-4.3.1.so singular-4.3.1p2_1
+libomalloc-0.9.6.so singular-4.2.1_1
+libSingular-4.3.2.so singular-4.3.2_1
+libfactory-4.3.2.so singular-4.3.2_1
+libpolys-4.3.2.so singular-4.3.2_1
+libsingular_resources-4.3.2.so singular-4.3.2_1
 libbrial.so.3 brial-1.2.10_1
 libbrial_groebner.so.3 brial-1.2.10_1
 libm4ri-0.0.20200125.so m4ri-20200125_1
diff --git a/srcpkgs/singular/template b/srcpkgs/singular/template
index c73a020dcf15..0481f6cb1e11 100644
--- a/srcpkgs/singular/template
+++ b/srcpkgs/singular/template
@@ -1,6 +1,6 @@
 # Template file for 'singular'
 pkgname=singular
-version=4.3.1p3
+version=4.3.2
 revision=1
 _majver=${version%p*}
 build_style=gnu-configure
@@ -20,7 +20,7 @@ maintainer="dkwo <npiazza@disroot.org>"
 license="GPL-2.0-or-later"
 homepage="https://www.singular.uni-kl.de"
 distfiles="https://www.singular.uni-kl.de/ftp/pub/Math/Singular/SOURCES/${_majver//./-}/singular-${version}.tar.gz"
-checksum=66cfaeee7ab909272fd81050a09cae3ec115652a01adde014a5128a54b97397a
+checksum=3fd565d1bd4265fa8ba7cc189137a36d9daf9939b5bb411466c2028d9191f6db
 
 if [ -z "$CROSS_BUILD" ]; then
 	makedepends+=" ntl-devel"

From 4db6f3ddf94a2b476a3f5eed230345470ff44d3d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 15 Mar 2023 09:27:58 -0300
Subject: [PATCH 3/4] sagemath: rebuild for singular update

Also fix doctests for pkg updates:
 - matplotlib 3.7
 - ipython 8.12
 - nauty 2.8.6
 - pythran 0.12.1

We add patches from upstream sagemath to fix these.

Also add pythran and sphinx to checkdepends to make sure doctests pass
when they are installed.
---
 ...support_singular_4.3.1.p3-5e5737a0c.patch} |  0
 .../34980-avoid_factoring_in_is_prime.patch   | 16 ++--
 .../patches/35177-matplotlib_3.7.patch        | 95 +++++++++++++++++++
 .../patches/35195-workaround_ecl_race.patch   | 56 +++++++++++
 .../patches/35204-fix_sage-cleaner.patch      | 28 ++++++
 .../sagemath/patches/35250-nauty_2.8.6.patch  | 35 +++++++
 .../sagemath/patches/35423-ipython_8.12.patch | 51 ++++++++++
 .../patches/35438-pythran_0.12.1.patch        | 41 ++++++++
 srcpkgs/sagemath/patches/get_patches          | 29 +++++-
 srcpkgs/sagemath/template                     |  4 +-
 10 files changed, 341 insertions(+), 14 deletions(-)
 rename srcpkgs/sagemath/patches/{trac-34851-support_singular_4.3.1.p3-5e5737a0c.patch => 34851-support_singular_4.3.1.p3-5e5737a0c.patch} (100%)
 create mode 100644 srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
 create mode 100644 srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
 create mode 100644 srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
 create mode 100644 srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
 create mode 100644 srcpkgs/sagemath/patches/35423-ipython_8.12.patch
 create mode 100644 srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch

diff --git a/srcpkgs/sagemath/patches/trac-34851-support_singular_4.3.1.p3-5e5737a0c.patch b/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
similarity index 100%
rename from srcpkgs/sagemath/patches/trac-34851-support_singular_4.3.1.p3-5e5737a0c.patch
rename to srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
diff --git a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch b/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
index ca61a2ada4eb..ee0f0e656b28 100644
--- a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
+++ b/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
@@ -1,8 +1,8 @@
 diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py
-index d5f7157217f..1a9d11aec68 100644
+index d5f7157217f..8ca1f958039 100644
 --- a/src/sage/rings/number_field/number_field_ideal.py
 +++ b/src/sage/rings/number_field/number_field_ideal.py
-@@ -996,16 +996,36 @@ def is_prime(self):
+@@ -996,16 +996,38 @@ def is_prime(self):
              False
              sage: K.ideal(17).is_prime()  # ramified
              False
@@ -33,13 +33,15 @@ index d5f7157217f..1a9d11aec68 100644
 +        K = self.number_field().pari_nf()
 +        I = self.pari_hnf()
 +
-+        self._pari_prime = K.idealismaximal(I) or None
++        candidate = K.idealismaximal(I) or None
 +
 +        # PARI uses probabilistic primality testing inside idealismaximal().
-+        if self._pari_prime \
-+                and get_flag(None, 'arithmetic') \
-+                and not self._pari_prime[0].isprime():
-+            self._pari_prime = None
++        if get_flag(None, 'arithmetic'):
++            # proof required, check using isprime()
++            if candidate and not candidate[0].isprime():
++                candidate = None
++
++        self._pari_prime = candidate
 +
 +        return self._pari_prime is not None
  
diff --git a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch b/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
new file mode 100644
index 000000000000..007f3324cfe4
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
@@ -0,0 +1,95 @@
+diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
+index b77c69b2f77..0586a96ae55 100644
+--- a/src/sage/plot/complex_plot.pyx
++++ b/src/sage/plot/complex_plot.pyx
+@@ -563,7 +563,7 @@ def complex_to_cmap_rgb(z_values, cmap='turbo', contoured=False, tiled=False,
+     import matplotlib as mpl
+ 
+     if isinstance(cmap, str):
+-        cmap = mpl.cm.get_cmap(cmap)
++        cmap = mpl.colormaps[cmap]
+ 
+     if contour_base is None:
+         if contour_type == "linear":
+@@ -1206,11 +1206,11 @@ def complex_plot(f, x_range, y_range, contoured=False, tiled=False, cmap=None,
+                 domain = np.linspace(0, 1, 256)
+                 shifted_domain = np.roll(domain, 128)
+                 default_cmap = mpl.colors.LinearSegmentedColormap.from_list(
+-                    "sage_default", mpl.cm.get_cmap('hsv')(shifted_domain)
++                    "sage_default", mpl.colormaps['hsv'](shifted_domain)
+                 )
+                 cmap = default_cmap
+             else:
+-                cmap = mpl.cm.get_cmap(cmap)
++                cmap = mpl.colormaps[cmap]
+         rgbs = complex_to_cmap_rgb(
+             z_values, cmap=cmap, contoured=contoured, tiled=tiled,
+             contour_type=contour_type, contour_base=contour_base,
+diff --git a/src/sage/plot/contour_plot.py b/src/sage/plot/contour_plot.py
+index c0cab456686..4accb309580 100644
+--- a/src/sage/plot/contour_plot.py
++++ b/src/sage/plot/contour_plot.py
+@@ -848,9 +848,7 @@ def f(x,y): return cos(x) + sin(y)
+ 
+         sage: contour_plot(lambda x,y: 0, (-1,1), (-1,1),
+         ....:              contours=[0], fill=False, cmap=['blue'])
+-        ...
+-        UserWarning: No contour levels were found within the data range.
+-        Graphics object consisting of 1 graphics primitive
++        ...Graphics object consisting of 1 graphics primitive
+ 
+     .. PLOT::
+ 
+@@ -874,8 +872,7 @@ def f(x,y): return cos(x) + sin(y)
+     Check that :trac:`18074` is fixed::
+ 
+         sage: contour_plot(0, (0,1), (0,1))
+-        ... UserWarning: No contour levels were found within the data range.
+-        Graphics object consisting of 1 graphics primitive
++        ...Graphics object consisting of 1 graphics primitive
+ 
+     Domain points in :trac:`11648` with complex output are now skipped::
+ 
+diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
+index 64ea1a7e10f..cdc99ced263 100644
+--- a/src/sage/plot/graphics.py
++++ b/src/sage/plot/graphics.py
+@@ -2341,7 +2341,7 @@ def _matplotlib_tick_formatter(self, subplot, base=(10, 10),
+             sage: subplot = Figure().add_subplot(111)
+             sage: p._objects[0]._render_on_subplot(subplot)
+             sage: p._matplotlib_tick_formatter(subplot, **d)
+-            (<AxesSubplot:...>,
++            (<Axes...>,
+             <matplotlib.ticker.MaxNLocator object at ...>,
+             <matplotlib.ticker.MaxNLocator object at ...>,
+             <matplotlib.ticker.ScalarFormatter object at ...>,
+diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
+index 99c817f03a6..ae85183dc93 100644
+--- a/src/sage/plot/multigraphics.py
++++ b/src/sage/plot/multigraphics.py
+@@ -1207,7 +1207,7 @@ def _add_subplot(self, figure, index, **options):
+             sage: fig = Figure()
+             sage: ax1 = G._add_subplot(fig, 0)
+             sage: type(ax1)
+-            <class 'matplotlib.axes._subplots.AxesSubplot'>
++            <class 'matplotlib.axes...'>
+             sage: ax2 = G._add_subplot(fig, 1)
+             sage: fig.get_axes() == [ax1, ax2]
+             True
+diff --git a/src/sage/plot/plot3d/plot_field3d.py b/src/sage/plot/plot3d/plot_field3d.py
+index bdf39391d3e..fe10e27f58f 100644
+--- a/src/sage/plot/plot3d/plot_field3d.py
++++ b/src/sage/plot/plot3d/plot_field3d.py
+@@ -126,9 +126,9 @@ def plot_vector_field3d(functions, xrange, yrange, zrange,
+     vectors = [vector((ff(*point), gg(*point), hh(*point))) for point in points]
+ 
+     try:
+-        from matplotlib.cm import get_cmap
+-        cm = get_cmap(colors)
+-    except (TypeError, ValueError):
++        import matplotlib as mpl
++        cm = mpl.colormaps[colors]
++    except (TypeError, KeyError):
+         cm = None
+     if cm is None:
+         if isinstance(colors, (list, tuple)):
diff --git a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch b/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
new file mode 100644
index 000000000000..1e0a708e8068
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
@@ -0,0 +1,56 @@
+diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py
+index c9ca5e30939..9459cb70334 100644
+--- a/src/sage/interfaces/maxima_lib.py
++++ b/src/sage/interfaces/maxima_lib.py
+@@ -77,6 +77,26 @@
+     sage: bar == foo
+     True
+ 
++TESTS:
++
++Check our workaround for a race in ecl works, see :trac:`26968`.
++We use a temporary `MAXIMA_USERDIR` so it's empty; we place it
++in `DOT_SAGE` since we expect it to have more latency than `/tmp`.
++
++    sage: import tempfile, subprocess
++    sage: tmpdir = tempfile.TemporaryDirectory(dir=DOT_SAGE)
++    sage: _ = subprocess.run(['sage', '-c',  # long time
++    ....: f'''
++    ....: import os
++    ....: os.environ["MAXIMA_USERDIR"] = "{tmpdir.name}"
++    ....: if not os.fork():
++    ....:     import sage.interfaces.maxima_lib
++    ....: else:
++    ....:     import sage.interfaces.maxima_lib
++    ....:     os.wait()
++    ....: '''])
++    sage: tmpdir.cleanup()
++
+ """
+ 
+ # ****************************************************************************
+@@ -116,7 +136,23 @@
+ ecl_eval("(setq $nolabels t))")
+ ecl_eval("(defvar *MAXIMA-LANG-SUBDIR* NIL)")
+ ecl_eval("(set-locale-subdir)")
+-ecl_eval("(set-pathnames)")
++
++try:
++    ecl_eval("(set-pathnames)")
++except RuntimeError:
++    # Recover from :trac:`26968` by creating `*maxima-objdir*` here.
++    # This cannot be done before calling `(set-pathnames)` since
++    # `*maxima-objdir*` is computed there.
++    # We use python `os.makedirs()` which is immune to the race.
++    # Using `(ensure-directories-exist ...)` in lisp would be
++    # subject to the same race condition and since `*maxima-objdir*`
++    # has multiple components this is quite plausible to happen.
++    maxima_objdir = ecl_eval("*maxima-objdir*").python()[1:-1]
++    import os
++    os.makedirs(maxima_objdir, exist_ok=True)
++    # Call `(set-pathnames)` again to complete its job.
++    ecl_eval("(set-pathnames)")
++
+ ecl_eval("(defun add-lineinfo (x) x)")
+ ecl_eval('(defun principal nil (cond ($noprincipal (diverg)) ((not pcprntd) (merror "Divergent Integral"))))')
+ ecl_eval("(remprop 'mfactorial 'grind)")  # don't use ! for factorials (#11539)
diff --git a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch b/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
new file mode 100644
index 000000000000..fc3e40da2a88
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
@@ -0,0 +1,28 @@
+diff --git a/src/bin/sage-cleaner b/src/bin/sage-cleaner
+index e2e578eec60..dc7d8f0482e 100755
+--- a/src/bin/sage-cleaner
++++ b/src/bin/sage-cleaner
+@@ -99,6 +99,15 @@ def cleanup():
+ 
+     return len(pid_list)
+ 
++def cleanup_cruft():
++    """ remove directories leftover from improper shutdown """
++    tmp_dirs = os.listdir(SAGE_TMP_ROOT)
++    for dir_entry in tmp_dirs:
++        baddir = os.path.join(SAGE_TMP_ROOT, dir_entry)
++        if os.path.isdir(baddir):
++            logger.warning('Removing old directory %s from SAGE_TMP_ROOT', baddir)
++            rm_rf(baddir)
++
+ def kill_spawned_jobs(jobfile, parent_pid):
+     logger.info("Killing %s's spawned jobs", parent_pid)
+     killed_them_all = True
+@@ -193,6 +202,7 @@ if __name__ == '__main__':
+     setup_daemon()
+     fix_old_mistakes()
+     logger.info("Starting sage-cleaner with PID %s", os.getpid())
++    cleanup_cruft()
+ 
+     if len(sys.argv) > 1:
+         wait = int(sys.argv[1])
diff --git a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch b/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
new file mode 100644
index 000000000000..ea210e20ae52
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
@@ -0,0 +1,35 @@
+diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py
+index ec6a5c19e60..9dd7bc1cb1e 100644
+--- a/src/sage/graphs/generators/families.py
++++ b/src/sage/graphs/generators/families.py
+@@ -3660,7 +3660,7 @@ def nauty_gentreeg(options="", debug=False):
+ 
+         sage: gen = graphs.nauty_gentreeg("4", debug=True)
+         sage: print(next(gen))
+-        >A ...gentreeg Z=2:3 D=3 n=4
++        >A ...gentreeg ...
+         sage: gen = graphs.nauty_gentreeg("4 -q", debug=True)
+         sage: next(gen)
+         ''
+@@ -3687,7 +3687,7 @@ def nauty_gentreeg(options="", debug=False):
+         sage: list(graphs.nauty_gentreeg("3 -x", debug=True))
+         ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n [res/mod] ...
+         sage: list(graphs.nauty_gentreeg("3", debug=True))
+-        ['>A ...gentreeg Z=2:2 D=2 n=3\n', Graph on 3 vertices]
++        ['>A ...gentreeg ...\n', Graph on 3 vertices]
+     """
+     import shlex
+     from sage.features.nauty import NautyExecutable
+diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py
+index df88bbe2713..1a8016976c2 100644
+--- a/src/sage/graphs/graph_generators.py
++++ b/src/sage/graphs/graph_generators.py
+@@ -966,7 +966,7 @@ def nauty_geng(self, options="", debug=False):
+             ...
+             ValueError: wrong format of parameter option
+             sage: list(graphs.nauty_geng("-c3", debug=True))
+-            ['>E Usage: ...geng [-cCmtfbd#D#] [-uygsnh] [-lvq] ...
++            ['>E Usage: ...geng ...\n']
+             sage: list(graphs.nauty_geng("-c 3", debug=True))
+             ['>A ...geng -cd1D2 n=3 e=2-3\n', Graph on 3 vertices, Graph on 3 vertices]
+         """
diff --git a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch b/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
new file mode 100644
index 000000000000..46bda084e48e
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
@@ -0,0 +1,51 @@
+diff --git a/src/sage/repl/inputhook.py b/src/sage/repl/inputhook.py
+index da5df0268c0..7f7894f6dcf 100644
+--- a/src/sage/repl/inputhook.py
++++ b/src/sage/repl/inputhook.py
+@@ -17,6 +17,8 @@
+ 
+ import select
+ import errno
++import contextlib
++import io
+ 
+ from IPython import get_ipython
+ from IPython.terminal.pt_inputhooks import register
+@@ -47,15 +49,27 @@ def install():
+     """
+     Install the Sage input hook
+ 
+-    EXAMPLES::
++    EXAMPLES:
++
++    Make sure ipython is running so we really test this function::
++
++        sage: from sage.repl.interpreter import get_test_shell
++        sage: get_test_shell()
++        <sage.repl.interpreter.SageTestShell object at ...>
++
++    Run the function twice, to check it is idempotent (see :trac:`35235`)::
+ 
+         sage: from sage.repl.inputhook import install
+         sage: install()
++        sage: install()
+     """
+     ip = get_ipython()
+     if not ip:
+         return   # Not running in ipython, e.g. doctests
+-    ip.enable_gui('sage')
++    if ip._inputhook != sage_inputhook:
++        # silence `ip.enable_gui()` useless output
++        with contextlib.redirect_stdout(io.StringIO()):
++            ip.enable_gui('sage')
+ 
+ 
+ def uninstall():
+@@ -71,4 +85,6 @@ def uninstall():
+     if not ip:
+         return
+     if ip._inputhook == sage_inputhook:
+-        ip.enable_gui(None)
++        # silence `ip.enable_gui()` useless output
++        with contextlib.redirect_stdout(io.StringIO()):
++            ip.enable_gui(None)
diff --git a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch b/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
new file mode 100644
index 000000000000..2cdc674d4f9e
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
@@ -0,0 +1,41 @@
+From 532fbbaf71bb41c73920b584108eb2a09d6deeb1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
+Date: Tue, 4 Apr 2023 12:56:57 -0300
+Subject: [PATCH] Ignore deprecation warnings triggered by pythran 0.12.1
+
+These happen with python 3.11, setuptools 67.6.1, numpy 1.24.2.
+When pythran 0.12.1 is installed, I get 24 doctest failures due to
+deprecation warnings; they are all gone with this commit.
+
+[backported from 839a6e928c264a9863bd42860c78ae95a6d9f3e0]
+---
+ src/sage/all.py | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/src/sage/all.py b/src/sage/all.py
+index 93588df1b93..ee775aad0e9 100644
+--- a/src/sage/all.py
++++ b/src/sage/all.py
+@@ -96,9 +96,17 @@ warnings.filterwarnings('ignore', category=DeprecationWarning,
+ warnings.filterwarnings('ignore', category=DeprecationWarning,
+     module='(.*[.]_vendor[.])?packaging')
+ 
+-# Ignore numpy warnings triggered by pythran
++# Ignore a few warnings triggered by pythran 0.12.1
+ warnings.filterwarnings('ignore', category=DeprecationWarning,
+-                        module='pythran')
++    message='\n\n  `numpy.distutils` is deprecated since NumPy 1.23.0',
++    module='pythran.dist')
++warnings.filterwarnings('ignore', category=DeprecationWarning,
++    message='pkg_resources is deprecated as an API|'
++            'Deprecated call to `pkg_resources.declare_namespace(.*)`',
++    module='pkg_resources')
++warnings.filterwarnings('ignore', category=DeprecationWarning,
++    message='msvccompiler is deprecated and slated to be removed',
++    module='distutils.msvccompiler')
+ 
+ warnings.filterwarnings('ignore', category=DeprecationWarning,
+                         message='The distutils(.sysconfig module| package) is deprecated',
+-- 
+2.40.0
+
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index c98da68683cc..74109ffbbb0d 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -19,7 +19,7 @@ get_trac() {
 	ticket=$1
 	desc=$(echo "$2" | sed -e 's/ /_/g')
 	commit=$3
-	$DO wget "$URL_BASE_COMPARE$commit.diff" -O "trac-$ticket-$desc-$commit.patch"
+	$DO wget "$URL_BASE_COMPARE$commit.diff" -O "$ticket-$desc-$commit.patch"
 }
 
 # run from patches dir
@@ -29,13 +29,32 @@ cd $(dirname "$0")
 get_trac 34851 "support singular 4.3.1.p3" 5e5737a0c
 get_pr 35068 "fix tests giac 1.9.0.35" patch
 
-# positive review
+# merged in 10.0.beta1
+get_pr 35058 "skip unstable tests klyachko"
+
+# merged in 10.0.beta2
 get_pr 34994 "fix tests numpy 1.24"
 get_pr 34997 "fix edge case of integer_check"
-get_pr 35058 "skip unstable tests klyachko"
-get_pr 35094 "support gap 4.12"					# includes PR 35093
 
-# needs review 
+# merged in 10.0.beta3
 get_pr 34995 "support tachyon 0.99.2"
+
+# merged in 10.0.beta4
 get_pr 34980 "avoid factoring in is_prime"
+
+# merged in 10.0.beta5
+get_pr 35094 "support gap 4.12"					# includes PR 35093
+
+# merged in 10.0.beta6
 get_pr 35127 "fix very slow test stream.py"
+get_pr 35177 "matplotlib 3.7"
+get_pr 35195 "workaround ecl race"
+get_pr 35204 "fix sage-cleaner"
+
+# merged in 10.0.beta7
+get_pr 35250 "nauty 2.8.6"
+
+# merged in 10.0.beta8
+#get_pr 35337 "ipython 8.11"
+get_pr 35423 "ipython 8.12"						# includes PR 35337
+get_pr 35438 "pythran 0.12.1"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 75695f0e5f87..82f97480a10f 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
 version=9.8
-revision=1
+revision=2
 build_wrksrc=pkgs/sagemath-standard
 build_style=python3-module
 _bindir=/usr/lib/sagemath/$version/bin
@@ -26,7 +26,7 @@ depends="FlintQS eclib-devel fflas-ffpack flintlib-devel gcc-fortran gd-devel
  python3-sympy python3-traitlets sage-data-combinatorial_designs
  sage-data-conway_polynomials sage-data-elliptic_curves sage-data-graphs
  sage-data-polytopes_db sympow tachyon threejs-sage"
-checkdepends="$depends"
+checkdepends="$depends pythran python3-Sphinx python3-Babel"
 short_desc="Open source mathematics software"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-or-later"

From f5ca4740c056d949ca949196f076da64744e602b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Tue, 25 Apr 2023 13:20:47 -0300
Subject: [PATCH 4/4] sagemath: update to 10.0.rc0.

---
 srcpkgs/sagemath/files/sage_conf.py           |    1 -
 srcpkgs/sagemath/files/timings2.json          |  405 ++---
 ...-support_singular_4.3.1.p3-5e5737a0c.patch |  205 ---
 .../34980-avoid_factoring_in_is_prime.patch   |   49 -
 .../patches/34994-fix_tests_numpy_1.24.patch  |   58 -
 .../34995-support_tachyon_0.99.2.patch        |   57 -
 ...34997-fix_edge_case_of_integer_check.patch |   36 -
 .../35058-skip_unstable_tests_klyachko.patch  |   22 -
 .../35068-fix_tests_giac_1.9.0.35.patch       |   62 -
 .../patches/35094-support_gap_4.12.patch      | 1303 -----------------
 .../35127-fix_very_slow_test_stream.py.patch  |   15 -
 .../patches/35177-matplotlib_3.7.patch        |   95 --
 .../patches/35195-workaround_ecl_race.patch   |   56 -
 .../patches/35204-fix_sage-cleaner.patch      |   28 -
 .../sagemath/patches/35250-nauty_2.8.6.patch  |   35 -
 .../sagemath/patches/35423-ipython_8.12.patch |   51 -
 .../patches/35438-pythran_0.12.1.patch        |   41 -
 srcpkgs/sagemath/patches/get_patches          |   43 +-
 srcpkgs/sagemath/template                     |    6 +-
 19 files changed, 111 insertions(+), 2457 deletions(-)
 delete mode 100644 srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
 delete mode 100644 srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
 delete mode 100644 srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
 delete mode 100644 srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
 delete mode 100644 srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
 delete mode 100644 srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
 delete mode 100644 srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
 delete mode 100644 srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
 delete mode 100644 srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
 delete mode 100644 srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
 delete mode 100644 srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
 delete mode 100644 srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
 delete mode 100644 srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
 delete mode 100644 srcpkgs/sagemath/patches/35423-ipython_8.12.patch
 delete mode 100644 srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch

diff --git a/srcpkgs/sagemath/files/sage_conf.py b/srcpkgs/sagemath/files/sage_conf.py
index 00de40f1ee4f..bc5388de8956 100644
--- a/srcpkgs/sagemath/files/sage_conf.py
+++ b/srcpkgs/sagemath/files/sage_conf.py
@@ -1,4 +1,3 @@
 # configuration for sage on void linux
 SAGE_SHARE = "/usr/share/sagemath"
 GAP_SHARE_DIR = "/usr/share/gap"
-GAP_LIB_DIR = "/usr/lib/gap"
diff --git a/srcpkgs/sagemath/files/timings2.json b/srcpkgs/sagemath/files/timings2.json
index bb3098680502..b2b3fe818a20 100644
--- a/srcpkgs/sagemath/files/timings2.json
+++ b/srcpkgs/sagemath/files/timings2.json
@@ -1,281 +1,152 @@
 {
-  "doc.ca.intro.index": {"walltime": 8},
-  "doc.en.constructions.calculus": {"walltime": 64},
-  "doc.en.constructions.plotting": {"walltime": 32},
-  "doc.en.prep.Advanced-2DPlotting": {"walltime": 16},
-  "doc.en.prep.Calculus": {"walltime": 8},
-  "doc.en.prep.Symbolics-and-Basic-Plotting": {"walltime": 8},
-  "doc.en.thematic_tutorials.explicit_methods_in_number_theory.birds_other": {"walltime": 8},
-  "doc.en.thematic_tutorials.explicit_methods_in_number_theory.elliptic_curves": {"walltime": 8},
-  "doc.en.thematic_tutorials.geometry.polyhedra_tutorial": {"walltime": 16},
-  "doc.en.thematic_tutorials.sandpile": {"walltime": 16},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_advanced": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_cartesian": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_change": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_curvilinear": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_plane": {"walltime": 16},
-  "doc.ja.tutorial.tour_plotting": {"walltime": 8},
-  "sage.algebras.cluster_algebra": {"walltime": 8},
   "sage.algebras.commutative_dga": {"walltime": 16},
-  "sage.algebras.hecke_algebras.ariki_koike_algebra": {"walltime": 8},
-  "sage.algebras.iwahori_hecke_algebra": {"walltime": 8},
-  "sage.algebras.lie_algebras.classical_lie_algebra": {"walltime": 128},
-  "sage.algebras.lie_algebras.nilpotent_lie_algebra": {"walltime": 16},
-  "sage.algebras.quantum_clifford": {"walltime": 16},
-  "sage.algebras.quantum_groups.fock_space": {"walltime": 8},
-  "sage.algebras.quatalg.quaternion_algebra": {"walltime": 8},
-  "sage.algebras.steenrod.steenrod_algebra": {"walltime": 64},
-  "sage.algebras.steenrod.steenrod_algebra_bases": {"walltime": 8},
-  "sage.algebras.yangian": {"walltime": 8},
-  "sage.arith.misc": {"walltime": 32},
+  "sage.algebras.fusion_rings.f_matrix": {"walltime": 16},
+  "sage.algebras.fusion_rings.fusion_ring": {"walltime": 16},
+  "sage.algebras.hecke_algebras.cubic_hecke_algebra": {"walltime": 8},
+  "sage.algebras.lie_conformal_algebras.n2_lie_conformal_algebra": {"walltime": 8},
+  "sage.algebras.quantum_clifford": {"walltime": 8},
+  "sage.algebras.steenrod.steenrod_algebra": {"walltime": 8},
   "sage.calculus.calculus": {"walltime": 16},
   "sage.calculus.desolvers": {"walltime": 8},
-  "sage.calculus.functional": {"walltime": 8},
-  "sage.calculus.riemann": {"walltime": 64},
-  "sage.calculus.tests": {"walltime": 16},
-  "sage.calculus.transforms.dwt": {"walltime": 16},
+  "sage.calculus.riemann": {"walltime": 8},
   "sage.calculus.transforms.fft": {"walltime": 8},
   "sage.categories.coxeter_groups": {"walltime": 8},
-  "sage.categories.finite_monoids": {"walltime": 16},
-  "sage.categories.lie_conformal_algebras": {"walltime": 8},
+  "sage.categories.finite_monoids": {"walltime": 8},
   "sage.categories.loop_crystals": {"walltime": 8},
-  "sage.categories.pushout": {"walltime": 8},
-  "sage.categories.super_hopf_algebras_with_basis": {"walltime": 32},
-  "sage.categories.super_lie_conformal_algebras": {"walltime": 8},
-  "sage.coding.ag_code": {"walltime": 64},
-  "sage.coding.ag_code_decoders": {"walltime": 128},
-  "sage.coding.binary_code": {"walltime": 8},
-  "sage.coding.linear_code": {"walltime": 16},
-  "sage.combinat.backtrack": {"walltime": 32},
-  "sage.combinat.chas.wqsym": {"walltime": 32},
-  "sage.combinat.cluster_algebra_quiver.cluster_seed": {"walltime": 64},
-  "sage.combinat.cluster_algebra_quiver.quiver": {"walltime": 128},
-  "sage.combinat.crystals.affine_factorization": {"walltime": 16},
-  "sage.combinat.crystals.alcove_path": {"walltime": 32},
-  "sage.combinat.crystals.highest_weight_crystals": {"walltime": 8},
-  "sage.combinat.crystals.kirillov_reshetikhin": {"walltime": 16},
-  "sage.combinat.crystals.letters": {"walltime": 8},
-  "sage.combinat.crystals.littelmann_path": {"walltime": 16},
-  "sage.combinat.crystals.mv_polytopes": {"walltime": 16},
-  "sage.combinat.crystals.pbw_crystal": {"walltime": 16},
-  "sage.combinat.crystals.star_crystal": {"walltime": 8},
-  "sage.combinat.designs.bibd": {"walltime": 8},
-  "sage.combinat.designs.database": {"walltime": 16},
+  "sage.coding.ag_code": {"walltime": 32},
+  "sage.coding.ag_code_decoders": {"walltime": 32},
+  "sage.coding.linear_code": {"walltime": 32},
+  "sage.combinat.designs.database": {"walltime": 8},
   "sage.combinat.designs.difference_family": {"walltime": 8},
-  "sage.combinat.designs.gen_quadrangles_with_spread": {"walltime": 128},
-  "sage.combinat.designs.orthogonal_arrays_build_recursive": {"walltime": 16},
-  "sage.combinat.designs.orthogonal_arrays_find_recursive": {"walltime": 8},
-  "sage.combinat.diagram_algebras": {"walltime": 64},
-  "sage.combinat.fqsym": {"walltime": 32},
-  "sage.combinat.free_prelie_algebra": {"walltime": 8},
-  "sage.combinat.fully_commutative_elements": {"walltime": 8},
-  "sage.combinat.grossman_larson_algebras": {"walltime": 8},
-  "sage.combinat.interval_posets": {"walltime": 8},
+  "sage.combinat.designs.orthogonal_arrays_build_recursive": {"walltime": 8},
   "sage.combinat.k_regular_sequence": {"walltime": 8},
   "sage.combinat.k_tableau": {"walltime": 16},
   "sage.combinat.matrices.hadamard_matrix": {"walltime": 8},
   "sage.combinat.multiset_partition_into_sets_ordered": {"walltime": 8},
-  "sage.combinat.ncsf_qsym.ncsf": {"walltime": 16},
-  "sage.combinat.ncsf_qsym.qsym": {"walltime": 16},
-  "sage.combinat.partition": {"walltime": 16},
-  "sage.combinat.partition_kleshchev": {"walltime": 16},
+  "sage.combinat.ncsf_qsym.ncsf": {"walltime": 8},
+  "sage.combinat.ncsf_qsym.qsym": {"walltime": 8},
+  "sage.combinat.partition": {"walltime": 8},
   "sage.combinat.partition_tuple": {"walltime": 8},
-  "sage.combinat.posets.moebius_algebra": {"walltime": 16},
+  "sage.combinat.permutation": {"walltime": 8},
   "sage.combinat.posets.posets": {"walltime": 8},
-  "sage.combinat.rigged_configurations.kr_tableaux": {"walltime": 32},
-  "sage.combinat.rigged_configurations.rigged_configurations": {"walltime": 16},
-  "sage.combinat.rigged_configurations.tensor_product_kr_tableaux": {"walltime": 16},
+  "sage.combinat.rigged_configurations.kr_tableaux": {"walltime": 8},
   "sage.combinat.root_system.associahedron": {"walltime": 8},
-  "sage.combinat.root_system.branching_rules": {"walltime": 8},
-  "sage.combinat.root_system.fusion_ring": {"walltime": 8},
-  "sage.combinat.root_system.integrable_representations": {"walltime": 16},
-  "sage.combinat.root_system.non_symmetric_macdonald_polynomials": {"walltime": 16},
-  "sage.combinat.root_system.pieri_factors": {"walltime": 8},
-  "sage.combinat.root_system.plot": {"walltime": 32},
-  "sage.combinat.root_system.root_lattice_realization_algebras": {"walltime": 16},
-  "sage.combinat.root_system.root_lattice_realizations": {"walltime": 16},
-  "sage.combinat.root_system.root_system": {"walltime": 8},
-  "sage.combinat.root_system.weyl_group": {"walltime": 8},
-  "sage.combinat.rsk": {"walltime": 32},
-  "sage.combinat.sf.classical": {"walltime": 16},
-  "sage.combinat.sf.jack": {"walltime": 16},
-  "sage.combinat.sf.k_dual": {"walltime": 16},
-  "sage.combinat.sf.llt": {"walltime": 16},
-  "sage.combinat.sf.macdonald": {"walltime": 64},
-  "sage.combinat.sf.new_kschur": {"walltime": 8},
-  "sage.combinat.sf.sfa": {"walltime": 32},
-  "sage.combinat.shifted_primed_tableau": {"walltime": 16},
+  "sage.combinat.root_system.non_symmetric_macdonald_polynomials": {"walltime": 8},
+  "sage.combinat.root_system.plot": {"walltime": 16},
+  "sage.combinat.root_system.root_lattice_realizations": {"walltime": 8},
+  "sage.combinat.rsk": {"walltime": 8},
+  "sage.combinat.sf.k_dual": {"walltime": 8},
+  "sage.combinat.sf.sf": {"walltime": 8},
+  "sage.combinat.sf.sfa": {"walltime": 8},
+  "sage.combinat.shifted_primed_tableau": {"walltime": 8},
   "sage.combinat.skew_tableau": {"walltime": 8},
-  "sage.combinat.symmetric_group_algebra": {"walltime": 16},
-  "sage.combinat.tableau": {"walltime": 32},
-  "sage.combinat.tableau_tuple": {"walltime": 32},
-  "sage.combinat.tiling": {"walltime": 16},
-  "sage.combinat.tutorial": {"walltime": 16},
-  "sage.combinat.words.paths": {"walltime": 64},
-  "sage.crypto.block_cipher.des": {"walltime": 16},
-  "sage.crypto.mq.sr": {"walltime": 64},
-  "sage.crypto.sbox": {"walltime": 16},
+  "sage.combinat.species.generating_series": {"walltime": 8},
+  "sage.combinat.tableau": {"walltime": 8},
+  "sage.combinat.tableau_tuple": {"walltime": 8},
+  "sage.combinat.tiling": {"walltime": 8},
+  "sage.combinat.tutorial": {"walltime": 8},
   "sage.crypto.sboxes": {"walltime": 8},
   "sage.doctest.forker": {"walltime": 16},
-  "sage.doctest.sources": {"walltime": 64},
-  "sage.doctest.test": {"walltime": 128},
-  "sage.dynamics.arithmetic_dynamics.projective_ds": {"walltime": 64},
-  "sage.dynamics.arithmetic_dynamics.wehlerK3": {"walltime": 8},
-  "sage.dynamics.cellular_automata.glca": {"walltime": 8},
+  "sage.dynamics.arithmetic_dynamics.projective_ds": {"walltime": 32},
   "sage.dynamics.cellular_automata.solitons": {"walltime": 8},
-  "sage.dynamics.complex_dynamics.mandel_julia": {"walltime": 16},
   "sage.functions.bessel": {"walltime": 16},
-  "sage.functions.exp_integral": {"walltime": 8},
   "sage.functions.hypergeometric": {"walltime": 8},
+  "sage.functions.orthogonal_polys": {"walltime": 8},
   "sage.functions.other": {"walltime": 16},
   "sage.functions.piecewise": {"walltime": 8},
-  "sage.games.quantumino": {"walltime": 8},
-  "sage.geometry.cone": {"walltime": 32},
-  "sage.geometry.fan": {"walltime": 8},
   "sage.geometry.hyperbolic_space.hyperbolic_geodesic": {"walltime": 8},
-  "sage.geometry.hyperplane_arrangement.arrangement": {"walltime": 16},
-  "sage.geometry.hyperplane_arrangement.library": {"walltime": 8},
+  "sage.geometry.hyperplane_arrangement.arrangement": {"walltime": 8},
   "sage.geometry.hyperplane_arrangement.plot": {"walltime": 8},
-  "sage.geometry.lattice_polytope": {"walltime": 16},
-  "sage.geometry.polyhedral_complex": {"walltime": 8},
-  "sage.geometry.polyhedron.base": {"walltime": 32},
-  "sage.geometry.polyhedron.library": {"walltime": 32},
-  "sage.geometry.polyhedron.plot": {"walltime": 8},
+  "sage.geometry.polyhedron.base": {"walltime": 8},
+  "sage.geometry.polyhedron.base5": {"walltime": 8},
+  "sage.geometry.polyhedron.base6": {"walltime": 16},
+  "sage.geometry.polyhedron.library": {"walltime": 16},
   "sage.geometry.riemannian_manifolds.parametrized_surface3d": {"walltime": 16},
-  "sage.geometry.triangulation.base": {"walltime": 32},
-  "sage.geometry.triangulation.point_configuration": {"walltime": 16},
-  "sage.graphs.chrompoly": {"walltime": 8},
-  "sage.graphs.connectivity": {"walltime": 16},
-  "sage.graphs.generators.basic": {"walltime": 16},
-  "sage.graphs.generators.classical_geometries": {"walltime": 32},
-  "sage.graphs.generators.distance_regular": {"walltime": 256},
-  "sage.graphs.generators.families": {"walltime": 32},
-  "sage.graphs.generators.smallgraphs": {"walltime": 16},
-  "sage.graphs.generic_graph": {"walltime": 32},
-  "sage.graphs.genus": {"walltime": 16},
+  "sage.graphs.connectivity": {"walltime": 8},
+  "sage.graphs.generators.classical_geometries": {"walltime": 8},
+  "sage.graphs.generators.distance_regular": {"walltime": 32},
+  "sage.graphs.generators.smallgraphs": {"walltime": 8},
+  "sage.graphs.generic_graph": {"walltime": 16},
   "sage.graphs.graph": {"walltime": 16},
-  "sage.graphs.graph_generators": {"walltime": 8},
   "sage.graphs.graph_list": {"walltime": 8},
   "sage.graphs.graph_plot": {"walltime": 8},
-  "sage.graphs.strongly_regular_db": {"walltime": 16},
-  "sage.groups.cubic_braid": {"walltime": 16},
-  "sage.groups.fqf_orthogonal": {"walltime": 16},
-  "sage.groups.libgap_mixin": {"walltime": 8},
-  "sage.groups.libgap_morphism": {"walltime": 8},
-  "sage.groups.lie_gps.nilpotent_lie_group": {"walltime": 16},
-  "sage.groups.matrix_gps.finitely_generated": {"walltime": 8},
-  "sage.groups.matrix_gps.heisenberg": {"walltime": 32},
-  "sage.groups.matrix_gps.linear": {"walltime": 8},
-  "sage.groups.perm_gps.cubegroup": {"walltime": 16},
-  "sage.groups.perm_gps.partn_ref.refinement_graphs": {"walltime": 8},
+  "sage.graphs.strongly_regular_db": {"walltime": 8},
+  "sage.groups.cactus_group": {"walltime": 8},
+  "sage.groups.cubic_braid": {"walltime": 8},
+  "sage.groups.lie_gps.nilpotent_lie_group": {"walltime": 8},
+  "sage.groups.matrix_gps.finitely_generated_gap": {"walltime": 8},
   "sage.groups.perm_gps.permgroup": {"walltime": 8},
   "sage.groups.perm_gps.permgroup_named": {"walltime": 8},
-  "sage.homology.hochschild_complex": {"walltime": 8},
   "sage.homology.homology_vector_space_with_basis": {"walltime": 8},
-  "sage.interacts.test_jupyter": {"walltime": 16},
-  "sage.interfaces.ecm": {"walltime": 8},
-  "sage.interfaces.expect": {"walltime": 8},
-  "sage.interfaces.gap": {"walltime": 16},
-  "sage.interfaces.maxima": {"walltime": 8},
-  "sage.interfaces.maxima_abstract": {"walltime": 64},
-  "sage.interfaces.psage": {"walltime": 8},
-  "sage.interfaces.sage0": {"walltime": 8},
-  "sage.lfunctions.zero_sums": {"walltime": 8},
-  "sage.libs.eclib.interface": {"walltime": 16},
+  "sage.interfaces.gap": {"walltime": 8},
+  "sage.interfaces.gap_workspace": {"walltime": 8},
+  "sage.interfaces.sage0": {"walltime": 16},
+  "sage.libs.eclib.interface": {"walltime": 32},
   "sage.libs.eclib.mwrank": {"walltime": 16},
-  "sage.libs.gap.test_long": {"walltime": 32},
-  "sage.libs.giac": {"walltime": 32},
   "sage.manifolds.catalog": {"walltime": 8},
-  "sage.manifolds.chart": {"walltime": 32},
+  "sage.manifolds.chart": {"walltime": 16},
   "sage.manifolds.chart_func": {"walltime": 8},
   "sage.manifolds.continuous_map": {"walltime": 8},
-  "sage.manifolds.differentiable.affine_connection": {"walltime": 128},
+  "sage.manifolds.differentiable.affine_connection": {"walltime": 32},
   "sage.manifolds.differentiable.automorphismfield": {"walltime": 32},
-  "sage.manifolds.differentiable.automorphismfield_group": {"walltime": 8},
   "sage.manifolds.differentiable.bundle_connection": {"walltime": 8},
-  "sage.manifolds.differentiable.characteristic_cohomology_class": {"walltime": 64},
+  "sage.manifolds.differentiable.characteristic_cohomology_class": {"walltime": 8},
   "sage.manifolds.differentiable.curve": {"walltime": 16},
-  "sage.manifolds.differentiable.degenerate": {"walltime": 32},
-  "sage.manifolds.differentiable.degenerate_submanifold": {"walltime": 16},
-  "sage.manifolds.differentiable.diff_form": {"walltime": 64},
+  "sage.manifolds.differentiable.degenerate": {"walltime": 16},
+  "sage.manifolds.differentiable.degenerate_submanifold": {"walltime": 8},
+  "sage.manifolds.differentiable.diff_form": {"walltime": 32},
   "sage.manifolds.differentiable.diff_map": {"walltime": 8},
   "sage.manifolds.differentiable.examples.euclidean": {"walltime": 32},
   "sage.manifolds.differentiable.examples.sphere": {"walltime": 32},
   "sage.manifolds.differentiable.integrated_curve": {"walltime": 32},
-  "sage.manifolds.differentiable.levi_civita_connection": {"walltime": 32},
-  "sage.manifolds.differentiable.manifold": {"walltime": 16},
-  "sage.manifolds.differentiable.manifold_homset": {"walltime": 16},
+  "sage.manifolds.differentiable.levi_civita_connection": {"walltime": 16},
+  "sage.manifolds.differentiable.manifold": {"walltime": 8},
+  "sage.manifolds.differentiable.manifold_homset": {"walltime": 8},
   "sage.manifolds.differentiable.metric": {"walltime": 64},
   "sage.manifolds.differentiable.mixed_form": {"walltime": 16},
-  "sage.manifolds.differentiable.mixed_form_algebra": {"walltime": 8},
   "sage.manifolds.differentiable.multivectorfield": {"walltime": 64},
-  "sage.manifolds.differentiable.pseudo_riemannian": {"walltime": 16},
-  "sage.manifolds.differentiable.pseudo_riemannian_submanifold": {"walltime": 128},
-  "sage.manifolds.differentiable.scalarfield": {"walltime": 16},
+  "sage.manifolds.differentiable.pseudo_riemannian": {"walltime": 8},
+  "sage.manifolds.differentiable.pseudo_riemannian_submanifold": {"walltime": 32},
+  "sage.manifolds.differentiable.scalarfield": {"walltime": 8},
   "sage.manifolds.differentiable.scalarfield_algebra": {"walltime": 8},
-  "sage.manifolds.differentiable.tangent_vector": {"walltime": 16},
+  "sage.manifolds.differentiable.tangent_vector": {"walltime": 8},
   "sage.manifolds.differentiable.tensorfield": {"walltime": 128},
   "sage.manifolds.differentiable.tensorfield_paral": {"walltime": 16},
-  "sage.manifolds.differentiable.vector_bundle": {"walltime": 16},
-  "sage.manifolds.differentiable.vectorfield": {"walltime": 64},
-  "sage.manifolds.differentiable.vectorframe": {"walltime": 8},
+  "sage.manifolds.differentiable.vectorfield": {"walltime": 16},
   "sage.manifolds.point": {"walltime": 16},
   "sage.manifolds.scalarfield": {"walltime": 16},
-  "sage.manifolds.scalarfield_algebra": {"walltime": 8},
-  "sage.manifolds.section": {"walltime": 32},
-  "sage.manifolds.trivialization": {"walltime": 8},
-  "sage.manifolds.vector_bundle": {"walltime": 8},
-  "sage.matrix.benchmark": {"walltime": 8},
+  "sage.manifolds.section": {"walltime": 16},
   "sage.matrix.matrix2": {"walltime": 16},
-  "sage.matrix.matrix_integer_dense": {"walltime": 16},
-  "sage.matrix.matrix_integer_dense_hnf": {"walltime": 32},
-  "sage.matrix.matrix_mod2_dense": {"walltime": 8},
   "sage.matrix.matrix_rational_dense": {"walltime": 8},
   "sage.matrix.special": {"walltime": 8},
-  "sage.matroids.catalog": {"walltime": 64},
   "sage.misc.cachefunc": {"walltime": 16},
-  "sage.misc.cython": {"walltime": 8},
   "sage.misc.functional": {"walltime": 8},
   "sage.misc.randstate": {"walltime": 16},
-  "sage.misc.sagedoc": {"walltime": 64},
-  "sage.misc.sageinspect": {"walltime": 32},
-  "sage.modular.abvar.abvar": {"walltime": 16},
+  "sage.misc.sagedoc": {"walltime": 16},
+  "sage.misc.sageinspect": {"walltime": 16},
+  "sage.misc.trace": {"walltime": 8},
+  "sage.modular.abvar.abvar": {"walltime": 8},
   "sage.modular.abvar.homspace": {"walltime": 8},
-  "sage.modular.abvar.lseries": {"walltime": 8},
-  "sage.modular.arithgroup.arithgroup_perm": {"walltime": 8},
-  "sage.modular.arithgroup.tests": {"walltime": 8},
-  "sage.modular.btquotients.pautomorphicform": {"walltime": 32},
-  "sage.modular.hypergeometric_motive": {"walltime": 16},
-  "sage.modular.local_comp.local_comp": {"walltime": 32},
-  "sage.modular.local_comp.type_space": {"walltime": 16},
-  "sage.modular.modform.ambient_R": {"walltime": 16},
-  "sage.modular.modform.constructor": {"walltime": 8},
-  "sage.modular.modform.cuspidal_submodule": {"walltime": 16},
-  "sage.modular.modform.element": {"walltime": 64},
-  "sage.modular.modform.ring": {"walltime": 64},
-  "sage.modular.modform.space": {"walltime": 8},
+  "sage.modular.btquotients.btquotient": {"walltime": 8},
+  "sage.modular.btquotients.pautomorphicform": {"walltime": 16},
+  "sage.modular.hecke.submodule": {"walltime": 8},
+  "sage.modular.hypergeometric_motive": {"walltime": 8},
+  "sage.modular.local_comp.local_comp": {"walltime": 16},
+  "sage.modular.local_comp.type_space": {"walltime": 8},
+  "sage.modular.modform.element": {"walltime": 32},
   "sage.modular.modform_hecketriangle.abstract_space": {"walltime": 16},
   "sage.modular.modform_hecketriangle.graded_ring_element": {"walltime": 16},
   "sage.modular.modform_hecketriangle.hecke_triangle_group_element": {"walltime": 32},
   "sage.modular.modform_hecketriangle.readme": {"walltime": 16},
-  "sage.modular.modform_hecketriangle.space": {"walltime": 8},
   "sage.modular.modsym.ambient": {"walltime": 16},
   "sage.modular.modsym.space": {"walltime": 8},
-  "sage.modular.pollack_stevens.modsym": {"walltime": 64},
-  "sage.modular.pollack_stevens.padic_lseries": {"walltime": 32},
-  "sage.modules.finite_submodule_iter": {"walltime": 16},
-  "sage.modules.free_module": {"walltime": 16},
-  "sage.modules.free_module_element": {"walltime": 8},
-  "sage.modules.free_module_integer": {"walltime": 32},
-  "sage.modules.free_quadratic_module_integer_symmetric": {"walltime": 8},
-  "sage.modules.torsion_quadratic_module": {"walltime": 16},
+  "sage.modular.overconvergent.genus0": {"walltime": 8},
+  "sage.modular.pollack_stevens.modsym": {"walltime": 8},
+  "sage.modules.fp_graded.morphism": {"walltime": 8},
+  "sage.modules.free_module": {"walltime": 8},
   "sage.parallel.map_reduce": {"walltime": 8},
-  "sage.plot.animate": {"walltime": 16},
-  "sage.plot.arrow": {"walltime": 8},
-  "sage.plot.circle": {"walltime": 8},
-  "sage.plot.complex_plot": {"walltime": 8},
+  "sage.plot.complex_plot": {"walltime": 16},
   "sage.plot.contour_plot": {"walltime": 32},
-  "sage.plot.density_plot": {"walltime": 8},
   "sage.plot.graphics": {"walltime": 32},
   "sage.plot.line": {"walltime": 8},
   "sage.plot.matrix_plot": {"walltime": 16},
@@ -283,115 +154,53 @@
   "sage.plot.plot": {"walltime": 64},
   "sage.plot.plot3d.base": {"walltime": 8},
   "sage.plot.plot3d.implicit_plot3d": {"walltime": 16},
-  "sage.plot.plot3d.implicit_surface": {"walltime": 8},
-  "sage.plot.plot3d.parametric_plot3d": {"walltime": 8},
+  "sage.plot.plot3d.parametric_plot3d": {"walltime": 16},
   "sage.plot.plot3d.parametric_surface": {"walltime": 8},
   "sage.plot.plot3d.plot3d": {"walltime": 16},
-  "sage.plot.plot3d.tachyon": {"walltime": 8},
-  "sage.plot.plot3d.transform": {"walltime": 32},
   "sage.plot.point": {"walltime": 8},
   "sage.plot.polygon": {"walltime": 8},
   "sage.plot.streamline_plot": {"walltime": 8},
-  "sage.quadratic_forms.genera.genus": {"walltime": 16},
-  "sage.quadratic_forms.quadratic_form__automorphisms": {"walltime": 8},
-  "sage.quadratic_forms.quadratic_form__local_representation_conditions": {"walltime": 64},
-  "sage.quadratic_forms.quadratic_form__neighbors": {"walltime": 8},
-  "sage.quadratic_forms.quadratic_form__siegel_product": {"walltime": 8},
   "sage.repl.ipython_extension": {"walltime": 8},
-  "sage.rings.asymptotic.asymptotic_expansion_generators": {"walltime": 64},
+  "sage.rings.asymptotic.asymptotic_expansion_generators": {"walltime": 16},
   "sage.rings.asymptotic.asymptotic_ring": {"walltime": 8},
-  "sage.rings.asymptotic.asymptotics_multivariate_generating_functions": {"walltime": 32},
-  "sage.rings.asymptotic.term_monoid": {"walltime": 8},
-  "sage.rings.continued_fraction": {"walltime": 8},
+  "sage.rings.asymptotic.asymptotics_multivariate_generating_functions": {"walltime": 8},
   "sage.rings.finite_rings.finite_field_base": {"walltime": 8},
-  "sage.rings.function_field.function_field": {"walltime": 128},
-  "sage.rings.function_field.function_field_valuation": {"walltime": 64},
+  "sage.rings.function_field.function_field": {"walltime": 8},
   "sage.rings.function_field.ideal": {"walltime": 8},
-  "sage.rings.function_field.place": {"walltime": 8},
-  "sage.rings.integer": {"walltime": 64},
-  "sage.rings.invariants.invariant_theory": {"walltime": 8},
-  "sage.rings.number_field.bdd_height": {"walltime": 8},
-  "sage.rings.number_field.number_field": {"walltime": 64},
-  "sage.rings.number_field.number_field_element": {"walltime": 16},
-  "sage.rings.number_field.splitting_field": {"walltime": 8},
-  "sage.rings.number_field.totallyreal": {"walltime": 16},
-  "sage.rings.number_field.totallyreal_rel": {"walltime": 8},
-  "sage.rings.padics.padic_base_leaves": {"walltime": 64},
-  "sage.rings.padics.padic_extension_leaves": {"walltime": 64},
-  "sage.rings.padics.padic_generic_element": {"walltime": 16},
-  "sage.rings.padics.padic_lattice_element": {"walltime": 32},
-  "sage.rings.padics.relative_extension_leaves": {"walltime": 32},
+  "sage.rings.lazy_series": {"walltime": 8},
+  "sage.rings.lazy_series_ring": {"walltime": 32},
+  "sage.rings.number_field.number_field": {"walltime": 32},
+  "sage.rings.number_field.number_field_element": {"walltime": 8},
+  "sage.rings.padics.padic_base_leaves": {"walltime": 8},
+  "sage.rings.padics.padic_generic_element": {"walltime": 8},
   "sage.rings.polynomial.multi_polynomial_ideal": {"walltime": 8},
-  "sage.rings.polynomial.multi_polynomial_sequence": {"walltime": 8},
-  "sage.rings.polynomial.ore_function_element": {"walltime": 8},
   "sage.rings.polynomial.polynomial_element": {"walltime": 16},
-  "sage.rings.polynomial.polynomial_rational_flint": {"walltime": 8},
   "sage.rings.qqbar": {"walltime": 16},
-  "sage.rings.tests": {"walltime": 16},
-  "sage.rings.valuation.augmented_valuation": {"walltime": 32},
-  "sage.rings.valuation.mapped_valuation": {"walltime": 64},
-  "sage.rings.valuation.valuation": {"walltime": 8},
-  "sage.sandpiles.sandpile": {"walltime": 16},
+  "sage.sandpiles.sandpile": {"walltime": 8},
   "sage.schemes.curves.affine_curve": {"walltime": 16},
   "sage.schemes.curves.closed_point": {"walltime": 8},
   "sage.schemes.curves.projective_curve": {"walltime": 32},
-  "sage.schemes.cyclic_covers.cycliccover_finite_field": {"walltime": 64},
   "sage.schemes.elliptic_curves.BSD": {"walltime": 8},
   "sage.schemes.elliptic_curves.Qcurves": {"walltime": 8},
-  "sage.schemes.elliptic_curves.constructor": {"walltime": 32},
-  "sage.schemes.elliptic_curves.ell_curve_isogeny": {"walltime": 16},
-  "sage.schemes.elliptic_curves.ell_egros": {"walltime": 32},
-  "sage.schemes.elliptic_curves.ell_finite_field": {"walltime": 8},
+  "sage.schemes.elliptic_curves.ell_curve_isogeny": {"walltime": 8},
   "sage.schemes.elliptic_curves.ell_generic": {"walltime": 8},
-  "sage.schemes.elliptic_curves.ell_modular_symbols": {"walltime": 16},
-  "sage.schemes.elliptic_curves.ell_number_field": {"walltime": 128},
+  "sage.schemes.elliptic_curves.ell_modular_symbols": {"walltime": 8},
   "sage.schemes.elliptic_curves.ell_point": {"walltime": 8},
-  "sage.schemes.elliptic_curves.ell_rational_field": {"walltime": 128},
-  "sage.schemes.elliptic_curves.gal_reps_number_field": {"walltime": 32},
-  "sage.schemes.elliptic_curves.gp_simon": {"walltime": 16},
-  "sage.schemes.elliptic_curves.heegner": {"walltime": 32},
-  "sage.schemes.elliptic_curves.height": {"walltime": 64},
-  "sage.schemes.elliptic_curves.isogeny_class": {"walltime": 32},
-  "sage.schemes.elliptic_curves.isogeny_small_degree": {"walltime": 64},
-  "sage.schemes.elliptic_curves.kraus": {"walltime": 16},
+  "sage.schemes.elliptic_curves.ell_rational_field": {"walltime": 32},
+  "sage.schemes.elliptic_curves.height": {"walltime": 8},
+  "sage.schemes.elliptic_curves.isogeny_small_degree": {"walltime": 16},
   "sage.schemes.elliptic_curves.mod_sym_num": {"walltime": 8},
   "sage.schemes.elliptic_curves.padic_lseries": {"walltime": 8},
-  "sage.schemes.elliptic_curves.padics": {"walltime": 16},
-  "sage.schemes.elliptic_curves.saturation": {"walltime": 16},
-  "sage.schemes.elliptic_curves.sha_tate": {"walltime": 32},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_finite_field": {"walltime": 64},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_generic": {"walltime": 8},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_padic_field": {"walltime": 32},
-  "sage.schemes.hyperelliptic_curves.monsky_washnitzer": {"walltime": 8},
-  "sage.schemes.projective.projective_rational_point": {"walltime": 8},
-  "sage.schemes.riemann_surfaces.riemann_surface": {"walltime": 64},
+  "sage.schemes.elliptic_curves.padics": {"walltime": 8},
+  "sage.schemes.elliptic_curves.sha_tate": {"walltime": 16},
+  "sage.schemes.hyperelliptic_curves.hyperelliptic_padic_field": {"walltime": 16},
+  "sage.schemes.riemann_surfaces.riemann_surface": {"walltime": 32},
   "sage.schemes.toric.chow_group": {"walltime": 8},
-  "sage.schemes.toric.sheaf.klyachko": {"walltime": 8},
-  "sage.stats.distributions.discrete_gaussian_integer": {"walltime": 8},
-  "sage.stats.time_series": {"walltime": 8},
-  "sage.structure.coerce_dict": {"walltime": 32},
   "sage.structure.element": {"walltime": 16},
-  "sage.structure.sage_object": {"walltime": 8},
   "sage.symbolic.expression": {"walltime": 32},
-  "sage.symbolic.integration.integral": {"walltime": 32},
-  "sage.symbolic.random_tests": {"walltime": 32},
+  "sage.symbolic.integration.integral": {"walltime": 16},
   "sage.symbolic.relation": {"walltime": 8},
-  "sage.tests.book_schilling_zabrocki_kschur_primer": {"walltime": 32},
-  "sage.tests.book_stein_ent": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.combinat_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.float_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.graphique_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.graphtheory_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.integration_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.mpoly_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.nonlinear_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.recequadiff_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.graphique_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.numbertheory_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.polynomes_doctest": {"walltime": 16},
-  "sage.tests.cmdline": {"walltime": 64},
-  "sage.tests.gosper-sum": {"walltime": 16},
-  "sage.tests.parigp": {"walltime": 8},
-  "sage.topology.simplicial_complex": {"walltime": 8},
-  "sage.topology.simplicial_complex_examples": {"walltime": 16}
+  "sage.tests.book_schilling_zabrocki_kschur_primer": {"walltime": 16},
+  "sage.tests.book_stein_ent": {"walltime": 8},
+  "sage.topology.simplicial_complex": {"walltime": 16}
 }
diff --git a/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch b/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
deleted file mode 100644
index f2f825e4fb10..000000000000
--- a/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
+++ /dev/null
@@ -1,205 +0,0 @@
-diff --git a/build/pkgs/singular/checksums.ini b/build/pkgs/singular/checksums.ini
-index 2e33a405d36..313463d2fea 100644
---- a/build/pkgs/singular/checksums.ini
-+++ b/build/pkgs/singular/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=singular-VERSION.tar.gz
--sha1=6c2b622d3681e2de3d58d30c654d43d3e32b720c
--md5=abb1e37c794472e7760655358ab66054
--cksum=17455733
-+sha1=28bb3ee97ef48d04dfa96de182fd93eebe08426c
-+md5=fc0a4f5720dadba45a52ee94324ce00c
-+cksum=1573851737
- upstream_url=ftp://jim.mathematik.uni-kl.de/pub/Math/Singular/SOURCES/4-3-1/singular-VERSION.tar.gz
-diff --git a/build/pkgs/singular/package-version.txt b/build/pkgs/singular/package-version.txt
-index 11300c77e7d..66e2bede53a 100644
---- a/build/pkgs/singular/package-version.txt
-+++ b/build/pkgs/singular/package-version.txt
-@@ -1 +1 @@
--4.3.1p1
-+4.3.1p3
-diff --git a/src/sage/libs/singular/decl.pxd b/src/sage/libs/singular/decl.pxd
-index 8e3ac314b67..747a6b1e2fb 100644
---- a/src/sage/libs/singular/decl.pxd
-+++ b/src/sage/libs/singular/decl.pxd
-@@ -574,7 +574,7 @@ cdef extern from "singular/Singular/libsingular.h":
- 
-     # gets a component out of a polynomial vector
- 
--    poly *pTakeOutComp1(poly **, int)
-+    poly *pTakeOutComp(poly **, int)
- 
-     # deep copy p
- 
-diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx
-index d8ea7b07f3c..3a1271cd59f 100644
---- a/src/sage/libs/singular/singular.pyx
-+++ b/src/sage/libs/singular/singular.pyx
-@@ -1726,20 +1726,21 @@ cdef int overflow_check(unsigned long e, ring *_ring) except -1:
- 
-     Whether an overflow occurs or not partially depends
-     on the number of variables in the ring. See trac ticket
--    :trac:`11856`. With Singular 4, it is by default optimized
--    for at least 4 variables on 64-bit and 2 variables on 32-bit,
--    which in both cases makes a maximal default exponent of
--    2^16-1.
-+    :trac:`11856`.
- 
-     EXAMPLES::
- 
-         sage: P.<x,y> = QQ[]
--        sage: y^(2^16-1)
--        y^65535
--        sage: y^2^16
-+        sage: y^(2^30)
-+        Traceback (most recent call last):             # 32-bit
-+        ...                                            # 32-bit
-+        OverflowError: exponent overflow (1073741824)  # 32-bit
-+        y^1073741824  # 64-bit
-+        sage: y^2^32
-         Traceback (most recent call last):
-         ...
--        OverflowError: exponent overflow (65536)
-+        OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+        OverflowError: exponent overflow (4294967296)  # 64-bit
-     """
-     if unlikely(e > _ring.bitmask):
-         raise OverflowError("exponent overflow (%d)"%(e))
-diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py
-index 7dc058a22f0..71494eddbc0 100644
---- a/src/sage/rings/polynomial/multi_polynomial_ideal.py
-+++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py
-@@ -60,7 +60,7 @@
- Note that the result of a computation is not necessarily reduced::
- 
-     sage: (a+b)^17
--    256*a*b^16 + 256*b^17
-+    a*b^16 + b^17
-     sage: S(17) == 0
-     True
- 
-diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-index 4dad016b33f..9bf67dd1425 100644
---- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-+++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-@@ -193,7 +193,7 @@ from sage.libs.singular.decl cimport (
-     p_IsUnit, p_IsOne, p_Series, p_Head, idInit, fast_map_common_subexp, id_Delete,
-     p_IsHomogeneous, p_Homogen, p_Totaldegree,pLDeg1_Totaldegree, singclap_pdivide, singclap_factorize,
-     idLift, IDELEMS, On, Off, SW_USE_CHINREM_GCD, SW_USE_EZGCD,
--    p_LmIsConstant, pTakeOutComp1, singclap_gcd, pp_Mult_qq, p_GetMaxExp,
-+    p_LmIsConstant, pTakeOutComp, singclap_gcd, pp_Mult_qq, p_GetMaxExp,
-     pLength, kNF, p_Neg, p_Minus_mm_Mult_qq, p_Plus_mm_Mult_qq,
-     pDiff, singclap_resultant, p_Normalize,
-     prCopyR, prCopyR_NoSort)
-@@ -1587,7 +1587,8 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_base):
-             9/4
- 
-             sage: P.monomial_quotient(x,y) # Note the wrong result
--            x*y^65535*z^65535
-+            x*y^65535*z^65535      # 32-bit
-+            x*y^1048575*z^1048575  # 64-bit
- 
-             sage: P.monomial_quotient(x,P(1))
-             x
-@@ -2247,10 +2248,11 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             9/4*x^2 - 1/4*y^2 - y - 1
- 
-             sage: P.<x,y> = PolynomialRing(QQ,order='lex')
--            sage: (x^2^15) * x^2^15
-+            sage: (x^2^32) * x^2^32
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (...)
-+            OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+            OverflowError: exponent overflow (...)  # 64-bit
-         """
-         # all currently implemented rings are commutative
-         cdef poly *_p
-@@ -2371,10 +2373,11 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             ValueError: not a 2nd power
- 
-             sage: P.<x,y> = PolynomialRing(QQ,order='lex')
--            sage: (x+y^2^15)^10
-+            sage: (x+y^2^32)^10
-             Traceback (most recent call last):
-             ....
--            OverflowError: exponent overflow (...)
-+            OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+            OverflowError: exponent overflow (...)  # 64-bit
- 
-         Test fractional powers (:trac:`22329`)::
- 
-@@ -3461,7 +3464,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             x^10000
-             no overflow
- 
--            sage: n = 1000
-+            sage: n = 100000
-             sage: try:
-             ....:     f = x^n
-             ....:     f.subs(x = x^n)
-@@ -4567,7 +4570,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
-         l = []
-         for i from 0 <= i < IDELEMS(res):
-             for j from 1 <= j <= IDELEMS(_I):
--                l.append( new_MP(parent, pTakeOutComp1(&res.m[i], j)) )
-+                l.append( new_MP(parent, pTakeOutComp(&res.m[i], 1)) )
- 
-         id_Delete(&fI, r)
-         id_Delete(&_I, r)
-@@ -4635,7 +4638,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
- 
-             sage: f = 3*x
-             sage: f.reduce([2*x,y])
--            3*x
-+            x
- 
-         The reduction is not canonical when ``I`` is not a Groebner
-         basis::
-diff --git a/src/sage/rings/polynomial/plural.pyx b/src/sage/rings/polynomial/plural.pyx
-index 1c9f35e56ba..587511c3888 100644
---- a/src/sage/rings/polynomial/plural.pyx
-+++ b/src/sage/rings/polynomial/plural.pyx
-@@ -1619,10 +1619,10 @@ cdef class NCPolynomial_plural(RingElement):
-             sage: P = A.g_algebra(relations={y*x:-x*y + z},  order='lex')
-             sage: P.inject_variables()
-             Defining x, z, y
--            sage: (x^2^15) * x^2^15
-+            sage: (x^2^31) * x^2^31
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (65536)
-+            OverflowError: exponent overflow (2147483648)
-         """
-         # all currently implemented rings are commutative
-         cdef poly *_p
-@@ -1689,10 +1689,10 @@ cdef class NCPolynomial_plural(RingElement):
-             sage: P = A.g_algebra(relations={y*x:-x*y + z},  order='lex')
-             sage: P.inject_variables()
-             Defining x, z, y
--            sage: (x+y^2^15)^10
-+            sage: (x+y^2^31)^10
-             Traceback (most recent call last):
-             ....
--            OverflowError: exponent overflow (327680)
-+            OverflowError: exponent overflow (2147483648)
-         """
-         if type(exp) is not Integer:
-             try:
-diff --git a/src/sage/structure/element.pyx b/src/sage/structure/element.pyx
-index b5d83ef71b6..5c45b3fb528 100644
---- a/src/sage/structure/element.pyx
-+++ b/src/sage/structure/element.pyx
-@@ -2705,10 +2705,10 @@ cdef class RingElement(ModuleElement):
-         with Singular 4::
- 
-             sage: K.<x,y> = ZZ[]
--            sage: (x^12345)^54321
-+            sage: (x^123456)^654321
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (670592745)
-+            OverflowError: exponent overflow (...)
-         """
-         return arith_generic_power(self, n)
- 
diff --git a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch b/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
deleted file mode 100644
index ee0f0e656b28..000000000000
--- a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py
-index d5f7157217f..8ca1f958039 100644
---- a/src/sage/rings/number_field/number_field_ideal.py
-+++ b/src/sage/rings/number_field/number_field_ideal.py
-@@ -996,16 +996,38 @@ def is_prime(self):
-             False
-             sage: K.ideal(17).is_prime()  # ramified
-             False
-+
-+        TESTS:
-+
-+        Check that we do not factor the norm of the ideal, this used
-+        to take half an hour, see :trac:`33360`::
-+
-+            sage: K.<a,b,c> = NumberField([x^2-2,x^2-3,x^2-5])
-+            sage: t = (((-2611940*c + 1925290/7653)*b - 1537130/7653*c
-+            ....:       + 10130950)*a + (1343014/7653*c - 8349770)*b
-+            ....:       + 6477058*c - 2801449990/4002519)
-+            sage: t.is_prime()
-+            False
-         """
-         try:
-             return self._pari_prime is not None
-         except AttributeError:
--            F = self.factor()  # factorization with caching
--            if len(F) != 1 or F[0][1] != 1:
--                self._pari_prime = None
--            else:
--                self._pari_prime = F[0][0]._pari_prime
--            return self._pari_prime is not None
-+            pass
-+
-+        K = self.number_field().pari_nf()
-+        I = self.pari_hnf()
-+
-+        candidate = K.idealismaximal(I) or None
-+
-+        # PARI uses probabilistic primality testing inside idealismaximal().
-+        if get_flag(None, 'arithmetic'):
-+            # proof required, check using isprime()
-+            if candidate and not candidate[0].isprime():
-+                candidate = None
-+
-+        self._pari_prime = candidate
-+
-+        return self._pari_prime is not None
- 
-     def pari_prime(self):
-         r"""
diff --git a/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch b/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
deleted file mode 100644
index 91f06fd4d173..000000000000
--- a/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-diff --git a/src/sage/misc/persist.pyx b/src/sage/misc/persist.pyx
-index 3ac5f1cc2b0..cb1f327c199 100644
---- a/src/sage/misc/persist.pyx
-+++ b/src/sage/misc/persist.pyx
-@@ -157,7 +157,7 @@ def load(*filename, compress=True, verbose=True, **kwargs):
-         ....:     _ = f.write(code)
-         sage: load(t)
-         sage: hello
--        <fortran object>
-+        <fortran ...>
-     """
-     import sage.repl.load
-     if len(filename) != 1:
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index 6f0aeab87ae..b77c69b2f77 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -461,6 +461,8 @@ def complex_to_rgb(z_values, contoured=False, tiled=False,
-             rgb[i, j, 2] = b
- 
-     sig_off()
-+    nan_indices = np.isnan(rgb).any(-1)     # Mask for undefined points
-+    rgb[nan_indices] = 1                    # Make nan_indices white
-     return rgb
- 
- 
-diff --git a/src/sage/plot/histogram.py b/src/sage/plot/histogram.py
-index 3bc2b76b58e..388c2d1391d 100644
---- a/src/sage/plot/histogram.py
-+++ b/src/sage/plot/histogram.py
-@@ -87,13 +87,8 @@ def get_minmax_data(self):
- 
-         TESTS::
- 
--            sage: h = histogram([10,3,5], normed=True)[0]
--            doctest:warning...:
--            DeprecationWarning: the 'normed' option is deprecated. Use 'density' instead.
--            See https://trac.sagemath.org/25260 for details.
-+            sage: h = histogram([10,3,5], density=True)[0]
-             sage: h.get_minmax_data()
--            doctest:warning ...
--            ...VisibleDeprecationWarning: Passing `normed=True` on non-uniform bins has always been broken, and computes neither the probability density function nor the probability mass function. The result is only correct if the bins are uniform, when density=True will produce the same result anyway. The argument will be removed in a future version of numpy.
-             {'xmax': 10.0, 'xmin': 3.0, 'ymax': 0.476190476190..., 'ymin': 0}
-         """
-         import numpy
-diff --git a/src/sage/repl/ipython_extension.py b/src/sage/repl/ipython_extension.py
-index 798671aab42..cad6a47ca8b 100644
---- a/src/sage/repl/ipython_extension.py
-+++ b/src/sage/repl/ipython_extension.py
-@@ -405,7 +405,7 @@ def fortran(self, line, cell):
-             ....: C END FILE FIB1.F
-             ....: ''')
-             sage: fib
--            <fortran object>
-+            <fortran ...>
-             sage: from numpy import array
-             sage: a = array(range(10), dtype=float)
-             sage: fib(a, 10)
diff --git a/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch b/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
deleted file mode 100644
index 2769e87f6a4b..000000000000
--- a/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-diff --git a/src/sage/interfaces/tachyon.py b/src/sage/interfaces/tachyon.py
-index 23671e50892..ce1d50f71bc 100644
---- a/src/sage/interfaces/tachyon.py
-+++ b/src/sage/interfaces/tachyon.py
-@@ -683,12 +683,14 @@
- #*****************************************************************************
- 
- import os
-+import re
- 
- from sage.cpython.string import bytes_to_str
- from sage.misc.pager import pager
- from sage.misc.superseded import deprecation
- from sage.misc.temporary_file import tmp_filename
- from sage.structure.sage_object import SageObject
-+from sage.misc.cachefunc import cached_method
- 
- 
- class TachyonRT(SageObject):
-@@ -799,6 +801,11 @@ def __call__(self, model, outfile='sage.png', verbose=1, extra_opts=''):
-             Parser failed due to an input file syntax error.
-             Aborting render.
-         """
-+        if self.version() >= '0.99.2':
-+            # this keyword was changed in 0.99.2
-+            model = model.replace(
-+                    "              focallength ",
-+                    "              focaldist ")
-         modelfile = tmp_filename(ext='.dat')
-         with open(modelfile, 'w') as file:
-             file.write(model)
-@@ -851,6 +858,25 @@ def usage(self, use_pager=True):
-         else:
-             print(r)
- 
-+    @cached_method
-+    def version(self):
-+        """
-+        Returns the version of the Tachyon raytracer being used.
-+
-+        TESTS::
-+
-+            sage: tachyon_rt.version()  # random
-+            0.98.9
-+            sage: tachyon_rt.version() >= '0.98.9'
-+            True
-+        """
-+        with os.popen('tachyon') as f:
-+            r = f.readline()
-+        res = re.search(r"Version ([\d.]*)", r)
-+        # debian patches tachyon so it won't report the version
-+        # we hardcode '0.99' since that's indeed the version they ship
-+        return res[1] if res else '0.99'
-+
-     def help(self, use_pager=True):
-         """
-         Deprecated: type 'sage.interfaces.tachyon?' for help
diff --git a/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch b/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
deleted file mode 100644
index 11eb20d4f735..000000000000
--- a/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff --git a/src/sage/arith/long.pxd b/src/sage/arith/long.pxd
-index 1c9a53387a0..d96b98f247c 100644
---- a/src/sage/arith/long.pxd
-+++ b/src/sage/arith/long.pxd
-@@ -270,6 +270,17 @@ cdef inline bint integer_check_long_py(x, long* value, int* err):
-         sage: L += [-x for x in L] + [0, long_min()]
-         sage: for v in L:
-         ....:     assert check_long_py(int(v)) == v
-+        sage: check_long_py(int(2^60))
-+        1152921504606846976                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^61))
-+        2305843009213693952                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^62))
-+        4611686018427387904                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^63))
-+        'Overflow (...)'
-         sage: check_long_py(int(2^100))
-         'Overflow (...)'
-         sage: check_long_py(int(long_max() + 1))
-@@ -309,7 +320,12 @@ cdef inline bint integer_check_long_py(x, long* value, int* err):
- 
-     cdef long lead
-     cdef long lead_2_overflow = (<long>1) << (BITS_IN_LONG - PyLong_SHIFT)
--    cdef long lead_3_overflow = (<long>1) << (BITS_IN_LONG - 2 * PyLong_SHIFT)
-+    cdef long lead_3_overflow
-+    if BITS_IN_LONG < 2 * PyLong_SHIFT:
-+        # in this case 3 digit is always overflow
-+        lead_3_overflow = 0
-+    else:
-+        lead_3_overflow = (<long>1) << (BITS_IN_LONG - 2 * PyLong_SHIFT)
-     if size == 0:
-         value[0] = 0
-         err[0] = 0
diff --git a/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch b/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
deleted file mode 100644
index c4d7d5c779d1..000000000000
--- a/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/src/sage/schemes/toric/sheaf/klyachko.py b/src/sage/schemes/toric/sheaf/klyachko.py
-index b1304a16913..77fae4b7545 100644
---- a/src/sage/schemes/toric/sheaf/klyachko.py
-+++ b/src/sage/schemes/toric/sheaf/klyachko.py
-@@ -26,7 +26,7 @@
-     (0, 0, 18, 16, 1)
-     sage: Gtilde = G_sum.random_deformation()
-     sage: V = Gtilde.wedge(2) * K                     # long time
--    sage: V.cohomology(dim=True, weight=(0,0,0,0))    # long time
-+    sage: V.cohomology(dim=True, weight=(0,0,0,0))    # long time  # random failure (see #32773)
-     (0, 0, 3, 0, 0)
- 
- REFERENCES:
-@@ -948,7 +948,7 @@ def random_deformation(self, epsilon=None):
-            sage: V.cohomology(dim=True, weight=(0,))
-            (1, 0)
-            sage: Vtilde = V.random_deformation()
--           sage: Vtilde.cohomology(dim=True, weight=(0,))
-+           sage: Vtilde.cohomology(dim=True, weight=(0,))  # random failure (see #32773)
-            (1, 0)
-         """
-         filt = self._filt.random_deformation(epsilon)
diff --git a/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch b/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
deleted file mode 100644
index d9a9835c696b..000000000000
--- a/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 9ac7840134054155545e24fa3e66402d42b91c0f Mon Sep 17 00:00:00 2001
-From: Antonio Rojas <arojas@archlinux.org>
-Date: Fri, 20 Jan 2023 21:36:27 +0100
-Subject: [PATCH] Fix tests with giac 1.9.0.35
-
----
- src/sage/libs/giac/giac.pyx   |  3 +--
- src/sage/symbolic/relation.py | 15 +++++----------
- 2 files changed, 6 insertions(+), 12 deletions(-)
-
-diff --git a/src/sage/libs/giac/giac.pyx b/src/sage/libs/giac/giac.pyx
-index 4e451dba5e7..ccad5169836 100644
---- a/src/sage/libs/giac/giac.pyx
-+++ b/src/sage/libs/giac/giac.pyx
-@@ -374,8 +374,7 @@ def _giac(s):
- 
-         sage: x = libgiac('x')
-         sage: (1+2*sin(3*x)).solve(x).simplify()
--        Warning, argument is not an equation, solving 1+2*sin(3*x)=0
--        list[-pi/18,7*pi/18]
-+        ...list[-pi/18,7*pi/18]
- 
-         sage: libgiac.solve('sin(3*x)>2*sin(x)',x)
-         Traceback (most recent call last):
-diff --git a/src/sage/symbolic/relation.py b/src/sage/symbolic/relation.py
-index e9dbc0fea30..b8896a94be9 100644
---- a/src/sage/symbolic/relation.py
-+++ b/src/sage/symbolic/relation.py
-@@ -935,8 +935,7 @@ def solve(f, *args, **kwds):
- 
-         sage: f = (sin(x) - 8*cos(x)*sin(x))*(sin(x)^2 + cos(x)) - (2*cos(x)*sin(x) - sin(x))*(-2*sin(x)^2 + 2*cos(x)^2 - cos(x))
-         sage: solve(f, x, algorithm='giac')
--        ...
--        [-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-+        ...[-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
- 
-         sage: x, y = SR.var('x,y')
-         sage: solve([x+y-4,x*y-3],[x,y],algorithm='giac')
-@@ -1440,19 +1439,15 @@ def _giac_solver(f, x, solution_dict=False):
-     EXAMPLES::
- 
-         sage: solve([(2/3)^x-2], [x], algorithm='giac')
--        ...
--        [[-log(2)/(log(3) - log(2))]]
-+        ...[[-log(2)/(log(3) - log(2))]]
-         sage: solve([(2/3)^x-2], [x], algorithm='giac', solution_dict=True)
--        ...
--        [{x: -log(2)/(log(3) - log(2))}]
-+        ...[{x: -log(2)/(log(3) - log(2))}]
- 
-         sage: f = (sin(x) - 8*cos(x)*sin(x))*(sin(x)^2 + cos(x)) - (2*cos(x)*sin(x) - sin(x))*(-2*sin(x)^2 + 2*cos(x)^2 - cos(x))
-         sage: solve(f, x, algorithm='giac')
--        ...
--        [-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-+        ...[-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-         sage: solve(f, x, algorithm='giac', solution_dict=True)
--        ...
--        [{x: -2*arctan(sqrt(2))}, {x: 0}, {x: 2*arctan(sqrt(2))}, {x: pi}]
-+        ...[{x: -2*arctan(sqrt(2))}, {x: 0}, {x: 2*arctan(sqrt(2))}, {x: pi}]
- 
-         sage: x, y = SR.var('x,y')
-         sage: solve([x+y-7,x*y-10],[x,y],algorithm='giac')
diff --git a/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch b/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
deleted file mode 100644
index 499e0c71e256..000000000000
--- a/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
+++ /dev/null
@@ -1,1303 +0,0 @@
-diff --git a/build/pkgs/gap/checksums.ini b/build/pkgs/gap/checksums.ini
-index 066e943308a..b0ea8ba8818 100644
---- a/build/pkgs/gap/checksums.ini
-+++ b/build/pkgs/gap/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=gap-VERSION.tar.gz
--sha1=4ecdd281b8f430282fb9b12690b06e0a26abde10
--md5=85dc9e459d5b6c66fcad9f468afd3e3e
--cksum=1351843158
-+sha1=a6e36f3f874a2c46f51561402634497eab705cca
-+md5=c5cd9f272f2703d7a3649ad7193b2d90
-+cksum=2760477284
- upstream_url=https://github.com/gap-system/gap/releases/download/vVERSION/gap-VERSION.tar.gz
-diff --git a/build/pkgs/gap/package-version.txt b/build/pkgs/gap/package-version.txt
-index d782fca8f64..f1cd7de1de5 100644
---- a/build/pkgs/gap/package-version.txt
-+++ b/build/pkgs/gap/package-version.txt
-@@ -1 +1 @@
--4.11.1
-+4.12.2
-diff --git a/build/pkgs/gap/spkg-check.in b/build/pkgs/gap/spkg-check.in
-index d9791d33293..d2fccda6e04 100644
---- a/build/pkgs/gap/spkg-check.in
-+++ b/build/pkgs/gap/spkg-check.in
-@@ -3,6 +3,13 @@ cd src
- # #28728: Fix test failure in tst/testinstall/strings.tst
- export LC_CTYPE=en_US.UTF-8
- 
-+# #34391: in GAP 4.12 some packages need GAP package io
-+#         to let tests run, otherwise this hangs. Thus we install io here.
-+cd pkg/io
-+./configure --with-gaproot=../..
-+make
-+cd ../..
-+
- make testinstall
- if [[ $? -ne 0 ]]; then
-     exit 1
-diff --git a/build/pkgs/gap/spkg-install.in b/build/pkgs/gap/spkg-install.in
-index 2ceadf99db4..e2c8b4dca54 100644
---- a/build/pkgs/gap/spkg-install.in
-+++ b/build/pkgs/gap/spkg-install.in
-@@ -8,8 +8,7 @@ export CFLAGS=$CFLAGS_NON_NATIVE
- export CXXFLAGS=$CXXFLAGS_NON_NATIVE
- 
- GAP_BUILD_ROOT="$(pwd)"
--GAP_ROOT="$SAGE_LOCAL/share/gap"
--DESTDIR_GAP_ROOT="$SAGE_DESTDIR$GAP_ROOT"
-+GAP_ROOT="$SAGE_LOCAL/lib/gap"
- 
- # Enable debug info if requested.
- # Note that -g3 allows you to use preprocessor macros in gdb which are widely used
-@@ -17,37 +16,17 @@ if [ "$SAGE_DEBUG" = yes ] ; then
-     export CFLAGS="-O0 -g3 -DDEBUG_MASTERPOINTERS -DDEBUG_GLOBAL_BAGS -DDEBUG_FUNCTIONS_BAGS $CFLAGS"
- fi
- 
--sdh_configure $SAGE_CONFIGURE_GMP
--sdh_make -j1
-+# LDFLAGS hack below needed by Semigroups package
-+sdh_configure $SAGE_CONFIGURE_GMP LDFLAGS="-pthread" --prefix=$SAGE_LOCAL
-+sdh_make
- 
--# GAP's "make install" is work in progress; we use bits and pieces of it
--# but we install many things manually.
--sdh_make install-headers install-libgap
--
--# Install config.h, which is not currently handled by `make install-headers`
--sdh_install gen/config.h "$SAGE_LOCAL/include/gap"
--
--# Now install the gap executable as "gap-bin"; it will be called normally
--# through our wrapper script that sets the appropriate GAP_ROOT
--SAGE_BIN="$SAGE_LOCAL/bin"
--mkdir -p "$SAGE_DESTDIR$SAGE_BIN" || sdh_die "Failed to create the directory $SAGE_BIN"
--
--./libtool --mode=install install gap "$SAGE_DESTDIR$SAGE_BIN/gap-bin" || \
--    sdh_die "Failed to install gap-bin to $SAGE_BIN"
--
--./libtool --mode=install install gac "$SAGE_DESTDIR$SAGE_BIN/gac" || \
--    sdh_die "Failed to install gac to $SAGE_BIN"
--
--# Now copy additional files GAP needs to run (and a few optional bits) into
--# GAP_ROOT; we don't need everything from the source tree
--sdh_install bin doc gen grp lib src tst sysinfo.gap "$GAP_ROOT"
--
--# GAP's copy of libtool is also used by the toolchain for build GAP packages
--# (i.e. by gac)
--sdh_install libtool "$GAP_ROOT"
-+sdh_make_install
-+# sdh_make install-headers install-libgap
-+# The 'packagemanager' package expects this https://github.com/gap-packages/PackageManager/issues/105
-+mkdir -p "$SAGE_LOCAL/lib/gap/bin"
- 
- # Install only the minimal packages GAP needs to run
--sdh_install pkg/GAPDoc-* pkg/primgrp-* pkg/SmallGrp-* pkg/transgrp "$GAP_ROOT"/pkg
-+sdh_install pkg/gapdoc pkg/primgrp pkg/smallgrp pkg/transgrp "$GAP_ROOT"/pkg
- 
- # Install additional packages that are not strictly required, but that are
- # typically "expected" to be loaded: These are the default packages that are
-@@ -58,50 +37,25 @@ sdh_install pkg/GAPDoc-* pkg/primgrp-* pkg/SmallGrp-* pkg/transgrp "$GAP_ROOT"/p
- # Also include atlasrep which is a dependency of tomlib
- sdh_install \
-     pkg/atlasrep \
--    pkg/autpgrp-* \
--    pkg/alnuth-* \
--    pkg/crisp-* \
--    pkg/ctbllib-* \
--    pkg/FactInt-* \
-+    pkg/autodoc \
-+    pkg/autpgrp \
-+    pkg/alnuth \
-+    pkg/crisp \
-+    pkg/ctbllib \
-+    pkg/factint \
-     pkg/fga \
--    pkg/irredsol-* \
--    pkg/laguna-* \
--    pkg/PackageManager-* \
--    pkg/polenta-* \
--    pkg/polycyclic-* \
--    pkg/resclasses-* \
--    pkg/sophus-* \
--    pkg/tomlib-* \
-+    pkg/irredsol \
-+    pkg/laguna \
-+    pkg/packagemanager \
-+    pkg/polenta \
-+    pkg/polycyclic \
-+    pkg/radiroot \
-+    pkg/resclasses \
-+    pkg/sophus \
-+    pkg/tomlib \
-+    pkg/utils \
-     "$GAP_ROOT"/pkg
- 
--# Install the GAP startup script; ensure it is executable
--sdh_install -T ../gap "$SAGE_BIN/gap"
--chmod +x "$SAGE_DESTDIR$SAGE_BIN/gap"
--
--# Create symlinks under $GAP_ROOT for these executables, as they are expected
--# (especially when building kernel packages) to exist
--ln -sf "../../bin/gap-bin" "$DESTDIR_GAP_ROOT/gap"
--ln -sf "../../bin/gac" "$DESTDIR_GAP_ROOT/gac"
--
--# Fix the $GAP_ROOT/bin/<arch>/src symlink to be relative (otherwise it links
--# to the actual path of the sources GAP was compiled from)
--for srclink in "$DESTDIR_GAP_ROOT"/bin/*/src; do
--    rm -f "$srclink"
--    ln -s "../../src" "$srclink"
--done
--
--# Additional fixups for some files after they have been copied into their
--# destination directory.  gac and sysinfo.gap are generated files that contain
--# in them hard-coded references to the GAP build directory, which will soon
--# be going away.  This breaks the build toolchain for some compiled GAP
--# packages.  We need to replace these paths with the final GAP_ROOT path.  The
--# below will work so long as neither of these paths contain '|', and if they do
--# then god help you.  https://trac.sagemath.org/ticket/27218
--sed -i -e "s|$GAP_BUILD_ROOT|$GAP_ROOT|g" \
--    "$SAGE_DESTDIR$SAGE_BIN/gac" "$DESTDIR_GAP_ROOT/sysinfo.gap" \
--    "$DESTDIR_GAP_ROOT/bin/gap.sh" "$DESTDIR_GAP_ROOT/doc/make_doc" || \
--    sdh_die "Failed to fix up hard-coded paths in GAP build tools."
--
- # TODO: This seems unnecessary--we are already installing all of doc/ to
- # GAP_ROOT, which is necessary for some functionality in GAP to work.  Do
- # we need this?  Maybe doc/gap could just be a symlink to gap/doc??
-diff --git a/build/pkgs/gap/spkg-legacy-uninstall b/build/pkgs/gap/spkg-legacy-uninstall
-index d17eb939eb7..a8e5c59e1fb 100755
---- a/build/pkgs/gap/spkg-legacy-uninstall
-+++ b/build/pkgs/gap/spkg-legacy-uninstall
-@@ -4,6 +4,8 @@ rm -rf "$SAGE_LOCAL/gap/gap-4."*
- rm -rf "$SAGE_SHARE/gap"
- rm -f "$SAGE_LOCAL/gap/latest"
- rm -f "$SAGE_LOCAL/bin/gap"
-+rm -f "$SAGE_LOCAL/bin/gac"
- 
--# Remove old libgap headers
-+# Remove old libgap headers and library
- rm -rf "$SAGE_LOCAL/include/gap"
-+rm -rf "$SAGE_LOCAL/lib/gap"
-diff --git a/build/pkgs/gap/spkg-prerm.in b/build/pkgs/gap/spkg-prerm.in
-deleted file mode 100644
-index 661d92621fa..00000000000
---- a/build/pkgs/gap/spkg-prerm.in
-+++ /dev/null
-@@ -1,6 +0,0 @@
--# These generated files are placed in directory provided by the SPKG, so
--# delete the generated files first so that their parent directories can be
--# removed during installation
--GAP_ROOT="$SAGE_LOCAL/share/gap"
--rm -f "$GAP_ROOT/pkg/atlasrep/datagens/"*.*
--rm -f "$GAP_ROOT/pkg/atlasrep/dataword/"*.*
-diff --git a/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch b/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch
-deleted file mode 100644
-index e45fe7d9c6f..00000000000
---- a/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch
-+++ /dev/null
-@@ -1,150 +0,0 @@
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c b/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--index 3bbdc45..7df699f 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--@@ -8,9 +8,8 @@ extern short sp[],**mat[],*psp[],**imcos[],**cpco[],lorb[],
-- short *cst,**cpst,***cdpst,**svptr,*cp,*rel;
-- short *spst,**pspst,**pptr,**cpptr,npt,nb,nph,nph2,npg,npg2,
--       rno,orno,coh_index,*invg;
---FILE  *ip,*op;
-- 
---void seeknln (void) { while (getc(ip)!='\n'); }
--+void seeknln (FILE *ip) { while (getc(ip)!='\n'); }
-- 
-- /* This program differs from most other permutation programs in that perms are
--    all stored in the single array sp. Schreier vectors are stored in the short
--@@ -23,13 +22,14 @@ void seeknln (void) { while (getc(ip)!='\n'); }
-- int 
-- crprog1 (void)
-- { short *pc,*qc,ex,neg; int x;
--+  FILE  *ip,*op;
--   short i,j,k,l,m,n,cl,rl,*p,ocl,im,pt,pt1,pn,ipt;
--   if ((ip=fopen(inf2,"r"))== 0)
--   { fprintf(stderr,"Cannot open %s.\n",inf2); return(-1);}
--   fscanf(ip,"%hd%hd%hd%hd",&npt,&nph,&nb,&k);
--   if (nb>=mb) {fprintf(stderr,"nb too big. Increase MB.\n"); return(-1);}
--   if (k<=2) {fprintf(stderr,"inf2 has illegal format.\n"); return(-1); }
---  seeknln(); seeknln();
--+  seeknln(ip); seeknln(ip);
--   for (i=1;i<=nb;i++) fscanf(ip,"%hd",lorb+i);
--   pptr=psp-1; pspst=psp+nph; svptr=cpsp-1;  cpst=cpsp+nb;
--   invg=sp; nph2=2*nph; spst=sp+nph2;
--@@ -37,7 +37,7 @@ crprog1 (void)
--   { pptr[i]=spst+(i-1)*npt-1; p=pptr[i];
--     for (j=1;j<=npt;j++) {fscanf(ip,"%hd",&k); p[k]=j; }
--     invg[2*i-2]=2*i-1; invg[2*i-1]=2*i-2;
---    seeknln();
--+    seeknln(ip);
--   }
--   spst+=(npt*nph);
--   for (i=1;i<=nb;i++)
--@@ -75,7 +75,7 @@ crprog1 (void)
--   strcpy(inf1,inf0); strcat(inf1,".rel");
--   if ((ip=fopen(inf1,"r"))==0)
--   { fprintf(stderr,"Cannot open %s.\n",inf1); return(-1);}
---  fscanf(ip,"%hd%hd",&k,&rno); seeknln();
--+  fscanf(ip,"%hd%hd",&k,&rno); seeknln(ip);
--   op=fopen(outft,"w");
-- /* Now we have read everything in, and the computation can start */
--   orno=0;
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--index a7396b2..658496f 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--@@ -20,8 +20,6 @@ short  mexp=MEXP,mcl=MCL,no,rel[RSP],wt[MEXP],exp,*rpf,*rpb,
-- extern short  prime,dim,*spv,**spm,mspace[],*vec[],**mat[],cp[],pinv[],opmats,
--         mm,mv;
-- extern int msp;
---FILE *ip,*op;
---
-- 
-- int 
-- calcmats (void)
--@@ -59,7 +57,7 @@ calcmats (void)
--   }
--   for (i=1;i<=exp;i++) trans(mat[i+exp],mat[i]);
--   if (opmats)
---  { op=fopen(outf,"w");
--+  { FILE *op=fopen(outf,"w");
--     fprintf(op,"%4d%4d%4d\n",prime,dim,exp);
--     for (i=1;i<=exp;i++) printmat(mat[i]); 
--     fclose(op);
--@@ -71,6 +69,7 @@ int
-- rdmats (void)
-- /* reads matrices of generators of P */
-- { short i; int quot;
--+  FILE *ip;
--   ip=fopen(inf4,"r");
--   if (ip==0)
--   { fprintf(stderr,"Cannot open %s\n ",inf4); return(-1); }
--@@ -90,12 +89,12 @@ rdmats (void)
--   fclose(ip);
--   return(0);
-- }
---FILE *ip;
-- 
-- int 
-- ingp (int inp)
-- /* Read in output of respcrun -s */
-- { short i,j,k,l,m,*orpf,**pcp;
--+  FILE *ip;
--   ip=fopen(inf3,"r");
--   if (ip==0) { fprintf(stderr,"Cannot open %s\n",inf3); return(-1); }
--   fscanf(ip,"%hd%hd%hd%hd%hd%hd",&prime,&exp,&i,&no,&j,&m);
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--index 0896551..6841bc8 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--@@ -9,7 +9,6 @@ extern short  intexp,mexp,mng,wksp,
--        spugen[],*tlintg[];
-- extern int ptrsp,rsp;
-- short  fac;
---FILE *ip,*op;
-- 
-- int 
-- ingp (void)
--@@ -18,6 +17,7 @@ ingp (void)
--    of nqrun, and tails are also read in.
-- */
-- { short i,j,k,l,m,x,y,no,*orpf,*orpb,**pcp;  char tails;
--+  FILE *ip;
--   if ((ip=fopen(inf1,"r"))==0)
--   { fprintf(stderr,"Cannot open %s.\n",inf1); return(-1); }
--   fscanf(ip,"%hd%hd%hd%hd%hd%hd",&prime,&exp,&nng,&no,&class,&m);
--@@ -89,6 +89,7 @@ int
-- outgp (void)
-- /* The PCP is output, together with tails */
-- { short i,k,l,**pcp,*b,*e,*c;
--+  FILE *op;
--   op=fopen(outf,"w");
--   fprintf(op,"%4d%4d%4d%4d%4d%4d\n",prime,exp,nng,exp,class,1);
--   for (i=1;i<=exp;i++) fprintf(op,"%4d",wt[i]); fprintf(op,"\n");
--@@ -379,7 +380,7 @@ restart:
--     nng--; mnng--; enexpnt--;
--     if (nng==0)
--     { if (gap)
---      { op=fopen(outfm,"w"); fprintf(op,"COHOMOLO.Multiplier:=[];\n");
--+      { FILE *op=fopen(outfm,"w"); fprintf(op,"COHOMOLO.Multiplier:=[];\n");
--         fclose(op);
--         printf("All new generators eliminated. Multiplier is trivial.\n");
--       }
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--index 01cf914..0144883 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--@@ -9,7 +9,6 @@ extern short  intexp,mng,mexp,wksp,
--        spugen[],*intg[],*imintg[],*tlintg[];
-- extern int ptrsp,rsp;
-- short  *wf,*wc; char norm;
---FILE *ip,*op;
-- 
-- /* The data structures for this program and for nqrun are similar.
--    d1 and d2 contain definitions of generators. (Def. comes from commutator
--@@ -35,6 +34,7 @@ nqmprog (void)
-- { short i,j,k,l,m,d,*gi,*gj,*ti,*tj,cl,def,*ps,*pf,**dp,*nrpb,*p,*orpf,*orpb,
--         nb,np,k1,*rno,*covrel,**pgen,tdef,sgn;
--   char nt;
--+  FILE *ip,*op;
--   if (ingp() == -1) {fprintf(stderr,"Input error.\n"); return(-1); }
--   eexpnt=expnt+exp; enexpnt=nexpnt+nng;
-- 
-diff --git a/build/pkgs/gap_packages/patches/guava_leon_includes.patch b/build/pkgs/gap_packages/patches/guava_leon_includes.patch
-deleted file mode 100644
-index cdcd19cc3e8..00000000000
---- a/build/pkgs/gap_packages/patches/guava_leon_includes.patch
-+++ /dev/null
-@@ -1,13 +0,0 @@
----- a/pkg/guava-3.15/src/leon/src/generate.c	Sat Feb 29 09:02:10 2020
----- b/pkg/guava-3.15/src/leon/src/generate.c	Thu Sep 24 13:58:36 2020
--***************
--*** 115,120 ****
----- 115,122 ----
--  #include "groupio.h"
--  #include "enum.h"
--  #include "storage.h"
--+ #include "chbase.h"
--+ #include "inform.h"
--  
--  #ifdef ALT_TIME_HEADER
--  #include "cputime.h"
-diff --git a/build/pkgs/gap_packages/spkg-install.in b/build/pkgs/gap_packages/spkg-install.in
-index 168e6b11532..6dff182a48f 100644
---- a/build/pkgs/gap_packages/spkg-install.in
-+++ b/build/pkgs/gap_packages/spkg-install.in
-@@ -1,4 +1,4 @@
--GAP_ROOT="$SAGE_LOCAL/share/gap"
-+GAP_ROOT="$SAGE_LOCAL/lib/gap"
- PKG_DIR="$GAP_ROOT/pkg"
- 
- PKG_SRC_DIR="$(pwd)/src/pkg"
-@@ -11,33 +11,31 @@ cd "$PKG_SRC_DIR"
- #    (GAP 4.8.6 still had it, but this is gone in 4.10)
- 
- sdh_install \
--    aclib-* \
--    AutoDoc-* \
--    corelg-* \
--    crime-* \
-+    aclib \
-+    corelg \
-+    crime \
-     cryst \
-     crystcat \
--    design-* \
-+    design \
-     gbnp \
--    genss-* \
--    hap-* \
--    hapcryst-* \
--    hecke-* \
--    images-* \
--    liealgdb-* \
--    liepring-* \
--    liering-* \
--    loops-* \
--    MapClass-* \
--    polymaking-* \
--    qpa-* \
--    quagroup-* \
--    radiroot-* \
--    repsn-* \
--    sla-* \
--    sonata-* \
--    Toric-* \
--    utils-* \
-+    genss \
-+    hap \
-+    hapcryst \
-+    hecke \
-+    images \
-+    liealgdb \
-+    liepring \
-+    liering \
-+    loops \
-+    mapclass \
-+    polymaking \
-+    qpa \
-+    quagroup \
-+    repsn \
-+    singular \
-+    sla \
-+    sonata \
-+    toric \
-     "$PKG_DIR"
- 
- install_compiled_pkg()
-@@ -45,27 +43,23 @@ install_compiled_pkg()
-     local pkg="$1"
-     # Install the bin/ dir (where compiled modules should end up)
-     # under <prefix>/lib/gap; we then symlink to it later
--    sdh_install bin "$SAGE_LOCAL/lib/gap/pkg/$pkg"
-+    sdh_install * "$SAGE_LOCAL/lib/gap/pkg/$pkg"
- 
-+    # TODO:
-     # Clean up any build artificts before installing the rest of the package
-     # Also remove configure/Makefiles
-     # Note: None, if any of the packages really have a proper install target
--    make clean  # Works for some packages but not all
--    rm -rf bin/
--    rm -rf configure configure.* config.* autogen.sh *.m4 Makefile* m4/
-+    #make clean  # Works for some packages but not all
-+    #rm -rf bin/
-+    #rm -rf configure configure.* config.* autogen.sh *.m4 Makefile* m4/
- 
--    # Create the bin/ symlink
--    ln -s "$SAGE_LOCAL/lib/gap/pkg/$pkg/bin" bin
--
--    # Install the rest of the package files
--    sdh_install * "$PKG_DIR/$pkg"
- }
- 
- # Build and install compiled packages:
- #
- # These packages have an old ./configure that take the GAP_ROOT as a positional
- # argument
--for pkg in cohomolo-* crypting-* grape-* guava-* orb-* datastructures-*
-+for pkg in cohomolo crypting grape guava orb datastructures
- do
-     echo "Building GAP package $pkg"
-     CFLAGS="$CFLAGS -Wno-implicit-function-declaration"
-@@ -91,7 +85,7 @@ pararr=( " " " " "--with-external-planarity" "--with-external-libsemigroups" )
- ##############################################################################
- 
- parind=0
--for pkg in nq-* io-* digraphs-* semigroups-*
-+for pkg in nq io digraphs semigroups
- do
-     echo "Building GAP package $pkg"
-     cd "$PKG_SRC_DIR/$pkg"
-diff --git a/build/pkgs/libsemigroups/checksums.ini b/build/pkgs/libsemigroups/checksums.ini
-index 62c4268515f..4e13a36cb35 100644
---- a/build/pkgs/libsemigroups/checksums.ini
-+++ b/build/pkgs/libsemigroups/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=libsemigroups-VERSION.tar.gz
--sha1=2b16c095cc5ffd3f77a71dfbf48cce188e054c03
--md5=7082cadcf7a195ccb93175cd72b6db95
--cksum=1501022358
-+sha1=86375824b47ce4b0e23570122e873f67136d0c0a
-+md5=ff79ad5fbc8bfeb64d48faaf24106b98
-+cksum=2845045455
- upstream_url=https://github.com/libsemigroups/libsemigroups/releases/download/vVERSION/libsemigroups-VERSION.tar.gz
-diff --git a/build/pkgs/libsemigroups/package-version.txt b/build/pkgs/libsemigroups/package-version.txt
-index 9084fa2f716..f90b1afc082 100644
---- a/build/pkgs/libsemigroups/package-version.txt
-+++ b/build/pkgs/libsemigroups/package-version.txt
-@@ -1 +1 @@
--1.1.0
-+2.3.2
-diff --git a/build/pkgs/libsemigroups/spkg-install.in b/build/pkgs/libsemigroups/spkg-install.in
-index 2aaf0e99043..128b54d2f99 100644
---- a/build/pkgs/libsemigroups/spkg-install.in
-+++ b/build/pkgs/libsemigroups/spkg-install.in
-@@ -1,4 +1,4 @@
- cd src
--sdh_configure
-+sdh_configure --disable-eigen
- sdh_make
- sdh_make_install
-diff --git a/build/pkgs/singular/spkg-configure.m4 b/build/pkgs/singular/spkg-configure.m4
-index d4d145defe3..6a85631f624 100644
---- a/build/pkgs/singular/spkg-configure.m4
-+++ b/build/pkgs/singular/spkg-configure.m4
-@@ -9,52 +9,7 @@ SAGE_SPKG_CONFIGURE([singular], [
-        AC_MSG_CHECKING([that Singular's help is working])
-        AS_IF([test x`printf "system(\"--browser\", \"builtin\"); \n help;" | Singular 2>&1 | grep "error occurred"` = x], [
-         AC_MSG_RESULT(yes)
--        dnl We have Singular. Now determine the shared library path on
--        dnl platforms on which sage.libs.singular needs to reload the library with RTLD_GLOBAL.
--        AS_CASE([$host_os],
--          [cygwin*], [dnl Nothing to do
--                     ],
--                     [dnl Use pkg-config to get singular's libdir while we're at it. As a
--                      dnl moral compromise for using pkg-config, this ultimately allows us
--                      dnl to pass an absolute path to dlopen(), which is the only approach
--                      dnl that POSIX guarantees will work.
--                      PKG_CHECK_VAR([SINGULAR_LIB_DIR], [Singular], [libdir])
--                      dnl The acl_shlibext variable is set in the top-level configure.ac.
--                      AC_LANG_PUSH(C)
--                      ORIG_LIBS="${LIBS}"
--                      LIBS="${LIBS} -ldl"
--                      AC_MSG_CHECKING([if we can dlopen($LIBSINGULAR_PATH)])
--                      LIBSINGULAR_PATH="${SINGULAR_LIB_DIR}/libSingular.${acl_shlibext}"
--
--                      dnl if we can dlopen() it, substitute the name for sage_conf;
--                      dnl otherwise, fall back to using the SPKG.
--                      AC_RUN_IFELSE(
--                        [AC_LANG_PROGRAM(
--                          [[#include <dlfcn.h>]],
--                          [[void* h = dlopen("${LIBSINGULAR_PATH}", RTLD_LAZY | RTLD_GLOBAL);
--                            if (h == 0) { return 1; } else { return dlclose(h); }]]
--                        )], [
--                          AC_MSG_RESULT(yes)
--                        ], [
--                          dnl try Debian-specific name
--                          LIBSINGULAR_PATH="${SINGULAR_LIB_DIR}/libsingular-Singular.${acl_shlibext}"
--                          AC_RUN_IFELSE(
--                           [AC_LANG_PROGRAM(
--                             [[#include <dlfcn.h>]],
--                             [[void* h = dlopen("${LIBSINGULAR_PATH}", RTLD_LAZY | RTLD_GLOBAL);
--                               if (h == 0) { return 1; } else { return dlclose(h); }]]
--                           )], [
--                             AC_MSG_RESULT(yes)
--                           ], [
--                            AC_MSG_RESULT(no)
--                            sage_spkg_install_singular=yes
--                          ], [AC_MSG_RESULT(yes)])
--                        ], [AC_MSG_RESULT(yes)])
--
--                      AC_LANG_POP()
--                      LIBS="${ORIG_LIBS}"
--                     ]
--       )], [
-+       ], [
-        AC_MSG_RESULT(no)
-        sage_spkg_install_singular=yes
-        ]
-@@ -64,20 +19,4 @@ SAGE_SPKG_CONFIGURE([singular], [
-       ])
-     ])
-   ])
--],[],[],[
--  dnl Post-check phase
--  dnl We make the sage_conf substitutions here, because the "default"
--  dnl substitution needs to be made even if we skipped the system-Singular
--  dnl checks themselves.
--  AS_IF([test "x${sage_spkg_install_singular}" = "xyes"], [
--    AS_CASE([$host_os],
--      [cygwin*], [dnl Nothing to do
--                 ],
--                 [dnl Set shared library path, needed for reloading the library with RTLD_GLOBAL
--                  LIBSINGULAR_PATH="\$SAGE_LOCAL/lib/libSingular.${acl_shlibext}"
--                 ]
--    )
--  ])
--
--  AC_SUBST(LIBSINGULAR_PATH, "${LIBSINGULAR_PATH}")
- ])
-diff --git a/pkgs/sage-conf/_sage_conf/_conf.py.in b/pkgs/sage-conf/_sage_conf/_conf.py.in
-index 6cd28f558a8..d66bdb3d264 100644
---- a/pkgs/sage-conf/_sage_conf/_conf.py.in
-+++ b/pkgs/sage-conf/_sage_conf/_conf.py.in
-@@ -55,9 +55,6 @@ THREEJS_DIR = SAGE_LOCAL + "/share/threejs-sage"
- OPENMP_CFLAGS = "@OPENMP_CFLAGS@"
- OPENMP_CXXFLAGS = "@OPENMP_CXXFLAGS@"
- 
--# The full absolute path to the main Singular library.
--LIBSINGULAR_PATH = "@LIBSINGULAR_PATH@".replace('$SAGE_LOCAL', SAGE_LOCAL)
--
- # Installation location of wheels. This is determined at configuration time
- # and does not depend on the installation location of sage-conf.
- SAGE_SPKG_WHEELS = "@SAGE_VENV@".replace('${SAGE_LOCAL}', SAGE_LOCAL) + "/var/lib/sage/wheels"
-diff --git a/src/doc/en/thematic_tutorials/lie/weyl_groups.rst b/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-index c917338e444..182e74aad20 100644
---- a/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-+++ b/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-@@ -139,12 +139,12 @@ string, which you can print::
-     X.1      1  1  1  1  1  1  1  1  1  1  1  1  1
-     X.2      1 -1  1  1 -1  1  1 -1 -1 -1  1  1  1
-     X.3      2  .  2 -1  .  2  2  .  .  . -1  2  2
--    X.4      3 -1 -1  .  1 -1  3 -1  1 -1  . -1  3
--    X.5      3 -1 -1  .  1  3 -1 -1 -1  1  . -1  3
--    X.6      3  1 -1  . -1 -1  3  1 -1  1  . -1  3
--    X.7      3  1 -1  . -1  3 -1  1  1 -1  . -1  3
--    X.8      3 -1  3  . -1 -1 -1 -1  1  1  . -1  3
--    X.9      3  1  3  .  1 -1 -1  1 -1 -1  . -1  3
-+    X.4      3 -1 -1  .  1  3 -1 -1 -1  1  . -1  3
-+    X.5      3  1 -1  . -1  3 -1  1  1 -1  . -1  3
-+    X.6      3 -1  3  . -1 -1 -1 -1  1  1  . -1  3
-+    X.7      3 -1 -1  .  1 -1  3 -1  1 -1  . -1  3
-+    X.8      3  1  3  .  1 -1 -1  1 -1 -1  . -1  3
-+    X.9      3  1 -1  . -1 -1  3  1 -1  1  . -1  3
-     X.10     4 -2  . -1  .  .  .  2  .  .  1  . -4
-     X.11     4  2  . -1  .  .  . -2  .  .  1  . -4
-     X.12     6  . -2  .  . -2 -2  .  .  .  .  2  6
-diff --git a/src/sage/coding/codecan/autgroup_can_label.pyx b/src/sage/coding/codecan/autgroup_can_label.pyx
-index de5db985e0b..c83b9264e44 100644
---- a/src/sage/coding/codecan/autgroup_can_label.pyx
-+++ b/src/sage/coding/codecan/autgroup_can_label.pyx
-@@ -76,7 +76,7 @@ columns do share the same coloring::
-     ((1,),
-      (2,),
-      (3, 5, 4),
--     (6, 19, 16, 9, 21, 10, 8, 15, 14, 11, 20, 13, 12, 7, 17, 18))
-+     (6, 19, 16, 21, 9, 10, 15, 8, 20, 11, 14, 13, 7, 12, 18, 17))
- 
- We can also restrict the group action to linear isometries::
- 
-diff --git a/src/sage/coding/linear_code.py b/src/sage/coding/linear_code.py
-index a3ac3ca1547..bfb9f8696e8 100644
---- a/src/sage/coding/linear_code.py
-+++ b/src/sage/coding/linear_code.py
-@@ -465,27 +465,27 @@ def automorphism_group_gens(self, equivalence="semilinear"):
-             0
-             sage: C = codes.HammingCode(GF(4, 'z'), 3)
-             sage: C.automorphism_group_gens()
--            ([((1, 1, 1, 1, 1, z + 1, z, z + 1, z, z, z, 1, 1, z + 1, z + 1, z, z + 1, z, z + 1, z + 1, z + 1); (1,14,6,7,4,10,11,19)(2,8,16,13,3,17,21,15)(9,12,18,20), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((1, 1, 1, z, z + 1, 1, 1, 1, 1, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z); (1,13,14,20)(2,21,8,18,7,16,19,15)(3,10,5,12,17,9,6,4), Ring endomorphism of Finite Field in z of size 2^2
-+                Defn: z |--> z + 1),
-+              ((z, 1, z, z, z, z + 1, z, z, z, z, z, z, z + 1, z, z, z, z, z + 1, z, z, z); (1,11,5,12,3,19)(2,8)(6,18,13)(7,17,15)(9,10,14,16,20,21), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z + 1),
--              ((z + 1, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z + 1, 1, z, z + 1, z + 1, z); (1,18,6,19,2,9,17,10,13,14,21,11,4,5,12)(3,20,7,16,8), Ring endomorphism of Finite Field in z of size 2^2
--                Defn: z |--> z),
-               ((z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z); (), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-              362880)
-             sage: C.automorphism_group_gens(equivalence="linear")
--            ([((z + 1, 1, z + 1, z + 1, z + 1, z, 1, z, 1, 1, 1, 1, z + 1, z + 1, z + 1, z, z, 1, z, z, z); (1,15,2,8,16,18,3)(4,9,12,13,20,10,11)(5,21,14,6,7,19,17), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((z, 1, z + 1, z + 1, 1, z + 1, z, 1, z + 1, z + 1, 1, z, 1, z + 1, z, 1, z, 1, z + 1, 1, 1); (1,12,11,10,6,8,9,20,13,21,5,14,3,16,17,19,7,4,2,15,18), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((z + 1, z + 1, z + 1, z + 1, z + 1, 1, z, 1, z, z, z, 1, z, 1, 1, 1, z + 1, z + 1, z + 1, 1, z); (1,15,21,8,9)(2,18,5,3,11,16,7,10,19,13,12,4,17,6,20), Ring endomorphism of Finite Field in z of size 2^2
-+              ((z + 1, z + 1, z + 1, z, 1, 1, z, z, 1, z + 1, z, 1, 1, z, 1, z + 1, z, z + 1, z + 1, 1, z); (1,3,18,2,17,6,19)(4,15,13,20,7,14,16)(5,11,8,21,12,9,10), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
-               ((z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1); (), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-              181440)
-             sage: C.automorphism_group_gens(equivalence="permutational")
--            ([((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,19)(3,17)(4,21)(5,20)(7,14)(9,12)(10,16)(11,15), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,11)(3,10)(4,9)(5,7)(12,21)(14,20)(15,19)(16,17), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,11)(3,10)(4,9)(5,7)(12,21)(14,20)(15,19)(16,17), Ring endomorphism of Finite Field in z of size 2^2
-+              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (2,18)(3,19)(4,10)(5,16)(8,13)(9,14)(11,21)(15,20), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,17)(2,8)(3,14)(4,10)(7,12)(9,19)(13,18)(15,20), Ring endomorphism of Finite Field in z of size 2^2
-+              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,19)(3,17)(4,21)(5,20)(7,14)(9,12)(10,16)(11,15), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
-               ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (2,13)(3,14)(4,20)(5,11)(8,18)(9,19)(10,15)(16,21), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-@@ -691,10 +691,10 @@ def _canonize(self, equivalence):
-             sage: C_iso == aut_group_can_label.get_canonical_form()
-             True
-             sage: aut_group_can_label.get_autom_gens()
--            [((1, 1, 1, 1, 1, z + 1, z, z + 1, z, z, z, 1, 1, z + 1, z + 1, z, z + 1, z, z + 1, z + 1, z + 1); (1,14,6,7,4,10,11,19)(2,8,16,13,3,17,21,15)(9,12,18,20), Ring endomorphism of Finite Field in z of size 2^2
-+            [((1, 1, 1, z, z + 1, 1, 1, 1, 1, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z); (1,13,14,20)(2,21,8,18,7,16,19,15)(3,10,5,12,17,9,6,4), Ring endomorphism of Finite Field in z of size 2^2
-+               Defn: z |--> z + 1),
-+             ((z, 1, z, z, z, z + 1, z, z, z, z, z, z, z + 1, z, z, z, z, z + 1, z, z, z); (1,11,5,12,3,19)(2,8)(6,18,13)(7,17,15)(9,10,14,16,20,21), Ring endomorphism of Finite Field in z of size 2^2
-                Defn: z |--> z + 1),
--             ((z + 1, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z + 1, 1, z, z + 1, z + 1, z); (1,18,6,19,2,9,17,10,13,14,21,11,4,5,12)(3,20,7,16,8), Ring endomorphism of Finite Field in z of size 2^2
--               Defn: z |--> z),
-              ((z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z); (), Ring endomorphism of Finite Field in z of size 2^2
-                Defn: z |--> z)]
-         """
-diff --git a/src/sage/combinat/posets/posets.py b/src/sage/combinat/posets/posets.py
-index 2836d59d960..8c882d5ac3b 100644
---- a/src/sage/combinat/posets/posets.py
-+++ b/src/sage/combinat/posets/posets.py
-@@ -8813,7 +8813,7 @@ def _libgap_(self):
-             sage: libgap(P)  # optional - gap_packages
-             <A poset on 5 points>
-             sage: A = libgap(GF(2)).PosetAlgebra(P); A  # optional - gap_packages
--            <GF(2)[<quiver with 5 vertices and 5 arrows>]/<two-sided ideal in <GF(2)[<quiver with 5 vertices and 5 arrows>]>, (1 generators)>>
-+            <GF(2)[<quiver with 5 vertices and 5 arrows>]/<two-sided ideal in <GF(2)[<quiver with 5 vertices and 5 arrows>]>, (1 generator)>>
-             sage: A.Dimension()  # optional - gap_packages
-             13
-         """
-diff --git a/src/sage/combinat/root_system/hecke_algebra_representation.py b/src/sage/combinat/root_system/hecke_algebra_representation.py
-index 6b756bafc30..8ac99319bec 100644
---- a/src/sage/combinat/root_system/hecke_algebra_representation.py
-+++ b/src/sage/combinat/root_system/hecke_algebra_representation.py
-@@ -357,7 +357,7 @@ def Tw(self, word, signs=None, scalar=None):
-             sage: q1, q2 = K.gens()
-             sage: KW = W.algebra(K)
-             sage: x = KW.an_element(); x
--            123 + 3*32 + 2*3 + e
-+            123 + 3*2312 + 2*31 + e
- 
-             sage: T = KW.demazure_lusztig_operators(q1,q2)
-             sage: T12 = T.Tw( (1,2) )
-diff --git a/src/sage/combinat/symmetric_group_algebra.py b/src/sage/combinat/symmetric_group_algebra.py
-index b8a0bebab44..9bccba124c8 100644
---- a/src/sage/combinat/symmetric_group_algebra.py
-+++ b/src/sage/combinat/symmetric_group_algebra.py
-@@ -101,7 +101,7 @@ def SymmetricGroupAlgebra(R, W, category=None):
-         sage: SGA.group()
-         Weyl Group of type ['A', 3] (as a matrix group acting on the ambient space)
-         sage: SGA.an_element()
--        s1*s2*s3 + 3*s3*s2 + 2*s3 + 1
-+        s1*s2*s3 + 3*s2*s3*s1*s2 + 2*s3*s1 + 1
- 
-     The preferred way to construct the symmetric group algebra is to
-     go through the usual ``algebra`` method::
-diff --git a/src/sage/env.py b/src/sage/env.py
-index 911f34b1bc6..5f7aca8599c 100644
---- a/src/sage/env.py
-+++ b/src/sage/env.py
-@@ -197,7 +197,8 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- GRAPHS_DATA_DIR = var("GRAPHS_DATA_DIR", join(SAGE_SHARE, "graphs"))
- ELLCURVE_DATA_DIR = var("ELLCURVE_DATA_DIR", join(SAGE_SHARE, "ellcurves"))
- POLYTOPE_DATA_DIR = var("POLYTOPE_DATA_DIR", join(SAGE_SHARE, "reflexive_polytopes"))
--GAP_ROOT_DIR = var("GAP_ROOT_DIR", join(SAGE_SHARE, "gap"))
-+GAP_LIB_DIR = var("GAP_LIB_DIR", join(SAGE_LOCAL, "lib", "gap"))
-+GAP_SHARE_DIR = var("GAP_SHARE_DIR", join(SAGE_SHARE, "gap"))
- THEBE_DIR = var("THEBE_DIR", join(SAGE_SHARE, "thebe"))
- COMBINATORIAL_DESIGN_DATA_DIR = var("COMBINATORIAL_DESIGN_DATA_DIR", join(SAGE_SHARE, "combinatorial_designs"))
- CREMONA_MINI_DATA_DIR = var("CREMONA_MINI_DATA_DIR", join(SAGE_SHARE, "cremona"))
-@@ -229,12 +230,6 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- LIE_INFO_DIR = var("LIE_INFO_DIR", join(SAGE_LOCAL, "lib", "LiE"))
- SINGULAR_BIN = var("SINGULAR_BIN") or "Singular"
- 
--# The path to libSingular, to be passed to dlopen(). This will
--# typically be set to an absolute path in sage_conf, but the relative
--# fallback path here works on systems where dlopen() searches the
--# system's library locations.
--LIBSINGULAR_PATH = var("LIBSINGULAR_PATH", "libSingular.so")
--
- # OpenMP
- OPENMP_CFLAGS = var("OPENMP_CFLAGS", "")
- OPENMP_CXXFLAGS = var("OPENMP_CXXFLAGS", "")
-@@ -255,81 +250,6 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- SAGE_GAP_COMMAND = var('SAGE_GAP_COMMAND', _gap_cmd)
- 
- 
--def _get_shared_lib_path(*libnames: str) -> Optional[str]:
--    """
--    Return the full path to a shared library file installed in
--    ``$SAGE_LOCAL/lib`` or the directories associated with the
--    Python sysconfig.
--
--    This can also be passed more than one library name (e.g. for cases where
--    some library may have multiple names depending on the platform) in which
--    case the first one found is returned.
--
--    This supports most *NIX variants (in which ``lib<libname>.so`` is found
--    under ``$SAGE_LOCAL/lib``), macOS (same, but with the ``.dylib``
--    extension), and Cygwin (under ``$SAGE_LOCAL/bin/cyg<libname>.dll``,
--    or ``$SAGE_LOCAL/bin/cyg<libname>-*.dll`` for versioned DLLs).
--
--    For distributions like Debian that use a multiarch layout, we also try the
--    multiarch lib paths (i.e. ``/usr/lib/<arch>/``).
--
--    This returns ``None`` if no matching library file could be found.
--
--    EXAMPLES::
--
--        sage: from sage.env import _get_shared_lib_path
--        sage: "gap" in _get_shared_lib_path("gap")
--        True
--        sage: _get_shared_lib_path("an_absurd_lib") is None
--        True
--
--    """
--
--    for libname in libnames:
--        search_directories: List[Path] = []
--        patterns: List[str] = []
--        if sys.platform == 'cygwin':
--            # Later down we take the first matching DLL found, so search
--            # SAGE_LOCAL first so that it takes precedence
--            if SAGE_LOCAL:
--                search_directories.append(Path(SAGE_LOCAL) / 'bin')
--            search_directories.append(Path(sysconfig.get_config_var('BINDIR')))
--            # Note: The following is not very robust, since if there are multible
--            # versions for the same library this just selects one more or less
--            # at arbitrary. However, practically speaking, on Cygwin, there
--            # will only ever be one version
--            patterns = [f'cyg{libname}.dll', f'cyg{libname}-*.dll']
--        else:
--            if sys.platform == 'darwin':
--                ext = 'dylib'
--            else:
--                ext = 'so'
--
--            if SAGE_LOCAL:
--                search_directories.append(Path(SAGE_LOCAL) / 'lib')
--            libdir = sysconfig.get_config_var('LIBDIR')
--            if libdir is not None:
--                libdir = Path(libdir)
--                search_directories.append(libdir)
--
--                multiarchlib = sysconfig.get_config_var('MULTIARCH')
--                if multiarchlib is not None:
--                    search_directories.append(libdir / multiarchlib),
--
--            patterns = [f'lib{libname}.{ext}']
--
--        for directory in search_directories:
--            for pattern in patterns:
--                path = next(directory.glob(pattern), None)
--                if path is not None:
--                    return str(path.resolve())
--
--    # Just return None if no files were found
--    return None
--
--# locate libgap shared object
--GAP_SO = var("GAP_SO", _get_shared_lib_path("gap", ""))
--
- # post process
- if DOT_SAGE is not None and ' ' in DOT_SAGE:
-     if UNAME[:6] == 'CYGWIN':
-diff --git a/src/sage/groups/abelian_gps/abelian_group_gap.py b/src/sage/groups/abelian_gps/abelian_group_gap.py
-index a4b047113c5..86090b43535 100644
---- a/src/sage/groups/abelian_gps/abelian_group_gap.py
-+++ b/src/sage/groups/abelian_gps/abelian_group_gap.py
-@@ -338,7 +338,7 @@ def _element_constructor_(self, x, check=True):
-         if isinstance(x, AbelianGroupElement_gap):
-             try:
-                 if x in self._cover:
--                    x = self.gap().NaturalHomomorphism().Image(x.gap())
-+                    x = self._cover.gap().NaturalHomomorphismByNormalSubgroup(self._relations).Image(x.gap())
-                 else:
-                     x = x.gap()
-             except AttributeError:
-@@ -1043,7 +1043,7 @@ def natural_homomorphism(self):
-             From: Abelian group with gap, generator orders (4,)
-             To:   Quotient abelian group with generator orders (2,)
-         """
--        phi = self.gap().NaturalHomomorphism()
-+        phi = self._cover.gap().NaturalHomomorphismByNormalSubgroup(self._relations)
-         Hom = self._cover.Hom(self)
-         return Hom(phi)
- 
-diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py
-index 8d6e443683c..1beb01af87f 100644
---- a/src/sage/groups/finitely_presented.py
-+++ b/src/sage/groups/finitely_presented.py
-@@ -596,9 +596,9 @@ def gap(self):
-             sage: k = G.rewriting_system()
-             sage: k.gap()
-             Knuth Bendix Rewriting System for Monoid( [ a, A, b, B ] ) with rules
--            [ [ a^2, <identity ...> ], [ a*A, <identity ...> ],
--              [ A*a, <identity ...> ], [ b^2, <identity ...> ],
--              [ b*B, <identity ...> ], [ B*b, <identity ...> ] ]
-+            [ [ a*A, <identity ...> ], [ A*a, <identity ...> ],
-+              [ b*B, <identity ...> ], [ B*b, <identity ...> ],
-+              [ a^2, <identity ...> ], [ b^2, <identity ...> ] ]
-         """
-         return self._gap
- 
-diff --git a/src/sage/groups/fqf_orthogonal.py b/src/sage/groups/fqf_orthogonal.py
-index 7fc4dbe7548..e5eccd45942 100644
---- a/src/sage/groups/fqf_orthogonal.py
-+++ b/src/sage/groups/fqf_orthogonal.py
-@@ -143,7 +143,7 @@ class FqfOrthogonalGroup(AbelianGroupAutomorphismGroup_subgroup):
-         [2/3   0   0]
-         [  0 2/3   0]
-         [  0   0 4/3]
--        generated by 2 elements
-+        generated by 3 elements
-         sage: q = matrix.diagonal(QQ, [3/2, 1/4, 1/4])
-         sage: T = TorsionQuadraticForm(q)
-         sage: T.orthogonal_group().order()
-diff --git a/src/sage/groups/libgap_wrapper.pyx b/src/sage/groups/libgap_wrapper.pyx
-index d25121aa792..dc81b71635b 100644
---- a/src/sage/groups/libgap_wrapper.pyx
-+++ b/src/sage/groups/libgap_wrapper.pyx
-@@ -25,7 +25,7 @@ Note how we call the constructor of both superclasses to initialize
- its output via LibGAP::
- 
-     sage: FooGroup()
--    <pc group of size 3 with 1 generators>
-+    <pc group of size 3 with 1 generator>
-     sage: type(FooGroup().gap())
-     <class 'sage.libs.gap.element.GapElement'>
- 
-@@ -106,7 +106,7 @@ class ParentLibGAP(SageObject):
-         ....:         ParentLibGAP.__init__(self, lg)
-         ....:         Group.__init__(self)
-         sage: FooGroup()
--        <pc group of size 3 with 1 generators>
-+        <pc group of size 3 with 1 generator>
-     """
- 
-     def __init__(self, libgap_parent, ambient=None):
-@@ -461,7 +461,7 @@ cdef class ElementLibGAP(MultiplicativeGroupElement):
-         ....:         ParentLibGAP.__init__(self, lg)
-         ....:         Group.__init__(self)
-         sage: FooGroup()
--        <pc group of size 3 with 1 generators>
-+        <pc group of size 3 with 1 generator>
-         sage: FooGroup().gens()
-         (f1,)
-     """
-diff --git a/src/sage/groups/matrix_gps/finitely_generated.py b/src/sage/groups/matrix_gps/finitely_generated.py
-index a6d3dc02513..63956ad5f10 100644
---- a/src/sage/groups/matrix_gps/finitely_generated.py
-+++ b/src/sage/groups/matrix_gps/finitely_generated.py
-@@ -563,9 +563,6 @@ def as_permutation_group(self, algorithm=None, seed=None):
-             21499084800
-             sage: P = G.as_permutation_group()
-             sage: Psmaller = G.as_permutation_group(algorithm="smaller", seed=6)
--            sage: P == Psmaller  # see the note below
--            True
--            sage: Psmaller = G.as_permutation_group(algorithm="smaller")
-             sage: P == Psmaller
-             False
-             sage: P.cardinality()
-diff --git a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-index f2ccca042ac..47d6862333c 100644
---- a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-+++ b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-@@ -427,7 +427,7 @@ cdef class LabelledBranching:
-             sage: from sage.groups.perm_gps.partn_ref2.refinement_generic import LabelledBranching
-             sage: L = LabelledBranching(3)
-             sage: L.small_generating_set()
--            []
-+            [()]
-             sage: L.add_gen(libgap.eval('(1,2,3)'))
-             sage: L.small_generating_set()
-             [(1,2,3)]
-diff --git a/src/sage/groups/perm_gps/permgroup.py b/src/sage/groups/perm_gps/permgroup.py
-index ebdf7c4c6eb..fb14008c8e0 100644
---- a/src/sage/groups/perm_gps/permgroup.py
-+++ b/src/sage/groups/perm_gps/permgroup.py
-@@ -926,7 +926,7 @@ def _coerce_map_from_(self, G):
-            sage: f = PG._coerce_map_from_(MG)
-            sage: mg = MG.an_element()
-            sage: p = f(mg); p
--           (2,33,32,23,31,55)(3,49,38,44,40,28)(4,17,59,62,58,46)(5,21,47,20,43,8)(6,53,50)(7,37,12,57,14,29)(9,41,56,34,64,10)(11,25,19)(13,61,26,51,22,15)(16,45,36)(18,27,35,48,52,54)(24,63,42)(30,39,60)
-+           (1,2,6,19,35,33)(3,9,26,14,31,23)(4,13,5)(7,22,17)(8,24,12)(10,16,32,27,20,28)(11,30,18)(15,25,36,34,29,21)
-            sage: PG(p._gap_()) == p
-            True
- 
-@@ -972,12 +972,12 @@ def _coerce_map_from_(self, G):
-             sage: P = G.as_permutation_group(algorithm='smaller', seed=5)
-             sage: P1 = G.as_permutation_group()
-             sage: P == P1
--            False
-+            True
-             sage: g1, g2, g3 = G.gens()
-             sage: P(g1*g2)
--            (1,3,7,12)(2,4,8,10)(5,11)(6,9)
-+            (1,4,13,11)(2,5,14,18)(3,15,8,16)(6,7)(9,20,19,12)(10,17)
-             sage: P1(g1*g2)
--            (2,29,25,68)(3,57,13,54)(4,11,72,37)(5,39,60,23)(6,64,75,63)(7,21,50,73)(8,46,38,32)(9,74,35,18)(10,44,49,48)(12,16,34,71)(14,79,27,40)(15,26)(17,62,59,76)(19,78,70,65)(20,22,58,51)(24,33,36,43)(28,81,80,52)(30,53,56,69)(31,61)(41,42,67,55)(45,77)(47,66)
-+            (1,4,13,11)(2,5,14,18)(3,15,8,16)(6,7)(9,20,19,12)(10,17)
- 
-         Another check for :trac:`5583`::
- 
-@@ -1302,7 +1302,7 @@ def gens_small(self):
-             sage: G.gens_small() # random
-             [('b','c'), ('a','c','b')] ## (on 64-bit Linux)
-             [('a','b'), ('a','c','b')] ## (on Solaris)
--            sage: len(G.gens_small()) == 2
-+            sage: len(G.gens_small()) == 2 # random
-             True
-         """
-         gens = self._libgap_().SmallGeneratingSet()
-@@ -4370,17 +4370,23 @@ def is_transitive(self, domain=None):
- 
-         ::
- 
--            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)]]) #S_5 on [1..5]
--            sage: G.is_transitive([1,4,5])
-+            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)],[(6,7)]])
-+            sage: G.is_transitive([1,2,3,4,5])
-             True
--            sage: G.is_transitive([2..6])
-+            sage: G.is_transitive([1..7])
-             False
-             sage: G.is_transitive(G.non_fixed_points())
--            True
-+            False
-             sage: H = PermutationGroup([[(1,2,3)],[(4,5,6)]])
-             sage: H.is_transitive(H.non_fixed_points())
-             False
- 
-+        If `G` does not act on the domain, it always returns ``False``::
-+
-+            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)]]) #S_5 on [1..5]
-+            sage: G.is_transitive([1,4,5])
-+            False
-+
-         Note that this differs from the definition in GAP, where
-         ``IsTransitive`` returns whether the group is transitive on the
-         set of points moved by the group.
-@@ -4436,12 +4442,16 @@ def is_primitive(self, domain=None):
-             sage: G = PermutationGroup([[(1,2,3,4)],[(2,4)]])
-             sage: G.is_primitive([1..4])
-             False
--            sage: G.is_primitive([1,2,3])
--            True
-             sage: G = PermutationGroup([[(3,4,5,6)],[(3,4)]]) #S_4 on [3..6]
-             sage: G.is_primitive(G.non_fixed_points())
-             True
- 
-+        If `G` does not act on the domain, it always returns ``False``::
-+
-+            sage: G = PermutationGroup([[(1,2,3,4)],[(2,4)]])
-+            sage: G.is_primitive([1,2,3])
-+            False
-+
-         """
-         #If the domain is not a subset of self.domain(), then the
-         #action isn't primitive.
-diff --git a/src/sage/interfaces/gap.py b/src/sage/interfaces/gap.py
-index 7ae1792e9de..ecaa9fd2341 100644
---- a/src/sage/interfaces/gap.py
-+++ b/src/sage/interfaces/gap.py
-@@ -1512,6 +1512,8 @@ def gap_reset_workspace(max_workspace_size=None, verbose=False):
-     """
-     # Create new workspace with filename WORKSPACE
-     g = Gap(use_workspace_cache=False, max_workspace_size=None)
-+    g.eval('ColorPrompt(false)')
-+    g.eval('SetUserPreference("UseColorPrompt", false)')
-     g.eval('SetUserPreference("HistoryMaxLines", 30)')
-     from sage.tests.gap_packages import all_installed_packages
-     for pkg in all_installed_packages(gap=g):
-diff --git a/src/sage/interfaces/gap_workspace.py b/src/sage/interfaces/gap_workspace.py
-index 33a87dd5076..03b40be6856 100644
---- a/src/sage/interfaces/gap_workspace.py
-+++ b/src/sage/interfaces/gap_workspace.py
-@@ -16,7 +16,8 @@
- import os
- import time
- import hashlib
--from sage.env import DOT_SAGE, GAP_SO
-+import subprocess
-+from sage.env import DOT_SAGE, HOSTNAME, GAP_LIB_DIR, GAP_SHARE_DIR
- 
- 
- def gap_workspace_file(system="gap", name="workspace", dir=None):
-@@ -59,11 +60,13 @@ def gap_workspace_file(system="gap", name="workspace", dir=None):
-     if dir is None:
-         dir = os.path.join(DOT_SAGE, 'gap')
- 
--    if GAP_SO:
--        h = hashlib.sha1(GAP_SO.encode('utf-8')).hexdigest()
--    else:
--        h = 'unknown'
--    return os.path.join(dir, '%s-%s-%s' % (system, name, h))
-+    data = f'{GAP_LIB_DIR}:{GAP_SHARE_DIR}'
-+    for path in GAP_LIB_DIR, GAP_SHARE_DIR:
-+        sysinfo = os.path.join(path, "sysinfo.gap")
-+        if os.path.exists(sysinfo):
-+            data += subprocess.getoutput(f'. "{sysinfo}" && echo ":$GAP_VERSION:$GAParch"')
-+    h = hashlib.sha1(data.encode('utf-8')).hexdigest()
-+    return os.path.join(dir, f'{system}-{name}-{HOSTNAME}-{h}')
- 
- 
- def prepare_workspace_dir(dir=None):
-diff --git a/src/sage/libs/gap/element.pyx b/src/sage/libs/gap/element.pyx
-index c555ea0333c..e3db3934baf 100644
---- a/src/sage/libs/gap/element.pyx
-+++ b/src/sage/libs/gap/element.pyx
-@@ -130,6 +130,7 @@ cdef char *capture_stdout(Obj func, Obj obj):
-     """
-     cdef Obj s, stream, output_text_string
-     cdef UInt res
-+    cdef TypOutputFile output
-     # The only way to get a string representation of an object that is truly
-     # consistent with how it would be represented at the GAP REPL is to call
-     # ViewObj on it.  Unfortunately, ViewObj *prints* to the output stream,
-@@ -145,12 +146,12 @@ cdef char *capture_stdout(Obj func, Obj obj):
-         output_text_string = GAP_ValueGlobalVariable("OutputTextString")
-         stream = CALL_2ARGS(output_text_string, s, GAP_True)
- 
--        if not OpenOutputStream(stream):
-+        if not OpenOutputStream(&output, stream):
-             raise GAPError("failed to open output capture stream for "
-                            "representing GAP object")
- 
-         CALL_1ARGS(func, obj)
--        CloseOutput()
-+        CloseOutput(&output)
-         return CSTR_STRING(s)
-     finally:
-         GAP_Leave()
-diff --git a/src/sage/libs/gap/gap_includes.pxd b/src/sage/libs/gap/gap_includes.pxd
-index 6d22e32540b..6111d18a5c7 100644
---- a/src/sage/libs/gap/gap_includes.pxd
-+++ b/src/sage/libs/gap/gap_includes.pxd
-@@ -76,8 +76,10 @@ cdef extern from "gap/intobj.h" nogil:
- 
- 
- cdef extern from "gap/io.h" nogil:
--    UInt OpenOutputStream(Obj stream)
--    UInt CloseOutput()
-+    ctypedef struct TypOutputFile:
-+        pass
-+    UInt OpenOutputStream(TypOutputFile* output, Obj stream)
-+    UInt CloseOutput(TypOutputFile* output)
- 
- 
- cdef extern from "gap/libgap-api.h" nogil:
-diff --git a/src/sage/libs/gap/libgap.pyx b/src/sage/libs/gap/libgap.pyx
-index b1a64e57939..6a36613aa8c 100644
---- a/src/sage/libs/gap/libgap.pyx
-+++ b/src/sage/libs/gap/libgap.pyx
-@@ -695,7 +695,7 @@ class Gap(Parent):
-             sage: libgap.List
-             <Gap function "List">
-             sage: libgap.GlobalRandomSource
--            <RandomSource in IsGlobalRandomSource>
-+            <RandomSource in IsGAPRandomSource>
-         """
-         if name in dir(self.__class__):
-             return getattr(self.__class__, name)
-diff --git a/src/sage/libs/gap/saved_workspace.py b/src/sage/libs/gap/saved_workspace.py
-index ad5adec36d0..7636707f557 100644
---- a/src/sage/libs/gap/saved_workspace.py
-+++ b/src/sage/libs/gap/saved_workspace.py
-@@ -8,7 +8,7 @@
- 
- import os
- import glob
--from sage.env import GAP_ROOT_DIR
-+from sage.env import GAP_LIB_DIR
- from sage.interfaces.gap_workspace import gap_workspace_file
- 
- 
-@@ -31,7 +31,7 @@ def timestamp():
-     """
-     libgap_dir = os.path.dirname(__file__)
-     libgap_files = glob.glob(os.path.join(libgap_dir, '*'))
--    gap_packages = glob.glob(os.path.join(GAP_ROOT_DIR, 'pkg', '*'))
-+    gap_packages = glob.glob(os.path.join(GAP_LIB_DIR, 'pkg', '*'))
-     files = libgap_files + gap_packages
-     if len(files) == 0:
-         print('Unable to find LibGAP files.')
-diff --git a/src/sage/libs/gap/util.pyx b/src/sage/libs/gap/util.pyx
-index 344ab88c42a..eaa659d64c7 100644
---- a/src/sage/libs/gap/util.pyx
-+++ b/src/sage/libs/gap/util.pyx
-@@ -13,7 +13,7 @@ Utility functions for GAP
- #*****************************************************************************
- 
- from libc.signal cimport signal, SIGCHLD, SIG_DFL
--from posix.dlfcn cimport dlopen, dlclose, RTLD_NOW, RTLD_GLOBAL
-+from posix.dlfcn cimport dlopen, dlclose, dlerror, RTLD_LAZY, RTLD_GLOBAL
- 
- from cpython.exc cimport PyErr_Fetch, PyErr_Restore
- from cpython.object cimport Py_LT, Py_LE, Py_EQ, Py_NE, Py_GT, Py_GE
-@@ -164,33 +164,6 @@ cdef void gasman_callback() with gil:
- ### Initialization of GAP ##################################################
- ############################################################################
- 
--def gap_root():
--    """
--    Find the location of the GAP root install which is stored in the gap
--    startup script.
--
--    EXAMPLES::
--
--        sage: from sage.libs.gap.util import gap_root
--        sage: gap_root()   # random output
--        '/home/vbraun/opt/sage-5.3.rc0/local/gap/latest'
--    """
--    if os.path.exists(sage.env.GAP_ROOT_DIR):
--        return sage.env.GAP_ROOT_DIR
--
--    # Attempt to figure out the appropriate GAP_ROOT by reading the
--    # local/bin/gap shell script; this is an ugly hack that exists for
--    # historical reasons; the best approach to setting where Sage looks for
--    # the appropriate GAP_ROOT is to set the GAP_ROOT_DIR variable
--    SAGE_LOCAL = sage.env.SAGE_LOCAL
--    with open(os.path.join(SAGE_LOCAL, 'bin', 'gap')) as f:
--        gap_sh = f.read().splitlines()
--    gapdir = next(x for x in gap_sh if x.strip().startswith('GAP_ROOT'))
--    gapdir = gapdir.split('"')[1]
--    gapdir = gapdir.replace('$SAGE_LOCAL', SAGE_LOCAL)
--    return gapdir
--
--
- # To ensure that we call initialize_libgap only once.
- cdef bint _gap_is_initialized = False
- 
-@@ -232,12 +205,12 @@ cdef initialize():
-     # this isn't portable
- 
-     cdef void* handle
--    libgapname = str_to_bytes(sage.env.GAP_SO)
--    handle = dlopen(libgapname, RTLD_NOW | RTLD_GLOBAL)
-+    # reload the current module to force reload of libgap (see #33446)
-+    lib = str_to_bytes(__loader__.path, FS_ENCODING, "surrogateescape")
-+    handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY)
-     if handle is NULL:
--        raise RuntimeError(
--                "Could not dlopen() libgap even though it should already "
--                "be loaded!")
-+        err = dlerror()
-+        raise RuntimeError(f"Could not reload gap library with RTLD_GLOBAL ({err})")
-     dlclose(handle)
- 
-     # Define argv variable, which we will pass in to
-@@ -245,7 +218,7 @@ cdef initialize():
-     cdef char* argv[16]
-     argv[0] = "sage"
-     argv[1] = "-l"
--    s = str_to_bytes(gap_root(), FS_ENCODING, "surrogateescape")
-+    s = str_to_bytes(sage.env.GAP_LIB_DIR + ";" + sage.env.GAP_SHARE_DIR, FS_ENCODING, "surrogateescape")
-     argv[2] = s
- 
-     argv[3] = "-m"
-@@ -362,15 +335,9 @@ cdef Obj gap_eval(str gap_string) except? NULL:
-         GAPError: Error, Variable: 'Complex' must have a value
-         Syntax error: ; expected in stream:1
-         Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^
-+                ^^^^^
-         Error, Variable: 'with' must have a value
--        Syntax error: ; expected in stream:1
--        Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^^^^^^^^^
-         Error, Variable: 'bits' must have a value
--        Syntax error: ; expected in stream:1
--        Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-         Error, Variable: 'precision' must have a value
- 
-     Test that on a subsequent attempt we get the same message (no garbage was
-diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx
-index d8ea7b07f3c..4beb1774df9 100644
---- a/src/sage/libs/singular/singular.pyx
-+++ b/src/sage/libs/singular/singular.pyx
-@@ -1705,14 +1705,7 @@ cdef object si2sa_intvec(intvec *v):
- cdef extern from *: # hack to get at cython macro
-     int unlikely(int)
- 
--cdef extern from "dlfcn.h":
--    void *dlopen(char *, long)
--    char *dlerror()
--    void dlclose(void *handle)
--
--cdef extern from "dlfcn.h":
--    cdef long RTLD_LAZY
--    cdef long RTLD_GLOBAL
-+from posix.dlfcn cimport dlopen, dlclose, dlerror, RTLD_LAZY, RTLD_GLOBAL
- 
- cdef int overflow_check(unsigned long e, ring *_ring) except -1:
-     """
-@@ -1762,8 +1755,6 @@ cdef init_libsingular():
- 
-     cdef void *handle = NULL
- 
--    from sage.env import LIBSINGULAR_PATH
--    lib = str_to_bytes(LIBSINGULAR_PATH, FS_ENCODING, "surrogateescape")
- 
-     # This is a workaround for https://github.com/Singular/Singular/issues/1113
-     # and can be removed once that fix makes it into release of Singular that
-@@ -1780,10 +1771,12 @@ cdef init_libsingular():
- 
-     import platform
-     if not platform.system().startswith("CYGWIN"):
-+        # reload the current module to force reload of libSingular (see #33446)
-+        lib = str_to_bytes(__loader__.path, FS_ENCODING, "surrogateescape")
-         handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY)
-         if not handle:
-             err = dlerror()
--            raise ImportError(f"cannot load Singular library from {LIBSINGULAR_PATH} ({err})")
-+            raise RuntimeError(f"Could not reload Singular library with RTLD_GLOBAL ({err})")
- 
-     # load SINGULAR
-     siInit(lib)
-diff --git a/src/sage/tests/gap_packages.py b/src/sage/tests/gap_packages.py
-index 2e4518ca226..c302b169b8a 100644
---- a/src/sage/tests/gap_packages.py
-+++ b/src/sage/tests/gap_packages.py
-@@ -103,7 +103,7 @@ def all_installed_packages(ignore_dot_gap=False, gap=None):
- 
-         sage: from sage.tests.gap_packages import all_installed_packages
-         sage: all_installed_packages()
--        (...'GAPDoc'...)
-+        (...'gapdoc'...)
-         sage: all_installed_packages(ignore_dot_gap=True) == all_installed_packages(gap=gap, ignore_dot_gap=True)
-         True
-     """
diff --git a/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch b/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
deleted file mode 100644
index d331a6573e1c..000000000000
--- a/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/src/sage/data_structures/stream.py b/src/sage/data_structures/stream.py
-index f8f6dc6a186..002e925f02f 100644
---- a/src/sage/data_structures/stream.py
-+++ b/src/sage/data_structures/stream.py
-@@ -2090,8 +2090,8 @@ def compute_product(self, n, la):
-             sage: f = Stream_exact([1]) # irrelevant for this test
-             sage: g = Stream_function(lambda n: s[n], True, 0)
-             sage: h = Stream_plethysm(f, g, True, p)
--            sage: B = p[2, 2, 1](sum(s[i] for i in range(7)))
--            sage: all(h.compute_product(k, Partition([2, 2, 1])) == B.restrict_degree(k) for k in range(7))
-+            sage: B = p[2, 2, 1](sum(p(s[i]) for i in range(7)))  # long time
-+            sage: all(h.compute_product(k, Partition([2, 2, 1])) == B.restrict_degree(k) for k in range(7))  # long time
-             True
-         """
-         # This is the approximate order of the result
diff --git a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch b/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
deleted file mode 100644
index 007f3324cfe4..000000000000
--- a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index b77c69b2f77..0586a96ae55 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -563,7 +563,7 @@ def complex_to_cmap_rgb(z_values, cmap='turbo', contoured=False, tiled=False,
-     import matplotlib as mpl
- 
-     if isinstance(cmap, str):
--        cmap = mpl.cm.get_cmap(cmap)
-+        cmap = mpl.colormaps[cmap]
- 
-     if contour_base is None:
-         if contour_type == "linear":
-@@ -1206,11 +1206,11 @@ def complex_plot(f, x_range, y_range, contoured=False, tiled=False, cmap=None,
-                 domain = np.linspace(0, 1, 256)
-                 shifted_domain = np.roll(domain, 128)
-                 default_cmap = mpl.colors.LinearSegmentedColormap.from_list(
--                    "sage_default", mpl.cm.get_cmap('hsv')(shifted_domain)
-+                    "sage_default", mpl.colormaps['hsv'](shifted_domain)
-                 )
-                 cmap = default_cmap
-             else:
--                cmap = mpl.cm.get_cmap(cmap)
-+                cmap = mpl.colormaps[cmap]
-         rgbs = complex_to_cmap_rgb(
-             z_values, cmap=cmap, contoured=contoured, tiled=tiled,
-             contour_type=contour_type, contour_base=contour_base,
-diff --git a/src/sage/plot/contour_plot.py b/src/sage/plot/contour_plot.py
-index c0cab456686..4accb309580 100644
---- a/src/sage/plot/contour_plot.py
-+++ b/src/sage/plot/contour_plot.py
-@@ -848,9 +848,7 @@ def f(x,y): return cos(x) + sin(y)
- 
-         sage: contour_plot(lambda x,y: 0, (-1,1), (-1,1),
-         ....:              contours=[0], fill=False, cmap=['blue'])
--        ...
--        UserWarning: No contour levels were found within the data range.
--        Graphics object consisting of 1 graphics primitive
-+        ...Graphics object consisting of 1 graphics primitive
- 
-     .. PLOT::
- 
-@@ -874,8 +872,7 @@ def f(x,y): return cos(x) + sin(y)
-     Check that :trac:`18074` is fixed::
- 
-         sage: contour_plot(0, (0,1), (0,1))
--        ... UserWarning: No contour levels were found within the data range.
--        Graphics object consisting of 1 graphics primitive
-+        ...Graphics object consisting of 1 graphics primitive
- 
-     Domain points in :trac:`11648` with complex output are now skipped::
- 
-diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
-index 64ea1a7e10f..cdc99ced263 100644
---- a/src/sage/plot/graphics.py
-+++ b/src/sage/plot/graphics.py
-@@ -2341,7 +2341,7 @@ def _matplotlib_tick_formatter(self, subplot, base=(10, 10),
-             sage: subplot = Figure().add_subplot(111)
-             sage: p._objects[0]._render_on_subplot(subplot)
-             sage: p._matplotlib_tick_formatter(subplot, **d)
--            (<AxesSubplot:...>,
-+            (<Axes...>,
-             <matplotlib.ticker.MaxNLocator object at ...>,
-             <matplotlib.ticker.MaxNLocator object at ...>,
-             <matplotlib.ticker.ScalarFormatter object at ...>,
-diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
-index 99c817f03a6..ae85183dc93 100644
---- a/src/sage/plot/multigraphics.py
-+++ b/src/sage/plot/multigraphics.py
-@@ -1207,7 +1207,7 @@ def _add_subplot(self, figure, index, **options):
-             sage: fig = Figure()
-             sage: ax1 = G._add_subplot(fig, 0)
-             sage: type(ax1)
--            <class 'matplotlib.axes._subplots.AxesSubplot'>
-+            <class 'matplotlib.axes...'>
-             sage: ax2 = G._add_subplot(fig, 1)
-             sage: fig.get_axes() == [ax1, ax2]
-             True
-diff --git a/src/sage/plot/plot3d/plot_field3d.py b/src/sage/plot/plot3d/plot_field3d.py
-index bdf39391d3e..fe10e27f58f 100644
---- a/src/sage/plot/plot3d/plot_field3d.py
-+++ b/src/sage/plot/plot3d/plot_field3d.py
-@@ -126,9 +126,9 @@ def plot_vector_field3d(functions, xrange, yrange, zrange,
-     vectors = [vector((ff(*point), gg(*point), hh(*point))) for point in points]
- 
-     try:
--        from matplotlib.cm import get_cmap
--        cm = get_cmap(colors)
--    except (TypeError, ValueError):
-+        import matplotlib as mpl
-+        cm = mpl.colormaps[colors]
-+    except (TypeError, KeyError):
-         cm = None
-     if cm is None:
-         if isinstance(colors, (list, tuple)):
diff --git a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch b/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
deleted file mode 100644
index 1e0a708e8068..000000000000
--- a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py
-index c9ca5e30939..9459cb70334 100644
---- a/src/sage/interfaces/maxima_lib.py
-+++ b/src/sage/interfaces/maxima_lib.py
-@@ -77,6 +77,26 @@
-     sage: bar == foo
-     True
- 
-+TESTS:
-+
-+Check our workaround for a race in ecl works, see :trac:`26968`.
-+We use a temporary `MAXIMA_USERDIR` so it's empty; we place it
-+in `DOT_SAGE` since we expect it to have more latency than `/tmp`.
-+
-+    sage: import tempfile, subprocess
-+    sage: tmpdir = tempfile.TemporaryDirectory(dir=DOT_SAGE)
-+    sage: _ = subprocess.run(['sage', '-c',  # long time
-+    ....: f'''
-+    ....: import os
-+    ....: os.environ["MAXIMA_USERDIR"] = "{tmpdir.name}"
-+    ....: if not os.fork():
-+    ....:     import sage.interfaces.maxima_lib
-+    ....: else:
-+    ....:     import sage.interfaces.maxima_lib
-+    ....:     os.wait()
-+    ....: '''])
-+    sage: tmpdir.cleanup()
-+
- """
- 
- # ****************************************************************************
-@@ -116,7 +136,23 @@
- ecl_eval("(setq $nolabels t))")
- ecl_eval("(defvar *MAXIMA-LANG-SUBDIR* NIL)")
- ecl_eval("(set-locale-subdir)")
--ecl_eval("(set-pathnames)")
-+
-+try:
-+    ecl_eval("(set-pathnames)")
-+except RuntimeError:
-+    # Recover from :trac:`26968` by creating `*maxima-objdir*` here.
-+    # This cannot be done before calling `(set-pathnames)` since
-+    # `*maxima-objdir*` is computed there.
-+    # We use python `os.makedirs()` which is immune to the race.
-+    # Using `(ensure-directories-exist ...)` in lisp would be
-+    # subject to the same race condition and since `*maxima-objdir*`
-+    # has multiple components this is quite plausible to happen.
-+    maxima_objdir = ecl_eval("*maxima-objdir*").python()[1:-1]
-+    import os
-+    os.makedirs(maxima_objdir, exist_ok=True)
-+    # Call `(set-pathnames)` again to complete its job.
-+    ecl_eval("(set-pathnames)")
-+
- ecl_eval("(defun add-lineinfo (x) x)")
- ecl_eval('(defun principal nil (cond ($noprincipal (diverg)) ((not pcprntd) (merror "Divergent Integral"))))')
- ecl_eval("(remprop 'mfactorial 'grind)")  # don't use ! for factorials (#11539)
diff --git a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch b/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
deleted file mode 100644
index fc3e40da2a88..000000000000
--- a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff --git a/src/bin/sage-cleaner b/src/bin/sage-cleaner
-index e2e578eec60..dc7d8f0482e 100755
---- a/src/bin/sage-cleaner
-+++ b/src/bin/sage-cleaner
-@@ -99,6 +99,15 @@ def cleanup():
- 
-     return len(pid_list)
- 
-+def cleanup_cruft():
-+    """ remove directories leftover from improper shutdown """
-+    tmp_dirs = os.listdir(SAGE_TMP_ROOT)
-+    for dir_entry in tmp_dirs:
-+        baddir = os.path.join(SAGE_TMP_ROOT, dir_entry)
-+        if os.path.isdir(baddir):
-+            logger.warning('Removing old directory %s from SAGE_TMP_ROOT', baddir)
-+            rm_rf(baddir)
-+
- def kill_spawned_jobs(jobfile, parent_pid):
-     logger.info("Killing %s's spawned jobs", parent_pid)
-     killed_them_all = True
-@@ -193,6 +202,7 @@ if __name__ == '__main__':
-     setup_daemon()
-     fix_old_mistakes()
-     logger.info("Starting sage-cleaner with PID %s", os.getpid())
-+    cleanup_cruft()
- 
-     if len(sys.argv) > 1:
-         wait = int(sys.argv[1])
diff --git a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch b/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
deleted file mode 100644
index ea210e20ae52..000000000000
--- a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py
-index ec6a5c19e60..9dd7bc1cb1e 100644
---- a/src/sage/graphs/generators/families.py
-+++ b/src/sage/graphs/generators/families.py
-@@ -3660,7 +3660,7 @@ def nauty_gentreeg(options="", debug=False):
- 
-         sage: gen = graphs.nauty_gentreeg("4", debug=True)
-         sage: print(next(gen))
--        >A ...gentreeg Z=2:3 D=3 n=4
-+        >A ...gentreeg ...
-         sage: gen = graphs.nauty_gentreeg("4 -q", debug=True)
-         sage: next(gen)
-         ''
-@@ -3687,7 +3687,7 @@ def nauty_gentreeg(options="", debug=False):
-         sage: list(graphs.nauty_gentreeg("3 -x", debug=True))
-         ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n [res/mod] ...
-         sage: list(graphs.nauty_gentreeg("3", debug=True))
--        ['>A ...gentreeg Z=2:2 D=2 n=3\n', Graph on 3 vertices]
-+        ['>A ...gentreeg ...\n', Graph on 3 vertices]
-     """
-     import shlex
-     from sage.features.nauty import NautyExecutable
-diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py
-index df88bbe2713..1a8016976c2 100644
---- a/src/sage/graphs/graph_generators.py
-+++ b/src/sage/graphs/graph_generators.py
-@@ -966,7 +966,7 @@ def nauty_geng(self, options="", debug=False):
-             ...
-             ValueError: wrong format of parameter option
-             sage: list(graphs.nauty_geng("-c3", debug=True))
--            ['>E Usage: ...geng [-cCmtfbd#D#] [-uygsnh] [-lvq] ...
-+            ['>E Usage: ...geng ...\n']
-             sage: list(graphs.nauty_geng("-c 3", debug=True))
-             ['>A ...geng -cd1D2 n=3 e=2-3\n', Graph on 3 vertices, Graph on 3 vertices]
-         """
diff --git a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch b/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
deleted file mode 100644
index 46bda084e48e..000000000000
--- a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-diff --git a/src/sage/repl/inputhook.py b/src/sage/repl/inputhook.py
-index da5df0268c0..7f7894f6dcf 100644
---- a/src/sage/repl/inputhook.py
-+++ b/src/sage/repl/inputhook.py
-@@ -17,6 +17,8 @@
- 
- import select
- import errno
-+import contextlib
-+import io
- 
- from IPython import get_ipython
- from IPython.terminal.pt_inputhooks import register
-@@ -47,15 +49,27 @@ def install():
-     """
-     Install the Sage input hook
- 
--    EXAMPLES::
-+    EXAMPLES:
-+
-+    Make sure ipython is running so we really test this function::
-+
-+        sage: from sage.repl.interpreter import get_test_shell
-+        sage: get_test_shell()
-+        <sage.repl.interpreter.SageTestShell object at ...>
-+
-+    Run the function twice, to check it is idempotent (see :trac:`35235`)::
- 
-         sage: from sage.repl.inputhook import install
-         sage: install()
-+        sage: install()
-     """
-     ip = get_ipython()
-     if not ip:
-         return   # Not running in ipython, e.g. doctests
--    ip.enable_gui('sage')
-+    if ip._inputhook != sage_inputhook:
-+        # silence `ip.enable_gui()` useless output
-+        with contextlib.redirect_stdout(io.StringIO()):
-+            ip.enable_gui('sage')
- 
- 
- def uninstall():
-@@ -71,4 +85,6 @@ def uninstall():
-     if not ip:
-         return
-     if ip._inputhook == sage_inputhook:
--        ip.enable_gui(None)
-+        # silence `ip.enable_gui()` useless output
-+        with contextlib.redirect_stdout(io.StringIO()):
-+            ip.enable_gui(None)
diff --git a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch b/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
deleted file mode 100644
index 2cdc674d4f9e..000000000000
--- a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 532fbbaf71bb41c73920b584108eb2a09d6deeb1 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
-Date: Tue, 4 Apr 2023 12:56:57 -0300
-Subject: [PATCH] Ignore deprecation warnings triggered by pythran 0.12.1
-
-These happen with python 3.11, setuptools 67.6.1, numpy 1.24.2.
-When pythran 0.12.1 is installed, I get 24 doctest failures due to
-deprecation warnings; they are all gone with this commit.
-
-[backported from 839a6e928c264a9863bd42860c78ae95a6d9f3e0]
----
- src/sage/all.py | 12 ++++++++++--
- 1 file changed, 10 insertions(+), 2 deletions(-)
-
-diff --git a/src/sage/all.py b/src/sage/all.py
-index 93588df1b93..ee775aad0e9 100644
---- a/src/sage/all.py
-+++ b/src/sage/all.py
-@@ -96,9 +96,17 @@ warnings.filterwarnings('ignore', category=DeprecationWarning,
- warnings.filterwarnings('ignore', category=DeprecationWarning,
-     module='(.*[.]_vendor[.])?packaging')
- 
--# Ignore numpy warnings triggered by pythran
-+# Ignore a few warnings triggered by pythran 0.12.1
- warnings.filterwarnings('ignore', category=DeprecationWarning,
--                        module='pythran')
-+    message='\n\n  `numpy.distutils` is deprecated since NumPy 1.23.0',
-+    module='pythran.dist')
-+warnings.filterwarnings('ignore', category=DeprecationWarning,
-+    message='pkg_resources is deprecated as an API|'
-+            'Deprecated call to `pkg_resources.declare_namespace(.*)`',
-+    module='pkg_resources')
-+warnings.filterwarnings('ignore', category=DeprecationWarning,
-+    message='msvccompiler is deprecated and slated to be removed',
-+    module='distutils.msvccompiler')
- 
- warnings.filterwarnings('ignore', category=DeprecationWarning,
-                         message='The distutils(.sysconfig module| package) is deprecated',
--- 
-2.40.0
-
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 74109ffbbb0d..aef79e95b1a6 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 URL_BASE_PR="https://github.com/sagemath/sage/pull/"
-URL_BASE_COMPARE="https://github.com/sagemath/sage/compare/9.8..."
+URL_BASE_COMPARE="https://github.com/sagemath/sage/compare/10.0.rc0..."
 
 case "$1" in
 	-n)  DO=echo ;;
@@ -15,46 +15,5 @@ get_pr() {
 	$DO wget "$URL_BASE_PR$pr.$ext" -O "$pr-$desc.patch"
 }
 
-get_trac() {
-	ticket=$1
-	desc=$(echo "$2" | sed -e 's/ /_/g')
-	commit=$3
-	$DO wget "$URL_BASE_COMPARE$commit.diff" -O "$ticket-$desc-$commit.patch"
-}
-
 # run from patches dir
 cd $(dirname "$0")
-
-# merged in 10.0.beta0
-get_trac 34851 "support singular 4.3.1.p3" 5e5737a0c
-get_pr 35068 "fix tests giac 1.9.0.35" patch
-
-# merged in 10.0.beta1
-get_pr 35058 "skip unstable tests klyachko"
-
-# merged in 10.0.beta2
-get_pr 34994 "fix tests numpy 1.24"
-get_pr 34997 "fix edge case of integer_check"
-
-# merged in 10.0.beta3
-get_pr 34995 "support tachyon 0.99.2"
-
-# merged in 10.0.beta4
-get_pr 34980 "avoid factoring in is_prime"
-
-# merged in 10.0.beta5
-get_pr 35094 "support gap 4.12"					# includes PR 35093
-
-# merged in 10.0.beta6
-get_pr 35127 "fix very slow test stream.py"
-get_pr 35177 "matplotlib 3.7"
-get_pr 35195 "workaround ecl race"
-get_pr 35204 "fix sage-cleaner"
-
-# merged in 10.0.beta7
-get_pr 35250 "nauty 2.8.6"
-
-# merged in 10.0.beta8
-#get_pr 35337 "ipython 8.11"
-get_pr 35423 "ipython 8.12"						# includes PR 35337
-get_pr 35438 "pythran 0.12.1"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 82f97480a10f..f360376d6cab 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=9.8
-revision=2
+version=10.0.rc0
+revision=1
 build_wrksrc=pkgs/sagemath-standard
 build_style=python3-module
 _bindir=/usr/lib/sagemath/$version/bin
@@ -32,7 +32,7 @@ maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-or-later"
 homepage="http://sagemath.org/"
 distfiles="https://github.com/sagemath/sage/archive/refs/tags/$version.tar.gz"
-checksum=2aff28bd1d18c2d526581f5298acb8336f5b92db5675a7403dec8eaf9a86bc4c
+checksum=8e56869d5c14f4bab4d8b0de2e4313b28375c3de35fb3e35e7766e697736eb83
 
 do_configure() {
 	# git tree needs bootstrapping

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [RFC] sagemath: update to 10.0.rc0.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
@ 2023-04-28 20:38 ` icp1994
  2023-04-28 20:47 ` tornaria
                   ` (38 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: icp1994 @ 2023-04-28 20:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 424 bytes --]

New comment by icp1994 on void-packages repository

https://github.com/void-linux/void-packages/pull/43659#issuecomment-1528068885

Comment:
I really hoped they would include updated [networkx](https://github.com/sagemath/sage/blob/10.0.rc0/build/pkgs/networkx/install-requires.txt) in this release. I have been meaning to update `python3-networkx` here to v3 for months but I can't confirm if that version works with sage.

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [RFC] sagemath: update to 10.0.rc0.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
  2023-04-28 20:38 ` icp1994
@ 2023-04-28 20:47 ` tornaria
  2023-04-28 22:50 ` tornaria
                   ` (37 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: tornaria @ 2023-04-28 20:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 500 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43659#issuecomment-1528076505

Comment:
> I really hoped they would include updated [networkx](https://github.com/sagemath/sage/blob/10.0.rc0/build/pkgs/networkx/install-requires.txt) in this release. I have been meaning to update `python3-networkx` here to v3 for months but I can't confirm if that version works with sage.

Do you have a draft PR for updating `python3-networkx`? I can try it.

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [RFC] sagemath: update to 10.0.rc0.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
  2023-04-28 20:38 ` icp1994
  2023-04-28 20:47 ` tornaria
@ 2023-04-28 22:50 ` tornaria
  2023-04-29  1:28 ` tornaria
                   ` (36 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: tornaria @ 2023-04-28 22:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 810 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43659#issuecomment-1528170518

Comment:
> I really hoped they would include updated [networkx](https://github.com/sagemath/sage/blob/10.0.rc0/build/pkgs/networkx/install-requires.txt) in this release. I have been meaning to update `python3-networkx` here to v3 for months but I can't confirm if that version works with sage.

I think I have a reasonable fix for 10.0.rc0 and it may even work for 9.8. Still testing.
If everything works I will submit upstream and include the patch in #43225 so sagemath in void supports networkx 3.1. After #43225 is merged we can update networkx to 3.1. 

Hopefully I will be able to get this fix merged in time for sagemath 10.0, but if not we can patch our sagemath.

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [RFC] sagemath: update to 10.0.rc0.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (2 preceding siblings ...)
  2023-04-28 22:50 ` tornaria
@ 2023-04-29  1:28 ` tornaria
  2023-04-29  2:20 ` [PR PATCH] [Updated] " tornaria
                   ` (35 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: tornaria @ 2023-04-29  1:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 231 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43659#issuecomment-1528401450

Comment:
See https://github.com/sagemath/sage/pull/35584 for support of networkx 3.1 in sagemath.

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] sagemath: update to 10.0.rc0.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (3 preceding siblings ...)
  2023-04-29  1:28 ` tornaria
@ 2023-04-29  2:20 ` tornaria
  2023-05-05  1:46 ` tornaria
                   ` (34 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: tornaria @ 2023-04-29  2:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1700 bytes --]

There is an updated pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages sagemath-next
https://github.com/void-linux/void-packages/pull/43659

[RFC] sagemath: update to 10.0.rc0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

This builds on top of #43225 for convenience.

#### Testing the changes
- I tested the changes in this PR: **briefly**

I've been following beta releases and now rc0 includes all of our patches :muscle:

All doctests pass with the version of packages in void except for `python-Babel` which must be updated (as in #43497) and is included  here as part of #43225.

I've switched my system sagemath to this version as everything seems to be working ok. The testsuite is 10-15% faster.

@dkwo: enjoy.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/43659.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-sagemath-next-43659.patch --]
[-- Type: text/x-diff, Size: 159862 bytes --]

From bcd09894152c6db0b95460127cedd256cb88de36 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 27 Mar 2023 00:31:35 -0300
Subject: [PATCH 1/4] singular: update to 4.3.2.

---
 common/shlibs             | 10 +++++-----
 srcpkgs/singular/template |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index e282bbd1f588..08dac21a5b3e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4099,11 +4099,11 @@ libumfpack.so.6 SuiteSparse-6.0.1_1
 libecl.so.21.2 ecl-21.2.1_1
 libecm.so.1 ecm-7.0.4_3
 libcliquer.so.1 cliquer-1.22_1
-libSingular-4.3.1.so singular-4.3.1p2_1
-libfactory-4.3.1.so singular-4.3.1p2_1
-libpolys-4.3.1.so singular-4.3.1p2_1
-libomalloc-0.9.6.so singular-4.3.1p2_1
-libsingular_resources-4.3.1.so singular-4.3.1p2_1
+libomalloc-0.9.6.so singular-4.2.1_1
+libSingular-4.3.2.so singular-4.3.2_1
+libfactory-4.3.2.so singular-4.3.2_1
+libpolys-4.3.2.so singular-4.3.2_1
+libsingular_resources-4.3.2.so singular-4.3.2_1
 libbrial.so.3 brial-1.2.10_1
 libbrial_groebner.so.3 brial-1.2.10_1
 libm4ri-0.0.20200125.so m4ri-20200125_1
diff --git a/srcpkgs/singular/template b/srcpkgs/singular/template
index c73a020dcf15..0481f6cb1e11 100644
--- a/srcpkgs/singular/template
+++ b/srcpkgs/singular/template
@@ -1,6 +1,6 @@
 # Template file for 'singular'
 pkgname=singular
-version=4.3.1p3
+version=4.3.2
 revision=1
 _majver=${version%p*}
 build_style=gnu-configure
@@ -20,7 +20,7 @@ maintainer="dkwo <npiazza@disroot.org>"
 license="GPL-2.0-or-later"
 homepage="https://www.singular.uni-kl.de"
 distfiles="https://www.singular.uni-kl.de/ftp/pub/Math/Singular/SOURCES/${_majver//./-}/singular-${version}.tar.gz"
-checksum=66cfaeee7ab909272fd81050a09cae3ec115652a01adde014a5128a54b97397a
+checksum=3fd565d1bd4265fa8ba7cc189137a36d9daf9939b5bb411466c2028d9191f6db
 
 if [ -z "$CROSS_BUILD" ]; then
 	makedepends+=" ntl-devel"

From 3171129c048430254672b4b0828bd37bab9c1e7f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 15 Mar 2023 09:27:58 -0300
Subject: [PATCH 2/4] sagemath: rebuild for singular update

Also fix doctests for pkg updates:
 - matplotlib 3.7
 - ipython 8.12
 - nauty 2.8.6
 - pythran 0.12.1

And add support for:
 - networkx 3.1

We use patches from upstream sagemath to fix all of these.

We also add pythran and sphinx to checkdepends to make sure doctests
pass when they are installed.
---
 ...support_singular_4.3.1.p3-5e5737a0c.patch} |  0
 .../34980-avoid_factoring_in_is_prime.patch   | 16 ++--
 .../patches/35177-matplotlib_3.7.patch        | 95 +++++++++++++++++++
 .../patches/35195-workaround_ecl_race.patch   | 56 +++++++++++
 .../patches/35204-fix_sage-cleaner.patch      | 28 ++++++
 .../sagemath/patches/35250-nauty_2.8.6.patch  | 35 +++++++
 .../sagemath/patches/35423-ipython_8.12.patch | 51 ++++++++++
 .../patches/35438-pythran_0.12.1.patch        | 41 ++++++++
 .../sagemath/patches/35584-networkx_3.1.patch | 81 ++++++++++++++++
 srcpkgs/sagemath/patches/get_patches          | 32 ++++++-
 srcpkgs/sagemath/template                     |  4 +-
 11 files changed, 425 insertions(+), 14 deletions(-)
 rename srcpkgs/sagemath/patches/{trac-34851-support_singular_4.3.1.p3-5e5737a0c.patch => 34851-support_singular_4.3.1.p3-5e5737a0c.patch} (100%)
 create mode 100644 srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
 create mode 100644 srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
 create mode 100644 srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
 create mode 100644 srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
 create mode 100644 srcpkgs/sagemath/patches/35423-ipython_8.12.patch
 create mode 100644 srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
 create mode 100644 srcpkgs/sagemath/patches/35584-networkx_3.1.patch

diff --git a/srcpkgs/sagemath/patches/trac-34851-support_singular_4.3.1.p3-5e5737a0c.patch b/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
similarity index 100%
rename from srcpkgs/sagemath/patches/trac-34851-support_singular_4.3.1.p3-5e5737a0c.patch
rename to srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
diff --git a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch b/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
index ca61a2ada4eb..ee0f0e656b28 100644
--- a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
+++ b/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
@@ -1,8 +1,8 @@
 diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py
-index d5f7157217f..1a9d11aec68 100644
+index d5f7157217f..8ca1f958039 100644
 --- a/src/sage/rings/number_field/number_field_ideal.py
 +++ b/src/sage/rings/number_field/number_field_ideal.py
-@@ -996,16 +996,36 @@ def is_prime(self):
+@@ -996,16 +996,38 @@ def is_prime(self):
              False
              sage: K.ideal(17).is_prime()  # ramified
              False
@@ -33,13 +33,15 @@ index d5f7157217f..1a9d11aec68 100644
 +        K = self.number_field().pari_nf()
 +        I = self.pari_hnf()
 +
-+        self._pari_prime = K.idealismaximal(I) or None
++        candidate = K.idealismaximal(I) or None
 +
 +        # PARI uses probabilistic primality testing inside idealismaximal().
-+        if self._pari_prime \
-+                and get_flag(None, 'arithmetic') \
-+                and not self._pari_prime[0].isprime():
-+            self._pari_prime = None
++        if get_flag(None, 'arithmetic'):
++            # proof required, check using isprime()
++            if candidate and not candidate[0].isprime():
++                candidate = None
++
++        self._pari_prime = candidate
 +
 +        return self._pari_prime is not None
  
diff --git a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch b/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
new file mode 100644
index 000000000000..007f3324cfe4
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
@@ -0,0 +1,95 @@
+diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
+index b77c69b2f77..0586a96ae55 100644
+--- a/src/sage/plot/complex_plot.pyx
++++ b/src/sage/plot/complex_plot.pyx
+@@ -563,7 +563,7 @@ def complex_to_cmap_rgb(z_values, cmap='turbo', contoured=False, tiled=False,
+     import matplotlib as mpl
+ 
+     if isinstance(cmap, str):
+-        cmap = mpl.cm.get_cmap(cmap)
++        cmap = mpl.colormaps[cmap]
+ 
+     if contour_base is None:
+         if contour_type == "linear":
+@@ -1206,11 +1206,11 @@ def complex_plot(f, x_range, y_range, contoured=False, tiled=False, cmap=None,
+                 domain = np.linspace(0, 1, 256)
+                 shifted_domain = np.roll(domain, 128)
+                 default_cmap = mpl.colors.LinearSegmentedColormap.from_list(
+-                    "sage_default", mpl.cm.get_cmap('hsv')(shifted_domain)
++                    "sage_default", mpl.colormaps['hsv'](shifted_domain)
+                 )
+                 cmap = default_cmap
+             else:
+-                cmap = mpl.cm.get_cmap(cmap)
++                cmap = mpl.colormaps[cmap]
+         rgbs = complex_to_cmap_rgb(
+             z_values, cmap=cmap, contoured=contoured, tiled=tiled,
+             contour_type=contour_type, contour_base=contour_base,
+diff --git a/src/sage/plot/contour_plot.py b/src/sage/plot/contour_plot.py
+index c0cab456686..4accb309580 100644
+--- a/src/sage/plot/contour_plot.py
++++ b/src/sage/plot/contour_plot.py
+@@ -848,9 +848,7 @@ def f(x,y): return cos(x) + sin(y)
+ 
+         sage: contour_plot(lambda x,y: 0, (-1,1), (-1,1),
+         ....:              contours=[0], fill=False, cmap=['blue'])
+-        ...
+-        UserWarning: No contour levels were found within the data range.
+-        Graphics object consisting of 1 graphics primitive
++        ...Graphics object consisting of 1 graphics primitive
+ 
+     .. PLOT::
+ 
+@@ -874,8 +872,7 @@ def f(x,y): return cos(x) + sin(y)
+     Check that :trac:`18074` is fixed::
+ 
+         sage: contour_plot(0, (0,1), (0,1))
+-        ... UserWarning: No contour levels were found within the data range.
+-        Graphics object consisting of 1 graphics primitive
++        ...Graphics object consisting of 1 graphics primitive
+ 
+     Domain points in :trac:`11648` with complex output are now skipped::
+ 
+diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
+index 64ea1a7e10f..cdc99ced263 100644
+--- a/src/sage/plot/graphics.py
++++ b/src/sage/plot/graphics.py
+@@ -2341,7 +2341,7 @@ def _matplotlib_tick_formatter(self, subplot, base=(10, 10),
+             sage: subplot = Figure().add_subplot(111)
+             sage: p._objects[0]._render_on_subplot(subplot)
+             sage: p._matplotlib_tick_formatter(subplot, **d)
+-            (<AxesSubplot:...>,
++            (<Axes...>,
+             <matplotlib.ticker.MaxNLocator object at ...>,
+             <matplotlib.ticker.MaxNLocator object at ...>,
+             <matplotlib.ticker.ScalarFormatter object at ...>,
+diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
+index 99c817f03a6..ae85183dc93 100644
+--- a/src/sage/plot/multigraphics.py
++++ b/src/sage/plot/multigraphics.py
+@@ -1207,7 +1207,7 @@ def _add_subplot(self, figure, index, **options):
+             sage: fig = Figure()
+             sage: ax1 = G._add_subplot(fig, 0)
+             sage: type(ax1)
+-            <class 'matplotlib.axes._subplots.AxesSubplot'>
++            <class 'matplotlib.axes...'>
+             sage: ax2 = G._add_subplot(fig, 1)
+             sage: fig.get_axes() == [ax1, ax2]
+             True
+diff --git a/src/sage/plot/plot3d/plot_field3d.py b/src/sage/plot/plot3d/plot_field3d.py
+index bdf39391d3e..fe10e27f58f 100644
+--- a/src/sage/plot/plot3d/plot_field3d.py
++++ b/src/sage/plot/plot3d/plot_field3d.py
+@@ -126,9 +126,9 @@ def plot_vector_field3d(functions, xrange, yrange, zrange,
+     vectors = [vector((ff(*point), gg(*point), hh(*point))) for point in points]
+ 
+     try:
+-        from matplotlib.cm import get_cmap
+-        cm = get_cmap(colors)
+-    except (TypeError, ValueError):
++        import matplotlib as mpl
++        cm = mpl.colormaps[colors]
++    except (TypeError, KeyError):
+         cm = None
+     if cm is None:
+         if isinstance(colors, (list, tuple)):
diff --git a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch b/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
new file mode 100644
index 000000000000..1e0a708e8068
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
@@ -0,0 +1,56 @@
+diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py
+index c9ca5e30939..9459cb70334 100644
+--- a/src/sage/interfaces/maxima_lib.py
++++ b/src/sage/interfaces/maxima_lib.py
+@@ -77,6 +77,26 @@
+     sage: bar == foo
+     True
+ 
++TESTS:
++
++Check our workaround for a race in ecl works, see :trac:`26968`.
++We use a temporary `MAXIMA_USERDIR` so it's empty; we place it
++in `DOT_SAGE` since we expect it to have more latency than `/tmp`.
++
++    sage: import tempfile, subprocess
++    sage: tmpdir = tempfile.TemporaryDirectory(dir=DOT_SAGE)
++    sage: _ = subprocess.run(['sage', '-c',  # long time
++    ....: f'''
++    ....: import os
++    ....: os.environ["MAXIMA_USERDIR"] = "{tmpdir.name}"
++    ....: if not os.fork():
++    ....:     import sage.interfaces.maxima_lib
++    ....: else:
++    ....:     import sage.interfaces.maxima_lib
++    ....:     os.wait()
++    ....: '''])
++    sage: tmpdir.cleanup()
++
+ """
+ 
+ # ****************************************************************************
+@@ -116,7 +136,23 @@
+ ecl_eval("(setq $nolabels t))")
+ ecl_eval("(defvar *MAXIMA-LANG-SUBDIR* NIL)")
+ ecl_eval("(set-locale-subdir)")
+-ecl_eval("(set-pathnames)")
++
++try:
++    ecl_eval("(set-pathnames)")
++except RuntimeError:
++    # Recover from :trac:`26968` by creating `*maxima-objdir*` here.
++    # This cannot be done before calling `(set-pathnames)` since
++    # `*maxima-objdir*` is computed there.
++    # We use python `os.makedirs()` which is immune to the race.
++    # Using `(ensure-directories-exist ...)` in lisp would be
++    # subject to the same race condition and since `*maxima-objdir*`
++    # has multiple components this is quite plausible to happen.
++    maxima_objdir = ecl_eval("*maxima-objdir*").python()[1:-1]
++    import os
++    os.makedirs(maxima_objdir, exist_ok=True)
++    # Call `(set-pathnames)` again to complete its job.
++    ecl_eval("(set-pathnames)")
++
+ ecl_eval("(defun add-lineinfo (x) x)")
+ ecl_eval('(defun principal nil (cond ($noprincipal (diverg)) ((not pcprntd) (merror "Divergent Integral"))))')
+ ecl_eval("(remprop 'mfactorial 'grind)")  # don't use ! for factorials (#11539)
diff --git a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch b/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
new file mode 100644
index 000000000000..fc3e40da2a88
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
@@ -0,0 +1,28 @@
+diff --git a/src/bin/sage-cleaner b/src/bin/sage-cleaner
+index e2e578eec60..dc7d8f0482e 100755
+--- a/src/bin/sage-cleaner
++++ b/src/bin/sage-cleaner
+@@ -99,6 +99,15 @@ def cleanup():
+ 
+     return len(pid_list)
+ 
++def cleanup_cruft():
++    """ remove directories leftover from improper shutdown """
++    tmp_dirs = os.listdir(SAGE_TMP_ROOT)
++    for dir_entry in tmp_dirs:
++        baddir = os.path.join(SAGE_TMP_ROOT, dir_entry)
++        if os.path.isdir(baddir):
++            logger.warning('Removing old directory %s from SAGE_TMP_ROOT', baddir)
++            rm_rf(baddir)
++
+ def kill_spawned_jobs(jobfile, parent_pid):
+     logger.info("Killing %s's spawned jobs", parent_pid)
+     killed_them_all = True
+@@ -193,6 +202,7 @@ if __name__ == '__main__':
+     setup_daemon()
+     fix_old_mistakes()
+     logger.info("Starting sage-cleaner with PID %s", os.getpid())
++    cleanup_cruft()
+ 
+     if len(sys.argv) > 1:
+         wait = int(sys.argv[1])
diff --git a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch b/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
new file mode 100644
index 000000000000..ea210e20ae52
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
@@ -0,0 +1,35 @@
+diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py
+index ec6a5c19e60..9dd7bc1cb1e 100644
+--- a/src/sage/graphs/generators/families.py
++++ b/src/sage/graphs/generators/families.py
+@@ -3660,7 +3660,7 @@ def nauty_gentreeg(options="", debug=False):
+ 
+         sage: gen = graphs.nauty_gentreeg("4", debug=True)
+         sage: print(next(gen))
+-        >A ...gentreeg Z=2:3 D=3 n=4
++        >A ...gentreeg ...
+         sage: gen = graphs.nauty_gentreeg("4 -q", debug=True)
+         sage: next(gen)
+         ''
+@@ -3687,7 +3687,7 @@ def nauty_gentreeg(options="", debug=False):
+         sage: list(graphs.nauty_gentreeg("3 -x", debug=True))
+         ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n [res/mod] ...
+         sage: list(graphs.nauty_gentreeg("3", debug=True))
+-        ['>A ...gentreeg Z=2:2 D=2 n=3\n', Graph on 3 vertices]
++        ['>A ...gentreeg ...\n', Graph on 3 vertices]
+     """
+     import shlex
+     from sage.features.nauty import NautyExecutable
+diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py
+index df88bbe2713..1a8016976c2 100644
+--- a/src/sage/graphs/graph_generators.py
++++ b/src/sage/graphs/graph_generators.py
+@@ -966,7 +966,7 @@ def nauty_geng(self, options="", debug=False):
+             ...
+             ValueError: wrong format of parameter option
+             sage: list(graphs.nauty_geng("-c3", debug=True))
+-            ['>E Usage: ...geng [-cCmtfbd#D#] [-uygsnh] [-lvq] ...
++            ['>E Usage: ...geng ...\n']
+             sage: list(graphs.nauty_geng("-c 3", debug=True))
+             ['>A ...geng -cd1D2 n=3 e=2-3\n', Graph on 3 vertices, Graph on 3 vertices]
+         """
diff --git a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch b/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
new file mode 100644
index 000000000000..46bda084e48e
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
@@ -0,0 +1,51 @@
+diff --git a/src/sage/repl/inputhook.py b/src/sage/repl/inputhook.py
+index da5df0268c0..7f7894f6dcf 100644
+--- a/src/sage/repl/inputhook.py
++++ b/src/sage/repl/inputhook.py
+@@ -17,6 +17,8 @@
+ 
+ import select
+ import errno
++import contextlib
++import io
+ 
+ from IPython import get_ipython
+ from IPython.terminal.pt_inputhooks import register
+@@ -47,15 +49,27 @@ def install():
+     """
+     Install the Sage input hook
+ 
+-    EXAMPLES::
++    EXAMPLES:
++
++    Make sure ipython is running so we really test this function::
++
++        sage: from sage.repl.interpreter import get_test_shell
++        sage: get_test_shell()
++        <sage.repl.interpreter.SageTestShell object at ...>
++
++    Run the function twice, to check it is idempotent (see :trac:`35235`)::
+ 
+         sage: from sage.repl.inputhook import install
+         sage: install()
++        sage: install()
+     """
+     ip = get_ipython()
+     if not ip:
+         return   # Not running in ipython, e.g. doctests
+-    ip.enable_gui('sage')
++    if ip._inputhook != sage_inputhook:
++        # silence `ip.enable_gui()` useless output
++        with contextlib.redirect_stdout(io.StringIO()):
++            ip.enable_gui('sage')
+ 
+ 
+ def uninstall():
+@@ -71,4 +85,6 @@ def uninstall():
+     if not ip:
+         return
+     if ip._inputhook == sage_inputhook:
+-        ip.enable_gui(None)
++        # silence `ip.enable_gui()` useless output
++        with contextlib.redirect_stdout(io.StringIO()):
++            ip.enable_gui(None)
diff --git a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch b/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
new file mode 100644
index 000000000000..2cdc674d4f9e
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
@@ -0,0 +1,41 @@
+From 532fbbaf71bb41c73920b584108eb2a09d6deeb1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
+Date: Tue, 4 Apr 2023 12:56:57 -0300
+Subject: [PATCH] Ignore deprecation warnings triggered by pythran 0.12.1
+
+These happen with python 3.11, setuptools 67.6.1, numpy 1.24.2.
+When pythran 0.12.1 is installed, I get 24 doctest failures due to
+deprecation warnings; they are all gone with this commit.
+
+[backported from 839a6e928c264a9863bd42860c78ae95a6d9f3e0]
+---
+ src/sage/all.py | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/src/sage/all.py b/src/sage/all.py
+index 93588df1b93..ee775aad0e9 100644
+--- a/src/sage/all.py
++++ b/src/sage/all.py
+@@ -96,9 +96,17 @@ warnings.filterwarnings('ignore', category=DeprecationWarning,
+ warnings.filterwarnings('ignore', category=DeprecationWarning,
+     module='(.*[.]_vendor[.])?packaging')
+ 
+-# Ignore numpy warnings triggered by pythran
++# Ignore a few warnings triggered by pythran 0.12.1
+ warnings.filterwarnings('ignore', category=DeprecationWarning,
+-                        module='pythran')
++    message='\n\n  `numpy.distutils` is deprecated since NumPy 1.23.0',
++    module='pythran.dist')
++warnings.filterwarnings('ignore', category=DeprecationWarning,
++    message='pkg_resources is deprecated as an API|'
++            'Deprecated call to `pkg_resources.declare_namespace(.*)`',
++    module='pkg_resources')
++warnings.filterwarnings('ignore', category=DeprecationWarning,
++    message='msvccompiler is deprecated and slated to be removed',
++    module='distutils.msvccompiler')
+ 
+ warnings.filterwarnings('ignore', category=DeprecationWarning,
+                         message='The distutils(.sysconfig module| package) is deprecated',
+-- 
+2.40.0
+
diff --git a/srcpkgs/sagemath/patches/35584-networkx_3.1.patch b/srcpkgs/sagemath/patches/35584-networkx_3.1.patch
new file mode 100644
index 000000000000..66eedecff7c6
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35584-networkx_3.1.patch
@@ -0,0 +1,81 @@
+diff --git a/src/sage/graphs/graph.py b/src/sage/graphs/graph.py
+index c2e42bcbd3..b6a10efbf4 100644
+--- a/src/sage/graphs/graph.py
++++ b/src/sage/graphs/graph.py
+@@ -6786,13 +6786,21 @@ def cliques_number_of(self, vertices=None, cliques=None):
+             {(0, 0): 2, (0, 1): 3, (0, 2): 2, (1, 0): 2, (1, 1): 3, (1, 2): 2}
+             sage: F.cliques_number_of(vertices=[(0, 1), (1, 2)])
+             {(0, 1): 3, (1, 2): 2}
++            sage: F.cliques_number_of(vertices=(0, 1))
++            3
+             sage: G = Graph({0:[1,2,3], 1:[2], 3:[0,1]})
+             sage: G.show(figsize=[2,2])
+             sage: G.cliques_number_of()
+             {0: 2, 1: 2, 2: 1, 3: 1}
+         """
+-        import networkx
+-        return networkx.number_of_cliques(self.networkx_graph(), vertices, cliques)
++        if cliques is None:
++            cliques = self.cliques_maximal()
++
++        if vertices in self: # single vertex
++            return sum(1 for c in cliques if vertices in c)
++        else:
++            return { v : sum(1 for c in cliques if v in c)
++                     for v in vertices or self }
+ 
+     @doc_index("Clique-related methods")
+     def cliques_get_max_clique_graph(self):
+@@ -7493,17 +7501,32 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
+ 
+             sage: C = Graph('DJ{')
+             sage: C.cliques_containing_vertex()
+-            {0: [[4, 0]], 1: [[4, 1, 2, 3]], 2: [[4, 1, 2, 3]], 3: [[4, 1, 2, 3]], 4: [[4, 0], [4, 1, 2, 3]]}
++            {0: [[0, 4]],
++             1: [[1, 2, 3, 4]],
++             2: [[1, 2, 3, 4]],
++             3: [[1, 2, 3, 4]],
++             4: [[0, 4], [1, 2, 3, 4]]}
++            sage: C.cliques_containing_vertex(4)
++            [[0, 4], [1, 2, 3, 4]]
++            sage: C.cliques_containing_vertex([0, 1])
++            {0: [[0, 4]], 1: [[1, 2, 3, 4]]}
+             sage: E = C.cliques_maximal()
+             sage: E
+             [[0, 4], [1, 2, 3, 4]]
+             sage: C.cliques_containing_vertex(cliques=E)
+-            {0: [[0, 4]], 1: [[1, 2, 3, 4]], 2: [[1, 2, 3, 4]], 3: [[1, 2, 3, 4]], 4: [[0, 4], [1, 2, 3, 4]]}
++            {0: [[0, 4]],
++             1: [[1, 2, 3, 4]],
++             2: [[1, 2, 3, 4]],
++             3: [[1, 2, 3, 4]],
++             4: [[0, 4], [1, 2, 3, 4]]}
+ 
+             sage: G = Graph({0:[1,2,3], 1:[2], 3:[0,1]})
+             sage: G.show(figsize=[2,2])
+             sage: G.cliques_containing_vertex()
+-            {0: [[0, 1, 2], [0, 1, 3]], 1: [[0, 1, 2], [0, 1, 3]], 2: [[0, 1, 2]], 3: [[0, 1, 3]]}
++            {0: [[0, 1, 2], [0, 1, 3]],
++             1: [[0, 1, 2], [0, 1, 3]],
++             2: [[0, 1, 2]],
++             3: [[0, 1, 3]]}
+ 
+         Since each clique of a 2 dimensional grid corresponds to an edge, the
+         number of cliques in which a vertex is involved equals its degree::
+@@ -7518,8 +7541,14 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
+             sage: sorted(sorted(x for x in L) for L in d[(0, 1)])
+             [[(0, 0), (0, 1)], [(0, 1), (0, 2)], [(0, 1), (1, 1)]]
+         """
+-        import networkx
+-        return networkx.cliques_containing_node(self.networkx_graph(), vertices, cliques)
++        if cliques is None:
++            cliques = self.cliques_maximal()
++
++        if vertices in self: # single vertex
++            return [c for c in cliques if vertices in c]
++        else:
++            return { v : [c for c in cliques if v in c]
++                     for v in vertices or self }
+ 
+     @doc_index("Clique-related methods")
+     def clique_complex(self):
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index c98da68683cc..871ae38577fd 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -19,7 +19,7 @@ get_trac() {
 	ticket=$1
 	desc=$(echo "$2" | sed -e 's/ /_/g')
 	commit=$3
-	$DO wget "$URL_BASE_COMPARE$commit.diff" -O "trac-$ticket-$desc-$commit.patch"
+	$DO wget "$URL_BASE_COMPARE$commit.diff" -O "$ticket-$desc-$commit.patch"
 }
 
 # run from patches dir
@@ -29,13 +29,35 @@ cd $(dirname "$0")
 get_trac 34851 "support singular 4.3.1.p3" 5e5737a0c
 get_pr 35068 "fix tests giac 1.9.0.35" patch
 
-# positive review
+# merged in 10.0.beta1
+get_pr 35058 "skip unstable tests klyachko"
+
+# merged in 10.0.beta2
 get_pr 34994 "fix tests numpy 1.24"
 get_pr 34997 "fix edge case of integer_check"
-get_pr 35058 "skip unstable tests klyachko"
-get_pr 35094 "support gap 4.12"					# includes PR 35093
 
-# needs review 
+# merged in 10.0.beta3
 get_pr 34995 "support tachyon 0.99.2"
+
+# merged in 10.0.beta4
 get_pr 34980 "avoid factoring in is_prime"
+
+# merged in 10.0.beta5
+get_pr 35094 "support gap 4.12"					# includes PR 35093
+
+# merged in 10.0.beta6
 get_pr 35127 "fix very slow test stream.py"
+get_pr 35177 "matplotlib 3.7"
+get_pr 35195 "workaround ecl race"
+get_pr 35204 "fix sage-cleaner"
+
+# merged in 10.0.beta7
+get_pr 35250 "nauty 2.8.6"
+
+# merged in 10.0.beta8
+#get_pr 35337 "ipython 8.11"
+get_pr 35423 "ipython 8.12"						# includes PR 35337
+get_pr 35438 "pythran 0.12.1"
+
+# needs review
+get_pr 35584 "networkx 3.1"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 75695f0e5f87..66a543efd21d 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
 version=9.8
-revision=1
+revision=2
 build_wrksrc=pkgs/sagemath-standard
 build_style=python3-module
 _bindir=/usr/lib/sagemath/$version/bin
@@ -26,7 +26,7 @@ depends="FlintQS eclib-devel fflas-ffpack flintlib-devel gcc-fortran gd-devel
  python3-sympy python3-traitlets sage-data-combinatorial_designs
  sage-data-conway_polynomials sage-data-elliptic_curves sage-data-graphs
  sage-data-polytopes_db sympow tachyon threejs-sage"
-checkdepends="$depends"
+checkdepends="$depends pythran python3-Sphinx"
 short_desc="Open source mathematics software"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-or-later"

From 09713264ff96b25e7f8e00b02770e7f0bf9891ca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Fri, 28 Apr 2023 19:38:50 -0300
Subject: [PATCH 3/4] python3-networkx: update to 3.1.

---
 srcpkgs/python3-networkx/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/python3-networkx/template b/srcpkgs/python3-networkx/template
index 83e21291feb8..526f4c5e259a 100644
--- a/srcpkgs/python3-networkx/template
+++ b/srcpkgs/python3-networkx/template
@@ -1,6 +1,6 @@
 # Template file for 'python3-networkx'
 pkgname=python3-networkx
-version=2.8.8
+version=3.1
 revision=1
 build_style=python3-module
 # failing in i686
@@ -10,12 +10,12 @@ depends="python3"
 checkdepends="python3-numpy python3-scipy python3-matplotlib python3-pandas
  python3-lxml python3-sympy python3-pytest-xdist"
 short_desc="Python3 package for creating and manipulating graphs and networks"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="BSD-3-Clause"
 homepage="https://networkx.org"
-changelog="https://networkx.org/documentation/stable/release/"
+changelog="https://github.com/networkx/networkx/raw/main/doc/release/release_${version}.rst"
 distfiles="${PYPI_SITE}/n/networkx/networkx-${version}.tar.gz"
-checksum=230d388117af870fce5647a3c52401fcf753e94720e6ea6b4197a5355648885e
+checksum=de346335408f84de0eada6ff9fafafff9bcda11f0a0dfaa931133debb146ab61
 
 post_install() {
 	vlicense LICENSE.txt

From c04d7c667a67f73ab9b48214b3f8715aea2fbc44 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Tue, 25 Apr 2023 13:20:47 -0300
Subject: [PATCH 4/4] sagemath: update to 10.0.rc0.

---
 srcpkgs/sagemath/files/sage_conf.py           |    1 -
 srcpkgs/sagemath/files/timings2.json          |  405 ++---
 ...-support_singular_4.3.1.p3-5e5737a0c.patch |  205 ---
 .../34980-avoid_factoring_in_is_prime.patch   |   49 -
 .../patches/34994-fix_tests_numpy_1.24.patch  |   58 -
 .../34995-support_tachyon_0.99.2.patch        |   57 -
 ...34997-fix_edge_case_of_integer_check.patch |   36 -
 .../35058-skip_unstable_tests_klyachko.patch  |   22 -
 .../35068-fix_tests_giac_1.9.0.35.patch       |   62 -
 .../patches/35094-support_gap_4.12.patch      | 1303 -----------------
 .../35127-fix_very_slow_test_stream.py.patch  |   15 -
 .../patches/35177-matplotlib_3.7.patch        |   95 --
 .../patches/35195-workaround_ecl_race.patch   |   56 -
 .../patches/35204-fix_sage-cleaner.patch      |   28 -
 .../sagemath/patches/35250-nauty_2.8.6.patch  |   35 -
 .../sagemath/patches/35423-ipython_8.12.patch |   51 -
 .../patches/35438-pythran_0.12.1.patch        |   41 -
 srcpkgs/sagemath/patches/get_patches          |   43 +-
 srcpkgs/sagemath/template                     |    6 +-
 19 files changed, 111 insertions(+), 2457 deletions(-)
 delete mode 100644 srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
 delete mode 100644 srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
 delete mode 100644 srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
 delete mode 100644 srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
 delete mode 100644 srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
 delete mode 100644 srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
 delete mode 100644 srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
 delete mode 100644 srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
 delete mode 100644 srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
 delete mode 100644 srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
 delete mode 100644 srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
 delete mode 100644 srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
 delete mode 100644 srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
 delete mode 100644 srcpkgs/sagemath/patches/35423-ipython_8.12.patch
 delete mode 100644 srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch

diff --git a/srcpkgs/sagemath/files/sage_conf.py b/srcpkgs/sagemath/files/sage_conf.py
index 00de40f1ee4f..bc5388de8956 100644
--- a/srcpkgs/sagemath/files/sage_conf.py
+++ b/srcpkgs/sagemath/files/sage_conf.py
@@ -1,4 +1,3 @@
 # configuration for sage on void linux
 SAGE_SHARE = "/usr/share/sagemath"
 GAP_SHARE_DIR = "/usr/share/gap"
-GAP_LIB_DIR = "/usr/lib/gap"
diff --git a/srcpkgs/sagemath/files/timings2.json b/srcpkgs/sagemath/files/timings2.json
index bb3098680502..b2b3fe818a20 100644
--- a/srcpkgs/sagemath/files/timings2.json
+++ b/srcpkgs/sagemath/files/timings2.json
@@ -1,281 +1,152 @@
 {
-  "doc.ca.intro.index": {"walltime": 8},
-  "doc.en.constructions.calculus": {"walltime": 64},
-  "doc.en.constructions.plotting": {"walltime": 32},
-  "doc.en.prep.Advanced-2DPlotting": {"walltime": 16},
-  "doc.en.prep.Calculus": {"walltime": 8},
-  "doc.en.prep.Symbolics-and-Basic-Plotting": {"walltime": 8},
-  "doc.en.thematic_tutorials.explicit_methods_in_number_theory.birds_other": {"walltime": 8},
-  "doc.en.thematic_tutorials.explicit_methods_in_number_theory.elliptic_curves": {"walltime": 8},
-  "doc.en.thematic_tutorials.geometry.polyhedra_tutorial": {"walltime": 16},
-  "doc.en.thematic_tutorials.sandpile": {"walltime": 16},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_advanced": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_cartesian": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_change": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_curvilinear": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_plane": {"walltime": 16},
-  "doc.ja.tutorial.tour_plotting": {"walltime": 8},
-  "sage.algebras.cluster_algebra": {"walltime": 8},
   "sage.algebras.commutative_dga": {"walltime": 16},
-  "sage.algebras.hecke_algebras.ariki_koike_algebra": {"walltime": 8},
-  "sage.algebras.iwahori_hecke_algebra": {"walltime": 8},
-  "sage.algebras.lie_algebras.classical_lie_algebra": {"walltime": 128},
-  "sage.algebras.lie_algebras.nilpotent_lie_algebra": {"walltime": 16},
-  "sage.algebras.quantum_clifford": {"walltime": 16},
-  "sage.algebras.quantum_groups.fock_space": {"walltime": 8},
-  "sage.algebras.quatalg.quaternion_algebra": {"walltime": 8},
-  "sage.algebras.steenrod.steenrod_algebra": {"walltime": 64},
-  "sage.algebras.steenrod.steenrod_algebra_bases": {"walltime": 8},
-  "sage.algebras.yangian": {"walltime": 8},
-  "sage.arith.misc": {"walltime": 32},
+  "sage.algebras.fusion_rings.f_matrix": {"walltime": 16},
+  "sage.algebras.fusion_rings.fusion_ring": {"walltime": 16},
+  "sage.algebras.hecke_algebras.cubic_hecke_algebra": {"walltime": 8},
+  "sage.algebras.lie_conformal_algebras.n2_lie_conformal_algebra": {"walltime": 8},
+  "sage.algebras.quantum_clifford": {"walltime": 8},
+  "sage.algebras.steenrod.steenrod_algebra": {"walltime": 8},
   "sage.calculus.calculus": {"walltime": 16},
   "sage.calculus.desolvers": {"walltime": 8},
-  "sage.calculus.functional": {"walltime": 8},
-  "sage.calculus.riemann": {"walltime": 64},
-  "sage.calculus.tests": {"walltime": 16},
-  "sage.calculus.transforms.dwt": {"walltime": 16},
+  "sage.calculus.riemann": {"walltime": 8},
   "sage.calculus.transforms.fft": {"walltime": 8},
   "sage.categories.coxeter_groups": {"walltime": 8},
-  "sage.categories.finite_monoids": {"walltime": 16},
-  "sage.categories.lie_conformal_algebras": {"walltime": 8},
+  "sage.categories.finite_monoids": {"walltime": 8},
   "sage.categories.loop_crystals": {"walltime": 8},
-  "sage.categories.pushout": {"walltime": 8},
-  "sage.categories.super_hopf_algebras_with_basis": {"walltime": 32},
-  "sage.categories.super_lie_conformal_algebras": {"walltime": 8},
-  "sage.coding.ag_code": {"walltime": 64},
-  "sage.coding.ag_code_decoders": {"walltime": 128},
-  "sage.coding.binary_code": {"walltime": 8},
-  "sage.coding.linear_code": {"walltime": 16},
-  "sage.combinat.backtrack": {"walltime": 32},
-  "sage.combinat.chas.wqsym": {"walltime": 32},
-  "sage.combinat.cluster_algebra_quiver.cluster_seed": {"walltime": 64},
-  "sage.combinat.cluster_algebra_quiver.quiver": {"walltime": 128},
-  "sage.combinat.crystals.affine_factorization": {"walltime": 16},
-  "sage.combinat.crystals.alcove_path": {"walltime": 32},
-  "sage.combinat.crystals.highest_weight_crystals": {"walltime": 8},
-  "sage.combinat.crystals.kirillov_reshetikhin": {"walltime": 16},
-  "sage.combinat.crystals.letters": {"walltime": 8},
-  "sage.combinat.crystals.littelmann_path": {"walltime": 16},
-  "sage.combinat.crystals.mv_polytopes": {"walltime": 16},
-  "sage.combinat.crystals.pbw_crystal": {"walltime": 16},
-  "sage.combinat.crystals.star_crystal": {"walltime": 8},
-  "sage.combinat.designs.bibd": {"walltime": 8},
-  "sage.combinat.designs.database": {"walltime": 16},
+  "sage.coding.ag_code": {"walltime": 32},
+  "sage.coding.ag_code_decoders": {"walltime": 32},
+  "sage.coding.linear_code": {"walltime": 32},
+  "sage.combinat.designs.database": {"walltime": 8},
   "sage.combinat.designs.difference_family": {"walltime": 8},
-  "sage.combinat.designs.gen_quadrangles_with_spread": {"walltime": 128},
-  "sage.combinat.designs.orthogonal_arrays_build_recursive": {"walltime": 16},
-  "sage.combinat.designs.orthogonal_arrays_find_recursive": {"walltime": 8},
-  "sage.combinat.diagram_algebras": {"walltime": 64},
-  "sage.combinat.fqsym": {"walltime": 32},
-  "sage.combinat.free_prelie_algebra": {"walltime": 8},
-  "sage.combinat.fully_commutative_elements": {"walltime": 8},
-  "sage.combinat.grossman_larson_algebras": {"walltime": 8},
-  "sage.combinat.interval_posets": {"walltime": 8},
+  "sage.combinat.designs.orthogonal_arrays_build_recursive": {"walltime": 8},
   "sage.combinat.k_regular_sequence": {"walltime": 8},
   "sage.combinat.k_tableau": {"walltime": 16},
   "sage.combinat.matrices.hadamard_matrix": {"walltime": 8},
   "sage.combinat.multiset_partition_into_sets_ordered": {"walltime": 8},
-  "sage.combinat.ncsf_qsym.ncsf": {"walltime": 16},
-  "sage.combinat.ncsf_qsym.qsym": {"walltime": 16},
-  "sage.combinat.partition": {"walltime": 16},
-  "sage.combinat.partition_kleshchev": {"walltime": 16},
+  "sage.combinat.ncsf_qsym.ncsf": {"walltime": 8},
+  "sage.combinat.ncsf_qsym.qsym": {"walltime": 8},
+  "sage.combinat.partition": {"walltime": 8},
   "sage.combinat.partition_tuple": {"walltime": 8},
-  "sage.combinat.posets.moebius_algebra": {"walltime": 16},
+  "sage.combinat.permutation": {"walltime": 8},
   "sage.combinat.posets.posets": {"walltime": 8},
-  "sage.combinat.rigged_configurations.kr_tableaux": {"walltime": 32},
-  "sage.combinat.rigged_configurations.rigged_configurations": {"walltime": 16},
-  "sage.combinat.rigged_configurations.tensor_product_kr_tableaux": {"walltime": 16},
+  "sage.combinat.rigged_configurations.kr_tableaux": {"walltime": 8},
   "sage.combinat.root_system.associahedron": {"walltime": 8},
-  "sage.combinat.root_system.branching_rules": {"walltime": 8},
-  "sage.combinat.root_system.fusion_ring": {"walltime": 8},
-  "sage.combinat.root_system.integrable_representations": {"walltime": 16},
-  "sage.combinat.root_system.non_symmetric_macdonald_polynomials": {"walltime": 16},
-  "sage.combinat.root_system.pieri_factors": {"walltime": 8},
-  "sage.combinat.root_system.plot": {"walltime": 32},
-  "sage.combinat.root_system.root_lattice_realization_algebras": {"walltime": 16},
-  "sage.combinat.root_system.root_lattice_realizations": {"walltime": 16},
-  "sage.combinat.root_system.root_system": {"walltime": 8},
-  "sage.combinat.root_system.weyl_group": {"walltime": 8},
-  "sage.combinat.rsk": {"walltime": 32},
-  "sage.combinat.sf.classical": {"walltime": 16},
-  "sage.combinat.sf.jack": {"walltime": 16},
-  "sage.combinat.sf.k_dual": {"walltime": 16},
-  "sage.combinat.sf.llt": {"walltime": 16},
-  "sage.combinat.sf.macdonald": {"walltime": 64},
-  "sage.combinat.sf.new_kschur": {"walltime": 8},
-  "sage.combinat.sf.sfa": {"walltime": 32},
-  "sage.combinat.shifted_primed_tableau": {"walltime": 16},
+  "sage.combinat.root_system.non_symmetric_macdonald_polynomials": {"walltime": 8},
+  "sage.combinat.root_system.plot": {"walltime": 16},
+  "sage.combinat.root_system.root_lattice_realizations": {"walltime": 8},
+  "sage.combinat.rsk": {"walltime": 8},
+  "sage.combinat.sf.k_dual": {"walltime": 8},
+  "sage.combinat.sf.sf": {"walltime": 8},
+  "sage.combinat.sf.sfa": {"walltime": 8},
+  "sage.combinat.shifted_primed_tableau": {"walltime": 8},
   "sage.combinat.skew_tableau": {"walltime": 8},
-  "sage.combinat.symmetric_group_algebra": {"walltime": 16},
-  "sage.combinat.tableau": {"walltime": 32},
-  "sage.combinat.tableau_tuple": {"walltime": 32},
-  "sage.combinat.tiling": {"walltime": 16},
-  "sage.combinat.tutorial": {"walltime": 16},
-  "sage.combinat.words.paths": {"walltime": 64},
-  "sage.crypto.block_cipher.des": {"walltime": 16},
-  "sage.crypto.mq.sr": {"walltime": 64},
-  "sage.crypto.sbox": {"walltime": 16},
+  "sage.combinat.species.generating_series": {"walltime": 8},
+  "sage.combinat.tableau": {"walltime": 8},
+  "sage.combinat.tableau_tuple": {"walltime": 8},
+  "sage.combinat.tiling": {"walltime": 8},
+  "sage.combinat.tutorial": {"walltime": 8},
   "sage.crypto.sboxes": {"walltime": 8},
   "sage.doctest.forker": {"walltime": 16},
-  "sage.doctest.sources": {"walltime": 64},
-  "sage.doctest.test": {"walltime": 128},
-  "sage.dynamics.arithmetic_dynamics.projective_ds": {"walltime": 64},
-  "sage.dynamics.arithmetic_dynamics.wehlerK3": {"walltime": 8},
-  "sage.dynamics.cellular_automata.glca": {"walltime": 8},
+  "sage.dynamics.arithmetic_dynamics.projective_ds": {"walltime": 32},
   "sage.dynamics.cellular_automata.solitons": {"walltime": 8},
-  "sage.dynamics.complex_dynamics.mandel_julia": {"walltime": 16},
   "sage.functions.bessel": {"walltime": 16},
-  "sage.functions.exp_integral": {"walltime": 8},
   "sage.functions.hypergeometric": {"walltime": 8},
+  "sage.functions.orthogonal_polys": {"walltime": 8},
   "sage.functions.other": {"walltime": 16},
   "sage.functions.piecewise": {"walltime": 8},
-  "sage.games.quantumino": {"walltime": 8},
-  "sage.geometry.cone": {"walltime": 32},
-  "sage.geometry.fan": {"walltime": 8},
   "sage.geometry.hyperbolic_space.hyperbolic_geodesic": {"walltime": 8},
-  "sage.geometry.hyperplane_arrangement.arrangement": {"walltime": 16},
-  "sage.geometry.hyperplane_arrangement.library": {"walltime": 8},
+  "sage.geometry.hyperplane_arrangement.arrangement": {"walltime": 8},
   "sage.geometry.hyperplane_arrangement.plot": {"walltime": 8},
-  "sage.geometry.lattice_polytope": {"walltime": 16},
-  "sage.geometry.polyhedral_complex": {"walltime": 8},
-  "sage.geometry.polyhedron.base": {"walltime": 32},
-  "sage.geometry.polyhedron.library": {"walltime": 32},
-  "sage.geometry.polyhedron.plot": {"walltime": 8},
+  "sage.geometry.polyhedron.base": {"walltime": 8},
+  "sage.geometry.polyhedron.base5": {"walltime": 8},
+  "sage.geometry.polyhedron.base6": {"walltime": 16},
+  "sage.geometry.polyhedron.library": {"walltime": 16},
   "sage.geometry.riemannian_manifolds.parametrized_surface3d": {"walltime": 16},
-  "sage.geometry.triangulation.base": {"walltime": 32},
-  "sage.geometry.triangulation.point_configuration": {"walltime": 16},
-  "sage.graphs.chrompoly": {"walltime": 8},
-  "sage.graphs.connectivity": {"walltime": 16},
-  "sage.graphs.generators.basic": {"walltime": 16},
-  "sage.graphs.generators.classical_geometries": {"walltime": 32},
-  "sage.graphs.generators.distance_regular": {"walltime": 256},
-  "sage.graphs.generators.families": {"walltime": 32},
-  "sage.graphs.generators.smallgraphs": {"walltime": 16},
-  "sage.graphs.generic_graph": {"walltime": 32},
-  "sage.graphs.genus": {"walltime": 16},
+  "sage.graphs.connectivity": {"walltime": 8},
+  "sage.graphs.generators.classical_geometries": {"walltime": 8},
+  "sage.graphs.generators.distance_regular": {"walltime": 32},
+  "sage.graphs.generators.smallgraphs": {"walltime": 8},
+  "sage.graphs.generic_graph": {"walltime": 16},
   "sage.graphs.graph": {"walltime": 16},
-  "sage.graphs.graph_generators": {"walltime": 8},
   "sage.graphs.graph_list": {"walltime": 8},
   "sage.graphs.graph_plot": {"walltime": 8},
-  "sage.graphs.strongly_regular_db": {"walltime": 16},
-  "sage.groups.cubic_braid": {"walltime": 16},
-  "sage.groups.fqf_orthogonal": {"walltime": 16},
-  "sage.groups.libgap_mixin": {"walltime": 8},
-  "sage.groups.libgap_morphism": {"walltime": 8},
-  "sage.groups.lie_gps.nilpotent_lie_group": {"walltime": 16},
-  "sage.groups.matrix_gps.finitely_generated": {"walltime": 8},
-  "sage.groups.matrix_gps.heisenberg": {"walltime": 32},
-  "sage.groups.matrix_gps.linear": {"walltime": 8},
-  "sage.groups.perm_gps.cubegroup": {"walltime": 16},
-  "sage.groups.perm_gps.partn_ref.refinement_graphs": {"walltime": 8},
+  "sage.graphs.strongly_regular_db": {"walltime": 8},
+  "sage.groups.cactus_group": {"walltime": 8},
+  "sage.groups.cubic_braid": {"walltime": 8},
+  "sage.groups.lie_gps.nilpotent_lie_group": {"walltime": 8},
+  "sage.groups.matrix_gps.finitely_generated_gap": {"walltime": 8},
   "sage.groups.perm_gps.permgroup": {"walltime": 8},
   "sage.groups.perm_gps.permgroup_named": {"walltime": 8},
-  "sage.homology.hochschild_complex": {"walltime": 8},
   "sage.homology.homology_vector_space_with_basis": {"walltime": 8},
-  "sage.interacts.test_jupyter": {"walltime": 16},
-  "sage.interfaces.ecm": {"walltime": 8},
-  "sage.interfaces.expect": {"walltime": 8},
-  "sage.interfaces.gap": {"walltime": 16},
-  "sage.interfaces.maxima": {"walltime": 8},
-  "sage.interfaces.maxima_abstract": {"walltime": 64},
-  "sage.interfaces.psage": {"walltime": 8},
-  "sage.interfaces.sage0": {"walltime": 8},
-  "sage.lfunctions.zero_sums": {"walltime": 8},
-  "sage.libs.eclib.interface": {"walltime": 16},
+  "sage.interfaces.gap": {"walltime": 8},
+  "sage.interfaces.gap_workspace": {"walltime": 8},
+  "sage.interfaces.sage0": {"walltime": 16},
+  "sage.libs.eclib.interface": {"walltime": 32},
   "sage.libs.eclib.mwrank": {"walltime": 16},
-  "sage.libs.gap.test_long": {"walltime": 32},
-  "sage.libs.giac": {"walltime": 32},
   "sage.manifolds.catalog": {"walltime": 8},
-  "sage.manifolds.chart": {"walltime": 32},
+  "sage.manifolds.chart": {"walltime": 16},
   "sage.manifolds.chart_func": {"walltime": 8},
   "sage.manifolds.continuous_map": {"walltime": 8},
-  "sage.manifolds.differentiable.affine_connection": {"walltime": 128},
+  "sage.manifolds.differentiable.affine_connection": {"walltime": 32},
   "sage.manifolds.differentiable.automorphismfield": {"walltime": 32},
-  "sage.manifolds.differentiable.automorphismfield_group": {"walltime": 8},
   "sage.manifolds.differentiable.bundle_connection": {"walltime": 8},
-  "sage.manifolds.differentiable.characteristic_cohomology_class": {"walltime": 64},
+  "sage.manifolds.differentiable.characteristic_cohomology_class": {"walltime": 8},
   "sage.manifolds.differentiable.curve": {"walltime": 16},
-  "sage.manifolds.differentiable.degenerate": {"walltime": 32},
-  "sage.manifolds.differentiable.degenerate_submanifold": {"walltime": 16},
-  "sage.manifolds.differentiable.diff_form": {"walltime": 64},
+  "sage.manifolds.differentiable.degenerate": {"walltime": 16},
+  "sage.manifolds.differentiable.degenerate_submanifold": {"walltime": 8},
+  "sage.manifolds.differentiable.diff_form": {"walltime": 32},
   "sage.manifolds.differentiable.diff_map": {"walltime": 8},
   "sage.manifolds.differentiable.examples.euclidean": {"walltime": 32},
   "sage.manifolds.differentiable.examples.sphere": {"walltime": 32},
   "sage.manifolds.differentiable.integrated_curve": {"walltime": 32},
-  "sage.manifolds.differentiable.levi_civita_connection": {"walltime": 32},
-  "sage.manifolds.differentiable.manifold": {"walltime": 16},
-  "sage.manifolds.differentiable.manifold_homset": {"walltime": 16},
+  "sage.manifolds.differentiable.levi_civita_connection": {"walltime": 16},
+  "sage.manifolds.differentiable.manifold": {"walltime": 8},
+  "sage.manifolds.differentiable.manifold_homset": {"walltime": 8},
   "sage.manifolds.differentiable.metric": {"walltime": 64},
   "sage.manifolds.differentiable.mixed_form": {"walltime": 16},
-  "sage.manifolds.differentiable.mixed_form_algebra": {"walltime": 8},
   "sage.manifolds.differentiable.multivectorfield": {"walltime": 64},
-  "sage.manifolds.differentiable.pseudo_riemannian": {"walltime": 16},
-  "sage.manifolds.differentiable.pseudo_riemannian_submanifold": {"walltime": 128},
-  "sage.manifolds.differentiable.scalarfield": {"walltime": 16},
+  "sage.manifolds.differentiable.pseudo_riemannian": {"walltime": 8},
+  "sage.manifolds.differentiable.pseudo_riemannian_submanifold": {"walltime": 32},
+  "sage.manifolds.differentiable.scalarfield": {"walltime": 8},
   "sage.manifolds.differentiable.scalarfield_algebra": {"walltime": 8},
-  "sage.manifolds.differentiable.tangent_vector": {"walltime": 16},
+  "sage.manifolds.differentiable.tangent_vector": {"walltime": 8},
   "sage.manifolds.differentiable.tensorfield": {"walltime": 128},
   "sage.manifolds.differentiable.tensorfield_paral": {"walltime": 16},
-  "sage.manifolds.differentiable.vector_bundle": {"walltime": 16},
-  "sage.manifolds.differentiable.vectorfield": {"walltime": 64},
-  "sage.manifolds.differentiable.vectorframe": {"walltime": 8},
+  "sage.manifolds.differentiable.vectorfield": {"walltime": 16},
   "sage.manifolds.point": {"walltime": 16},
   "sage.manifolds.scalarfield": {"walltime": 16},
-  "sage.manifolds.scalarfield_algebra": {"walltime": 8},
-  "sage.manifolds.section": {"walltime": 32},
-  "sage.manifolds.trivialization": {"walltime": 8},
-  "sage.manifolds.vector_bundle": {"walltime": 8},
-  "sage.matrix.benchmark": {"walltime": 8},
+  "sage.manifolds.section": {"walltime": 16},
   "sage.matrix.matrix2": {"walltime": 16},
-  "sage.matrix.matrix_integer_dense": {"walltime": 16},
-  "sage.matrix.matrix_integer_dense_hnf": {"walltime": 32},
-  "sage.matrix.matrix_mod2_dense": {"walltime": 8},
   "sage.matrix.matrix_rational_dense": {"walltime": 8},
   "sage.matrix.special": {"walltime": 8},
-  "sage.matroids.catalog": {"walltime": 64},
   "sage.misc.cachefunc": {"walltime": 16},
-  "sage.misc.cython": {"walltime": 8},
   "sage.misc.functional": {"walltime": 8},
   "sage.misc.randstate": {"walltime": 16},
-  "sage.misc.sagedoc": {"walltime": 64},
-  "sage.misc.sageinspect": {"walltime": 32},
-  "sage.modular.abvar.abvar": {"walltime": 16},
+  "sage.misc.sagedoc": {"walltime": 16},
+  "sage.misc.sageinspect": {"walltime": 16},
+  "sage.misc.trace": {"walltime": 8},
+  "sage.modular.abvar.abvar": {"walltime": 8},
   "sage.modular.abvar.homspace": {"walltime": 8},
-  "sage.modular.abvar.lseries": {"walltime": 8},
-  "sage.modular.arithgroup.arithgroup_perm": {"walltime": 8},
-  "sage.modular.arithgroup.tests": {"walltime": 8},
-  "sage.modular.btquotients.pautomorphicform": {"walltime": 32},
-  "sage.modular.hypergeometric_motive": {"walltime": 16},
-  "sage.modular.local_comp.local_comp": {"walltime": 32},
-  "sage.modular.local_comp.type_space": {"walltime": 16},
-  "sage.modular.modform.ambient_R": {"walltime": 16},
-  "sage.modular.modform.constructor": {"walltime": 8},
-  "sage.modular.modform.cuspidal_submodule": {"walltime": 16},
-  "sage.modular.modform.element": {"walltime": 64},
-  "sage.modular.modform.ring": {"walltime": 64},
-  "sage.modular.modform.space": {"walltime": 8},
+  "sage.modular.btquotients.btquotient": {"walltime": 8},
+  "sage.modular.btquotients.pautomorphicform": {"walltime": 16},
+  "sage.modular.hecke.submodule": {"walltime": 8},
+  "sage.modular.hypergeometric_motive": {"walltime": 8},
+  "sage.modular.local_comp.local_comp": {"walltime": 16},
+  "sage.modular.local_comp.type_space": {"walltime": 8},
+  "sage.modular.modform.element": {"walltime": 32},
   "sage.modular.modform_hecketriangle.abstract_space": {"walltime": 16},
   "sage.modular.modform_hecketriangle.graded_ring_element": {"walltime": 16},
   "sage.modular.modform_hecketriangle.hecke_triangle_group_element": {"walltime": 32},
   "sage.modular.modform_hecketriangle.readme": {"walltime": 16},
-  "sage.modular.modform_hecketriangle.space": {"walltime": 8},
   "sage.modular.modsym.ambient": {"walltime": 16},
   "sage.modular.modsym.space": {"walltime": 8},
-  "sage.modular.pollack_stevens.modsym": {"walltime": 64},
-  "sage.modular.pollack_stevens.padic_lseries": {"walltime": 32},
-  "sage.modules.finite_submodule_iter": {"walltime": 16},
-  "sage.modules.free_module": {"walltime": 16},
-  "sage.modules.free_module_element": {"walltime": 8},
-  "sage.modules.free_module_integer": {"walltime": 32},
-  "sage.modules.free_quadratic_module_integer_symmetric": {"walltime": 8},
-  "sage.modules.torsion_quadratic_module": {"walltime": 16},
+  "sage.modular.overconvergent.genus0": {"walltime": 8},
+  "sage.modular.pollack_stevens.modsym": {"walltime": 8},
+  "sage.modules.fp_graded.morphism": {"walltime": 8},
+  "sage.modules.free_module": {"walltime": 8},
   "sage.parallel.map_reduce": {"walltime": 8},
-  "sage.plot.animate": {"walltime": 16},
-  "sage.plot.arrow": {"walltime": 8},
-  "sage.plot.circle": {"walltime": 8},
-  "sage.plot.complex_plot": {"walltime": 8},
+  "sage.plot.complex_plot": {"walltime": 16},
   "sage.plot.contour_plot": {"walltime": 32},
-  "sage.plot.density_plot": {"walltime": 8},
   "sage.plot.graphics": {"walltime": 32},
   "sage.plot.line": {"walltime": 8},
   "sage.plot.matrix_plot": {"walltime": 16},
@@ -283,115 +154,53 @@
   "sage.plot.plot": {"walltime": 64},
   "sage.plot.plot3d.base": {"walltime": 8},
   "sage.plot.plot3d.implicit_plot3d": {"walltime": 16},
-  "sage.plot.plot3d.implicit_surface": {"walltime": 8},
-  "sage.plot.plot3d.parametric_plot3d": {"walltime": 8},
+  "sage.plot.plot3d.parametric_plot3d": {"walltime": 16},
   "sage.plot.plot3d.parametric_surface": {"walltime": 8},
   "sage.plot.plot3d.plot3d": {"walltime": 16},
-  "sage.plot.plot3d.tachyon": {"walltime": 8},
-  "sage.plot.plot3d.transform": {"walltime": 32},
   "sage.plot.point": {"walltime": 8},
   "sage.plot.polygon": {"walltime": 8},
   "sage.plot.streamline_plot": {"walltime": 8},
-  "sage.quadratic_forms.genera.genus": {"walltime": 16},
-  "sage.quadratic_forms.quadratic_form__automorphisms": {"walltime": 8},
-  "sage.quadratic_forms.quadratic_form__local_representation_conditions": {"walltime": 64},
-  "sage.quadratic_forms.quadratic_form__neighbors": {"walltime": 8},
-  "sage.quadratic_forms.quadratic_form__siegel_product": {"walltime": 8},
   "sage.repl.ipython_extension": {"walltime": 8},
-  "sage.rings.asymptotic.asymptotic_expansion_generators": {"walltime": 64},
+  "sage.rings.asymptotic.asymptotic_expansion_generators": {"walltime": 16},
   "sage.rings.asymptotic.asymptotic_ring": {"walltime": 8},
-  "sage.rings.asymptotic.asymptotics_multivariate_generating_functions": {"walltime": 32},
-  "sage.rings.asymptotic.term_monoid": {"walltime": 8},
-  "sage.rings.continued_fraction": {"walltime": 8},
+  "sage.rings.asymptotic.asymptotics_multivariate_generating_functions": {"walltime": 8},
   "sage.rings.finite_rings.finite_field_base": {"walltime": 8},
-  "sage.rings.function_field.function_field": {"walltime": 128},
-  "sage.rings.function_field.function_field_valuation": {"walltime": 64},
+  "sage.rings.function_field.function_field": {"walltime": 8},
   "sage.rings.function_field.ideal": {"walltime": 8},
-  "sage.rings.function_field.place": {"walltime": 8},
-  "sage.rings.integer": {"walltime": 64},
-  "sage.rings.invariants.invariant_theory": {"walltime": 8},
-  "sage.rings.number_field.bdd_height": {"walltime": 8},
-  "sage.rings.number_field.number_field": {"walltime": 64},
-  "sage.rings.number_field.number_field_element": {"walltime": 16},
-  "sage.rings.number_field.splitting_field": {"walltime": 8},
-  "sage.rings.number_field.totallyreal": {"walltime": 16},
-  "sage.rings.number_field.totallyreal_rel": {"walltime": 8},
-  "sage.rings.padics.padic_base_leaves": {"walltime": 64},
-  "sage.rings.padics.padic_extension_leaves": {"walltime": 64},
-  "sage.rings.padics.padic_generic_element": {"walltime": 16},
-  "sage.rings.padics.padic_lattice_element": {"walltime": 32},
-  "sage.rings.padics.relative_extension_leaves": {"walltime": 32},
+  "sage.rings.lazy_series": {"walltime": 8},
+  "sage.rings.lazy_series_ring": {"walltime": 32},
+  "sage.rings.number_field.number_field": {"walltime": 32},
+  "sage.rings.number_field.number_field_element": {"walltime": 8},
+  "sage.rings.padics.padic_base_leaves": {"walltime": 8},
+  "sage.rings.padics.padic_generic_element": {"walltime": 8},
   "sage.rings.polynomial.multi_polynomial_ideal": {"walltime": 8},
-  "sage.rings.polynomial.multi_polynomial_sequence": {"walltime": 8},
-  "sage.rings.polynomial.ore_function_element": {"walltime": 8},
   "sage.rings.polynomial.polynomial_element": {"walltime": 16},
-  "sage.rings.polynomial.polynomial_rational_flint": {"walltime": 8},
   "sage.rings.qqbar": {"walltime": 16},
-  "sage.rings.tests": {"walltime": 16},
-  "sage.rings.valuation.augmented_valuation": {"walltime": 32},
-  "sage.rings.valuation.mapped_valuation": {"walltime": 64},
-  "sage.rings.valuation.valuation": {"walltime": 8},
-  "sage.sandpiles.sandpile": {"walltime": 16},
+  "sage.sandpiles.sandpile": {"walltime": 8},
   "sage.schemes.curves.affine_curve": {"walltime": 16},
   "sage.schemes.curves.closed_point": {"walltime": 8},
   "sage.schemes.curves.projective_curve": {"walltime": 32},
-  "sage.schemes.cyclic_covers.cycliccover_finite_field": {"walltime": 64},
   "sage.schemes.elliptic_curves.BSD": {"walltime": 8},
   "sage.schemes.elliptic_curves.Qcurves": {"walltime": 8},
-  "sage.schemes.elliptic_curves.constructor": {"walltime": 32},
-  "sage.schemes.elliptic_curves.ell_curve_isogeny": {"walltime": 16},
-  "sage.schemes.elliptic_curves.ell_egros": {"walltime": 32},
-  "sage.schemes.elliptic_curves.ell_finite_field": {"walltime": 8},
+  "sage.schemes.elliptic_curves.ell_curve_isogeny": {"walltime": 8},
   "sage.schemes.elliptic_curves.ell_generic": {"walltime": 8},
-  "sage.schemes.elliptic_curves.ell_modular_symbols": {"walltime": 16},
-  "sage.schemes.elliptic_curves.ell_number_field": {"walltime": 128},
+  "sage.schemes.elliptic_curves.ell_modular_symbols": {"walltime": 8},
   "sage.schemes.elliptic_curves.ell_point": {"walltime": 8},
-  "sage.schemes.elliptic_curves.ell_rational_field": {"walltime": 128},
-  "sage.schemes.elliptic_curves.gal_reps_number_field": {"walltime": 32},
-  "sage.schemes.elliptic_curves.gp_simon": {"walltime": 16},
-  "sage.schemes.elliptic_curves.heegner": {"walltime": 32},
-  "sage.schemes.elliptic_curves.height": {"walltime": 64},
-  "sage.schemes.elliptic_curves.isogeny_class": {"walltime": 32},
-  "sage.schemes.elliptic_curves.isogeny_small_degree": {"walltime": 64},
-  "sage.schemes.elliptic_curves.kraus": {"walltime": 16},
+  "sage.schemes.elliptic_curves.ell_rational_field": {"walltime": 32},
+  "sage.schemes.elliptic_curves.height": {"walltime": 8},
+  "sage.schemes.elliptic_curves.isogeny_small_degree": {"walltime": 16},
   "sage.schemes.elliptic_curves.mod_sym_num": {"walltime": 8},
   "sage.schemes.elliptic_curves.padic_lseries": {"walltime": 8},
-  "sage.schemes.elliptic_curves.padics": {"walltime": 16},
-  "sage.schemes.elliptic_curves.saturation": {"walltime": 16},
-  "sage.schemes.elliptic_curves.sha_tate": {"walltime": 32},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_finite_field": {"walltime": 64},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_generic": {"walltime": 8},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_padic_field": {"walltime": 32},
-  "sage.schemes.hyperelliptic_curves.monsky_washnitzer": {"walltime": 8},
-  "sage.schemes.projective.projective_rational_point": {"walltime": 8},
-  "sage.schemes.riemann_surfaces.riemann_surface": {"walltime": 64},
+  "sage.schemes.elliptic_curves.padics": {"walltime": 8},
+  "sage.schemes.elliptic_curves.sha_tate": {"walltime": 16},
+  "sage.schemes.hyperelliptic_curves.hyperelliptic_padic_field": {"walltime": 16},
+  "sage.schemes.riemann_surfaces.riemann_surface": {"walltime": 32},
   "sage.schemes.toric.chow_group": {"walltime": 8},
-  "sage.schemes.toric.sheaf.klyachko": {"walltime": 8},
-  "sage.stats.distributions.discrete_gaussian_integer": {"walltime": 8},
-  "sage.stats.time_series": {"walltime": 8},
-  "sage.structure.coerce_dict": {"walltime": 32},
   "sage.structure.element": {"walltime": 16},
-  "sage.structure.sage_object": {"walltime": 8},
   "sage.symbolic.expression": {"walltime": 32},
-  "sage.symbolic.integration.integral": {"walltime": 32},
-  "sage.symbolic.random_tests": {"walltime": 32},
+  "sage.symbolic.integration.integral": {"walltime": 16},
   "sage.symbolic.relation": {"walltime": 8},
-  "sage.tests.book_schilling_zabrocki_kschur_primer": {"walltime": 32},
-  "sage.tests.book_stein_ent": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.combinat_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.float_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.graphique_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.graphtheory_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.integration_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.mpoly_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.nonlinear_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.recequadiff_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.graphique_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.numbertheory_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.polynomes_doctest": {"walltime": 16},
-  "sage.tests.cmdline": {"walltime": 64},
-  "sage.tests.gosper-sum": {"walltime": 16},
-  "sage.tests.parigp": {"walltime": 8},
-  "sage.topology.simplicial_complex": {"walltime": 8},
-  "sage.topology.simplicial_complex_examples": {"walltime": 16}
+  "sage.tests.book_schilling_zabrocki_kschur_primer": {"walltime": 16},
+  "sage.tests.book_stein_ent": {"walltime": 8},
+  "sage.topology.simplicial_complex": {"walltime": 16}
 }
diff --git a/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch b/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
deleted file mode 100644
index f2f825e4fb10..000000000000
--- a/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
+++ /dev/null
@@ -1,205 +0,0 @@
-diff --git a/build/pkgs/singular/checksums.ini b/build/pkgs/singular/checksums.ini
-index 2e33a405d36..313463d2fea 100644
---- a/build/pkgs/singular/checksums.ini
-+++ b/build/pkgs/singular/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=singular-VERSION.tar.gz
--sha1=6c2b622d3681e2de3d58d30c654d43d3e32b720c
--md5=abb1e37c794472e7760655358ab66054
--cksum=17455733
-+sha1=28bb3ee97ef48d04dfa96de182fd93eebe08426c
-+md5=fc0a4f5720dadba45a52ee94324ce00c
-+cksum=1573851737
- upstream_url=ftp://jim.mathematik.uni-kl.de/pub/Math/Singular/SOURCES/4-3-1/singular-VERSION.tar.gz
-diff --git a/build/pkgs/singular/package-version.txt b/build/pkgs/singular/package-version.txt
-index 11300c77e7d..66e2bede53a 100644
---- a/build/pkgs/singular/package-version.txt
-+++ b/build/pkgs/singular/package-version.txt
-@@ -1 +1 @@
--4.3.1p1
-+4.3.1p3
-diff --git a/src/sage/libs/singular/decl.pxd b/src/sage/libs/singular/decl.pxd
-index 8e3ac314b67..747a6b1e2fb 100644
---- a/src/sage/libs/singular/decl.pxd
-+++ b/src/sage/libs/singular/decl.pxd
-@@ -574,7 +574,7 @@ cdef extern from "singular/Singular/libsingular.h":
- 
-     # gets a component out of a polynomial vector
- 
--    poly *pTakeOutComp1(poly **, int)
-+    poly *pTakeOutComp(poly **, int)
- 
-     # deep copy p
- 
-diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx
-index d8ea7b07f3c..3a1271cd59f 100644
---- a/src/sage/libs/singular/singular.pyx
-+++ b/src/sage/libs/singular/singular.pyx
-@@ -1726,20 +1726,21 @@ cdef int overflow_check(unsigned long e, ring *_ring) except -1:
- 
-     Whether an overflow occurs or not partially depends
-     on the number of variables in the ring. See trac ticket
--    :trac:`11856`. With Singular 4, it is by default optimized
--    for at least 4 variables on 64-bit and 2 variables on 32-bit,
--    which in both cases makes a maximal default exponent of
--    2^16-1.
-+    :trac:`11856`.
- 
-     EXAMPLES::
- 
-         sage: P.<x,y> = QQ[]
--        sage: y^(2^16-1)
--        y^65535
--        sage: y^2^16
-+        sage: y^(2^30)
-+        Traceback (most recent call last):             # 32-bit
-+        ...                                            # 32-bit
-+        OverflowError: exponent overflow (1073741824)  # 32-bit
-+        y^1073741824  # 64-bit
-+        sage: y^2^32
-         Traceback (most recent call last):
-         ...
--        OverflowError: exponent overflow (65536)
-+        OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+        OverflowError: exponent overflow (4294967296)  # 64-bit
-     """
-     if unlikely(e > _ring.bitmask):
-         raise OverflowError("exponent overflow (%d)"%(e))
-diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py
-index 7dc058a22f0..71494eddbc0 100644
---- a/src/sage/rings/polynomial/multi_polynomial_ideal.py
-+++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py
-@@ -60,7 +60,7 @@
- Note that the result of a computation is not necessarily reduced::
- 
-     sage: (a+b)^17
--    256*a*b^16 + 256*b^17
-+    a*b^16 + b^17
-     sage: S(17) == 0
-     True
- 
-diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-index 4dad016b33f..9bf67dd1425 100644
---- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-+++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-@@ -193,7 +193,7 @@ from sage.libs.singular.decl cimport (
-     p_IsUnit, p_IsOne, p_Series, p_Head, idInit, fast_map_common_subexp, id_Delete,
-     p_IsHomogeneous, p_Homogen, p_Totaldegree,pLDeg1_Totaldegree, singclap_pdivide, singclap_factorize,
-     idLift, IDELEMS, On, Off, SW_USE_CHINREM_GCD, SW_USE_EZGCD,
--    p_LmIsConstant, pTakeOutComp1, singclap_gcd, pp_Mult_qq, p_GetMaxExp,
-+    p_LmIsConstant, pTakeOutComp, singclap_gcd, pp_Mult_qq, p_GetMaxExp,
-     pLength, kNF, p_Neg, p_Minus_mm_Mult_qq, p_Plus_mm_Mult_qq,
-     pDiff, singclap_resultant, p_Normalize,
-     prCopyR, prCopyR_NoSort)
-@@ -1587,7 +1587,8 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_base):
-             9/4
- 
-             sage: P.monomial_quotient(x,y) # Note the wrong result
--            x*y^65535*z^65535
-+            x*y^65535*z^65535      # 32-bit
-+            x*y^1048575*z^1048575  # 64-bit
- 
-             sage: P.monomial_quotient(x,P(1))
-             x
-@@ -2247,10 +2248,11 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             9/4*x^2 - 1/4*y^2 - y - 1
- 
-             sage: P.<x,y> = PolynomialRing(QQ,order='lex')
--            sage: (x^2^15) * x^2^15
-+            sage: (x^2^32) * x^2^32
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (...)
-+            OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+            OverflowError: exponent overflow (...)  # 64-bit
-         """
-         # all currently implemented rings are commutative
-         cdef poly *_p
-@@ -2371,10 +2373,11 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             ValueError: not a 2nd power
- 
-             sage: P.<x,y> = PolynomialRing(QQ,order='lex')
--            sage: (x+y^2^15)^10
-+            sage: (x+y^2^32)^10
-             Traceback (most recent call last):
-             ....
--            OverflowError: exponent overflow (...)
-+            OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+            OverflowError: exponent overflow (...)  # 64-bit
- 
-         Test fractional powers (:trac:`22329`)::
- 
-@@ -3461,7 +3464,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             x^10000
-             no overflow
- 
--            sage: n = 1000
-+            sage: n = 100000
-             sage: try:
-             ....:     f = x^n
-             ....:     f.subs(x = x^n)
-@@ -4567,7 +4570,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
-         l = []
-         for i from 0 <= i < IDELEMS(res):
-             for j from 1 <= j <= IDELEMS(_I):
--                l.append( new_MP(parent, pTakeOutComp1(&res.m[i], j)) )
-+                l.append( new_MP(parent, pTakeOutComp(&res.m[i], 1)) )
- 
-         id_Delete(&fI, r)
-         id_Delete(&_I, r)
-@@ -4635,7 +4638,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
- 
-             sage: f = 3*x
-             sage: f.reduce([2*x,y])
--            3*x
-+            x
- 
-         The reduction is not canonical when ``I`` is not a Groebner
-         basis::
-diff --git a/src/sage/rings/polynomial/plural.pyx b/src/sage/rings/polynomial/plural.pyx
-index 1c9f35e56ba..587511c3888 100644
---- a/src/sage/rings/polynomial/plural.pyx
-+++ b/src/sage/rings/polynomial/plural.pyx
-@@ -1619,10 +1619,10 @@ cdef class NCPolynomial_plural(RingElement):
-             sage: P = A.g_algebra(relations={y*x:-x*y + z},  order='lex')
-             sage: P.inject_variables()
-             Defining x, z, y
--            sage: (x^2^15) * x^2^15
-+            sage: (x^2^31) * x^2^31
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (65536)
-+            OverflowError: exponent overflow (2147483648)
-         """
-         # all currently implemented rings are commutative
-         cdef poly *_p
-@@ -1689,10 +1689,10 @@ cdef class NCPolynomial_plural(RingElement):
-             sage: P = A.g_algebra(relations={y*x:-x*y + z},  order='lex')
-             sage: P.inject_variables()
-             Defining x, z, y
--            sage: (x+y^2^15)^10
-+            sage: (x+y^2^31)^10
-             Traceback (most recent call last):
-             ....
--            OverflowError: exponent overflow (327680)
-+            OverflowError: exponent overflow (2147483648)
-         """
-         if type(exp) is not Integer:
-             try:
-diff --git a/src/sage/structure/element.pyx b/src/sage/structure/element.pyx
-index b5d83ef71b6..5c45b3fb528 100644
---- a/src/sage/structure/element.pyx
-+++ b/src/sage/structure/element.pyx
-@@ -2705,10 +2705,10 @@ cdef class RingElement(ModuleElement):
-         with Singular 4::
- 
-             sage: K.<x,y> = ZZ[]
--            sage: (x^12345)^54321
-+            sage: (x^123456)^654321
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (670592745)
-+            OverflowError: exponent overflow (...)
-         """
-         return arith_generic_power(self, n)
- 
diff --git a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch b/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
deleted file mode 100644
index ee0f0e656b28..000000000000
--- a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py
-index d5f7157217f..8ca1f958039 100644
---- a/src/sage/rings/number_field/number_field_ideal.py
-+++ b/src/sage/rings/number_field/number_field_ideal.py
-@@ -996,16 +996,38 @@ def is_prime(self):
-             False
-             sage: K.ideal(17).is_prime()  # ramified
-             False
-+
-+        TESTS:
-+
-+        Check that we do not factor the norm of the ideal, this used
-+        to take half an hour, see :trac:`33360`::
-+
-+            sage: K.<a,b,c> = NumberField([x^2-2,x^2-3,x^2-5])
-+            sage: t = (((-2611940*c + 1925290/7653)*b - 1537130/7653*c
-+            ....:       + 10130950)*a + (1343014/7653*c - 8349770)*b
-+            ....:       + 6477058*c - 2801449990/4002519)
-+            sage: t.is_prime()
-+            False
-         """
-         try:
-             return self._pari_prime is not None
-         except AttributeError:
--            F = self.factor()  # factorization with caching
--            if len(F) != 1 or F[0][1] != 1:
--                self._pari_prime = None
--            else:
--                self._pari_prime = F[0][0]._pari_prime
--            return self._pari_prime is not None
-+            pass
-+
-+        K = self.number_field().pari_nf()
-+        I = self.pari_hnf()
-+
-+        candidate = K.idealismaximal(I) or None
-+
-+        # PARI uses probabilistic primality testing inside idealismaximal().
-+        if get_flag(None, 'arithmetic'):
-+            # proof required, check using isprime()
-+            if candidate and not candidate[0].isprime():
-+                candidate = None
-+
-+        self._pari_prime = candidate
-+
-+        return self._pari_prime is not None
- 
-     def pari_prime(self):
-         r"""
diff --git a/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch b/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
deleted file mode 100644
index 91f06fd4d173..000000000000
--- a/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-diff --git a/src/sage/misc/persist.pyx b/src/sage/misc/persist.pyx
-index 3ac5f1cc2b0..cb1f327c199 100644
---- a/src/sage/misc/persist.pyx
-+++ b/src/sage/misc/persist.pyx
-@@ -157,7 +157,7 @@ def load(*filename, compress=True, verbose=True, **kwargs):
-         ....:     _ = f.write(code)
-         sage: load(t)
-         sage: hello
--        <fortran object>
-+        <fortran ...>
-     """
-     import sage.repl.load
-     if len(filename) != 1:
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index 6f0aeab87ae..b77c69b2f77 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -461,6 +461,8 @@ def complex_to_rgb(z_values, contoured=False, tiled=False,
-             rgb[i, j, 2] = b
- 
-     sig_off()
-+    nan_indices = np.isnan(rgb).any(-1)     # Mask for undefined points
-+    rgb[nan_indices] = 1                    # Make nan_indices white
-     return rgb
- 
- 
-diff --git a/src/sage/plot/histogram.py b/src/sage/plot/histogram.py
-index 3bc2b76b58e..388c2d1391d 100644
---- a/src/sage/plot/histogram.py
-+++ b/src/sage/plot/histogram.py
-@@ -87,13 +87,8 @@ def get_minmax_data(self):
- 
-         TESTS::
- 
--            sage: h = histogram([10,3,5], normed=True)[0]
--            doctest:warning...:
--            DeprecationWarning: the 'normed' option is deprecated. Use 'density' instead.
--            See https://trac.sagemath.org/25260 for details.
-+            sage: h = histogram([10,3,5], density=True)[0]
-             sage: h.get_minmax_data()
--            doctest:warning ...
--            ...VisibleDeprecationWarning: Passing `normed=True` on non-uniform bins has always been broken, and computes neither the probability density function nor the probability mass function. The result is only correct if the bins are uniform, when density=True will produce the same result anyway. The argument will be removed in a future version of numpy.
-             {'xmax': 10.0, 'xmin': 3.0, 'ymax': 0.476190476190..., 'ymin': 0}
-         """
-         import numpy
-diff --git a/src/sage/repl/ipython_extension.py b/src/sage/repl/ipython_extension.py
-index 798671aab42..cad6a47ca8b 100644
---- a/src/sage/repl/ipython_extension.py
-+++ b/src/sage/repl/ipython_extension.py
-@@ -405,7 +405,7 @@ def fortran(self, line, cell):
-             ....: C END FILE FIB1.F
-             ....: ''')
-             sage: fib
--            <fortran object>
-+            <fortran ...>
-             sage: from numpy import array
-             sage: a = array(range(10), dtype=float)
-             sage: fib(a, 10)
diff --git a/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch b/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
deleted file mode 100644
index 2769e87f6a4b..000000000000
--- a/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-diff --git a/src/sage/interfaces/tachyon.py b/src/sage/interfaces/tachyon.py
-index 23671e50892..ce1d50f71bc 100644
---- a/src/sage/interfaces/tachyon.py
-+++ b/src/sage/interfaces/tachyon.py
-@@ -683,12 +683,14 @@
- #*****************************************************************************
- 
- import os
-+import re
- 
- from sage.cpython.string import bytes_to_str
- from sage.misc.pager import pager
- from sage.misc.superseded import deprecation
- from sage.misc.temporary_file import tmp_filename
- from sage.structure.sage_object import SageObject
-+from sage.misc.cachefunc import cached_method
- 
- 
- class TachyonRT(SageObject):
-@@ -799,6 +801,11 @@ def __call__(self, model, outfile='sage.png', verbose=1, extra_opts=''):
-             Parser failed due to an input file syntax error.
-             Aborting render.
-         """
-+        if self.version() >= '0.99.2':
-+            # this keyword was changed in 0.99.2
-+            model = model.replace(
-+                    "              focallength ",
-+                    "              focaldist ")
-         modelfile = tmp_filename(ext='.dat')
-         with open(modelfile, 'w') as file:
-             file.write(model)
-@@ -851,6 +858,25 @@ def usage(self, use_pager=True):
-         else:
-             print(r)
- 
-+    @cached_method
-+    def version(self):
-+        """
-+        Returns the version of the Tachyon raytracer being used.
-+
-+        TESTS::
-+
-+            sage: tachyon_rt.version()  # random
-+            0.98.9
-+            sage: tachyon_rt.version() >= '0.98.9'
-+            True
-+        """
-+        with os.popen('tachyon') as f:
-+            r = f.readline()
-+        res = re.search(r"Version ([\d.]*)", r)
-+        # debian patches tachyon so it won't report the version
-+        # we hardcode '0.99' since that's indeed the version they ship
-+        return res[1] if res else '0.99'
-+
-     def help(self, use_pager=True):
-         """
-         Deprecated: type 'sage.interfaces.tachyon?' for help
diff --git a/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch b/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
deleted file mode 100644
index 11eb20d4f735..000000000000
--- a/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff --git a/src/sage/arith/long.pxd b/src/sage/arith/long.pxd
-index 1c9a53387a0..d96b98f247c 100644
---- a/src/sage/arith/long.pxd
-+++ b/src/sage/arith/long.pxd
-@@ -270,6 +270,17 @@ cdef inline bint integer_check_long_py(x, long* value, int* err):
-         sage: L += [-x for x in L] + [0, long_min()]
-         sage: for v in L:
-         ....:     assert check_long_py(int(v)) == v
-+        sage: check_long_py(int(2^60))
-+        1152921504606846976                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^61))
-+        2305843009213693952                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^62))
-+        4611686018427387904                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^63))
-+        'Overflow (...)'
-         sage: check_long_py(int(2^100))
-         'Overflow (...)'
-         sage: check_long_py(int(long_max() + 1))
-@@ -309,7 +320,12 @@ cdef inline bint integer_check_long_py(x, long* value, int* err):
- 
-     cdef long lead
-     cdef long lead_2_overflow = (<long>1) << (BITS_IN_LONG - PyLong_SHIFT)
--    cdef long lead_3_overflow = (<long>1) << (BITS_IN_LONG - 2 * PyLong_SHIFT)
-+    cdef long lead_3_overflow
-+    if BITS_IN_LONG < 2 * PyLong_SHIFT:
-+        # in this case 3 digit is always overflow
-+        lead_3_overflow = 0
-+    else:
-+        lead_3_overflow = (<long>1) << (BITS_IN_LONG - 2 * PyLong_SHIFT)
-     if size == 0:
-         value[0] = 0
-         err[0] = 0
diff --git a/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch b/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
deleted file mode 100644
index c4d7d5c779d1..000000000000
--- a/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/src/sage/schemes/toric/sheaf/klyachko.py b/src/sage/schemes/toric/sheaf/klyachko.py
-index b1304a16913..77fae4b7545 100644
---- a/src/sage/schemes/toric/sheaf/klyachko.py
-+++ b/src/sage/schemes/toric/sheaf/klyachko.py
-@@ -26,7 +26,7 @@
-     (0, 0, 18, 16, 1)
-     sage: Gtilde = G_sum.random_deformation()
-     sage: V = Gtilde.wedge(2) * K                     # long time
--    sage: V.cohomology(dim=True, weight=(0,0,0,0))    # long time
-+    sage: V.cohomology(dim=True, weight=(0,0,0,0))    # long time  # random failure (see #32773)
-     (0, 0, 3, 0, 0)
- 
- REFERENCES:
-@@ -948,7 +948,7 @@ def random_deformation(self, epsilon=None):
-            sage: V.cohomology(dim=True, weight=(0,))
-            (1, 0)
-            sage: Vtilde = V.random_deformation()
--           sage: Vtilde.cohomology(dim=True, weight=(0,))
-+           sage: Vtilde.cohomology(dim=True, weight=(0,))  # random failure (see #32773)
-            (1, 0)
-         """
-         filt = self._filt.random_deformation(epsilon)
diff --git a/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch b/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
deleted file mode 100644
index d9a9835c696b..000000000000
--- a/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 9ac7840134054155545e24fa3e66402d42b91c0f Mon Sep 17 00:00:00 2001
-From: Antonio Rojas <arojas@archlinux.org>
-Date: Fri, 20 Jan 2023 21:36:27 +0100
-Subject: [PATCH] Fix tests with giac 1.9.0.35
-
----
- src/sage/libs/giac/giac.pyx   |  3 +--
- src/sage/symbolic/relation.py | 15 +++++----------
- 2 files changed, 6 insertions(+), 12 deletions(-)
-
-diff --git a/src/sage/libs/giac/giac.pyx b/src/sage/libs/giac/giac.pyx
-index 4e451dba5e7..ccad5169836 100644
---- a/src/sage/libs/giac/giac.pyx
-+++ b/src/sage/libs/giac/giac.pyx
-@@ -374,8 +374,7 @@ def _giac(s):
- 
-         sage: x = libgiac('x')
-         sage: (1+2*sin(3*x)).solve(x).simplify()
--        Warning, argument is not an equation, solving 1+2*sin(3*x)=0
--        list[-pi/18,7*pi/18]
-+        ...list[-pi/18,7*pi/18]
- 
-         sage: libgiac.solve('sin(3*x)>2*sin(x)',x)
-         Traceback (most recent call last):
-diff --git a/src/sage/symbolic/relation.py b/src/sage/symbolic/relation.py
-index e9dbc0fea30..b8896a94be9 100644
---- a/src/sage/symbolic/relation.py
-+++ b/src/sage/symbolic/relation.py
-@@ -935,8 +935,7 @@ def solve(f, *args, **kwds):
- 
-         sage: f = (sin(x) - 8*cos(x)*sin(x))*(sin(x)^2 + cos(x)) - (2*cos(x)*sin(x) - sin(x))*(-2*sin(x)^2 + 2*cos(x)^2 - cos(x))
-         sage: solve(f, x, algorithm='giac')
--        ...
--        [-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-+        ...[-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
- 
-         sage: x, y = SR.var('x,y')
-         sage: solve([x+y-4,x*y-3],[x,y],algorithm='giac')
-@@ -1440,19 +1439,15 @@ def _giac_solver(f, x, solution_dict=False):
-     EXAMPLES::
- 
-         sage: solve([(2/3)^x-2], [x], algorithm='giac')
--        ...
--        [[-log(2)/(log(3) - log(2))]]
-+        ...[[-log(2)/(log(3) - log(2))]]
-         sage: solve([(2/3)^x-2], [x], algorithm='giac', solution_dict=True)
--        ...
--        [{x: -log(2)/(log(3) - log(2))}]
-+        ...[{x: -log(2)/(log(3) - log(2))}]
- 
-         sage: f = (sin(x) - 8*cos(x)*sin(x))*(sin(x)^2 + cos(x)) - (2*cos(x)*sin(x) - sin(x))*(-2*sin(x)^2 + 2*cos(x)^2 - cos(x))
-         sage: solve(f, x, algorithm='giac')
--        ...
--        [-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-+        ...[-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-         sage: solve(f, x, algorithm='giac', solution_dict=True)
--        ...
--        [{x: -2*arctan(sqrt(2))}, {x: 0}, {x: 2*arctan(sqrt(2))}, {x: pi}]
-+        ...[{x: -2*arctan(sqrt(2))}, {x: 0}, {x: 2*arctan(sqrt(2))}, {x: pi}]
- 
-         sage: x, y = SR.var('x,y')
-         sage: solve([x+y-7,x*y-10],[x,y],algorithm='giac')
diff --git a/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch b/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
deleted file mode 100644
index 499e0c71e256..000000000000
--- a/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
+++ /dev/null
@@ -1,1303 +0,0 @@
-diff --git a/build/pkgs/gap/checksums.ini b/build/pkgs/gap/checksums.ini
-index 066e943308a..b0ea8ba8818 100644
---- a/build/pkgs/gap/checksums.ini
-+++ b/build/pkgs/gap/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=gap-VERSION.tar.gz
--sha1=4ecdd281b8f430282fb9b12690b06e0a26abde10
--md5=85dc9e459d5b6c66fcad9f468afd3e3e
--cksum=1351843158
-+sha1=a6e36f3f874a2c46f51561402634497eab705cca
-+md5=c5cd9f272f2703d7a3649ad7193b2d90
-+cksum=2760477284
- upstream_url=https://github.com/gap-system/gap/releases/download/vVERSION/gap-VERSION.tar.gz
-diff --git a/build/pkgs/gap/package-version.txt b/build/pkgs/gap/package-version.txt
-index d782fca8f64..f1cd7de1de5 100644
---- a/build/pkgs/gap/package-version.txt
-+++ b/build/pkgs/gap/package-version.txt
-@@ -1 +1 @@
--4.11.1
-+4.12.2
-diff --git a/build/pkgs/gap/spkg-check.in b/build/pkgs/gap/spkg-check.in
-index d9791d33293..d2fccda6e04 100644
---- a/build/pkgs/gap/spkg-check.in
-+++ b/build/pkgs/gap/spkg-check.in
-@@ -3,6 +3,13 @@ cd src
- # #28728: Fix test failure in tst/testinstall/strings.tst
- export LC_CTYPE=en_US.UTF-8
- 
-+# #34391: in GAP 4.12 some packages need GAP package io
-+#         to let tests run, otherwise this hangs. Thus we install io here.
-+cd pkg/io
-+./configure --with-gaproot=../..
-+make
-+cd ../..
-+
- make testinstall
- if [[ $? -ne 0 ]]; then
-     exit 1
-diff --git a/build/pkgs/gap/spkg-install.in b/build/pkgs/gap/spkg-install.in
-index 2ceadf99db4..e2c8b4dca54 100644
---- a/build/pkgs/gap/spkg-install.in
-+++ b/build/pkgs/gap/spkg-install.in
-@@ -8,8 +8,7 @@ export CFLAGS=$CFLAGS_NON_NATIVE
- export CXXFLAGS=$CXXFLAGS_NON_NATIVE
- 
- GAP_BUILD_ROOT="$(pwd)"
--GAP_ROOT="$SAGE_LOCAL/share/gap"
--DESTDIR_GAP_ROOT="$SAGE_DESTDIR$GAP_ROOT"
-+GAP_ROOT="$SAGE_LOCAL/lib/gap"
- 
- # Enable debug info if requested.
- # Note that -g3 allows you to use preprocessor macros in gdb which are widely used
-@@ -17,37 +16,17 @@ if [ "$SAGE_DEBUG" = yes ] ; then
-     export CFLAGS="-O0 -g3 -DDEBUG_MASTERPOINTERS -DDEBUG_GLOBAL_BAGS -DDEBUG_FUNCTIONS_BAGS $CFLAGS"
- fi
- 
--sdh_configure $SAGE_CONFIGURE_GMP
--sdh_make -j1
-+# LDFLAGS hack below needed by Semigroups package
-+sdh_configure $SAGE_CONFIGURE_GMP LDFLAGS="-pthread" --prefix=$SAGE_LOCAL
-+sdh_make
- 
--# GAP's "make install" is work in progress; we use bits and pieces of it
--# but we install many things manually.
--sdh_make install-headers install-libgap
--
--# Install config.h, which is not currently handled by `make install-headers`
--sdh_install gen/config.h "$SAGE_LOCAL/include/gap"
--
--# Now install the gap executable as "gap-bin"; it will be called normally
--# through our wrapper script that sets the appropriate GAP_ROOT
--SAGE_BIN="$SAGE_LOCAL/bin"
--mkdir -p "$SAGE_DESTDIR$SAGE_BIN" || sdh_die "Failed to create the directory $SAGE_BIN"
--
--./libtool --mode=install install gap "$SAGE_DESTDIR$SAGE_BIN/gap-bin" || \
--    sdh_die "Failed to install gap-bin to $SAGE_BIN"
--
--./libtool --mode=install install gac "$SAGE_DESTDIR$SAGE_BIN/gac" || \
--    sdh_die "Failed to install gac to $SAGE_BIN"
--
--# Now copy additional files GAP needs to run (and a few optional bits) into
--# GAP_ROOT; we don't need everything from the source tree
--sdh_install bin doc gen grp lib src tst sysinfo.gap "$GAP_ROOT"
--
--# GAP's copy of libtool is also used by the toolchain for build GAP packages
--# (i.e. by gac)
--sdh_install libtool "$GAP_ROOT"
-+sdh_make_install
-+# sdh_make install-headers install-libgap
-+# The 'packagemanager' package expects this https://github.com/gap-packages/PackageManager/issues/105
-+mkdir -p "$SAGE_LOCAL/lib/gap/bin"
- 
- # Install only the minimal packages GAP needs to run
--sdh_install pkg/GAPDoc-* pkg/primgrp-* pkg/SmallGrp-* pkg/transgrp "$GAP_ROOT"/pkg
-+sdh_install pkg/gapdoc pkg/primgrp pkg/smallgrp pkg/transgrp "$GAP_ROOT"/pkg
- 
- # Install additional packages that are not strictly required, but that are
- # typically "expected" to be loaded: These are the default packages that are
-@@ -58,50 +37,25 @@ sdh_install pkg/GAPDoc-* pkg/primgrp-* pkg/SmallGrp-* pkg/transgrp "$GAP_ROOT"/p
- # Also include atlasrep which is a dependency of tomlib
- sdh_install \
-     pkg/atlasrep \
--    pkg/autpgrp-* \
--    pkg/alnuth-* \
--    pkg/crisp-* \
--    pkg/ctbllib-* \
--    pkg/FactInt-* \
-+    pkg/autodoc \
-+    pkg/autpgrp \
-+    pkg/alnuth \
-+    pkg/crisp \
-+    pkg/ctbllib \
-+    pkg/factint \
-     pkg/fga \
--    pkg/irredsol-* \
--    pkg/laguna-* \
--    pkg/PackageManager-* \
--    pkg/polenta-* \
--    pkg/polycyclic-* \
--    pkg/resclasses-* \
--    pkg/sophus-* \
--    pkg/tomlib-* \
-+    pkg/irredsol \
-+    pkg/laguna \
-+    pkg/packagemanager \
-+    pkg/polenta \
-+    pkg/polycyclic \
-+    pkg/radiroot \
-+    pkg/resclasses \
-+    pkg/sophus \
-+    pkg/tomlib \
-+    pkg/utils \
-     "$GAP_ROOT"/pkg
- 
--# Install the GAP startup script; ensure it is executable
--sdh_install -T ../gap "$SAGE_BIN/gap"
--chmod +x "$SAGE_DESTDIR$SAGE_BIN/gap"
--
--# Create symlinks under $GAP_ROOT for these executables, as they are expected
--# (especially when building kernel packages) to exist
--ln -sf "../../bin/gap-bin" "$DESTDIR_GAP_ROOT/gap"
--ln -sf "../../bin/gac" "$DESTDIR_GAP_ROOT/gac"
--
--# Fix the $GAP_ROOT/bin/<arch>/src symlink to be relative (otherwise it links
--# to the actual path of the sources GAP was compiled from)
--for srclink in "$DESTDIR_GAP_ROOT"/bin/*/src; do
--    rm -f "$srclink"
--    ln -s "../../src" "$srclink"
--done
--
--# Additional fixups for some files after they have been copied into their
--# destination directory.  gac and sysinfo.gap are generated files that contain
--# in them hard-coded references to the GAP build directory, which will soon
--# be going away.  This breaks the build toolchain for some compiled GAP
--# packages.  We need to replace these paths with the final GAP_ROOT path.  The
--# below will work so long as neither of these paths contain '|', and if they do
--# then god help you.  https://trac.sagemath.org/ticket/27218
--sed -i -e "s|$GAP_BUILD_ROOT|$GAP_ROOT|g" \
--    "$SAGE_DESTDIR$SAGE_BIN/gac" "$DESTDIR_GAP_ROOT/sysinfo.gap" \
--    "$DESTDIR_GAP_ROOT/bin/gap.sh" "$DESTDIR_GAP_ROOT/doc/make_doc" || \
--    sdh_die "Failed to fix up hard-coded paths in GAP build tools."
--
- # TODO: This seems unnecessary--we are already installing all of doc/ to
- # GAP_ROOT, which is necessary for some functionality in GAP to work.  Do
- # we need this?  Maybe doc/gap could just be a symlink to gap/doc??
-diff --git a/build/pkgs/gap/spkg-legacy-uninstall b/build/pkgs/gap/spkg-legacy-uninstall
-index d17eb939eb7..a8e5c59e1fb 100755
---- a/build/pkgs/gap/spkg-legacy-uninstall
-+++ b/build/pkgs/gap/spkg-legacy-uninstall
-@@ -4,6 +4,8 @@ rm -rf "$SAGE_LOCAL/gap/gap-4."*
- rm -rf "$SAGE_SHARE/gap"
- rm -f "$SAGE_LOCAL/gap/latest"
- rm -f "$SAGE_LOCAL/bin/gap"
-+rm -f "$SAGE_LOCAL/bin/gac"
- 
--# Remove old libgap headers
-+# Remove old libgap headers and library
- rm -rf "$SAGE_LOCAL/include/gap"
-+rm -rf "$SAGE_LOCAL/lib/gap"
-diff --git a/build/pkgs/gap/spkg-prerm.in b/build/pkgs/gap/spkg-prerm.in
-deleted file mode 100644
-index 661d92621fa..00000000000
---- a/build/pkgs/gap/spkg-prerm.in
-+++ /dev/null
-@@ -1,6 +0,0 @@
--# These generated files are placed in directory provided by the SPKG, so
--# delete the generated files first so that their parent directories can be
--# removed during installation
--GAP_ROOT="$SAGE_LOCAL/share/gap"
--rm -f "$GAP_ROOT/pkg/atlasrep/datagens/"*.*
--rm -f "$GAP_ROOT/pkg/atlasrep/dataword/"*.*
-diff --git a/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch b/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch
-deleted file mode 100644
-index e45fe7d9c6f..00000000000
---- a/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch
-+++ /dev/null
-@@ -1,150 +0,0 @@
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c b/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--index 3bbdc45..7df699f 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--@@ -8,9 +8,8 @@ extern short sp[],**mat[],*psp[],**imcos[],**cpco[],lorb[],
-- short *cst,**cpst,***cdpst,**svptr,*cp,*rel;
-- short *spst,**pspst,**pptr,**cpptr,npt,nb,nph,nph2,npg,npg2,
--       rno,orno,coh_index,*invg;
---FILE  *ip,*op;
-- 
---void seeknln (void) { while (getc(ip)!='\n'); }
--+void seeknln (FILE *ip) { while (getc(ip)!='\n'); }
-- 
-- /* This program differs from most other permutation programs in that perms are
--    all stored in the single array sp. Schreier vectors are stored in the short
--@@ -23,13 +22,14 @@ void seeknln (void) { while (getc(ip)!='\n'); }
-- int 
-- crprog1 (void)
-- { short *pc,*qc,ex,neg; int x;
--+  FILE  *ip,*op;
--   short i,j,k,l,m,n,cl,rl,*p,ocl,im,pt,pt1,pn,ipt;
--   if ((ip=fopen(inf2,"r"))== 0)
--   { fprintf(stderr,"Cannot open %s.\n",inf2); return(-1);}
--   fscanf(ip,"%hd%hd%hd%hd",&npt,&nph,&nb,&k);
--   if (nb>=mb) {fprintf(stderr,"nb too big. Increase MB.\n"); return(-1);}
--   if (k<=2) {fprintf(stderr,"inf2 has illegal format.\n"); return(-1); }
---  seeknln(); seeknln();
--+  seeknln(ip); seeknln(ip);
--   for (i=1;i<=nb;i++) fscanf(ip,"%hd",lorb+i);
--   pptr=psp-1; pspst=psp+nph; svptr=cpsp-1;  cpst=cpsp+nb;
--   invg=sp; nph2=2*nph; spst=sp+nph2;
--@@ -37,7 +37,7 @@ crprog1 (void)
--   { pptr[i]=spst+(i-1)*npt-1; p=pptr[i];
--     for (j=1;j<=npt;j++) {fscanf(ip,"%hd",&k); p[k]=j; }
--     invg[2*i-2]=2*i-1; invg[2*i-1]=2*i-2;
---    seeknln();
--+    seeknln(ip);
--   }
--   spst+=(npt*nph);
--   for (i=1;i<=nb;i++)
--@@ -75,7 +75,7 @@ crprog1 (void)
--   strcpy(inf1,inf0); strcat(inf1,".rel");
--   if ((ip=fopen(inf1,"r"))==0)
--   { fprintf(stderr,"Cannot open %s.\n",inf1); return(-1);}
---  fscanf(ip,"%hd%hd",&k,&rno); seeknln();
--+  fscanf(ip,"%hd%hd",&k,&rno); seeknln(ip);
--   op=fopen(outft,"w");
-- /* Now we have read everything in, and the computation can start */
--   orno=0;
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--index a7396b2..658496f 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--@@ -20,8 +20,6 @@ short  mexp=MEXP,mcl=MCL,no,rel[RSP],wt[MEXP],exp,*rpf,*rpb,
-- extern short  prime,dim,*spv,**spm,mspace[],*vec[],**mat[],cp[],pinv[],opmats,
--         mm,mv;
-- extern int msp;
---FILE *ip,*op;
---
-- 
-- int 
-- calcmats (void)
--@@ -59,7 +57,7 @@ calcmats (void)
--   }
--   for (i=1;i<=exp;i++) trans(mat[i+exp],mat[i]);
--   if (opmats)
---  { op=fopen(outf,"w");
--+  { FILE *op=fopen(outf,"w");
--     fprintf(op,"%4d%4d%4d\n",prime,dim,exp);
--     for (i=1;i<=exp;i++) printmat(mat[i]); 
--     fclose(op);
--@@ -71,6 +69,7 @@ int
-- rdmats (void)
-- /* reads matrices of generators of P */
-- { short i; int quot;
--+  FILE *ip;
--   ip=fopen(inf4,"r");
--   if (ip==0)
--   { fprintf(stderr,"Cannot open %s\n ",inf4); return(-1); }
--@@ -90,12 +89,12 @@ rdmats (void)
--   fclose(ip);
--   return(0);
-- }
---FILE *ip;
-- 
-- int 
-- ingp (int inp)
-- /* Read in output of respcrun -s */
-- { short i,j,k,l,m,*orpf,**pcp;
--+  FILE *ip;
--   ip=fopen(inf3,"r");
--   if (ip==0) { fprintf(stderr,"Cannot open %s\n",inf3); return(-1); }
--   fscanf(ip,"%hd%hd%hd%hd%hd%hd",&prime,&exp,&i,&no,&j,&m);
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--index 0896551..6841bc8 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--@@ -9,7 +9,6 @@ extern short  intexp,mexp,mng,wksp,
--        spugen[],*tlintg[];
-- extern int ptrsp,rsp;
-- short  fac;
---FILE *ip,*op;
-- 
-- int 
-- ingp (void)
--@@ -18,6 +17,7 @@ ingp (void)
--    of nqrun, and tails are also read in.
-- */
-- { short i,j,k,l,m,x,y,no,*orpf,*orpb,**pcp;  char tails;
--+  FILE *ip;
--   if ((ip=fopen(inf1,"r"))==0)
--   { fprintf(stderr,"Cannot open %s.\n",inf1); return(-1); }
--   fscanf(ip,"%hd%hd%hd%hd%hd%hd",&prime,&exp,&nng,&no,&class,&m);
--@@ -89,6 +89,7 @@ int
-- outgp (void)
-- /* The PCP is output, together with tails */
-- { short i,k,l,**pcp,*b,*e,*c;
--+  FILE *op;
--   op=fopen(outf,"w");
--   fprintf(op,"%4d%4d%4d%4d%4d%4d\n",prime,exp,nng,exp,class,1);
--   for (i=1;i<=exp;i++) fprintf(op,"%4d",wt[i]); fprintf(op,"\n");
--@@ -379,7 +380,7 @@ restart:
--     nng--; mnng--; enexpnt--;
--     if (nng==0)
--     { if (gap)
---      { op=fopen(outfm,"w"); fprintf(op,"COHOMOLO.Multiplier:=[];\n");
--+      { FILE *op=fopen(outfm,"w"); fprintf(op,"COHOMOLO.Multiplier:=[];\n");
--         fclose(op);
--         printf("All new generators eliminated. Multiplier is trivial.\n");
--       }
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--index 01cf914..0144883 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--@@ -9,7 +9,6 @@ extern short  intexp,mng,mexp,wksp,
--        spugen[],*intg[],*imintg[],*tlintg[];
-- extern int ptrsp,rsp;
-- short  *wf,*wc; char norm;
---FILE *ip,*op;
-- 
-- /* The data structures for this program and for nqrun are similar.
--    d1 and d2 contain definitions of generators. (Def. comes from commutator
--@@ -35,6 +34,7 @@ nqmprog (void)
-- { short i,j,k,l,m,d,*gi,*gj,*ti,*tj,cl,def,*ps,*pf,**dp,*nrpb,*p,*orpf,*orpb,
--         nb,np,k1,*rno,*covrel,**pgen,tdef,sgn;
--   char nt;
--+  FILE *ip,*op;
--   if (ingp() == -1) {fprintf(stderr,"Input error.\n"); return(-1); }
--   eexpnt=expnt+exp; enexpnt=nexpnt+nng;
-- 
-diff --git a/build/pkgs/gap_packages/patches/guava_leon_includes.patch b/build/pkgs/gap_packages/patches/guava_leon_includes.patch
-deleted file mode 100644
-index cdcd19cc3e8..00000000000
---- a/build/pkgs/gap_packages/patches/guava_leon_includes.patch
-+++ /dev/null
-@@ -1,13 +0,0 @@
----- a/pkg/guava-3.15/src/leon/src/generate.c	Sat Feb 29 09:02:10 2020
----- b/pkg/guava-3.15/src/leon/src/generate.c	Thu Sep 24 13:58:36 2020
--***************
--*** 115,120 ****
----- 115,122 ----
--  #include "groupio.h"
--  #include "enum.h"
--  #include "storage.h"
--+ #include "chbase.h"
--+ #include "inform.h"
--  
--  #ifdef ALT_TIME_HEADER
--  #include "cputime.h"
-diff --git a/build/pkgs/gap_packages/spkg-install.in b/build/pkgs/gap_packages/spkg-install.in
-index 168e6b11532..6dff182a48f 100644
---- a/build/pkgs/gap_packages/spkg-install.in
-+++ b/build/pkgs/gap_packages/spkg-install.in
-@@ -1,4 +1,4 @@
--GAP_ROOT="$SAGE_LOCAL/share/gap"
-+GAP_ROOT="$SAGE_LOCAL/lib/gap"
- PKG_DIR="$GAP_ROOT/pkg"
- 
- PKG_SRC_DIR="$(pwd)/src/pkg"
-@@ -11,33 +11,31 @@ cd "$PKG_SRC_DIR"
- #    (GAP 4.8.6 still had it, but this is gone in 4.10)
- 
- sdh_install \
--    aclib-* \
--    AutoDoc-* \
--    corelg-* \
--    crime-* \
-+    aclib \
-+    corelg \
-+    crime \
-     cryst \
-     crystcat \
--    design-* \
-+    design \
-     gbnp \
--    genss-* \
--    hap-* \
--    hapcryst-* \
--    hecke-* \
--    images-* \
--    liealgdb-* \
--    liepring-* \
--    liering-* \
--    loops-* \
--    MapClass-* \
--    polymaking-* \
--    qpa-* \
--    quagroup-* \
--    radiroot-* \
--    repsn-* \
--    sla-* \
--    sonata-* \
--    Toric-* \
--    utils-* \
-+    genss \
-+    hap \
-+    hapcryst \
-+    hecke \
-+    images \
-+    liealgdb \
-+    liepring \
-+    liering \
-+    loops \
-+    mapclass \
-+    polymaking \
-+    qpa \
-+    quagroup \
-+    repsn \
-+    singular \
-+    sla \
-+    sonata \
-+    toric \
-     "$PKG_DIR"
- 
- install_compiled_pkg()
-@@ -45,27 +43,23 @@ install_compiled_pkg()
-     local pkg="$1"
-     # Install the bin/ dir (where compiled modules should end up)
-     # under <prefix>/lib/gap; we then symlink to it later
--    sdh_install bin "$SAGE_LOCAL/lib/gap/pkg/$pkg"
-+    sdh_install * "$SAGE_LOCAL/lib/gap/pkg/$pkg"
- 
-+    # TODO:
-     # Clean up any build artificts before installing the rest of the package
-     # Also remove configure/Makefiles
-     # Note: None, if any of the packages really have a proper install target
--    make clean  # Works for some packages but not all
--    rm -rf bin/
--    rm -rf configure configure.* config.* autogen.sh *.m4 Makefile* m4/
-+    #make clean  # Works for some packages but not all
-+    #rm -rf bin/
-+    #rm -rf configure configure.* config.* autogen.sh *.m4 Makefile* m4/
- 
--    # Create the bin/ symlink
--    ln -s "$SAGE_LOCAL/lib/gap/pkg/$pkg/bin" bin
--
--    # Install the rest of the package files
--    sdh_install * "$PKG_DIR/$pkg"
- }
- 
- # Build and install compiled packages:
- #
- # These packages have an old ./configure that take the GAP_ROOT as a positional
- # argument
--for pkg in cohomolo-* crypting-* grape-* guava-* orb-* datastructures-*
-+for pkg in cohomolo crypting grape guava orb datastructures
- do
-     echo "Building GAP package $pkg"
-     CFLAGS="$CFLAGS -Wno-implicit-function-declaration"
-@@ -91,7 +85,7 @@ pararr=( " " " " "--with-external-planarity" "--with-external-libsemigroups" )
- ##############################################################################
- 
- parind=0
--for pkg in nq-* io-* digraphs-* semigroups-*
-+for pkg in nq io digraphs semigroups
- do
-     echo "Building GAP package $pkg"
-     cd "$PKG_SRC_DIR/$pkg"
-diff --git a/build/pkgs/libsemigroups/checksums.ini b/build/pkgs/libsemigroups/checksums.ini
-index 62c4268515f..4e13a36cb35 100644
---- a/build/pkgs/libsemigroups/checksums.ini
-+++ b/build/pkgs/libsemigroups/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=libsemigroups-VERSION.tar.gz
--sha1=2b16c095cc5ffd3f77a71dfbf48cce188e054c03
--md5=7082cadcf7a195ccb93175cd72b6db95
--cksum=1501022358
-+sha1=86375824b47ce4b0e23570122e873f67136d0c0a
-+md5=ff79ad5fbc8bfeb64d48faaf24106b98
-+cksum=2845045455
- upstream_url=https://github.com/libsemigroups/libsemigroups/releases/download/vVERSION/libsemigroups-VERSION.tar.gz
-diff --git a/build/pkgs/libsemigroups/package-version.txt b/build/pkgs/libsemigroups/package-version.txt
-index 9084fa2f716..f90b1afc082 100644
---- a/build/pkgs/libsemigroups/package-version.txt
-+++ b/build/pkgs/libsemigroups/package-version.txt
-@@ -1 +1 @@
--1.1.0
-+2.3.2
-diff --git a/build/pkgs/libsemigroups/spkg-install.in b/build/pkgs/libsemigroups/spkg-install.in
-index 2aaf0e99043..128b54d2f99 100644
---- a/build/pkgs/libsemigroups/spkg-install.in
-+++ b/build/pkgs/libsemigroups/spkg-install.in
-@@ -1,4 +1,4 @@
- cd src
--sdh_configure
-+sdh_configure --disable-eigen
- sdh_make
- sdh_make_install
-diff --git a/build/pkgs/singular/spkg-configure.m4 b/build/pkgs/singular/spkg-configure.m4
-index d4d145defe3..6a85631f624 100644
---- a/build/pkgs/singular/spkg-configure.m4
-+++ b/build/pkgs/singular/spkg-configure.m4
-@@ -9,52 +9,7 @@ SAGE_SPKG_CONFIGURE([singular], [
-        AC_MSG_CHECKING([that Singular's help is working])
-        AS_IF([test x`printf "system(\"--browser\", \"builtin\"); \n help;" | Singular 2>&1 | grep "error occurred"` = x], [
-         AC_MSG_RESULT(yes)
--        dnl We have Singular. Now determine the shared library path on
--        dnl platforms on which sage.libs.singular needs to reload the library with RTLD_GLOBAL.
--        AS_CASE([$host_os],
--          [cygwin*], [dnl Nothing to do
--                     ],
--                     [dnl Use pkg-config to get singular's libdir while we're at it. As a
--                      dnl moral compromise for using pkg-config, this ultimately allows us
--                      dnl to pass an absolute path to dlopen(), which is the only approach
--                      dnl that POSIX guarantees will work.
--                      PKG_CHECK_VAR([SINGULAR_LIB_DIR], [Singular], [libdir])
--                      dnl The acl_shlibext variable is set in the top-level configure.ac.
--                      AC_LANG_PUSH(C)
--                      ORIG_LIBS="${LIBS}"
--                      LIBS="${LIBS} -ldl"
--                      AC_MSG_CHECKING([if we can dlopen($LIBSINGULAR_PATH)])
--                      LIBSINGULAR_PATH="${SINGULAR_LIB_DIR}/libSingular.${acl_shlibext}"
--
--                      dnl if we can dlopen() it, substitute the name for sage_conf;
--                      dnl otherwise, fall back to using the SPKG.
--                      AC_RUN_IFELSE(
--                        [AC_LANG_PROGRAM(
--                          [[#include <dlfcn.h>]],
--                          [[void* h = dlopen("${LIBSINGULAR_PATH}", RTLD_LAZY | RTLD_GLOBAL);
--                            if (h == 0) { return 1; } else { return dlclose(h); }]]
--                        )], [
--                          AC_MSG_RESULT(yes)
--                        ], [
--                          dnl try Debian-specific name
--                          LIBSINGULAR_PATH="${SINGULAR_LIB_DIR}/libsingular-Singular.${acl_shlibext}"
--                          AC_RUN_IFELSE(
--                           [AC_LANG_PROGRAM(
--                             [[#include <dlfcn.h>]],
--                             [[void* h = dlopen("${LIBSINGULAR_PATH}", RTLD_LAZY | RTLD_GLOBAL);
--                               if (h == 0) { return 1; } else { return dlclose(h); }]]
--                           )], [
--                             AC_MSG_RESULT(yes)
--                           ], [
--                            AC_MSG_RESULT(no)
--                            sage_spkg_install_singular=yes
--                          ], [AC_MSG_RESULT(yes)])
--                        ], [AC_MSG_RESULT(yes)])
--
--                      AC_LANG_POP()
--                      LIBS="${ORIG_LIBS}"
--                     ]
--       )], [
-+       ], [
-        AC_MSG_RESULT(no)
-        sage_spkg_install_singular=yes
-        ]
-@@ -64,20 +19,4 @@ SAGE_SPKG_CONFIGURE([singular], [
-       ])
-     ])
-   ])
--],[],[],[
--  dnl Post-check phase
--  dnl We make the sage_conf substitutions here, because the "default"
--  dnl substitution needs to be made even if we skipped the system-Singular
--  dnl checks themselves.
--  AS_IF([test "x${sage_spkg_install_singular}" = "xyes"], [
--    AS_CASE([$host_os],
--      [cygwin*], [dnl Nothing to do
--                 ],
--                 [dnl Set shared library path, needed for reloading the library with RTLD_GLOBAL
--                  LIBSINGULAR_PATH="\$SAGE_LOCAL/lib/libSingular.${acl_shlibext}"
--                 ]
--    )
--  ])
--
--  AC_SUBST(LIBSINGULAR_PATH, "${LIBSINGULAR_PATH}")
- ])
-diff --git a/pkgs/sage-conf/_sage_conf/_conf.py.in b/pkgs/sage-conf/_sage_conf/_conf.py.in
-index 6cd28f558a8..d66bdb3d264 100644
---- a/pkgs/sage-conf/_sage_conf/_conf.py.in
-+++ b/pkgs/sage-conf/_sage_conf/_conf.py.in
-@@ -55,9 +55,6 @@ THREEJS_DIR = SAGE_LOCAL + "/share/threejs-sage"
- OPENMP_CFLAGS = "@OPENMP_CFLAGS@"
- OPENMP_CXXFLAGS = "@OPENMP_CXXFLAGS@"
- 
--# The full absolute path to the main Singular library.
--LIBSINGULAR_PATH = "@LIBSINGULAR_PATH@".replace('$SAGE_LOCAL', SAGE_LOCAL)
--
- # Installation location of wheels. This is determined at configuration time
- # and does not depend on the installation location of sage-conf.
- SAGE_SPKG_WHEELS = "@SAGE_VENV@".replace('${SAGE_LOCAL}', SAGE_LOCAL) + "/var/lib/sage/wheels"
-diff --git a/src/doc/en/thematic_tutorials/lie/weyl_groups.rst b/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-index c917338e444..182e74aad20 100644
---- a/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-+++ b/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-@@ -139,12 +139,12 @@ string, which you can print::
-     X.1      1  1  1  1  1  1  1  1  1  1  1  1  1
-     X.2      1 -1  1  1 -1  1  1 -1 -1 -1  1  1  1
-     X.3      2  .  2 -1  .  2  2  .  .  . -1  2  2
--    X.4      3 -1 -1  .  1 -1  3 -1  1 -1  . -1  3
--    X.5      3 -1 -1  .  1  3 -1 -1 -1  1  . -1  3
--    X.6      3  1 -1  . -1 -1  3  1 -1  1  . -1  3
--    X.7      3  1 -1  . -1  3 -1  1  1 -1  . -1  3
--    X.8      3 -1  3  . -1 -1 -1 -1  1  1  . -1  3
--    X.9      3  1  3  .  1 -1 -1  1 -1 -1  . -1  3
-+    X.4      3 -1 -1  .  1  3 -1 -1 -1  1  . -1  3
-+    X.5      3  1 -1  . -1  3 -1  1  1 -1  . -1  3
-+    X.6      3 -1  3  . -1 -1 -1 -1  1  1  . -1  3
-+    X.7      3 -1 -1  .  1 -1  3 -1  1 -1  . -1  3
-+    X.8      3  1  3  .  1 -1 -1  1 -1 -1  . -1  3
-+    X.9      3  1 -1  . -1 -1  3  1 -1  1  . -1  3
-     X.10     4 -2  . -1  .  .  .  2  .  .  1  . -4
-     X.11     4  2  . -1  .  .  . -2  .  .  1  . -4
-     X.12     6  . -2  .  . -2 -2  .  .  .  .  2  6
-diff --git a/src/sage/coding/codecan/autgroup_can_label.pyx b/src/sage/coding/codecan/autgroup_can_label.pyx
-index de5db985e0b..c83b9264e44 100644
---- a/src/sage/coding/codecan/autgroup_can_label.pyx
-+++ b/src/sage/coding/codecan/autgroup_can_label.pyx
-@@ -76,7 +76,7 @@ columns do share the same coloring::
-     ((1,),
-      (2,),
-      (3, 5, 4),
--     (6, 19, 16, 9, 21, 10, 8, 15, 14, 11, 20, 13, 12, 7, 17, 18))
-+     (6, 19, 16, 21, 9, 10, 15, 8, 20, 11, 14, 13, 7, 12, 18, 17))
- 
- We can also restrict the group action to linear isometries::
- 
-diff --git a/src/sage/coding/linear_code.py b/src/sage/coding/linear_code.py
-index a3ac3ca1547..bfb9f8696e8 100644
---- a/src/sage/coding/linear_code.py
-+++ b/src/sage/coding/linear_code.py
-@@ -465,27 +465,27 @@ def automorphism_group_gens(self, equivalence="semilinear"):
-             0
-             sage: C = codes.HammingCode(GF(4, 'z'), 3)
-             sage: C.automorphism_group_gens()
--            ([((1, 1, 1, 1, 1, z + 1, z, z + 1, z, z, z, 1, 1, z + 1, z + 1, z, z + 1, z, z + 1, z + 1, z + 1); (1,14,6,7,4,10,11,19)(2,8,16,13,3,17,21,15)(9,12,18,20), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((1, 1, 1, z, z + 1, 1, 1, 1, 1, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z); (1,13,14,20)(2,21,8,18,7,16,19,15)(3,10,5,12,17,9,6,4), Ring endomorphism of Finite Field in z of size 2^2
-+                Defn: z |--> z + 1),
-+              ((z, 1, z, z, z, z + 1, z, z, z, z, z, z, z + 1, z, z, z, z, z + 1, z, z, z); (1,11,5,12,3,19)(2,8)(6,18,13)(7,17,15)(9,10,14,16,20,21), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z + 1),
--              ((z + 1, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z + 1, 1, z, z + 1, z + 1, z); (1,18,6,19,2,9,17,10,13,14,21,11,4,5,12)(3,20,7,16,8), Ring endomorphism of Finite Field in z of size 2^2
--                Defn: z |--> z),
-               ((z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z); (), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-              362880)
-             sage: C.automorphism_group_gens(equivalence="linear")
--            ([((z + 1, 1, z + 1, z + 1, z + 1, z, 1, z, 1, 1, 1, 1, z + 1, z + 1, z + 1, z, z, 1, z, z, z); (1,15,2,8,16,18,3)(4,9,12,13,20,10,11)(5,21,14,6,7,19,17), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((z, 1, z + 1, z + 1, 1, z + 1, z, 1, z + 1, z + 1, 1, z, 1, z + 1, z, 1, z, 1, z + 1, 1, 1); (1,12,11,10,6,8,9,20,13,21,5,14,3,16,17,19,7,4,2,15,18), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((z + 1, z + 1, z + 1, z + 1, z + 1, 1, z, 1, z, z, z, 1, z, 1, 1, 1, z + 1, z + 1, z + 1, 1, z); (1,15,21,8,9)(2,18,5,3,11,16,7,10,19,13,12,4,17,6,20), Ring endomorphism of Finite Field in z of size 2^2
-+              ((z + 1, z + 1, z + 1, z, 1, 1, z, z, 1, z + 1, z, 1, 1, z, 1, z + 1, z, z + 1, z + 1, 1, z); (1,3,18,2,17,6,19)(4,15,13,20,7,14,16)(5,11,8,21,12,9,10), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
-               ((z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1); (), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-              181440)
-             sage: C.automorphism_group_gens(equivalence="permutational")
--            ([((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,19)(3,17)(4,21)(5,20)(7,14)(9,12)(10,16)(11,15), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,11)(3,10)(4,9)(5,7)(12,21)(14,20)(15,19)(16,17), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,11)(3,10)(4,9)(5,7)(12,21)(14,20)(15,19)(16,17), Ring endomorphism of Finite Field in z of size 2^2
-+              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (2,18)(3,19)(4,10)(5,16)(8,13)(9,14)(11,21)(15,20), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,17)(2,8)(3,14)(4,10)(7,12)(9,19)(13,18)(15,20), Ring endomorphism of Finite Field in z of size 2^2
-+              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,19)(3,17)(4,21)(5,20)(7,14)(9,12)(10,16)(11,15), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
-               ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (2,13)(3,14)(4,20)(5,11)(8,18)(9,19)(10,15)(16,21), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-@@ -691,10 +691,10 @@ def _canonize(self, equivalence):
-             sage: C_iso == aut_group_can_label.get_canonical_form()
-             True
-             sage: aut_group_can_label.get_autom_gens()
--            [((1, 1, 1, 1, 1, z + 1, z, z + 1, z, z, z, 1, 1, z + 1, z + 1, z, z + 1, z, z + 1, z + 1, z + 1); (1,14,6,7,4,10,11,19)(2,8,16,13,3,17,21,15)(9,12,18,20), Ring endomorphism of Finite Field in z of size 2^2
-+            [((1, 1, 1, z, z + 1, 1, 1, 1, 1, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z); (1,13,14,20)(2,21,8,18,7,16,19,15)(3,10,5,12,17,9,6,4), Ring endomorphism of Finite Field in z of size 2^2
-+               Defn: z |--> z + 1),
-+             ((z, 1, z, z, z, z + 1, z, z, z, z, z, z, z + 1, z, z, z, z, z + 1, z, z, z); (1,11,5,12,3,19)(2,8)(6,18,13)(7,17,15)(9,10,14,16,20,21), Ring endomorphism of Finite Field in z of size 2^2
-                Defn: z |--> z + 1),
--             ((z + 1, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z + 1, 1, z, z + 1, z + 1, z); (1,18,6,19,2,9,17,10,13,14,21,11,4,5,12)(3,20,7,16,8), Ring endomorphism of Finite Field in z of size 2^2
--               Defn: z |--> z),
-              ((z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z); (), Ring endomorphism of Finite Field in z of size 2^2
-                Defn: z |--> z)]
-         """
-diff --git a/src/sage/combinat/posets/posets.py b/src/sage/combinat/posets/posets.py
-index 2836d59d960..8c882d5ac3b 100644
---- a/src/sage/combinat/posets/posets.py
-+++ b/src/sage/combinat/posets/posets.py
-@@ -8813,7 +8813,7 @@ def _libgap_(self):
-             sage: libgap(P)  # optional - gap_packages
-             <A poset on 5 points>
-             sage: A = libgap(GF(2)).PosetAlgebra(P); A  # optional - gap_packages
--            <GF(2)[<quiver with 5 vertices and 5 arrows>]/<two-sided ideal in <GF(2)[<quiver with 5 vertices and 5 arrows>]>, (1 generators)>>
-+            <GF(2)[<quiver with 5 vertices and 5 arrows>]/<two-sided ideal in <GF(2)[<quiver with 5 vertices and 5 arrows>]>, (1 generator)>>
-             sage: A.Dimension()  # optional - gap_packages
-             13
-         """
-diff --git a/src/sage/combinat/root_system/hecke_algebra_representation.py b/src/sage/combinat/root_system/hecke_algebra_representation.py
-index 6b756bafc30..8ac99319bec 100644
---- a/src/sage/combinat/root_system/hecke_algebra_representation.py
-+++ b/src/sage/combinat/root_system/hecke_algebra_representation.py
-@@ -357,7 +357,7 @@ def Tw(self, word, signs=None, scalar=None):
-             sage: q1, q2 = K.gens()
-             sage: KW = W.algebra(K)
-             sage: x = KW.an_element(); x
--            123 + 3*32 + 2*3 + e
-+            123 + 3*2312 + 2*31 + e
- 
-             sage: T = KW.demazure_lusztig_operators(q1,q2)
-             sage: T12 = T.Tw( (1,2) )
-diff --git a/src/sage/combinat/symmetric_group_algebra.py b/src/sage/combinat/symmetric_group_algebra.py
-index b8a0bebab44..9bccba124c8 100644
---- a/src/sage/combinat/symmetric_group_algebra.py
-+++ b/src/sage/combinat/symmetric_group_algebra.py
-@@ -101,7 +101,7 @@ def SymmetricGroupAlgebra(R, W, category=None):
-         sage: SGA.group()
-         Weyl Group of type ['A', 3] (as a matrix group acting on the ambient space)
-         sage: SGA.an_element()
--        s1*s2*s3 + 3*s3*s2 + 2*s3 + 1
-+        s1*s2*s3 + 3*s2*s3*s1*s2 + 2*s3*s1 + 1
- 
-     The preferred way to construct the symmetric group algebra is to
-     go through the usual ``algebra`` method::
-diff --git a/src/sage/env.py b/src/sage/env.py
-index 911f34b1bc6..5f7aca8599c 100644
---- a/src/sage/env.py
-+++ b/src/sage/env.py
-@@ -197,7 +197,8 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- GRAPHS_DATA_DIR = var("GRAPHS_DATA_DIR", join(SAGE_SHARE, "graphs"))
- ELLCURVE_DATA_DIR = var("ELLCURVE_DATA_DIR", join(SAGE_SHARE, "ellcurves"))
- POLYTOPE_DATA_DIR = var("POLYTOPE_DATA_DIR", join(SAGE_SHARE, "reflexive_polytopes"))
--GAP_ROOT_DIR = var("GAP_ROOT_DIR", join(SAGE_SHARE, "gap"))
-+GAP_LIB_DIR = var("GAP_LIB_DIR", join(SAGE_LOCAL, "lib", "gap"))
-+GAP_SHARE_DIR = var("GAP_SHARE_DIR", join(SAGE_SHARE, "gap"))
- THEBE_DIR = var("THEBE_DIR", join(SAGE_SHARE, "thebe"))
- COMBINATORIAL_DESIGN_DATA_DIR = var("COMBINATORIAL_DESIGN_DATA_DIR", join(SAGE_SHARE, "combinatorial_designs"))
- CREMONA_MINI_DATA_DIR = var("CREMONA_MINI_DATA_DIR", join(SAGE_SHARE, "cremona"))
-@@ -229,12 +230,6 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- LIE_INFO_DIR = var("LIE_INFO_DIR", join(SAGE_LOCAL, "lib", "LiE"))
- SINGULAR_BIN = var("SINGULAR_BIN") or "Singular"
- 
--# The path to libSingular, to be passed to dlopen(). This will
--# typically be set to an absolute path in sage_conf, but the relative
--# fallback path here works on systems where dlopen() searches the
--# system's library locations.
--LIBSINGULAR_PATH = var("LIBSINGULAR_PATH", "libSingular.so")
--
- # OpenMP
- OPENMP_CFLAGS = var("OPENMP_CFLAGS", "")
- OPENMP_CXXFLAGS = var("OPENMP_CXXFLAGS", "")
-@@ -255,81 +250,6 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- SAGE_GAP_COMMAND = var('SAGE_GAP_COMMAND', _gap_cmd)
- 
- 
--def _get_shared_lib_path(*libnames: str) -> Optional[str]:
--    """
--    Return the full path to a shared library file installed in
--    ``$SAGE_LOCAL/lib`` or the directories associated with the
--    Python sysconfig.
--
--    This can also be passed more than one library name (e.g. for cases where
--    some library may have multiple names depending on the platform) in which
--    case the first one found is returned.
--
--    This supports most *NIX variants (in which ``lib<libname>.so`` is found
--    under ``$SAGE_LOCAL/lib``), macOS (same, but with the ``.dylib``
--    extension), and Cygwin (under ``$SAGE_LOCAL/bin/cyg<libname>.dll``,
--    or ``$SAGE_LOCAL/bin/cyg<libname>-*.dll`` for versioned DLLs).
--
--    For distributions like Debian that use a multiarch layout, we also try the
--    multiarch lib paths (i.e. ``/usr/lib/<arch>/``).
--
--    This returns ``None`` if no matching library file could be found.
--
--    EXAMPLES::
--
--        sage: from sage.env import _get_shared_lib_path
--        sage: "gap" in _get_shared_lib_path("gap")
--        True
--        sage: _get_shared_lib_path("an_absurd_lib") is None
--        True
--
--    """
--
--    for libname in libnames:
--        search_directories: List[Path] = []
--        patterns: List[str] = []
--        if sys.platform == 'cygwin':
--            # Later down we take the first matching DLL found, so search
--            # SAGE_LOCAL first so that it takes precedence
--            if SAGE_LOCAL:
--                search_directories.append(Path(SAGE_LOCAL) / 'bin')
--            search_directories.append(Path(sysconfig.get_config_var('BINDIR')))
--            # Note: The following is not very robust, since if there are multible
--            # versions for the same library this just selects one more or less
--            # at arbitrary. However, practically speaking, on Cygwin, there
--            # will only ever be one version
--            patterns = [f'cyg{libname}.dll', f'cyg{libname}-*.dll']
--        else:
--            if sys.platform == 'darwin':
--                ext = 'dylib'
--            else:
--                ext = 'so'
--
--            if SAGE_LOCAL:
--                search_directories.append(Path(SAGE_LOCAL) / 'lib')
--            libdir = sysconfig.get_config_var('LIBDIR')
--            if libdir is not None:
--                libdir = Path(libdir)
--                search_directories.append(libdir)
--
--                multiarchlib = sysconfig.get_config_var('MULTIARCH')
--                if multiarchlib is not None:
--                    search_directories.append(libdir / multiarchlib),
--
--            patterns = [f'lib{libname}.{ext}']
--
--        for directory in search_directories:
--            for pattern in patterns:
--                path = next(directory.glob(pattern), None)
--                if path is not None:
--                    return str(path.resolve())
--
--    # Just return None if no files were found
--    return None
--
--# locate libgap shared object
--GAP_SO = var("GAP_SO", _get_shared_lib_path("gap", ""))
--
- # post process
- if DOT_SAGE is not None and ' ' in DOT_SAGE:
-     if UNAME[:6] == 'CYGWIN':
-diff --git a/src/sage/groups/abelian_gps/abelian_group_gap.py b/src/sage/groups/abelian_gps/abelian_group_gap.py
-index a4b047113c5..86090b43535 100644
---- a/src/sage/groups/abelian_gps/abelian_group_gap.py
-+++ b/src/sage/groups/abelian_gps/abelian_group_gap.py
-@@ -338,7 +338,7 @@ def _element_constructor_(self, x, check=True):
-         if isinstance(x, AbelianGroupElement_gap):
-             try:
-                 if x in self._cover:
--                    x = self.gap().NaturalHomomorphism().Image(x.gap())
-+                    x = self._cover.gap().NaturalHomomorphismByNormalSubgroup(self._relations).Image(x.gap())
-                 else:
-                     x = x.gap()
-             except AttributeError:
-@@ -1043,7 +1043,7 @@ def natural_homomorphism(self):
-             From: Abelian group with gap, generator orders (4,)
-             To:   Quotient abelian group with generator orders (2,)
-         """
--        phi = self.gap().NaturalHomomorphism()
-+        phi = self._cover.gap().NaturalHomomorphismByNormalSubgroup(self._relations)
-         Hom = self._cover.Hom(self)
-         return Hom(phi)
- 
-diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py
-index 8d6e443683c..1beb01af87f 100644
---- a/src/sage/groups/finitely_presented.py
-+++ b/src/sage/groups/finitely_presented.py
-@@ -596,9 +596,9 @@ def gap(self):
-             sage: k = G.rewriting_system()
-             sage: k.gap()
-             Knuth Bendix Rewriting System for Monoid( [ a, A, b, B ] ) with rules
--            [ [ a^2, <identity ...> ], [ a*A, <identity ...> ],
--              [ A*a, <identity ...> ], [ b^2, <identity ...> ],
--              [ b*B, <identity ...> ], [ B*b, <identity ...> ] ]
-+            [ [ a*A, <identity ...> ], [ A*a, <identity ...> ],
-+              [ b*B, <identity ...> ], [ B*b, <identity ...> ],
-+              [ a^2, <identity ...> ], [ b^2, <identity ...> ] ]
-         """
-         return self._gap
- 
-diff --git a/src/sage/groups/fqf_orthogonal.py b/src/sage/groups/fqf_orthogonal.py
-index 7fc4dbe7548..e5eccd45942 100644
---- a/src/sage/groups/fqf_orthogonal.py
-+++ b/src/sage/groups/fqf_orthogonal.py
-@@ -143,7 +143,7 @@ class FqfOrthogonalGroup(AbelianGroupAutomorphismGroup_subgroup):
-         [2/3   0   0]
-         [  0 2/3   0]
-         [  0   0 4/3]
--        generated by 2 elements
-+        generated by 3 elements
-         sage: q = matrix.diagonal(QQ, [3/2, 1/4, 1/4])
-         sage: T = TorsionQuadraticForm(q)
-         sage: T.orthogonal_group().order()
-diff --git a/src/sage/groups/libgap_wrapper.pyx b/src/sage/groups/libgap_wrapper.pyx
-index d25121aa792..dc81b71635b 100644
---- a/src/sage/groups/libgap_wrapper.pyx
-+++ b/src/sage/groups/libgap_wrapper.pyx
-@@ -25,7 +25,7 @@ Note how we call the constructor of both superclasses to initialize
- its output via LibGAP::
- 
-     sage: FooGroup()
--    <pc group of size 3 with 1 generators>
-+    <pc group of size 3 with 1 generator>
-     sage: type(FooGroup().gap())
-     <class 'sage.libs.gap.element.GapElement'>
- 
-@@ -106,7 +106,7 @@ class ParentLibGAP(SageObject):
-         ....:         ParentLibGAP.__init__(self, lg)
-         ....:         Group.__init__(self)
-         sage: FooGroup()
--        <pc group of size 3 with 1 generators>
-+        <pc group of size 3 with 1 generator>
-     """
- 
-     def __init__(self, libgap_parent, ambient=None):
-@@ -461,7 +461,7 @@ cdef class ElementLibGAP(MultiplicativeGroupElement):
-         ....:         ParentLibGAP.__init__(self, lg)
-         ....:         Group.__init__(self)
-         sage: FooGroup()
--        <pc group of size 3 with 1 generators>
-+        <pc group of size 3 with 1 generator>
-         sage: FooGroup().gens()
-         (f1,)
-     """
-diff --git a/src/sage/groups/matrix_gps/finitely_generated.py b/src/sage/groups/matrix_gps/finitely_generated.py
-index a6d3dc02513..63956ad5f10 100644
---- a/src/sage/groups/matrix_gps/finitely_generated.py
-+++ b/src/sage/groups/matrix_gps/finitely_generated.py
-@@ -563,9 +563,6 @@ def as_permutation_group(self, algorithm=None, seed=None):
-             21499084800
-             sage: P = G.as_permutation_group()
-             sage: Psmaller = G.as_permutation_group(algorithm="smaller", seed=6)
--            sage: P == Psmaller  # see the note below
--            True
--            sage: Psmaller = G.as_permutation_group(algorithm="smaller")
-             sage: P == Psmaller
-             False
-             sage: P.cardinality()
-diff --git a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-index f2ccca042ac..47d6862333c 100644
---- a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-+++ b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-@@ -427,7 +427,7 @@ cdef class LabelledBranching:
-             sage: from sage.groups.perm_gps.partn_ref2.refinement_generic import LabelledBranching
-             sage: L = LabelledBranching(3)
-             sage: L.small_generating_set()
--            []
-+            [()]
-             sage: L.add_gen(libgap.eval('(1,2,3)'))
-             sage: L.small_generating_set()
-             [(1,2,3)]
-diff --git a/src/sage/groups/perm_gps/permgroup.py b/src/sage/groups/perm_gps/permgroup.py
-index ebdf7c4c6eb..fb14008c8e0 100644
---- a/src/sage/groups/perm_gps/permgroup.py
-+++ b/src/sage/groups/perm_gps/permgroup.py
-@@ -926,7 +926,7 @@ def _coerce_map_from_(self, G):
-            sage: f = PG._coerce_map_from_(MG)
-            sage: mg = MG.an_element()
-            sage: p = f(mg); p
--           (2,33,32,23,31,55)(3,49,38,44,40,28)(4,17,59,62,58,46)(5,21,47,20,43,8)(6,53,50)(7,37,12,57,14,29)(9,41,56,34,64,10)(11,25,19)(13,61,26,51,22,15)(16,45,36)(18,27,35,48,52,54)(24,63,42)(30,39,60)
-+           (1,2,6,19,35,33)(3,9,26,14,31,23)(4,13,5)(7,22,17)(8,24,12)(10,16,32,27,20,28)(11,30,18)(15,25,36,34,29,21)
-            sage: PG(p._gap_()) == p
-            True
- 
-@@ -972,12 +972,12 @@ def _coerce_map_from_(self, G):
-             sage: P = G.as_permutation_group(algorithm='smaller', seed=5)
-             sage: P1 = G.as_permutation_group()
-             sage: P == P1
--            False
-+            True
-             sage: g1, g2, g3 = G.gens()
-             sage: P(g1*g2)
--            (1,3,7,12)(2,4,8,10)(5,11)(6,9)
-+            (1,4,13,11)(2,5,14,18)(3,15,8,16)(6,7)(9,20,19,12)(10,17)
-             sage: P1(g1*g2)
--            (2,29,25,68)(3,57,13,54)(4,11,72,37)(5,39,60,23)(6,64,75,63)(7,21,50,73)(8,46,38,32)(9,74,35,18)(10,44,49,48)(12,16,34,71)(14,79,27,40)(15,26)(17,62,59,76)(19,78,70,65)(20,22,58,51)(24,33,36,43)(28,81,80,52)(30,53,56,69)(31,61)(41,42,67,55)(45,77)(47,66)
-+            (1,4,13,11)(2,5,14,18)(3,15,8,16)(6,7)(9,20,19,12)(10,17)
- 
-         Another check for :trac:`5583`::
- 
-@@ -1302,7 +1302,7 @@ def gens_small(self):
-             sage: G.gens_small() # random
-             [('b','c'), ('a','c','b')] ## (on 64-bit Linux)
-             [('a','b'), ('a','c','b')] ## (on Solaris)
--            sage: len(G.gens_small()) == 2
-+            sage: len(G.gens_small()) == 2 # random
-             True
-         """
-         gens = self._libgap_().SmallGeneratingSet()
-@@ -4370,17 +4370,23 @@ def is_transitive(self, domain=None):
- 
-         ::
- 
--            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)]]) #S_5 on [1..5]
--            sage: G.is_transitive([1,4,5])
-+            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)],[(6,7)]])
-+            sage: G.is_transitive([1,2,3,4,5])
-             True
--            sage: G.is_transitive([2..6])
-+            sage: G.is_transitive([1..7])
-             False
-             sage: G.is_transitive(G.non_fixed_points())
--            True
-+            False
-             sage: H = PermutationGroup([[(1,2,3)],[(4,5,6)]])
-             sage: H.is_transitive(H.non_fixed_points())
-             False
- 
-+        If `G` does not act on the domain, it always returns ``False``::
-+
-+            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)]]) #S_5 on [1..5]
-+            sage: G.is_transitive([1,4,5])
-+            False
-+
-         Note that this differs from the definition in GAP, where
-         ``IsTransitive`` returns whether the group is transitive on the
-         set of points moved by the group.
-@@ -4436,12 +4442,16 @@ def is_primitive(self, domain=None):
-             sage: G = PermutationGroup([[(1,2,3,4)],[(2,4)]])
-             sage: G.is_primitive([1..4])
-             False
--            sage: G.is_primitive([1,2,3])
--            True
-             sage: G = PermutationGroup([[(3,4,5,6)],[(3,4)]]) #S_4 on [3..6]
-             sage: G.is_primitive(G.non_fixed_points())
-             True
- 
-+        If `G` does not act on the domain, it always returns ``False``::
-+
-+            sage: G = PermutationGroup([[(1,2,3,4)],[(2,4)]])
-+            sage: G.is_primitive([1,2,3])
-+            False
-+
-         """
-         #If the domain is not a subset of self.domain(), then the
-         #action isn't primitive.
-diff --git a/src/sage/interfaces/gap.py b/src/sage/interfaces/gap.py
-index 7ae1792e9de..ecaa9fd2341 100644
---- a/src/sage/interfaces/gap.py
-+++ b/src/sage/interfaces/gap.py
-@@ -1512,6 +1512,8 @@ def gap_reset_workspace(max_workspace_size=None, verbose=False):
-     """
-     # Create new workspace with filename WORKSPACE
-     g = Gap(use_workspace_cache=False, max_workspace_size=None)
-+    g.eval('ColorPrompt(false)')
-+    g.eval('SetUserPreference("UseColorPrompt", false)')
-     g.eval('SetUserPreference("HistoryMaxLines", 30)')
-     from sage.tests.gap_packages import all_installed_packages
-     for pkg in all_installed_packages(gap=g):
-diff --git a/src/sage/interfaces/gap_workspace.py b/src/sage/interfaces/gap_workspace.py
-index 33a87dd5076..03b40be6856 100644
---- a/src/sage/interfaces/gap_workspace.py
-+++ b/src/sage/interfaces/gap_workspace.py
-@@ -16,7 +16,8 @@
- import os
- import time
- import hashlib
--from sage.env import DOT_SAGE, GAP_SO
-+import subprocess
-+from sage.env import DOT_SAGE, HOSTNAME, GAP_LIB_DIR, GAP_SHARE_DIR
- 
- 
- def gap_workspace_file(system="gap", name="workspace", dir=None):
-@@ -59,11 +60,13 @@ def gap_workspace_file(system="gap", name="workspace", dir=None):
-     if dir is None:
-         dir = os.path.join(DOT_SAGE, 'gap')
- 
--    if GAP_SO:
--        h = hashlib.sha1(GAP_SO.encode('utf-8')).hexdigest()
--    else:
--        h = 'unknown'
--    return os.path.join(dir, '%s-%s-%s' % (system, name, h))
-+    data = f'{GAP_LIB_DIR}:{GAP_SHARE_DIR}'
-+    for path in GAP_LIB_DIR, GAP_SHARE_DIR:
-+        sysinfo = os.path.join(path, "sysinfo.gap")
-+        if os.path.exists(sysinfo):
-+            data += subprocess.getoutput(f'. "{sysinfo}" && echo ":$GAP_VERSION:$GAParch"')
-+    h = hashlib.sha1(data.encode('utf-8')).hexdigest()
-+    return os.path.join(dir, f'{system}-{name}-{HOSTNAME}-{h}')
- 
- 
- def prepare_workspace_dir(dir=None):
-diff --git a/src/sage/libs/gap/element.pyx b/src/sage/libs/gap/element.pyx
-index c555ea0333c..e3db3934baf 100644
---- a/src/sage/libs/gap/element.pyx
-+++ b/src/sage/libs/gap/element.pyx
-@@ -130,6 +130,7 @@ cdef char *capture_stdout(Obj func, Obj obj):
-     """
-     cdef Obj s, stream, output_text_string
-     cdef UInt res
-+    cdef TypOutputFile output
-     # The only way to get a string representation of an object that is truly
-     # consistent with how it would be represented at the GAP REPL is to call
-     # ViewObj on it.  Unfortunately, ViewObj *prints* to the output stream,
-@@ -145,12 +146,12 @@ cdef char *capture_stdout(Obj func, Obj obj):
-         output_text_string = GAP_ValueGlobalVariable("OutputTextString")
-         stream = CALL_2ARGS(output_text_string, s, GAP_True)
- 
--        if not OpenOutputStream(stream):
-+        if not OpenOutputStream(&output, stream):
-             raise GAPError("failed to open output capture stream for "
-                            "representing GAP object")
- 
-         CALL_1ARGS(func, obj)
--        CloseOutput()
-+        CloseOutput(&output)
-         return CSTR_STRING(s)
-     finally:
-         GAP_Leave()
-diff --git a/src/sage/libs/gap/gap_includes.pxd b/src/sage/libs/gap/gap_includes.pxd
-index 6d22e32540b..6111d18a5c7 100644
---- a/src/sage/libs/gap/gap_includes.pxd
-+++ b/src/sage/libs/gap/gap_includes.pxd
-@@ -76,8 +76,10 @@ cdef extern from "gap/intobj.h" nogil:
- 
- 
- cdef extern from "gap/io.h" nogil:
--    UInt OpenOutputStream(Obj stream)
--    UInt CloseOutput()
-+    ctypedef struct TypOutputFile:
-+        pass
-+    UInt OpenOutputStream(TypOutputFile* output, Obj stream)
-+    UInt CloseOutput(TypOutputFile* output)
- 
- 
- cdef extern from "gap/libgap-api.h" nogil:
-diff --git a/src/sage/libs/gap/libgap.pyx b/src/sage/libs/gap/libgap.pyx
-index b1a64e57939..6a36613aa8c 100644
---- a/src/sage/libs/gap/libgap.pyx
-+++ b/src/sage/libs/gap/libgap.pyx
-@@ -695,7 +695,7 @@ class Gap(Parent):
-             sage: libgap.List
-             <Gap function "List">
-             sage: libgap.GlobalRandomSource
--            <RandomSource in IsGlobalRandomSource>
-+            <RandomSource in IsGAPRandomSource>
-         """
-         if name in dir(self.__class__):
-             return getattr(self.__class__, name)
-diff --git a/src/sage/libs/gap/saved_workspace.py b/src/sage/libs/gap/saved_workspace.py
-index ad5adec36d0..7636707f557 100644
---- a/src/sage/libs/gap/saved_workspace.py
-+++ b/src/sage/libs/gap/saved_workspace.py
-@@ -8,7 +8,7 @@
- 
- import os
- import glob
--from sage.env import GAP_ROOT_DIR
-+from sage.env import GAP_LIB_DIR
- from sage.interfaces.gap_workspace import gap_workspace_file
- 
- 
-@@ -31,7 +31,7 @@ def timestamp():
-     """
-     libgap_dir = os.path.dirname(__file__)
-     libgap_files = glob.glob(os.path.join(libgap_dir, '*'))
--    gap_packages = glob.glob(os.path.join(GAP_ROOT_DIR, 'pkg', '*'))
-+    gap_packages = glob.glob(os.path.join(GAP_LIB_DIR, 'pkg', '*'))
-     files = libgap_files + gap_packages
-     if len(files) == 0:
-         print('Unable to find LibGAP files.')
-diff --git a/src/sage/libs/gap/util.pyx b/src/sage/libs/gap/util.pyx
-index 344ab88c42a..eaa659d64c7 100644
---- a/src/sage/libs/gap/util.pyx
-+++ b/src/sage/libs/gap/util.pyx
-@@ -13,7 +13,7 @@ Utility functions for GAP
- #*****************************************************************************
- 
- from libc.signal cimport signal, SIGCHLD, SIG_DFL
--from posix.dlfcn cimport dlopen, dlclose, RTLD_NOW, RTLD_GLOBAL
-+from posix.dlfcn cimport dlopen, dlclose, dlerror, RTLD_LAZY, RTLD_GLOBAL
- 
- from cpython.exc cimport PyErr_Fetch, PyErr_Restore
- from cpython.object cimport Py_LT, Py_LE, Py_EQ, Py_NE, Py_GT, Py_GE
-@@ -164,33 +164,6 @@ cdef void gasman_callback() with gil:
- ### Initialization of GAP ##################################################
- ############################################################################
- 
--def gap_root():
--    """
--    Find the location of the GAP root install which is stored in the gap
--    startup script.
--
--    EXAMPLES::
--
--        sage: from sage.libs.gap.util import gap_root
--        sage: gap_root()   # random output
--        '/home/vbraun/opt/sage-5.3.rc0/local/gap/latest'
--    """
--    if os.path.exists(sage.env.GAP_ROOT_DIR):
--        return sage.env.GAP_ROOT_DIR
--
--    # Attempt to figure out the appropriate GAP_ROOT by reading the
--    # local/bin/gap shell script; this is an ugly hack that exists for
--    # historical reasons; the best approach to setting where Sage looks for
--    # the appropriate GAP_ROOT is to set the GAP_ROOT_DIR variable
--    SAGE_LOCAL = sage.env.SAGE_LOCAL
--    with open(os.path.join(SAGE_LOCAL, 'bin', 'gap')) as f:
--        gap_sh = f.read().splitlines()
--    gapdir = next(x for x in gap_sh if x.strip().startswith('GAP_ROOT'))
--    gapdir = gapdir.split('"')[1]
--    gapdir = gapdir.replace('$SAGE_LOCAL', SAGE_LOCAL)
--    return gapdir
--
--
- # To ensure that we call initialize_libgap only once.
- cdef bint _gap_is_initialized = False
- 
-@@ -232,12 +205,12 @@ cdef initialize():
-     # this isn't portable
- 
-     cdef void* handle
--    libgapname = str_to_bytes(sage.env.GAP_SO)
--    handle = dlopen(libgapname, RTLD_NOW | RTLD_GLOBAL)
-+    # reload the current module to force reload of libgap (see #33446)
-+    lib = str_to_bytes(__loader__.path, FS_ENCODING, "surrogateescape")
-+    handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY)
-     if handle is NULL:
--        raise RuntimeError(
--                "Could not dlopen() libgap even though it should already "
--                "be loaded!")
-+        err = dlerror()
-+        raise RuntimeError(f"Could not reload gap library with RTLD_GLOBAL ({err})")
-     dlclose(handle)
- 
-     # Define argv variable, which we will pass in to
-@@ -245,7 +218,7 @@ cdef initialize():
-     cdef char* argv[16]
-     argv[0] = "sage"
-     argv[1] = "-l"
--    s = str_to_bytes(gap_root(), FS_ENCODING, "surrogateescape")
-+    s = str_to_bytes(sage.env.GAP_LIB_DIR + ";" + sage.env.GAP_SHARE_DIR, FS_ENCODING, "surrogateescape")
-     argv[2] = s
- 
-     argv[3] = "-m"
-@@ -362,15 +335,9 @@ cdef Obj gap_eval(str gap_string) except? NULL:
-         GAPError: Error, Variable: 'Complex' must have a value
-         Syntax error: ; expected in stream:1
-         Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^
-+                ^^^^^
-         Error, Variable: 'with' must have a value
--        Syntax error: ; expected in stream:1
--        Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^^^^^^^^^
-         Error, Variable: 'bits' must have a value
--        Syntax error: ; expected in stream:1
--        Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-         Error, Variable: 'precision' must have a value
- 
-     Test that on a subsequent attempt we get the same message (no garbage was
-diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx
-index d8ea7b07f3c..4beb1774df9 100644
---- a/src/sage/libs/singular/singular.pyx
-+++ b/src/sage/libs/singular/singular.pyx
-@@ -1705,14 +1705,7 @@ cdef object si2sa_intvec(intvec *v):
- cdef extern from *: # hack to get at cython macro
-     int unlikely(int)
- 
--cdef extern from "dlfcn.h":
--    void *dlopen(char *, long)
--    char *dlerror()
--    void dlclose(void *handle)
--
--cdef extern from "dlfcn.h":
--    cdef long RTLD_LAZY
--    cdef long RTLD_GLOBAL
-+from posix.dlfcn cimport dlopen, dlclose, dlerror, RTLD_LAZY, RTLD_GLOBAL
- 
- cdef int overflow_check(unsigned long e, ring *_ring) except -1:
-     """
-@@ -1762,8 +1755,6 @@ cdef init_libsingular():
- 
-     cdef void *handle = NULL
- 
--    from sage.env import LIBSINGULAR_PATH
--    lib = str_to_bytes(LIBSINGULAR_PATH, FS_ENCODING, "surrogateescape")
- 
-     # This is a workaround for https://github.com/Singular/Singular/issues/1113
-     # and can be removed once that fix makes it into release of Singular that
-@@ -1780,10 +1771,12 @@ cdef init_libsingular():
- 
-     import platform
-     if not platform.system().startswith("CYGWIN"):
-+        # reload the current module to force reload of libSingular (see #33446)
-+        lib = str_to_bytes(__loader__.path, FS_ENCODING, "surrogateescape")
-         handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY)
-         if not handle:
-             err = dlerror()
--            raise ImportError(f"cannot load Singular library from {LIBSINGULAR_PATH} ({err})")
-+            raise RuntimeError(f"Could not reload Singular library with RTLD_GLOBAL ({err})")
- 
-     # load SINGULAR
-     siInit(lib)
-diff --git a/src/sage/tests/gap_packages.py b/src/sage/tests/gap_packages.py
-index 2e4518ca226..c302b169b8a 100644
---- a/src/sage/tests/gap_packages.py
-+++ b/src/sage/tests/gap_packages.py
-@@ -103,7 +103,7 @@ def all_installed_packages(ignore_dot_gap=False, gap=None):
- 
-         sage: from sage.tests.gap_packages import all_installed_packages
-         sage: all_installed_packages()
--        (...'GAPDoc'...)
-+        (...'gapdoc'...)
-         sage: all_installed_packages(ignore_dot_gap=True) == all_installed_packages(gap=gap, ignore_dot_gap=True)
-         True
-     """
diff --git a/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch b/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
deleted file mode 100644
index d331a6573e1c..000000000000
--- a/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/src/sage/data_structures/stream.py b/src/sage/data_structures/stream.py
-index f8f6dc6a186..002e925f02f 100644
---- a/src/sage/data_structures/stream.py
-+++ b/src/sage/data_structures/stream.py
-@@ -2090,8 +2090,8 @@ def compute_product(self, n, la):
-             sage: f = Stream_exact([1]) # irrelevant for this test
-             sage: g = Stream_function(lambda n: s[n], True, 0)
-             sage: h = Stream_plethysm(f, g, True, p)
--            sage: B = p[2, 2, 1](sum(s[i] for i in range(7)))
--            sage: all(h.compute_product(k, Partition([2, 2, 1])) == B.restrict_degree(k) for k in range(7))
-+            sage: B = p[2, 2, 1](sum(p(s[i]) for i in range(7)))  # long time
-+            sage: all(h.compute_product(k, Partition([2, 2, 1])) == B.restrict_degree(k) for k in range(7))  # long time
-             True
-         """
-         # This is the approximate order of the result
diff --git a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch b/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
deleted file mode 100644
index 007f3324cfe4..000000000000
--- a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index b77c69b2f77..0586a96ae55 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -563,7 +563,7 @@ def complex_to_cmap_rgb(z_values, cmap='turbo', contoured=False, tiled=False,
-     import matplotlib as mpl
- 
-     if isinstance(cmap, str):
--        cmap = mpl.cm.get_cmap(cmap)
-+        cmap = mpl.colormaps[cmap]
- 
-     if contour_base is None:
-         if contour_type == "linear":
-@@ -1206,11 +1206,11 @@ def complex_plot(f, x_range, y_range, contoured=False, tiled=False, cmap=None,
-                 domain = np.linspace(0, 1, 256)
-                 shifted_domain = np.roll(domain, 128)
-                 default_cmap = mpl.colors.LinearSegmentedColormap.from_list(
--                    "sage_default", mpl.cm.get_cmap('hsv')(shifted_domain)
-+                    "sage_default", mpl.colormaps['hsv'](shifted_domain)
-                 )
-                 cmap = default_cmap
-             else:
--                cmap = mpl.cm.get_cmap(cmap)
-+                cmap = mpl.colormaps[cmap]
-         rgbs = complex_to_cmap_rgb(
-             z_values, cmap=cmap, contoured=contoured, tiled=tiled,
-             contour_type=contour_type, contour_base=contour_base,
-diff --git a/src/sage/plot/contour_plot.py b/src/sage/plot/contour_plot.py
-index c0cab456686..4accb309580 100644
---- a/src/sage/plot/contour_plot.py
-+++ b/src/sage/plot/contour_plot.py
-@@ -848,9 +848,7 @@ def f(x,y): return cos(x) + sin(y)
- 
-         sage: contour_plot(lambda x,y: 0, (-1,1), (-1,1),
-         ....:              contours=[0], fill=False, cmap=['blue'])
--        ...
--        UserWarning: No contour levels were found within the data range.
--        Graphics object consisting of 1 graphics primitive
-+        ...Graphics object consisting of 1 graphics primitive
- 
-     .. PLOT::
- 
-@@ -874,8 +872,7 @@ def f(x,y): return cos(x) + sin(y)
-     Check that :trac:`18074` is fixed::
- 
-         sage: contour_plot(0, (0,1), (0,1))
--        ... UserWarning: No contour levels were found within the data range.
--        Graphics object consisting of 1 graphics primitive
-+        ...Graphics object consisting of 1 graphics primitive
- 
-     Domain points in :trac:`11648` with complex output are now skipped::
- 
-diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
-index 64ea1a7e10f..cdc99ced263 100644
---- a/src/sage/plot/graphics.py
-+++ b/src/sage/plot/graphics.py
-@@ -2341,7 +2341,7 @@ def _matplotlib_tick_formatter(self, subplot, base=(10, 10),
-             sage: subplot = Figure().add_subplot(111)
-             sage: p._objects[0]._render_on_subplot(subplot)
-             sage: p._matplotlib_tick_formatter(subplot, **d)
--            (<AxesSubplot:...>,
-+            (<Axes...>,
-             <matplotlib.ticker.MaxNLocator object at ...>,
-             <matplotlib.ticker.MaxNLocator object at ...>,
-             <matplotlib.ticker.ScalarFormatter object at ...>,
-diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
-index 99c817f03a6..ae85183dc93 100644
---- a/src/sage/plot/multigraphics.py
-+++ b/src/sage/plot/multigraphics.py
-@@ -1207,7 +1207,7 @@ def _add_subplot(self, figure, index, **options):
-             sage: fig = Figure()
-             sage: ax1 = G._add_subplot(fig, 0)
-             sage: type(ax1)
--            <class 'matplotlib.axes._subplots.AxesSubplot'>
-+            <class 'matplotlib.axes...'>
-             sage: ax2 = G._add_subplot(fig, 1)
-             sage: fig.get_axes() == [ax1, ax2]
-             True
-diff --git a/src/sage/plot/plot3d/plot_field3d.py b/src/sage/plot/plot3d/plot_field3d.py
-index bdf39391d3e..fe10e27f58f 100644
---- a/src/sage/plot/plot3d/plot_field3d.py
-+++ b/src/sage/plot/plot3d/plot_field3d.py
-@@ -126,9 +126,9 @@ def plot_vector_field3d(functions, xrange, yrange, zrange,
-     vectors = [vector((ff(*point), gg(*point), hh(*point))) for point in points]
- 
-     try:
--        from matplotlib.cm import get_cmap
--        cm = get_cmap(colors)
--    except (TypeError, ValueError):
-+        import matplotlib as mpl
-+        cm = mpl.colormaps[colors]
-+    except (TypeError, KeyError):
-         cm = None
-     if cm is None:
-         if isinstance(colors, (list, tuple)):
diff --git a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch b/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
deleted file mode 100644
index 1e0a708e8068..000000000000
--- a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py
-index c9ca5e30939..9459cb70334 100644
---- a/src/sage/interfaces/maxima_lib.py
-+++ b/src/sage/interfaces/maxima_lib.py
-@@ -77,6 +77,26 @@
-     sage: bar == foo
-     True
- 
-+TESTS:
-+
-+Check our workaround for a race in ecl works, see :trac:`26968`.
-+We use a temporary `MAXIMA_USERDIR` so it's empty; we place it
-+in `DOT_SAGE` since we expect it to have more latency than `/tmp`.
-+
-+    sage: import tempfile, subprocess
-+    sage: tmpdir = tempfile.TemporaryDirectory(dir=DOT_SAGE)
-+    sage: _ = subprocess.run(['sage', '-c',  # long time
-+    ....: f'''
-+    ....: import os
-+    ....: os.environ["MAXIMA_USERDIR"] = "{tmpdir.name}"
-+    ....: if not os.fork():
-+    ....:     import sage.interfaces.maxima_lib
-+    ....: else:
-+    ....:     import sage.interfaces.maxima_lib
-+    ....:     os.wait()
-+    ....: '''])
-+    sage: tmpdir.cleanup()
-+
- """
- 
- # ****************************************************************************
-@@ -116,7 +136,23 @@
- ecl_eval("(setq $nolabels t))")
- ecl_eval("(defvar *MAXIMA-LANG-SUBDIR* NIL)")
- ecl_eval("(set-locale-subdir)")
--ecl_eval("(set-pathnames)")
-+
-+try:
-+    ecl_eval("(set-pathnames)")
-+except RuntimeError:
-+    # Recover from :trac:`26968` by creating `*maxima-objdir*` here.
-+    # This cannot be done before calling `(set-pathnames)` since
-+    # `*maxima-objdir*` is computed there.
-+    # We use python `os.makedirs()` which is immune to the race.
-+    # Using `(ensure-directories-exist ...)` in lisp would be
-+    # subject to the same race condition and since `*maxima-objdir*`
-+    # has multiple components this is quite plausible to happen.
-+    maxima_objdir = ecl_eval("*maxima-objdir*").python()[1:-1]
-+    import os
-+    os.makedirs(maxima_objdir, exist_ok=True)
-+    # Call `(set-pathnames)` again to complete its job.
-+    ecl_eval("(set-pathnames)")
-+
- ecl_eval("(defun add-lineinfo (x) x)")
- ecl_eval('(defun principal nil (cond ($noprincipal (diverg)) ((not pcprntd) (merror "Divergent Integral"))))')
- ecl_eval("(remprop 'mfactorial 'grind)")  # don't use ! for factorials (#11539)
diff --git a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch b/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
deleted file mode 100644
index fc3e40da2a88..000000000000
--- a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff --git a/src/bin/sage-cleaner b/src/bin/sage-cleaner
-index e2e578eec60..dc7d8f0482e 100755
---- a/src/bin/sage-cleaner
-+++ b/src/bin/sage-cleaner
-@@ -99,6 +99,15 @@ def cleanup():
- 
-     return len(pid_list)
- 
-+def cleanup_cruft():
-+    """ remove directories leftover from improper shutdown """
-+    tmp_dirs = os.listdir(SAGE_TMP_ROOT)
-+    for dir_entry in tmp_dirs:
-+        baddir = os.path.join(SAGE_TMP_ROOT, dir_entry)
-+        if os.path.isdir(baddir):
-+            logger.warning('Removing old directory %s from SAGE_TMP_ROOT', baddir)
-+            rm_rf(baddir)
-+
- def kill_spawned_jobs(jobfile, parent_pid):
-     logger.info("Killing %s's spawned jobs", parent_pid)
-     killed_them_all = True
-@@ -193,6 +202,7 @@ if __name__ == '__main__':
-     setup_daemon()
-     fix_old_mistakes()
-     logger.info("Starting sage-cleaner with PID %s", os.getpid())
-+    cleanup_cruft()
- 
-     if len(sys.argv) > 1:
-         wait = int(sys.argv[1])
diff --git a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch b/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
deleted file mode 100644
index ea210e20ae52..000000000000
--- a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py
-index ec6a5c19e60..9dd7bc1cb1e 100644
---- a/src/sage/graphs/generators/families.py
-+++ b/src/sage/graphs/generators/families.py
-@@ -3660,7 +3660,7 @@ def nauty_gentreeg(options="", debug=False):
- 
-         sage: gen = graphs.nauty_gentreeg("4", debug=True)
-         sage: print(next(gen))
--        >A ...gentreeg Z=2:3 D=3 n=4
-+        >A ...gentreeg ...
-         sage: gen = graphs.nauty_gentreeg("4 -q", debug=True)
-         sage: next(gen)
-         ''
-@@ -3687,7 +3687,7 @@ def nauty_gentreeg(options="", debug=False):
-         sage: list(graphs.nauty_gentreeg("3 -x", debug=True))
-         ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n [res/mod] ...
-         sage: list(graphs.nauty_gentreeg("3", debug=True))
--        ['>A ...gentreeg Z=2:2 D=2 n=3\n', Graph on 3 vertices]
-+        ['>A ...gentreeg ...\n', Graph on 3 vertices]
-     """
-     import shlex
-     from sage.features.nauty import NautyExecutable
-diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py
-index df88bbe2713..1a8016976c2 100644
---- a/src/sage/graphs/graph_generators.py
-+++ b/src/sage/graphs/graph_generators.py
-@@ -966,7 +966,7 @@ def nauty_geng(self, options="", debug=False):
-             ...
-             ValueError: wrong format of parameter option
-             sage: list(graphs.nauty_geng("-c3", debug=True))
--            ['>E Usage: ...geng [-cCmtfbd#D#] [-uygsnh] [-lvq] ...
-+            ['>E Usage: ...geng ...\n']
-             sage: list(graphs.nauty_geng("-c 3", debug=True))
-             ['>A ...geng -cd1D2 n=3 e=2-3\n', Graph on 3 vertices, Graph on 3 vertices]
-         """
diff --git a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch b/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
deleted file mode 100644
index 46bda084e48e..000000000000
--- a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-diff --git a/src/sage/repl/inputhook.py b/src/sage/repl/inputhook.py
-index da5df0268c0..7f7894f6dcf 100644
---- a/src/sage/repl/inputhook.py
-+++ b/src/sage/repl/inputhook.py
-@@ -17,6 +17,8 @@
- 
- import select
- import errno
-+import contextlib
-+import io
- 
- from IPython import get_ipython
- from IPython.terminal.pt_inputhooks import register
-@@ -47,15 +49,27 @@ def install():
-     """
-     Install the Sage input hook
- 
--    EXAMPLES::
-+    EXAMPLES:
-+
-+    Make sure ipython is running so we really test this function::
-+
-+        sage: from sage.repl.interpreter import get_test_shell
-+        sage: get_test_shell()
-+        <sage.repl.interpreter.SageTestShell object at ...>
-+
-+    Run the function twice, to check it is idempotent (see :trac:`35235`)::
- 
-         sage: from sage.repl.inputhook import install
-         sage: install()
-+        sage: install()
-     """
-     ip = get_ipython()
-     if not ip:
-         return   # Not running in ipython, e.g. doctests
--    ip.enable_gui('sage')
-+    if ip._inputhook != sage_inputhook:
-+        # silence `ip.enable_gui()` useless output
-+        with contextlib.redirect_stdout(io.StringIO()):
-+            ip.enable_gui('sage')
- 
- 
- def uninstall():
-@@ -71,4 +85,6 @@ def uninstall():
-     if not ip:
-         return
-     if ip._inputhook == sage_inputhook:
--        ip.enable_gui(None)
-+        # silence `ip.enable_gui()` useless output
-+        with contextlib.redirect_stdout(io.StringIO()):
-+            ip.enable_gui(None)
diff --git a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch b/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
deleted file mode 100644
index 2cdc674d4f9e..000000000000
--- a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 532fbbaf71bb41c73920b584108eb2a09d6deeb1 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
-Date: Tue, 4 Apr 2023 12:56:57 -0300
-Subject: [PATCH] Ignore deprecation warnings triggered by pythran 0.12.1
-
-These happen with python 3.11, setuptools 67.6.1, numpy 1.24.2.
-When pythran 0.12.1 is installed, I get 24 doctest failures due to
-deprecation warnings; they are all gone with this commit.
-
-[backported from 839a6e928c264a9863bd42860c78ae95a6d9f3e0]
----
- src/sage/all.py | 12 ++++++++++--
- 1 file changed, 10 insertions(+), 2 deletions(-)
-
-diff --git a/src/sage/all.py b/src/sage/all.py
-index 93588df1b93..ee775aad0e9 100644
---- a/src/sage/all.py
-+++ b/src/sage/all.py
-@@ -96,9 +96,17 @@ warnings.filterwarnings('ignore', category=DeprecationWarning,
- warnings.filterwarnings('ignore', category=DeprecationWarning,
-     module='(.*[.]_vendor[.])?packaging')
- 
--# Ignore numpy warnings triggered by pythran
-+# Ignore a few warnings triggered by pythran 0.12.1
- warnings.filterwarnings('ignore', category=DeprecationWarning,
--                        module='pythran')
-+    message='\n\n  `numpy.distutils` is deprecated since NumPy 1.23.0',
-+    module='pythran.dist')
-+warnings.filterwarnings('ignore', category=DeprecationWarning,
-+    message='pkg_resources is deprecated as an API|'
-+            'Deprecated call to `pkg_resources.declare_namespace(.*)`',
-+    module='pkg_resources')
-+warnings.filterwarnings('ignore', category=DeprecationWarning,
-+    message='msvccompiler is deprecated and slated to be removed',
-+    module='distutils.msvccompiler')
- 
- warnings.filterwarnings('ignore', category=DeprecationWarning,
-                         message='The distutils(.sysconfig module| package) is deprecated',
--- 
-2.40.0
-
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 871ae38577fd..ab73c494aab2 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 URL_BASE_PR="https://github.com/sagemath/sage/pull/"
-URL_BASE_COMPARE="https://github.com/sagemath/sage/compare/9.8..."
+URL_BASE_COMPARE="https://github.com/sagemath/sage/compare/10.0.rc0..."
 
 case "$1" in
 	-n)  DO=echo ;;
@@ -15,49 +15,8 @@ get_pr() {
 	$DO wget "$URL_BASE_PR$pr.$ext" -O "$pr-$desc.patch"
 }
 
-get_trac() {
-	ticket=$1
-	desc=$(echo "$2" | sed -e 's/ /_/g')
-	commit=$3
-	$DO wget "$URL_BASE_COMPARE$commit.diff" -O "$ticket-$desc-$commit.patch"
-}
-
 # run from patches dir
 cd $(dirname "$0")
 
-# merged in 10.0.beta0
-get_trac 34851 "support singular 4.3.1.p3" 5e5737a0c
-get_pr 35068 "fix tests giac 1.9.0.35" patch
-
-# merged in 10.0.beta1
-get_pr 35058 "skip unstable tests klyachko"
-
-# merged in 10.0.beta2
-get_pr 34994 "fix tests numpy 1.24"
-get_pr 34997 "fix edge case of integer_check"
-
-# merged in 10.0.beta3
-get_pr 34995 "support tachyon 0.99.2"
-
-# merged in 10.0.beta4
-get_pr 34980 "avoid factoring in is_prime"
-
-# merged in 10.0.beta5
-get_pr 35094 "support gap 4.12"					# includes PR 35093
-
-# merged in 10.0.beta6
-get_pr 35127 "fix very slow test stream.py"
-get_pr 35177 "matplotlib 3.7"
-get_pr 35195 "workaround ecl race"
-get_pr 35204 "fix sage-cleaner"
-
-# merged in 10.0.beta7
-get_pr 35250 "nauty 2.8.6"
-
-# merged in 10.0.beta8
-#get_pr 35337 "ipython 8.11"
-get_pr 35423 "ipython 8.12"						# includes PR 35337
-get_pr 35438 "pythran 0.12.1"
-
 # needs review
 get_pr 35584 "networkx 3.1"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 66a543efd21d..f7687005e0b0 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=9.8
-revision=2
+version=10.0.rc0
+revision=1
 build_wrksrc=pkgs/sagemath-standard
 build_style=python3-module
 _bindir=/usr/lib/sagemath/$version/bin
@@ -32,7 +32,7 @@ maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-or-later"
 homepage="http://sagemath.org/"
 distfiles="https://github.com/sagemath/sage/archive/refs/tags/$version.tar.gz"
-checksum=2aff28bd1d18c2d526581f5298acb8336f5b92db5675a7403dec8eaf9a86bc4c
+checksum=8e56869d5c14f4bab4d8b0de2e4313b28375c3de35fb3e35e7766e697736eb83
 
 do_configure() {
 	# git tree needs bootstrapping

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] sagemath: update to 10.0.rc0.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (4 preceding siblings ...)
  2023-04-29  2:20 ` [PR PATCH] [Updated] " tornaria
@ 2023-05-05  1:46 ` tornaria
  2023-05-05  1:51 ` [RFC] sagemath: update to 10.0.rc1 tornaria
                   ` (33 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: tornaria @ 2023-05-05  1:46 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1700 bytes --]

There is an updated pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages sagemath-next
https://github.com/void-linux/void-packages/pull/43659

[RFC] sagemath: update to 10.0.rc0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

This builds on top of #43225 for convenience.

#### Testing the changes
- I tested the changes in this PR: **briefly**

I've been following beta releases and now rc0 includes all of our patches :muscle:

All doctests pass with the version of packages in void except for `python-Babel` which must be updated (as in #43497) and is included  here as part of #43225.

I've switched my system sagemath to this version as everything seems to be working ok. The testsuite is 10-15% faster.

@dkwo: enjoy.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/43659.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-sagemath-next-43659.patch --]
[-- Type: text/x-diff, Size: 149885 bytes --]

From 296f569064cfd5efa639b11ea95a4932a07d3203 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Dec 2021 20:20:09 -0300
Subject: [PATCH 1/5] givaro: update to 4.2.0.

---
 srcpkgs/givaro/patches/197.patch | 28 ++++++++++++++++++++++++++++
 srcpkgs/givaro/template          |  9 ++++-----
 2 files changed, 32 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/givaro/patches/197.patch

diff --git a/srcpkgs/givaro/patches/197.patch b/srcpkgs/givaro/patches/197.patch
new file mode 100644
index 000000000000..bafaff3efbd9
--- /dev/null
+++ b/srcpkgs/givaro/patches/197.patch
@@ -0,0 +1,28 @@
+From ab3d332508c21daff41fb64a8658cdc7cc74fc47 Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
+Date: Thu, 16 Dec 2021 17:12:25 +0100
+Subject: [PATCH] dom_power argument is now an uint64_t to avoid problem with
+ 32bit machine
+
+---
+ src/kernel/system/givpower.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/kernel/system/givpower.h b/src/kernel/system/givpower.h
+index eb784872..5644264d 100644
+--- a/src/kernel/system/givpower.h
++++ b/src/kernel/system/givpower.h
+@@ -71,11 +71,11 @@ namespace Givaro {
+ 
+     //! dom_power
+     template<class D, class TT>
+-    TT& dom_power(TT& res, const TT& n, long l, const D& F)
++    TT& dom_power(TT& res, const TT& n, uint64_t l, const D& F)
+     {
+         if (l == 0) return F.assign(res,F.one) ;
+ 
+-        unsigned long p = (unsigned long) l ;
++        uint64_t p = l;
+         bool is_assg = false ;
+ 
+         TT puiss; F.init(puiss); F.assign(puiss,n) ;
diff --git a/srcpkgs/givaro/template b/srcpkgs/givaro/template
index 9c16de5b1974..52457c02a1ed 100644
--- a/srcpkgs/givaro/template
+++ b/srcpkgs/givaro/template
@@ -1,6 +1,6 @@
 # Template file for 'givaro'
 pkgname=givaro
-version=4.1.1
+version=4.2.0
 revision=1
 build_style=gnu-configure
 makedepends="gmpxx-devel"
@@ -8,16 +8,15 @@ short_desc="C++ library for arithmetic and algebraic computations"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="CECILL-B"
 homepage="https://github.com/linbox-team/givaro"
+changelog="https://github.com/linbox-team/givaro/raw/master/ChangeLog"
 distfiles="https://github.com/linbox-team/givaro/releases/download/v${version}/givaro-${version}.tar.gz"
-checksum=628049899386e91da245aee6cd446350fbca87e94863bc0d815066c08150487f
+checksum=865e228812feca971dfb6e776a7bc7ac959cf63ebd52b4f05492730a46e1f189
 nocross=yes
 
 build_options="native_build"
 
 if [ -z "$build_option_native_build" ]; then
-	configure_args="--enable-sse --enable-sse2
-	  --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42
-	  --disable-avx --disable-avx2 --disable-fma --disable-fma4"
+	configure_args="--without-archnative"
 fi
 
 post_install() {

From 6667f066733f6d9d70087a4d285f0cdcb68581df Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Dec 2021 20:20:17 -0300
Subject: [PATCH 2/5] fflas-ffpack: update to 2.5.0.

---
 srcpkgs/fflas-ffpack/patches/357.patch | 35 ++++++++++++++++++++++++++
 srcpkgs/fflas-ffpack/template          | 12 ++++-----
 2 files changed, 40 insertions(+), 7 deletions(-)
 create mode 100644 srcpkgs/fflas-ffpack/patches/357.patch

diff --git a/srcpkgs/fflas-ffpack/patches/357.patch b/srcpkgs/fflas-ffpack/patches/357.patch
new file mode 100644
index 000000000000..99fd34efd93b
--- /dev/null
+++ b/srcpkgs/fflas-ffpack/patches/357.patch
@@ -0,0 +1,35 @@
+From 9b6083c663096e9ca85775b79f1f27c848dbeb98 Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
+Date: Fri, 17 Dec 2021 10:27:02 +0100
+Subject: [PATCH] Fix SimdChooser: on not x86_64 machines its value could be an
+ nonexistant struct
+
+---
+ fflas-ffpack/fflas/fflas_simd.h | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/fflas-ffpack/fflas/fflas_simd.h b/fflas-ffpack/fflas/fflas_simd.h
+index bf5d30211..84ced0fd8 100644
+--- a/fflas-ffpack/fflas/fflas_simd.h
++++ b/fflas-ffpack/fflas/fflas_simd.h
+@@ -384,6 +384,20 @@ struct SimdChooser<T, true, true> // integral number
+ #endif
+ };
+ 
++#ifndef __x86_64__
++template <>
++struct SimdChooser<uint64_t, true, true>
++{
++    using value = NoSimd<uint64_t>;
++};
++
++template <>
++struct SimdChooser<int64_t, true, true>
++{
++    using value = NoSimd<int64_t>;
++};
++#endif
++
+ template <class T> using Simd = typename SimdChooser<T>::value;
+ 
+ // template <class T> struct SimdChooser<T, true> {
diff --git a/srcpkgs/fflas-ffpack/template b/srcpkgs/fflas-ffpack/template
index 557c644c00a4..2aa599703585 100644
--- a/srcpkgs/fflas-ffpack/template
+++ b/srcpkgs/fflas-ffpack/template
@@ -1,6 +1,6 @@
 # Template file for 'fflas-ffpack'
 pkgname=fflas-ffpack
-version=2.4.3
+version=2.5.0
 revision=1
 build_style=gnu-configure
 hostmakedepends="pkg-config"
@@ -10,15 +10,13 @@ short_desc="Finite Field Linear Algebra Subroutines / Package"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="LGPL-2.1-or-later"
 homepage="http://linbox-team.github.io/fflas-ffpack/"
-distfiles="https://github.com/linbox-team/fflas-ffpack/releases/download/${version}/fflas-ffpack-${version}.tar.gz"
-checksum=f372783a17a9899ee9f88d4c9421d80facccb95556146dad7020d07a03791cc9
+changelog="https://github.com/linbox-team/fflas-ffpack/raw/master/ChangeLog"
+distfiles="https://github.com/linbox-team/fflas-ffpack/releases/download/v${version}/fflas-ffpack-${version}.tar.gz"
+checksum=dafb4c0835824d28e4f823748579be6e4c8889c9570c6ce9cce1e186c3ebbb23
 nocross=yes
 
 build_options="native_build"
 
 if [ -z "$build_option_native_build" ]; then
-	configure_args="--enable-sse --enable-sse2
-	  --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42
-	  --disable-avx --disable-avx2 --disable-fma --disable-fma4
-	  --disable-avx512f --disable-avx512dq --disable-avx512vl"
+	configure_args="--without-archnative"
 fi

From 277dff14025d4b017bb13f13ef86dfcac4cef86f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Dec 2021 20:20:20 -0300
Subject: [PATCH 3/5] linbox: update to 1.7.0.

---
 srcpkgs/linbox/patches/292.patch              | 24 ++++++++++++
 srcpkgs/linbox/patches/294.patch              | 38 +++++++++++++++++++
 ...8adade10641f1f04f04b589753d928fb5443.patch | 35 -----------------
 .../remove-linboxsage-libs-from-pc.patch      | 23 -----------
 srcpkgs/linbox/template                       | 11 +++---
 5 files changed, 67 insertions(+), 64 deletions(-)
 create mode 100644 srcpkgs/linbox/patches/292.patch
 create mode 100644 srcpkgs/linbox/patches/294.patch
 delete mode 100644 srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch
 delete mode 100644 srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch

diff --git a/srcpkgs/linbox/patches/292.patch b/srcpkgs/linbox/patches/292.patch
new file mode 100644
index 000000000000..d3333cc23d0b
--- /dev/null
+++ b/srcpkgs/linbox/patches/292.patch
@@ -0,0 +1,24 @@
+From 49b9cccd0286980c1c1811c3b03df883ef0164df Mon Sep 17 00:00:00 2001
+From: Doug Torrance <dtorrance@piedmont.edu>
+Date: Tue, 14 Dec 2021 16:22:33 -0500
+Subject: [PATCH] Only register uint128_t as a TypeName when it's available.
+
+Otherwise, test-fft will fail when it isn't.
+---
+ tests/test-fft.C | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/tests/test-fft.C b/tests/test-fft.C
+index d19184c2d..5811ebc5d 100644
+--- a/tests/test-fft.C
++++ b/tests/test-fft.C
+@@ -55,7 +55,9 @@ REGISTER_TYPE_NAME(double);
+ REGISTER_TYPE_NAME(uint16_t);
+ REGISTER_TYPE_NAME(uint32_t);
+ REGISTER_TYPE_NAME(uint64_t);
++#ifdef __FFLASFFPACK_HAVE_INT128
+ REGISTER_TYPE_NAME(uint128_t);
++#endif
+ REGISTER_TYPE_NAME(Modular);
+ REGISTER_TYPE_NAME(ModularExtended);
+ 
diff --git a/srcpkgs/linbox/patches/294.patch b/srcpkgs/linbox/patches/294.patch
new file mode 100644
index 000000000000..7c645f165d39
--- /dev/null
+++ b/srcpkgs/linbox/patches/294.patch
@@ -0,0 +1,38 @@
+From f81a1f4a5e0835b7a0f3bb88a0fcbbaa32174cfa Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
+Date: Wed, 15 Dec 2021 16:00:39 +0100
+Subject: [PATCH] Only register uint128_t as a TypeName when it's available
+
+---
+ benchmarks/benchmark-fft.C                       | 2 ++
+ benchmarks/benchmark-polynomial-matrix-mul-fft.C | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/benchmarks/benchmark-fft.C b/benchmarks/benchmark-fft.C
+index 39b86c9d9..59a8be57c 100644
+--- a/benchmarks/benchmark-fft.C
++++ b/benchmarks/benchmark-fft.C
+@@ -54,7 +54,9 @@ REGISTER_TYPE_NAME(double);
+ REGISTER_TYPE_NAME(uint16_t);
+ REGISTER_TYPE_NAME(uint32_t);
+ REGISTER_TYPE_NAME(uint64_t);
++#ifdef __FFLASFFPACK_HAVE_INT128
+ REGISTER_TYPE_NAME(uint128_t);
++#endif
+ REGISTER_TYPE_NAME(Modular);
+ REGISTER_TYPE_NAME(ModularExtended);
+ 
+diff --git a/benchmarks/benchmark-polynomial-matrix-mul-fft.C b/benchmarks/benchmark-polynomial-matrix-mul-fft.C
+index e9b184bcf..7bf17f33e 100644
+--- a/benchmarks/benchmark-polynomial-matrix-mul-fft.C
++++ b/benchmarks/benchmark-polynomial-matrix-mul-fft.C
+@@ -65,7 +65,9 @@ REGISTER_TYPE_NAME(double);
+ REGISTER_TYPE_NAME(uint16_t);
+ REGISTER_TYPE_NAME(uint32_t);
+ REGISTER_TYPE_NAME(uint64_t);
++#ifdef __FFLASFFPACK_HAVE_INT128
+ REGISTER_TYPE_NAME(uint128_t);
++#endif
+ REGISTER_TYPE_NAME(Modular);
+ REGISTER_TYPE_NAME(ModularExtended);
+ 
diff --git a/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch b/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch
deleted file mode 100644
index 5afa078ec7b8..000000000000
--- a/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 892f8adade10641f1f04f04b589753d928fb5443 Mon Sep 17 00:00:00 2001
-From: Doug Torrance <dtorrance@piedmont.edu>
-Date: Sun, 9 May 2021 12:14:19 -0400
-Subject: [PATCH] Use std::ptrdiff_t for vector iterator difference type
-
-It was previously long (64-bit integers), but this will not be the
-case on 32-bit systems.
-
-Closes: #273
----
- linbox/vector/bit-vector.inl | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/linbox/vector/bit-vector.inl b/linbox/vector/bit-vector.inl
-index 5fa84b421..23a22ba47 100644
---- a/linbox/vector/bit-vector.inl
-+++ b/linbox/vector/bit-vector.inl
-@@ -46,7 +46,7 @@ namespace std
- 		typedef LinBox::BitVector::reference reference;
- 		typedef bool *pointer;
- 		typedef bool value_type;
--		typedef long difference_type;
-+		typedef std::ptrdiff_t difference_type;
- 	};
- 
- 	template <>
-@@ -56,7 +56,7 @@ namespace std
- 		typedef LinBox::BitVector::const_reference reference;
- 		typedef const bool *pointer;
- 		typedef bool value_type;
--		typedef long difference_type;
-+		typedef std::ptrdiff_t difference_type;
- 	};
- }
- 
diff --git a/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch b/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch
deleted file mode 100644
index c93915fb1b06..000000000000
--- a/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Backported from:
-
-From 426eb97ba762c7663884f57ead0909f2aa3cd6a5 Mon Sep 17 00:00:00 2001
-From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
-Date: Thu, 17 Jan 2019 16:32:19 +0100
-Subject: [PATCH] Remove @LINBOXSAGE_LIBS@ from linbox.pc.in
-
----
- linbox.pc.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/linbox.pc.in b/linbox.pc.in
-index 278f127e4..c6b8091eb 100644
---- a/linbox.pc.in
-+++ b/linbox.pc.in
-@@ -9,6 +9,6 @@ Description: Exact Linear Algebra library
- URL: http://github.com/linbox-team/linbox
- Version: @VERSION@
- Requires: fflas-ffpack >= 2.4.0, givaro >= 4.1.0
--Libs: -L${libdir} -llinbox @LINBOXSAGE_LIBS@ @NTL_LIBS@ @MPFR_LIBS@ @FPLLL_LIBS@ @IML_LIBS@ @FLINT_LIBS@ @OCL_LIBS@
-+Libs: -L${libdir} -llinbox @NTL_LIBS@ @MPFR_LIBS@ @FPLLL_LIBS@ @IML_LIBS@ @FLINT_LIBS@ @OCL_LIBS@
- Cflags: @DEFAULT_CFLAGS@ -DDISABLE_COMMENTATOR -I${includedir} @NTL_CFLAGS@ @MPFR_CFLAGS@ @FPLLL_CFLAGS@  @IML_CFLAGS@ @FLINT_CFLAGS@ 
- \-------------------------------------------------------
diff --git a/srcpkgs/linbox/template b/srcpkgs/linbox/template
index 096a15b3390b..e6edacdd0a74 100644
--- a/srcpkgs/linbox/template
+++ b/srcpkgs/linbox/template
@@ -1,7 +1,7 @@
 # Template file for 'linbox'
 pkgname=linbox
-version=1.6.3
-revision=2
+version=1.7.0
+revision=1
 build_style=gnu-configure
 hostmakedepends="pkg-config"
 makedepends="fflas-ffpack"
@@ -9,16 +9,15 @@ short_desc="C++ library for exact, high-performance linear algebra"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="LGPL-2.1-or-later"
 homepage="https://linalg.org"
+changelog="https://github.com/linbox-team/linbox/raw/master/ChangeLog"
 distfiles="https://github.com/linbox-team/linbox/releases/download/v${version}/linbox-${version}.tar.gz"
-checksum=a58a188307b07c57964e844bceb99321d3043a8a4a1fccc082a54928bb9a0057
+checksum=6d2159fd395be0298362dd37f6c696676237bc8e2757341fbc46520e3b466bcc
 nocross=yes
 
 build_options="native_build"
 
 if [ -z "$build_option_native_build" ]; then
-	configure_args="--enable-sse --enable-sse2
-	  --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42
-	  --disable-avx --disable-avx2 --disable-fma --disable-fma4"
+	configure_args="--without-archnative"
 fi
 
 linbox-devel_package() {

From 7cd0f09d1949944cd8d143678962c2f50e5906cb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Feb 2023 22:53:33 -0300
Subject: [PATCH 4/5] sagemath: rebuild for linbox 1.7.0

---
 .../sagemath/patches/35612-linbox_1.7.patch   | 64 +++++++++++++++++++
 srcpkgs/sagemath/patches/get_patches          |  1 +
 srcpkgs/sagemath/template                     |  2 +-
 3 files changed, 66 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/sagemath/patches/35612-linbox_1.7.patch

diff --git a/srcpkgs/sagemath/patches/35612-linbox_1.7.patch b/srcpkgs/sagemath/patches/35612-linbox_1.7.patch
new file mode 100644
index 000000000000..58dddf34a69d
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35612-linbox_1.7.patch
@@ -0,0 +1,64 @@
+diff --git a/src/sage/libs/linbox/conversion.pxd b/src/sage/libs/linbox/conversion.pxd
+index 7794c9edc39..1753277b1f1 100644
+--- a/src/sage/libs/linbox/conversion.pxd
++++ b/src/sage/libs/linbox/conversion.pxd
+@@ -177,9 +177,8 @@ cdef inline Vector_integer_dense new_sage_vector_integer_dense(P, DenseVector_in
+     - v -- linbox vector
+     """
+     cdef Vector_integer_dense res = P()
+-    cdef cppvector[Integer] * vec = &v.refRep()
+     cdef size_t i
+     for i in range(<size_t> res._degree):
+-        mpz_set(res._entries[i], vec[0][i].get_mpz_const())
++        mpz_set(res._entries[i], v.getEntry(i).get_mpz_const())
+ 
+     return res
+diff --git a/src/sage/libs/linbox/linbox.pxd b/src/sage/libs/linbox/linbox.pxd
+index 9112d151f8b..bfeda4b6042 100644
+--- a/src/sage/libs/linbox/linbox.pxd
++++ b/src/sage/libs/linbox/linbox.pxd
+@@ -32,7 +32,6 @@ cdef extern from "linbox/matrix/dense-matrix.h":
+         ctypedef Modular_double Field
+         ctypedef double Element
+         DenseMatrix_Modular_double(Field F, size_t m, size_t n)
+-        DenseMatrix_Modular_double(Field F, Element*, size_t m, size_t n)
+         void setEntry(size_t i, size_t j, Element& a)
+         Element &getEntry(size_t i, size_t j)
+ 
+@@ -42,7 +41,6 @@ cdef extern from "linbox/matrix/dense-matrix.h":
+         ctypedef Modular_float Field
+         ctypedef float Element
+         DenseMatrix_Modular_float(Field F, size_t m, size_t n)
+-        DenseMatrix_Modular_float(Field F, Element*, size_t m, size_t n)
+         void setEntry(size_t i, size_t j, Element& a)
+         Element &getEntry(size_t i, size_t j)
+ 
+@@ -101,7 +99,6 @@ cdef extern from "linbox/vector/vector.h":
+         DenseVector_integer (Field &F)
+         DenseVector_integer (Field &F, long& m)
+         DenseVector_integer (Field &F, cppvector[Integer]&)
+-        cppvector[Element]& refRep()
+         size_t size()
+         void resize(size_t)
+         void resize(size_t n, const Element&)
+diff --git a/src/sage/matrix/matrix_modn_dense_template.pxi b/src/sage/matrix/matrix_modn_dense_template.pxi
+index abf29badce6..68b869ce314 100644
+--- a/src/sage/matrix/matrix_modn_dense_template.pxi
++++ b/src/sage/matrix/matrix_modn_dense_template.pxi
+@@ -221,9 +221,14 @@ cdef inline linbox_echelonize_efd(celement modulus, celement* entries, Py_ssize_
+         return 0,[]
+ 
+     cdef ModField *F = new ModField(<long>modulus)
+-    cdef DenseMatrix *A = new DenseMatrix(F[0], <ModField.Element*>entries,<Py_ssize_t>nrows, <Py_ssize_t>ncols)
+-    cdef Py_ssize_t r = reducedRowEchelonize(A[0])
++    cdef DenseMatrix *A = new DenseMatrix(F[0], nrows, ncols)
++
+     cdef Py_ssize_t i,j
++    for i in range(nrows):
++        for j in range(ncols):
++            A.setEntry(i, j, entries[i*ncols+j])
++
++    cdef Py_ssize_t r = reducedRowEchelonize(A[0])
+     for i in range(nrows):
+         for j in range(ncols):
+             entries[i*ncols+j] = <celement>A.getEntry(i,j)
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 871ae38577fd..db36086fc9f9 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -61,3 +61,4 @@ get_pr 35438 "pythran 0.12.1"
 
 # needs review
 get_pr 35584 "networkx 3.1"
+get_pr 35612 "linbox 1.7"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 66a543efd21d..6e794c931df4 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
 version=9.8
-revision=2
+revision=3
 build_wrksrc=pkgs/sagemath-standard
 build_style=python3-module
 _bindir=/usr/lib/sagemath/$version/bin

From 75065513b13aa0e8fea72c7b078265863a38b5c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Tue, 25 Apr 2023 13:20:47 -0300
Subject: [PATCH 5/5] sagemath: update to 10.0.rc1.

---
 srcpkgs/sagemath/files/sage_conf.py           |    1 -
 srcpkgs/sagemath/files/timings2.json          |  405 ++---
 ...-support_singular_4.3.1.p3-5e5737a0c.patch |  205 ---
 .../34980-avoid_factoring_in_is_prime.patch   |   49 -
 .../patches/34994-fix_tests_numpy_1.24.patch  |   58 -
 .../34995-support_tachyon_0.99.2.patch        |   57 -
 ...34997-fix_edge_case_of_integer_check.patch |   36 -
 .../35058-skip_unstable_tests_klyachko.patch  |   22 -
 .../35068-fix_tests_giac_1.9.0.35.patch       |   62 -
 .../patches/35094-support_gap_4.12.patch      | 1303 -----------------
 .../35127-fix_very_slow_test_stream.py.patch  |   15 -
 .../patches/35177-matplotlib_3.7.patch        |   95 --
 .../patches/35195-workaround_ecl_race.patch   |   56 -
 .../patches/35204-fix_sage-cleaner.patch      |   28 -
 .../sagemath/patches/35250-nauty_2.8.6.patch  |   35 -
 .../sagemath/patches/35423-ipython_8.12.patch |   51 -
 .../patches/35438-pythran_0.12.1.patch        |   41 -
 srcpkgs/sagemath/patches/get_patches          |   43 +-
 srcpkgs/sagemath/template                     |    6 +-
 19 files changed, 111 insertions(+), 2457 deletions(-)
 delete mode 100644 srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
 delete mode 100644 srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
 delete mode 100644 srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
 delete mode 100644 srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
 delete mode 100644 srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
 delete mode 100644 srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
 delete mode 100644 srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
 delete mode 100644 srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
 delete mode 100644 srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
 delete mode 100644 srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
 delete mode 100644 srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
 delete mode 100644 srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
 delete mode 100644 srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
 delete mode 100644 srcpkgs/sagemath/patches/35423-ipython_8.12.patch
 delete mode 100644 srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch

diff --git a/srcpkgs/sagemath/files/sage_conf.py b/srcpkgs/sagemath/files/sage_conf.py
index 00de40f1ee4f..bc5388de8956 100644
--- a/srcpkgs/sagemath/files/sage_conf.py
+++ b/srcpkgs/sagemath/files/sage_conf.py
@@ -1,4 +1,3 @@
 # configuration for sage on void linux
 SAGE_SHARE = "/usr/share/sagemath"
 GAP_SHARE_DIR = "/usr/share/gap"
-GAP_LIB_DIR = "/usr/lib/gap"
diff --git a/srcpkgs/sagemath/files/timings2.json b/srcpkgs/sagemath/files/timings2.json
index bb3098680502..b2b3fe818a20 100644
--- a/srcpkgs/sagemath/files/timings2.json
+++ b/srcpkgs/sagemath/files/timings2.json
@@ -1,281 +1,152 @@
 {
-  "doc.ca.intro.index": {"walltime": 8},
-  "doc.en.constructions.calculus": {"walltime": 64},
-  "doc.en.constructions.plotting": {"walltime": 32},
-  "doc.en.prep.Advanced-2DPlotting": {"walltime": 16},
-  "doc.en.prep.Calculus": {"walltime": 8},
-  "doc.en.prep.Symbolics-and-Basic-Plotting": {"walltime": 8},
-  "doc.en.thematic_tutorials.explicit_methods_in_number_theory.birds_other": {"walltime": 8},
-  "doc.en.thematic_tutorials.explicit_methods_in_number_theory.elliptic_curves": {"walltime": 8},
-  "doc.en.thematic_tutorials.geometry.polyhedra_tutorial": {"walltime": 16},
-  "doc.en.thematic_tutorials.sandpile": {"walltime": 16},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_advanced": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_cartesian": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_change": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_curvilinear": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_plane": {"walltime": 16},
-  "doc.ja.tutorial.tour_plotting": {"walltime": 8},
-  "sage.algebras.cluster_algebra": {"walltime": 8},
   "sage.algebras.commutative_dga": {"walltime": 16},
-  "sage.algebras.hecke_algebras.ariki_koike_algebra": {"walltime": 8},
-  "sage.algebras.iwahori_hecke_algebra": {"walltime": 8},
-  "sage.algebras.lie_algebras.classical_lie_algebra": {"walltime": 128},
-  "sage.algebras.lie_algebras.nilpotent_lie_algebra": {"walltime": 16},
-  "sage.algebras.quantum_clifford": {"walltime": 16},
-  "sage.algebras.quantum_groups.fock_space": {"walltime": 8},
-  "sage.algebras.quatalg.quaternion_algebra": {"walltime": 8},
-  "sage.algebras.steenrod.steenrod_algebra": {"walltime": 64},
-  "sage.algebras.steenrod.steenrod_algebra_bases": {"walltime": 8},
-  "sage.algebras.yangian": {"walltime": 8},
-  "sage.arith.misc": {"walltime": 32},
+  "sage.algebras.fusion_rings.f_matrix": {"walltime": 16},
+  "sage.algebras.fusion_rings.fusion_ring": {"walltime": 16},
+  "sage.algebras.hecke_algebras.cubic_hecke_algebra": {"walltime": 8},
+  "sage.algebras.lie_conformal_algebras.n2_lie_conformal_algebra": {"walltime": 8},
+  "sage.algebras.quantum_clifford": {"walltime": 8},
+  "sage.algebras.steenrod.steenrod_algebra": {"walltime": 8},
   "sage.calculus.calculus": {"walltime": 16},
   "sage.calculus.desolvers": {"walltime": 8},
-  "sage.calculus.functional": {"walltime": 8},
-  "sage.calculus.riemann": {"walltime": 64},
-  "sage.calculus.tests": {"walltime": 16},
-  "sage.calculus.transforms.dwt": {"walltime": 16},
+  "sage.calculus.riemann": {"walltime": 8},
   "sage.calculus.transforms.fft": {"walltime": 8},
   "sage.categories.coxeter_groups": {"walltime": 8},
-  "sage.categories.finite_monoids": {"walltime": 16},
-  "sage.categories.lie_conformal_algebras": {"walltime": 8},
+  "sage.categories.finite_monoids": {"walltime": 8},
   "sage.categories.loop_crystals": {"walltime": 8},
-  "sage.categories.pushout": {"walltime": 8},
-  "sage.categories.super_hopf_algebras_with_basis": {"walltime": 32},
-  "sage.categories.super_lie_conformal_algebras": {"walltime": 8},
-  "sage.coding.ag_code": {"walltime": 64},
-  "sage.coding.ag_code_decoders": {"walltime": 128},
-  "sage.coding.binary_code": {"walltime": 8},
-  "sage.coding.linear_code": {"walltime": 16},
-  "sage.combinat.backtrack": {"walltime": 32},
-  "sage.combinat.chas.wqsym": {"walltime": 32},
-  "sage.combinat.cluster_algebra_quiver.cluster_seed": {"walltime": 64},
-  "sage.combinat.cluster_algebra_quiver.quiver": {"walltime": 128},
-  "sage.combinat.crystals.affine_factorization": {"walltime": 16},
-  "sage.combinat.crystals.alcove_path": {"walltime": 32},
-  "sage.combinat.crystals.highest_weight_crystals": {"walltime": 8},
-  "sage.combinat.crystals.kirillov_reshetikhin": {"walltime": 16},
-  "sage.combinat.crystals.letters": {"walltime": 8},
-  "sage.combinat.crystals.littelmann_path": {"walltime": 16},
-  "sage.combinat.crystals.mv_polytopes": {"walltime": 16},
-  "sage.combinat.crystals.pbw_crystal": {"walltime": 16},
-  "sage.combinat.crystals.star_crystal": {"walltime": 8},
-  "sage.combinat.designs.bibd": {"walltime": 8},
-  "sage.combinat.designs.database": {"walltime": 16},
+  "sage.coding.ag_code": {"walltime": 32},
+  "sage.coding.ag_code_decoders": {"walltime": 32},
+  "sage.coding.linear_code": {"walltime": 32},
+  "sage.combinat.designs.database": {"walltime": 8},
   "sage.combinat.designs.difference_family": {"walltime": 8},
-  "sage.combinat.designs.gen_quadrangles_with_spread": {"walltime": 128},
-  "sage.combinat.designs.orthogonal_arrays_build_recursive": {"walltime": 16},
-  "sage.combinat.designs.orthogonal_arrays_find_recursive": {"walltime": 8},
-  "sage.combinat.diagram_algebras": {"walltime": 64},
-  "sage.combinat.fqsym": {"walltime": 32},
-  "sage.combinat.free_prelie_algebra": {"walltime": 8},
-  "sage.combinat.fully_commutative_elements": {"walltime": 8},
-  "sage.combinat.grossman_larson_algebras": {"walltime": 8},
-  "sage.combinat.interval_posets": {"walltime": 8},
+  "sage.combinat.designs.orthogonal_arrays_build_recursive": {"walltime": 8},
   "sage.combinat.k_regular_sequence": {"walltime": 8},
   "sage.combinat.k_tableau": {"walltime": 16},
   "sage.combinat.matrices.hadamard_matrix": {"walltime": 8},
   "sage.combinat.multiset_partition_into_sets_ordered": {"walltime": 8},
-  "sage.combinat.ncsf_qsym.ncsf": {"walltime": 16},
-  "sage.combinat.ncsf_qsym.qsym": {"walltime": 16},
-  "sage.combinat.partition": {"walltime": 16},
-  "sage.combinat.partition_kleshchev": {"walltime": 16},
+  "sage.combinat.ncsf_qsym.ncsf": {"walltime": 8},
+  "sage.combinat.ncsf_qsym.qsym": {"walltime": 8},
+  "sage.combinat.partition": {"walltime": 8},
   "sage.combinat.partition_tuple": {"walltime": 8},
-  "sage.combinat.posets.moebius_algebra": {"walltime": 16},
+  "sage.combinat.permutation": {"walltime": 8},
   "sage.combinat.posets.posets": {"walltime": 8},
-  "sage.combinat.rigged_configurations.kr_tableaux": {"walltime": 32},
-  "sage.combinat.rigged_configurations.rigged_configurations": {"walltime": 16},
-  "sage.combinat.rigged_configurations.tensor_product_kr_tableaux": {"walltime": 16},
+  "sage.combinat.rigged_configurations.kr_tableaux": {"walltime": 8},
   "sage.combinat.root_system.associahedron": {"walltime": 8},
-  "sage.combinat.root_system.branching_rules": {"walltime": 8},
-  "sage.combinat.root_system.fusion_ring": {"walltime": 8},
-  "sage.combinat.root_system.integrable_representations": {"walltime": 16},
-  "sage.combinat.root_system.non_symmetric_macdonald_polynomials": {"walltime": 16},
-  "sage.combinat.root_system.pieri_factors": {"walltime": 8},
-  "sage.combinat.root_system.plot": {"walltime": 32},
-  "sage.combinat.root_system.root_lattice_realization_algebras": {"walltime": 16},
-  "sage.combinat.root_system.root_lattice_realizations": {"walltime": 16},
-  "sage.combinat.root_system.root_system": {"walltime": 8},
-  "sage.combinat.root_system.weyl_group": {"walltime": 8},
-  "sage.combinat.rsk": {"walltime": 32},
-  "sage.combinat.sf.classical": {"walltime": 16},
-  "sage.combinat.sf.jack": {"walltime": 16},
-  "sage.combinat.sf.k_dual": {"walltime": 16},
-  "sage.combinat.sf.llt": {"walltime": 16},
-  "sage.combinat.sf.macdonald": {"walltime": 64},
-  "sage.combinat.sf.new_kschur": {"walltime": 8},
-  "sage.combinat.sf.sfa": {"walltime": 32},
-  "sage.combinat.shifted_primed_tableau": {"walltime": 16},
+  "sage.combinat.root_system.non_symmetric_macdonald_polynomials": {"walltime": 8},
+  "sage.combinat.root_system.plot": {"walltime": 16},
+  "sage.combinat.root_system.root_lattice_realizations": {"walltime": 8},
+  "sage.combinat.rsk": {"walltime": 8},
+  "sage.combinat.sf.k_dual": {"walltime": 8},
+  "sage.combinat.sf.sf": {"walltime": 8},
+  "sage.combinat.sf.sfa": {"walltime": 8},
+  "sage.combinat.shifted_primed_tableau": {"walltime": 8},
   "sage.combinat.skew_tableau": {"walltime": 8},
-  "sage.combinat.symmetric_group_algebra": {"walltime": 16},
-  "sage.combinat.tableau": {"walltime": 32},
-  "sage.combinat.tableau_tuple": {"walltime": 32},
-  "sage.combinat.tiling": {"walltime": 16},
-  "sage.combinat.tutorial": {"walltime": 16},
-  "sage.combinat.words.paths": {"walltime": 64},
-  "sage.crypto.block_cipher.des": {"walltime": 16},
-  "sage.crypto.mq.sr": {"walltime": 64},
-  "sage.crypto.sbox": {"walltime": 16},
+  "sage.combinat.species.generating_series": {"walltime": 8},
+  "sage.combinat.tableau": {"walltime": 8},
+  "sage.combinat.tableau_tuple": {"walltime": 8},
+  "sage.combinat.tiling": {"walltime": 8},
+  "sage.combinat.tutorial": {"walltime": 8},
   "sage.crypto.sboxes": {"walltime": 8},
   "sage.doctest.forker": {"walltime": 16},
-  "sage.doctest.sources": {"walltime": 64},
-  "sage.doctest.test": {"walltime": 128},
-  "sage.dynamics.arithmetic_dynamics.projective_ds": {"walltime": 64},
-  "sage.dynamics.arithmetic_dynamics.wehlerK3": {"walltime": 8},
-  "sage.dynamics.cellular_automata.glca": {"walltime": 8},
+  "sage.dynamics.arithmetic_dynamics.projective_ds": {"walltime": 32},
   "sage.dynamics.cellular_automata.solitons": {"walltime": 8},
-  "sage.dynamics.complex_dynamics.mandel_julia": {"walltime": 16},
   "sage.functions.bessel": {"walltime": 16},
-  "sage.functions.exp_integral": {"walltime": 8},
   "sage.functions.hypergeometric": {"walltime": 8},
+  "sage.functions.orthogonal_polys": {"walltime": 8},
   "sage.functions.other": {"walltime": 16},
   "sage.functions.piecewise": {"walltime": 8},
-  "sage.games.quantumino": {"walltime": 8},
-  "sage.geometry.cone": {"walltime": 32},
-  "sage.geometry.fan": {"walltime": 8},
   "sage.geometry.hyperbolic_space.hyperbolic_geodesic": {"walltime": 8},
-  "sage.geometry.hyperplane_arrangement.arrangement": {"walltime": 16},
-  "sage.geometry.hyperplane_arrangement.library": {"walltime": 8},
+  "sage.geometry.hyperplane_arrangement.arrangement": {"walltime": 8},
   "sage.geometry.hyperplane_arrangement.plot": {"walltime": 8},
-  "sage.geometry.lattice_polytope": {"walltime": 16},
-  "sage.geometry.polyhedral_complex": {"walltime": 8},
-  "sage.geometry.polyhedron.base": {"walltime": 32},
-  "sage.geometry.polyhedron.library": {"walltime": 32},
-  "sage.geometry.polyhedron.plot": {"walltime": 8},
+  "sage.geometry.polyhedron.base": {"walltime": 8},
+  "sage.geometry.polyhedron.base5": {"walltime": 8},
+  "sage.geometry.polyhedron.base6": {"walltime": 16},
+  "sage.geometry.polyhedron.library": {"walltime": 16},
   "sage.geometry.riemannian_manifolds.parametrized_surface3d": {"walltime": 16},
-  "sage.geometry.triangulation.base": {"walltime": 32},
-  "sage.geometry.triangulation.point_configuration": {"walltime": 16},
-  "sage.graphs.chrompoly": {"walltime": 8},
-  "sage.graphs.connectivity": {"walltime": 16},
-  "sage.graphs.generators.basic": {"walltime": 16},
-  "sage.graphs.generators.classical_geometries": {"walltime": 32},
-  "sage.graphs.generators.distance_regular": {"walltime": 256},
-  "sage.graphs.generators.families": {"walltime": 32},
-  "sage.graphs.generators.smallgraphs": {"walltime": 16},
-  "sage.graphs.generic_graph": {"walltime": 32},
-  "sage.graphs.genus": {"walltime": 16},
+  "sage.graphs.connectivity": {"walltime": 8},
+  "sage.graphs.generators.classical_geometries": {"walltime": 8},
+  "sage.graphs.generators.distance_regular": {"walltime": 32},
+  "sage.graphs.generators.smallgraphs": {"walltime": 8},
+  "sage.graphs.generic_graph": {"walltime": 16},
   "sage.graphs.graph": {"walltime": 16},
-  "sage.graphs.graph_generators": {"walltime": 8},
   "sage.graphs.graph_list": {"walltime": 8},
   "sage.graphs.graph_plot": {"walltime": 8},
-  "sage.graphs.strongly_regular_db": {"walltime": 16},
-  "sage.groups.cubic_braid": {"walltime": 16},
-  "sage.groups.fqf_orthogonal": {"walltime": 16},
-  "sage.groups.libgap_mixin": {"walltime": 8},
-  "sage.groups.libgap_morphism": {"walltime": 8},
-  "sage.groups.lie_gps.nilpotent_lie_group": {"walltime": 16},
-  "sage.groups.matrix_gps.finitely_generated": {"walltime": 8},
-  "sage.groups.matrix_gps.heisenberg": {"walltime": 32},
-  "sage.groups.matrix_gps.linear": {"walltime": 8},
-  "sage.groups.perm_gps.cubegroup": {"walltime": 16},
-  "sage.groups.perm_gps.partn_ref.refinement_graphs": {"walltime": 8},
+  "sage.graphs.strongly_regular_db": {"walltime": 8},
+  "sage.groups.cactus_group": {"walltime": 8},
+  "sage.groups.cubic_braid": {"walltime": 8},
+  "sage.groups.lie_gps.nilpotent_lie_group": {"walltime": 8},
+  "sage.groups.matrix_gps.finitely_generated_gap": {"walltime": 8},
   "sage.groups.perm_gps.permgroup": {"walltime": 8},
   "sage.groups.perm_gps.permgroup_named": {"walltime": 8},
-  "sage.homology.hochschild_complex": {"walltime": 8},
   "sage.homology.homology_vector_space_with_basis": {"walltime": 8},
-  "sage.interacts.test_jupyter": {"walltime": 16},
-  "sage.interfaces.ecm": {"walltime": 8},
-  "sage.interfaces.expect": {"walltime": 8},
-  "sage.interfaces.gap": {"walltime": 16},
-  "sage.interfaces.maxima": {"walltime": 8},
-  "sage.interfaces.maxima_abstract": {"walltime": 64},
-  "sage.interfaces.psage": {"walltime": 8},
-  "sage.interfaces.sage0": {"walltime": 8},
-  "sage.lfunctions.zero_sums": {"walltime": 8},
-  "sage.libs.eclib.interface": {"walltime": 16},
+  "sage.interfaces.gap": {"walltime": 8},
+  "sage.interfaces.gap_workspace": {"walltime": 8},
+  "sage.interfaces.sage0": {"walltime": 16},
+  "sage.libs.eclib.interface": {"walltime": 32},
   "sage.libs.eclib.mwrank": {"walltime": 16},
-  "sage.libs.gap.test_long": {"walltime": 32},
-  "sage.libs.giac": {"walltime": 32},
   "sage.manifolds.catalog": {"walltime": 8},
-  "sage.manifolds.chart": {"walltime": 32},
+  "sage.manifolds.chart": {"walltime": 16},
   "sage.manifolds.chart_func": {"walltime": 8},
   "sage.manifolds.continuous_map": {"walltime": 8},
-  "sage.manifolds.differentiable.affine_connection": {"walltime": 128},
+  "sage.manifolds.differentiable.affine_connection": {"walltime": 32},
   "sage.manifolds.differentiable.automorphismfield": {"walltime": 32},
-  "sage.manifolds.differentiable.automorphismfield_group": {"walltime": 8},
   "sage.manifolds.differentiable.bundle_connection": {"walltime": 8},
-  "sage.manifolds.differentiable.characteristic_cohomology_class": {"walltime": 64},
+  "sage.manifolds.differentiable.characteristic_cohomology_class": {"walltime": 8},
   "sage.manifolds.differentiable.curve": {"walltime": 16},
-  "sage.manifolds.differentiable.degenerate": {"walltime": 32},
-  "sage.manifolds.differentiable.degenerate_submanifold": {"walltime": 16},
-  "sage.manifolds.differentiable.diff_form": {"walltime": 64},
+  "sage.manifolds.differentiable.degenerate": {"walltime": 16},
+  "sage.manifolds.differentiable.degenerate_submanifold": {"walltime": 8},
+  "sage.manifolds.differentiable.diff_form": {"walltime": 32},
   "sage.manifolds.differentiable.diff_map": {"walltime": 8},
   "sage.manifolds.differentiable.examples.euclidean": {"walltime": 32},
   "sage.manifolds.differentiable.examples.sphere": {"walltime": 32},
   "sage.manifolds.differentiable.integrated_curve": {"walltime": 32},
-  "sage.manifolds.differentiable.levi_civita_connection": {"walltime": 32},
-  "sage.manifolds.differentiable.manifold": {"walltime": 16},
-  "sage.manifolds.differentiable.manifold_homset": {"walltime": 16},
+  "sage.manifolds.differentiable.levi_civita_connection": {"walltime": 16},
+  "sage.manifolds.differentiable.manifold": {"walltime": 8},
+  "sage.manifolds.differentiable.manifold_homset": {"walltime": 8},
   "sage.manifolds.differentiable.metric": {"walltime": 64},
   "sage.manifolds.differentiable.mixed_form": {"walltime": 16},
-  "sage.manifolds.differentiable.mixed_form_algebra": {"walltime": 8},
   "sage.manifolds.differentiable.multivectorfield": {"walltime": 64},
-  "sage.manifolds.differentiable.pseudo_riemannian": {"walltime": 16},
-  "sage.manifolds.differentiable.pseudo_riemannian_submanifold": {"walltime": 128},
-  "sage.manifolds.differentiable.scalarfield": {"walltime": 16},
+  "sage.manifolds.differentiable.pseudo_riemannian": {"walltime": 8},
+  "sage.manifolds.differentiable.pseudo_riemannian_submanifold": {"walltime": 32},
+  "sage.manifolds.differentiable.scalarfield": {"walltime": 8},
   "sage.manifolds.differentiable.scalarfield_algebra": {"walltime": 8},
-  "sage.manifolds.differentiable.tangent_vector": {"walltime": 16},
+  "sage.manifolds.differentiable.tangent_vector": {"walltime": 8},
   "sage.manifolds.differentiable.tensorfield": {"walltime": 128},
   "sage.manifolds.differentiable.tensorfield_paral": {"walltime": 16},
-  "sage.manifolds.differentiable.vector_bundle": {"walltime": 16},
-  "sage.manifolds.differentiable.vectorfield": {"walltime": 64},
-  "sage.manifolds.differentiable.vectorframe": {"walltime": 8},
+  "sage.manifolds.differentiable.vectorfield": {"walltime": 16},
   "sage.manifolds.point": {"walltime": 16},
   "sage.manifolds.scalarfield": {"walltime": 16},
-  "sage.manifolds.scalarfield_algebra": {"walltime": 8},
-  "sage.manifolds.section": {"walltime": 32},
-  "sage.manifolds.trivialization": {"walltime": 8},
-  "sage.manifolds.vector_bundle": {"walltime": 8},
-  "sage.matrix.benchmark": {"walltime": 8},
+  "sage.manifolds.section": {"walltime": 16},
   "sage.matrix.matrix2": {"walltime": 16},
-  "sage.matrix.matrix_integer_dense": {"walltime": 16},
-  "sage.matrix.matrix_integer_dense_hnf": {"walltime": 32},
-  "sage.matrix.matrix_mod2_dense": {"walltime": 8},
   "sage.matrix.matrix_rational_dense": {"walltime": 8},
   "sage.matrix.special": {"walltime": 8},
-  "sage.matroids.catalog": {"walltime": 64},
   "sage.misc.cachefunc": {"walltime": 16},
-  "sage.misc.cython": {"walltime": 8},
   "sage.misc.functional": {"walltime": 8},
   "sage.misc.randstate": {"walltime": 16},
-  "sage.misc.sagedoc": {"walltime": 64},
-  "sage.misc.sageinspect": {"walltime": 32},
-  "sage.modular.abvar.abvar": {"walltime": 16},
+  "sage.misc.sagedoc": {"walltime": 16},
+  "sage.misc.sageinspect": {"walltime": 16},
+  "sage.misc.trace": {"walltime": 8},
+  "sage.modular.abvar.abvar": {"walltime": 8},
   "sage.modular.abvar.homspace": {"walltime": 8},
-  "sage.modular.abvar.lseries": {"walltime": 8},
-  "sage.modular.arithgroup.arithgroup_perm": {"walltime": 8},
-  "sage.modular.arithgroup.tests": {"walltime": 8},
-  "sage.modular.btquotients.pautomorphicform": {"walltime": 32},
-  "sage.modular.hypergeometric_motive": {"walltime": 16},
-  "sage.modular.local_comp.local_comp": {"walltime": 32},
-  "sage.modular.local_comp.type_space": {"walltime": 16},
-  "sage.modular.modform.ambient_R": {"walltime": 16},
-  "sage.modular.modform.constructor": {"walltime": 8},
-  "sage.modular.modform.cuspidal_submodule": {"walltime": 16},
-  "sage.modular.modform.element": {"walltime": 64},
-  "sage.modular.modform.ring": {"walltime": 64},
-  "sage.modular.modform.space": {"walltime": 8},
+  "sage.modular.btquotients.btquotient": {"walltime": 8},
+  "sage.modular.btquotients.pautomorphicform": {"walltime": 16},
+  "sage.modular.hecke.submodule": {"walltime": 8},
+  "sage.modular.hypergeometric_motive": {"walltime": 8},
+  "sage.modular.local_comp.local_comp": {"walltime": 16},
+  "sage.modular.local_comp.type_space": {"walltime": 8},
+  "sage.modular.modform.element": {"walltime": 32},
   "sage.modular.modform_hecketriangle.abstract_space": {"walltime": 16},
   "sage.modular.modform_hecketriangle.graded_ring_element": {"walltime": 16},
   "sage.modular.modform_hecketriangle.hecke_triangle_group_element": {"walltime": 32},
   "sage.modular.modform_hecketriangle.readme": {"walltime": 16},
-  "sage.modular.modform_hecketriangle.space": {"walltime": 8},
   "sage.modular.modsym.ambient": {"walltime": 16},
   "sage.modular.modsym.space": {"walltime": 8},
-  "sage.modular.pollack_stevens.modsym": {"walltime": 64},
-  "sage.modular.pollack_stevens.padic_lseries": {"walltime": 32},
-  "sage.modules.finite_submodule_iter": {"walltime": 16},
-  "sage.modules.free_module": {"walltime": 16},
-  "sage.modules.free_module_element": {"walltime": 8},
-  "sage.modules.free_module_integer": {"walltime": 32},
-  "sage.modules.free_quadratic_module_integer_symmetric": {"walltime": 8},
-  "sage.modules.torsion_quadratic_module": {"walltime": 16},
+  "sage.modular.overconvergent.genus0": {"walltime": 8},
+  "sage.modular.pollack_stevens.modsym": {"walltime": 8},
+  "sage.modules.fp_graded.morphism": {"walltime": 8},
+  "sage.modules.free_module": {"walltime": 8},
   "sage.parallel.map_reduce": {"walltime": 8},
-  "sage.plot.animate": {"walltime": 16},
-  "sage.plot.arrow": {"walltime": 8},
-  "sage.plot.circle": {"walltime": 8},
-  "sage.plot.complex_plot": {"walltime": 8},
+  "sage.plot.complex_plot": {"walltime": 16},
   "sage.plot.contour_plot": {"walltime": 32},
-  "sage.plot.density_plot": {"walltime": 8},
   "sage.plot.graphics": {"walltime": 32},
   "sage.plot.line": {"walltime": 8},
   "sage.plot.matrix_plot": {"walltime": 16},
@@ -283,115 +154,53 @@
   "sage.plot.plot": {"walltime": 64},
   "sage.plot.plot3d.base": {"walltime": 8},
   "sage.plot.plot3d.implicit_plot3d": {"walltime": 16},
-  "sage.plot.plot3d.implicit_surface": {"walltime": 8},
-  "sage.plot.plot3d.parametric_plot3d": {"walltime": 8},
+  "sage.plot.plot3d.parametric_plot3d": {"walltime": 16},
   "sage.plot.plot3d.parametric_surface": {"walltime": 8},
   "sage.plot.plot3d.plot3d": {"walltime": 16},
-  "sage.plot.plot3d.tachyon": {"walltime": 8},
-  "sage.plot.plot3d.transform": {"walltime": 32},
   "sage.plot.point": {"walltime": 8},
   "sage.plot.polygon": {"walltime": 8},
   "sage.plot.streamline_plot": {"walltime": 8},
-  "sage.quadratic_forms.genera.genus": {"walltime": 16},
-  "sage.quadratic_forms.quadratic_form__automorphisms": {"walltime": 8},
-  "sage.quadratic_forms.quadratic_form__local_representation_conditions": {"walltime": 64},
-  "sage.quadratic_forms.quadratic_form__neighbors": {"walltime": 8},
-  "sage.quadratic_forms.quadratic_form__siegel_product": {"walltime": 8},
   "sage.repl.ipython_extension": {"walltime": 8},
-  "sage.rings.asymptotic.asymptotic_expansion_generators": {"walltime": 64},
+  "sage.rings.asymptotic.asymptotic_expansion_generators": {"walltime": 16},
   "sage.rings.asymptotic.asymptotic_ring": {"walltime": 8},
-  "sage.rings.asymptotic.asymptotics_multivariate_generating_functions": {"walltime": 32},
-  "sage.rings.asymptotic.term_monoid": {"walltime": 8},
-  "sage.rings.continued_fraction": {"walltime": 8},
+  "sage.rings.asymptotic.asymptotics_multivariate_generating_functions": {"walltime": 8},
   "sage.rings.finite_rings.finite_field_base": {"walltime": 8},
-  "sage.rings.function_field.function_field": {"walltime": 128},
-  "sage.rings.function_field.function_field_valuation": {"walltime": 64},
+  "sage.rings.function_field.function_field": {"walltime": 8},
   "sage.rings.function_field.ideal": {"walltime": 8},
-  "sage.rings.function_field.place": {"walltime": 8},
-  "sage.rings.integer": {"walltime": 64},
-  "sage.rings.invariants.invariant_theory": {"walltime": 8},
-  "sage.rings.number_field.bdd_height": {"walltime": 8},
-  "sage.rings.number_field.number_field": {"walltime": 64},
-  "sage.rings.number_field.number_field_element": {"walltime": 16},
-  "sage.rings.number_field.splitting_field": {"walltime": 8},
-  "sage.rings.number_field.totallyreal": {"walltime": 16},
-  "sage.rings.number_field.totallyreal_rel": {"walltime": 8},
-  "sage.rings.padics.padic_base_leaves": {"walltime": 64},
-  "sage.rings.padics.padic_extension_leaves": {"walltime": 64},
-  "sage.rings.padics.padic_generic_element": {"walltime": 16},
-  "sage.rings.padics.padic_lattice_element": {"walltime": 32},
-  "sage.rings.padics.relative_extension_leaves": {"walltime": 32},
+  "sage.rings.lazy_series": {"walltime": 8},
+  "sage.rings.lazy_series_ring": {"walltime": 32},
+  "sage.rings.number_field.number_field": {"walltime": 32},
+  "sage.rings.number_field.number_field_element": {"walltime": 8},
+  "sage.rings.padics.padic_base_leaves": {"walltime": 8},
+  "sage.rings.padics.padic_generic_element": {"walltime": 8},
   "sage.rings.polynomial.multi_polynomial_ideal": {"walltime": 8},
-  "sage.rings.polynomial.multi_polynomial_sequence": {"walltime": 8},
-  "sage.rings.polynomial.ore_function_element": {"walltime": 8},
   "sage.rings.polynomial.polynomial_element": {"walltime": 16},
-  "sage.rings.polynomial.polynomial_rational_flint": {"walltime": 8},
   "sage.rings.qqbar": {"walltime": 16},
-  "sage.rings.tests": {"walltime": 16},
-  "sage.rings.valuation.augmented_valuation": {"walltime": 32},
-  "sage.rings.valuation.mapped_valuation": {"walltime": 64},
-  "sage.rings.valuation.valuation": {"walltime": 8},
-  "sage.sandpiles.sandpile": {"walltime": 16},
+  "sage.sandpiles.sandpile": {"walltime": 8},
   "sage.schemes.curves.affine_curve": {"walltime": 16},
   "sage.schemes.curves.closed_point": {"walltime": 8},
   "sage.schemes.curves.projective_curve": {"walltime": 32},
-  "sage.schemes.cyclic_covers.cycliccover_finite_field": {"walltime": 64},
   "sage.schemes.elliptic_curves.BSD": {"walltime": 8},
   "sage.schemes.elliptic_curves.Qcurves": {"walltime": 8},
-  "sage.schemes.elliptic_curves.constructor": {"walltime": 32},
-  "sage.schemes.elliptic_curves.ell_curve_isogeny": {"walltime": 16},
-  "sage.schemes.elliptic_curves.ell_egros": {"walltime": 32},
-  "sage.schemes.elliptic_curves.ell_finite_field": {"walltime": 8},
+  "sage.schemes.elliptic_curves.ell_curve_isogeny": {"walltime": 8},
   "sage.schemes.elliptic_curves.ell_generic": {"walltime": 8},
-  "sage.schemes.elliptic_curves.ell_modular_symbols": {"walltime": 16},
-  "sage.schemes.elliptic_curves.ell_number_field": {"walltime": 128},
+  "sage.schemes.elliptic_curves.ell_modular_symbols": {"walltime": 8},
   "sage.schemes.elliptic_curves.ell_point": {"walltime": 8},
-  "sage.schemes.elliptic_curves.ell_rational_field": {"walltime": 128},
-  "sage.schemes.elliptic_curves.gal_reps_number_field": {"walltime": 32},
-  "sage.schemes.elliptic_curves.gp_simon": {"walltime": 16},
-  "sage.schemes.elliptic_curves.heegner": {"walltime": 32},
-  "sage.schemes.elliptic_curves.height": {"walltime": 64},
-  "sage.schemes.elliptic_curves.isogeny_class": {"walltime": 32},
-  "sage.schemes.elliptic_curves.isogeny_small_degree": {"walltime": 64},
-  "sage.schemes.elliptic_curves.kraus": {"walltime": 16},
+  "sage.schemes.elliptic_curves.ell_rational_field": {"walltime": 32},
+  "sage.schemes.elliptic_curves.height": {"walltime": 8},
+  "sage.schemes.elliptic_curves.isogeny_small_degree": {"walltime": 16},
   "sage.schemes.elliptic_curves.mod_sym_num": {"walltime": 8},
   "sage.schemes.elliptic_curves.padic_lseries": {"walltime": 8},
-  "sage.schemes.elliptic_curves.padics": {"walltime": 16},
-  "sage.schemes.elliptic_curves.saturation": {"walltime": 16},
-  "sage.schemes.elliptic_curves.sha_tate": {"walltime": 32},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_finite_field": {"walltime": 64},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_generic": {"walltime": 8},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_padic_field": {"walltime": 32},
-  "sage.schemes.hyperelliptic_curves.monsky_washnitzer": {"walltime": 8},
-  "sage.schemes.projective.projective_rational_point": {"walltime": 8},
-  "sage.schemes.riemann_surfaces.riemann_surface": {"walltime": 64},
+  "sage.schemes.elliptic_curves.padics": {"walltime": 8},
+  "sage.schemes.elliptic_curves.sha_tate": {"walltime": 16},
+  "sage.schemes.hyperelliptic_curves.hyperelliptic_padic_field": {"walltime": 16},
+  "sage.schemes.riemann_surfaces.riemann_surface": {"walltime": 32},
   "sage.schemes.toric.chow_group": {"walltime": 8},
-  "sage.schemes.toric.sheaf.klyachko": {"walltime": 8},
-  "sage.stats.distributions.discrete_gaussian_integer": {"walltime": 8},
-  "sage.stats.time_series": {"walltime": 8},
-  "sage.structure.coerce_dict": {"walltime": 32},
   "sage.structure.element": {"walltime": 16},
-  "sage.structure.sage_object": {"walltime": 8},
   "sage.symbolic.expression": {"walltime": 32},
-  "sage.symbolic.integration.integral": {"walltime": 32},
-  "sage.symbolic.random_tests": {"walltime": 32},
+  "sage.symbolic.integration.integral": {"walltime": 16},
   "sage.symbolic.relation": {"walltime": 8},
-  "sage.tests.book_schilling_zabrocki_kschur_primer": {"walltime": 32},
-  "sage.tests.book_stein_ent": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.combinat_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.float_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.graphique_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.graphtheory_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.integration_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.mpoly_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.nonlinear_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.recequadiff_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.graphique_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.numbertheory_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.polynomes_doctest": {"walltime": 16},
-  "sage.tests.cmdline": {"walltime": 64},
-  "sage.tests.gosper-sum": {"walltime": 16},
-  "sage.tests.parigp": {"walltime": 8},
-  "sage.topology.simplicial_complex": {"walltime": 8},
-  "sage.topology.simplicial_complex_examples": {"walltime": 16}
+  "sage.tests.book_schilling_zabrocki_kschur_primer": {"walltime": 16},
+  "sage.tests.book_stein_ent": {"walltime": 8},
+  "sage.topology.simplicial_complex": {"walltime": 16}
 }
diff --git a/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch b/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
deleted file mode 100644
index f2f825e4fb10..000000000000
--- a/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
+++ /dev/null
@@ -1,205 +0,0 @@
-diff --git a/build/pkgs/singular/checksums.ini b/build/pkgs/singular/checksums.ini
-index 2e33a405d36..313463d2fea 100644
---- a/build/pkgs/singular/checksums.ini
-+++ b/build/pkgs/singular/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=singular-VERSION.tar.gz
--sha1=6c2b622d3681e2de3d58d30c654d43d3e32b720c
--md5=abb1e37c794472e7760655358ab66054
--cksum=17455733
-+sha1=28bb3ee97ef48d04dfa96de182fd93eebe08426c
-+md5=fc0a4f5720dadba45a52ee94324ce00c
-+cksum=1573851737
- upstream_url=ftp://jim.mathematik.uni-kl.de/pub/Math/Singular/SOURCES/4-3-1/singular-VERSION.tar.gz
-diff --git a/build/pkgs/singular/package-version.txt b/build/pkgs/singular/package-version.txt
-index 11300c77e7d..66e2bede53a 100644
---- a/build/pkgs/singular/package-version.txt
-+++ b/build/pkgs/singular/package-version.txt
-@@ -1 +1 @@
--4.3.1p1
-+4.3.1p3
-diff --git a/src/sage/libs/singular/decl.pxd b/src/sage/libs/singular/decl.pxd
-index 8e3ac314b67..747a6b1e2fb 100644
---- a/src/sage/libs/singular/decl.pxd
-+++ b/src/sage/libs/singular/decl.pxd
-@@ -574,7 +574,7 @@ cdef extern from "singular/Singular/libsingular.h":
- 
-     # gets a component out of a polynomial vector
- 
--    poly *pTakeOutComp1(poly **, int)
-+    poly *pTakeOutComp(poly **, int)
- 
-     # deep copy p
- 
-diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx
-index d8ea7b07f3c..3a1271cd59f 100644
---- a/src/sage/libs/singular/singular.pyx
-+++ b/src/sage/libs/singular/singular.pyx
-@@ -1726,20 +1726,21 @@ cdef int overflow_check(unsigned long e, ring *_ring) except -1:
- 
-     Whether an overflow occurs or not partially depends
-     on the number of variables in the ring. See trac ticket
--    :trac:`11856`. With Singular 4, it is by default optimized
--    for at least 4 variables on 64-bit and 2 variables on 32-bit,
--    which in both cases makes a maximal default exponent of
--    2^16-1.
-+    :trac:`11856`.
- 
-     EXAMPLES::
- 
-         sage: P.<x,y> = QQ[]
--        sage: y^(2^16-1)
--        y^65535
--        sage: y^2^16
-+        sage: y^(2^30)
-+        Traceback (most recent call last):             # 32-bit
-+        ...                                            # 32-bit
-+        OverflowError: exponent overflow (1073741824)  # 32-bit
-+        y^1073741824  # 64-bit
-+        sage: y^2^32
-         Traceback (most recent call last):
-         ...
--        OverflowError: exponent overflow (65536)
-+        OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+        OverflowError: exponent overflow (4294967296)  # 64-bit
-     """
-     if unlikely(e > _ring.bitmask):
-         raise OverflowError("exponent overflow (%d)"%(e))
-diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py
-index 7dc058a22f0..71494eddbc0 100644
---- a/src/sage/rings/polynomial/multi_polynomial_ideal.py
-+++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py
-@@ -60,7 +60,7 @@
- Note that the result of a computation is not necessarily reduced::
- 
-     sage: (a+b)^17
--    256*a*b^16 + 256*b^17
-+    a*b^16 + b^17
-     sage: S(17) == 0
-     True
- 
-diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-index 4dad016b33f..9bf67dd1425 100644
---- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-+++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-@@ -193,7 +193,7 @@ from sage.libs.singular.decl cimport (
-     p_IsUnit, p_IsOne, p_Series, p_Head, idInit, fast_map_common_subexp, id_Delete,
-     p_IsHomogeneous, p_Homogen, p_Totaldegree,pLDeg1_Totaldegree, singclap_pdivide, singclap_factorize,
-     idLift, IDELEMS, On, Off, SW_USE_CHINREM_GCD, SW_USE_EZGCD,
--    p_LmIsConstant, pTakeOutComp1, singclap_gcd, pp_Mult_qq, p_GetMaxExp,
-+    p_LmIsConstant, pTakeOutComp, singclap_gcd, pp_Mult_qq, p_GetMaxExp,
-     pLength, kNF, p_Neg, p_Minus_mm_Mult_qq, p_Plus_mm_Mult_qq,
-     pDiff, singclap_resultant, p_Normalize,
-     prCopyR, prCopyR_NoSort)
-@@ -1587,7 +1587,8 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_base):
-             9/4
- 
-             sage: P.monomial_quotient(x,y) # Note the wrong result
--            x*y^65535*z^65535
-+            x*y^65535*z^65535      # 32-bit
-+            x*y^1048575*z^1048575  # 64-bit
- 
-             sage: P.monomial_quotient(x,P(1))
-             x
-@@ -2247,10 +2248,11 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             9/4*x^2 - 1/4*y^2 - y - 1
- 
-             sage: P.<x,y> = PolynomialRing(QQ,order='lex')
--            sage: (x^2^15) * x^2^15
-+            sage: (x^2^32) * x^2^32
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (...)
-+            OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+            OverflowError: exponent overflow (...)  # 64-bit
-         """
-         # all currently implemented rings are commutative
-         cdef poly *_p
-@@ -2371,10 +2373,11 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             ValueError: not a 2nd power
- 
-             sage: P.<x,y> = PolynomialRing(QQ,order='lex')
--            sage: (x+y^2^15)^10
-+            sage: (x+y^2^32)^10
-             Traceback (most recent call last):
-             ....
--            OverflowError: exponent overflow (...)
-+            OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+            OverflowError: exponent overflow (...)  # 64-bit
- 
-         Test fractional powers (:trac:`22329`)::
- 
-@@ -3461,7 +3464,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             x^10000
-             no overflow
- 
--            sage: n = 1000
-+            sage: n = 100000
-             sage: try:
-             ....:     f = x^n
-             ....:     f.subs(x = x^n)
-@@ -4567,7 +4570,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
-         l = []
-         for i from 0 <= i < IDELEMS(res):
-             for j from 1 <= j <= IDELEMS(_I):
--                l.append( new_MP(parent, pTakeOutComp1(&res.m[i], j)) )
-+                l.append( new_MP(parent, pTakeOutComp(&res.m[i], 1)) )
- 
-         id_Delete(&fI, r)
-         id_Delete(&_I, r)
-@@ -4635,7 +4638,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
- 
-             sage: f = 3*x
-             sage: f.reduce([2*x,y])
--            3*x
-+            x
- 
-         The reduction is not canonical when ``I`` is not a Groebner
-         basis::
-diff --git a/src/sage/rings/polynomial/plural.pyx b/src/sage/rings/polynomial/plural.pyx
-index 1c9f35e56ba..587511c3888 100644
---- a/src/sage/rings/polynomial/plural.pyx
-+++ b/src/sage/rings/polynomial/plural.pyx
-@@ -1619,10 +1619,10 @@ cdef class NCPolynomial_plural(RingElement):
-             sage: P = A.g_algebra(relations={y*x:-x*y + z},  order='lex')
-             sage: P.inject_variables()
-             Defining x, z, y
--            sage: (x^2^15) * x^2^15
-+            sage: (x^2^31) * x^2^31
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (65536)
-+            OverflowError: exponent overflow (2147483648)
-         """
-         # all currently implemented rings are commutative
-         cdef poly *_p
-@@ -1689,10 +1689,10 @@ cdef class NCPolynomial_plural(RingElement):
-             sage: P = A.g_algebra(relations={y*x:-x*y + z},  order='lex')
-             sage: P.inject_variables()
-             Defining x, z, y
--            sage: (x+y^2^15)^10
-+            sage: (x+y^2^31)^10
-             Traceback (most recent call last):
-             ....
--            OverflowError: exponent overflow (327680)
-+            OverflowError: exponent overflow (2147483648)
-         """
-         if type(exp) is not Integer:
-             try:
-diff --git a/src/sage/structure/element.pyx b/src/sage/structure/element.pyx
-index b5d83ef71b6..5c45b3fb528 100644
---- a/src/sage/structure/element.pyx
-+++ b/src/sage/structure/element.pyx
-@@ -2705,10 +2705,10 @@ cdef class RingElement(ModuleElement):
-         with Singular 4::
- 
-             sage: K.<x,y> = ZZ[]
--            sage: (x^12345)^54321
-+            sage: (x^123456)^654321
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (670592745)
-+            OverflowError: exponent overflow (...)
-         """
-         return arith_generic_power(self, n)
- 
diff --git a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch b/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
deleted file mode 100644
index ee0f0e656b28..000000000000
--- a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py
-index d5f7157217f..8ca1f958039 100644
---- a/src/sage/rings/number_field/number_field_ideal.py
-+++ b/src/sage/rings/number_field/number_field_ideal.py
-@@ -996,16 +996,38 @@ def is_prime(self):
-             False
-             sage: K.ideal(17).is_prime()  # ramified
-             False
-+
-+        TESTS:
-+
-+        Check that we do not factor the norm of the ideal, this used
-+        to take half an hour, see :trac:`33360`::
-+
-+            sage: K.<a,b,c> = NumberField([x^2-2,x^2-3,x^2-5])
-+            sage: t = (((-2611940*c + 1925290/7653)*b - 1537130/7653*c
-+            ....:       + 10130950)*a + (1343014/7653*c - 8349770)*b
-+            ....:       + 6477058*c - 2801449990/4002519)
-+            sage: t.is_prime()
-+            False
-         """
-         try:
-             return self._pari_prime is not None
-         except AttributeError:
--            F = self.factor()  # factorization with caching
--            if len(F) != 1 or F[0][1] != 1:
--                self._pari_prime = None
--            else:
--                self._pari_prime = F[0][0]._pari_prime
--            return self._pari_prime is not None
-+            pass
-+
-+        K = self.number_field().pari_nf()
-+        I = self.pari_hnf()
-+
-+        candidate = K.idealismaximal(I) or None
-+
-+        # PARI uses probabilistic primality testing inside idealismaximal().
-+        if get_flag(None, 'arithmetic'):
-+            # proof required, check using isprime()
-+            if candidate and not candidate[0].isprime():
-+                candidate = None
-+
-+        self._pari_prime = candidate
-+
-+        return self._pari_prime is not None
- 
-     def pari_prime(self):
-         r"""
diff --git a/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch b/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
deleted file mode 100644
index 91f06fd4d173..000000000000
--- a/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-diff --git a/src/sage/misc/persist.pyx b/src/sage/misc/persist.pyx
-index 3ac5f1cc2b0..cb1f327c199 100644
---- a/src/sage/misc/persist.pyx
-+++ b/src/sage/misc/persist.pyx
-@@ -157,7 +157,7 @@ def load(*filename, compress=True, verbose=True, **kwargs):
-         ....:     _ = f.write(code)
-         sage: load(t)
-         sage: hello
--        <fortran object>
-+        <fortran ...>
-     """
-     import sage.repl.load
-     if len(filename) != 1:
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index 6f0aeab87ae..b77c69b2f77 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -461,6 +461,8 @@ def complex_to_rgb(z_values, contoured=False, tiled=False,
-             rgb[i, j, 2] = b
- 
-     sig_off()
-+    nan_indices = np.isnan(rgb).any(-1)     # Mask for undefined points
-+    rgb[nan_indices] = 1                    # Make nan_indices white
-     return rgb
- 
- 
-diff --git a/src/sage/plot/histogram.py b/src/sage/plot/histogram.py
-index 3bc2b76b58e..388c2d1391d 100644
---- a/src/sage/plot/histogram.py
-+++ b/src/sage/plot/histogram.py
-@@ -87,13 +87,8 @@ def get_minmax_data(self):
- 
-         TESTS::
- 
--            sage: h = histogram([10,3,5], normed=True)[0]
--            doctest:warning...:
--            DeprecationWarning: the 'normed' option is deprecated. Use 'density' instead.
--            See https://trac.sagemath.org/25260 for details.
-+            sage: h = histogram([10,3,5], density=True)[0]
-             sage: h.get_minmax_data()
--            doctest:warning ...
--            ...VisibleDeprecationWarning: Passing `normed=True` on non-uniform bins has always been broken, and computes neither the probability density function nor the probability mass function. The result is only correct if the bins are uniform, when density=True will produce the same result anyway. The argument will be removed in a future version of numpy.
-             {'xmax': 10.0, 'xmin': 3.0, 'ymax': 0.476190476190..., 'ymin': 0}
-         """
-         import numpy
-diff --git a/src/sage/repl/ipython_extension.py b/src/sage/repl/ipython_extension.py
-index 798671aab42..cad6a47ca8b 100644
---- a/src/sage/repl/ipython_extension.py
-+++ b/src/sage/repl/ipython_extension.py
-@@ -405,7 +405,7 @@ def fortran(self, line, cell):
-             ....: C END FILE FIB1.F
-             ....: ''')
-             sage: fib
--            <fortran object>
-+            <fortran ...>
-             sage: from numpy import array
-             sage: a = array(range(10), dtype=float)
-             sage: fib(a, 10)
diff --git a/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch b/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
deleted file mode 100644
index 2769e87f6a4b..000000000000
--- a/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-diff --git a/src/sage/interfaces/tachyon.py b/src/sage/interfaces/tachyon.py
-index 23671e50892..ce1d50f71bc 100644
---- a/src/sage/interfaces/tachyon.py
-+++ b/src/sage/interfaces/tachyon.py
-@@ -683,12 +683,14 @@
- #*****************************************************************************
- 
- import os
-+import re
- 
- from sage.cpython.string import bytes_to_str
- from sage.misc.pager import pager
- from sage.misc.superseded import deprecation
- from sage.misc.temporary_file import tmp_filename
- from sage.structure.sage_object import SageObject
-+from sage.misc.cachefunc import cached_method
- 
- 
- class TachyonRT(SageObject):
-@@ -799,6 +801,11 @@ def __call__(self, model, outfile='sage.png', verbose=1, extra_opts=''):
-             Parser failed due to an input file syntax error.
-             Aborting render.
-         """
-+        if self.version() >= '0.99.2':
-+            # this keyword was changed in 0.99.2
-+            model = model.replace(
-+                    "              focallength ",
-+                    "              focaldist ")
-         modelfile = tmp_filename(ext='.dat')
-         with open(modelfile, 'w') as file:
-             file.write(model)
-@@ -851,6 +858,25 @@ def usage(self, use_pager=True):
-         else:
-             print(r)
- 
-+    @cached_method
-+    def version(self):
-+        """
-+        Returns the version of the Tachyon raytracer being used.
-+
-+        TESTS::
-+
-+            sage: tachyon_rt.version()  # random
-+            0.98.9
-+            sage: tachyon_rt.version() >= '0.98.9'
-+            True
-+        """
-+        with os.popen('tachyon') as f:
-+            r = f.readline()
-+        res = re.search(r"Version ([\d.]*)", r)
-+        # debian patches tachyon so it won't report the version
-+        # we hardcode '0.99' since that's indeed the version they ship
-+        return res[1] if res else '0.99'
-+
-     def help(self, use_pager=True):
-         """
-         Deprecated: type 'sage.interfaces.tachyon?' for help
diff --git a/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch b/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
deleted file mode 100644
index 11eb20d4f735..000000000000
--- a/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff --git a/src/sage/arith/long.pxd b/src/sage/arith/long.pxd
-index 1c9a53387a0..d96b98f247c 100644
---- a/src/sage/arith/long.pxd
-+++ b/src/sage/arith/long.pxd
-@@ -270,6 +270,17 @@ cdef inline bint integer_check_long_py(x, long* value, int* err):
-         sage: L += [-x for x in L] + [0, long_min()]
-         sage: for v in L:
-         ....:     assert check_long_py(int(v)) == v
-+        sage: check_long_py(int(2^60))
-+        1152921504606846976                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^61))
-+        2305843009213693952                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^62))
-+        4611686018427387904                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^63))
-+        'Overflow (...)'
-         sage: check_long_py(int(2^100))
-         'Overflow (...)'
-         sage: check_long_py(int(long_max() + 1))
-@@ -309,7 +320,12 @@ cdef inline bint integer_check_long_py(x, long* value, int* err):
- 
-     cdef long lead
-     cdef long lead_2_overflow = (<long>1) << (BITS_IN_LONG - PyLong_SHIFT)
--    cdef long lead_3_overflow = (<long>1) << (BITS_IN_LONG - 2 * PyLong_SHIFT)
-+    cdef long lead_3_overflow
-+    if BITS_IN_LONG < 2 * PyLong_SHIFT:
-+        # in this case 3 digit is always overflow
-+        lead_3_overflow = 0
-+    else:
-+        lead_3_overflow = (<long>1) << (BITS_IN_LONG - 2 * PyLong_SHIFT)
-     if size == 0:
-         value[0] = 0
-         err[0] = 0
diff --git a/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch b/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
deleted file mode 100644
index c4d7d5c779d1..000000000000
--- a/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/src/sage/schemes/toric/sheaf/klyachko.py b/src/sage/schemes/toric/sheaf/klyachko.py
-index b1304a16913..77fae4b7545 100644
---- a/src/sage/schemes/toric/sheaf/klyachko.py
-+++ b/src/sage/schemes/toric/sheaf/klyachko.py
-@@ -26,7 +26,7 @@
-     (0, 0, 18, 16, 1)
-     sage: Gtilde = G_sum.random_deformation()
-     sage: V = Gtilde.wedge(2) * K                     # long time
--    sage: V.cohomology(dim=True, weight=(0,0,0,0))    # long time
-+    sage: V.cohomology(dim=True, weight=(0,0,0,0))    # long time  # random failure (see #32773)
-     (0, 0, 3, 0, 0)
- 
- REFERENCES:
-@@ -948,7 +948,7 @@ def random_deformation(self, epsilon=None):
-            sage: V.cohomology(dim=True, weight=(0,))
-            (1, 0)
-            sage: Vtilde = V.random_deformation()
--           sage: Vtilde.cohomology(dim=True, weight=(0,))
-+           sage: Vtilde.cohomology(dim=True, weight=(0,))  # random failure (see #32773)
-            (1, 0)
-         """
-         filt = self._filt.random_deformation(epsilon)
diff --git a/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch b/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
deleted file mode 100644
index d9a9835c696b..000000000000
--- a/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 9ac7840134054155545e24fa3e66402d42b91c0f Mon Sep 17 00:00:00 2001
-From: Antonio Rojas <arojas@archlinux.org>
-Date: Fri, 20 Jan 2023 21:36:27 +0100
-Subject: [PATCH] Fix tests with giac 1.9.0.35
-
----
- src/sage/libs/giac/giac.pyx   |  3 +--
- src/sage/symbolic/relation.py | 15 +++++----------
- 2 files changed, 6 insertions(+), 12 deletions(-)
-
-diff --git a/src/sage/libs/giac/giac.pyx b/src/sage/libs/giac/giac.pyx
-index 4e451dba5e7..ccad5169836 100644
---- a/src/sage/libs/giac/giac.pyx
-+++ b/src/sage/libs/giac/giac.pyx
-@@ -374,8 +374,7 @@ def _giac(s):
- 
-         sage: x = libgiac('x')
-         sage: (1+2*sin(3*x)).solve(x).simplify()
--        Warning, argument is not an equation, solving 1+2*sin(3*x)=0
--        list[-pi/18,7*pi/18]
-+        ...list[-pi/18,7*pi/18]
- 
-         sage: libgiac.solve('sin(3*x)>2*sin(x)',x)
-         Traceback (most recent call last):
-diff --git a/src/sage/symbolic/relation.py b/src/sage/symbolic/relation.py
-index e9dbc0fea30..b8896a94be9 100644
---- a/src/sage/symbolic/relation.py
-+++ b/src/sage/symbolic/relation.py
-@@ -935,8 +935,7 @@ def solve(f, *args, **kwds):
- 
-         sage: f = (sin(x) - 8*cos(x)*sin(x))*(sin(x)^2 + cos(x)) - (2*cos(x)*sin(x) - sin(x))*(-2*sin(x)^2 + 2*cos(x)^2 - cos(x))
-         sage: solve(f, x, algorithm='giac')
--        ...
--        [-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-+        ...[-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
- 
-         sage: x, y = SR.var('x,y')
-         sage: solve([x+y-4,x*y-3],[x,y],algorithm='giac')
-@@ -1440,19 +1439,15 @@ def _giac_solver(f, x, solution_dict=False):
-     EXAMPLES::
- 
-         sage: solve([(2/3)^x-2], [x], algorithm='giac')
--        ...
--        [[-log(2)/(log(3) - log(2))]]
-+        ...[[-log(2)/(log(3) - log(2))]]
-         sage: solve([(2/3)^x-2], [x], algorithm='giac', solution_dict=True)
--        ...
--        [{x: -log(2)/(log(3) - log(2))}]
-+        ...[{x: -log(2)/(log(3) - log(2))}]
- 
-         sage: f = (sin(x) - 8*cos(x)*sin(x))*(sin(x)^2 + cos(x)) - (2*cos(x)*sin(x) - sin(x))*(-2*sin(x)^2 + 2*cos(x)^2 - cos(x))
-         sage: solve(f, x, algorithm='giac')
--        ...
--        [-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-+        ...[-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-         sage: solve(f, x, algorithm='giac', solution_dict=True)
--        ...
--        [{x: -2*arctan(sqrt(2))}, {x: 0}, {x: 2*arctan(sqrt(2))}, {x: pi}]
-+        ...[{x: -2*arctan(sqrt(2))}, {x: 0}, {x: 2*arctan(sqrt(2))}, {x: pi}]
- 
-         sage: x, y = SR.var('x,y')
-         sage: solve([x+y-7,x*y-10],[x,y],algorithm='giac')
diff --git a/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch b/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
deleted file mode 100644
index 499e0c71e256..000000000000
--- a/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
+++ /dev/null
@@ -1,1303 +0,0 @@
-diff --git a/build/pkgs/gap/checksums.ini b/build/pkgs/gap/checksums.ini
-index 066e943308a..b0ea8ba8818 100644
---- a/build/pkgs/gap/checksums.ini
-+++ b/build/pkgs/gap/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=gap-VERSION.tar.gz
--sha1=4ecdd281b8f430282fb9b12690b06e0a26abde10
--md5=85dc9e459d5b6c66fcad9f468afd3e3e
--cksum=1351843158
-+sha1=a6e36f3f874a2c46f51561402634497eab705cca
-+md5=c5cd9f272f2703d7a3649ad7193b2d90
-+cksum=2760477284
- upstream_url=https://github.com/gap-system/gap/releases/download/vVERSION/gap-VERSION.tar.gz
-diff --git a/build/pkgs/gap/package-version.txt b/build/pkgs/gap/package-version.txt
-index d782fca8f64..f1cd7de1de5 100644
---- a/build/pkgs/gap/package-version.txt
-+++ b/build/pkgs/gap/package-version.txt
-@@ -1 +1 @@
--4.11.1
-+4.12.2
-diff --git a/build/pkgs/gap/spkg-check.in b/build/pkgs/gap/spkg-check.in
-index d9791d33293..d2fccda6e04 100644
---- a/build/pkgs/gap/spkg-check.in
-+++ b/build/pkgs/gap/spkg-check.in
-@@ -3,6 +3,13 @@ cd src
- # #28728: Fix test failure in tst/testinstall/strings.tst
- export LC_CTYPE=en_US.UTF-8
- 
-+# #34391: in GAP 4.12 some packages need GAP package io
-+#         to let tests run, otherwise this hangs. Thus we install io here.
-+cd pkg/io
-+./configure --with-gaproot=../..
-+make
-+cd ../..
-+
- make testinstall
- if [[ $? -ne 0 ]]; then
-     exit 1
-diff --git a/build/pkgs/gap/spkg-install.in b/build/pkgs/gap/spkg-install.in
-index 2ceadf99db4..e2c8b4dca54 100644
---- a/build/pkgs/gap/spkg-install.in
-+++ b/build/pkgs/gap/spkg-install.in
-@@ -8,8 +8,7 @@ export CFLAGS=$CFLAGS_NON_NATIVE
- export CXXFLAGS=$CXXFLAGS_NON_NATIVE
- 
- GAP_BUILD_ROOT="$(pwd)"
--GAP_ROOT="$SAGE_LOCAL/share/gap"
--DESTDIR_GAP_ROOT="$SAGE_DESTDIR$GAP_ROOT"
-+GAP_ROOT="$SAGE_LOCAL/lib/gap"
- 
- # Enable debug info if requested.
- # Note that -g3 allows you to use preprocessor macros in gdb which are widely used
-@@ -17,37 +16,17 @@ if [ "$SAGE_DEBUG" = yes ] ; then
-     export CFLAGS="-O0 -g3 -DDEBUG_MASTERPOINTERS -DDEBUG_GLOBAL_BAGS -DDEBUG_FUNCTIONS_BAGS $CFLAGS"
- fi
- 
--sdh_configure $SAGE_CONFIGURE_GMP
--sdh_make -j1
-+# LDFLAGS hack below needed by Semigroups package
-+sdh_configure $SAGE_CONFIGURE_GMP LDFLAGS="-pthread" --prefix=$SAGE_LOCAL
-+sdh_make
- 
--# GAP's "make install" is work in progress; we use bits and pieces of it
--# but we install many things manually.
--sdh_make install-headers install-libgap
--
--# Install config.h, which is not currently handled by `make install-headers`
--sdh_install gen/config.h "$SAGE_LOCAL/include/gap"
--
--# Now install the gap executable as "gap-bin"; it will be called normally
--# through our wrapper script that sets the appropriate GAP_ROOT
--SAGE_BIN="$SAGE_LOCAL/bin"
--mkdir -p "$SAGE_DESTDIR$SAGE_BIN" || sdh_die "Failed to create the directory $SAGE_BIN"
--
--./libtool --mode=install install gap "$SAGE_DESTDIR$SAGE_BIN/gap-bin" || \
--    sdh_die "Failed to install gap-bin to $SAGE_BIN"
--
--./libtool --mode=install install gac "$SAGE_DESTDIR$SAGE_BIN/gac" || \
--    sdh_die "Failed to install gac to $SAGE_BIN"
--
--# Now copy additional files GAP needs to run (and a few optional bits) into
--# GAP_ROOT; we don't need everything from the source tree
--sdh_install bin doc gen grp lib src tst sysinfo.gap "$GAP_ROOT"
--
--# GAP's copy of libtool is also used by the toolchain for build GAP packages
--# (i.e. by gac)
--sdh_install libtool "$GAP_ROOT"
-+sdh_make_install
-+# sdh_make install-headers install-libgap
-+# The 'packagemanager' package expects this https://github.com/gap-packages/PackageManager/issues/105
-+mkdir -p "$SAGE_LOCAL/lib/gap/bin"
- 
- # Install only the minimal packages GAP needs to run
--sdh_install pkg/GAPDoc-* pkg/primgrp-* pkg/SmallGrp-* pkg/transgrp "$GAP_ROOT"/pkg
-+sdh_install pkg/gapdoc pkg/primgrp pkg/smallgrp pkg/transgrp "$GAP_ROOT"/pkg
- 
- # Install additional packages that are not strictly required, but that are
- # typically "expected" to be loaded: These are the default packages that are
-@@ -58,50 +37,25 @@ sdh_install pkg/GAPDoc-* pkg/primgrp-* pkg/SmallGrp-* pkg/transgrp "$GAP_ROOT"/p
- # Also include atlasrep which is a dependency of tomlib
- sdh_install \
-     pkg/atlasrep \
--    pkg/autpgrp-* \
--    pkg/alnuth-* \
--    pkg/crisp-* \
--    pkg/ctbllib-* \
--    pkg/FactInt-* \
-+    pkg/autodoc \
-+    pkg/autpgrp \
-+    pkg/alnuth \
-+    pkg/crisp \
-+    pkg/ctbllib \
-+    pkg/factint \
-     pkg/fga \
--    pkg/irredsol-* \
--    pkg/laguna-* \
--    pkg/PackageManager-* \
--    pkg/polenta-* \
--    pkg/polycyclic-* \
--    pkg/resclasses-* \
--    pkg/sophus-* \
--    pkg/tomlib-* \
-+    pkg/irredsol \
-+    pkg/laguna \
-+    pkg/packagemanager \
-+    pkg/polenta \
-+    pkg/polycyclic \
-+    pkg/radiroot \
-+    pkg/resclasses \
-+    pkg/sophus \
-+    pkg/tomlib \
-+    pkg/utils \
-     "$GAP_ROOT"/pkg
- 
--# Install the GAP startup script; ensure it is executable
--sdh_install -T ../gap "$SAGE_BIN/gap"
--chmod +x "$SAGE_DESTDIR$SAGE_BIN/gap"
--
--# Create symlinks under $GAP_ROOT for these executables, as they are expected
--# (especially when building kernel packages) to exist
--ln -sf "../../bin/gap-bin" "$DESTDIR_GAP_ROOT/gap"
--ln -sf "../../bin/gac" "$DESTDIR_GAP_ROOT/gac"
--
--# Fix the $GAP_ROOT/bin/<arch>/src symlink to be relative (otherwise it links
--# to the actual path of the sources GAP was compiled from)
--for srclink in "$DESTDIR_GAP_ROOT"/bin/*/src; do
--    rm -f "$srclink"
--    ln -s "../../src" "$srclink"
--done
--
--# Additional fixups for some files after they have been copied into their
--# destination directory.  gac and sysinfo.gap are generated files that contain
--# in them hard-coded references to the GAP build directory, which will soon
--# be going away.  This breaks the build toolchain for some compiled GAP
--# packages.  We need to replace these paths with the final GAP_ROOT path.  The
--# below will work so long as neither of these paths contain '|', and if they do
--# then god help you.  https://trac.sagemath.org/ticket/27218
--sed -i -e "s|$GAP_BUILD_ROOT|$GAP_ROOT|g" \
--    "$SAGE_DESTDIR$SAGE_BIN/gac" "$DESTDIR_GAP_ROOT/sysinfo.gap" \
--    "$DESTDIR_GAP_ROOT/bin/gap.sh" "$DESTDIR_GAP_ROOT/doc/make_doc" || \
--    sdh_die "Failed to fix up hard-coded paths in GAP build tools."
--
- # TODO: This seems unnecessary--we are already installing all of doc/ to
- # GAP_ROOT, which is necessary for some functionality in GAP to work.  Do
- # we need this?  Maybe doc/gap could just be a symlink to gap/doc??
-diff --git a/build/pkgs/gap/spkg-legacy-uninstall b/build/pkgs/gap/spkg-legacy-uninstall
-index d17eb939eb7..a8e5c59e1fb 100755
---- a/build/pkgs/gap/spkg-legacy-uninstall
-+++ b/build/pkgs/gap/spkg-legacy-uninstall
-@@ -4,6 +4,8 @@ rm -rf "$SAGE_LOCAL/gap/gap-4."*
- rm -rf "$SAGE_SHARE/gap"
- rm -f "$SAGE_LOCAL/gap/latest"
- rm -f "$SAGE_LOCAL/bin/gap"
-+rm -f "$SAGE_LOCAL/bin/gac"
- 
--# Remove old libgap headers
-+# Remove old libgap headers and library
- rm -rf "$SAGE_LOCAL/include/gap"
-+rm -rf "$SAGE_LOCAL/lib/gap"
-diff --git a/build/pkgs/gap/spkg-prerm.in b/build/pkgs/gap/spkg-prerm.in
-deleted file mode 100644
-index 661d92621fa..00000000000
---- a/build/pkgs/gap/spkg-prerm.in
-+++ /dev/null
-@@ -1,6 +0,0 @@
--# These generated files are placed in directory provided by the SPKG, so
--# delete the generated files first so that their parent directories can be
--# removed during installation
--GAP_ROOT="$SAGE_LOCAL/share/gap"
--rm -f "$GAP_ROOT/pkg/atlasrep/datagens/"*.*
--rm -f "$GAP_ROOT/pkg/atlasrep/dataword/"*.*
-diff --git a/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch b/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch
-deleted file mode 100644
-index e45fe7d9c6f..00000000000
---- a/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch
-+++ /dev/null
-@@ -1,150 +0,0 @@
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c b/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--index 3bbdc45..7df699f 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--@@ -8,9 +8,8 @@ extern short sp[],**mat[],*psp[],**imcos[],**cpco[],lorb[],
-- short *cst,**cpst,***cdpst,**svptr,*cp,*rel;
-- short *spst,**pspst,**pptr,**cpptr,npt,nb,nph,nph2,npg,npg2,
--       rno,orno,coh_index,*invg;
---FILE  *ip,*op;
-- 
---void seeknln (void) { while (getc(ip)!='\n'); }
--+void seeknln (FILE *ip) { while (getc(ip)!='\n'); }
-- 
-- /* This program differs from most other permutation programs in that perms are
--    all stored in the single array sp. Schreier vectors are stored in the short
--@@ -23,13 +22,14 @@ void seeknln (void) { while (getc(ip)!='\n'); }
-- int 
-- crprog1 (void)
-- { short *pc,*qc,ex,neg; int x;
--+  FILE  *ip,*op;
--   short i,j,k,l,m,n,cl,rl,*p,ocl,im,pt,pt1,pn,ipt;
--   if ((ip=fopen(inf2,"r"))== 0)
--   { fprintf(stderr,"Cannot open %s.\n",inf2); return(-1);}
--   fscanf(ip,"%hd%hd%hd%hd",&npt,&nph,&nb,&k);
--   if (nb>=mb) {fprintf(stderr,"nb too big. Increase MB.\n"); return(-1);}
--   if (k<=2) {fprintf(stderr,"inf2 has illegal format.\n"); return(-1); }
---  seeknln(); seeknln();
--+  seeknln(ip); seeknln(ip);
--   for (i=1;i<=nb;i++) fscanf(ip,"%hd",lorb+i);
--   pptr=psp-1; pspst=psp+nph; svptr=cpsp-1;  cpst=cpsp+nb;
--   invg=sp; nph2=2*nph; spst=sp+nph2;
--@@ -37,7 +37,7 @@ crprog1 (void)
--   { pptr[i]=spst+(i-1)*npt-1; p=pptr[i];
--     for (j=1;j<=npt;j++) {fscanf(ip,"%hd",&k); p[k]=j; }
--     invg[2*i-2]=2*i-1; invg[2*i-1]=2*i-2;
---    seeknln();
--+    seeknln(ip);
--   }
--   spst+=(npt*nph);
--   for (i=1;i<=nb;i++)
--@@ -75,7 +75,7 @@ crprog1 (void)
--   strcpy(inf1,inf0); strcat(inf1,".rel");
--   if ((ip=fopen(inf1,"r"))==0)
--   { fprintf(stderr,"Cannot open %s.\n",inf1); return(-1);}
---  fscanf(ip,"%hd%hd",&k,&rno); seeknln();
--+  fscanf(ip,"%hd%hd",&k,&rno); seeknln(ip);
--   op=fopen(outft,"w");
-- /* Now we have read everything in, and the computation can start */
--   orno=0;
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--index a7396b2..658496f 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--@@ -20,8 +20,6 @@ short  mexp=MEXP,mcl=MCL,no,rel[RSP],wt[MEXP],exp,*rpf,*rpb,
-- extern short  prime,dim,*spv,**spm,mspace[],*vec[],**mat[],cp[],pinv[],opmats,
--         mm,mv;
-- extern int msp;
---FILE *ip,*op;
---
-- 
-- int 
-- calcmats (void)
--@@ -59,7 +57,7 @@ calcmats (void)
--   }
--   for (i=1;i<=exp;i++) trans(mat[i+exp],mat[i]);
--   if (opmats)
---  { op=fopen(outf,"w");
--+  { FILE *op=fopen(outf,"w");
--     fprintf(op,"%4d%4d%4d\n",prime,dim,exp);
--     for (i=1;i<=exp;i++) printmat(mat[i]); 
--     fclose(op);
--@@ -71,6 +69,7 @@ int
-- rdmats (void)
-- /* reads matrices of generators of P */
-- { short i; int quot;
--+  FILE *ip;
--   ip=fopen(inf4,"r");
--   if (ip==0)
--   { fprintf(stderr,"Cannot open %s\n ",inf4); return(-1); }
--@@ -90,12 +89,12 @@ rdmats (void)
--   fclose(ip);
--   return(0);
-- }
---FILE *ip;
-- 
-- int 
-- ingp (int inp)
-- /* Read in output of respcrun -s */
-- { short i,j,k,l,m,*orpf,**pcp;
--+  FILE *ip;
--   ip=fopen(inf3,"r");
--   if (ip==0) { fprintf(stderr,"Cannot open %s\n",inf3); return(-1); }
--   fscanf(ip,"%hd%hd%hd%hd%hd%hd",&prime,&exp,&i,&no,&j,&m);
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--index 0896551..6841bc8 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--@@ -9,7 +9,6 @@ extern short  intexp,mexp,mng,wksp,
--        spugen[],*tlintg[];
-- extern int ptrsp,rsp;
-- short  fac;
---FILE *ip,*op;
-- 
-- int 
-- ingp (void)
--@@ -18,6 +17,7 @@ ingp (void)
--    of nqrun, and tails are also read in.
-- */
-- { short i,j,k,l,m,x,y,no,*orpf,*orpb,**pcp;  char tails;
--+  FILE *ip;
--   if ((ip=fopen(inf1,"r"))==0)
--   { fprintf(stderr,"Cannot open %s.\n",inf1); return(-1); }
--   fscanf(ip,"%hd%hd%hd%hd%hd%hd",&prime,&exp,&nng,&no,&class,&m);
--@@ -89,6 +89,7 @@ int
-- outgp (void)
-- /* The PCP is output, together with tails */
-- { short i,k,l,**pcp,*b,*e,*c;
--+  FILE *op;
--   op=fopen(outf,"w");
--   fprintf(op,"%4d%4d%4d%4d%4d%4d\n",prime,exp,nng,exp,class,1);
--   for (i=1;i<=exp;i++) fprintf(op,"%4d",wt[i]); fprintf(op,"\n");
--@@ -379,7 +380,7 @@ restart:
--     nng--; mnng--; enexpnt--;
--     if (nng==0)
--     { if (gap)
---      { op=fopen(outfm,"w"); fprintf(op,"COHOMOLO.Multiplier:=[];\n");
--+      { FILE *op=fopen(outfm,"w"); fprintf(op,"COHOMOLO.Multiplier:=[];\n");
--         fclose(op);
--         printf("All new generators eliminated. Multiplier is trivial.\n");
--       }
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--index 01cf914..0144883 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--@@ -9,7 +9,6 @@ extern short  intexp,mng,mexp,wksp,
--        spugen[],*intg[],*imintg[],*tlintg[];
-- extern int ptrsp,rsp;
-- short  *wf,*wc; char norm;
---FILE *ip,*op;
-- 
-- /* The data structures for this program and for nqrun are similar.
--    d1 and d2 contain definitions of generators. (Def. comes from commutator
--@@ -35,6 +34,7 @@ nqmprog (void)
-- { short i,j,k,l,m,d,*gi,*gj,*ti,*tj,cl,def,*ps,*pf,**dp,*nrpb,*p,*orpf,*orpb,
--         nb,np,k1,*rno,*covrel,**pgen,tdef,sgn;
--   char nt;
--+  FILE *ip,*op;
--   if (ingp() == -1) {fprintf(stderr,"Input error.\n"); return(-1); }
--   eexpnt=expnt+exp; enexpnt=nexpnt+nng;
-- 
-diff --git a/build/pkgs/gap_packages/patches/guava_leon_includes.patch b/build/pkgs/gap_packages/patches/guava_leon_includes.patch
-deleted file mode 100644
-index cdcd19cc3e8..00000000000
---- a/build/pkgs/gap_packages/patches/guava_leon_includes.patch
-+++ /dev/null
-@@ -1,13 +0,0 @@
----- a/pkg/guava-3.15/src/leon/src/generate.c	Sat Feb 29 09:02:10 2020
----- b/pkg/guava-3.15/src/leon/src/generate.c	Thu Sep 24 13:58:36 2020
--***************
--*** 115,120 ****
----- 115,122 ----
--  #include "groupio.h"
--  #include "enum.h"
--  #include "storage.h"
--+ #include "chbase.h"
--+ #include "inform.h"
--  
--  #ifdef ALT_TIME_HEADER
--  #include "cputime.h"
-diff --git a/build/pkgs/gap_packages/spkg-install.in b/build/pkgs/gap_packages/spkg-install.in
-index 168e6b11532..6dff182a48f 100644
---- a/build/pkgs/gap_packages/spkg-install.in
-+++ b/build/pkgs/gap_packages/spkg-install.in
-@@ -1,4 +1,4 @@
--GAP_ROOT="$SAGE_LOCAL/share/gap"
-+GAP_ROOT="$SAGE_LOCAL/lib/gap"
- PKG_DIR="$GAP_ROOT/pkg"
- 
- PKG_SRC_DIR="$(pwd)/src/pkg"
-@@ -11,33 +11,31 @@ cd "$PKG_SRC_DIR"
- #    (GAP 4.8.6 still had it, but this is gone in 4.10)
- 
- sdh_install \
--    aclib-* \
--    AutoDoc-* \
--    corelg-* \
--    crime-* \
-+    aclib \
-+    corelg \
-+    crime \
-     cryst \
-     crystcat \
--    design-* \
-+    design \
-     gbnp \
--    genss-* \
--    hap-* \
--    hapcryst-* \
--    hecke-* \
--    images-* \
--    liealgdb-* \
--    liepring-* \
--    liering-* \
--    loops-* \
--    MapClass-* \
--    polymaking-* \
--    qpa-* \
--    quagroup-* \
--    radiroot-* \
--    repsn-* \
--    sla-* \
--    sonata-* \
--    Toric-* \
--    utils-* \
-+    genss \
-+    hap \
-+    hapcryst \
-+    hecke \
-+    images \
-+    liealgdb \
-+    liepring \
-+    liering \
-+    loops \
-+    mapclass \
-+    polymaking \
-+    qpa \
-+    quagroup \
-+    repsn \
-+    singular \
-+    sla \
-+    sonata \
-+    toric \
-     "$PKG_DIR"
- 
- install_compiled_pkg()
-@@ -45,27 +43,23 @@ install_compiled_pkg()
-     local pkg="$1"
-     # Install the bin/ dir (where compiled modules should end up)
-     # under <prefix>/lib/gap; we then symlink to it later
--    sdh_install bin "$SAGE_LOCAL/lib/gap/pkg/$pkg"
-+    sdh_install * "$SAGE_LOCAL/lib/gap/pkg/$pkg"
- 
-+    # TODO:
-     # Clean up any build artificts before installing the rest of the package
-     # Also remove configure/Makefiles
-     # Note: None, if any of the packages really have a proper install target
--    make clean  # Works for some packages but not all
--    rm -rf bin/
--    rm -rf configure configure.* config.* autogen.sh *.m4 Makefile* m4/
-+    #make clean  # Works for some packages but not all
-+    #rm -rf bin/
-+    #rm -rf configure configure.* config.* autogen.sh *.m4 Makefile* m4/
- 
--    # Create the bin/ symlink
--    ln -s "$SAGE_LOCAL/lib/gap/pkg/$pkg/bin" bin
--
--    # Install the rest of the package files
--    sdh_install * "$PKG_DIR/$pkg"
- }
- 
- # Build and install compiled packages:
- #
- # These packages have an old ./configure that take the GAP_ROOT as a positional
- # argument
--for pkg in cohomolo-* crypting-* grape-* guava-* orb-* datastructures-*
-+for pkg in cohomolo crypting grape guava orb datastructures
- do
-     echo "Building GAP package $pkg"
-     CFLAGS="$CFLAGS -Wno-implicit-function-declaration"
-@@ -91,7 +85,7 @@ pararr=( " " " " "--with-external-planarity" "--with-external-libsemigroups" )
- ##############################################################################
- 
- parind=0
--for pkg in nq-* io-* digraphs-* semigroups-*
-+for pkg in nq io digraphs semigroups
- do
-     echo "Building GAP package $pkg"
-     cd "$PKG_SRC_DIR/$pkg"
-diff --git a/build/pkgs/libsemigroups/checksums.ini b/build/pkgs/libsemigroups/checksums.ini
-index 62c4268515f..4e13a36cb35 100644
---- a/build/pkgs/libsemigroups/checksums.ini
-+++ b/build/pkgs/libsemigroups/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=libsemigroups-VERSION.tar.gz
--sha1=2b16c095cc5ffd3f77a71dfbf48cce188e054c03
--md5=7082cadcf7a195ccb93175cd72b6db95
--cksum=1501022358
-+sha1=86375824b47ce4b0e23570122e873f67136d0c0a
-+md5=ff79ad5fbc8bfeb64d48faaf24106b98
-+cksum=2845045455
- upstream_url=https://github.com/libsemigroups/libsemigroups/releases/download/vVERSION/libsemigroups-VERSION.tar.gz
-diff --git a/build/pkgs/libsemigroups/package-version.txt b/build/pkgs/libsemigroups/package-version.txt
-index 9084fa2f716..f90b1afc082 100644
---- a/build/pkgs/libsemigroups/package-version.txt
-+++ b/build/pkgs/libsemigroups/package-version.txt
-@@ -1 +1 @@
--1.1.0
-+2.3.2
-diff --git a/build/pkgs/libsemigroups/spkg-install.in b/build/pkgs/libsemigroups/spkg-install.in
-index 2aaf0e99043..128b54d2f99 100644
---- a/build/pkgs/libsemigroups/spkg-install.in
-+++ b/build/pkgs/libsemigroups/spkg-install.in
-@@ -1,4 +1,4 @@
- cd src
--sdh_configure
-+sdh_configure --disable-eigen
- sdh_make
- sdh_make_install
-diff --git a/build/pkgs/singular/spkg-configure.m4 b/build/pkgs/singular/spkg-configure.m4
-index d4d145defe3..6a85631f624 100644
---- a/build/pkgs/singular/spkg-configure.m4
-+++ b/build/pkgs/singular/spkg-configure.m4
-@@ -9,52 +9,7 @@ SAGE_SPKG_CONFIGURE([singular], [
-        AC_MSG_CHECKING([that Singular's help is working])
-        AS_IF([test x`printf "system(\"--browser\", \"builtin\"); \n help;" | Singular 2>&1 | grep "error occurred"` = x], [
-         AC_MSG_RESULT(yes)
--        dnl We have Singular. Now determine the shared library path on
--        dnl platforms on which sage.libs.singular needs to reload the library with RTLD_GLOBAL.
--        AS_CASE([$host_os],
--          [cygwin*], [dnl Nothing to do
--                     ],
--                     [dnl Use pkg-config to get singular's libdir while we're at it. As a
--                      dnl moral compromise for using pkg-config, this ultimately allows us
--                      dnl to pass an absolute path to dlopen(), which is the only approach
--                      dnl that POSIX guarantees will work.
--                      PKG_CHECK_VAR([SINGULAR_LIB_DIR], [Singular], [libdir])
--                      dnl The acl_shlibext variable is set in the top-level configure.ac.
--                      AC_LANG_PUSH(C)
--                      ORIG_LIBS="${LIBS}"
--                      LIBS="${LIBS} -ldl"
--                      AC_MSG_CHECKING([if we can dlopen($LIBSINGULAR_PATH)])
--                      LIBSINGULAR_PATH="${SINGULAR_LIB_DIR}/libSingular.${acl_shlibext}"
--
--                      dnl if we can dlopen() it, substitute the name for sage_conf;
--                      dnl otherwise, fall back to using the SPKG.
--                      AC_RUN_IFELSE(
--                        [AC_LANG_PROGRAM(
--                          [[#include <dlfcn.h>]],
--                          [[void* h = dlopen("${LIBSINGULAR_PATH}", RTLD_LAZY | RTLD_GLOBAL);
--                            if (h == 0) { return 1; } else { return dlclose(h); }]]
--                        )], [
--                          AC_MSG_RESULT(yes)
--                        ], [
--                          dnl try Debian-specific name
--                          LIBSINGULAR_PATH="${SINGULAR_LIB_DIR}/libsingular-Singular.${acl_shlibext}"
--                          AC_RUN_IFELSE(
--                           [AC_LANG_PROGRAM(
--                             [[#include <dlfcn.h>]],
--                             [[void* h = dlopen("${LIBSINGULAR_PATH}", RTLD_LAZY | RTLD_GLOBAL);
--                               if (h == 0) { return 1; } else { return dlclose(h); }]]
--                           )], [
--                             AC_MSG_RESULT(yes)
--                           ], [
--                            AC_MSG_RESULT(no)
--                            sage_spkg_install_singular=yes
--                          ], [AC_MSG_RESULT(yes)])
--                        ], [AC_MSG_RESULT(yes)])
--
--                      AC_LANG_POP()
--                      LIBS="${ORIG_LIBS}"
--                     ]
--       )], [
-+       ], [
-        AC_MSG_RESULT(no)
-        sage_spkg_install_singular=yes
-        ]
-@@ -64,20 +19,4 @@ SAGE_SPKG_CONFIGURE([singular], [
-       ])
-     ])
-   ])
--],[],[],[
--  dnl Post-check phase
--  dnl We make the sage_conf substitutions here, because the "default"
--  dnl substitution needs to be made even if we skipped the system-Singular
--  dnl checks themselves.
--  AS_IF([test "x${sage_spkg_install_singular}" = "xyes"], [
--    AS_CASE([$host_os],
--      [cygwin*], [dnl Nothing to do
--                 ],
--                 [dnl Set shared library path, needed for reloading the library with RTLD_GLOBAL
--                  LIBSINGULAR_PATH="\$SAGE_LOCAL/lib/libSingular.${acl_shlibext}"
--                 ]
--    )
--  ])
--
--  AC_SUBST(LIBSINGULAR_PATH, "${LIBSINGULAR_PATH}")
- ])
-diff --git a/pkgs/sage-conf/_sage_conf/_conf.py.in b/pkgs/sage-conf/_sage_conf/_conf.py.in
-index 6cd28f558a8..d66bdb3d264 100644
---- a/pkgs/sage-conf/_sage_conf/_conf.py.in
-+++ b/pkgs/sage-conf/_sage_conf/_conf.py.in
-@@ -55,9 +55,6 @@ THREEJS_DIR = SAGE_LOCAL + "/share/threejs-sage"
- OPENMP_CFLAGS = "@OPENMP_CFLAGS@"
- OPENMP_CXXFLAGS = "@OPENMP_CXXFLAGS@"
- 
--# The full absolute path to the main Singular library.
--LIBSINGULAR_PATH = "@LIBSINGULAR_PATH@".replace('$SAGE_LOCAL', SAGE_LOCAL)
--
- # Installation location of wheels. This is determined at configuration time
- # and does not depend on the installation location of sage-conf.
- SAGE_SPKG_WHEELS = "@SAGE_VENV@".replace('${SAGE_LOCAL}', SAGE_LOCAL) + "/var/lib/sage/wheels"
-diff --git a/src/doc/en/thematic_tutorials/lie/weyl_groups.rst b/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-index c917338e444..182e74aad20 100644
---- a/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-+++ b/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-@@ -139,12 +139,12 @@ string, which you can print::
-     X.1      1  1  1  1  1  1  1  1  1  1  1  1  1
-     X.2      1 -1  1  1 -1  1  1 -1 -1 -1  1  1  1
-     X.3      2  .  2 -1  .  2  2  .  .  . -1  2  2
--    X.4      3 -1 -1  .  1 -1  3 -1  1 -1  . -1  3
--    X.5      3 -1 -1  .  1  3 -1 -1 -1  1  . -1  3
--    X.6      3  1 -1  . -1 -1  3  1 -1  1  . -1  3
--    X.7      3  1 -1  . -1  3 -1  1  1 -1  . -1  3
--    X.8      3 -1  3  . -1 -1 -1 -1  1  1  . -1  3
--    X.9      3  1  3  .  1 -1 -1  1 -1 -1  . -1  3
-+    X.4      3 -1 -1  .  1  3 -1 -1 -1  1  . -1  3
-+    X.5      3  1 -1  . -1  3 -1  1  1 -1  . -1  3
-+    X.6      3 -1  3  . -1 -1 -1 -1  1  1  . -1  3
-+    X.7      3 -1 -1  .  1 -1  3 -1  1 -1  . -1  3
-+    X.8      3  1  3  .  1 -1 -1  1 -1 -1  . -1  3
-+    X.9      3  1 -1  . -1 -1  3  1 -1  1  . -1  3
-     X.10     4 -2  . -1  .  .  .  2  .  .  1  . -4
-     X.11     4  2  . -1  .  .  . -2  .  .  1  . -4
-     X.12     6  . -2  .  . -2 -2  .  .  .  .  2  6
-diff --git a/src/sage/coding/codecan/autgroup_can_label.pyx b/src/sage/coding/codecan/autgroup_can_label.pyx
-index de5db985e0b..c83b9264e44 100644
---- a/src/sage/coding/codecan/autgroup_can_label.pyx
-+++ b/src/sage/coding/codecan/autgroup_can_label.pyx
-@@ -76,7 +76,7 @@ columns do share the same coloring::
-     ((1,),
-      (2,),
-      (3, 5, 4),
--     (6, 19, 16, 9, 21, 10, 8, 15, 14, 11, 20, 13, 12, 7, 17, 18))
-+     (6, 19, 16, 21, 9, 10, 15, 8, 20, 11, 14, 13, 7, 12, 18, 17))
- 
- We can also restrict the group action to linear isometries::
- 
-diff --git a/src/sage/coding/linear_code.py b/src/sage/coding/linear_code.py
-index a3ac3ca1547..bfb9f8696e8 100644
---- a/src/sage/coding/linear_code.py
-+++ b/src/sage/coding/linear_code.py
-@@ -465,27 +465,27 @@ def automorphism_group_gens(self, equivalence="semilinear"):
-             0
-             sage: C = codes.HammingCode(GF(4, 'z'), 3)
-             sage: C.automorphism_group_gens()
--            ([((1, 1, 1, 1, 1, z + 1, z, z + 1, z, z, z, 1, 1, z + 1, z + 1, z, z + 1, z, z + 1, z + 1, z + 1); (1,14,6,7,4,10,11,19)(2,8,16,13,3,17,21,15)(9,12,18,20), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((1, 1, 1, z, z + 1, 1, 1, 1, 1, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z); (1,13,14,20)(2,21,8,18,7,16,19,15)(3,10,5,12,17,9,6,4), Ring endomorphism of Finite Field in z of size 2^2
-+                Defn: z |--> z + 1),
-+              ((z, 1, z, z, z, z + 1, z, z, z, z, z, z, z + 1, z, z, z, z, z + 1, z, z, z); (1,11,5,12,3,19)(2,8)(6,18,13)(7,17,15)(9,10,14,16,20,21), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z + 1),
--              ((z + 1, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z + 1, 1, z, z + 1, z + 1, z); (1,18,6,19,2,9,17,10,13,14,21,11,4,5,12)(3,20,7,16,8), Ring endomorphism of Finite Field in z of size 2^2
--                Defn: z |--> z),
-               ((z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z); (), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-              362880)
-             sage: C.automorphism_group_gens(equivalence="linear")
--            ([((z + 1, 1, z + 1, z + 1, z + 1, z, 1, z, 1, 1, 1, 1, z + 1, z + 1, z + 1, z, z, 1, z, z, z); (1,15,2,8,16,18,3)(4,9,12,13,20,10,11)(5,21,14,6,7,19,17), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((z, 1, z + 1, z + 1, 1, z + 1, z, 1, z + 1, z + 1, 1, z, 1, z + 1, z, 1, z, 1, z + 1, 1, 1); (1,12,11,10,6,8,9,20,13,21,5,14,3,16,17,19,7,4,2,15,18), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((z + 1, z + 1, z + 1, z + 1, z + 1, 1, z, 1, z, z, z, 1, z, 1, 1, 1, z + 1, z + 1, z + 1, 1, z); (1,15,21,8,9)(2,18,5,3,11,16,7,10,19,13,12,4,17,6,20), Ring endomorphism of Finite Field in z of size 2^2
-+              ((z + 1, z + 1, z + 1, z, 1, 1, z, z, 1, z + 1, z, 1, 1, z, 1, z + 1, z, z + 1, z + 1, 1, z); (1,3,18,2,17,6,19)(4,15,13,20,7,14,16)(5,11,8,21,12,9,10), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
-               ((z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1); (), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-              181440)
-             sage: C.automorphism_group_gens(equivalence="permutational")
--            ([((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,19)(3,17)(4,21)(5,20)(7,14)(9,12)(10,16)(11,15), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,11)(3,10)(4,9)(5,7)(12,21)(14,20)(15,19)(16,17), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,11)(3,10)(4,9)(5,7)(12,21)(14,20)(15,19)(16,17), Ring endomorphism of Finite Field in z of size 2^2
-+              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (2,18)(3,19)(4,10)(5,16)(8,13)(9,14)(11,21)(15,20), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,17)(2,8)(3,14)(4,10)(7,12)(9,19)(13,18)(15,20), Ring endomorphism of Finite Field in z of size 2^2
-+              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,19)(3,17)(4,21)(5,20)(7,14)(9,12)(10,16)(11,15), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
-               ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (2,13)(3,14)(4,20)(5,11)(8,18)(9,19)(10,15)(16,21), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-@@ -691,10 +691,10 @@ def _canonize(self, equivalence):
-             sage: C_iso == aut_group_can_label.get_canonical_form()
-             True
-             sage: aut_group_can_label.get_autom_gens()
--            [((1, 1, 1, 1, 1, z + 1, z, z + 1, z, z, z, 1, 1, z + 1, z + 1, z, z + 1, z, z + 1, z + 1, z + 1); (1,14,6,7,4,10,11,19)(2,8,16,13,3,17,21,15)(9,12,18,20), Ring endomorphism of Finite Field in z of size 2^2
-+            [((1, 1, 1, z, z + 1, 1, 1, 1, 1, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z); (1,13,14,20)(2,21,8,18,7,16,19,15)(3,10,5,12,17,9,6,4), Ring endomorphism of Finite Field in z of size 2^2
-+               Defn: z |--> z + 1),
-+             ((z, 1, z, z, z, z + 1, z, z, z, z, z, z, z + 1, z, z, z, z, z + 1, z, z, z); (1,11,5,12,3,19)(2,8)(6,18,13)(7,17,15)(9,10,14,16,20,21), Ring endomorphism of Finite Field in z of size 2^2
-                Defn: z |--> z + 1),
--             ((z + 1, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z + 1, 1, z, z + 1, z + 1, z); (1,18,6,19,2,9,17,10,13,14,21,11,4,5,12)(3,20,7,16,8), Ring endomorphism of Finite Field in z of size 2^2
--               Defn: z |--> z),
-              ((z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z); (), Ring endomorphism of Finite Field in z of size 2^2
-                Defn: z |--> z)]
-         """
-diff --git a/src/sage/combinat/posets/posets.py b/src/sage/combinat/posets/posets.py
-index 2836d59d960..8c882d5ac3b 100644
---- a/src/sage/combinat/posets/posets.py
-+++ b/src/sage/combinat/posets/posets.py
-@@ -8813,7 +8813,7 @@ def _libgap_(self):
-             sage: libgap(P)  # optional - gap_packages
-             <A poset on 5 points>
-             sage: A = libgap(GF(2)).PosetAlgebra(P); A  # optional - gap_packages
--            <GF(2)[<quiver with 5 vertices and 5 arrows>]/<two-sided ideal in <GF(2)[<quiver with 5 vertices and 5 arrows>]>, (1 generators)>>
-+            <GF(2)[<quiver with 5 vertices and 5 arrows>]/<two-sided ideal in <GF(2)[<quiver with 5 vertices and 5 arrows>]>, (1 generator)>>
-             sage: A.Dimension()  # optional - gap_packages
-             13
-         """
-diff --git a/src/sage/combinat/root_system/hecke_algebra_representation.py b/src/sage/combinat/root_system/hecke_algebra_representation.py
-index 6b756bafc30..8ac99319bec 100644
---- a/src/sage/combinat/root_system/hecke_algebra_representation.py
-+++ b/src/sage/combinat/root_system/hecke_algebra_representation.py
-@@ -357,7 +357,7 @@ def Tw(self, word, signs=None, scalar=None):
-             sage: q1, q2 = K.gens()
-             sage: KW = W.algebra(K)
-             sage: x = KW.an_element(); x
--            123 + 3*32 + 2*3 + e
-+            123 + 3*2312 + 2*31 + e
- 
-             sage: T = KW.demazure_lusztig_operators(q1,q2)
-             sage: T12 = T.Tw( (1,2) )
-diff --git a/src/sage/combinat/symmetric_group_algebra.py b/src/sage/combinat/symmetric_group_algebra.py
-index b8a0bebab44..9bccba124c8 100644
---- a/src/sage/combinat/symmetric_group_algebra.py
-+++ b/src/sage/combinat/symmetric_group_algebra.py
-@@ -101,7 +101,7 @@ def SymmetricGroupAlgebra(R, W, category=None):
-         sage: SGA.group()
-         Weyl Group of type ['A', 3] (as a matrix group acting on the ambient space)
-         sage: SGA.an_element()
--        s1*s2*s3 + 3*s3*s2 + 2*s3 + 1
-+        s1*s2*s3 + 3*s2*s3*s1*s2 + 2*s3*s1 + 1
- 
-     The preferred way to construct the symmetric group algebra is to
-     go through the usual ``algebra`` method::
-diff --git a/src/sage/env.py b/src/sage/env.py
-index 911f34b1bc6..5f7aca8599c 100644
---- a/src/sage/env.py
-+++ b/src/sage/env.py
-@@ -197,7 +197,8 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- GRAPHS_DATA_DIR = var("GRAPHS_DATA_DIR", join(SAGE_SHARE, "graphs"))
- ELLCURVE_DATA_DIR = var("ELLCURVE_DATA_DIR", join(SAGE_SHARE, "ellcurves"))
- POLYTOPE_DATA_DIR = var("POLYTOPE_DATA_DIR", join(SAGE_SHARE, "reflexive_polytopes"))
--GAP_ROOT_DIR = var("GAP_ROOT_DIR", join(SAGE_SHARE, "gap"))
-+GAP_LIB_DIR = var("GAP_LIB_DIR", join(SAGE_LOCAL, "lib", "gap"))
-+GAP_SHARE_DIR = var("GAP_SHARE_DIR", join(SAGE_SHARE, "gap"))
- THEBE_DIR = var("THEBE_DIR", join(SAGE_SHARE, "thebe"))
- COMBINATORIAL_DESIGN_DATA_DIR = var("COMBINATORIAL_DESIGN_DATA_DIR", join(SAGE_SHARE, "combinatorial_designs"))
- CREMONA_MINI_DATA_DIR = var("CREMONA_MINI_DATA_DIR", join(SAGE_SHARE, "cremona"))
-@@ -229,12 +230,6 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- LIE_INFO_DIR = var("LIE_INFO_DIR", join(SAGE_LOCAL, "lib", "LiE"))
- SINGULAR_BIN = var("SINGULAR_BIN") or "Singular"
- 
--# The path to libSingular, to be passed to dlopen(). This will
--# typically be set to an absolute path in sage_conf, but the relative
--# fallback path here works on systems where dlopen() searches the
--# system's library locations.
--LIBSINGULAR_PATH = var("LIBSINGULAR_PATH", "libSingular.so")
--
- # OpenMP
- OPENMP_CFLAGS = var("OPENMP_CFLAGS", "")
- OPENMP_CXXFLAGS = var("OPENMP_CXXFLAGS", "")
-@@ -255,81 +250,6 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- SAGE_GAP_COMMAND = var('SAGE_GAP_COMMAND', _gap_cmd)
- 
- 
--def _get_shared_lib_path(*libnames: str) -> Optional[str]:
--    """
--    Return the full path to a shared library file installed in
--    ``$SAGE_LOCAL/lib`` or the directories associated with the
--    Python sysconfig.
--
--    This can also be passed more than one library name (e.g. for cases where
--    some library may have multiple names depending on the platform) in which
--    case the first one found is returned.
--
--    This supports most *NIX variants (in which ``lib<libname>.so`` is found
--    under ``$SAGE_LOCAL/lib``), macOS (same, but with the ``.dylib``
--    extension), and Cygwin (under ``$SAGE_LOCAL/bin/cyg<libname>.dll``,
--    or ``$SAGE_LOCAL/bin/cyg<libname>-*.dll`` for versioned DLLs).
--
--    For distributions like Debian that use a multiarch layout, we also try the
--    multiarch lib paths (i.e. ``/usr/lib/<arch>/``).
--
--    This returns ``None`` if no matching library file could be found.
--
--    EXAMPLES::
--
--        sage: from sage.env import _get_shared_lib_path
--        sage: "gap" in _get_shared_lib_path("gap")
--        True
--        sage: _get_shared_lib_path("an_absurd_lib") is None
--        True
--
--    """
--
--    for libname in libnames:
--        search_directories: List[Path] = []
--        patterns: List[str] = []
--        if sys.platform == 'cygwin':
--            # Later down we take the first matching DLL found, so search
--            # SAGE_LOCAL first so that it takes precedence
--            if SAGE_LOCAL:
--                search_directories.append(Path(SAGE_LOCAL) / 'bin')
--            search_directories.append(Path(sysconfig.get_config_var('BINDIR')))
--            # Note: The following is not very robust, since if there are multible
--            # versions for the same library this just selects one more or less
--            # at arbitrary. However, practically speaking, on Cygwin, there
--            # will only ever be one version
--            patterns = [f'cyg{libname}.dll', f'cyg{libname}-*.dll']
--        else:
--            if sys.platform == 'darwin':
--                ext = 'dylib'
--            else:
--                ext = 'so'
--
--            if SAGE_LOCAL:
--                search_directories.append(Path(SAGE_LOCAL) / 'lib')
--            libdir = sysconfig.get_config_var('LIBDIR')
--            if libdir is not None:
--                libdir = Path(libdir)
--                search_directories.append(libdir)
--
--                multiarchlib = sysconfig.get_config_var('MULTIARCH')
--                if multiarchlib is not None:
--                    search_directories.append(libdir / multiarchlib),
--
--            patterns = [f'lib{libname}.{ext}']
--
--        for directory in search_directories:
--            for pattern in patterns:
--                path = next(directory.glob(pattern), None)
--                if path is not None:
--                    return str(path.resolve())
--
--    # Just return None if no files were found
--    return None
--
--# locate libgap shared object
--GAP_SO = var("GAP_SO", _get_shared_lib_path("gap", ""))
--
- # post process
- if DOT_SAGE is not None and ' ' in DOT_SAGE:
-     if UNAME[:6] == 'CYGWIN':
-diff --git a/src/sage/groups/abelian_gps/abelian_group_gap.py b/src/sage/groups/abelian_gps/abelian_group_gap.py
-index a4b047113c5..86090b43535 100644
---- a/src/sage/groups/abelian_gps/abelian_group_gap.py
-+++ b/src/sage/groups/abelian_gps/abelian_group_gap.py
-@@ -338,7 +338,7 @@ def _element_constructor_(self, x, check=True):
-         if isinstance(x, AbelianGroupElement_gap):
-             try:
-                 if x in self._cover:
--                    x = self.gap().NaturalHomomorphism().Image(x.gap())
-+                    x = self._cover.gap().NaturalHomomorphismByNormalSubgroup(self._relations).Image(x.gap())
-                 else:
-                     x = x.gap()
-             except AttributeError:
-@@ -1043,7 +1043,7 @@ def natural_homomorphism(self):
-             From: Abelian group with gap, generator orders (4,)
-             To:   Quotient abelian group with generator orders (2,)
-         """
--        phi = self.gap().NaturalHomomorphism()
-+        phi = self._cover.gap().NaturalHomomorphismByNormalSubgroup(self._relations)
-         Hom = self._cover.Hom(self)
-         return Hom(phi)
- 
-diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py
-index 8d6e443683c..1beb01af87f 100644
---- a/src/sage/groups/finitely_presented.py
-+++ b/src/sage/groups/finitely_presented.py
-@@ -596,9 +596,9 @@ def gap(self):
-             sage: k = G.rewriting_system()
-             sage: k.gap()
-             Knuth Bendix Rewriting System for Monoid( [ a, A, b, B ] ) with rules
--            [ [ a^2, <identity ...> ], [ a*A, <identity ...> ],
--              [ A*a, <identity ...> ], [ b^2, <identity ...> ],
--              [ b*B, <identity ...> ], [ B*b, <identity ...> ] ]
-+            [ [ a*A, <identity ...> ], [ A*a, <identity ...> ],
-+              [ b*B, <identity ...> ], [ B*b, <identity ...> ],
-+              [ a^2, <identity ...> ], [ b^2, <identity ...> ] ]
-         """
-         return self._gap
- 
-diff --git a/src/sage/groups/fqf_orthogonal.py b/src/sage/groups/fqf_orthogonal.py
-index 7fc4dbe7548..e5eccd45942 100644
---- a/src/sage/groups/fqf_orthogonal.py
-+++ b/src/sage/groups/fqf_orthogonal.py
-@@ -143,7 +143,7 @@ class FqfOrthogonalGroup(AbelianGroupAutomorphismGroup_subgroup):
-         [2/3   0   0]
-         [  0 2/3   0]
-         [  0   0 4/3]
--        generated by 2 elements
-+        generated by 3 elements
-         sage: q = matrix.diagonal(QQ, [3/2, 1/4, 1/4])
-         sage: T = TorsionQuadraticForm(q)
-         sage: T.orthogonal_group().order()
-diff --git a/src/sage/groups/libgap_wrapper.pyx b/src/sage/groups/libgap_wrapper.pyx
-index d25121aa792..dc81b71635b 100644
---- a/src/sage/groups/libgap_wrapper.pyx
-+++ b/src/sage/groups/libgap_wrapper.pyx
-@@ -25,7 +25,7 @@ Note how we call the constructor of both superclasses to initialize
- its output via LibGAP::
- 
-     sage: FooGroup()
--    <pc group of size 3 with 1 generators>
-+    <pc group of size 3 with 1 generator>
-     sage: type(FooGroup().gap())
-     <class 'sage.libs.gap.element.GapElement'>
- 
-@@ -106,7 +106,7 @@ class ParentLibGAP(SageObject):
-         ....:         ParentLibGAP.__init__(self, lg)
-         ....:         Group.__init__(self)
-         sage: FooGroup()
--        <pc group of size 3 with 1 generators>
-+        <pc group of size 3 with 1 generator>
-     """
- 
-     def __init__(self, libgap_parent, ambient=None):
-@@ -461,7 +461,7 @@ cdef class ElementLibGAP(MultiplicativeGroupElement):
-         ....:         ParentLibGAP.__init__(self, lg)
-         ....:         Group.__init__(self)
-         sage: FooGroup()
--        <pc group of size 3 with 1 generators>
-+        <pc group of size 3 with 1 generator>
-         sage: FooGroup().gens()
-         (f1,)
-     """
-diff --git a/src/sage/groups/matrix_gps/finitely_generated.py b/src/sage/groups/matrix_gps/finitely_generated.py
-index a6d3dc02513..63956ad5f10 100644
---- a/src/sage/groups/matrix_gps/finitely_generated.py
-+++ b/src/sage/groups/matrix_gps/finitely_generated.py
-@@ -563,9 +563,6 @@ def as_permutation_group(self, algorithm=None, seed=None):
-             21499084800
-             sage: P = G.as_permutation_group()
-             sage: Psmaller = G.as_permutation_group(algorithm="smaller", seed=6)
--            sage: P == Psmaller  # see the note below
--            True
--            sage: Psmaller = G.as_permutation_group(algorithm="smaller")
-             sage: P == Psmaller
-             False
-             sage: P.cardinality()
-diff --git a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-index f2ccca042ac..47d6862333c 100644
---- a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-+++ b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-@@ -427,7 +427,7 @@ cdef class LabelledBranching:
-             sage: from sage.groups.perm_gps.partn_ref2.refinement_generic import LabelledBranching
-             sage: L = LabelledBranching(3)
-             sage: L.small_generating_set()
--            []
-+            [()]
-             sage: L.add_gen(libgap.eval('(1,2,3)'))
-             sage: L.small_generating_set()
-             [(1,2,3)]
-diff --git a/src/sage/groups/perm_gps/permgroup.py b/src/sage/groups/perm_gps/permgroup.py
-index ebdf7c4c6eb..fb14008c8e0 100644
---- a/src/sage/groups/perm_gps/permgroup.py
-+++ b/src/sage/groups/perm_gps/permgroup.py
-@@ -926,7 +926,7 @@ def _coerce_map_from_(self, G):
-            sage: f = PG._coerce_map_from_(MG)
-            sage: mg = MG.an_element()
-            sage: p = f(mg); p
--           (2,33,32,23,31,55)(3,49,38,44,40,28)(4,17,59,62,58,46)(5,21,47,20,43,8)(6,53,50)(7,37,12,57,14,29)(9,41,56,34,64,10)(11,25,19)(13,61,26,51,22,15)(16,45,36)(18,27,35,48,52,54)(24,63,42)(30,39,60)
-+           (1,2,6,19,35,33)(3,9,26,14,31,23)(4,13,5)(7,22,17)(8,24,12)(10,16,32,27,20,28)(11,30,18)(15,25,36,34,29,21)
-            sage: PG(p._gap_()) == p
-            True
- 
-@@ -972,12 +972,12 @@ def _coerce_map_from_(self, G):
-             sage: P = G.as_permutation_group(algorithm='smaller', seed=5)
-             sage: P1 = G.as_permutation_group()
-             sage: P == P1
--            False
-+            True
-             sage: g1, g2, g3 = G.gens()
-             sage: P(g1*g2)
--            (1,3,7,12)(2,4,8,10)(5,11)(6,9)
-+            (1,4,13,11)(2,5,14,18)(3,15,8,16)(6,7)(9,20,19,12)(10,17)
-             sage: P1(g1*g2)
--            (2,29,25,68)(3,57,13,54)(4,11,72,37)(5,39,60,23)(6,64,75,63)(7,21,50,73)(8,46,38,32)(9,74,35,18)(10,44,49,48)(12,16,34,71)(14,79,27,40)(15,26)(17,62,59,76)(19,78,70,65)(20,22,58,51)(24,33,36,43)(28,81,80,52)(30,53,56,69)(31,61)(41,42,67,55)(45,77)(47,66)
-+            (1,4,13,11)(2,5,14,18)(3,15,8,16)(6,7)(9,20,19,12)(10,17)
- 
-         Another check for :trac:`5583`::
- 
-@@ -1302,7 +1302,7 @@ def gens_small(self):
-             sage: G.gens_small() # random
-             [('b','c'), ('a','c','b')] ## (on 64-bit Linux)
-             [('a','b'), ('a','c','b')] ## (on Solaris)
--            sage: len(G.gens_small()) == 2
-+            sage: len(G.gens_small()) == 2 # random
-             True
-         """
-         gens = self._libgap_().SmallGeneratingSet()
-@@ -4370,17 +4370,23 @@ def is_transitive(self, domain=None):
- 
-         ::
- 
--            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)]]) #S_5 on [1..5]
--            sage: G.is_transitive([1,4,5])
-+            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)],[(6,7)]])
-+            sage: G.is_transitive([1,2,3,4,5])
-             True
--            sage: G.is_transitive([2..6])
-+            sage: G.is_transitive([1..7])
-             False
-             sage: G.is_transitive(G.non_fixed_points())
--            True
-+            False
-             sage: H = PermutationGroup([[(1,2,3)],[(4,5,6)]])
-             sage: H.is_transitive(H.non_fixed_points())
-             False
- 
-+        If `G` does not act on the domain, it always returns ``False``::
-+
-+            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)]]) #S_5 on [1..5]
-+            sage: G.is_transitive([1,4,5])
-+            False
-+
-         Note that this differs from the definition in GAP, where
-         ``IsTransitive`` returns whether the group is transitive on the
-         set of points moved by the group.
-@@ -4436,12 +4442,16 @@ def is_primitive(self, domain=None):
-             sage: G = PermutationGroup([[(1,2,3,4)],[(2,4)]])
-             sage: G.is_primitive([1..4])
-             False
--            sage: G.is_primitive([1,2,3])
--            True
-             sage: G = PermutationGroup([[(3,4,5,6)],[(3,4)]]) #S_4 on [3..6]
-             sage: G.is_primitive(G.non_fixed_points())
-             True
- 
-+        If `G` does not act on the domain, it always returns ``False``::
-+
-+            sage: G = PermutationGroup([[(1,2,3,4)],[(2,4)]])
-+            sage: G.is_primitive([1,2,3])
-+            False
-+
-         """
-         #If the domain is not a subset of self.domain(), then the
-         #action isn't primitive.
-diff --git a/src/sage/interfaces/gap.py b/src/sage/interfaces/gap.py
-index 7ae1792e9de..ecaa9fd2341 100644
---- a/src/sage/interfaces/gap.py
-+++ b/src/sage/interfaces/gap.py
-@@ -1512,6 +1512,8 @@ def gap_reset_workspace(max_workspace_size=None, verbose=False):
-     """
-     # Create new workspace with filename WORKSPACE
-     g = Gap(use_workspace_cache=False, max_workspace_size=None)
-+    g.eval('ColorPrompt(false)')
-+    g.eval('SetUserPreference("UseColorPrompt", false)')
-     g.eval('SetUserPreference("HistoryMaxLines", 30)')
-     from sage.tests.gap_packages import all_installed_packages
-     for pkg in all_installed_packages(gap=g):
-diff --git a/src/sage/interfaces/gap_workspace.py b/src/sage/interfaces/gap_workspace.py
-index 33a87dd5076..03b40be6856 100644
---- a/src/sage/interfaces/gap_workspace.py
-+++ b/src/sage/interfaces/gap_workspace.py
-@@ -16,7 +16,8 @@
- import os
- import time
- import hashlib
--from sage.env import DOT_SAGE, GAP_SO
-+import subprocess
-+from sage.env import DOT_SAGE, HOSTNAME, GAP_LIB_DIR, GAP_SHARE_DIR
- 
- 
- def gap_workspace_file(system="gap", name="workspace", dir=None):
-@@ -59,11 +60,13 @@ def gap_workspace_file(system="gap", name="workspace", dir=None):
-     if dir is None:
-         dir = os.path.join(DOT_SAGE, 'gap')
- 
--    if GAP_SO:
--        h = hashlib.sha1(GAP_SO.encode('utf-8')).hexdigest()
--    else:
--        h = 'unknown'
--    return os.path.join(dir, '%s-%s-%s' % (system, name, h))
-+    data = f'{GAP_LIB_DIR}:{GAP_SHARE_DIR}'
-+    for path in GAP_LIB_DIR, GAP_SHARE_DIR:
-+        sysinfo = os.path.join(path, "sysinfo.gap")
-+        if os.path.exists(sysinfo):
-+            data += subprocess.getoutput(f'. "{sysinfo}" && echo ":$GAP_VERSION:$GAParch"')
-+    h = hashlib.sha1(data.encode('utf-8')).hexdigest()
-+    return os.path.join(dir, f'{system}-{name}-{HOSTNAME}-{h}')
- 
- 
- def prepare_workspace_dir(dir=None):
-diff --git a/src/sage/libs/gap/element.pyx b/src/sage/libs/gap/element.pyx
-index c555ea0333c..e3db3934baf 100644
---- a/src/sage/libs/gap/element.pyx
-+++ b/src/sage/libs/gap/element.pyx
-@@ -130,6 +130,7 @@ cdef char *capture_stdout(Obj func, Obj obj):
-     """
-     cdef Obj s, stream, output_text_string
-     cdef UInt res
-+    cdef TypOutputFile output
-     # The only way to get a string representation of an object that is truly
-     # consistent with how it would be represented at the GAP REPL is to call
-     # ViewObj on it.  Unfortunately, ViewObj *prints* to the output stream,
-@@ -145,12 +146,12 @@ cdef char *capture_stdout(Obj func, Obj obj):
-         output_text_string = GAP_ValueGlobalVariable("OutputTextString")
-         stream = CALL_2ARGS(output_text_string, s, GAP_True)
- 
--        if not OpenOutputStream(stream):
-+        if not OpenOutputStream(&output, stream):
-             raise GAPError("failed to open output capture stream for "
-                            "representing GAP object")
- 
-         CALL_1ARGS(func, obj)
--        CloseOutput()
-+        CloseOutput(&output)
-         return CSTR_STRING(s)
-     finally:
-         GAP_Leave()
-diff --git a/src/sage/libs/gap/gap_includes.pxd b/src/sage/libs/gap/gap_includes.pxd
-index 6d22e32540b..6111d18a5c7 100644
---- a/src/sage/libs/gap/gap_includes.pxd
-+++ b/src/sage/libs/gap/gap_includes.pxd
-@@ -76,8 +76,10 @@ cdef extern from "gap/intobj.h" nogil:
- 
- 
- cdef extern from "gap/io.h" nogil:
--    UInt OpenOutputStream(Obj stream)
--    UInt CloseOutput()
-+    ctypedef struct TypOutputFile:
-+        pass
-+    UInt OpenOutputStream(TypOutputFile* output, Obj stream)
-+    UInt CloseOutput(TypOutputFile* output)
- 
- 
- cdef extern from "gap/libgap-api.h" nogil:
-diff --git a/src/sage/libs/gap/libgap.pyx b/src/sage/libs/gap/libgap.pyx
-index b1a64e57939..6a36613aa8c 100644
---- a/src/sage/libs/gap/libgap.pyx
-+++ b/src/sage/libs/gap/libgap.pyx
-@@ -695,7 +695,7 @@ class Gap(Parent):
-             sage: libgap.List
-             <Gap function "List">
-             sage: libgap.GlobalRandomSource
--            <RandomSource in IsGlobalRandomSource>
-+            <RandomSource in IsGAPRandomSource>
-         """
-         if name in dir(self.__class__):
-             return getattr(self.__class__, name)
-diff --git a/src/sage/libs/gap/saved_workspace.py b/src/sage/libs/gap/saved_workspace.py
-index ad5adec36d0..7636707f557 100644
---- a/src/sage/libs/gap/saved_workspace.py
-+++ b/src/sage/libs/gap/saved_workspace.py
-@@ -8,7 +8,7 @@
- 
- import os
- import glob
--from sage.env import GAP_ROOT_DIR
-+from sage.env import GAP_LIB_DIR
- from sage.interfaces.gap_workspace import gap_workspace_file
- 
- 
-@@ -31,7 +31,7 @@ def timestamp():
-     """
-     libgap_dir = os.path.dirname(__file__)
-     libgap_files = glob.glob(os.path.join(libgap_dir, '*'))
--    gap_packages = glob.glob(os.path.join(GAP_ROOT_DIR, 'pkg', '*'))
-+    gap_packages = glob.glob(os.path.join(GAP_LIB_DIR, 'pkg', '*'))
-     files = libgap_files + gap_packages
-     if len(files) == 0:
-         print('Unable to find LibGAP files.')
-diff --git a/src/sage/libs/gap/util.pyx b/src/sage/libs/gap/util.pyx
-index 344ab88c42a..eaa659d64c7 100644
---- a/src/sage/libs/gap/util.pyx
-+++ b/src/sage/libs/gap/util.pyx
-@@ -13,7 +13,7 @@ Utility functions for GAP
- #*****************************************************************************
- 
- from libc.signal cimport signal, SIGCHLD, SIG_DFL
--from posix.dlfcn cimport dlopen, dlclose, RTLD_NOW, RTLD_GLOBAL
-+from posix.dlfcn cimport dlopen, dlclose, dlerror, RTLD_LAZY, RTLD_GLOBAL
- 
- from cpython.exc cimport PyErr_Fetch, PyErr_Restore
- from cpython.object cimport Py_LT, Py_LE, Py_EQ, Py_NE, Py_GT, Py_GE
-@@ -164,33 +164,6 @@ cdef void gasman_callback() with gil:
- ### Initialization of GAP ##################################################
- ############################################################################
- 
--def gap_root():
--    """
--    Find the location of the GAP root install which is stored in the gap
--    startup script.
--
--    EXAMPLES::
--
--        sage: from sage.libs.gap.util import gap_root
--        sage: gap_root()   # random output
--        '/home/vbraun/opt/sage-5.3.rc0/local/gap/latest'
--    """
--    if os.path.exists(sage.env.GAP_ROOT_DIR):
--        return sage.env.GAP_ROOT_DIR
--
--    # Attempt to figure out the appropriate GAP_ROOT by reading the
--    # local/bin/gap shell script; this is an ugly hack that exists for
--    # historical reasons; the best approach to setting where Sage looks for
--    # the appropriate GAP_ROOT is to set the GAP_ROOT_DIR variable
--    SAGE_LOCAL = sage.env.SAGE_LOCAL
--    with open(os.path.join(SAGE_LOCAL, 'bin', 'gap')) as f:
--        gap_sh = f.read().splitlines()
--    gapdir = next(x for x in gap_sh if x.strip().startswith('GAP_ROOT'))
--    gapdir = gapdir.split('"')[1]
--    gapdir = gapdir.replace('$SAGE_LOCAL', SAGE_LOCAL)
--    return gapdir
--
--
- # To ensure that we call initialize_libgap only once.
- cdef bint _gap_is_initialized = False
- 
-@@ -232,12 +205,12 @@ cdef initialize():
-     # this isn't portable
- 
-     cdef void* handle
--    libgapname = str_to_bytes(sage.env.GAP_SO)
--    handle = dlopen(libgapname, RTLD_NOW | RTLD_GLOBAL)
-+    # reload the current module to force reload of libgap (see #33446)
-+    lib = str_to_bytes(__loader__.path, FS_ENCODING, "surrogateescape")
-+    handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY)
-     if handle is NULL:
--        raise RuntimeError(
--                "Could not dlopen() libgap even though it should already "
--                "be loaded!")
-+        err = dlerror()
-+        raise RuntimeError(f"Could not reload gap library with RTLD_GLOBAL ({err})")
-     dlclose(handle)
- 
-     # Define argv variable, which we will pass in to
-@@ -245,7 +218,7 @@ cdef initialize():
-     cdef char* argv[16]
-     argv[0] = "sage"
-     argv[1] = "-l"
--    s = str_to_bytes(gap_root(), FS_ENCODING, "surrogateescape")
-+    s = str_to_bytes(sage.env.GAP_LIB_DIR + ";" + sage.env.GAP_SHARE_DIR, FS_ENCODING, "surrogateescape")
-     argv[2] = s
- 
-     argv[3] = "-m"
-@@ -362,15 +335,9 @@ cdef Obj gap_eval(str gap_string) except? NULL:
-         GAPError: Error, Variable: 'Complex' must have a value
-         Syntax error: ; expected in stream:1
-         Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^
-+                ^^^^^
-         Error, Variable: 'with' must have a value
--        Syntax error: ; expected in stream:1
--        Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^^^^^^^^^
-         Error, Variable: 'bits' must have a value
--        Syntax error: ; expected in stream:1
--        Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-         Error, Variable: 'precision' must have a value
- 
-     Test that on a subsequent attempt we get the same message (no garbage was
-diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx
-index d8ea7b07f3c..4beb1774df9 100644
---- a/src/sage/libs/singular/singular.pyx
-+++ b/src/sage/libs/singular/singular.pyx
-@@ -1705,14 +1705,7 @@ cdef object si2sa_intvec(intvec *v):
- cdef extern from *: # hack to get at cython macro
-     int unlikely(int)
- 
--cdef extern from "dlfcn.h":
--    void *dlopen(char *, long)
--    char *dlerror()
--    void dlclose(void *handle)
--
--cdef extern from "dlfcn.h":
--    cdef long RTLD_LAZY
--    cdef long RTLD_GLOBAL
-+from posix.dlfcn cimport dlopen, dlclose, dlerror, RTLD_LAZY, RTLD_GLOBAL
- 
- cdef int overflow_check(unsigned long e, ring *_ring) except -1:
-     """
-@@ -1762,8 +1755,6 @@ cdef init_libsingular():
- 
-     cdef void *handle = NULL
- 
--    from sage.env import LIBSINGULAR_PATH
--    lib = str_to_bytes(LIBSINGULAR_PATH, FS_ENCODING, "surrogateescape")
- 
-     # This is a workaround for https://github.com/Singular/Singular/issues/1113
-     # and can be removed once that fix makes it into release of Singular that
-@@ -1780,10 +1771,12 @@ cdef init_libsingular():
- 
-     import platform
-     if not platform.system().startswith("CYGWIN"):
-+        # reload the current module to force reload of libSingular (see #33446)
-+        lib = str_to_bytes(__loader__.path, FS_ENCODING, "surrogateescape")
-         handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY)
-         if not handle:
-             err = dlerror()
--            raise ImportError(f"cannot load Singular library from {LIBSINGULAR_PATH} ({err})")
-+            raise RuntimeError(f"Could not reload Singular library with RTLD_GLOBAL ({err})")
- 
-     # load SINGULAR
-     siInit(lib)
-diff --git a/src/sage/tests/gap_packages.py b/src/sage/tests/gap_packages.py
-index 2e4518ca226..c302b169b8a 100644
---- a/src/sage/tests/gap_packages.py
-+++ b/src/sage/tests/gap_packages.py
-@@ -103,7 +103,7 @@ def all_installed_packages(ignore_dot_gap=False, gap=None):
- 
-         sage: from sage.tests.gap_packages import all_installed_packages
-         sage: all_installed_packages()
--        (...'GAPDoc'...)
-+        (...'gapdoc'...)
-         sage: all_installed_packages(ignore_dot_gap=True) == all_installed_packages(gap=gap, ignore_dot_gap=True)
-         True
-     """
diff --git a/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch b/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
deleted file mode 100644
index d331a6573e1c..000000000000
--- a/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/src/sage/data_structures/stream.py b/src/sage/data_structures/stream.py
-index f8f6dc6a186..002e925f02f 100644
---- a/src/sage/data_structures/stream.py
-+++ b/src/sage/data_structures/stream.py
-@@ -2090,8 +2090,8 @@ def compute_product(self, n, la):
-             sage: f = Stream_exact([1]) # irrelevant for this test
-             sage: g = Stream_function(lambda n: s[n], True, 0)
-             sage: h = Stream_plethysm(f, g, True, p)
--            sage: B = p[2, 2, 1](sum(s[i] for i in range(7)))
--            sage: all(h.compute_product(k, Partition([2, 2, 1])) == B.restrict_degree(k) for k in range(7))
-+            sage: B = p[2, 2, 1](sum(p(s[i]) for i in range(7)))  # long time
-+            sage: all(h.compute_product(k, Partition([2, 2, 1])) == B.restrict_degree(k) for k in range(7))  # long time
-             True
-         """
-         # This is the approximate order of the result
diff --git a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch b/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
deleted file mode 100644
index 007f3324cfe4..000000000000
--- a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index b77c69b2f77..0586a96ae55 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -563,7 +563,7 @@ def complex_to_cmap_rgb(z_values, cmap='turbo', contoured=False, tiled=False,
-     import matplotlib as mpl
- 
-     if isinstance(cmap, str):
--        cmap = mpl.cm.get_cmap(cmap)
-+        cmap = mpl.colormaps[cmap]
- 
-     if contour_base is None:
-         if contour_type == "linear":
-@@ -1206,11 +1206,11 @@ def complex_plot(f, x_range, y_range, contoured=False, tiled=False, cmap=None,
-                 domain = np.linspace(0, 1, 256)
-                 shifted_domain = np.roll(domain, 128)
-                 default_cmap = mpl.colors.LinearSegmentedColormap.from_list(
--                    "sage_default", mpl.cm.get_cmap('hsv')(shifted_domain)
-+                    "sage_default", mpl.colormaps['hsv'](shifted_domain)
-                 )
-                 cmap = default_cmap
-             else:
--                cmap = mpl.cm.get_cmap(cmap)
-+                cmap = mpl.colormaps[cmap]
-         rgbs = complex_to_cmap_rgb(
-             z_values, cmap=cmap, contoured=contoured, tiled=tiled,
-             contour_type=contour_type, contour_base=contour_base,
-diff --git a/src/sage/plot/contour_plot.py b/src/sage/plot/contour_plot.py
-index c0cab456686..4accb309580 100644
---- a/src/sage/plot/contour_plot.py
-+++ b/src/sage/plot/contour_plot.py
-@@ -848,9 +848,7 @@ def f(x,y): return cos(x) + sin(y)
- 
-         sage: contour_plot(lambda x,y: 0, (-1,1), (-1,1),
-         ....:              contours=[0], fill=False, cmap=['blue'])
--        ...
--        UserWarning: No contour levels were found within the data range.
--        Graphics object consisting of 1 graphics primitive
-+        ...Graphics object consisting of 1 graphics primitive
- 
-     .. PLOT::
- 
-@@ -874,8 +872,7 @@ def f(x,y): return cos(x) + sin(y)
-     Check that :trac:`18074` is fixed::
- 
-         sage: contour_plot(0, (0,1), (0,1))
--        ... UserWarning: No contour levels were found within the data range.
--        Graphics object consisting of 1 graphics primitive
-+        ...Graphics object consisting of 1 graphics primitive
- 
-     Domain points in :trac:`11648` with complex output are now skipped::
- 
-diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
-index 64ea1a7e10f..cdc99ced263 100644
---- a/src/sage/plot/graphics.py
-+++ b/src/sage/plot/graphics.py
-@@ -2341,7 +2341,7 @@ def _matplotlib_tick_formatter(self, subplot, base=(10, 10),
-             sage: subplot = Figure().add_subplot(111)
-             sage: p._objects[0]._render_on_subplot(subplot)
-             sage: p._matplotlib_tick_formatter(subplot, **d)
--            (<AxesSubplot:...>,
-+            (<Axes...>,
-             <matplotlib.ticker.MaxNLocator object at ...>,
-             <matplotlib.ticker.MaxNLocator object at ...>,
-             <matplotlib.ticker.ScalarFormatter object at ...>,
-diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
-index 99c817f03a6..ae85183dc93 100644
---- a/src/sage/plot/multigraphics.py
-+++ b/src/sage/plot/multigraphics.py
-@@ -1207,7 +1207,7 @@ def _add_subplot(self, figure, index, **options):
-             sage: fig = Figure()
-             sage: ax1 = G._add_subplot(fig, 0)
-             sage: type(ax1)
--            <class 'matplotlib.axes._subplots.AxesSubplot'>
-+            <class 'matplotlib.axes...'>
-             sage: ax2 = G._add_subplot(fig, 1)
-             sage: fig.get_axes() == [ax1, ax2]
-             True
-diff --git a/src/sage/plot/plot3d/plot_field3d.py b/src/sage/plot/plot3d/plot_field3d.py
-index bdf39391d3e..fe10e27f58f 100644
---- a/src/sage/plot/plot3d/plot_field3d.py
-+++ b/src/sage/plot/plot3d/plot_field3d.py
-@@ -126,9 +126,9 @@ def plot_vector_field3d(functions, xrange, yrange, zrange,
-     vectors = [vector((ff(*point), gg(*point), hh(*point))) for point in points]
- 
-     try:
--        from matplotlib.cm import get_cmap
--        cm = get_cmap(colors)
--    except (TypeError, ValueError):
-+        import matplotlib as mpl
-+        cm = mpl.colormaps[colors]
-+    except (TypeError, KeyError):
-         cm = None
-     if cm is None:
-         if isinstance(colors, (list, tuple)):
diff --git a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch b/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
deleted file mode 100644
index 1e0a708e8068..000000000000
--- a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py
-index c9ca5e30939..9459cb70334 100644
---- a/src/sage/interfaces/maxima_lib.py
-+++ b/src/sage/interfaces/maxima_lib.py
-@@ -77,6 +77,26 @@
-     sage: bar == foo
-     True
- 
-+TESTS:
-+
-+Check our workaround for a race in ecl works, see :trac:`26968`.
-+We use a temporary `MAXIMA_USERDIR` so it's empty; we place it
-+in `DOT_SAGE` since we expect it to have more latency than `/tmp`.
-+
-+    sage: import tempfile, subprocess
-+    sage: tmpdir = tempfile.TemporaryDirectory(dir=DOT_SAGE)
-+    sage: _ = subprocess.run(['sage', '-c',  # long time
-+    ....: f'''
-+    ....: import os
-+    ....: os.environ["MAXIMA_USERDIR"] = "{tmpdir.name}"
-+    ....: if not os.fork():
-+    ....:     import sage.interfaces.maxima_lib
-+    ....: else:
-+    ....:     import sage.interfaces.maxima_lib
-+    ....:     os.wait()
-+    ....: '''])
-+    sage: tmpdir.cleanup()
-+
- """
- 
- # ****************************************************************************
-@@ -116,7 +136,23 @@
- ecl_eval("(setq $nolabels t))")
- ecl_eval("(defvar *MAXIMA-LANG-SUBDIR* NIL)")
- ecl_eval("(set-locale-subdir)")
--ecl_eval("(set-pathnames)")
-+
-+try:
-+    ecl_eval("(set-pathnames)")
-+except RuntimeError:
-+    # Recover from :trac:`26968` by creating `*maxima-objdir*` here.
-+    # This cannot be done before calling `(set-pathnames)` since
-+    # `*maxima-objdir*` is computed there.
-+    # We use python `os.makedirs()` which is immune to the race.
-+    # Using `(ensure-directories-exist ...)` in lisp would be
-+    # subject to the same race condition and since `*maxima-objdir*`
-+    # has multiple components this is quite plausible to happen.
-+    maxima_objdir = ecl_eval("*maxima-objdir*").python()[1:-1]
-+    import os
-+    os.makedirs(maxima_objdir, exist_ok=True)
-+    # Call `(set-pathnames)` again to complete its job.
-+    ecl_eval("(set-pathnames)")
-+
- ecl_eval("(defun add-lineinfo (x) x)")
- ecl_eval('(defun principal nil (cond ($noprincipal (diverg)) ((not pcprntd) (merror "Divergent Integral"))))')
- ecl_eval("(remprop 'mfactorial 'grind)")  # don't use ! for factorials (#11539)
diff --git a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch b/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
deleted file mode 100644
index fc3e40da2a88..000000000000
--- a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff --git a/src/bin/sage-cleaner b/src/bin/sage-cleaner
-index e2e578eec60..dc7d8f0482e 100755
---- a/src/bin/sage-cleaner
-+++ b/src/bin/sage-cleaner
-@@ -99,6 +99,15 @@ def cleanup():
- 
-     return len(pid_list)
- 
-+def cleanup_cruft():
-+    """ remove directories leftover from improper shutdown """
-+    tmp_dirs = os.listdir(SAGE_TMP_ROOT)
-+    for dir_entry in tmp_dirs:
-+        baddir = os.path.join(SAGE_TMP_ROOT, dir_entry)
-+        if os.path.isdir(baddir):
-+            logger.warning('Removing old directory %s from SAGE_TMP_ROOT', baddir)
-+            rm_rf(baddir)
-+
- def kill_spawned_jobs(jobfile, parent_pid):
-     logger.info("Killing %s's spawned jobs", parent_pid)
-     killed_them_all = True
-@@ -193,6 +202,7 @@ if __name__ == '__main__':
-     setup_daemon()
-     fix_old_mistakes()
-     logger.info("Starting sage-cleaner with PID %s", os.getpid())
-+    cleanup_cruft()
- 
-     if len(sys.argv) > 1:
-         wait = int(sys.argv[1])
diff --git a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch b/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
deleted file mode 100644
index ea210e20ae52..000000000000
--- a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py
-index ec6a5c19e60..9dd7bc1cb1e 100644
---- a/src/sage/graphs/generators/families.py
-+++ b/src/sage/graphs/generators/families.py
-@@ -3660,7 +3660,7 @@ def nauty_gentreeg(options="", debug=False):
- 
-         sage: gen = graphs.nauty_gentreeg("4", debug=True)
-         sage: print(next(gen))
--        >A ...gentreeg Z=2:3 D=3 n=4
-+        >A ...gentreeg ...
-         sage: gen = graphs.nauty_gentreeg("4 -q", debug=True)
-         sage: next(gen)
-         ''
-@@ -3687,7 +3687,7 @@ def nauty_gentreeg(options="", debug=False):
-         sage: list(graphs.nauty_gentreeg("3 -x", debug=True))
-         ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n [res/mod] ...
-         sage: list(graphs.nauty_gentreeg("3", debug=True))
--        ['>A ...gentreeg Z=2:2 D=2 n=3\n', Graph on 3 vertices]
-+        ['>A ...gentreeg ...\n', Graph on 3 vertices]
-     """
-     import shlex
-     from sage.features.nauty import NautyExecutable
-diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py
-index df88bbe2713..1a8016976c2 100644
---- a/src/sage/graphs/graph_generators.py
-+++ b/src/sage/graphs/graph_generators.py
-@@ -966,7 +966,7 @@ def nauty_geng(self, options="", debug=False):
-             ...
-             ValueError: wrong format of parameter option
-             sage: list(graphs.nauty_geng("-c3", debug=True))
--            ['>E Usage: ...geng [-cCmtfbd#D#] [-uygsnh] [-lvq] ...
-+            ['>E Usage: ...geng ...\n']
-             sage: list(graphs.nauty_geng("-c 3", debug=True))
-             ['>A ...geng -cd1D2 n=3 e=2-3\n', Graph on 3 vertices, Graph on 3 vertices]
-         """
diff --git a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch b/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
deleted file mode 100644
index 46bda084e48e..000000000000
--- a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-diff --git a/src/sage/repl/inputhook.py b/src/sage/repl/inputhook.py
-index da5df0268c0..7f7894f6dcf 100644
---- a/src/sage/repl/inputhook.py
-+++ b/src/sage/repl/inputhook.py
-@@ -17,6 +17,8 @@
- 
- import select
- import errno
-+import contextlib
-+import io
- 
- from IPython import get_ipython
- from IPython.terminal.pt_inputhooks import register
-@@ -47,15 +49,27 @@ def install():
-     """
-     Install the Sage input hook
- 
--    EXAMPLES::
-+    EXAMPLES:
-+
-+    Make sure ipython is running so we really test this function::
-+
-+        sage: from sage.repl.interpreter import get_test_shell
-+        sage: get_test_shell()
-+        <sage.repl.interpreter.SageTestShell object at ...>
-+
-+    Run the function twice, to check it is idempotent (see :trac:`35235`)::
- 
-         sage: from sage.repl.inputhook import install
-         sage: install()
-+        sage: install()
-     """
-     ip = get_ipython()
-     if not ip:
-         return   # Not running in ipython, e.g. doctests
--    ip.enable_gui('sage')
-+    if ip._inputhook != sage_inputhook:
-+        # silence `ip.enable_gui()` useless output
-+        with contextlib.redirect_stdout(io.StringIO()):
-+            ip.enable_gui('sage')
- 
- 
- def uninstall():
-@@ -71,4 +85,6 @@ def uninstall():
-     if not ip:
-         return
-     if ip._inputhook == sage_inputhook:
--        ip.enable_gui(None)
-+        # silence `ip.enable_gui()` useless output
-+        with contextlib.redirect_stdout(io.StringIO()):
-+            ip.enable_gui(None)
diff --git a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch b/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
deleted file mode 100644
index 2cdc674d4f9e..000000000000
--- a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 532fbbaf71bb41c73920b584108eb2a09d6deeb1 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
-Date: Tue, 4 Apr 2023 12:56:57 -0300
-Subject: [PATCH] Ignore deprecation warnings triggered by pythran 0.12.1
-
-These happen with python 3.11, setuptools 67.6.1, numpy 1.24.2.
-When pythran 0.12.1 is installed, I get 24 doctest failures due to
-deprecation warnings; they are all gone with this commit.
-
-[backported from 839a6e928c264a9863bd42860c78ae95a6d9f3e0]
----
- src/sage/all.py | 12 ++++++++++--
- 1 file changed, 10 insertions(+), 2 deletions(-)
-
-diff --git a/src/sage/all.py b/src/sage/all.py
-index 93588df1b93..ee775aad0e9 100644
---- a/src/sage/all.py
-+++ b/src/sage/all.py
-@@ -96,9 +96,17 @@ warnings.filterwarnings('ignore', category=DeprecationWarning,
- warnings.filterwarnings('ignore', category=DeprecationWarning,
-     module='(.*[.]_vendor[.])?packaging')
- 
--# Ignore numpy warnings triggered by pythran
-+# Ignore a few warnings triggered by pythran 0.12.1
- warnings.filterwarnings('ignore', category=DeprecationWarning,
--                        module='pythran')
-+    message='\n\n  `numpy.distutils` is deprecated since NumPy 1.23.0',
-+    module='pythran.dist')
-+warnings.filterwarnings('ignore', category=DeprecationWarning,
-+    message='pkg_resources is deprecated as an API|'
-+            'Deprecated call to `pkg_resources.declare_namespace(.*)`',
-+    module='pkg_resources')
-+warnings.filterwarnings('ignore', category=DeprecationWarning,
-+    message='msvccompiler is deprecated and slated to be removed',
-+    module='distutils.msvccompiler')
- 
- warnings.filterwarnings('ignore', category=DeprecationWarning,
-                         message='The distutils(.sysconfig module| package) is deprecated',
--- 
-2.40.0
-
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index db36086fc9f9..73e9607aa1fb 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 URL_BASE_PR="https://github.com/sagemath/sage/pull/"
-URL_BASE_COMPARE="https://github.com/sagemath/sage/compare/9.8..."
+URL_BASE_COMPARE="https://github.com/sagemath/sage/compare/10.0.rc0..."
 
 case "$1" in
 	-n)  DO=echo ;;
@@ -15,50 +15,9 @@ get_pr() {
 	$DO wget "$URL_BASE_PR$pr.$ext" -O "$pr-$desc.patch"
 }
 
-get_trac() {
-	ticket=$1
-	desc=$(echo "$2" | sed -e 's/ /_/g')
-	commit=$3
-	$DO wget "$URL_BASE_COMPARE$commit.diff" -O "$ticket-$desc-$commit.patch"
-}
-
 # run from patches dir
 cd $(dirname "$0")
 
-# merged in 10.0.beta0
-get_trac 34851 "support singular 4.3.1.p3" 5e5737a0c
-get_pr 35068 "fix tests giac 1.9.0.35" patch
-
-# merged in 10.0.beta1
-get_pr 35058 "skip unstable tests klyachko"
-
-# merged in 10.0.beta2
-get_pr 34994 "fix tests numpy 1.24"
-get_pr 34997 "fix edge case of integer_check"
-
-# merged in 10.0.beta3
-get_pr 34995 "support tachyon 0.99.2"
-
-# merged in 10.0.beta4
-get_pr 34980 "avoid factoring in is_prime"
-
-# merged in 10.0.beta5
-get_pr 35094 "support gap 4.12"					# includes PR 35093
-
-# merged in 10.0.beta6
-get_pr 35127 "fix very slow test stream.py"
-get_pr 35177 "matplotlib 3.7"
-get_pr 35195 "workaround ecl race"
-get_pr 35204 "fix sage-cleaner"
-
-# merged in 10.0.beta7
-get_pr 35250 "nauty 2.8.6"
-
-# merged in 10.0.beta8
-#get_pr 35337 "ipython 8.11"
-get_pr 35423 "ipython 8.12"						# includes PR 35337
-get_pr 35438 "pythran 0.12.1"
-
 # needs review
 get_pr 35584 "networkx 3.1"
 get_pr 35612 "linbox 1.7"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 6e794c931df4..a74fb49aa9b5 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=9.8
-revision=3
+version=10.0.rc1
+revision=1
 build_wrksrc=pkgs/sagemath-standard
 build_style=python3-module
 _bindir=/usr/lib/sagemath/$version/bin
@@ -32,7 +32,7 @@ maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-or-later"
 homepage="http://sagemath.org/"
 distfiles="https://github.com/sagemath/sage/archive/refs/tags/$version.tar.gz"
-checksum=2aff28bd1d18c2d526581f5298acb8336f5b92db5675a7403dec8eaf9a86bc4c
+checksum=3289d56637e3ce7f90571e136b0b243bf59920d6ae1cfc1cd6ea4e2391f39779
 
 do_configure() {
 	# git tree needs bootstrapping

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [RFC] sagemath: update to 10.0.rc1.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (5 preceding siblings ...)
  2023-05-05  1:46 ` tornaria
@ 2023-05-05  1:51 ` tornaria
  2023-05-05 12:28 ` tornaria
                   ` (32 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: tornaria @ 2023-05-05  1:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 414 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43659#issuecomment-1535599571

Comment:
- Updated to 10.0.rc1
- included #42326 

As of now we need just two patches coming from upstream:
 - https://github.com/sagemath/sage/pull/35584
 - https://github.com/sagemath/sage/pull/35612
 
Hopefully both will be merged upstream for the upcoming 10.0 release.

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [RFC] sagemath: update to 10.0.rc1.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (6 preceding siblings ...)
  2023-05-05  1:51 ` [RFC] sagemath: update to 10.0.rc1 tornaria
@ 2023-05-05 12:28 ` tornaria
  2023-05-05 19:16 ` [PR PATCH] [Updated] " tornaria
                   ` (31 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: tornaria @ 2023-05-05 12:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 793 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43659#issuecomment-1536187503

Comment:
CI failure on i686, when checking linbox:
```
...
 FAIL: test-minpoly
...
============================================================================
Testsuite summary for LinBox 1.7.0
============================================================================
# TOTAL: 40
# PASS:  39
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0
============================================================================
See tests/test-suite.log
Please report to linbox-use@googlegroups.com
============================================================================```
```
The exact same thing run in #42326 without any failure...

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] sagemath: update to 10.0.rc1.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (7 preceding siblings ...)
  2023-05-05 12:28 ` tornaria
@ 2023-05-05 19:16 ` tornaria
  2023-05-06  1:16 ` tornaria
                   ` (30 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: tornaria @ 2023-05-05 19:16 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1700 bytes --]

There is an updated pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages sagemath-next
https://github.com/void-linux/void-packages/pull/43659

[RFC] sagemath: update to 10.0.rc1.
<!-- Uncomment relevant sections and delete options which are not applicable -->

This builds on top of #43225 for convenience.

#### Testing the changes
- I tested the changes in this PR: **briefly**

I've been following beta releases and now rc0 includes all of our patches :muscle:

All doctests pass with the version of packages in void except for `python-Babel` which must be updated (as in #43497) and is included  here as part of #43225.

I've switched my system sagemath to this version as everything seems to be working ok. The testsuite is 10-15% faster.

@dkwo: enjoy.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/43659.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-sagemath-next-43659.patch --]
[-- Type: text/x-diff, Size: 149885 bytes --]

From 296f569064cfd5efa639b11ea95a4932a07d3203 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Dec 2021 20:20:09 -0300
Subject: [PATCH 1/5] givaro: update to 4.2.0.

---
 srcpkgs/givaro/patches/197.patch | 28 ++++++++++++++++++++++++++++
 srcpkgs/givaro/template          |  9 ++++-----
 2 files changed, 32 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/givaro/patches/197.patch

diff --git a/srcpkgs/givaro/patches/197.patch b/srcpkgs/givaro/patches/197.patch
new file mode 100644
index 000000000000..bafaff3efbd9
--- /dev/null
+++ b/srcpkgs/givaro/patches/197.patch
@@ -0,0 +1,28 @@
+From ab3d332508c21daff41fb64a8658cdc7cc74fc47 Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
+Date: Thu, 16 Dec 2021 17:12:25 +0100
+Subject: [PATCH] dom_power argument is now an uint64_t to avoid problem with
+ 32bit machine
+
+---
+ src/kernel/system/givpower.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/kernel/system/givpower.h b/src/kernel/system/givpower.h
+index eb784872..5644264d 100644
+--- a/src/kernel/system/givpower.h
++++ b/src/kernel/system/givpower.h
+@@ -71,11 +71,11 @@ namespace Givaro {
+ 
+     //! dom_power
+     template<class D, class TT>
+-    TT& dom_power(TT& res, const TT& n, long l, const D& F)
++    TT& dom_power(TT& res, const TT& n, uint64_t l, const D& F)
+     {
+         if (l == 0) return F.assign(res,F.one) ;
+ 
+-        unsigned long p = (unsigned long) l ;
++        uint64_t p = l;
+         bool is_assg = false ;
+ 
+         TT puiss; F.init(puiss); F.assign(puiss,n) ;
diff --git a/srcpkgs/givaro/template b/srcpkgs/givaro/template
index 9c16de5b1974..52457c02a1ed 100644
--- a/srcpkgs/givaro/template
+++ b/srcpkgs/givaro/template
@@ -1,6 +1,6 @@
 # Template file for 'givaro'
 pkgname=givaro
-version=4.1.1
+version=4.2.0
 revision=1
 build_style=gnu-configure
 makedepends="gmpxx-devel"
@@ -8,16 +8,15 @@ short_desc="C++ library for arithmetic and algebraic computations"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="CECILL-B"
 homepage="https://github.com/linbox-team/givaro"
+changelog="https://github.com/linbox-team/givaro/raw/master/ChangeLog"
 distfiles="https://github.com/linbox-team/givaro/releases/download/v${version}/givaro-${version}.tar.gz"
-checksum=628049899386e91da245aee6cd446350fbca87e94863bc0d815066c08150487f
+checksum=865e228812feca971dfb6e776a7bc7ac959cf63ebd52b4f05492730a46e1f189
 nocross=yes
 
 build_options="native_build"
 
 if [ -z "$build_option_native_build" ]; then
-	configure_args="--enable-sse --enable-sse2
-	  --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42
-	  --disable-avx --disable-avx2 --disable-fma --disable-fma4"
+	configure_args="--without-archnative"
 fi
 
 post_install() {

From 6667f066733f6d9d70087a4d285f0cdcb68581df Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Dec 2021 20:20:17 -0300
Subject: [PATCH 2/5] fflas-ffpack: update to 2.5.0.

---
 srcpkgs/fflas-ffpack/patches/357.patch | 35 ++++++++++++++++++++++++++
 srcpkgs/fflas-ffpack/template          | 12 ++++-----
 2 files changed, 40 insertions(+), 7 deletions(-)
 create mode 100644 srcpkgs/fflas-ffpack/patches/357.patch

diff --git a/srcpkgs/fflas-ffpack/patches/357.patch b/srcpkgs/fflas-ffpack/patches/357.patch
new file mode 100644
index 000000000000..99fd34efd93b
--- /dev/null
+++ b/srcpkgs/fflas-ffpack/patches/357.patch
@@ -0,0 +1,35 @@
+From 9b6083c663096e9ca85775b79f1f27c848dbeb98 Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
+Date: Fri, 17 Dec 2021 10:27:02 +0100
+Subject: [PATCH] Fix SimdChooser: on not x86_64 machines its value could be an
+ nonexistant struct
+
+---
+ fflas-ffpack/fflas/fflas_simd.h | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/fflas-ffpack/fflas/fflas_simd.h b/fflas-ffpack/fflas/fflas_simd.h
+index bf5d30211..84ced0fd8 100644
+--- a/fflas-ffpack/fflas/fflas_simd.h
++++ b/fflas-ffpack/fflas/fflas_simd.h
+@@ -384,6 +384,20 @@ struct SimdChooser<T, true, true> // integral number
+ #endif
+ };
+ 
++#ifndef __x86_64__
++template <>
++struct SimdChooser<uint64_t, true, true>
++{
++    using value = NoSimd<uint64_t>;
++};
++
++template <>
++struct SimdChooser<int64_t, true, true>
++{
++    using value = NoSimd<int64_t>;
++};
++#endif
++
+ template <class T> using Simd = typename SimdChooser<T>::value;
+ 
+ // template <class T> struct SimdChooser<T, true> {
diff --git a/srcpkgs/fflas-ffpack/template b/srcpkgs/fflas-ffpack/template
index 557c644c00a4..2aa599703585 100644
--- a/srcpkgs/fflas-ffpack/template
+++ b/srcpkgs/fflas-ffpack/template
@@ -1,6 +1,6 @@
 # Template file for 'fflas-ffpack'
 pkgname=fflas-ffpack
-version=2.4.3
+version=2.5.0
 revision=1
 build_style=gnu-configure
 hostmakedepends="pkg-config"
@@ -10,15 +10,13 @@ short_desc="Finite Field Linear Algebra Subroutines / Package"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="LGPL-2.1-or-later"
 homepage="http://linbox-team.github.io/fflas-ffpack/"
-distfiles="https://github.com/linbox-team/fflas-ffpack/releases/download/${version}/fflas-ffpack-${version}.tar.gz"
-checksum=f372783a17a9899ee9f88d4c9421d80facccb95556146dad7020d07a03791cc9
+changelog="https://github.com/linbox-team/fflas-ffpack/raw/master/ChangeLog"
+distfiles="https://github.com/linbox-team/fflas-ffpack/releases/download/v${version}/fflas-ffpack-${version}.tar.gz"
+checksum=dafb4c0835824d28e4f823748579be6e4c8889c9570c6ce9cce1e186c3ebbb23
 nocross=yes
 
 build_options="native_build"
 
 if [ -z "$build_option_native_build" ]; then
-	configure_args="--enable-sse --enable-sse2
-	  --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42
-	  --disable-avx --disable-avx2 --disable-fma --disable-fma4
-	  --disable-avx512f --disable-avx512dq --disable-avx512vl"
+	configure_args="--without-archnative"
 fi

From 277dff14025d4b017bb13f13ef86dfcac4cef86f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Dec 2021 20:20:20 -0300
Subject: [PATCH 3/5] linbox: update to 1.7.0.

---
 srcpkgs/linbox/patches/292.patch              | 24 ++++++++++++
 srcpkgs/linbox/patches/294.patch              | 38 +++++++++++++++++++
 ...8adade10641f1f04f04b589753d928fb5443.patch | 35 -----------------
 .../remove-linboxsage-libs-from-pc.patch      | 23 -----------
 srcpkgs/linbox/template                       | 11 +++---
 5 files changed, 67 insertions(+), 64 deletions(-)
 create mode 100644 srcpkgs/linbox/patches/292.patch
 create mode 100644 srcpkgs/linbox/patches/294.patch
 delete mode 100644 srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch
 delete mode 100644 srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch

diff --git a/srcpkgs/linbox/patches/292.patch b/srcpkgs/linbox/patches/292.patch
new file mode 100644
index 000000000000..d3333cc23d0b
--- /dev/null
+++ b/srcpkgs/linbox/patches/292.patch
@@ -0,0 +1,24 @@
+From 49b9cccd0286980c1c1811c3b03df883ef0164df Mon Sep 17 00:00:00 2001
+From: Doug Torrance <dtorrance@piedmont.edu>
+Date: Tue, 14 Dec 2021 16:22:33 -0500
+Subject: [PATCH] Only register uint128_t as a TypeName when it's available.
+
+Otherwise, test-fft will fail when it isn't.
+---
+ tests/test-fft.C | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/tests/test-fft.C b/tests/test-fft.C
+index d19184c2d..5811ebc5d 100644
+--- a/tests/test-fft.C
++++ b/tests/test-fft.C
+@@ -55,7 +55,9 @@ REGISTER_TYPE_NAME(double);
+ REGISTER_TYPE_NAME(uint16_t);
+ REGISTER_TYPE_NAME(uint32_t);
+ REGISTER_TYPE_NAME(uint64_t);
++#ifdef __FFLASFFPACK_HAVE_INT128
+ REGISTER_TYPE_NAME(uint128_t);
++#endif
+ REGISTER_TYPE_NAME(Modular);
+ REGISTER_TYPE_NAME(ModularExtended);
+ 
diff --git a/srcpkgs/linbox/patches/294.patch b/srcpkgs/linbox/patches/294.patch
new file mode 100644
index 000000000000..7c645f165d39
--- /dev/null
+++ b/srcpkgs/linbox/patches/294.patch
@@ -0,0 +1,38 @@
+From f81a1f4a5e0835b7a0f3bb88a0fcbbaa32174cfa Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
+Date: Wed, 15 Dec 2021 16:00:39 +0100
+Subject: [PATCH] Only register uint128_t as a TypeName when it's available
+
+---
+ benchmarks/benchmark-fft.C                       | 2 ++
+ benchmarks/benchmark-polynomial-matrix-mul-fft.C | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/benchmarks/benchmark-fft.C b/benchmarks/benchmark-fft.C
+index 39b86c9d9..59a8be57c 100644
+--- a/benchmarks/benchmark-fft.C
++++ b/benchmarks/benchmark-fft.C
+@@ -54,7 +54,9 @@ REGISTER_TYPE_NAME(double);
+ REGISTER_TYPE_NAME(uint16_t);
+ REGISTER_TYPE_NAME(uint32_t);
+ REGISTER_TYPE_NAME(uint64_t);
++#ifdef __FFLASFFPACK_HAVE_INT128
+ REGISTER_TYPE_NAME(uint128_t);
++#endif
+ REGISTER_TYPE_NAME(Modular);
+ REGISTER_TYPE_NAME(ModularExtended);
+ 
+diff --git a/benchmarks/benchmark-polynomial-matrix-mul-fft.C b/benchmarks/benchmark-polynomial-matrix-mul-fft.C
+index e9b184bcf..7bf17f33e 100644
+--- a/benchmarks/benchmark-polynomial-matrix-mul-fft.C
++++ b/benchmarks/benchmark-polynomial-matrix-mul-fft.C
+@@ -65,7 +65,9 @@ REGISTER_TYPE_NAME(double);
+ REGISTER_TYPE_NAME(uint16_t);
+ REGISTER_TYPE_NAME(uint32_t);
+ REGISTER_TYPE_NAME(uint64_t);
++#ifdef __FFLASFFPACK_HAVE_INT128
+ REGISTER_TYPE_NAME(uint128_t);
++#endif
+ REGISTER_TYPE_NAME(Modular);
+ REGISTER_TYPE_NAME(ModularExtended);
+ 
diff --git a/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch b/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch
deleted file mode 100644
index 5afa078ec7b8..000000000000
--- a/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 892f8adade10641f1f04f04b589753d928fb5443 Mon Sep 17 00:00:00 2001
-From: Doug Torrance <dtorrance@piedmont.edu>
-Date: Sun, 9 May 2021 12:14:19 -0400
-Subject: [PATCH] Use std::ptrdiff_t for vector iterator difference type
-
-It was previously long (64-bit integers), but this will not be the
-case on 32-bit systems.
-
-Closes: #273
----
- linbox/vector/bit-vector.inl | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/linbox/vector/bit-vector.inl b/linbox/vector/bit-vector.inl
-index 5fa84b421..23a22ba47 100644
---- a/linbox/vector/bit-vector.inl
-+++ b/linbox/vector/bit-vector.inl
-@@ -46,7 +46,7 @@ namespace std
- 		typedef LinBox::BitVector::reference reference;
- 		typedef bool *pointer;
- 		typedef bool value_type;
--		typedef long difference_type;
-+		typedef std::ptrdiff_t difference_type;
- 	};
- 
- 	template <>
-@@ -56,7 +56,7 @@ namespace std
- 		typedef LinBox::BitVector::const_reference reference;
- 		typedef const bool *pointer;
- 		typedef bool value_type;
--		typedef long difference_type;
-+		typedef std::ptrdiff_t difference_type;
- 	};
- }
- 
diff --git a/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch b/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch
deleted file mode 100644
index c93915fb1b06..000000000000
--- a/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Backported from:
-
-From 426eb97ba762c7663884f57ead0909f2aa3cd6a5 Mon Sep 17 00:00:00 2001
-From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
-Date: Thu, 17 Jan 2019 16:32:19 +0100
-Subject: [PATCH] Remove @LINBOXSAGE_LIBS@ from linbox.pc.in
-
----
- linbox.pc.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/linbox.pc.in b/linbox.pc.in
-index 278f127e4..c6b8091eb 100644
---- a/linbox.pc.in
-+++ b/linbox.pc.in
-@@ -9,6 +9,6 @@ Description: Exact Linear Algebra library
- URL: http://github.com/linbox-team/linbox
- Version: @VERSION@
- Requires: fflas-ffpack >= 2.4.0, givaro >= 4.1.0
--Libs: -L${libdir} -llinbox @LINBOXSAGE_LIBS@ @NTL_LIBS@ @MPFR_LIBS@ @FPLLL_LIBS@ @IML_LIBS@ @FLINT_LIBS@ @OCL_LIBS@
-+Libs: -L${libdir} -llinbox @NTL_LIBS@ @MPFR_LIBS@ @FPLLL_LIBS@ @IML_LIBS@ @FLINT_LIBS@ @OCL_LIBS@
- Cflags: @DEFAULT_CFLAGS@ -DDISABLE_COMMENTATOR -I${includedir} @NTL_CFLAGS@ @MPFR_CFLAGS@ @FPLLL_CFLAGS@  @IML_CFLAGS@ @FLINT_CFLAGS@ 
- \-------------------------------------------------------
diff --git a/srcpkgs/linbox/template b/srcpkgs/linbox/template
index 096a15b3390b..e6edacdd0a74 100644
--- a/srcpkgs/linbox/template
+++ b/srcpkgs/linbox/template
@@ -1,7 +1,7 @@
 # Template file for 'linbox'
 pkgname=linbox
-version=1.6.3
-revision=2
+version=1.7.0
+revision=1
 build_style=gnu-configure
 hostmakedepends="pkg-config"
 makedepends="fflas-ffpack"
@@ -9,16 +9,15 @@ short_desc="C++ library for exact, high-performance linear algebra"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="LGPL-2.1-or-later"
 homepage="https://linalg.org"
+changelog="https://github.com/linbox-team/linbox/raw/master/ChangeLog"
 distfiles="https://github.com/linbox-team/linbox/releases/download/v${version}/linbox-${version}.tar.gz"
-checksum=a58a188307b07c57964e844bceb99321d3043a8a4a1fccc082a54928bb9a0057
+checksum=6d2159fd395be0298362dd37f6c696676237bc8e2757341fbc46520e3b466bcc
 nocross=yes
 
 build_options="native_build"
 
 if [ -z "$build_option_native_build" ]; then
-	configure_args="--enable-sse --enable-sse2
-	  --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42
-	  --disable-avx --disable-avx2 --disable-fma --disable-fma4"
+	configure_args="--without-archnative"
 fi
 
 linbox-devel_package() {

From 7cd0f09d1949944cd8d143678962c2f50e5906cb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Feb 2023 22:53:33 -0300
Subject: [PATCH 4/5] sagemath: rebuild for linbox 1.7.0

---
 .../sagemath/patches/35612-linbox_1.7.patch   | 64 +++++++++++++++++++
 srcpkgs/sagemath/patches/get_patches          |  1 +
 srcpkgs/sagemath/template                     |  2 +-
 3 files changed, 66 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/sagemath/patches/35612-linbox_1.7.patch

diff --git a/srcpkgs/sagemath/patches/35612-linbox_1.7.patch b/srcpkgs/sagemath/patches/35612-linbox_1.7.patch
new file mode 100644
index 000000000000..58dddf34a69d
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35612-linbox_1.7.patch
@@ -0,0 +1,64 @@
+diff --git a/src/sage/libs/linbox/conversion.pxd b/src/sage/libs/linbox/conversion.pxd
+index 7794c9edc39..1753277b1f1 100644
+--- a/src/sage/libs/linbox/conversion.pxd
++++ b/src/sage/libs/linbox/conversion.pxd
+@@ -177,9 +177,8 @@ cdef inline Vector_integer_dense new_sage_vector_integer_dense(P, DenseVector_in
+     - v -- linbox vector
+     """
+     cdef Vector_integer_dense res = P()
+-    cdef cppvector[Integer] * vec = &v.refRep()
+     cdef size_t i
+     for i in range(<size_t> res._degree):
+-        mpz_set(res._entries[i], vec[0][i].get_mpz_const())
++        mpz_set(res._entries[i], v.getEntry(i).get_mpz_const())
+ 
+     return res
+diff --git a/src/sage/libs/linbox/linbox.pxd b/src/sage/libs/linbox/linbox.pxd
+index 9112d151f8b..bfeda4b6042 100644
+--- a/src/sage/libs/linbox/linbox.pxd
++++ b/src/sage/libs/linbox/linbox.pxd
+@@ -32,7 +32,6 @@ cdef extern from "linbox/matrix/dense-matrix.h":
+         ctypedef Modular_double Field
+         ctypedef double Element
+         DenseMatrix_Modular_double(Field F, size_t m, size_t n)
+-        DenseMatrix_Modular_double(Field F, Element*, size_t m, size_t n)
+         void setEntry(size_t i, size_t j, Element& a)
+         Element &getEntry(size_t i, size_t j)
+ 
+@@ -42,7 +41,6 @@ cdef extern from "linbox/matrix/dense-matrix.h":
+         ctypedef Modular_float Field
+         ctypedef float Element
+         DenseMatrix_Modular_float(Field F, size_t m, size_t n)
+-        DenseMatrix_Modular_float(Field F, Element*, size_t m, size_t n)
+         void setEntry(size_t i, size_t j, Element& a)
+         Element &getEntry(size_t i, size_t j)
+ 
+@@ -101,7 +99,6 @@ cdef extern from "linbox/vector/vector.h":
+         DenseVector_integer (Field &F)
+         DenseVector_integer (Field &F, long& m)
+         DenseVector_integer (Field &F, cppvector[Integer]&)
+-        cppvector[Element]& refRep()
+         size_t size()
+         void resize(size_t)
+         void resize(size_t n, const Element&)
+diff --git a/src/sage/matrix/matrix_modn_dense_template.pxi b/src/sage/matrix/matrix_modn_dense_template.pxi
+index abf29badce6..68b869ce314 100644
+--- a/src/sage/matrix/matrix_modn_dense_template.pxi
++++ b/src/sage/matrix/matrix_modn_dense_template.pxi
+@@ -221,9 +221,14 @@ cdef inline linbox_echelonize_efd(celement modulus, celement* entries, Py_ssize_
+         return 0,[]
+ 
+     cdef ModField *F = new ModField(<long>modulus)
+-    cdef DenseMatrix *A = new DenseMatrix(F[0], <ModField.Element*>entries,<Py_ssize_t>nrows, <Py_ssize_t>ncols)
+-    cdef Py_ssize_t r = reducedRowEchelonize(A[0])
++    cdef DenseMatrix *A = new DenseMatrix(F[0], nrows, ncols)
++
+     cdef Py_ssize_t i,j
++    for i in range(nrows):
++        for j in range(ncols):
++            A.setEntry(i, j, entries[i*ncols+j])
++
++    cdef Py_ssize_t r = reducedRowEchelonize(A[0])
+     for i in range(nrows):
+         for j in range(ncols):
+             entries[i*ncols+j] = <celement>A.getEntry(i,j)
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 871ae38577fd..db36086fc9f9 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -61,3 +61,4 @@ get_pr 35438 "pythran 0.12.1"
 
 # needs review
 get_pr 35584 "networkx 3.1"
+get_pr 35612 "linbox 1.7"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 66a543efd21d..6e794c931df4 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
 version=9.8
-revision=2
+revision=3
 build_wrksrc=pkgs/sagemath-standard
 build_style=python3-module
 _bindir=/usr/lib/sagemath/$version/bin

From e2c6e25b25b4c63a5f13706f4f7717282f6025fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Tue, 25 Apr 2023 13:20:47 -0300
Subject: [PATCH 5/5] sagemath: update to 10.0.rc1.

---
 srcpkgs/sagemath/files/sage_conf.py           |    1 -
 srcpkgs/sagemath/files/timings2.json          |  405 ++---
 ...-support_singular_4.3.1.p3-5e5737a0c.patch |  205 ---
 .../34980-avoid_factoring_in_is_prime.patch   |   49 -
 .../patches/34994-fix_tests_numpy_1.24.patch  |   58 -
 .../34995-support_tachyon_0.99.2.patch        |   57 -
 ...34997-fix_edge_case_of_integer_check.patch |   36 -
 .../35058-skip_unstable_tests_klyachko.patch  |   22 -
 .../35068-fix_tests_giac_1.9.0.35.patch       |   62 -
 .../patches/35094-support_gap_4.12.patch      | 1303 -----------------
 .../35127-fix_very_slow_test_stream.py.patch  |   15 -
 .../patches/35177-matplotlib_3.7.patch        |   95 --
 .../patches/35195-workaround_ecl_race.patch   |   56 -
 .../patches/35204-fix_sage-cleaner.patch      |   28 -
 .../sagemath/patches/35250-nauty_2.8.6.patch  |   35 -
 .../sagemath/patches/35423-ipython_8.12.patch |   51 -
 .../patches/35438-pythran_0.12.1.patch        |   41 -
 srcpkgs/sagemath/patches/get_patches          |   43 +-
 srcpkgs/sagemath/template                     |    6 +-
 19 files changed, 111 insertions(+), 2457 deletions(-)
 delete mode 100644 srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
 delete mode 100644 srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
 delete mode 100644 srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
 delete mode 100644 srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
 delete mode 100644 srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
 delete mode 100644 srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
 delete mode 100644 srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
 delete mode 100644 srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
 delete mode 100644 srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
 delete mode 100644 srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
 delete mode 100644 srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
 delete mode 100644 srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
 delete mode 100644 srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
 delete mode 100644 srcpkgs/sagemath/patches/35423-ipython_8.12.patch
 delete mode 100644 srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch

diff --git a/srcpkgs/sagemath/files/sage_conf.py b/srcpkgs/sagemath/files/sage_conf.py
index 00de40f1ee4f..bc5388de8956 100644
--- a/srcpkgs/sagemath/files/sage_conf.py
+++ b/srcpkgs/sagemath/files/sage_conf.py
@@ -1,4 +1,3 @@
 # configuration for sage on void linux
 SAGE_SHARE = "/usr/share/sagemath"
 GAP_SHARE_DIR = "/usr/share/gap"
-GAP_LIB_DIR = "/usr/lib/gap"
diff --git a/srcpkgs/sagemath/files/timings2.json b/srcpkgs/sagemath/files/timings2.json
index bb3098680502..b2b3fe818a20 100644
--- a/srcpkgs/sagemath/files/timings2.json
+++ b/srcpkgs/sagemath/files/timings2.json
@@ -1,281 +1,152 @@
 {
-  "doc.ca.intro.index": {"walltime": 8},
-  "doc.en.constructions.calculus": {"walltime": 64},
-  "doc.en.constructions.plotting": {"walltime": 32},
-  "doc.en.prep.Advanced-2DPlotting": {"walltime": 16},
-  "doc.en.prep.Calculus": {"walltime": 8},
-  "doc.en.prep.Symbolics-and-Basic-Plotting": {"walltime": 8},
-  "doc.en.thematic_tutorials.explicit_methods_in_number_theory.birds_other": {"walltime": 8},
-  "doc.en.thematic_tutorials.explicit_methods_in_number_theory.elliptic_curves": {"walltime": 8},
-  "doc.en.thematic_tutorials.geometry.polyhedra_tutorial": {"walltime": 16},
-  "doc.en.thematic_tutorials.sandpile": {"walltime": 16},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_advanced": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_cartesian": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_change": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_curvilinear": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_plane": {"walltime": 16},
-  "doc.ja.tutorial.tour_plotting": {"walltime": 8},
-  "sage.algebras.cluster_algebra": {"walltime": 8},
   "sage.algebras.commutative_dga": {"walltime": 16},
-  "sage.algebras.hecke_algebras.ariki_koike_algebra": {"walltime": 8},
-  "sage.algebras.iwahori_hecke_algebra": {"walltime": 8},
-  "sage.algebras.lie_algebras.classical_lie_algebra": {"walltime": 128},
-  "sage.algebras.lie_algebras.nilpotent_lie_algebra": {"walltime": 16},
-  "sage.algebras.quantum_clifford": {"walltime": 16},
-  "sage.algebras.quantum_groups.fock_space": {"walltime": 8},
-  "sage.algebras.quatalg.quaternion_algebra": {"walltime": 8},
-  "sage.algebras.steenrod.steenrod_algebra": {"walltime": 64},
-  "sage.algebras.steenrod.steenrod_algebra_bases": {"walltime": 8},
-  "sage.algebras.yangian": {"walltime": 8},
-  "sage.arith.misc": {"walltime": 32},
+  "sage.algebras.fusion_rings.f_matrix": {"walltime": 16},
+  "sage.algebras.fusion_rings.fusion_ring": {"walltime": 16},
+  "sage.algebras.hecke_algebras.cubic_hecke_algebra": {"walltime": 8},
+  "sage.algebras.lie_conformal_algebras.n2_lie_conformal_algebra": {"walltime": 8},
+  "sage.algebras.quantum_clifford": {"walltime": 8},
+  "sage.algebras.steenrod.steenrod_algebra": {"walltime": 8},
   "sage.calculus.calculus": {"walltime": 16},
   "sage.calculus.desolvers": {"walltime": 8},
-  "sage.calculus.functional": {"walltime": 8},
-  "sage.calculus.riemann": {"walltime": 64},
-  "sage.calculus.tests": {"walltime": 16},
-  "sage.calculus.transforms.dwt": {"walltime": 16},
+  "sage.calculus.riemann": {"walltime": 8},
   "sage.calculus.transforms.fft": {"walltime": 8},
   "sage.categories.coxeter_groups": {"walltime": 8},
-  "sage.categories.finite_monoids": {"walltime": 16},
-  "sage.categories.lie_conformal_algebras": {"walltime": 8},
+  "sage.categories.finite_monoids": {"walltime": 8},
   "sage.categories.loop_crystals": {"walltime": 8},
-  "sage.categories.pushout": {"walltime": 8},
-  "sage.categories.super_hopf_algebras_with_basis": {"walltime": 32},
-  "sage.categories.super_lie_conformal_algebras": {"walltime": 8},
-  "sage.coding.ag_code": {"walltime": 64},
-  "sage.coding.ag_code_decoders": {"walltime": 128},
-  "sage.coding.binary_code": {"walltime": 8},
-  "sage.coding.linear_code": {"walltime": 16},
-  "sage.combinat.backtrack": {"walltime": 32},
-  "sage.combinat.chas.wqsym": {"walltime": 32},
-  "sage.combinat.cluster_algebra_quiver.cluster_seed": {"walltime": 64},
-  "sage.combinat.cluster_algebra_quiver.quiver": {"walltime": 128},
-  "sage.combinat.crystals.affine_factorization": {"walltime": 16},
-  "sage.combinat.crystals.alcove_path": {"walltime": 32},
-  "sage.combinat.crystals.highest_weight_crystals": {"walltime": 8},
-  "sage.combinat.crystals.kirillov_reshetikhin": {"walltime": 16},
-  "sage.combinat.crystals.letters": {"walltime": 8},
-  "sage.combinat.crystals.littelmann_path": {"walltime": 16},
-  "sage.combinat.crystals.mv_polytopes": {"walltime": 16},
-  "sage.combinat.crystals.pbw_crystal": {"walltime": 16},
-  "sage.combinat.crystals.star_crystal": {"walltime": 8},
-  "sage.combinat.designs.bibd": {"walltime": 8},
-  "sage.combinat.designs.database": {"walltime": 16},
+  "sage.coding.ag_code": {"walltime": 32},
+  "sage.coding.ag_code_decoders": {"walltime": 32},
+  "sage.coding.linear_code": {"walltime": 32},
+  "sage.combinat.designs.database": {"walltime": 8},
   "sage.combinat.designs.difference_family": {"walltime": 8},
-  "sage.combinat.designs.gen_quadrangles_with_spread": {"walltime": 128},
-  "sage.combinat.designs.orthogonal_arrays_build_recursive": {"walltime": 16},
-  "sage.combinat.designs.orthogonal_arrays_find_recursive": {"walltime": 8},
-  "sage.combinat.diagram_algebras": {"walltime": 64},
-  "sage.combinat.fqsym": {"walltime": 32},
-  "sage.combinat.free_prelie_algebra": {"walltime": 8},
-  "sage.combinat.fully_commutative_elements": {"walltime": 8},
-  "sage.combinat.grossman_larson_algebras": {"walltime": 8},
-  "sage.combinat.interval_posets": {"walltime": 8},
+  "sage.combinat.designs.orthogonal_arrays_build_recursive": {"walltime": 8},
   "sage.combinat.k_regular_sequence": {"walltime": 8},
   "sage.combinat.k_tableau": {"walltime": 16},
   "sage.combinat.matrices.hadamard_matrix": {"walltime": 8},
   "sage.combinat.multiset_partition_into_sets_ordered": {"walltime": 8},
-  "sage.combinat.ncsf_qsym.ncsf": {"walltime": 16},
-  "sage.combinat.ncsf_qsym.qsym": {"walltime": 16},
-  "sage.combinat.partition": {"walltime": 16},
-  "sage.combinat.partition_kleshchev": {"walltime": 16},
+  "sage.combinat.ncsf_qsym.ncsf": {"walltime": 8},
+  "sage.combinat.ncsf_qsym.qsym": {"walltime": 8},
+  "sage.combinat.partition": {"walltime": 8},
   "sage.combinat.partition_tuple": {"walltime": 8},
-  "sage.combinat.posets.moebius_algebra": {"walltime": 16},
+  "sage.combinat.permutation": {"walltime": 8},
   "sage.combinat.posets.posets": {"walltime": 8},
-  "sage.combinat.rigged_configurations.kr_tableaux": {"walltime": 32},
-  "sage.combinat.rigged_configurations.rigged_configurations": {"walltime": 16},
-  "sage.combinat.rigged_configurations.tensor_product_kr_tableaux": {"walltime": 16},
+  "sage.combinat.rigged_configurations.kr_tableaux": {"walltime": 8},
   "sage.combinat.root_system.associahedron": {"walltime": 8},
-  "sage.combinat.root_system.branching_rules": {"walltime": 8},
-  "sage.combinat.root_system.fusion_ring": {"walltime": 8},
-  "sage.combinat.root_system.integrable_representations": {"walltime": 16},
-  "sage.combinat.root_system.non_symmetric_macdonald_polynomials": {"walltime": 16},
-  "sage.combinat.root_system.pieri_factors": {"walltime": 8},
-  "sage.combinat.root_system.plot": {"walltime": 32},
-  "sage.combinat.root_system.root_lattice_realization_algebras": {"walltime": 16},
-  "sage.combinat.root_system.root_lattice_realizations": {"walltime": 16},
-  "sage.combinat.root_system.root_system": {"walltime": 8},
-  "sage.combinat.root_system.weyl_group": {"walltime": 8},
-  "sage.combinat.rsk": {"walltime": 32},
-  "sage.combinat.sf.classical": {"walltime": 16},
-  "sage.combinat.sf.jack": {"walltime": 16},
-  "sage.combinat.sf.k_dual": {"walltime": 16},
-  "sage.combinat.sf.llt": {"walltime": 16},
-  "sage.combinat.sf.macdonald": {"walltime": 64},
-  "sage.combinat.sf.new_kschur": {"walltime": 8},
-  "sage.combinat.sf.sfa": {"walltime": 32},
-  "sage.combinat.shifted_primed_tableau": {"walltime": 16},
+  "sage.combinat.root_system.non_symmetric_macdonald_polynomials": {"walltime": 8},
+  "sage.combinat.root_system.plot": {"walltime": 16},
+  "sage.combinat.root_system.root_lattice_realizations": {"walltime": 8},
+  "sage.combinat.rsk": {"walltime": 8},
+  "sage.combinat.sf.k_dual": {"walltime": 8},
+  "sage.combinat.sf.sf": {"walltime": 8},
+  "sage.combinat.sf.sfa": {"walltime": 8},
+  "sage.combinat.shifted_primed_tableau": {"walltime": 8},
   "sage.combinat.skew_tableau": {"walltime": 8},
-  "sage.combinat.symmetric_group_algebra": {"walltime": 16},
-  "sage.combinat.tableau": {"walltime": 32},
-  "sage.combinat.tableau_tuple": {"walltime": 32},
-  "sage.combinat.tiling": {"walltime": 16},
-  "sage.combinat.tutorial": {"walltime": 16},
-  "sage.combinat.words.paths": {"walltime": 64},
-  "sage.crypto.block_cipher.des": {"walltime": 16},
-  "sage.crypto.mq.sr": {"walltime": 64},
-  "sage.crypto.sbox": {"walltime": 16},
+  "sage.combinat.species.generating_series": {"walltime": 8},
+  "sage.combinat.tableau": {"walltime": 8},
+  "sage.combinat.tableau_tuple": {"walltime": 8},
+  "sage.combinat.tiling": {"walltime": 8},
+  "sage.combinat.tutorial": {"walltime": 8},
   "sage.crypto.sboxes": {"walltime": 8},
   "sage.doctest.forker": {"walltime": 16},
-  "sage.doctest.sources": {"walltime": 64},
-  "sage.doctest.test": {"walltime": 128},
-  "sage.dynamics.arithmetic_dynamics.projective_ds": {"walltime": 64},
-  "sage.dynamics.arithmetic_dynamics.wehlerK3": {"walltime": 8},
-  "sage.dynamics.cellular_automata.glca": {"walltime": 8},
+  "sage.dynamics.arithmetic_dynamics.projective_ds": {"walltime": 32},
   "sage.dynamics.cellular_automata.solitons": {"walltime": 8},
-  "sage.dynamics.complex_dynamics.mandel_julia": {"walltime": 16},
   "sage.functions.bessel": {"walltime": 16},
-  "sage.functions.exp_integral": {"walltime": 8},
   "sage.functions.hypergeometric": {"walltime": 8},
+  "sage.functions.orthogonal_polys": {"walltime": 8},
   "sage.functions.other": {"walltime": 16},
   "sage.functions.piecewise": {"walltime": 8},
-  "sage.games.quantumino": {"walltime": 8},
-  "sage.geometry.cone": {"walltime": 32},
-  "sage.geometry.fan": {"walltime": 8},
   "sage.geometry.hyperbolic_space.hyperbolic_geodesic": {"walltime": 8},
-  "sage.geometry.hyperplane_arrangement.arrangement": {"walltime": 16},
-  "sage.geometry.hyperplane_arrangement.library": {"walltime": 8},
+  "sage.geometry.hyperplane_arrangement.arrangement": {"walltime": 8},
   "sage.geometry.hyperplane_arrangement.plot": {"walltime": 8},
-  "sage.geometry.lattice_polytope": {"walltime": 16},
-  "sage.geometry.polyhedral_complex": {"walltime": 8},
-  "sage.geometry.polyhedron.base": {"walltime": 32},
-  "sage.geometry.polyhedron.library": {"walltime": 32},
-  "sage.geometry.polyhedron.plot": {"walltime": 8},
+  "sage.geometry.polyhedron.base": {"walltime": 8},
+  "sage.geometry.polyhedron.base5": {"walltime": 8},
+  "sage.geometry.polyhedron.base6": {"walltime": 16},
+  "sage.geometry.polyhedron.library": {"walltime": 16},
   "sage.geometry.riemannian_manifolds.parametrized_surface3d": {"walltime": 16},
-  "sage.geometry.triangulation.base": {"walltime": 32},
-  "sage.geometry.triangulation.point_configuration": {"walltime": 16},
-  "sage.graphs.chrompoly": {"walltime": 8},
-  "sage.graphs.connectivity": {"walltime": 16},
-  "sage.graphs.generators.basic": {"walltime": 16},
-  "sage.graphs.generators.classical_geometries": {"walltime": 32},
-  "sage.graphs.generators.distance_regular": {"walltime": 256},
-  "sage.graphs.generators.families": {"walltime": 32},
-  "sage.graphs.generators.smallgraphs": {"walltime": 16},
-  "sage.graphs.generic_graph": {"walltime": 32},
-  "sage.graphs.genus": {"walltime": 16},
+  "sage.graphs.connectivity": {"walltime": 8},
+  "sage.graphs.generators.classical_geometries": {"walltime": 8},
+  "sage.graphs.generators.distance_regular": {"walltime": 32},
+  "sage.graphs.generators.smallgraphs": {"walltime": 8},
+  "sage.graphs.generic_graph": {"walltime": 16},
   "sage.graphs.graph": {"walltime": 16},
-  "sage.graphs.graph_generators": {"walltime": 8},
   "sage.graphs.graph_list": {"walltime": 8},
   "sage.graphs.graph_plot": {"walltime": 8},
-  "sage.graphs.strongly_regular_db": {"walltime": 16},
-  "sage.groups.cubic_braid": {"walltime": 16},
-  "sage.groups.fqf_orthogonal": {"walltime": 16},
-  "sage.groups.libgap_mixin": {"walltime": 8},
-  "sage.groups.libgap_morphism": {"walltime": 8},
-  "sage.groups.lie_gps.nilpotent_lie_group": {"walltime": 16},
-  "sage.groups.matrix_gps.finitely_generated": {"walltime": 8},
-  "sage.groups.matrix_gps.heisenberg": {"walltime": 32},
-  "sage.groups.matrix_gps.linear": {"walltime": 8},
-  "sage.groups.perm_gps.cubegroup": {"walltime": 16},
-  "sage.groups.perm_gps.partn_ref.refinement_graphs": {"walltime": 8},
+  "sage.graphs.strongly_regular_db": {"walltime": 8},
+  "sage.groups.cactus_group": {"walltime": 8},
+  "sage.groups.cubic_braid": {"walltime": 8},
+  "sage.groups.lie_gps.nilpotent_lie_group": {"walltime": 8},
+  "sage.groups.matrix_gps.finitely_generated_gap": {"walltime": 8},
   "sage.groups.perm_gps.permgroup": {"walltime": 8},
   "sage.groups.perm_gps.permgroup_named": {"walltime": 8},
-  "sage.homology.hochschild_complex": {"walltime": 8},
   "sage.homology.homology_vector_space_with_basis": {"walltime": 8},
-  "sage.interacts.test_jupyter": {"walltime": 16},
-  "sage.interfaces.ecm": {"walltime": 8},
-  "sage.interfaces.expect": {"walltime": 8},
-  "sage.interfaces.gap": {"walltime": 16},
-  "sage.interfaces.maxima": {"walltime": 8},
-  "sage.interfaces.maxima_abstract": {"walltime": 64},
-  "sage.interfaces.psage": {"walltime": 8},
-  "sage.interfaces.sage0": {"walltime": 8},
-  "sage.lfunctions.zero_sums": {"walltime": 8},
-  "sage.libs.eclib.interface": {"walltime": 16},
+  "sage.interfaces.gap": {"walltime": 8},
+  "sage.interfaces.gap_workspace": {"walltime": 8},
+  "sage.interfaces.sage0": {"walltime": 16},
+  "sage.libs.eclib.interface": {"walltime": 32},
   "sage.libs.eclib.mwrank": {"walltime": 16},
-  "sage.libs.gap.test_long": {"walltime": 32},
-  "sage.libs.giac": {"walltime": 32},
   "sage.manifolds.catalog": {"walltime": 8},
-  "sage.manifolds.chart": {"walltime": 32},
+  "sage.manifolds.chart": {"walltime": 16},
   "sage.manifolds.chart_func": {"walltime": 8},
   "sage.manifolds.continuous_map": {"walltime": 8},
-  "sage.manifolds.differentiable.affine_connection": {"walltime": 128},
+  "sage.manifolds.differentiable.affine_connection": {"walltime": 32},
   "sage.manifolds.differentiable.automorphismfield": {"walltime": 32},
-  "sage.manifolds.differentiable.automorphismfield_group": {"walltime": 8},
   "sage.manifolds.differentiable.bundle_connection": {"walltime": 8},
-  "sage.manifolds.differentiable.characteristic_cohomology_class": {"walltime": 64},
+  "sage.manifolds.differentiable.characteristic_cohomology_class": {"walltime": 8},
   "sage.manifolds.differentiable.curve": {"walltime": 16},
-  "sage.manifolds.differentiable.degenerate": {"walltime": 32},
-  "sage.manifolds.differentiable.degenerate_submanifold": {"walltime": 16},
-  "sage.manifolds.differentiable.diff_form": {"walltime": 64},
+  "sage.manifolds.differentiable.degenerate": {"walltime": 16},
+  "sage.manifolds.differentiable.degenerate_submanifold": {"walltime": 8},
+  "sage.manifolds.differentiable.diff_form": {"walltime": 32},
   "sage.manifolds.differentiable.diff_map": {"walltime": 8},
   "sage.manifolds.differentiable.examples.euclidean": {"walltime": 32},
   "sage.manifolds.differentiable.examples.sphere": {"walltime": 32},
   "sage.manifolds.differentiable.integrated_curve": {"walltime": 32},
-  "sage.manifolds.differentiable.levi_civita_connection": {"walltime": 32},
-  "sage.manifolds.differentiable.manifold": {"walltime": 16},
-  "sage.manifolds.differentiable.manifold_homset": {"walltime": 16},
+  "sage.manifolds.differentiable.levi_civita_connection": {"walltime": 16},
+  "sage.manifolds.differentiable.manifold": {"walltime": 8},
+  "sage.manifolds.differentiable.manifold_homset": {"walltime": 8},
   "sage.manifolds.differentiable.metric": {"walltime": 64},
   "sage.manifolds.differentiable.mixed_form": {"walltime": 16},
-  "sage.manifolds.differentiable.mixed_form_algebra": {"walltime": 8},
   "sage.manifolds.differentiable.multivectorfield": {"walltime": 64},
-  "sage.manifolds.differentiable.pseudo_riemannian": {"walltime": 16},
-  "sage.manifolds.differentiable.pseudo_riemannian_submanifold": {"walltime": 128},
-  "sage.manifolds.differentiable.scalarfield": {"walltime": 16},
+  "sage.manifolds.differentiable.pseudo_riemannian": {"walltime": 8},
+  "sage.manifolds.differentiable.pseudo_riemannian_submanifold": {"walltime": 32},
+  "sage.manifolds.differentiable.scalarfield": {"walltime": 8},
   "sage.manifolds.differentiable.scalarfield_algebra": {"walltime": 8},
-  "sage.manifolds.differentiable.tangent_vector": {"walltime": 16},
+  "sage.manifolds.differentiable.tangent_vector": {"walltime": 8},
   "sage.manifolds.differentiable.tensorfield": {"walltime": 128},
   "sage.manifolds.differentiable.tensorfield_paral": {"walltime": 16},
-  "sage.manifolds.differentiable.vector_bundle": {"walltime": 16},
-  "sage.manifolds.differentiable.vectorfield": {"walltime": 64},
-  "sage.manifolds.differentiable.vectorframe": {"walltime": 8},
+  "sage.manifolds.differentiable.vectorfield": {"walltime": 16},
   "sage.manifolds.point": {"walltime": 16},
   "sage.manifolds.scalarfield": {"walltime": 16},
-  "sage.manifolds.scalarfield_algebra": {"walltime": 8},
-  "sage.manifolds.section": {"walltime": 32},
-  "sage.manifolds.trivialization": {"walltime": 8},
-  "sage.manifolds.vector_bundle": {"walltime": 8},
-  "sage.matrix.benchmark": {"walltime": 8},
+  "sage.manifolds.section": {"walltime": 16},
   "sage.matrix.matrix2": {"walltime": 16},
-  "sage.matrix.matrix_integer_dense": {"walltime": 16},
-  "sage.matrix.matrix_integer_dense_hnf": {"walltime": 32},
-  "sage.matrix.matrix_mod2_dense": {"walltime": 8},
   "sage.matrix.matrix_rational_dense": {"walltime": 8},
   "sage.matrix.special": {"walltime": 8},
-  "sage.matroids.catalog": {"walltime": 64},
   "sage.misc.cachefunc": {"walltime": 16},
-  "sage.misc.cython": {"walltime": 8},
   "sage.misc.functional": {"walltime": 8},
   "sage.misc.randstate": {"walltime": 16},
-  "sage.misc.sagedoc": {"walltime": 64},
-  "sage.misc.sageinspect": {"walltime": 32},
-  "sage.modular.abvar.abvar": {"walltime": 16},
+  "sage.misc.sagedoc": {"walltime": 16},
+  "sage.misc.sageinspect": {"walltime": 16},
+  "sage.misc.trace": {"walltime": 8},
+  "sage.modular.abvar.abvar": {"walltime": 8},
   "sage.modular.abvar.homspace": {"walltime": 8},
-  "sage.modular.abvar.lseries": {"walltime": 8},
-  "sage.modular.arithgroup.arithgroup_perm": {"walltime": 8},
-  "sage.modular.arithgroup.tests": {"walltime": 8},
-  "sage.modular.btquotients.pautomorphicform": {"walltime": 32},
-  "sage.modular.hypergeometric_motive": {"walltime": 16},
-  "sage.modular.local_comp.local_comp": {"walltime": 32},
-  "sage.modular.local_comp.type_space": {"walltime": 16},
-  "sage.modular.modform.ambient_R": {"walltime": 16},
-  "sage.modular.modform.constructor": {"walltime": 8},
-  "sage.modular.modform.cuspidal_submodule": {"walltime": 16},
-  "sage.modular.modform.element": {"walltime": 64},
-  "sage.modular.modform.ring": {"walltime": 64},
-  "sage.modular.modform.space": {"walltime": 8},
+  "sage.modular.btquotients.btquotient": {"walltime": 8},
+  "sage.modular.btquotients.pautomorphicform": {"walltime": 16},
+  "sage.modular.hecke.submodule": {"walltime": 8},
+  "sage.modular.hypergeometric_motive": {"walltime": 8},
+  "sage.modular.local_comp.local_comp": {"walltime": 16},
+  "sage.modular.local_comp.type_space": {"walltime": 8},
+  "sage.modular.modform.element": {"walltime": 32},
   "sage.modular.modform_hecketriangle.abstract_space": {"walltime": 16},
   "sage.modular.modform_hecketriangle.graded_ring_element": {"walltime": 16},
   "sage.modular.modform_hecketriangle.hecke_triangle_group_element": {"walltime": 32},
   "sage.modular.modform_hecketriangle.readme": {"walltime": 16},
-  "sage.modular.modform_hecketriangle.space": {"walltime": 8},
   "sage.modular.modsym.ambient": {"walltime": 16},
   "sage.modular.modsym.space": {"walltime": 8},
-  "sage.modular.pollack_stevens.modsym": {"walltime": 64},
-  "sage.modular.pollack_stevens.padic_lseries": {"walltime": 32},
-  "sage.modules.finite_submodule_iter": {"walltime": 16},
-  "sage.modules.free_module": {"walltime": 16},
-  "sage.modules.free_module_element": {"walltime": 8},
-  "sage.modules.free_module_integer": {"walltime": 32},
-  "sage.modules.free_quadratic_module_integer_symmetric": {"walltime": 8},
-  "sage.modules.torsion_quadratic_module": {"walltime": 16},
+  "sage.modular.overconvergent.genus0": {"walltime": 8},
+  "sage.modular.pollack_stevens.modsym": {"walltime": 8},
+  "sage.modules.fp_graded.morphism": {"walltime": 8},
+  "sage.modules.free_module": {"walltime": 8},
   "sage.parallel.map_reduce": {"walltime": 8},
-  "sage.plot.animate": {"walltime": 16},
-  "sage.plot.arrow": {"walltime": 8},
-  "sage.plot.circle": {"walltime": 8},
-  "sage.plot.complex_plot": {"walltime": 8},
+  "sage.plot.complex_plot": {"walltime": 16},
   "sage.plot.contour_plot": {"walltime": 32},
-  "sage.plot.density_plot": {"walltime": 8},
   "sage.plot.graphics": {"walltime": 32},
   "sage.plot.line": {"walltime": 8},
   "sage.plot.matrix_plot": {"walltime": 16},
@@ -283,115 +154,53 @@
   "sage.plot.plot": {"walltime": 64},
   "sage.plot.plot3d.base": {"walltime": 8},
   "sage.plot.plot3d.implicit_plot3d": {"walltime": 16},
-  "sage.plot.plot3d.implicit_surface": {"walltime": 8},
-  "sage.plot.plot3d.parametric_plot3d": {"walltime": 8},
+  "sage.plot.plot3d.parametric_plot3d": {"walltime": 16},
   "sage.plot.plot3d.parametric_surface": {"walltime": 8},
   "sage.plot.plot3d.plot3d": {"walltime": 16},
-  "sage.plot.plot3d.tachyon": {"walltime": 8},
-  "sage.plot.plot3d.transform": {"walltime": 32},
   "sage.plot.point": {"walltime": 8},
   "sage.plot.polygon": {"walltime": 8},
   "sage.plot.streamline_plot": {"walltime": 8},
-  "sage.quadratic_forms.genera.genus": {"walltime": 16},
-  "sage.quadratic_forms.quadratic_form__automorphisms": {"walltime": 8},
-  "sage.quadratic_forms.quadratic_form__local_representation_conditions": {"walltime": 64},
-  "sage.quadratic_forms.quadratic_form__neighbors": {"walltime": 8},
-  "sage.quadratic_forms.quadratic_form__siegel_product": {"walltime": 8},
   "sage.repl.ipython_extension": {"walltime": 8},
-  "sage.rings.asymptotic.asymptotic_expansion_generators": {"walltime": 64},
+  "sage.rings.asymptotic.asymptotic_expansion_generators": {"walltime": 16},
   "sage.rings.asymptotic.asymptotic_ring": {"walltime": 8},
-  "sage.rings.asymptotic.asymptotics_multivariate_generating_functions": {"walltime": 32},
-  "sage.rings.asymptotic.term_monoid": {"walltime": 8},
-  "sage.rings.continued_fraction": {"walltime": 8},
+  "sage.rings.asymptotic.asymptotics_multivariate_generating_functions": {"walltime": 8},
   "sage.rings.finite_rings.finite_field_base": {"walltime": 8},
-  "sage.rings.function_field.function_field": {"walltime": 128},
-  "sage.rings.function_field.function_field_valuation": {"walltime": 64},
+  "sage.rings.function_field.function_field": {"walltime": 8},
   "sage.rings.function_field.ideal": {"walltime": 8},
-  "sage.rings.function_field.place": {"walltime": 8},
-  "sage.rings.integer": {"walltime": 64},
-  "sage.rings.invariants.invariant_theory": {"walltime": 8},
-  "sage.rings.number_field.bdd_height": {"walltime": 8},
-  "sage.rings.number_field.number_field": {"walltime": 64},
-  "sage.rings.number_field.number_field_element": {"walltime": 16},
-  "sage.rings.number_field.splitting_field": {"walltime": 8},
-  "sage.rings.number_field.totallyreal": {"walltime": 16},
-  "sage.rings.number_field.totallyreal_rel": {"walltime": 8},
-  "sage.rings.padics.padic_base_leaves": {"walltime": 64},
-  "sage.rings.padics.padic_extension_leaves": {"walltime": 64},
-  "sage.rings.padics.padic_generic_element": {"walltime": 16},
-  "sage.rings.padics.padic_lattice_element": {"walltime": 32},
-  "sage.rings.padics.relative_extension_leaves": {"walltime": 32},
+  "sage.rings.lazy_series": {"walltime": 8},
+  "sage.rings.lazy_series_ring": {"walltime": 32},
+  "sage.rings.number_field.number_field": {"walltime": 32},
+  "sage.rings.number_field.number_field_element": {"walltime": 8},
+  "sage.rings.padics.padic_base_leaves": {"walltime": 8},
+  "sage.rings.padics.padic_generic_element": {"walltime": 8},
   "sage.rings.polynomial.multi_polynomial_ideal": {"walltime": 8},
-  "sage.rings.polynomial.multi_polynomial_sequence": {"walltime": 8},
-  "sage.rings.polynomial.ore_function_element": {"walltime": 8},
   "sage.rings.polynomial.polynomial_element": {"walltime": 16},
-  "sage.rings.polynomial.polynomial_rational_flint": {"walltime": 8},
   "sage.rings.qqbar": {"walltime": 16},
-  "sage.rings.tests": {"walltime": 16},
-  "sage.rings.valuation.augmented_valuation": {"walltime": 32},
-  "sage.rings.valuation.mapped_valuation": {"walltime": 64},
-  "sage.rings.valuation.valuation": {"walltime": 8},
-  "sage.sandpiles.sandpile": {"walltime": 16},
+  "sage.sandpiles.sandpile": {"walltime": 8},
   "sage.schemes.curves.affine_curve": {"walltime": 16},
   "sage.schemes.curves.closed_point": {"walltime": 8},
   "sage.schemes.curves.projective_curve": {"walltime": 32},
-  "sage.schemes.cyclic_covers.cycliccover_finite_field": {"walltime": 64},
   "sage.schemes.elliptic_curves.BSD": {"walltime": 8},
   "sage.schemes.elliptic_curves.Qcurves": {"walltime": 8},
-  "sage.schemes.elliptic_curves.constructor": {"walltime": 32},
-  "sage.schemes.elliptic_curves.ell_curve_isogeny": {"walltime": 16},
-  "sage.schemes.elliptic_curves.ell_egros": {"walltime": 32},
-  "sage.schemes.elliptic_curves.ell_finite_field": {"walltime": 8},
+  "sage.schemes.elliptic_curves.ell_curve_isogeny": {"walltime": 8},
   "sage.schemes.elliptic_curves.ell_generic": {"walltime": 8},
-  "sage.schemes.elliptic_curves.ell_modular_symbols": {"walltime": 16},
-  "sage.schemes.elliptic_curves.ell_number_field": {"walltime": 128},
+  "sage.schemes.elliptic_curves.ell_modular_symbols": {"walltime": 8},
   "sage.schemes.elliptic_curves.ell_point": {"walltime": 8},
-  "sage.schemes.elliptic_curves.ell_rational_field": {"walltime": 128},
-  "sage.schemes.elliptic_curves.gal_reps_number_field": {"walltime": 32},
-  "sage.schemes.elliptic_curves.gp_simon": {"walltime": 16},
-  "sage.schemes.elliptic_curves.heegner": {"walltime": 32},
-  "sage.schemes.elliptic_curves.height": {"walltime": 64},
-  "sage.schemes.elliptic_curves.isogeny_class": {"walltime": 32},
-  "sage.schemes.elliptic_curves.isogeny_small_degree": {"walltime": 64},
-  "sage.schemes.elliptic_curves.kraus": {"walltime": 16},
+  "sage.schemes.elliptic_curves.ell_rational_field": {"walltime": 32},
+  "sage.schemes.elliptic_curves.height": {"walltime": 8},
+  "sage.schemes.elliptic_curves.isogeny_small_degree": {"walltime": 16},
   "sage.schemes.elliptic_curves.mod_sym_num": {"walltime": 8},
   "sage.schemes.elliptic_curves.padic_lseries": {"walltime": 8},
-  "sage.schemes.elliptic_curves.padics": {"walltime": 16},
-  "sage.schemes.elliptic_curves.saturation": {"walltime": 16},
-  "sage.schemes.elliptic_curves.sha_tate": {"walltime": 32},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_finite_field": {"walltime": 64},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_generic": {"walltime": 8},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_padic_field": {"walltime": 32},
-  "sage.schemes.hyperelliptic_curves.monsky_washnitzer": {"walltime": 8},
-  "sage.schemes.projective.projective_rational_point": {"walltime": 8},
-  "sage.schemes.riemann_surfaces.riemann_surface": {"walltime": 64},
+  "sage.schemes.elliptic_curves.padics": {"walltime": 8},
+  "sage.schemes.elliptic_curves.sha_tate": {"walltime": 16},
+  "sage.schemes.hyperelliptic_curves.hyperelliptic_padic_field": {"walltime": 16},
+  "sage.schemes.riemann_surfaces.riemann_surface": {"walltime": 32},
   "sage.schemes.toric.chow_group": {"walltime": 8},
-  "sage.schemes.toric.sheaf.klyachko": {"walltime": 8},
-  "sage.stats.distributions.discrete_gaussian_integer": {"walltime": 8},
-  "sage.stats.time_series": {"walltime": 8},
-  "sage.structure.coerce_dict": {"walltime": 32},
   "sage.structure.element": {"walltime": 16},
-  "sage.structure.sage_object": {"walltime": 8},
   "sage.symbolic.expression": {"walltime": 32},
-  "sage.symbolic.integration.integral": {"walltime": 32},
-  "sage.symbolic.random_tests": {"walltime": 32},
+  "sage.symbolic.integration.integral": {"walltime": 16},
   "sage.symbolic.relation": {"walltime": 8},
-  "sage.tests.book_schilling_zabrocki_kschur_primer": {"walltime": 32},
-  "sage.tests.book_stein_ent": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.combinat_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.float_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.graphique_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.graphtheory_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.integration_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.mpoly_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.nonlinear_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.recequadiff_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.graphique_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.numbertheory_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.polynomes_doctest": {"walltime": 16},
-  "sage.tests.cmdline": {"walltime": 64},
-  "sage.tests.gosper-sum": {"walltime": 16},
-  "sage.tests.parigp": {"walltime": 8},
-  "sage.topology.simplicial_complex": {"walltime": 8},
-  "sage.topology.simplicial_complex_examples": {"walltime": 16}
+  "sage.tests.book_schilling_zabrocki_kschur_primer": {"walltime": 16},
+  "sage.tests.book_stein_ent": {"walltime": 8},
+  "sage.topology.simplicial_complex": {"walltime": 16}
 }
diff --git a/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch b/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
deleted file mode 100644
index f2f825e4fb10..000000000000
--- a/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
+++ /dev/null
@@ -1,205 +0,0 @@
-diff --git a/build/pkgs/singular/checksums.ini b/build/pkgs/singular/checksums.ini
-index 2e33a405d36..313463d2fea 100644
---- a/build/pkgs/singular/checksums.ini
-+++ b/build/pkgs/singular/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=singular-VERSION.tar.gz
--sha1=6c2b622d3681e2de3d58d30c654d43d3e32b720c
--md5=abb1e37c794472e7760655358ab66054
--cksum=17455733
-+sha1=28bb3ee97ef48d04dfa96de182fd93eebe08426c
-+md5=fc0a4f5720dadba45a52ee94324ce00c
-+cksum=1573851737
- upstream_url=ftp://jim.mathematik.uni-kl.de/pub/Math/Singular/SOURCES/4-3-1/singular-VERSION.tar.gz
-diff --git a/build/pkgs/singular/package-version.txt b/build/pkgs/singular/package-version.txt
-index 11300c77e7d..66e2bede53a 100644
---- a/build/pkgs/singular/package-version.txt
-+++ b/build/pkgs/singular/package-version.txt
-@@ -1 +1 @@
--4.3.1p1
-+4.3.1p3
-diff --git a/src/sage/libs/singular/decl.pxd b/src/sage/libs/singular/decl.pxd
-index 8e3ac314b67..747a6b1e2fb 100644
---- a/src/sage/libs/singular/decl.pxd
-+++ b/src/sage/libs/singular/decl.pxd
-@@ -574,7 +574,7 @@ cdef extern from "singular/Singular/libsingular.h":
- 
-     # gets a component out of a polynomial vector
- 
--    poly *pTakeOutComp1(poly **, int)
-+    poly *pTakeOutComp(poly **, int)
- 
-     # deep copy p
- 
-diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx
-index d8ea7b07f3c..3a1271cd59f 100644
---- a/src/sage/libs/singular/singular.pyx
-+++ b/src/sage/libs/singular/singular.pyx
-@@ -1726,20 +1726,21 @@ cdef int overflow_check(unsigned long e, ring *_ring) except -1:
- 
-     Whether an overflow occurs or not partially depends
-     on the number of variables in the ring. See trac ticket
--    :trac:`11856`. With Singular 4, it is by default optimized
--    for at least 4 variables on 64-bit and 2 variables on 32-bit,
--    which in both cases makes a maximal default exponent of
--    2^16-1.
-+    :trac:`11856`.
- 
-     EXAMPLES::
- 
-         sage: P.<x,y> = QQ[]
--        sage: y^(2^16-1)
--        y^65535
--        sage: y^2^16
-+        sage: y^(2^30)
-+        Traceback (most recent call last):             # 32-bit
-+        ...                                            # 32-bit
-+        OverflowError: exponent overflow (1073741824)  # 32-bit
-+        y^1073741824  # 64-bit
-+        sage: y^2^32
-         Traceback (most recent call last):
-         ...
--        OverflowError: exponent overflow (65536)
-+        OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+        OverflowError: exponent overflow (4294967296)  # 64-bit
-     """
-     if unlikely(e > _ring.bitmask):
-         raise OverflowError("exponent overflow (%d)"%(e))
-diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py
-index 7dc058a22f0..71494eddbc0 100644
---- a/src/sage/rings/polynomial/multi_polynomial_ideal.py
-+++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py
-@@ -60,7 +60,7 @@
- Note that the result of a computation is not necessarily reduced::
- 
-     sage: (a+b)^17
--    256*a*b^16 + 256*b^17
-+    a*b^16 + b^17
-     sage: S(17) == 0
-     True
- 
-diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-index 4dad016b33f..9bf67dd1425 100644
---- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-+++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-@@ -193,7 +193,7 @@ from sage.libs.singular.decl cimport (
-     p_IsUnit, p_IsOne, p_Series, p_Head, idInit, fast_map_common_subexp, id_Delete,
-     p_IsHomogeneous, p_Homogen, p_Totaldegree,pLDeg1_Totaldegree, singclap_pdivide, singclap_factorize,
-     idLift, IDELEMS, On, Off, SW_USE_CHINREM_GCD, SW_USE_EZGCD,
--    p_LmIsConstant, pTakeOutComp1, singclap_gcd, pp_Mult_qq, p_GetMaxExp,
-+    p_LmIsConstant, pTakeOutComp, singclap_gcd, pp_Mult_qq, p_GetMaxExp,
-     pLength, kNF, p_Neg, p_Minus_mm_Mult_qq, p_Plus_mm_Mult_qq,
-     pDiff, singclap_resultant, p_Normalize,
-     prCopyR, prCopyR_NoSort)
-@@ -1587,7 +1587,8 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_base):
-             9/4
- 
-             sage: P.monomial_quotient(x,y) # Note the wrong result
--            x*y^65535*z^65535
-+            x*y^65535*z^65535      # 32-bit
-+            x*y^1048575*z^1048575  # 64-bit
- 
-             sage: P.monomial_quotient(x,P(1))
-             x
-@@ -2247,10 +2248,11 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             9/4*x^2 - 1/4*y^2 - y - 1
- 
-             sage: P.<x,y> = PolynomialRing(QQ,order='lex')
--            sage: (x^2^15) * x^2^15
-+            sage: (x^2^32) * x^2^32
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (...)
-+            OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+            OverflowError: exponent overflow (...)  # 64-bit
-         """
-         # all currently implemented rings are commutative
-         cdef poly *_p
-@@ -2371,10 +2373,11 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             ValueError: not a 2nd power
- 
-             sage: P.<x,y> = PolynomialRing(QQ,order='lex')
--            sage: (x+y^2^15)^10
-+            sage: (x+y^2^32)^10
-             Traceback (most recent call last):
-             ....
--            OverflowError: exponent overflow (...)
-+            OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+            OverflowError: exponent overflow (...)  # 64-bit
- 
-         Test fractional powers (:trac:`22329`)::
- 
-@@ -3461,7 +3464,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             x^10000
-             no overflow
- 
--            sage: n = 1000
-+            sage: n = 100000
-             sage: try:
-             ....:     f = x^n
-             ....:     f.subs(x = x^n)
-@@ -4567,7 +4570,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
-         l = []
-         for i from 0 <= i < IDELEMS(res):
-             for j from 1 <= j <= IDELEMS(_I):
--                l.append( new_MP(parent, pTakeOutComp1(&res.m[i], j)) )
-+                l.append( new_MP(parent, pTakeOutComp(&res.m[i], 1)) )
- 
-         id_Delete(&fI, r)
-         id_Delete(&_I, r)
-@@ -4635,7 +4638,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
- 
-             sage: f = 3*x
-             sage: f.reduce([2*x,y])
--            3*x
-+            x
- 
-         The reduction is not canonical when ``I`` is not a Groebner
-         basis::
-diff --git a/src/sage/rings/polynomial/plural.pyx b/src/sage/rings/polynomial/plural.pyx
-index 1c9f35e56ba..587511c3888 100644
---- a/src/sage/rings/polynomial/plural.pyx
-+++ b/src/sage/rings/polynomial/plural.pyx
-@@ -1619,10 +1619,10 @@ cdef class NCPolynomial_plural(RingElement):
-             sage: P = A.g_algebra(relations={y*x:-x*y + z},  order='lex')
-             sage: P.inject_variables()
-             Defining x, z, y
--            sage: (x^2^15) * x^2^15
-+            sage: (x^2^31) * x^2^31
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (65536)
-+            OverflowError: exponent overflow (2147483648)
-         """
-         # all currently implemented rings are commutative
-         cdef poly *_p
-@@ -1689,10 +1689,10 @@ cdef class NCPolynomial_plural(RingElement):
-             sage: P = A.g_algebra(relations={y*x:-x*y + z},  order='lex')
-             sage: P.inject_variables()
-             Defining x, z, y
--            sage: (x+y^2^15)^10
-+            sage: (x+y^2^31)^10
-             Traceback (most recent call last):
-             ....
--            OverflowError: exponent overflow (327680)
-+            OverflowError: exponent overflow (2147483648)
-         """
-         if type(exp) is not Integer:
-             try:
-diff --git a/src/sage/structure/element.pyx b/src/sage/structure/element.pyx
-index b5d83ef71b6..5c45b3fb528 100644
---- a/src/sage/structure/element.pyx
-+++ b/src/sage/structure/element.pyx
-@@ -2705,10 +2705,10 @@ cdef class RingElement(ModuleElement):
-         with Singular 4::
- 
-             sage: K.<x,y> = ZZ[]
--            sage: (x^12345)^54321
-+            sage: (x^123456)^654321
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (670592745)
-+            OverflowError: exponent overflow (...)
-         """
-         return arith_generic_power(self, n)
- 
diff --git a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch b/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
deleted file mode 100644
index ee0f0e656b28..000000000000
--- a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py
-index d5f7157217f..8ca1f958039 100644
---- a/src/sage/rings/number_field/number_field_ideal.py
-+++ b/src/sage/rings/number_field/number_field_ideal.py
-@@ -996,16 +996,38 @@ def is_prime(self):
-             False
-             sage: K.ideal(17).is_prime()  # ramified
-             False
-+
-+        TESTS:
-+
-+        Check that we do not factor the norm of the ideal, this used
-+        to take half an hour, see :trac:`33360`::
-+
-+            sage: K.<a,b,c> = NumberField([x^2-2,x^2-3,x^2-5])
-+            sage: t = (((-2611940*c + 1925290/7653)*b - 1537130/7653*c
-+            ....:       + 10130950)*a + (1343014/7653*c - 8349770)*b
-+            ....:       + 6477058*c - 2801449990/4002519)
-+            sage: t.is_prime()
-+            False
-         """
-         try:
-             return self._pari_prime is not None
-         except AttributeError:
--            F = self.factor()  # factorization with caching
--            if len(F) != 1 or F[0][1] != 1:
--                self._pari_prime = None
--            else:
--                self._pari_prime = F[0][0]._pari_prime
--            return self._pari_prime is not None
-+            pass
-+
-+        K = self.number_field().pari_nf()
-+        I = self.pari_hnf()
-+
-+        candidate = K.idealismaximal(I) or None
-+
-+        # PARI uses probabilistic primality testing inside idealismaximal().
-+        if get_flag(None, 'arithmetic'):
-+            # proof required, check using isprime()
-+            if candidate and not candidate[0].isprime():
-+                candidate = None
-+
-+        self._pari_prime = candidate
-+
-+        return self._pari_prime is not None
- 
-     def pari_prime(self):
-         r"""
diff --git a/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch b/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
deleted file mode 100644
index 91f06fd4d173..000000000000
--- a/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-diff --git a/src/sage/misc/persist.pyx b/src/sage/misc/persist.pyx
-index 3ac5f1cc2b0..cb1f327c199 100644
---- a/src/sage/misc/persist.pyx
-+++ b/src/sage/misc/persist.pyx
-@@ -157,7 +157,7 @@ def load(*filename, compress=True, verbose=True, **kwargs):
-         ....:     _ = f.write(code)
-         sage: load(t)
-         sage: hello
--        <fortran object>
-+        <fortran ...>
-     """
-     import sage.repl.load
-     if len(filename) != 1:
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index 6f0aeab87ae..b77c69b2f77 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -461,6 +461,8 @@ def complex_to_rgb(z_values, contoured=False, tiled=False,
-             rgb[i, j, 2] = b
- 
-     sig_off()
-+    nan_indices = np.isnan(rgb).any(-1)     # Mask for undefined points
-+    rgb[nan_indices] = 1                    # Make nan_indices white
-     return rgb
- 
- 
-diff --git a/src/sage/plot/histogram.py b/src/sage/plot/histogram.py
-index 3bc2b76b58e..388c2d1391d 100644
---- a/src/sage/plot/histogram.py
-+++ b/src/sage/plot/histogram.py
-@@ -87,13 +87,8 @@ def get_minmax_data(self):
- 
-         TESTS::
- 
--            sage: h = histogram([10,3,5], normed=True)[0]
--            doctest:warning...:
--            DeprecationWarning: the 'normed' option is deprecated. Use 'density' instead.
--            See https://trac.sagemath.org/25260 for details.
-+            sage: h = histogram([10,3,5], density=True)[0]
-             sage: h.get_minmax_data()
--            doctest:warning ...
--            ...VisibleDeprecationWarning: Passing `normed=True` on non-uniform bins has always been broken, and computes neither the probability density function nor the probability mass function. The result is only correct if the bins are uniform, when density=True will produce the same result anyway. The argument will be removed in a future version of numpy.
-             {'xmax': 10.0, 'xmin': 3.0, 'ymax': 0.476190476190..., 'ymin': 0}
-         """
-         import numpy
-diff --git a/src/sage/repl/ipython_extension.py b/src/sage/repl/ipython_extension.py
-index 798671aab42..cad6a47ca8b 100644
---- a/src/sage/repl/ipython_extension.py
-+++ b/src/sage/repl/ipython_extension.py
-@@ -405,7 +405,7 @@ def fortran(self, line, cell):
-             ....: C END FILE FIB1.F
-             ....: ''')
-             sage: fib
--            <fortran object>
-+            <fortran ...>
-             sage: from numpy import array
-             sage: a = array(range(10), dtype=float)
-             sage: fib(a, 10)
diff --git a/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch b/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
deleted file mode 100644
index 2769e87f6a4b..000000000000
--- a/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-diff --git a/src/sage/interfaces/tachyon.py b/src/sage/interfaces/tachyon.py
-index 23671e50892..ce1d50f71bc 100644
---- a/src/sage/interfaces/tachyon.py
-+++ b/src/sage/interfaces/tachyon.py
-@@ -683,12 +683,14 @@
- #*****************************************************************************
- 
- import os
-+import re
- 
- from sage.cpython.string import bytes_to_str
- from sage.misc.pager import pager
- from sage.misc.superseded import deprecation
- from sage.misc.temporary_file import tmp_filename
- from sage.structure.sage_object import SageObject
-+from sage.misc.cachefunc import cached_method
- 
- 
- class TachyonRT(SageObject):
-@@ -799,6 +801,11 @@ def __call__(self, model, outfile='sage.png', verbose=1, extra_opts=''):
-             Parser failed due to an input file syntax error.
-             Aborting render.
-         """
-+        if self.version() >= '0.99.2':
-+            # this keyword was changed in 0.99.2
-+            model = model.replace(
-+                    "              focallength ",
-+                    "              focaldist ")
-         modelfile = tmp_filename(ext='.dat')
-         with open(modelfile, 'w') as file:
-             file.write(model)
-@@ -851,6 +858,25 @@ def usage(self, use_pager=True):
-         else:
-             print(r)
- 
-+    @cached_method
-+    def version(self):
-+        """
-+        Returns the version of the Tachyon raytracer being used.
-+
-+        TESTS::
-+
-+            sage: tachyon_rt.version()  # random
-+            0.98.9
-+            sage: tachyon_rt.version() >= '0.98.9'
-+            True
-+        """
-+        with os.popen('tachyon') as f:
-+            r = f.readline()
-+        res = re.search(r"Version ([\d.]*)", r)
-+        # debian patches tachyon so it won't report the version
-+        # we hardcode '0.99' since that's indeed the version they ship
-+        return res[1] if res else '0.99'
-+
-     def help(self, use_pager=True):
-         """
-         Deprecated: type 'sage.interfaces.tachyon?' for help
diff --git a/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch b/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
deleted file mode 100644
index 11eb20d4f735..000000000000
--- a/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff --git a/src/sage/arith/long.pxd b/src/sage/arith/long.pxd
-index 1c9a53387a0..d96b98f247c 100644
---- a/src/sage/arith/long.pxd
-+++ b/src/sage/arith/long.pxd
-@@ -270,6 +270,17 @@ cdef inline bint integer_check_long_py(x, long* value, int* err):
-         sage: L += [-x for x in L] + [0, long_min()]
-         sage: for v in L:
-         ....:     assert check_long_py(int(v)) == v
-+        sage: check_long_py(int(2^60))
-+        1152921504606846976                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^61))
-+        2305843009213693952                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^62))
-+        4611686018427387904                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^63))
-+        'Overflow (...)'
-         sage: check_long_py(int(2^100))
-         'Overflow (...)'
-         sage: check_long_py(int(long_max() + 1))
-@@ -309,7 +320,12 @@ cdef inline bint integer_check_long_py(x, long* value, int* err):
- 
-     cdef long lead
-     cdef long lead_2_overflow = (<long>1) << (BITS_IN_LONG - PyLong_SHIFT)
--    cdef long lead_3_overflow = (<long>1) << (BITS_IN_LONG - 2 * PyLong_SHIFT)
-+    cdef long lead_3_overflow
-+    if BITS_IN_LONG < 2 * PyLong_SHIFT:
-+        # in this case 3 digit is always overflow
-+        lead_3_overflow = 0
-+    else:
-+        lead_3_overflow = (<long>1) << (BITS_IN_LONG - 2 * PyLong_SHIFT)
-     if size == 0:
-         value[0] = 0
-         err[0] = 0
diff --git a/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch b/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
deleted file mode 100644
index c4d7d5c779d1..000000000000
--- a/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/src/sage/schemes/toric/sheaf/klyachko.py b/src/sage/schemes/toric/sheaf/klyachko.py
-index b1304a16913..77fae4b7545 100644
---- a/src/sage/schemes/toric/sheaf/klyachko.py
-+++ b/src/sage/schemes/toric/sheaf/klyachko.py
-@@ -26,7 +26,7 @@
-     (0, 0, 18, 16, 1)
-     sage: Gtilde = G_sum.random_deformation()
-     sage: V = Gtilde.wedge(2) * K                     # long time
--    sage: V.cohomology(dim=True, weight=(0,0,0,0))    # long time
-+    sage: V.cohomology(dim=True, weight=(0,0,0,0))    # long time  # random failure (see #32773)
-     (0, 0, 3, 0, 0)
- 
- REFERENCES:
-@@ -948,7 +948,7 @@ def random_deformation(self, epsilon=None):
-            sage: V.cohomology(dim=True, weight=(0,))
-            (1, 0)
-            sage: Vtilde = V.random_deformation()
--           sage: Vtilde.cohomology(dim=True, weight=(0,))
-+           sage: Vtilde.cohomology(dim=True, weight=(0,))  # random failure (see #32773)
-            (1, 0)
-         """
-         filt = self._filt.random_deformation(epsilon)
diff --git a/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch b/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
deleted file mode 100644
index d9a9835c696b..000000000000
--- a/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 9ac7840134054155545e24fa3e66402d42b91c0f Mon Sep 17 00:00:00 2001
-From: Antonio Rojas <arojas@archlinux.org>
-Date: Fri, 20 Jan 2023 21:36:27 +0100
-Subject: [PATCH] Fix tests with giac 1.9.0.35
-
----
- src/sage/libs/giac/giac.pyx   |  3 +--
- src/sage/symbolic/relation.py | 15 +++++----------
- 2 files changed, 6 insertions(+), 12 deletions(-)
-
-diff --git a/src/sage/libs/giac/giac.pyx b/src/sage/libs/giac/giac.pyx
-index 4e451dba5e7..ccad5169836 100644
---- a/src/sage/libs/giac/giac.pyx
-+++ b/src/sage/libs/giac/giac.pyx
-@@ -374,8 +374,7 @@ def _giac(s):
- 
-         sage: x = libgiac('x')
-         sage: (1+2*sin(3*x)).solve(x).simplify()
--        Warning, argument is not an equation, solving 1+2*sin(3*x)=0
--        list[-pi/18,7*pi/18]
-+        ...list[-pi/18,7*pi/18]
- 
-         sage: libgiac.solve('sin(3*x)>2*sin(x)',x)
-         Traceback (most recent call last):
-diff --git a/src/sage/symbolic/relation.py b/src/sage/symbolic/relation.py
-index e9dbc0fea30..b8896a94be9 100644
---- a/src/sage/symbolic/relation.py
-+++ b/src/sage/symbolic/relation.py
-@@ -935,8 +935,7 @@ def solve(f, *args, **kwds):
- 
-         sage: f = (sin(x) - 8*cos(x)*sin(x))*(sin(x)^2 + cos(x)) - (2*cos(x)*sin(x) - sin(x))*(-2*sin(x)^2 + 2*cos(x)^2 - cos(x))
-         sage: solve(f, x, algorithm='giac')
--        ...
--        [-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-+        ...[-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
- 
-         sage: x, y = SR.var('x,y')
-         sage: solve([x+y-4,x*y-3],[x,y],algorithm='giac')
-@@ -1440,19 +1439,15 @@ def _giac_solver(f, x, solution_dict=False):
-     EXAMPLES::
- 
-         sage: solve([(2/3)^x-2], [x], algorithm='giac')
--        ...
--        [[-log(2)/(log(3) - log(2))]]
-+        ...[[-log(2)/(log(3) - log(2))]]
-         sage: solve([(2/3)^x-2], [x], algorithm='giac', solution_dict=True)
--        ...
--        [{x: -log(2)/(log(3) - log(2))}]
-+        ...[{x: -log(2)/(log(3) - log(2))}]
- 
-         sage: f = (sin(x) - 8*cos(x)*sin(x))*(sin(x)^2 + cos(x)) - (2*cos(x)*sin(x) - sin(x))*(-2*sin(x)^2 + 2*cos(x)^2 - cos(x))
-         sage: solve(f, x, algorithm='giac')
--        ...
--        [-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-+        ...[-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-         sage: solve(f, x, algorithm='giac', solution_dict=True)
--        ...
--        [{x: -2*arctan(sqrt(2))}, {x: 0}, {x: 2*arctan(sqrt(2))}, {x: pi}]
-+        ...[{x: -2*arctan(sqrt(2))}, {x: 0}, {x: 2*arctan(sqrt(2))}, {x: pi}]
- 
-         sage: x, y = SR.var('x,y')
-         sage: solve([x+y-7,x*y-10],[x,y],algorithm='giac')
diff --git a/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch b/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
deleted file mode 100644
index 499e0c71e256..000000000000
--- a/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
+++ /dev/null
@@ -1,1303 +0,0 @@
-diff --git a/build/pkgs/gap/checksums.ini b/build/pkgs/gap/checksums.ini
-index 066e943308a..b0ea8ba8818 100644
---- a/build/pkgs/gap/checksums.ini
-+++ b/build/pkgs/gap/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=gap-VERSION.tar.gz
--sha1=4ecdd281b8f430282fb9b12690b06e0a26abde10
--md5=85dc9e459d5b6c66fcad9f468afd3e3e
--cksum=1351843158
-+sha1=a6e36f3f874a2c46f51561402634497eab705cca
-+md5=c5cd9f272f2703d7a3649ad7193b2d90
-+cksum=2760477284
- upstream_url=https://github.com/gap-system/gap/releases/download/vVERSION/gap-VERSION.tar.gz
-diff --git a/build/pkgs/gap/package-version.txt b/build/pkgs/gap/package-version.txt
-index d782fca8f64..f1cd7de1de5 100644
---- a/build/pkgs/gap/package-version.txt
-+++ b/build/pkgs/gap/package-version.txt
-@@ -1 +1 @@
--4.11.1
-+4.12.2
-diff --git a/build/pkgs/gap/spkg-check.in b/build/pkgs/gap/spkg-check.in
-index d9791d33293..d2fccda6e04 100644
---- a/build/pkgs/gap/spkg-check.in
-+++ b/build/pkgs/gap/spkg-check.in
-@@ -3,6 +3,13 @@ cd src
- # #28728: Fix test failure in tst/testinstall/strings.tst
- export LC_CTYPE=en_US.UTF-8
- 
-+# #34391: in GAP 4.12 some packages need GAP package io
-+#         to let tests run, otherwise this hangs. Thus we install io here.
-+cd pkg/io
-+./configure --with-gaproot=../..
-+make
-+cd ../..
-+
- make testinstall
- if [[ $? -ne 0 ]]; then
-     exit 1
-diff --git a/build/pkgs/gap/spkg-install.in b/build/pkgs/gap/spkg-install.in
-index 2ceadf99db4..e2c8b4dca54 100644
---- a/build/pkgs/gap/spkg-install.in
-+++ b/build/pkgs/gap/spkg-install.in
-@@ -8,8 +8,7 @@ export CFLAGS=$CFLAGS_NON_NATIVE
- export CXXFLAGS=$CXXFLAGS_NON_NATIVE
- 
- GAP_BUILD_ROOT="$(pwd)"
--GAP_ROOT="$SAGE_LOCAL/share/gap"
--DESTDIR_GAP_ROOT="$SAGE_DESTDIR$GAP_ROOT"
-+GAP_ROOT="$SAGE_LOCAL/lib/gap"
- 
- # Enable debug info if requested.
- # Note that -g3 allows you to use preprocessor macros in gdb which are widely used
-@@ -17,37 +16,17 @@ if [ "$SAGE_DEBUG" = yes ] ; then
-     export CFLAGS="-O0 -g3 -DDEBUG_MASTERPOINTERS -DDEBUG_GLOBAL_BAGS -DDEBUG_FUNCTIONS_BAGS $CFLAGS"
- fi
- 
--sdh_configure $SAGE_CONFIGURE_GMP
--sdh_make -j1
-+# LDFLAGS hack below needed by Semigroups package
-+sdh_configure $SAGE_CONFIGURE_GMP LDFLAGS="-pthread" --prefix=$SAGE_LOCAL
-+sdh_make
- 
--# GAP's "make install" is work in progress; we use bits and pieces of it
--# but we install many things manually.
--sdh_make install-headers install-libgap
--
--# Install config.h, which is not currently handled by `make install-headers`
--sdh_install gen/config.h "$SAGE_LOCAL/include/gap"
--
--# Now install the gap executable as "gap-bin"; it will be called normally
--# through our wrapper script that sets the appropriate GAP_ROOT
--SAGE_BIN="$SAGE_LOCAL/bin"
--mkdir -p "$SAGE_DESTDIR$SAGE_BIN" || sdh_die "Failed to create the directory $SAGE_BIN"
--
--./libtool --mode=install install gap "$SAGE_DESTDIR$SAGE_BIN/gap-bin" || \
--    sdh_die "Failed to install gap-bin to $SAGE_BIN"
--
--./libtool --mode=install install gac "$SAGE_DESTDIR$SAGE_BIN/gac" || \
--    sdh_die "Failed to install gac to $SAGE_BIN"
--
--# Now copy additional files GAP needs to run (and a few optional bits) into
--# GAP_ROOT; we don't need everything from the source tree
--sdh_install bin doc gen grp lib src tst sysinfo.gap "$GAP_ROOT"
--
--# GAP's copy of libtool is also used by the toolchain for build GAP packages
--# (i.e. by gac)
--sdh_install libtool "$GAP_ROOT"
-+sdh_make_install
-+# sdh_make install-headers install-libgap
-+# The 'packagemanager' package expects this https://github.com/gap-packages/PackageManager/issues/105
-+mkdir -p "$SAGE_LOCAL/lib/gap/bin"
- 
- # Install only the minimal packages GAP needs to run
--sdh_install pkg/GAPDoc-* pkg/primgrp-* pkg/SmallGrp-* pkg/transgrp "$GAP_ROOT"/pkg
-+sdh_install pkg/gapdoc pkg/primgrp pkg/smallgrp pkg/transgrp "$GAP_ROOT"/pkg
- 
- # Install additional packages that are not strictly required, but that are
- # typically "expected" to be loaded: These are the default packages that are
-@@ -58,50 +37,25 @@ sdh_install pkg/GAPDoc-* pkg/primgrp-* pkg/SmallGrp-* pkg/transgrp "$GAP_ROOT"/p
- # Also include atlasrep which is a dependency of tomlib
- sdh_install \
-     pkg/atlasrep \
--    pkg/autpgrp-* \
--    pkg/alnuth-* \
--    pkg/crisp-* \
--    pkg/ctbllib-* \
--    pkg/FactInt-* \
-+    pkg/autodoc \
-+    pkg/autpgrp \
-+    pkg/alnuth \
-+    pkg/crisp \
-+    pkg/ctbllib \
-+    pkg/factint \
-     pkg/fga \
--    pkg/irredsol-* \
--    pkg/laguna-* \
--    pkg/PackageManager-* \
--    pkg/polenta-* \
--    pkg/polycyclic-* \
--    pkg/resclasses-* \
--    pkg/sophus-* \
--    pkg/tomlib-* \
-+    pkg/irredsol \
-+    pkg/laguna \
-+    pkg/packagemanager \
-+    pkg/polenta \
-+    pkg/polycyclic \
-+    pkg/radiroot \
-+    pkg/resclasses \
-+    pkg/sophus \
-+    pkg/tomlib \
-+    pkg/utils \
-     "$GAP_ROOT"/pkg
- 
--# Install the GAP startup script; ensure it is executable
--sdh_install -T ../gap "$SAGE_BIN/gap"
--chmod +x "$SAGE_DESTDIR$SAGE_BIN/gap"
--
--# Create symlinks under $GAP_ROOT for these executables, as they are expected
--# (especially when building kernel packages) to exist
--ln -sf "../../bin/gap-bin" "$DESTDIR_GAP_ROOT/gap"
--ln -sf "../../bin/gac" "$DESTDIR_GAP_ROOT/gac"
--
--# Fix the $GAP_ROOT/bin/<arch>/src symlink to be relative (otherwise it links
--# to the actual path of the sources GAP was compiled from)
--for srclink in "$DESTDIR_GAP_ROOT"/bin/*/src; do
--    rm -f "$srclink"
--    ln -s "../../src" "$srclink"
--done
--
--# Additional fixups for some files after they have been copied into their
--# destination directory.  gac and sysinfo.gap are generated files that contain
--# in them hard-coded references to the GAP build directory, which will soon
--# be going away.  This breaks the build toolchain for some compiled GAP
--# packages.  We need to replace these paths with the final GAP_ROOT path.  The
--# below will work so long as neither of these paths contain '|', and if they do
--# then god help you.  https://trac.sagemath.org/ticket/27218
--sed -i -e "s|$GAP_BUILD_ROOT|$GAP_ROOT|g" \
--    "$SAGE_DESTDIR$SAGE_BIN/gac" "$DESTDIR_GAP_ROOT/sysinfo.gap" \
--    "$DESTDIR_GAP_ROOT/bin/gap.sh" "$DESTDIR_GAP_ROOT/doc/make_doc" || \
--    sdh_die "Failed to fix up hard-coded paths in GAP build tools."
--
- # TODO: This seems unnecessary--we are already installing all of doc/ to
- # GAP_ROOT, which is necessary for some functionality in GAP to work.  Do
- # we need this?  Maybe doc/gap could just be a symlink to gap/doc??
-diff --git a/build/pkgs/gap/spkg-legacy-uninstall b/build/pkgs/gap/spkg-legacy-uninstall
-index d17eb939eb7..a8e5c59e1fb 100755
---- a/build/pkgs/gap/spkg-legacy-uninstall
-+++ b/build/pkgs/gap/spkg-legacy-uninstall
-@@ -4,6 +4,8 @@ rm -rf "$SAGE_LOCAL/gap/gap-4."*
- rm -rf "$SAGE_SHARE/gap"
- rm -f "$SAGE_LOCAL/gap/latest"
- rm -f "$SAGE_LOCAL/bin/gap"
-+rm -f "$SAGE_LOCAL/bin/gac"
- 
--# Remove old libgap headers
-+# Remove old libgap headers and library
- rm -rf "$SAGE_LOCAL/include/gap"
-+rm -rf "$SAGE_LOCAL/lib/gap"
-diff --git a/build/pkgs/gap/spkg-prerm.in b/build/pkgs/gap/spkg-prerm.in
-deleted file mode 100644
-index 661d92621fa..00000000000
---- a/build/pkgs/gap/spkg-prerm.in
-+++ /dev/null
-@@ -1,6 +0,0 @@
--# These generated files are placed in directory provided by the SPKG, so
--# delete the generated files first so that their parent directories can be
--# removed during installation
--GAP_ROOT="$SAGE_LOCAL/share/gap"
--rm -f "$GAP_ROOT/pkg/atlasrep/datagens/"*.*
--rm -f "$GAP_ROOT/pkg/atlasrep/dataword/"*.*
-diff --git a/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch b/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch
-deleted file mode 100644
-index e45fe7d9c6f..00000000000
---- a/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch
-+++ /dev/null
-@@ -1,150 +0,0 @@
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c b/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--index 3bbdc45..7df699f 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--@@ -8,9 +8,8 @@ extern short sp[],**mat[],*psp[],**imcos[],**cpco[],lorb[],
-- short *cst,**cpst,***cdpst,**svptr,*cp,*rel;
-- short *spst,**pspst,**pptr,**cpptr,npt,nb,nph,nph2,npg,npg2,
--       rno,orno,coh_index,*invg;
---FILE  *ip,*op;
-- 
---void seeknln (void) { while (getc(ip)!='\n'); }
--+void seeknln (FILE *ip) { while (getc(ip)!='\n'); }
-- 
-- /* This program differs from most other permutation programs in that perms are
--    all stored in the single array sp. Schreier vectors are stored in the short
--@@ -23,13 +22,14 @@ void seeknln (void) { while (getc(ip)!='\n'); }
-- int 
-- crprog1 (void)
-- { short *pc,*qc,ex,neg; int x;
--+  FILE  *ip,*op;
--   short i,j,k,l,m,n,cl,rl,*p,ocl,im,pt,pt1,pn,ipt;
--   if ((ip=fopen(inf2,"r"))== 0)
--   { fprintf(stderr,"Cannot open %s.\n",inf2); return(-1);}
--   fscanf(ip,"%hd%hd%hd%hd",&npt,&nph,&nb,&k);
--   if (nb>=mb) {fprintf(stderr,"nb too big. Increase MB.\n"); return(-1);}
--   if (k<=2) {fprintf(stderr,"inf2 has illegal format.\n"); return(-1); }
---  seeknln(); seeknln();
--+  seeknln(ip); seeknln(ip);
--   for (i=1;i<=nb;i++) fscanf(ip,"%hd",lorb+i);
--   pptr=psp-1; pspst=psp+nph; svptr=cpsp-1;  cpst=cpsp+nb;
--   invg=sp; nph2=2*nph; spst=sp+nph2;
--@@ -37,7 +37,7 @@ crprog1 (void)
--   { pptr[i]=spst+(i-1)*npt-1; p=pptr[i];
--     for (j=1;j<=npt;j++) {fscanf(ip,"%hd",&k); p[k]=j; }
--     invg[2*i-2]=2*i-1; invg[2*i-1]=2*i-2;
---    seeknln();
--+    seeknln(ip);
--   }
--   spst+=(npt*nph);
--   for (i=1;i<=nb;i++)
--@@ -75,7 +75,7 @@ crprog1 (void)
--   strcpy(inf1,inf0); strcat(inf1,".rel");
--   if ((ip=fopen(inf1,"r"))==0)
--   { fprintf(stderr,"Cannot open %s.\n",inf1); return(-1);}
---  fscanf(ip,"%hd%hd",&k,&rno); seeknln();
--+  fscanf(ip,"%hd%hd",&k,&rno); seeknln(ip);
--   op=fopen(outft,"w");
-- /* Now we have read everything in, and the computation can start */
--   orno=0;
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--index a7396b2..658496f 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--@@ -20,8 +20,6 @@ short  mexp=MEXP,mcl=MCL,no,rel[RSP],wt[MEXP],exp,*rpf,*rpb,
-- extern short  prime,dim,*spv,**spm,mspace[],*vec[],**mat[],cp[],pinv[],opmats,
--         mm,mv;
-- extern int msp;
---FILE *ip,*op;
---
-- 
-- int 
-- calcmats (void)
--@@ -59,7 +57,7 @@ calcmats (void)
--   }
--   for (i=1;i<=exp;i++) trans(mat[i+exp],mat[i]);
--   if (opmats)
---  { op=fopen(outf,"w");
--+  { FILE *op=fopen(outf,"w");
--     fprintf(op,"%4d%4d%4d\n",prime,dim,exp);
--     for (i=1;i<=exp;i++) printmat(mat[i]); 
--     fclose(op);
--@@ -71,6 +69,7 @@ int
-- rdmats (void)
-- /* reads matrices of generators of P */
-- { short i; int quot;
--+  FILE *ip;
--   ip=fopen(inf4,"r");
--   if (ip==0)
--   { fprintf(stderr,"Cannot open %s\n ",inf4); return(-1); }
--@@ -90,12 +89,12 @@ rdmats (void)
--   fclose(ip);
--   return(0);
-- }
---FILE *ip;
-- 
-- int 
-- ingp (int inp)
-- /* Read in output of respcrun -s */
-- { short i,j,k,l,m,*orpf,**pcp;
--+  FILE *ip;
--   ip=fopen(inf3,"r");
--   if (ip==0) { fprintf(stderr,"Cannot open %s\n",inf3); return(-1); }
--   fscanf(ip,"%hd%hd%hd%hd%hd%hd",&prime,&exp,&i,&no,&j,&m);
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--index 0896551..6841bc8 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--@@ -9,7 +9,6 @@ extern short  intexp,mexp,mng,wksp,
--        spugen[],*tlintg[];
-- extern int ptrsp,rsp;
-- short  fac;
---FILE *ip,*op;
-- 
-- int 
-- ingp (void)
--@@ -18,6 +17,7 @@ ingp (void)
--    of nqrun, and tails are also read in.
-- */
-- { short i,j,k,l,m,x,y,no,*orpf,*orpb,**pcp;  char tails;
--+  FILE *ip;
--   if ((ip=fopen(inf1,"r"))==0)
--   { fprintf(stderr,"Cannot open %s.\n",inf1); return(-1); }
--   fscanf(ip,"%hd%hd%hd%hd%hd%hd",&prime,&exp,&nng,&no,&class,&m);
--@@ -89,6 +89,7 @@ int
-- outgp (void)
-- /* The PCP is output, together with tails */
-- { short i,k,l,**pcp,*b,*e,*c;
--+  FILE *op;
--   op=fopen(outf,"w");
--   fprintf(op,"%4d%4d%4d%4d%4d%4d\n",prime,exp,nng,exp,class,1);
--   for (i=1;i<=exp;i++) fprintf(op,"%4d",wt[i]); fprintf(op,"\n");
--@@ -379,7 +380,7 @@ restart:
--     nng--; mnng--; enexpnt--;
--     if (nng==0)
--     { if (gap)
---      { op=fopen(outfm,"w"); fprintf(op,"COHOMOLO.Multiplier:=[];\n");
--+      { FILE *op=fopen(outfm,"w"); fprintf(op,"COHOMOLO.Multiplier:=[];\n");
--         fclose(op);
--         printf("All new generators eliminated. Multiplier is trivial.\n");
--       }
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--index 01cf914..0144883 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--@@ -9,7 +9,6 @@ extern short  intexp,mng,mexp,wksp,
--        spugen[],*intg[],*imintg[],*tlintg[];
-- extern int ptrsp,rsp;
-- short  *wf,*wc; char norm;
---FILE *ip,*op;
-- 
-- /* The data structures for this program and for nqrun are similar.
--    d1 and d2 contain definitions of generators. (Def. comes from commutator
--@@ -35,6 +34,7 @@ nqmprog (void)
-- { short i,j,k,l,m,d,*gi,*gj,*ti,*tj,cl,def,*ps,*pf,**dp,*nrpb,*p,*orpf,*orpb,
--         nb,np,k1,*rno,*covrel,**pgen,tdef,sgn;
--   char nt;
--+  FILE *ip,*op;
--   if (ingp() == -1) {fprintf(stderr,"Input error.\n"); return(-1); }
--   eexpnt=expnt+exp; enexpnt=nexpnt+nng;
-- 
-diff --git a/build/pkgs/gap_packages/patches/guava_leon_includes.patch b/build/pkgs/gap_packages/patches/guava_leon_includes.patch
-deleted file mode 100644
-index cdcd19cc3e8..00000000000
---- a/build/pkgs/gap_packages/patches/guava_leon_includes.patch
-+++ /dev/null
-@@ -1,13 +0,0 @@
----- a/pkg/guava-3.15/src/leon/src/generate.c	Sat Feb 29 09:02:10 2020
----- b/pkg/guava-3.15/src/leon/src/generate.c	Thu Sep 24 13:58:36 2020
--***************
--*** 115,120 ****
----- 115,122 ----
--  #include "groupio.h"
--  #include "enum.h"
--  #include "storage.h"
--+ #include "chbase.h"
--+ #include "inform.h"
--  
--  #ifdef ALT_TIME_HEADER
--  #include "cputime.h"
-diff --git a/build/pkgs/gap_packages/spkg-install.in b/build/pkgs/gap_packages/spkg-install.in
-index 168e6b11532..6dff182a48f 100644
---- a/build/pkgs/gap_packages/spkg-install.in
-+++ b/build/pkgs/gap_packages/spkg-install.in
-@@ -1,4 +1,4 @@
--GAP_ROOT="$SAGE_LOCAL/share/gap"
-+GAP_ROOT="$SAGE_LOCAL/lib/gap"
- PKG_DIR="$GAP_ROOT/pkg"
- 
- PKG_SRC_DIR="$(pwd)/src/pkg"
-@@ -11,33 +11,31 @@ cd "$PKG_SRC_DIR"
- #    (GAP 4.8.6 still had it, but this is gone in 4.10)
- 
- sdh_install \
--    aclib-* \
--    AutoDoc-* \
--    corelg-* \
--    crime-* \
-+    aclib \
-+    corelg \
-+    crime \
-     cryst \
-     crystcat \
--    design-* \
-+    design \
-     gbnp \
--    genss-* \
--    hap-* \
--    hapcryst-* \
--    hecke-* \
--    images-* \
--    liealgdb-* \
--    liepring-* \
--    liering-* \
--    loops-* \
--    MapClass-* \
--    polymaking-* \
--    qpa-* \
--    quagroup-* \
--    radiroot-* \
--    repsn-* \
--    sla-* \
--    sonata-* \
--    Toric-* \
--    utils-* \
-+    genss \
-+    hap \
-+    hapcryst \
-+    hecke \
-+    images \
-+    liealgdb \
-+    liepring \
-+    liering \
-+    loops \
-+    mapclass \
-+    polymaking \
-+    qpa \
-+    quagroup \
-+    repsn \
-+    singular \
-+    sla \
-+    sonata \
-+    toric \
-     "$PKG_DIR"
- 
- install_compiled_pkg()
-@@ -45,27 +43,23 @@ install_compiled_pkg()
-     local pkg="$1"
-     # Install the bin/ dir (where compiled modules should end up)
-     # under <prefix>/lib/gap; we then symlink to it later
--    sdh_install bin "$SAGE_LOCAL/lib/gap/pkg/$pkg"
-+    sdh_install * "$SAGE_LOCAL/lib/gap/pkg/$pkg"
- 
-+    # TODO:
-     # Clean up any build artificts before installing the rest of the package
-     # Also remove configure/Makefiles
-     # Note: None, if any of the packages really have a proper install target
--    make clean  # Works for some packages but not all
--    rm -rf bin/
--    rm -rf configure configure.* config.* autogen.sh *.m4 Makefile* m4/
-+    #make clean  # Works for some packages but not all
-+    #rm -rf bin/
-+    #rm -rf configure configure.* config.* autogen.sh *.m4 Makefile* m4/
- 
--    # Create the bin/ symlink
--    ln -s "$SAGE_LOCAL/lib/gap/pkg/$pkg/bin" bin
--
--    # Install the rest of the package files
--    sdh_install * "$PKG_DIR/$pkg"
- }
- 
- # Build and install compiled packages:
- #
- # These packages have an old ./configure that take the GAP_ROOT as a positional
- # argument
--for pkg in cohomolo-* crypting-* grape-* guava-* orb-* datastructures-*
-+for pkg in cohomolo crypting grape guava orb datastructures
- do
-     echo "Building GAP package $pkg"
-     CFLAGS="$CFLAGS -Wno-implicit-function-declaration"
-@@ -91,7 +85,7 @@ pararr=( " " " " "--with-external-planarity" "--with-external-libsemigroups" )
- ##############################################################################
- 
- parind=0
--for pkg in nq-* io-* digraphs-* semigroups-*
-+for pkg in nq io digraphs semigroups
- do
-     echo "Building GAP package $pkg"
-     cd "$PKG_SRC_DIR/$pkg"
-diff --git a/build/pkgs/libsemigroups/checksums.ini b/build/pkgs/libsemigroups/checksums.ini
-index 62c4268515f..4e13a36cb35 100644
---- a/build/pkgs/libsemigroups/checksums.ini
-+++ b/build/pkgs/libsemigroups/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=libsemigroups-VERSION.tar.gz
--sha1=2b16c095cc5ffd3f77a71dfbf48cce188e054c03
--md5=7082cadcf7a195ccb93175cd72b6db95
--cksum=1501022358
-+sha1=86375824b47ce4b0e23570122e873f67136d0c0a
-+md5=ff79ad5fbc8bfeb64d48faaf24106b98
-+cksum=2845045455
- upstream_url=https://github.com/libsemigroups/libsemigroups/releases/download/vVERSION/libsemigroups-VERSION.tar.gz
-diff --git a/build/pkgs/libsemigroups/package-version.txt b/build/pkgs/libsemigroups/package-version.txt
-index 9084fa2f716..f90b1afc082 100644
---- a/build/pkgs/libsemigroups/package-version.txt
-+++ b/build/pkgs/libsemigroups/package-version.txt
-@@ -1 +1 @@
--1.1.0
-+2.3.2
-diff --git a/build/pkgs/libsemigroups/spkg-install.in b/build/pkgs/libsemigroups/spkg-install.in
-index 2aaf0e99043..128b54d2f99 100644
---- a/build/pkgs/libsemigroups/spkg-install.in
-+++ b/build/pkgs/libsemigroups/spkg-install.in
-@@ -1,4 +1,4 @@
- cd src
--sdh_configure
-+sdh_configure --disable-eigen
- sdh_make
- sdh_make_install
-diff --git a/build/pkgs/singular/spkg-configure.m4 b/build/pkgs/singular/spkg-configure.m4
-index d4d145defe3..6a85631f624 100644
---- a/build/pkgs/singular/spkg-configure.m4
-+++ b/build/pkgs/singular/spkg-configure.m4
-@@ -9,52 +9,7 @@ SAGE_SPKG_CONFIGURE([singular], [
-        AC_MSG_CHECKING([that Singular's help is working])
-        AS_IF([test x`printf "system(\"--browser\", \"builtin\"); \n help;" | Singular 2>&1 | grep "error occurred"` = x], [
-         AC_MSG_RESULT(yes)
--        dnl We have Singular. Now determine the shared library path on
--        dnl platforms on which sage.libs.singular needs to reload the library with RTLD_GLOBAL.
--        AS_CASE([$host_os],
--          [cygwin*], [dnl Nothing to do
--                     ],
--                     [dnl Use pkg-config to get singular's libdir while we're at it. As a
--                      dnl moral compromise for using pkg-config, this ultimately allows us
--                      dnl to pass an absolute path to dlopen(), which is the only approach
--                      dnl that POSIX guarantees will work.
--                      PKG_CHECK_VAR([SINGULAR_LIB_DIR], [Singular], [libdir])
--                      dnl The acl_shlibext variable is set in the top-level configure.ac.
--                      AC_LANG_PUSH(C)
--                      ORIG_LIBS="${LIBS}"
--                      LIBS="${LIBS} -ldl"
--                      AC_MSG_CHECKING([if we can dlopen($LIBSINGULAR_PATH)])
--                      LIBSINGULAR_PATH="${SINGULAR_LIB_DIR}/libSingular.${acl_shlibext}"
--
--                      dnl if we can dlopen() it, substitute the name for sage_conf;
--                      dnl otherwise, fall back to using the SPKG.
--                      AC_RUN_IFELSE(
--                        [AC_LANG_PROGRAM(
--                          [[#include <dlfcn.h>]],
--                          [[void* h = dlopen("${LIBSINGULAR_PATH}", RTLD_LAZY | RTLD_GLOBAL);
--                            if (h == 0) { return 1; } else { return dlclose(h); }]]
--                        )], [
--                          AC_MSG_RESULT(yes)
--                        ], [
--                          dnl try Debian-specific name
--                          LIBSINGULAR_PATH="${SINGULAR_LIB_DIR}/libsingular-Singular.${acl_shlibext}"
--                          AC_RUN_IFELSE(
--                           [AC_LANG_PROGRAM(
--                             [[#include <dlfcn.h>]],
--                             [[void* h = dlopen("${LIBSINGULAR_PATH}", RTLD_LAZY | RTLD_GLOBAL);
--                               if (h == 0) { return 1; } else { return dlclose(h); }]]
--                           )], [
--                             AC_MSG_RESULT(yes)
--                           ], [
--                            AC_MSG_RESULT(no)
--                            sage_spkg_install_singular=yes
--                          ], [AC_MSG_RESULT(yes)])
--                        ], [AC_MSG_RESULT(yes)])
--
--                      AC_LANG_POP()
--                      LIBS="${ORIG_LIBS}"
--                     ]
--       )], [
-+       ], [
-        AC_MSG_RESULT(no)
-        sage_spkg_install_singular=yes
-        ]
-@@ -64,20 +19,4 @@ SAGE_SPKG_CONFIGURE([singular], [
-       ])
-     ])
-   ])
--],[],[],[
--  dnl Post-check phase
--  dnl We make the sage_conf substitutions here, because the "default"
--  dnl substitution needs to be made even if we skipped the system-Singular
--  dnl checks themselves.
--  AS_IF([test "x${sage_spkg_install_singular}" = "xyes"], [
--    AS_CASE([$host_os],
--      [cygwin*], [dnl Nothing to do
--                 ],
--                 [dnl Set shared library path, needed for reloading the library with RTLD_GLOBAL
--                  LIBSINGULAR_PATH="\$SAGE_LOCAL/lib/libSingular.${acl_shlibext}"
--                 ]
--    )
--  ])
--
--  AC_SUBST(LIBSINGULAR_PATH, "${LIBSINGULAR_PATH}")
- ])
-diff --git a/pkgs/sage-conf/_sage_conf/_conf.py.in b/pkgs/sage-conf/_sage_conf/_conf.py.in
-index 6cd28f558a8..d66bdb3d264 100644
---- a/pkgs/sage-conf/_sage_conf/_conf.py.in
-+++ b/pkgs/sage-conf/_sage_conf/_conf.py.in
-@@ -55,9 +55,6 @@ THREEJS_DIR = SAGE_LOCAL + "/share/threejs-sage"
- OPENMP_CFLAGS = "@OPENMP_CFLAGS@"
- OPENMP_CXXFLAGS = "@OPENMP_CXXFLAGS@"
- 
--# The full absolute path to the main Singular library.
--LIBSINGULAR_PATH = "@LIBSINGULAR_PATH@".replace('$SAGE_LOCAL', SAGE_LOCAL)
--
- # Installation location of wheels. This is determined at configuration time
- # and does not depend on the installation location of sage-conf.
- SAGE_SPKG_WHEELS = "@SAGE_VENV@".replace('${SAGE_LOCAL}', SAGE_LOCAL) + "/var/lib/sage/wheels"
-diff --git a/src/doc/en/thematic_tutorials/lie/weyl_groups.rst b/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-index c917338e444..182e74aad20 100644
---- a/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-+++ b/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-@@ -139,12 +139,12 @@ string, which you can print::
-     X.1      1  1  1  1  1  1  1  1  1  1  1  1  1
-     X.2      1 -1  1  1 -1  1  1 -1 -1 -1  1  1  1
-     X.3      2  .  2 -1  .  2  2  .  .  . -1  2  2
--    X.4      3 -1 -1  .  1 -1  3 -1  1 -1  . -1  3
--    X.5      3 -1 -1  .  1  3 -1 -1 -1  1  . -1  3
--    X.6      3  1 -1  . -1 -1  3  1 -1  1  . -1  3
--    X.7      3  1 -1  . -1  3 -1  1  1 -1  . -1  3
--    X.8      3 -1  3  . -1 -1 -1 -1  1  1  . -1  3
--    X.9      3  1  3  .  1 -1 -1  1 -1 -1  . -1  3
-+    X.4      3 -1 -1  .  1  3 -1 -1 -1  1  . -1  3
-+    X.5      3  1 -1  . -1  3 -1  1  1 -1  . -1  3
-+    X.6      3 -1  3  . -1 -1 -1 -1  1  1  . -1  3
-+    X.7      3 -1 -1  .  1 -1  3 -1  1 -1  . -1  3
-+    X.8      3  1  3  .  1 -1 -1  1 -1 -1  . -1  3
-+    X.9      3  1 -1  . -1 -1  3  1 -1  1  . -1  3
-     X.10     4 -2  . -1  .  .  .  2  .  .  1  . -4
-     X.11     4  2  . -1  .  .  . -2  .  .  1  . -4
-     X.12     6  . -2  .  . -2 -2  .  .  .  .  2  6
-diff --git a/src/sage/coding/codecan/autgroup_can_label.pyx b/src/sage/coding/codecan/autgroup_can_label.pyx
-index de5db985e0b..c83b9264e44 100644
---- a/src/sage/coding/codecan/autgroup_can_label.pyx
-+++ b/src/sage/coding/codecan/autgroup_can_label.pyx
-@@ -76,7 +76,7 @@ columns do share the same coloring::
-     ((1,),
-      (2,),
-      (3, 5, 4),
--     (6, 19, 16, 9, 21, 10, 8, 15, 14, 11, 20, 13, 12, 7, 17, 18))
-+     (6, 19, 16, 21, 9, 10, 15, 8, 20, 11, 14, 13, 7, 12, 18, 17))
- 
- We can also restrict the group action to linear isometries::
- 
-diff --git a/src/sage/coding/linear_code.py b/src/sage/coding/linear_code.py
-index a3ac3ca1547..bfb9f8696e8 100644
---- a/src/sage/coding/linear_code.py
-+++ b/src/sage/coding/linear_code.py
-@@ -465,27 +465,27 @@ def automorphism_group_gens(self, equivalence="semilinear"):
-             0
-             sage: C = codes.HammingCode(GF(4, 'z'), 3)
-             sage: C.automorphism_group_gens()
--            ([((1, 1, 1, 1, 1, z + 1, z, z + 1, z, z, z, 1, 1, z + 1, z + 1, z, z + 1, z, z + 1, z + 1, z + 1); (1,14,6,7,4,10,11,19)(2,8,16,13,3,17,21,15)(9,12,18,20), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((1, 1, 1, z, z + 1, 1, 1, 1, 1, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z); (1,13,14,20)(2,21,8,18,7,16,19,15)(3,10,5,12,17,9,6,4), Ring endomorphism of Finite Field in z of size 2^2
-+                Defn: z |--> z + 1),
-+              ((z, 1, z, z, z, z + 1, z, z, z, z, z, z, z + 1, z, z, z, z, z + 1, z, z, z); (1,11,5,12,3,19)(2,8)(6,18,13)(7,17,15)(9,10,14,16,20,21), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z + 1),
--              ((z + 1, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z + 1, 1, z, z + 1, z + 1, z); (1,18,6,19,2,9,17,10,13,14,21,11,4,5,12)(3,20,7,16,8), Ring endomorphism of Finite Field in z of size 2^2
--                Defn: z |--> z),
-               ((z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z); (), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-              362880)
-             sage: C.automorphism_group_gens(equivalence="linear")
--            ([((z + 1, 1, z + 1, z + 1, z + 1, z, 1, z, 1, 1, 1, 1, z + 1, z + 1, z + 1, z, z, 1, z, z, z); (1,15,2,8,16,18,3)(4,9,12,13,20,10,11)(5,21,14,6,7,19,17), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((z, 1, z + 1, z + 1, 1, z + 1, z, 1, z + 1, z + 1, 1, z, 1, z + 1, z, 1, z, 1, z + 1, 1, 1); (1,12,11,10,6,8,9,20,13,21,5,14,3,16,17,19,7,4,2,15,18), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((z + 1, z + 1, z + 1, z + 1, z + 1, 1, z, 1, z, z, z, 1, z, 1, 1, 1, z + 1, z + 1, z + 1, 1, z); (1,15,21,8,9)(2,18,5,3,11,16,7,10,19,13,12,4,17,6,20), Ring endomorphism of Finite Field in z of size 2^2
-+              ((z + 1, z + 1, z + 1, z, 1, 1, z, z, 1, z + 1, z, 1, 1, z, 1, z + 1, z, z + 1, z + 1, 1, z); (1,3,18,2,17,6,19)(4,15,13,20,7,14,16)(5,11,8,21,12,9,10), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
-               ((z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1); (), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-              181440)
-             sage: C.automorphism_group_gens(equivalence="permutational")
--            ([((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,19)(3,17)(4,21)(5,20)(7,14)(9,12)(10,16)(11,15), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,11)(3,10)(4,9)(5,7)(12,21)(14,20)(15,19)(16,17), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,11)(3,10)(4,9)(5,7)(12,21)(14,20)(15,19)(16,17), Ring endomorphism of Finite Field in z of size 2^2
-+              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (2,18)(3,19)(4,10)(5,16)(8,13)(9,14)(11,21)(15,20), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,17)(2,8)(3,14)(4,10)(7,12)(9,19)(13,18)(15,20), Ring endomorphism of Finite Field in z of size 2^2
-+              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,19)(3,17)(4,21)(5,20)(7,14)(9,12)(10,16)(11,15), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
-               ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (2,13)(3,14)(4,20)(5,11)(8,18)(9,19)(10,15)(16,21), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-@@ -691,10 +691,10 @@ def _canonize(self, equivalence):
-             sage: C_iso == aut_group_can_label.get_canonical_form()
-             True
-             sage: aut_group_can_label.get_autom_gens()
--            [((1, 1, 1, 1, 1, z + 1, z, z + 1, z, z, z, 1, 1, z + 1, z + 1, z, z + 1, z, z + 1, z + 1, z + 1); (1,14,6,7,4,10,11,19)(2,8,16,13,3,17,21,15)(9,12,18,20), Ring endomorphism of Finite Field in z of size 2^2
-+            [((1, 1, 1, z, z + 1, 1, 1, 1, 1, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z); (1,13,14,20)(2,21,8,18,7,16,19,15)(3,10,5,12,17,9,6,4), Ring endomorphism of Finite Field in z of size 2^2
-+               Defn: z |--> z + 1),
-+             ((z, 1, z, z, z, z + 1, z, z, z, z, z, z, z + 1, z, z, z, z, z + 1, z, z, z); (1,11,5,12,3,19)(2,8)(6,18,13)(7,17,15)(9,10,14,16,20,21), Ring endomorphism of Finite Field in z of size 2^2
-                Defn: z |--> z + 1),
--             ((z + 1, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z + 1, 1, z, z + 1, z + 1, z); (1,18,6,19,2,9,17,10,13,14,21,11,4,5,12)(3,20,7,16,8), Ring endomorphism of Finite Field in z of size 2^2
--               Defn: z |--> z),
-              ((z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z); (), Ring endomorphism of Finite Field in z of size 2^2
-                Defn: z |--> z)]
-         """
-diff --git a/src/sage/combinat/posets/posets.py b/src/sage/combinat/posets/posets.py
-index 2836d59d960..8c882d5ac3b 100644
---- a/src/sage/combinat/posets/posets.py
-+++ b/src/sage/combinat/posets/posets.py
-@@ -8813,7 +8813,7 @@ def _libgap_(self):
-             sage: libgap(P)  # optional - gap_packages
-             <A poset on 5 points>
-             sage: A = libgap(GF(2)).PosetAlgebra(P); A  # optional - gap_packages
--            <GF(2)[<quiver with 5 vertices and 5 arrows>]/<two-sided ideal in <GF(2)[<quiver with 5 vertices and 5 arrows>]>, (1 generators)>>
-+            <GF(2)[<quiver with 5 vertices and 5 arrows>]/<two-sided ideal in <GF(2)[<quiver with 5 vertices and 5 arrows>]>, (1 generator)>>
-             sage: A.Dimension()  # optional - gap_packages
-             13
-         """
-diff --git a/src/sage/combinat/root_system/hecke_algebra_representation.py b/src/sage/combinat/root_system/hecke_algebra_representation.py
-index 6b756bafc30..8ac99319bec 100644
---- a/src/sage/combinat/root_system/hecke_algebra_representation.py
-+++ b/src/sage/combinat/root_system/hecke_algebra_representation.py
-@@ -357,7 +357,7 @@ def Tw(self, word, signs=None, scalar=None):
-             sage: q1, q2 = K.gens()
-             sage: KW = W.algebra(K)
-             sage: x = KW.an_element(); x
--            123 + 3*32 + 2*3 + e
-+            123 + 3*2312 + 2*31 + e
- 
-             sage: T = KW.demazure_lusztig_operators(q1,q2)
-             sage: T12 = T.Tw( (1,2) )
-diff --git a/src/sage/combinat/symmetric_group_algebra.py b/src/sage/combinat/symmetric_group_algebra.py
-index b8a0bebab44..9bccba124c8 100644
---- a/src/sage/combinat/symmetric_group_algebra.py
-+++ b/src/sage/combinat/symmetric_group_algebra.py
-@@ -101,7 +101,7 @@ def SymmetricGroupAlgebra(R, W, category=None):
-         sage: SGA.group()
-         Weyl Group of type ['A', 3] (as a matrix group acting on the ambient space)
-         sage: SGA.an_element()
--        s1*s2*s3 + 3*s3*s2 + 2*s3 + 1
-+        s1*s2*s3 + 3*s2*s3*s1*s2 + 2*s3*s1 + 1
- 
-     The preferred way to construct the symmetric group algebra is to
-     go through the usual ``algebra`` method::
-diff --git a/src/sage/env.py b/src/sage/env.py
-index 911f34b1bc6..5f7aca8599c 100644
---- a/src/sage/env.py
-+++ b/src/sage/env.py
-@@ -197,7 +197,8 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- GRAPHS_DATA_DIR = var("GRAPHS_DATA_DIR", join(SAGE_SHARE, "graphs"))
- ELLCURVE_DATA_DIR = var("ELLCURVE_DATA_DIR", join(SAGE_SHARE, "ellcurves"))
- POLYTOPE_DATA_DIR = var("POLYTOPE_DATA_DIR", join(SAGE_SHARE, "reflexive_polytopes"))
--GAP_ROOT_DIR = var("GAP_ROOT_DIR", join(SAGE_SHARE, "gap"))
-+GAP_LIB_DIR = var("GAP_LIB_DIR", join(SAGE_LOCAL, "lib", "gap"))
-+GAP_SHARE_DIR = var("GAP_SHARE_DIR", join(SAGE_SHARE, "gap"))
- THEBE_DIR = var("THEBE_DIR", join(SAGE_SHARE, "thebe"))
- COMBINATORIAL_DESIGN_DATA_DIR = var("COMBINATORIAL_DESIGN_DATA_DIR", join(SAGE_SHARE, "combinatorial_designs"))
- CREMONA_MINI_DATA_DIR = var("CREMONA_MINI_DATA_DIR", join(SAGE_SHARE, "cremona"))
-@@ -229,12 +230,6 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- LIE_INFO_DIR = var("LIE_INFO_DIR", join(SAGE_LOCAL, "lib", "LiE"))
- SINGULAR_BIN = var("SINGULAR_BIN") or "Singular"
- 
--# The path to libSingular, to be passed to dlopen(). This will
--# typically be set to an absolute path in sage_conf, but the relative
--# fallback path here works on systems where dlopen() searches the
--# system's library locations.
--LIBSINGULAR_PATH = var("LIBSINGULAR_PATH", "libSingular.so")
--
- # OpenMP
- OPENMP_CFLAGS = var("OPENMP_CFLAGS", "")
- OPENMP_CXXFLAGS = var("OPENMP_CXXFLAGS", "")
-@@ -255,81 +250,6 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- SAGE_GAP_COMMAND = var('SAGE_GAP_COMMAND', _gap_cmd)
- 
- 
--def _get_shared_lib_path(*libnames: str) -> Optional[str]:
--    """
--    Return the full path to a shared library file installed in
--    ``$SAGE_LOCAL/lib`` or the directories associated with the
--    Python sysconfig.
--
--    This can also be passed more than one library name (e.g. for cases where
--    some library may have multiple names depending on the platform) in which
--    case the first one found is returned.
--
--    This supports most *NIX variants (in which ``lib<libname>.so`` is found
--    under ``$SAGE_LOCAL/lib``), macOS (same, but with the ``.dylib``
--    extension), and Cygwin (under ``$SAGE_LOCAL/bin/cyg<libname>.dll``,
--    or ``$SAGE_LOCAL/bin/cyg<libname>-*.dll`` for versioned DLLs).
--
--    For distributions like Debian that use a multiarch layout, we also try the
--    multiarch lib paths (i.e. ``/usr/lib/<arch>/``).
--
--    This returns ``None`` if no matching library file could be found.
--
--    EXAMPLES::
--
--        sage: from sage.env import _get_shared_lib_path
--        sage: "gap" in _get_shared_lib_path("gap")
--        True
--        sage: _get_shared_lib_path("an_absurd_lib") is None
--        True
--
--    """
--
--    for libname in libnames:
--        search_directories: List[Path] = []
--        patterns: List[str] = []
--        if sys.platform == 'cygwin':
--            # Later down we take the first matching DLL found, so search
--            # SAGE_LOCAL first so that it takes precedence
--            if SAGE_LOCAL:
--                search_directories.append(Path(SAGE_LOCAL) / 'bin')
--            search_directories.append(Path(sysconfig.get_config_var('BINDIR')))
--            # Note: The following is not very robust, since if there are multible
--            # versions for the same library this just selects one more or less
--            # at arbitrary. However, practically speaking, on Cygwin, there
--            # will only ever be one version
--            patterns = [f'cyg{libname}.dll', f'cyg{libname}-*.dll']
--        else:
--            if sys.platform == 'darwin':
--                ext = 'dylib'
--            else:
--                ext = 'so'
--
--            if SAGE_LOCAL:
--                search_directories.append(Path(SAGE_LOCAL) / 'lib')
--            libdir = sysconfig.get_config_var('LIBDIR')
--            if libdir is not None:
--                libdir = Path(libdir)
--                search_directories.append(libdir)
--
--                multiarchlib = sysconfig.get_config_var('MULTIARCH')
--                if multiarchlib is not None:
--                    search_directories.append(libdir / multiarchlib),
--
--            patterns = [f'lib{libname}.{ext}']
--
--        for directory in search_directories:
--            for pattern in patterns:
--                path = next(directory.glob(pattern), None)
--                if path is not None:
--                    return str(path.resolve())
--
--    # Just return None if no files were found
--    return None
--
--# locate libgap shared object
--GAP_SO = var("GAP_SO", _get_shared_lib_path("gap", ""))
--
- # post process
- if DOT_SAGE is not None and ' ' in DOT_SAGE:
-     if UNAME[:6] == 'CYGWIN':
-diff --git a/src/sage/groups/abelian_gps/abelian_group_gap.py b/src/sage/groups/abelian_gps/abelian_group_gap.py
-index a4b047113c5..86090b43535 100644
---- a/src/sage/groups/abelian_gps/abelian_group_gap.py
-+++ b/src/sage/groups/abelian_gps/abelian_group_gap.py
-@@ -338,7 +338,7 @@ def _element_constructor_(self, x, check=True):
-         if isinstance(x, AbelianGroupElement_gap):
-             try:
-                 if x in self._cover:
--                    x = self.gap().NaturalHomomorphism().Image(x.gap())
-+                    x = self._cover.gap().NaturalHomomorphismByNormalSubgroup(self._relations).Image(x.gap())
-                 else:
-                     x = x.gap()
-             except AttributeError:
-@@ -1043,7 +1043,7 @@ def natural_homomorphism(self):
-             From: Abelian group with gap, generator orders (4,)
-             To:   Quotient abelian group with generator orders (2,)
-         """
--        phi = self.gap().NaturalHomomorphism()
-+        phi = self._cover.gap().NaturalHomomorphismByNormalSubgroup(self._relations)
-         Hom = self._cover.Hom(self)
-         return Hom(phi)
- 
-diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py
-index 8d6e443683c..1beb01af87f 100644
---- a/src/sage/groups/finitely_presented.py
-+++ b/src/sage/groups/finitely_presented.py
-@@ -596,9 +596,9 @@ def gap(self):
-             sage: k = G.rewriting_system()
-             sage: k.gap()
-             Knuth Bendix Rewriting System for Monoid( [ a, A, b, B ] ) with rules
--            [ [ a^2, <identity ...> ], [ a*A, <identity ...> ],
--              [ A*a, <identity ...> ], [ b^2, <identity ...> ],
--              [ b*B, <identity ...> ], [ B*b, <identity ...> ] ]
-+            [ [ a*A, <identity ...> ], [ A*a, <identity ...> ],
-+              [ b*B, <identity ...> ], [ B*b, <identity ...> ],
-+              [ a^2, <identity ...> ], [ b^2, <identity ...> ] ]
-         """
-         return self._gap
- 
-diff --git a/src/sage/groups/fqf_orthogonal.py b/src/sage/groups/fqf_orthogonal.py
-index 7fc4dbe7548..e5eccd45942 100644
---- a/src/sage/groups/fqf_orthogonal.py
-+++ b/src/sage/groups/fqf_orthogonal.py
-@@ -143,7 +143,7 @@ class FqfOrthogonalGroup(AbelianGroupAutomorphismGroup_subgroup):
-         [2/3   0   0]
-         [  0 2/3   0]
-         [  0   0 4/3]
--        generated by 2 elements
-+        generated by 3 elements
-         sage: q = matrix.diagonal(QQ, [3/2, 1/4, 1/4])
-         sage: T = TorsionQuadraticForm(q)
-         sage: T.orthogonal_group().order()
-diff --git a/src/sage/groups/libgap_wrapper.pyx b/src/sage/groups/libgap_wrapper.pyx
-index d25121aa792..dc81b71635b 100644
---- a/src/sage/groups/libgap_wrapper.pyx
-+++ b/src/sage/groups/libgap_wrapper.pyx
-@@ -25,7 +25,7 @@ Note how we call the constructor of both superclasses to initialize
- its output via LibGAP::
- 
-     sage: FooGroup()
--    <pc group of size 3 with 1 generators>
-+    <pc group of size 3 with 1 generator>
-     sage: type(FooGroup().gap())
-     <class 'sage.libs.gap.element.GapElement'>
- 
-@@ -106,7 +106,7 @@ class ParentLibGAP(SageObject):
-         ....:         ParentLibGAP.__init__(self, lg)
-         ....:         Group.__init__(self)
-         sage: FooGroup()
--        <pc group of size 3 with 1 generators>
-+        <pc group of size 3 with 1 generator>
-     """
- 
-     def __init__(self, libgap_parent, ambient=None):
-@@ -461,7 +461,7 @@ cdef class ElementLibGAP(MultiplicativeGroupElement):
-         ....:         ParentLibGAP.__init__(self, lg)
-         ....:         Group.__init__(self)
-         sage: FooGroup()
--        <pc group of size 3 with 1 generators>
-+        <pc group of size 3 with 1 generator>
-         sage: FooGroup().gens()
-         (f1,)
-     """
-diff --git a/src/sage/groups/matrix_gps/finitely_generated.py b/src/sage/groups/matrix_gps/finitely_generated.py
-index a6d3dc02513..63956ad5f10 100644
---- a/src/sage/groups/matrix_gps/finitely_generated.py
-+++ b/src/sage/groups/matrix_gps/finitely_generated.py
-@@ -563,9 +563,6 @@ def as_permutation_group(self, algorithm=None, seed=None):
-             21499084800
-             sage: P = G.as_permutation_group()
-             sage: Psmaller = G.as_permutation_group(algorithm="smaller", seed=6)
--            sage: P == Psmaller  # see the note below
--            True
--            sage: Psmaller = G.as_permutation_group(algorithm="smaller")
-             sage: P == Psmaller
-             False
-             sage: P.cardinality()
-diff --git a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-index f2ccca042ac..47d6862333c 100644
---- a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-+++ b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-@@ -427,7 +427,7 @@ cdef class LabelledBranching:
-             sage: from sage.groups.perm_gps.partn_ref2.refinement_generic import LabelledBranching
-             sage: L = LabelledBranching(3)
-             sage: L.small_generating_set()
--            []
-+            [()]
-             sage: L.add_gen(libgap.eval('(1,2,3)'))
-             sage: L.small_generating_set()
-             [(1,2,3)]
-diff --git a/src/sage/groups/perm_gps/permgroup.py b/src/sage/groups/perm_gps/permgroup.py
-index ebdf7c4c6eb..fb14008c8e0 100644
---- a/src/sage/groups/perm_gps/permgroup.py
-+++ b/src/sage/groups/perm_gps/permgroup.py
-@@ -926,7 +926,7 @@ def _coerce_map_from_(self, G):
-            sage: f = PG._coerce_map_from_(MG)
-            sage: mg = MG.an_element()
-            sage: p = f(mg); p
--           (2,33,32,23,31,55)(3,49,38,44,40,28)(4,17,59,62,58,46)(5,21,47,20,43,8)(6,53,50)(7,37,12,57,14,29)(9,41,56,34,64,10)(11,25,19)(13,61,26,51,22,15)(16,45,36)(18,27,35,48,52,54)(24,63,42)(30,39,60)
-+           (1,2,6,19,35,33)(3,9,26,14,31,23)(4,13,5)(7,22,17)(8,24,12)(10,16,32,27,20,28)(11,30,18)(15,25,36,34,29,21)
-            sage: PG(p._gap_()) == p
-            True
- 
-@@ -972,12 +972,12 @@ def _coerce_map_from_(self, G):
-             sage: P = G.as_permutation_group(algorithm='smaller', seed=5)
-             sage: P1 = G.as_permutation_group()
-             sage: P == P1
--            False
-+            True
-             sage: g1, g2, g3 = G.gens()
-             sage: P(g1*g2)
--            (1,3,7,12)(2,4,8,10)(5,11)(6,9)
-+            (1,4,13,11)(2,5,14,18)(3,15,8,16)(6,7)(9,20,19,12)(10,17)
-             sage: P1(g1*g2)
--            (2,29,25,68)(3,57,13,54)(4,11,72,37)(5,39,60,23)(6,64,75,63)(7,21,50,73)(8,46,38,32)(9,74,35,18)(10,44,49,48)(12,16,34,71)(14,79,27,40)(15,26)(17,62,59,76)(19,78,70,65)(20,22,58,51)(24,33,36,43)(28,81,80,52)(30,53,56,69)(31,61)(41,42,67,55)(45,77)(47,66)
-+            (1,4,13,11)(2,5,14,18)(3,15,8,16)(6,7)(9,20,19,12)(10,17)
- 
-         Another check for :trac:`5583`::
- 
-@@ -1302,7 +1302,7 @@ def gens_small(self):
-             sage: G.gens_small() # random
-             [('b','c'), ('a','c','b')] ## (on 64-bit Linux)
-             [('a','b'), ('a','c','b')] ## (on Solaris)
--            sage: len(G.gens_small()) == 2
-+            sage: len(G.gens_small()) == 2 # random
-             True
-         """
-         gens = self._libgap_().SmallGeneratingSet()
-@@ -4370,17 +4370,23 @@ def is_transitive(self, domain=None):
- 
-         ::
- 
--            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)]]) #S_5 on [1..5]
--            sage: G.is_transitive([1,4,5])
-+            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)],[(6,7)]])
-+            sage: G.is_transitive([1,2,3,4,5])
-             True
--            sage: G.is_transitive([2..6])
-+            sage: G.is_transitive([1..7])
-             False
-             sage: G.is_transitive(G.non_fixed_points())
--            True
-+            False
-             sage: H = PermutationGroup([[(1,2,3)],[(4,5,6)]])
-             sage: H.is_transitive(H.non_fixed_points())
-             False
- 
-+        If `G` does not act on the domain, it always returns ``False``::
-+
-+            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)]]) #S_5 on [1..5]
-+            sage: G.is_transitive([1,4,5])
-+            False
-+
-         Note that this differs from the definition in GAP, where
-         ``IsTransitive`` returns whether the group is transitive on the
-         set of points moved by the group.
-@@ -4436,12 +4442,16 @@ def is_primitive(self, domain=None):
-             sage: G = PermutationGroup([[(1,2,3,4)],[(2,4)]])
-             sage: G.is_primitive([1..4])
-             False
--            sage: G.is_primitive([1,2,3])
--            True
-             sage: G = PermutationGroup([[(3,4,5,6)],[(3,4)]]) #S_4 on [3..6]
-             sage: G.is_primitive(G.non_fixed_points())
-             True
- 
-+        If `G` does not act on the domain, it always returns ``False``::
-+
-+            sage: G = PermutationGroup([[(1,2,3,4)],[(2,4)]])
-+            sage: G.is_primitive([1,2,3])
-+            False
-+
-         """
-         #If the domain is not a subset of self.domain(), then the
-         #action isn't primitive.
-diff --git a/src/sage/interfaces/gap.py b/src/sage/interfaces/gap.py
-index 7ae1792e9de..ecaa9fd2341 100644
---- a/src/sage/interfaces/gap.py
-+++ b/src/sage/interfaces/gap.py
-@@ -1512,6 +1512,8 @@ def gap_reset_workspace(max_workspace_size=None, verbose=False):
-     """
-     # Create new workspace with filename WORKSPACE
-     g = Gap(use_workspace_cache=False, max_workspace_size=None)
-+    g.eval('ColorPrompt(false)')
-+    g.eval('SetUserPreference("UseColorPrompt", false)')
-     g.eval('SetUserPreference("HistoryMaxLines", 30)')
-     from sage.tests.gap_packages import all_installed_packages
-     for pkg in all_installed_packages(gap=g):
-diff --git a/src/sage/interfaces/gap_workspace.py b/src/sage/interfaces/gap_workspace.py
-index 33a87dd5076..03b40be6856 100644
---- a/src/sage/interfaces/gap_workspace.py
-+++ b/src/sage/interfaces/gap_workspace.py
-@@ -16,7 +16,8 @@
- import os
- import time
- import hashlib
--from sage.env import DOT_SAGE, GAP_SO
-+import subprocess
-+from sage.env import DOT_SAGE, HOSTNAME, GAP_LIB_DIR, GAP_SHARE_DIR
- 
- 
- def gap_workspace_file(system="gap", name="workspace", dir=None):
-@@ -59,11 +60,13 @@ def gap_workspace_file(system="gap", name="workspace", dir=None):
-     if dir is None:
-         dir = os.path.join(DOT_SAGE, 'gap')
- 
--    if GAP_SO:
--        h = hashlib.sha1(GAP_SO.encode('utf-8')).hexdigest()
--    else:
--        h = 'unknown'
--    return os.path.join(dir, '%s-%s-%s' % (system, name, h))
-+    data = f'{GAP_LIB_DIR}:{GAP_SHARE_DIR}'
-+    for path in GAP_LIB_DIR, GAP_SHARE_DIR:
-+        sysinfo = os.path.join(path, "sysinfo.gap")
-+        if os.path.exists(sysinfo):
-+            data += subprocess.getoutput(f'. "{sysinfo}" && echo ":$GAP_VERSION:$GAParch"')
-+    h = hashlib.sha1(data.encode('utf-8')).hexdigest()
-+    return os.path.join(dir, f'{system}-{name}-{HOSTNAME}-{h}')
- 
- 
- def prepare_workspace_dir(dir=None):
-diff --git a/src/sage/libs/gap/element.pyx b/src/sage/libs/gap/element.pyx
-index c555ea0333c..e3db3934baf 100644
---- a/src/sage/libs/gap/element.pyx
-+++ b/src/sage/libs/gap/element.pyx
-@@ -130,6 +130,7 @@ cdef char *capture_stdout(Obj func, Obj obj):
-     """
-     cdef Obj s, stream, output_text_string
-     cdef UInt res
-+    cdef TypOutputFile output
-     # The only way to get a string representation of an object that is truly
-     # consistent with how it would be represented at the GAP REPL is to call
-     # ViewObj on it.  Unfortunately, ViewObj *prints* to the output stream,
-@@ -145,12 +146,12 @@ cdef char *capture_stdout(Obj func, Obj obj):
-         output_text_string = GAP_ValueGlobalVariable("OutputTextString")
-         stream = CALL_2ARGS(output_text_string, s, GAP_True)
- 
--        if not OpenOutputStream(stream):
-+        if not OpenOutputStream(&output, stream):
-             raise GAPError("failed to open output capture stream for "
-                            "representing GAP object")
- 
-         CALL_1ARGS(func, obj)
--        CloseOutput()
-+        CloseOutput(&output)
-         return CSTR_STRING(s)
-     finally:
-         GAP_Leave()
-diff --git a/src/sage/libs/gap/gap_includes.pxd b/src/sage/libs/gap/gap_includes.pxd
-index 6d22e32540b..6111d18a5c7 100644
---- a/src/sage/libs/gap/gap_includes.pxd
-+++ b/src/sage/libs/gap/gap_includes.pxd
-@@ -76,8 +76,10 @@ cdef extern from "gap/intobj.h" nogil:
- 
- 
- cdef extern from "gap/io.h" nogil:
--    UInt OpenOutputStream(Obj stream)
--    UInt CloseOutput()
-+    ctypedef struct TypOutputFile:
-+        pass
-+    UInt OpenOutputStream(TypOutputFile* output, Obj stream)
-+    UInt CloseOutput(TypOutputFile* output)
- 
- 
- cdef extern from "gap/libgap-api.h" nogil:
-diff --git a/src/sage/libs/gap/libgap.pyx b/src/sage/libs/gap/libgap.pyx
-index b1a64e57939..6a36613aa8c 100644
---- a/src/sage/libs/gap/libgap.pyx
-+++ b/src/sage/libs/gap/libgap.pyx
-@@ -695,7 +695,7 @@ class Gap(Parent):
-             sage: libgap.List
-             <Gap function "List">
-             sage: libgap.GlobalRandomSource
--            <RandomSource in IsGlobalRandomSource>
-+            <RandomSource in IsGAPRandomSource>
-         """
-         if name in dir(self.__class__):
-             return getattr(self.__class__, name)
-diff --git a/src/sage/libs/gap/saved_workspace.py b/src/sage/libs/gap/saved_workspace.py
-index ad5adec36d0..7636707f557 100644
---- a/src/sage/libs/gap/saved_workspace.py
-+++ b/src/sage/libs/gap/saved_workspace.py
-@@ -8,7 +8,7 @@
- 
- import os
- import glob
--from sage.env import GAP_ROOT_DIR
-+from sage.env import GAP_LIB_DIR
- from sage.interfaces.gap_workspace import gap_workspace_file
- 
- 
-@@ -31,7 +31,7 @@ def timestamp():
-     """
-     libgap_dir = os.path.dirname(__file__)
-     libgap_files = glob.glob(os.path.join(libgap_dir, '*'))
--    gap_packages = glob.glob(os.path.join(GAP_ROOT_DIR, 'pkg', '*'))
-+    gap_packages = glob.glob(os.path.join(GAP_LIB_DIR, 'pkg', '*'))
-     files = libgap_files + gap_packages
-     if len(files) == 0:
-         print('Unable to find LibGAP files.')
-diff --git a/src/sage/libs/gap/util.pyx b/src/sage/libs/gap/util.pyx
-index 344ab88c42a..eaa659d64c7 100644
---- a/src/sage/libs/gap/util.pyx
-+++ b/src/sage/libs/gap/util.pyx
-@@ -13,7 +13,7 @@ Utility functions for GAP
- #*****************************************************************************
- 
- from libc.signal cimport signal, SIGCHLD, SIG_DFL
--from posix.dlfcn cimport dlopen, dlclose, RTLD_NOW, RTLD_GLOBAL
-+from posix.dlfcn cimport dlopen, dlclose, dlerror, RTLD_LAZY, RTLD_GLOBAL
- 
- from cpython.exc cimport PyErr_Fetch, PyErr_Restore
- from cpython.object cimport Py_LT, Py_LE, Py_EQ, Py_NE, Py_GT, Py_GE
-@@ -164,33 +164,6 @@ cdef void gasman_callback() with gil:
- ### Initialization of GAP ##################################################
- ############################################################################
- 
--def gap_root():
--    """
--    Find the location of the GAP root install which is stored in the gap
--    startup script.
--
--    EXAMPLES::
--
--        sage: from sage.libs.gap.util import gap_root
--        sage: gap_root()   # random output
--        '/home/vbraun/opt/sage-5.3.rc0/local/gap/latest'
--    """
--    if os.path.exists(sage.env.GAP_ROOT_DIR):
--        return sage.env.GAP_ROOT_DIR
--
--    # Attempt to figure out the appropriate GAP_ROOT by reading the
--    # local/bin/gap shell script; this is an ugly hack that exists for
--    # historical reasons; the best approach to setting where Sage looks for
--    # the appropriate GAP_ROOT is to set the GAP_ROOT_DIR variable
--    SAGE_LOCAL = sage.env.SAGE_LOCAL
--    with open(os.path.join(SAGE_LOCAL, 'bin', 'gap')) as f:
--        gap_sh = f.read().splitlines()
--    gapdir = next(x for x in gap_sh if x.strip().startswith('GAP_ROOT'))
--    gapdir = gapdir.split('"')[1]
--    gapdir = gapdir.replace('$SAGE_LOCAL', SAGE_LOCAL)
--    return gapdir
--
--
- # To ensure that we call initialize_libgap only once.
- cdef bint _gap_is_initialized = False
- 
-@@ -232,12 +205,12 @@ cdef initialize():
-     # this isn't portable
- 
-     cdef void* handle
--    libgapname = str_to_bytes(sage.env.GAP_SO)
--    handle = dlopen(libgapname, RTLD_NOW | RTLD_GLOBAL)
-+    # reload the current module to force reload of libgap (see #33446)
-+    lib = str_to_bytes(__loader__.path, FS_ENCODING, "surrogateescape")
-+    handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY)
-     if handle is NULL:
--        raise RuntimeError(
--                "Could not dlopen() libgap even though it should already "
--                "be loaded!")
-+        err = dlerror()
-+        raise RuntimeError(f"Could not reload gap library with RTLD_GLOBAL ({err})")
-     dlclose(handle)
- 
-     # Define argv variable, which we will pass in to
-@@ -245,7 +218,7 @@ cdef initialize():
-     cdef char* argv[16]
-     argv[0] = "sage"
-     argv[1] = "-l"
--    s = str_to_bytes(gap_root(), FS_ENCODING, "surrogateescape")
-+    s = str_to_bytes(sage.env.GAP_LIB_DIR + ";" + sage.env.GAP_SHARE_DIR, FS_ENCODING, "surrogateescape")
-     argv[2] = s
- 
-     argv[3] = "-m"
-@@ -362,15 +335,9 @@ cdef Obj gap_eval(str gap_string) except? NULL:
-         GAPError: Error, Variable: 'Complex' must have a value
-         Syntax error: ; expected in stream:1
-         Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^
-+                ^^^^^
-         Error, Variable: 'with' must have a value
--        Syntax error: ; expected in stream:1
--        Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^^^^^^^^^
-         Error, Variable: 'bits' must have a value
--        Syntax error: ; expected in stream:1
--        Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-         Error, Variable: 'precision' must have a value
- 
-     Test that on a subsequent attempt we get the same message (no garbage was
-diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx
-index d8ea7b07f3c..4beb1774df9 100644
---- a/src/sage/libs/singular/singular.pyx
-+++ b/src/sage/libs/singular/singular.pyx
-@@ -1705,14 +1705,7 @@ cdef object si2sa_intvec(intvec *v):
- cdef extern from *: # hack to get at cython macro
-     int unlikely(int)
- 
--cdef extern from "dlfcn.h":
--    void *dlopen(char *, long)
--    char *dlerror()
--    void dlclose(void *handle)
--
--cdef extern from "dlfcn.h":
--    cdef long RTLD_LAZY
--    cdef long RTLD_GLOBAL
-+from posix.dlfcn cimport dlopen, dlclose, dlerror, RTLD_LAZY, RTLD_GLOBAL
- 
- cdef int overflow_check(unsigned long e, ring *_ring) except -1:
-     """
-@@ -1762,8 +1755,6 @@ cdef init_libsingular():
- 
-     cdef void *handle = NULL
- 
--    from sage.env import LIBSINGULAR_PATH
--    lib = str_to_bytes(LIBSINGULAR_PATH, FS_ENCODING, "surrogateescape")
- 
-     # This is a workaround for https://github.com/Singular/Singular/issues/1113
-     # and can be removed once that fix makes it into release of Singular that
-@@ -1780,10 +1771,12 @@ cdef init_libsingular():
- 
-     import platform
-     if not platform.system().startswith("CYGWIN"):
-+        # reload the current module to force reload of libSingular (see #33446)
-+        lib = str_to_bytes(__loader__.path, FS_ENCODING, "surrogateescape")
-         handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY)
-         if not handle:
-             err = dlerror()
--            raise ImportError(f"cannot load Singular library from {LIBSINGULAR_PATH} ({err})")
-+            raise RuntimeError(f"Could not reload Singular library with RTLD_GLOBAL ({err})")
- 
-     # load SINGULAR
-     siInit(lib)
-diff --git a/src/sage/tests/gap_packages.py b/src/sage/tests/gap_packages.py
-index 2e4518ca226..c302b169b8a 100644
---- a/src/sage/tests/gap_packages.py
-+++ b/src/sage/tests/gap_packages.py
-@@ -103,7 +103,7 @@ def all_installed_packages(ignore_dot_gap=False, gap=None):
- 
-         sage: from sage.tests.gap_packages import all_installed_packages
-         sage: all_installed_packages()
--        (...'GAPDoc'...)
-+        (...'gapdoc'...)
-         sage: all_installed_packages(ignore_dot_gap=True) == all_installed_packages(gap=gap, ignore_dot_gap=True)
-         True
-     """
diff --git a/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch b/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
deleted file mode 100644
index d331a6573e1c..000000000000
--- a/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/src/sage/data_structures/stream.py b/src/sage/data_structures/stream.py
-index f8f6dc6a186..002e925f02f 100644
---- a/src/sage/data_structures/stream.py
-+++ b/src/sage/data_structures/stream.py
-@@ -2090,8 +2090,8 @@ def compute_product(self, n, la):
-             sage: f = Stream_exact([1]) # irrelevant for this test
-             sage: g = Stream_function(lambda n: s[n], True, 0)
-             sage: h = Stream_plethysm(f, g, True, p)
--            sage: B = p[2, 2, 1](sum(s[i] for i in range(7)))
--            sage: all(h.compute_product(k, Partition([2, 2, 1])) == B.restrict_degree(k) for k in range(7))
-+            sage: B = p[2, 2, 1](sum(p(s[i]) for i in range(7)))  # long time
-+            sage: all(h.compute_product(k, Partition([2, 2, 1])) == B.restrict_degree(k) for k in range(7))  # long time
-             True
-         """
-         # This is the approximate order of the result
diff --git a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch b/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
deleted file mode 100644
index 007f3324cfe4..000000000000
--- a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index b77c69b2f77..0586a96ae55 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -563,7 +563,7 @@ def complex_to_cmap_rgb(z_values, cmap='turbo', contoured=False, tiled=False,
-     import matplotlib as mpl
- 
-     if isinstance(cmap, str):
--        cmap = mpl.cm.get_cmap(cmap)
-+        cmap = mpl.colormaps[cmap]
- 
-     if contour_base is None:
-         if contour_type == "linear":
-@@ -1206,11 +1206,11 @@ def complex_plot(f, x_range, y_range, contoured=False, tiled=False, cmap=None,
-                 domain = np.linspace(0, 1, 256)
-                 shifted_domain = np.roll(domain, 128)
-                 default_cmap = mpl.colors.LinearSegmentedColormap.from_list(
--                    "sage_default", mpl.cm.get_cmap('hsv')(shifted_domain)
-+                    "sage_default", mpl.colormaps['hsv'](shifted_domain)
-                 )
-                 cmap = default_cmap
-             else:
--                cmap = mpl.cm.get_cmap(cmap)
-+                cmap = mpl.colormaps[cmap]
-         rgbs = complex_to_cmap_rgb(
-             z_values, cmap=cmap, contoured=contoured, tiled=tiled,
-             contour_type=contour_type, contour_base=contour_base,
-diff --git a/src/sage/plot/contour_plot.py b/src/sage/plot/contour_plot.py
-index c0cab456686..4accb309580 100644
---- a/src/sage/plot/contour_plot.py
-+++ b/src/sage/plot/contour_plot.py
-@@ -848,9 +848,7 @@ def f(x,y): return cos(x) + sin(y)
- 
-         sage: contour_plot(lambda x,y: 0, (-1,1), (-1,1),
-         ....:              contours=[0], fill=False, cmap=['blue'])
--        ...
--        UserWarning: No contour levels were found within the data range.
--        Graphics object consisting of 1 graphics primitive
-+        ...Graphics object consisting of 1 graphics primitive
- 
-     .. PLOT::
- 
-@@ -874,8 +872,7 @@ def f(x,y): return cos(x) + sin(y)
-     Check that :trac:`18074` is fixed::
- 
-         sage: contour_plot(0, (0,1), (0,1))
--        ... UserWarning: No contour levels were found within the data range.
--        Graphics object consisting of 1 graphics primitive
-+        ...Graphics object consisting of 1 graphics primitive
- 
-     Domain points in :trac:`11648` with complex output are now skipped::
- 
-diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
-index 64ea1a7e10f..cdc99ced263 100644
---- a/src/sage/plot/graphics.py
-+++ b/src/sage/plot/graphics.py
-@@ -2341,7 +2341,7 @@ def _matplotlib_tick_formatter(self, subplot, base=(10, 10),
-             sage: subplot = Figure().add_subplot(111)
-             sage: p._objects[0]._render_on_subplot(subplot)
-             sage: p._matplotlib_tick_formatter(subplot, **d)
--            (<AxesSubplot:...>,
-+            (<Axes...>,
-             <matplotlib.ticker.MaxNLocator object at ...>,
-             <matplotlib.ticker.MaxNLocator object at ...>,
-             <matplotlib.ticker.ScalarFormatter object at ...>,
-diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
-index 99c817f03a6..ae85183dc93 100644
---- a/src/sage/plot/multigraphics.py
-+++ b/src/sage/plot/multigraphics.py
-@@ -1207,7 +1207,7 @@ def _add_subplot(self, figure, index, **options):
-             sage: fig = Figure()
-             sage: ax1 = G._add_subplot(fig, 0)
-             sage: type(ax1)
--            <class 'matplotlib.axes._subplots.AxesSubplot'>
-+            <class 'matplotlib.axes...'>
-             sage: ax2 = G._add_subplot(fig, 1)
-             sage: fig.get_axes() == [ax1, ax2]
-             True
-diff --git a/src/sage/plot/plot3d/plot_field3d.py b/src/sage/plot/plot3d/plot_field3d.py
-index bdf39391d3e..fe10e27f58f 100644
---- a/src/sage/plot/plot3d/plot_field3d.py
-+++ b/src/sage/plot/plot3d/plot_field3d.py
-@@ -126,9 +126,9 @@ def plot_vector_field3d(functions, xrange, yrange, zrange,
-     vectors = [vector((ff(*point), gg(*point), hh(*point))) for point in points]
- 
-     try:
--        from matplotlib.cm import get_cmap
--        cm = get_cmap(colors)
--    except (TypeError, ValueError):
-+        import matplotlib as mpl
-+        cm = mpl.colormaps[colors]
-+    except (TypeError, KeyError):
-         cm = None
-     if cm is None:
-         if isinstance(colors, (list, tuple)):
diff --git a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch b/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
deleted file mode 100644
index 1e0a708e8068..000000000000
--- a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py
-index c9ca5e30939..9459cb70334 100644
---- a/src/sage/interfaces/maxima_lib.py
-+++ b/src/sage/interfaces/maxima_lib.py
-@@ -77,6 +77,26 @@
-     sage: bar == foo
-     True
- 
-+TESTS:
-+
-+Check our workaround for a race in ecl works, see :trac:`26968`.
-+We use a temporary `MAXIMA_USERDIR` so it's empty; we place it
-+in `DOT_SAGE` since we expect it to have more latency than `/tmp`.
-+
-+    sage: import tempfile, subprocess
-+    sage: tmpdir = tempfile.TemporaryDirectory(dir=DOT_SAGE)
-+    sage: _ = subprocess.run(['sage', '-c',  # long time
-+    ....: f'''
-+    ....: import os
-+    ....: os.environ["MAXIMA_USERDIR"] = "{tmpdir.name}"
-+    ....: if not os.fork():
-+    ....:     import sage.interfaces.maxima_lib
-+    ....: else:
-+    ....:     import sage.interfaces.maxima_lib
-+    ....:     os.wait()
-+    ....: '''])
-+    sage: tmpdir.cleanup()
-+
- """
- 
- # ****************************************************************************
-@@ -116,7 +136,23 @@
- ecl_eval("(setq $nolabels t))")
- ecl_eval("(defvar *MAXIMA-LANG-SUBDIR* NIL)")
- ecl_eval("(set-locale-subdir)")
--ecl_eval("(set-pathnames)")
-+
-+try:
-+    ecl_eval("(set-pathnames)")
-+except RuntimeError:
-+    # Recover from :trac:`26968` by creating `*maxima-objdir*` here.
-+    # This cannot be done before calling `(set-pathnames)` since
-+    # `*maxima-objdir*` is computed there.
-+    # We use python `os.makedirs()` which is immune to the race.
-+    # Using `(ensure-directories-exist ...)` in lisp would be
-+    # subject to the same race condition and since `*maxima-objdir*`
-+    # has multiple components this is quite plausible to happen.
-+    maxima_objdir = ecl_eval("*maxima-objdir*").python()[1:-1]
-+    import os
-+    os.makedirs(maxima_objdir, exist_ok=True)
-+    # Call `(set-pathnames)` again to complete its job.
-+    ecl_eval("(set-pathnames)")
-+
- ecl_eval("(defun add-lineinfo (x) x)")
- ecl_eval('(defun principal nil (cond ($noprincipal (diverg)) ((not pcprntd) (merror "Divergent Integral"))))')
- ecl_eval("(remprop 'mfactorial 'grind)")  # don't use ! for factorials (#11539)
diff --git a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch b/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
deleted file mode 100644
index fc3e40da2a88..000000000000
--- a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff --git a/src/bin/sage-cleaner b/src/bin/sage-cleaner
-index e2e578eec60..dc7d8f0482e 100755
---- a/src/bin/sage-cleaner
-+++ b/src/bin/sage-cleaner
-@@ -99,6 +99,15 @@ def cleanup():
- 
-     return len(pid_list)
- 
-+def cleanup_cruft():
-+    """ remove directories leftover from improper shutdown """
-+    tmp_dirs = os.listdir(SAGE_TMP_ROOT)
-+    for dir_entry in tmp_dirs:
-+        baddir = os.path.join(SAGE_TMP_ROOT, dir_entry)
-+        if os.path.isdir(baddir):
-+            logger.warning('Removing old directory %s from SAGE_TMP_ROOT', baddir)
-+            rm_rf(baddir)
-+
- def kill_spawned_jobs(jobfile, parent_pid):
-     logger.info("Killing %s's spawned jobs", parent_pid)
-     killed_them_all = True
-@@ -193,6 +202,7 @@ if __name__ == '__main__':
-     setup_daemon()
-     fix_old_mistakes()
-     logger.info("Starting sage-cleaner with PID %s", os.getpid())
-+    cleanup_cruft()
- 
-     if len(sys.argv) > 1:
-         wait = int(sys.argv[1])
diff --git a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch b/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
deleted file mode 100644
index ea210e20ae52..000000000000
--- a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py
-index ec6a5c19e60..9dd7bc1cb1e 100644
---- a/src/sage/graphs/generators/families.py
-+++ b/src/sage/graphs/generators/families.py
-@@ -3660,7 +3660,7 @@ def nauty_gentreeg(options="", debug=False):
- 
-         sage: gen = graphs.nauty_gentreeg("4", debug=True)
-         sage: print(next(gen))
--        >A ...gentreeg Z=2:3 D=3 n=4
-+        >A ...gentreeg ...
-         sage: gen = graphs.nauty_gentreeg("4 -q", debug=True)
-         sage: next(gen)
-         ''
-@@ -3687,7 +3687,7 @@ def nauty_gentreeg(options="", debug=False):
-         sage: list(graphs.nauty_gentreeg("3 -x", debug=True))
-         ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n [res/mod] ...
-         sage: list(graphs.nauty_gentreeg("3", debug=True))
--        ['>A ...gentreeg Z=2:2 D=2 n=3\n', Graph on 3 vertices]
-+        ['>A ...gentreeg ...\n', Graph on 3 vertices]
-     """
-     import shlex
-     from sage.features.nauty import NautyExecutable
-diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py
-index df88bbe2713..1a8016976c2 100644
---- a/src/sage/graphs/graph_generators.py
-+++ b/src/sage/graphs/graph_generators.py
-@@ -966,7 +966,7 @@ def nauty_geng(self, options="", debug=False):
-             ...
-             ValueError: wrong format of parameter option
-             sage: list(graphs.nauty_geng("-c3", debug=True))
--            ['>E Usage: ...geng [-cCmtfbd#D#] [-uygsnh] [-lvq] ...
-+            ['>E Usage: ...geng ...\n']
-             sage: list(graphs.nauty_geng("-c 3", debug=True))
-             ['>A ...geng -cd1D2 n=3 e=2-3\n', Graph on 3 vertices, Graph on 3 vertices]
-         """
diff --git a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch b/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
deleted file mode 100644
index 46bda084e48e..000000000000
--- a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-diff --git a/src/sage/repl/inputhook.py b/src/sage/repl/inputhook.py
-index da5df0268c0..7f7894f6dcf 100644
---- a/src/sage/repl/inputhook.py
-+++ b/src/sage/repl/inputhook.py
-@@ -17,6 +17,8 @@
- 
- import select
- import errno
-+import contextlib
-+import io
- 
- from IPython import get_ipython
- from IPython.terminal.pt_inputhooks import register
-@@ -47,15 +49,27 @@ def install():
-     """
-     Install the Sage input hook
- 
--    EXAMPLES::
-+    EXAMPLES:
-+
-+    Make sure ipython is running so we really test this function::
-+
-+        sage: from sage.repl.interpreter import get_test_shell
-+        sage: get_test_shell()
-+        <sage.repl.interpreter.SageTestShell object at ...>
-+
-+    Run the function twice, to check it is idempotent (see :trac:`35235`)::
- 
-         sage: from sage.repl.inputhook import install
-         sage: install()
-+        sage: install()
-     """
-     ip = get_ipython()
-     if not ip:
-         return   # Not running in ipython, e.g. doctests
--    ip.enable_gui('sage')
-+    if ip._inputhook != sage_inputhook:
-+        # silence `ip.enable_gui()` useless output
-+        with contextlib.redirect_stdout(io.StringIO()):
-+            ip.enable_gui('sage')
- 
- 
- def uninstall():
-@@ -71,4 +85,6 @@ def uninstall():
-     if not ip:
-         return
-     if ip._inputhook == sage_inputhook:
--        ip.enable_gui(None)
-+        # silence `ip.enable_gui()` useless output
-+        with contextlib.redirect_stdout(io.StringIO()):
-+            ip.enable_gui(None)
diff --git a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch b/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
deleted file mode 100644
index 2cdc674d4f9e..000000000000
--- a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 532fbbaf71bb41c73920b584108eb2a09d6deeb1 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
-Date: Tue, 4 Apr 2023 12:56:57 -0300
-Subject: [PATCH] Ignore deprecation warnings triggered by pythran 0.12.1
-
-These happen with python 3.11, setuptools 67.6.1, numpy 1.24.2.
-When pythran 0.12.1 is installed, I get 24 doctest failures due to
-deprecation warnings; they are all gone with this commit.
-
-[backported from 839a6e928c264a9863bd42860c78ae95a6d9f3e0]
----
- src/sage/all.py | 12 ++++++++++--
- 1 file changed, 10 insertions(+), 2 deletions(-)
-
-diff --git a/src/sage/all.py b/src/sage/all.py
-index 93588df1b93..ee775aad0e9 100644
---- a/src/sage/all.py
-+++ b/src/sage/all.py
-@@ -96,9 +96,17 @@ warnings.filterwarnings('ignore', category=DeprecationWarning,
- warnings.filterwarnings('ignore', category=DeprecationWarning,
-     module='(.*[.]_vendor[.])?packaging')
- 
--# Ignore numpy warnings triggered by pythran
-+# Ignore a few warnings triggered by pythran 0.12.1
- warnings.filterwarnings('ignore', category=DeprecationWarning,
--                        module='pythran')
-+    message='\n\n  `numpy.distutils` is deprecated since NumPy 1.23.0',
-+    module='pythran.dist')
-+warnings.filterwarnings('ignore', category=DeprecationWarning,
-+    message='pkg_resources is deprecated as an API|'
-+            'Deprecated call to `pkg_resources.declare_namespace(.*)`',
-+    module='pkg_resources')
-+warnings.filterwarnings('ignore', category=DeprecationWarning,
-+    message='msvccompiler is deprecated and slated to be removed',
-+    module='distutils.msvccompiler')
- 
- warnings.filterwarnings('ignore', category=DeprecationWarning,
-                         message='The distutils(.sysconfig module| package) is deprecated',
--- 
-2.40.0
-
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index db36086fc9f9..73e9607aa1fb 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 URL_BASE_PR="https://github.com/sagemath/sage/pull/"
-URL_BASE_COMPARE="https://github.com/sagemath/sage/compare/9.8..."
+URL_BASE_COMPARE="https://github.com/sagemath/sage/compare/10.0.rc0..."
 
 case "$1" in
 	-n)  DO=echo ;;
@@ -15,50 +15,9 @@ get_pr() {
 	$DO wget "$URL_BASE_PR$pr.$ext" -O "$pr-$desc.patch"
 }
 
-get_trac() {
-	ticket=$1
-	desc=$(echo "$2" | sed -e 's/ /_/g')
-	commit=$3
-	$DO wget "$URL_BASE_COMPARE$commit.diff" -O "$ticket-$desc-$commit.patch"
-}
-
 # run from patches dir
 cd $(dirname "$0")
 
-# merged in 10.0.beta0
-get_trac 34851 "support singular 4.3.1.p3" 5e5737a0c
-get_pr 35068 "fix tests giac 1.9.0.35" patch
-
-# merged in 10.0.beta1
-get_pr 35058 "skip unstable tests klyachko"
-
-# merged in 10.0.beta2
-get_pr 34994 "fix tests numpy 1.24"
-get_pr 34997 "fix edge case of integer_check"
-
-# merged in 10.0.beta3
-get_pr 34995 "support tachyon 0.99.2"
-
-# merged in 10.0.beta4
-get_pr 34980 "avoid factoring in is_prime"
-
-# merged in 10.0.beta5
-get_pr 35094 "support gap 4.12"					# includes PR 35093
-
-# merged in 10.0.beta6
-get_pr 35127 "fix very slow test stream.py"
-get_pr 35177 "matplotlib 3.7"
-get_pr 35195 "workaround ecl race"
-get_pr 35204 "fix sage-cleaner"
-
-# merged in 10.0.beta7
-get_pr 35250 "nauty 2.8.6"
-
-# merged in 10.0.beta8
-#get_pr 35337 "ipython 8.11"
-get_pr 35423 "ipython 8.12"						# includes PR 35337
-get_pr 35438 "pythran 0.12.1"
-
 # needs review
 get_pr 35584 "networkx 3.1"
 get_pr 35612 "linbox 1.7"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 6e794c931df4..a74fb49aa9b5 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=9.8
-revision=3
+version=10.0.rc1
+revision=1
 build_wrksrc=pkgs/sagemath-standard
 build_style=python3-module
 _bindir=/usr/lib/sagemath/$version/bin
@@ -32,7 +32,7 @@ maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-or-later"
 homepage="http://sagemath.org/"
 distfiles="https://github.com/sagemath/sage/archive/refs/tags/$version.tar.gz"
-checksum=2aff28bd1d18c2d526581f5298acb8336f5b92db5675a7403dec8eaf9a86bc4c
+checksum=3289d56637e3ce7f90571e136b0b243bf59920d6ae1cfc1cd6ea4e2391f39779
 
 do_configure() {
 	# git tree needs bootstrapping

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [RFC] sagemath: update to 10.0.rc1.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (8 preceding siblings ...)
  2023-05-05 19:16 ` [PR PATCH] [Updated] " tornaria
@ 2023-05-06  1:16 ` tornaria
  2023-05-06 14:06 ` dkwo
                   ` (29 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: tornaria @ 2023-05-06  1:16 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 848 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43659#issuecomment-1536958965

Comment:
Now CI failure on x86_64-musl, when checking linbox:
```
...
FAIL: test-solve
...
============================================================================
Testsuite summary for LinBox 1.7.0
============================================================================
# TOTAL: 40
# PASS:  39
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0
============================================================================
See tests/test-suite.log
Please report to linbox-use@googlegroups.com
============================================================================
```
I've run check linbox many times and I haven't been lucky (unlucky?) to trigger any failure locally :shrug:

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [RFC] sagemath: update to 10.0.rc1.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (9 preceding siblings ...)
  2023-05-06  1:16 ` tornaria
@ 2023-05-06 14:06 ` dkwo
  2023-05-06 14:45 ` tornaria
                   ` (28 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: dkwo @ 2023-05-06 14:06 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 251 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43659#issuecomment-1537149720

Comment:
Maybe these ci failures are not too serious? I will test locally built pr on x86_64-musl and aarch64-glibc soon.

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [RFC] sagemath: update to 10.0.rc1.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (10 preceding siblings ...)
  2023-05-06 14:06 ` dkwo
@ 2023-05-06 14:45 ` tornaria
  2023-05-09 13:11 ` dkwo
                   ` (27 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: tornaria @ 2023-05-06 14:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 534 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43659#issuecomment-1537157058

Comment:
> Maybe these ci failures are not too serious? I will test locally built pr on x86_64-musl and aarch64-glibc soon.

They could be random failures that depend on the seed -- unfortunately linbox check doesn't print the seed used for each test.

Or else, this could be some weird race condition type of heisenbug which triggers under heavy load (i.e. github actions) but not in my box.



^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [RFC] sagemath: update to 10.0.rc1.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (11 preceding siblings ...)
  2023-05-06 14:45 ` tornaria
@ 2023-05-09 13:11 ` dkwo
  2023-05-10 12:48 ` [PR PATCH] [Updated] " tornaria
                   ` (26 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: dkwo @ 2023-05-09 13:11 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 349 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43659#issuecomment-1540098837

Comment:
On aarch64-glibc, this looks quite good: only a couple of timed outs with test=yes
```
parallel/map_reduce.py
sets/recursively_enumerated_sets.pyx
```
I can test more completely from within installed sage.

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] sagemath: update to 10.0.rc1.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (12 preceding siblings ...)
  2023-05-09 13:11 ` dkwo
@ 2023-05-10 12:48 ` tornaria
  2023-05-10 12:55 ` tornaria
                   ` (25 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: tornaria @ 2023-05-10 12:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1700 bytes --]

There is an updated pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages sagemath-next
https://github.com/void-linux/void-packages/pull/43659

[RFC] sagemath: update to 10.0.rc1.
<!-- Uncomment relevant sections and delete options which are not applicable -->

This builds on top of #43225 for convenience.

#### Testing the changes
- I tested the changes in this PR: **briefly**

I've been following beta releases and now rc0 includes all of our patches :muscle:

All doctests pass with the version of packages in void except for `python-Babel` which must be updated (as in #43497) and is included  here as part of #43225.

I've switched my system sagemath to this version as everything seems to be working ok. The testsuite is 10-15% faster.

@dkwo: enjoy.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/43659.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-sagemath-next-43659.patch --]
[-- Type: text/x-diff, Size: 181237 bytes --]

From 52ea70b5c6a0cf5f17d07a54b93e8ca2ef35b74f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Dec 2021 20:20:09 -0300
Subject: [PATCH 1/6] givaro: update to 4.2.0.

---
 srcpkgs/givaro/patches/197.patch | 28 ++++++++++++++++++++++++++++
 srcpkgs/givaro/template          |  9 ++++-----
 2 files changed, 32 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/givaro/patches/197.patch

diff --git a/srcpkgs/givaro/patches/197.patch b/srcpkgs/givaro/patches/197.patch
new file mode 100644
index 000000000000..bafaff3efbd9
--- /dev/null
+++ b/srcpkgs/givaro/patches/197.patch
@@ -0,0 +1,28 @@
+From ab3d332508c21daff41fb64a8658cdc7cc74fc47 Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
+Date: Thu, 16 Dec 2021 17:12:25 +0100
+Subject: [PATCH] dom_power argument is now an uint64_t to avoid problem with
+ 32bit machine
+
+---
+ src/kernel/system/givpower.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/kernel/system/givpower.h b/src/kernel/system/givpower.h
+index eb784872..5644264d 100644
+--- a/src/kernel/system/givpower.h
++++ b/src/kernel/system/givpower.h
+@@ -71,11 +71,11 @@ namespace Givaro {
+ 
+     //! dom_power
+     template<class D, class TT>
+-    TT& dom_power(TT& res, const TT& n, long l, const D& F)
++    TT& dom_power(TT& res, const TT& n, uint64_t l, const D& F)
+     {
+         if (l == 0) return F.assign(res,F.one) ;
+ 
+-        unsigned long p = (unsigned long) l ;
++        uint64_t p = l;
+         bool is_assg = false ;
+ 
+         TT puiss; F.init(puiss); F.assign(puiss,n) ;
diff --git a/srcpkgs/givaro/template b/srcpkgs/givaro/template
index 9c16de5b1974..52457c02a1ed 100644
--- a/srcpkgs/givaro/template
+++ b/srcpkgs/givaro/template
@@ -1,6 +1,6 @@
 # Template file for 'givaro'
 pkgname=givaro
-version=4.1.1
+version=4.2.0
 revision=1
 build_style=gnu-configure
 makedepends="gmpxx-devel"
@@ -8,16 +8,15 @@ short_desc="C++ library for arithmetic and algebraic computations"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="CECILL-B"
 homepage="https://github.com/linbox-team/givaro"
+changelog="https://github.com/linbox-team/givaro/raw/master/ChangeLog"
 distfiles="https://github.com/linbox-team/givaro/releases/download/v${version}/givaro-${version}.tar.gz"
-checksum=628049899386e91da245aee6cd446350fbca87e94863bc0d815066c08150487f
+checksum=865e228812feca971dfb6e776a7bc7ac959cf63ebd52b4f05492730a46e1f189
 nocross=yes
 
 build_options="native_build"
 
 if [ -z "$build_option_native_build" ]; then
-	configure_args="--enable-sse --enable-sse2
-	  --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42
-	  --disable-avx --disable-avx2 --disable-fma --disable-fma4"
+	configure_args="--without-archnative"
 fi
 
 post_install() {

From df0c1283e300468b1f20f6c618df6b0e3b6b01f8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Dec 2021 20:20:17 -0300
Subject: [PATCH 2/6] fflas-ffpack: update to 2.5.0.

---
 srcpkgs/fflas-ffpack/patches/357.patch | 35 ++++++++++++++++++++++++++
 srcpkgs/fflas-ffpack/template          | 12 ++++-----
 2 files changed, 40 insertions(+), 7 deletions(-)
 create mode 100644 srcpkgs/fflas-ffpack/patches/357.patch

diff --git a/srcpkgs/fflas-ffpack/patches/357.patch b/srcpkgs/fflas-ffpack/patches/357.patch
new file mode 100644
index 000000000000..99fd34efd93b
--- /dev/null
+++ b/srcpkgs/fflas-ffpack/patches/357.patch
@@ -0,0 +1,35 @@
+From 9b6083c663096e9ca85775b79f1f27c848dbeb98 Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
+Date: Fri, 17 Dec 2021 10:27:02 +0100
+Subject: [PATCH] Fix SimdChooser: on not x86_64 machines its value could be an
+ nonexistant struct
+
+---
+ fflas-ffpack/fflas/fflas_simd.h | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/fflas-ffpack/fflas/fflas_simd.h b/fflas-ffpack/fflas/fflas_simd.h
+index bf5d30211..84ced0fd8 100644
+--- a/fflas-ffpack/fflas/fflas_simd.h
++++ b/fflas-ffpack/fflas/fflas_simd.h
+@@ -384,6 +384,20 @@ struct SimdChooser<T, true, true> // integral number
+ #endif
+ };
+ 
++#ifndef __x86_64__
++template <>
++struct SimdChooser<uint64_t, true, true>
++{
++    using value = NoSimd<uint64_t>;
++};
++
++template <>
++struct SimdChooser<int64_t, true, true>
++{
++    using value = NoSimd<int64_t>;
++};
++#endif
++
+ template <class T> using Simd = typename SimdChooser<T>::value;
+ 
+ // template <class T> struct SimdChooser<T, true> {
diff --git a/srcpkgs/fflas-ffpack/template b/srcpkgs/fflas-ffpack/template
index 557c644c00a4..2aa599703585 100644
--- a/srcpkgs/fflas-ffpack/template
+++ b/srcpkgs/fflas-ffpack/template
@@ -1,6 +1,6 @@
 # Template file for 'fflas-ffpack'
 pkgname=fflas-ffpack
-version=2.4.3
+version=2.5.0
 revision=1
 build_style=gnu-configure
 hostmakedepends="pkg-config"
@@ -10,15 +10,13 @@ short_desc="Finite Field Linear Algebra Subroutines / Package"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="LGPL-2.1-or-later"
 homepage="http://linbox-team.github.io/fflas-ffpack/"
-distfiles="https://github.com/linbox-team/fflas-ffpack/releases/download/${version}/fflas-ffpack-${version}.tar.gz"
-checksum=f372783a17a9899ee9f88d4c9421d80facccb95556146dad7020d07a03791cc9
+changelog="https://github.com/linbox-team/fflas-ffpack/raw/master/ChangeLog"
+distfiles="https://github.com/linbox-team/fflas-ffpack/releases/download/v${version}/fflas-ffpack-${version}.tar.gz"
+checksum=dafb4c0835824d28e4f823748579be6e4c8889c9570c6ce9cce1e186c3ebbb23
 nocross=yes
 
 build_options="native_build"
 
 if [ -z "$build_option_native_build" ]; then
-	configure_args="--enable-sse --enable-sse2
-	  --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42
-	  --disable-avx --disable-avx2 --disable-fma --disable-fma4
-	  --disable-avx512f --disable-avx512dq --disable-avx512vl"
+	configure_args="--without-archnative"
 fi

From 6e601fa4b600132d9b1ac8461332d1e713b833b8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Dec 2021 20:20:20 -0300
Subject: [PATCH 3/6] linbox: update to 1.7.0.

---
 srcpkgs/linbox/patches/292.patch              | 24 ++++++++++++
 srcpkgs/linbox/patches/294.patch              | 38 +++++++++++++++++++
 ...8adade10641f1f04f04b589753d928fb5443.patch | 35 -----------------
 .../remove-linboxsage-libs-from-pc.patch      | 23 -----------
 srcpkgs/linbox/template                       | 11 +++---
 5 files changed, 67 insertions(+), 64 deletions(-)
 create mode 100644 srcpkgs/linbox/patches/292.patch
 create mode 100644 srcpkgs/linbox/patches/294.patch
 delete mode 100644 srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch
 delete mode 100644 srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch

diff --git a/srcpkgs/linbox/patches/292.patch b/srcpkgs/linbox/patches/292.patch
new file mode 100644
index 000000000000..d3333cc23d0b
--- /dev/null
+++ b/srcpkgs/linbox/patches/292.patch
@@ -0,0 +1,24 @@
+From 49b9cccd0286980c1c1811c3b03df883ef0164df Mon Sep 17 00:00:00 2001
+From: Doug Torrance <dtorrance@piedmont.edu>
+Date: Tue, 14 Dec 2021 16:22:33 -0500
+Subject: [PATCH] Only register uint128_t as a TypeName when it's available.
+
+Otherwise, test-fft will fail when it isn't.
+---
+ tests/test-fft.C | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/tests/test-fft.C b/tests/test-fft.C
+index d19184c2d..5811ebc5d 100644
+--- a/tests/test-fft.C
++++ b/tests/test-fft.C
+@@ -55,7 +55,9 @@ REGISTER_TYPE_NAME(double);
+ REGISTER_TYPE_NAME(uint16_t);
+ REGISTER_TYPE_NAME(uint32_t);
+ REGISTER_TYPE_NAME(uint64_t);
++#ifdef __FFLASFFPACK_HAVE_INT128
+ REGISTER_TYPE_NAME(uint128_t);
++#endif
+ REGISTER_TYPE_NAME(Modular);
+ REGISTER_TYPE_NAME(ModularExtended);
+ 
diff --git a/srcpkgs/linbox/patches/294.patch b/srcpkgs/linbox/patches/294.patch
new file mode 100644
index 000000000000..7c645f165d39
--- /dev/null
+++ b/srcpkgs/linbox/patches/294.patch
@@ -0,0 +1,38 @@
+From f81a1f4a5e0835b7a0f3bb88a0fcbbaa32174cfa Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
+Date: Wed, 15 Dec 2021 16:00:39 +0100
+Subject: [PATCH] Only register uint128_t as a TypeName when it's available
+
+---
+ benchmarks/benchmark-fft.C                       | 2 ++
+ benchmarks/benchmark-polynomial-matrix-mul-fft.C | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/benchmarks/benchmark-fft.C b/benchmarks/benchmark-fft.C
+index 39b86c9d9..59a8be57c 100644
+--- a/benchmarks/benchmark-fft.C
++++ b/benchmarks/benchmark-fft.C
+@@ -54,7 +54,9 @@ REGISTER_TYPE_NAME(double);
+ REGISTER_TYPE_NAME(uint16_t);
+ REGISTER_TYPE_NAME(uint32_t);
+ REGISTER_TYPE_NAME(uint64_t);
++#ifdef __FFLASFFPACK_HAVE_INT128
+ REGISTER_TYPE_NAME(uint128_t);
++#endif
+ REGISTER_TYPE_NAME(Modular);
+ REGISTER_TYPE_NAME(ModularExtended);
+ 
+diff --git a/benchmarks/benchmark-polynomial-matrix-mul-fft.C b/benchmarks/benchmark-polynomial-matrix-mul-fft.C
+index e9b184bcf..7bf17f33e 100644
+--- a/benchmarks/benchmark-polynomial-matrix-mul-fft.C
++++ b/benchmarks/benchmark-polynomial-matrix-mul-fft.C
+@@ -65,7 +65,9 @@ REGISTER_TYPE_NAME(double);
+ REGISTER_TYPE_NAME(uint16_t);
+ REGISTER_TYPE_NAME(uint32_t);
+ REGISTER_TYPE_NAME(uint64_t);
++#ifdef __FFLASFFPACK_HAVE_INT128
+ REGISTER_TYPE_NAME(uint128_t);
++#endif
+ REGISTER_TYPE_NAME(Modular);
+ REGISTER_TYPE_NAME(ModularExtended);
+ 
diff --git a/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch b/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch
deleted file mode 100644
index 5afa078ec7b8..000000000000
--- a/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 892f8adade10641f1f04f04b589753d928fb5443 Mon Sep 17 00:00:00 2001
-From: Doug Torrance <dtorrance@piedmont.edu>
-Date: Sun, 9 May 2021 12:14:19 -0400
-Subject: [PATCH] Use std::ptrdiff_t for vector iterator difference type
-
-It was previously long (64-bit integers), but this will not be the
-case on 32-bit systems.
-
-Closes: #273
----
- linbox/vector/bit-vector.inl | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/linbox/vector/bit-vector.inl b/linbox/vector/bit-vector.inl
-index 5fa84b421..23a22ba47 100644
---- a/linbox/vector/bit-vector.inl
-+++ b/linbox/vector/bit-vector.inl
-@@ -46,7 +46,7 @@ namespace std
- 		typedef LinBox::BitVector::reference reference;
- 		typedef bool *pointer;
- 		typedef bool value_type;
--		typedef long difference_type;
-+		typedef std::ptrdiff_t difference_type;
- 	};
- 
- 	template <>
-@@ -56,7 +56,7 @@ namespace std
- 		typedef LinBox::BitVector::const_reference reference;
- 		typedef const bool *pointer;
- 		typedef bool value_type;
--		typedef long difference_type;
-+		typedef std::ptrdiff_t difference_type;
- 	};
- }
- 
diff --git a/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch b/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch
deleted file mode 100644
index c93915fb1b06..000000000000
--- a/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Backported from:
-
-From 426eb97ba762c7663884f57ead0909f2aa3cd6a5 Mon Sep 17 00:00:00 2001
-From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
-Date: Thu, 17 Jan 2019 16:32:19 +0100
-Subject: [PATCH] Remove @LINBOXSAGE_LIBS@ from linbox.pc.in
-
----
- linbox.pc.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/linbox.pc.in b/linbox.pc.in
-index 278f127e4..c6b8091eb 100644
---- a/linbox.pc.in
-+++ b/linbox.pc.in
-@@ -9,6 +9,6 @@ Description: Exact Linear Algebra library
- URL: http://github.com/linbox-team/linbox
- Version: @VERSION@
- Requires: fflas-ffpack >= 2.4.0, givaro >= 4.1.0
--Libs: -L${libdir} -llinbox @LINBOXSAGE_LIBS@ @NTL_LIBS@ @MPFR_LIBS@ @FPLLL_LIBS@ @IML_LIBS@ @FLINT_LIBS@ @OCL_LIBS@
-+Libs: -L${libdir} -llinbox @NTL_LIBS@ @MPFR_LIBS@ @FPLLL_LIBS@ @IML_LIBS@ @FLINT_LIBS@ @OCL_LIBS@
- Cflags: @DEFAULT_CFLAGS@ -DDISABLE_COMMENTATOR -I${includedir} @NTL_CFLAGS@ @MPFR_CFLAGS@ @FPLLL_CFLAGS@  @IML_CFLAGS@ @FLINT_CFLAGS@ 
- \-------------------------------------------------------
diff --git a/srcpkgs/linbox/template b/srcpkgs/linbox/template
index 096a15b3390b..e6edacdd0a74 100644
--- a/srcpkgs/linbox/template
+++ b/srcpkgs/linbox/template
@@ -1,7 +1,7 @@
 # Template file for 'linbox'
 pkgname=linbox
-version=1.6.3
-revision=2
+version=1.7.0
+revision=1
 build_style=gnu-configure
 hostmakedepends="pkg-config"
 makedepends="fflas-ffpack"
@@ -9,16 +9,15 @@ short_desc="C++ library for exact, high-performance linear algebra"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="LGPL-2.1-or-later"
 homepage="https://linalg.org"
+changelog="https://github.com/linbox-team/linbox/raw/master/ChangeLog"
 distfiles="https://github.com/linbox-team/linbox/releases/download/v${version}/linbox-${version}.tar.gz"
-checksum=a58a188307b07c57964e844bceb99321d3043a8a4a1fccc082a54928bb9a0057
+checksum=6d2159fd395be0298362dd37f6c696676237bc8e2757341fbc46520e3b466bcc
 nocross=yes
 
 build_options="native_build"
 
 if [ -z "$build_option_native_build" ]; then
-	configure_args="--enable-sse --enable-sse2
-	  --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42
-	  --disable-avx --disable-avx2 --disable-fma --disable-fma4"
+	configure_args="--without-archnative"
 fi
 
 linbox-devel_package() {

From 9bdc7fa3dc3b2591479cce3cf2712682d1cd1ac7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Feb 2023 22:53:33 -0300
Subject: [PATCH 4/6] sagemath: rebuild for linbox 1.7.0

---
 .../sagemath/patches/35612-linbox_1.7.patch   | 64 +++++++++++++++++++
 srcpkgs/sagemath/patches/get_patches          |  1 +
 srcpkgs/sagemath/template                     |  2 +-
 3 files changed, 66 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/sagemath/patches/35612-linbox_1.7.patch

diff --git a/srcpkgs/sagemath/patches/35612-linbox_1.7.patch b/srcpkgs/sagemath/patches/35612-linbox_1.7.patch
new file mode 100644
index 000000000000..58dddf34a69d
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35612-linbox_1.7.patch
@@ -0,0 +1,64 @@
+diff --git a/src/sage/libs/linbox/conversion.pxd b/src/sage/libs/linbox/conversion.pxd
+index 7794c9edc39..1753277b1f1 100644
+--- a/src/sage/libs/linbox/conversion.pxd
++++ b/src/sage/libs/linbox/conversion.pxd
+@@ -177,9 +177,8 @@ cdef inline Vector_integer_dense new_sage_vector_integer_dense(P, DenseVector_in
+     - v -- linbox vector
+     """
+     cdef Vector_integer_dense res = P()
+-    cdef cppvector[Integer] * vec = &v.refRep()
+     cdef size_t i
+     for i in range(<size_t> res._degree):
+-        mpz_set(res._entries[i], vec[0][i].get_mpz_const())
++        mpz_set(res._entries[i], v.getEntry(i).get_mpz_const())
+ 
+     return res
+diff --git a/src/sage/libs/linbox/linbox.pxd b/src/sage/libs/linbox/linbox.pxd
+index 9112d151f8b..bfeda4b6042 100644
+--- a/src/sage/libs/linbox/linbox.pxd
++++ b/src/sage/libs/linbox/linbox.pxd
+@@ -32,7 +32,6 @@ cdef extern from "linbox/matrix/dense-matrix.h":
+         ctypedef Modular_double Field
+         ctypedef double Element
+         DenseMatrix_Modular_double(Field F, size_t m, size_t n)
+-        DenseMatrix_Modular_double(Field F, Element*, size_t m, size_t n)
+         void setEntry(size_t i, size_t j, Element& a)
+         Element &getEntry(size_t i, size_t j)
+ 
+@@ -42,7 +41,6 @@ cdef extern from "linbox/matrix/dense-matrix.h":
+         ctypedef Modular_float Field
+         ctypedef float Element
+         DenseMatrix_Modular_float(Field F, size_t m, size_t n)
+-        DenseMatrix_Modular_float(Field F, Element*, size_t m, size_t n)
+         void setEntry(size_t i, size_t j, Element& a)
+         Element &getEntry(size_t i, size_t j)
+ 
+@@ -101,7 +99,6 @@ cdef extern from "linbox/vector/vector.h":
+         DenseVector_integer (Field &F)
+         DenseVector_integer (Field &F, long& m)
+         DenseVector_integer (Field &F, cppvector[Integer]&)
+-        cppvector[Element]& refRep()
+         size_t size()
+         void resize(size_t)
+         void resize(size_t n, const Element&)
+diff --git a/src/sage/matrix/matrix_modn_dense_template.pxi b/src/sage/matrix/matrix_modn_dense_template.pxi
+index abf29badce6..68b869ce314 100644
+--- a/src/sage/matrix/matrix_modn_dense_template.pxi
++++ b/src/sage/matrix/matrix_modn_dense_template.pxi
+@@ -221,9 +221,14 @@ cdef inline linbox_echelonize_efd(celement modulus, celement* entries, Py_ssize_
+         return 0,[]
+ 
+     cdef ModField *F = new ModField(<long>modulus)
+-    cdef DenseMatrix *A = new DenseMatrix(F[0], <ModField.Element*>entries,<Py_ssize_t>nrows, <Py_ssize_t>ncols)
+-    cdef Py_ssize_t r = reducedRowEchelonize(A[0])
++    cdef DenseMatrix *A = new DenseMatrix(F[0], nrows, ncols)
++
+     cdef Py_ssize_t i,j
++    for i in range(nrows):
++        for j in range(ncols):
++            A.setEntry(i, j, entries[i*ncols+j])
++
++    cdef Py_ssize_t r = reducedRowEchelonize(A[0])
+     for i in range(nrows):
+         for j in range(ncols):
+             entries[i*ncols+j] = <celement>A.getEntry(i,j)
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 871ae38577fd..db36086fc9f9 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -61,3 +61,4 @@ get_pr 35438 "pythran 0.12.1"
 
 # needs review
 get_pr 35584 "networkx 3.1"
+get_pr 35612 "linbox 1.7"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 66a543efd21d..6e794c931df4 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
 version=9.8
-revision=2
+revision=3
 build_wrksrc=pkgs/sagemath-standard
 build_style=python3-module
 _bindir=/usr/lib/sagemath/$version/bin

From 6964c3d8e6dbd458afe4bda1986eda1a825faaba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Fri, 15 Apr 2022 14:25:08 -0300
Subject: [PATCH 5/6] maxima: update to 5.46.0.

---
 ...a43e5234305bd6f1de5909d4ce5d7e1ea864.patch | 24 -------------------
 srcpkgs/maxima/template                       |  7 +++---
 2 files changed, 4 insertions(+), 27 deletions(-)
 delete mode 100644 srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch

diff --git a/srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch b/srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch
deleted file mode 100644
index e1ac1e5f6086..000000000000
--- a/srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-commit a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864
-Author: Robert Dodier <robert_dodier@users.sourceforge.net>
-Date:   Mon Oct 11 22:40:13 2021 -0700
-
-    Apply patch #80: "Build a FASL library, needed by SageMath"
-    
-    This modifies maxima.system for ECL only.
-
-diff --git a/src/maxima.system b/src/maxima.system
-index d954bc2b9..525fb778e 100644
---- a/src/maxima.system
-+++ b/src/maxima.system
-@@ -75,6 +75,11 @@
- 			     ;; Convert dir/foo.fas to dir/foo.o
- 			     (make-pathname :type "o" :defaults p))
- 			 files)))
-+	(c::build-fasl "binary-ecl/maxima" :lisp-files obj
-+			  :ld-flags
-+			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
-+							      (find-package "MAXIMA")))))
-+			    (if (and x (not (string= x ""))) (list x))))
- 	(c::build-program "binary-ecl/maxima" :lisp-files obj
- 			  :ld-flags
- 			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
diff --git a/srcpkgs/maxima/template b/srcpkgs/maxima/template
index 69e85ec833e8..6e3100c892f5 100644
--- a/srcpkgs/maxima/template
+++ b/srcpkgs/maxima/template
@@ -1,7 +1,7 @@
 # Template file for 'maxima'
 pkgname=maxima
-version=5.45.1
-revision=4
+version=5.46.0
+revision=1
 build_style=gnu-configure
 configure_args="$(vopt_enable clisp) $(vopt_enable sbcl sbcl-exec) $(vopt_enable ecl)"
 hostmakedepends="python3 perl emacs texinfo patchelf"
@@ -12,8 +12,9 @@ short_desc="Computer Algebra System"
 maintainer="Bosco Garcia <jboscogg@gmail.org>"
 license="GPL-2.0-only"
 homepage="http://maxima.sourceforge.net"
+changelog="https://sourceforge.net/p/maxima/code/ci/master/tree/changelogs/ChangeLog-${version%.*}.md?format=raw"
 distfiles="${SOURCEFORGE_SITE}/maxima/maxima-${version}.tar.gz"
-checksum=fe9016276970bef214a1a244348558644514d7fdfaa4fc8b9d0e87afcbb4e7dc
+checksum=7390f06b48da65c9033e8b2f629b978b90056454a54022db7de70e2225aa8b07
 
 # maxima-sbcl is nopie and should NOT be stripped or it won't work
 nostrip_files=/usr/lib/maxima/$version/binary-sbcl/maxima

From 37122792137ce013effbc45f9a9818a42bee4a8c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Tue, 25 Apr 2023 13:20:47 -0300
Subject: [PATCH 6/6] sagemath: update to 10.0.rc2.

Also:
 - support networkx 3.1 (sage#35584)
 - support linbox 1.7.0 (sage#35612)
 - support maxima 5.46.0 (sage#35619)
---
 srcpkgs/sagemath/files/sage_conf.py           |    1 -
 srcpkgs/sagemath/files/timings2.json          |  405 ++---
 ...-support_singular_4.3.1.p3-5e5737a0c.patch |  205 ---
 .../34980-avoid_factoring_in_is_prime.patch   |   49 -
 .../patches/34994-fix_tests_numpy_1.24.patch  |   58 -
 .../34995-support_tachyon_0.99.2.patch        |   57 -
 ...34997-fix_edge_case_of_integer_check.patch |   36 -
 .../35058-skip_unstable_tests_klyachko.patch  |   22 -
 .../35068-fix_tests_giac_1.9.0.35.patch       |   62 -
 .../patches/35094-support_gap_4.12.patch      | 1303 -----------------
 .../35127-fix_very_slow_test_stream.py.patch  |   15 -
 .../patches/35177-matplotlib_3.7.patch        |   95 --
 .../patches/35195-workaround_ecl_race.patch   |   56 -
 .../patches/35204-fix_sage-cleaner.patch      |   28 -
 .../sagemath/patches/35250-nauty_2.8.6.patch  |   35 -
 .../sagemath/patches/35423-ipython_8.12.patch |   51 -
 .../patches/35438-pythran_0.12.1.patch        |   41 -
 .../sagemath/patches/35584-networkx_3.1.patch |   35 +-
 ...box_1.7.patch => 35612-linbox_1.7.0.patch} |    0
 .../patches/35619-maxima_5.46.0.patch         |  578 ++++++++
 srcpkgs/sagemath/patches/get_patches          |   46 +-
 srcpkgs/sagemath/template                     |    6 +-
 22 files changed, 714 insertions(+), 2470 deletions(-)
 delete mode 100644 srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
 delete mode 100644 srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
 delete mode 100644 srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
 delete mode 100644 srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
 delete mode 100644 srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
 delete mode 100644 srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
 delete mode 100644 srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
 delete mode 100644 srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
 delete mode 100644 srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
 delete mode 100644 srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
 delete mode 100644 srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
 delete mode 100644 srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
 delete mode 100644 srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
 delete mode 100644 srcpkgs/sagemath/patches/35423-ipython_8.12.patch
 delete mode 100644 srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
 rename srcpkgs/sagemath/patches/{35612-linbox_1.7.patch => 35612-linbox_1.7.0.patch} (100%)
 create mode 100644 srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch

diff --git a/srcpkgs/sagemath/files/sage_conf.py b/srcpkgs/sagemath/files/sage_conf.py
index 00de40f1ee4f..bc5388de8956 100644
--- a/srcpkgs/sagemath/files/sage_conf.py
+++ b/srcpkgs/sagemath/files/sage_conf.py
@@ -1,4 +1,3 @@
 # configuration for sage on void linux
 SAGE_SHARE = "/usr/share/sagemath"
 GAP_SHARE_DIR = "/usr/share/gap"
-GAP_LIB_DIR = "/usr/lib/gap"
diff --git a/srcpkgs/sagemath/files/timings2.json b/srcpkgs/sagemath/files/timings2.json
index bb3098680502..b2b3fe818a20 100644
--- a/srcpkgs/sagemath/files/timings2.json
+++ b/srcpkgs/sagemath/files/timings2.json
@@ -1,281 +1,152 @@
 {
-  "doc.ca.intro.index": {"walltime": 8},
-  "doc.en.constructions.calculus": {"walltime": 64},
-  "doc.en.constructions.plotting": {"walltime": 32},
-  "doc.en.prep.Advanced-2DPlotting": {"walltime": 16},
-  "doc.en.prep.Calculus": {"walltime": 8},
-  "doc.en.prep.Symbolics-and-Basic-Plotting": {"walltime": 8},
-  "doc.en.thematic_tutorials.explicit_methods_in_number_theory.birds_other": {"walltime": 8},
-  "doc.en.thematic_tutorials.explicit_methods_in_number_theory.elliptic_curves": {"walltime": 8},
-  "doc.en.thematic_tutorials.geometry.polyhedra_tutorial": {"walltime": 16},
-  "doc.en.thematic_tutorials.sandpile": {"walltime": 16},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_advanced": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_cartesian": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_change": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_curvilinear": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_plane": {"walltime": 16},
-  "doc.ja.tutorial.tour_plotting": {"walltime": 8},
-  "sage.algebras.cluster_algebra": {"walltime": 8},
   "sage.algebras.commutative_dga": {"walltime": 16},
-  "sage.algebras.hecke_algebras.ariki_koike_algebra": {"walltime": 8},
-  "sage.algebras.iwahori_hecke_algebra": {"walltime": 8},
-  "sage.algebras.lie_algebras.classical_lie_algebra": {"walltime": 128},
-  "sage.algebras.lie_algebras.nilpotent_lie_algebra": {"walltime": 16},
-  "sage.algebras.quantum_clifford": {"walltime": 16},
-  "sage.algebras.quantum_groups.fock_space": {"walltime": 8},
-  "sage.algebras.quatalg.quaternion_algebra": {"walltime": 8},
-  "sage.algebras.steenrod.steenrod_algebra": {"walltime": 64},
-  "sage.algebras.steenrod.steenrod_algebra_bases": {"walltime": 8},
-  "sage.algebras.yangian": {"walltime": 8},
-  "sage.arith.misc": {"walltime": 32},
+  "sage.algebras.fusion_rings.f_matrix": {"walltime": 16},
+  "sage.algebras.fusion_rings.fusion_ring": {"walltime": 16},
+  "sage.algebras.hecke_algebras.cubic_hecke_algebra": {"walltime": 8},
+  "sage.algebras.lie_conformal_algebras.n2_lie_conformal_algebra": {"walltime": 8},
+  "sage.algebras.quantum_clifford": {"walltime": 8},
+  "sage.algebras.steenrod.steenrod_algebra": {"walltime": 8},
   "sage.calculus.calculus": {"walltime": 16},
   "sage.calculus.desolvers": {"walltime": 8},
-  "sage.calculus.functional": {"walltime": 8},
-  "sage.calculus.riemann": {"walltime": 64},
-  "sage.calculus.tests": {"walltime": 16},
-  "sage.calculus.transforms.dwt": {"walltime": 16},
+  "sage.calculus.riemann": {"walltime": 8},
   "sage.calculus.transforms.fft": {"walltime": 8},
   "sage.categories.coxeter_groups": {"walltime": 8},
-  "sage.categories.finite_monoids": {"walltime": 16},
-  "sage.categories.lie_conformal_algebras": {"walltime": 8},
+  "sage.categories.finite_monoids": {"walltime": 8},
   "sage.categories.loop_crystals": {"walltime": 8},
-  "sage.categories.pushout": {"walltime": 8},
-  "sage.categories.super_hopf_algebras_with_basis": {"walltime": 32},
-  "sage.categories.super_lie_conformal_algebras": {"walltime": 8},
-  "sage.coding.ag_code": {"walltime": 64},
-  "sage.coding.ag_code_decoders": {"walltime": 128},
-  "sage.coding.binary_code": {"walltime": 8},
-  "sage.coding.linear_code": {"walltime": 16},
-  "sage.combinat.backtrack": {"walltime": 32},
-  "sage.combinat.chas.wqsym": {"walltime": 32},
-  "sage.combinat.cluster_algebra_quiver.cluster_seed": {"walltime": 64},
-  "sage.combinat.cluster_algebra_quiver.quiver": {"walltime": 128},
-  "sage.combinat.crystals.affine_factorization": {"walltime": 16},
-  "sage.combinat.crystals.alcove_path": {"walltime": 32},
-  "sage.combinat.crystals.highest_weight_crystals": {"walltime": 8},
-  "sage.combinat.crystals.kirillov_reshetikhin": {"walltime": 16},
-  "sage.combinat.crystals.letters": {"walltime": 8},
-  "sage.combinat.crystals.littelmann_path": {"walltime": 16},
-  "sage.combinat.crystals.mv_polytopes": {"walltime": 16},
-  "sage.combinat.crystals.pbw_crystal": {"walltime": 16},
-  "sage.combinat.crystals.star_crystal": {"walltime": 8},
-  "sage.combinat.designs.bibd": {"walltime": 8},
-  "sage.combinat.designs.database": {"walltime": 16},
+  "sage.coding.ag_code": {"walltime": 32},
+  "sage.coding.ag_code_decoders": {"walltime": 32},
+  "sage.coding.linear_code": {"walltime": 32},
+  "sage.combinat.designs.database": {"walltime": 8},
   "sage.combinat.designs.difference_family": {"walltime": 8},
-  "sage.combinat.designs.gen_quadrangles_with_spread": {"walltime": 128},
-  "sage.combinat.designs.orthogonal_arrays_build_recursive": {"walltime": 16},
-  "sage.combinat.designs.orthogonal_arrays_find_recursive": {"walltime": 8},
-  "sage.combinat.diagram_algebras": {"walltime": 64},
-  "sage.combinat.fqsym": {"walltime": 32},
-  "sage.combinat.free_prelie_algebra": {"walltime": 8},
-  "sage.combinat.fully_commutative_elements": {"walltime": 8},
-  "sage.combinat.grossman_larson_algebras": {"walltime": 8},
-  "sage.combinat.interval_posets": {"walltime": 8},
+  "sage.combinat.designs.orthogonal_arrays_build_recursive": {"walltime": 8},
   "sage.combinat.k_regular_sequence": {"walltime": 8},
   "sage.combinat.k_tableau": {"walltime": 16},
   "sage.combinat.matrices.hadamard_matrix": {"walltime": 8},
   "sage.combinat.multiset_partition_into_sets_ordered": {"walltime": 8},
-  "sage.combinat.ncsf_qsym.ncsf": {"walltime": 16},
-  "sage.combinat.ncsf_qsym.qsym": {"walltime": 16},
-  "sage.combinat.partition": {"walltime": 16},
-  "sage.combinat.partition_kleshchev": {"walltime": 16},
+  "sage.combinat.ncsf_qsym.ncsf": {"walltime": 8},
+  "sage.combinat.ncsf_qsym.qsym": {"walltime": 8},
+  "sage.combinat.partition": {"walltime": 8},
   "sage.combinat.partition_tuple": {"walltime": 8},
-  "sage.combinat.posets.moebius_algebra": {"walltime": 16},
+  "sage.combinat.permutation": {"walltime": 8},
   "sage.combinat.posets.posets": {"walltime": 8},
-  "sage.combinat.rigged_configurations.kr_tableaux": {"walltime": 32},
-  "sage.combinat.rigged_configurations.rigged_configurations": {"walltime": 16},
-  "sage.combinat.rigged_configurations.tensor_product_kr_tableaux": {"walltime": 16},
+  "sage.combinat.rigged_configurations.kr_tableaux": {"walltime": 8},
   "sage.combinat.root_system.associahedron": {"walltime": 8},
-  "sage.combinat.root_system.branching_rules": {"walltime": 8},
-  "sage.combinat.root_system.fusion_ring": {"walltime": 8},
-  "sage.combinat.root_system.integrable_representations": {"walltime": 16},
-  "sage.combinat.root_system.non_symmetric_macdonald_polynomials": {"walltime": 16},
-  "sage.combinat.root_system.pieri_factors": {"walltime": 8},
-  "sage.combinat.root_system.plot": {"walltime": 32},
-  "sage.combinat.root_system.root_lattice_realization_algebras": {"walltime": 16},
-  "sage.combinat.root_system.root_lattice_realizations": {"walltime": 16},
-  "sage.combinat.root_system.root_system": {"walltime": 8},
-  "sage.combinat.root_system.weyl_group": {"walltime": 8},
-  "sage.combinat.rsk": {"walltime": 32},
-  "sage.combinat.sf.classical": {"walltime": 16},
-  "sage.combinat.sf.jack": {"walltime": 16},
-  "sage.combinat.sf.k_dual": {"walltime": 16},
-  "sage.combinat.sf.llt": {"walltime": 16},
-  "sage.combinat.sf.macdonald": {"walltime": 64},
-  "sage.combinat.sf.new_kschur": {"walltime": 8},
-  "sage.combinat.sf.sfa": {"walltime": 32},
-  "sage.combinat.shifted_primed_tableau": {"walltime": 16},
+  "sage.combinat.root_system.non_symmetric_macdonald_polynomials": {"walltime": 8},
+  "sage.combinat.root_system.plot": {"walltime": 16},
+  "sage.combinat.root_system.root_lattice_realizations": {"walltime": 8},
+  "sage.combinat.rsk": {"walltime": 8},
+  "sage.combinat.sf.k_dual": {"walltime": 8},
+  "sage.combinat.sf.sf": {"walltime": 8},
+  "sage.combinat.sf.sfa": {"walltime": 8},
+  "sage.combinat.shifted_primed_tableau": {"walltime": 8},
   "sage.combinat.skew_tableau": {"walltime": 8},
-  "sage.combinat.symmetric_group_algebra": {"walltime": 16},
-  "sage.combinat.tableau": {"walltime": 32},
-  "sage.combinat.tableau_tuple": {"walltime": 32},
-  "sage.combinat.tiling": {"walltime": 16},
-  "sage.combinat.tutorial": {"walltime": 16},
-  "sage.combinat.words.paths": {"walltime": 64},
-  "sage.crypto.block_cipher.des": {"walltime": 16},
-  "sage.crypto.mq.sr": {"walltime": 64},
-  "sage.crypto.sbox": {"walltime": 16},
+  "sage.combinat.species.generating_series": {"walltime": 8},
+  "sage.combinat.tableau": {"walltime": 8},
+  "sage.combinat.tableau_tuple": {"walltime": 8},
+  "sage.combinat.tiling": {"walltime": 8},
+  "sage.combinat.tutorial": {"walltime": 8},
   "sage.crypto.sboxes": {"walltime": 8},
   "sage.doctest.forker": {"walltime": 16},
-  "sage.doctest.sources": {"walltime": 64},
-  "sage.doctest.test": {"walltime": 128},
-  "sage.dynamics.arithmetic_dynamics.projective_ds": {"walltime": 64},
-  "sage.dynamics.arithmetic_dynamics.wehlerK3": {"walltime": 8},
-  "sage.dynamics.cellular_automata.glca": {"walltime": 8},
+  "sage.dynamics.arithmetic_dynamics.projective_ds": {"walltime": 32},
   "sage.dynamics.cellular_automata.solitons": {"walltime": 8},
-  "sage.dynamics.complex_dynamics.mandel_julia": {"walltime": 16},
   "sage.functions.bessel": {"walltime": 16},
-  "sage.functions.exp_integral": {"walltime": 8},
   "sage.functions.hypergeometric": {"walltime": 8},
+  "sage.functions.orthogonal_polys": {"walltime": 8},
   "sage.functions.other": {"walltime": 16},
   "sage.functions.piecewise": {"walltime": 8},
-  "sage.games.quantumino": {"walltime": 8},
-  "sage.geometry.cone": {"walltime": 32},
-  "sage.geometry.fan": {"walltime": 8},
   "sage.geometry.hyperbolic_space.hyperbolic_geodesic": {"walltime": 8},
-  "sage.geometry.hyperplane_arrangement.arrangement": {"walltime": 16},
-  "sage.geometry.hyperplane_arrangement.library": {"walltime": 8},
+  "sage.geometry.hyperplane_arrangement.arrangement": {"walltime": 8},
   "sage.geometry.hyperplane_arrangement.plot": {"walltime": 8},
-  "sage.geometry.lattice_polytope": {"walltime": 16},
-  "sage.geometry.polyhedral_complex": {"walltime": 8},
-  "sage.geometry.polyhedron.base": {"walltime": 32},
-  "sage.geometry.polyhedron.library": {"walltime": 32},
-  "sage.geometry.polyhedron.plot": {"walltime": 8},
+  "sage.geometry.polyhedron.base": {"walltime": 8},
+  "sage.geometry.polyhedron.base5": {"walltime": 8},
+  "sage.geometry.polyhedron.base6": {"walltime": 16},
+  "sage.geometry.polyhedron.library": {"walltime": 16},
   "sage.geometry.riemannian_manifolds.parametrized_surface3d": {"walltime": 16},
-  "sage.geometry.triangulation.base": {"walltime": 32},
-  "sage.geometry.triangulation.point_configuration": {"walltime": 16},
-  "sage.graphs.chrompoly": {"walltime": 8},
-  "sage.graphs.connectivity": {"walltime": 16},
-  "sage.graphs.generators.basic": {"walltime": 16},
-  "sage.graphs.generators.classical_geometries": {"walltime": 32},
-  "sage.graphs.generators.distance_regular": {"walltime": 256},
-  "sage.graphs.generators.families": {"walltime": 32},
-  "sage.graphs.generators.smallgraphs": {"walltime": 16},
-  "sage.graphs.generic_graph": {"walltime": 32},
-  "sage.graphs.genus": {"walltime": 16},
+  "sage.graphs.connectivity": {"walltime": 8},
+  "sage.graphs.generators.classical_geometries": {"walltime": 8},
+  "sage.graphs.generators.distance_regular": {"walltime": 32},
+  "sage.graphs.generators.smallgraphs": {"walltime": 8},
+  "sage.graphs.generic_graph": {"walltime": 16},
   "sage.graphs.graph": {"walltime": 16},
-  "sage.graphs.graph_generators": {"walltime": 8},
   "sage.graphs.graph_list": {"walltime": 8},
   "sage.graphs.graph_plot": {"walltime": 8},
-  "sage.graphs.strongly_regular_db": {"walltime": 16},
-  "sage.groups.cubic_braid": {"walltime": 16},
-  "sage.groups.fqf_orthogonal": {"walltime": 16},
-  "sage.groups.libgap_mixin": {"walltime": 8},
-  "sage.groups.libgap_morphism": {"walltime": 8},
-  "sage.groups.lie_gps.nilpotent_lie_group": {"walltime": 16},
-  "sage.groups.matrix_gps.finitely_generated": {"walltime": 8},
-  "sage.groups.matrix_gps.heisenberg": {"walltime": 32},
-  "sage.groups.matrix_gps.linear": {"walltime": 8},
-  "sage.groups.perm_gps.cubegroup": {"walltime": 16},
-  "sage.groups.perm_gps.partn_ref.refinement_graphs": {"walltime": 8},
+  "sage.graphs.strongly_regular_db": {"walltime": 8},
+  "sage.groups.cactus_group": {"walltime": 8},
+  "sage.groups.cubic_braid": {"walltime": 8},
+  "sage.groups.lie_gps.nilpotent_lie_group": {"walltime": 8},
+  "sage.groups.matrix_gps.finitely_generated_gap": {"walltime": 8},
   "sage.groups.perm_gps.permgroup": {"walltime": 8},
   "sage.groups.perm_gps.permgroup_named": {"walltime": 8},
-  "sage.homology.hochschild_complex": {"walltime": 8},
   "sage.homology.homology_vector_space_with_basis": {"walltime": 8},
-  "sage.interacts.test_jupyter": {"walltime": 16},
-  "sage.interfaces.ecm": {"walltime": 8},
-  "sage.interfaces.expect": {"walltime": 8},
-  "sage.interfaces.gap": {"walltime": 16},
-  "sage.interfaces.maxima": {"walltime": 8},
-  "sage.interfaces.maxima_abstract": {"walltime": 64},
-  "sage.interfaces.psage": {"walltime": 8},
-  "sage.interfaces.sage0": {"walltime": 8},
-  "sage.lfunctions.zero_sums": {"walltime": 8},
-  "sage.libs.eclib.interface": {"walltime": 16},
+  "sage.interfaces.gap": {"walltime": 8},
+  "sage.interfaces.gap_workspace": {"walltime": 8},
+  "sage.interfaces.sage0": {"walltime": 16},
+  "sage.libs.eclib.interface": {"walltime": 32},
   "sage.libs.eclib.mwrank": {"walltime": 16},
-  "sage.libs.gap.test_long": {"walltime": 32},
-  "sage.libs.giac": {"walltime": 32},
   "sage.manifolds.catalog": {"walltime": 8},
-  "sage.manifolds.chart": {"walltime": 32},
+  "sage.manifolds.chart": {"walltime": 16},
   "sage.manifolds.chart_func": {"walltime": 8},
   "sage.manifolds.continuous_map": {"walltime": 8},
-  "sage.manifolds.differentiable.affine_connection": {"walltime": 128},
+  "sage.manifolds.differentiable.affine_connection": {"walltime": 32},
   "sage.manifolds.differentiable.automorphismfield": {"walltime": 32},
-  "sage.manifolds.differentiable.automorphismfield_group": {"walltime": 8},
   "sage.manifolds.differentiable.bundle_connection": {"walltime": 8},
-  "sage.manifolds.differentiable.characteristic_cohomology_class": {"walltime": 64},
+  "sage.manifolds.differentiable.characteristic_cohomology_class": {"walltime": 8},
   "sage.manifolds.differentiable.curve": {"walltime": 16},
-  "sage.manifolds.differentiable.degenerate": {"walltime": 32},
-  "sage.manifolds.differentiable.degenerate_submanifold": {"walltime": 16},
-  "sage.manifolds.differentiable.diff_form": {"walltime": 64},
+  "sage.manifolds.differentiable.degenerate": {"walltime": 16},
+  "sage.manifolds.differentiable.degenerate_submanifold": {"walltime": 8},
+  "sage.manifolds.differentiable.diff_form": {"walltime": 32},
   "sage.manifolds.differentiable.diff_map": {"walltime": 8},
   "sage.manifolds.differentiable.examples.euclidean": {"walltime": 32},
   "sage.manifolds.differentiable.examples.sphere": {"walltime": 32},
   "sage.manifolds.differentiable.integrated_curve": {"walltime": 32},
-  "sage.manifolds.differentiable.levi_civita_connection": {"walltime": 32},
-  "sage.manifolds.differentiable.manifold": {"walltime": 16},
-  "sage.manifolds.differentiable.manifold_homset": {"walltime": 16},
+  "sage.manifolds.differentiable.levi_civita_connection": {"walltime": 16},
+  "sage.manifolds.differentiable.manifold": {"walltime": 8},
+  "sage.manifolds.differentiable.manifold_homset": {"walltime": 8},
   "sage.manifolds.differentiable.metric": {"walltime": 64},
   "sage.manifolds.differentiable.mixed_form": {"walltime": 16},
-  "sage.manifolds.differentiable.mixed_form_algebra": {"walltime": 8},
   "sage.manifolds.differentiable.multivectorfield": {"walltime": 64},
-  "sage.manifolds.differentiable.pseudo_riemannian": {"walltime": 16},
-  "sage.manifolds.differentiable.pseudo_riemannian_submanifold": {"walltime": 128},
-  "sage.manifolds.differentiable.scalarfield": {"walltime": 16},
+  "sage.manifolds.differentiable.pseudo_riemannian": {"walltime": 8},
+  "sage.manifolds.differentiable.pseudo_riemannian_submanifold": {"walltime": 32},
+  "sage.manifolds.differentiable.scalarfield": {"walltime": 8},
   "sage.manifolds.differentiable.scalarfield_algebra": {"walltime": 8},
-  "sage.manifolds.differentiable.tangent_vector": {"walltime": 16},
+  "sage.manifolds.differentiable.tangent_vector": {"walltime": 8},
   "sage.manifolds.differentiable.tensorfield": {"walltime": 128},
   "sage.manifolds.differentiable.tensorfield_paral": {"walltime": 16},
-  "sage.manifolds.differentiable.vector_bundle": {"walltime": 16},
-  "sage.manifolds.differentiable.vectorfield": {"walltime": 64},
-  "sage.manifolds.differentiable.vectorframe": {"walltime": 8},
+  "sage.manifolds.differentiable.vectorfield": {"walltime": 16},
   "sage.manifolds.point": {"walltime": 16},
   "sage.manifolds.scalarfield": {"walltime": 16},
-  "sage.manifolds.scalarfield_algebra": {"walltime": 8},
-  "sage.manifolds.section": {"walltime": 32},
-  "sage.manifolds.trivialization": {"walltime": 8},
-  "sage.manifolds.vector_bundle": {"walltime": 8},
-  "sage.matrix.benchmark": {"walltime": 8},
+  "sage.manifolds.section": {"walltime": 16},
   "sage.matrix.matrix2": {"walltime": 16},
-  "sage.matrix.matrix_integer_dense": {"walltime": 16},
-  "sage.matrix.matrix_integer_dense_hnf": {"walltime": 32},
-  "sage.matrix.matrix_mod2_dense": {"walltime": 8},
   "sage.matrix.matrix_rational_dense": {"walltime": 8},
   "sage.matrix.special": {"walltime": 8},
-  "sage.matroids.catalog": {"walltime": 64},
   "sage.misc.cachefunc": {"walltime": 16},
-  "sage.misc.cython": {"walltime": 8},
   "sage.misc.functional": {"walltime": 8},
   "sage.misc.randstate": {"walltime": 16},
-  "sage.misc.sagedoc": {"walltime": 64},
-  "sage.misc.sageinspect": {"walltime": 32},
-  "sage.modular.abvar.abvar": {"walltime": 16},
+  "sage.misc.sagedoc": {"walltime": 16},
+  "sage.misc.sageinspect": {"walltime": 16},
+  "sage.misc.trace": {"walltime": 8},
+  "sage.modular.abvar.abvar": {"walltime": 8},
   "sage.modular.abvar.homspace": {"walltime": 8},
-  "sage.modular.abvar.lseries": {"walltime": 8},
-  "sage.modular.arithgroup.arithgroup_perm": {"walltime": 8},
-  "sage.modular.arithgroup.tests": {"walltime": 8},
-  "sage.modular.btquotients.pautomorphicform": {"walltime": 32},
-  "sage.modular.hypergeometric_motive": {"walltime": 16},
-  "sage.modular.local_comp.local_comp": {"walltime": 32},
-  "sage.modular.local_comp.type_space": {"walltime": 16},
-  "sage.modular.modform.ambient_R": {"walltime": 16},
-  "sage.modular.modform.constructor": {"walltime": 8},
-  "sage.modular.modform.cuspidal_submodule": {"walltime": 16},
-  "sage.modular.modform.element": {"walltime": 64},
-  "sage.modular.modform.ring": {"walltime": 64},
-  "sage.modular.modform.space": {"walltime": 8},
+  "sage.modular.btquotients.btquotient": {"walltime": 8},
+  "sage.modular.btquotients.pautomorphicform": {"walltime": 16},
+  "sage.modular.hecke.submodule": {"walltime": 8},
+  "sage.modular.hypergeometric_motive": {"walltime": 8},
+  "sage.modular.local_comp.local_comp": {"walltime": 16},
+  "sage.modular.local_comp.type_space": {"walltime": 8},
+  "sage.modular.modform.element": {"walltime": 32},
   "sage.modular.modform_hecketriangle.abstract_space": {"walltime": 16},
   "sage.modular.modform_hecketriangle.graded_ring_element": {"walltime": 16},
   "sage.modular.modform_hecketriangle.hecke_triangle_group_element": {"walltime": 32},
   "sage.modular.modform_hecketriangle.readme": {"walltime": 16},
-  "sage.modular.modform_hecketriangle.space": {"walltime": 8},
   "sage.modular.modsym.ambient": {"walltime": 16},
   "sage.modular.modsym.space": {"walltime": 8},
-  "sage.modular.pollack_stevens.modsym": {"walltime": 64},
-  "sage.modular.pollack_stevens.padic_lseries": {"walltime": 32},
-  "sage.modules.finite_submodule_iter": {"walltime": 16},
-  "sage.modules.free_module": {"walltime": 16},
-  "sage.modules.free_module_element": {"walltime": 8},
-  "sage.modules.free_module_integer": {"walltime": 32},
-  "sage.modules.free_quadratic_module_integer_symmetric": {"walltime": 8},
-  "sage.modules.torsion_quadratic_module": {"walltime": 16},
+  "sage.modular.overconvergent.genus0": {"walltime": 8},
+  "sage.modular.pollack_stevens.modsym": {"walltime": 8},
+  "sage.modules.fp_graded.morphism": {"walltime": 8},
+  "sage.modules.free_module": {"walltime": 8},
   "sage.parallel.map_reduce": {"walltime": 8},
-  "sage.plot.animate": {"walltime": 16},
-  "sage.plot.arrow": {"walltime": 8},
-  "sage.plot.circle": {"walltime": 8},
-  "sage.plot.complex_plot": {"walltime": 8},
+  "sage.plot.complex_plot": {"walltime": 16},
   "sage.plot.contour_plot": {"walltime": 32},
-  "sage.plot.density_plot": {"walltime": 8},
   "sage.plot.graphics": {"walltime": 32},
   "sage.plot.line": {"walltime": 8},
   "sage.plot.matrix_plot": {"walltime": 16},
@@ -283,115 +154,53 @@
   "sage.plot.plot": {"walltime": 64},
   "sage.plot.plot3d.base": {"walltime": 8},
   "sage.plot.plot3d.implicit_plot3d": {"walltime": 16},
-  "sage.plot.plot3d.implicit_surface": {"walltime": 8},
-  "sage.plot.plot3d.parametric_plot3d": {"walltime": 8},
+  "sage.plot.plot3d.parametric_plot3d": {"walltime": 16},
   "sage.plot.plot3d.parametric_surface": {"walltime": 8},
   "sage.plot.plot3d.plot3d": {"walltime": 16},
-  "sage.plot.plot3d.tachyon": {"walltime": 8},
-  "sage.plot.plot3d.transform": {"walltime": 32},
   "sage.plot.point": {"walltime": 8},
   "sage.plot.polygon": {"walltime": 8},
   "sage.plot.streamline_plot": {"walltime": 8},
-  "sage.quadratic_forms.genera.genus": {"walltime": 16},
-  "sage.quadratic_forms.quadratic_form__automorphisms": {"walltime": 8},
-  "sage.quadratic_forms.quadratic_form__local_representation_conditions": {"walltime": 64},
-  "sage.quadratic_forms.quadratic_form__neighbors": {"walltime": 8},
-  "sage.quadratic_forms.quadratic_form__siegel_product": {"walltime": 8},
   "sage.repl.ipython_extension": {"walltime": 8},
-  "sage.rings.asymptotic.asymptotic_expansion_generators": {"walltime": 64},
+  "sage.rings.asymptotic.asymptotic_expansion_generators": {"walltime": 16},
   "sage.rings.asymptotic.asymptotic_ring": {"walltime": 8},
-  "sage.rings.asymptotic.asymptotics_multivariate_generating_functions": {"walltime": 32},
-  "sage.rings.asymptotic.term_monoid": {"walltime": 8},
-  "sage.rings.continued_fraction": {"walltime": 8},
+  "sage.rings.asymptotic.asymptotics_multivariate_generating_functions": {"walltime": 8},
   "sage.rings.finite_rings.finite_field_base": {"walltime": 8},
-  "sage.rings.function_field.function_field": {"walltime": 128},
-  "sage.rings.function_field.function_field_valuation": {"walltime": 64},
+  "sage.rings.function_field.function_field": {"walltime": 8},
   "sage.rings.function_field.ideal": {"walltime": 8},
-  "sage.rings.function_field.place": {"walltime": 8},
-  "sage.rings.integer": {"walltime": 64},
-  "sage.rings.invariants.invariant_theory": {"walltime": 8},
-  "sage.rings.number_field.bdd_height": {"walltime": 8},
-  "sage.rings.number_field.number_field": {"walltime": 64},
-  "sage.rings.number_field.number_field_element": {"walltime": 16},
-  "sage.rings.number_field.splitting_field": {"walltime": 8},
-  "sage.rings.number_field.totallyreal": {"walltime": 16},
-  "sage.rings.number_field.totallyreal_rel": {"walltime": 8},
-  "sage.rings.padics.padic_base_leaves": {"walltime": 64},
-  "sage.rings.padics.padic_extension_leaves": {"walltime": 64},
-  "sage.rings.padics.padic_generic_element": {"walltime": 16},
-  "sage.rings.padics.padic_lattice_element": {"walltime": 32},
-  "sage.rings.padics.relative_extension_leaves": {"walltime": 32},
+  "sage.rings.lazy_series": {"walltime": 8},
+  "sage.rings.lazy_series_ring": {"walltime": 32},
+  "sage.rings.number_field.number_field": {"walltime": 32},
+  "sage.rings.number_field.number_field_element": {"walltime": 8},
+  "sage.rings.padics.padic_base_leaves": {"walltime": 8},
+  "sage.rings.padics.padic_generic_element": {"walltime": 8},
   "sage.rings.polynomial.multi_polynomial_ideal": {"walltime": 8},
-  "sage.rings.polynomial.multi_polynomial_sequence": {"walltime": 8},
-  "sage.rings.polynomial.ore_function_element": {"walltime": 8},
   "sage.rings.polynomial.polynomial_element": {"walltime": 16},
-  "sage.rings.polynomial.polynomial_rational_flint": {"walltime": 8},
   "sage.rings.qqbar": {"walltime": 16},
-  "sage.rings.tests": {"walltime": 16},
-  "sage.rings.valuation.augmented_valuation": {"walltime": 32},
-  "sage.rings.valuation.mapped_valuation": {"walltime": 64},
-  "sage.rings.valuation.valuation": {"walltime": 8},
-  "sage.sandpiles.sandpile": {"walltime": 16},
+  "sage.sandpiles.sandpile": {"walltime": 8},
   "sage.schemes.curves.affine_curve": {"walltime": 16},
   "sage.schemes.curves.closed_point": {"walltime": 8},
   "sage.schemes.curves.projective_curve": {"walltime": 32},
-  "sage.schemes.cyclic_covers.cycliccover_finite_field": {"walltime": 64},
   "sage.schemes.elliptic_curves.BSD": {"walltime": 8},
   "sage.schemes.elliptic_curves.Qcurves": {"walltime": 8},
-  "sage.schemes.elliptic_curves.constructor": {"walltime": 32},
-  "sage.schemes.elliptic_curves.ell_curve_isogeny": {"walltime": 16},
-  "sage.schemes.elliptic_curves.ell_egros": {"walltime": 32},
-  "sage.schemes.elliptic_curves.ell_finite_field": {"walltime": 8},
+  "sage.schemes.elliptic_curves.ell_curve_isogeny": {"walltime": 8},
   "sage.schemes.elliptic_curves.ell_generic": {"walltime": 8},
-  "sage.schemes.elliptic_curves.ell_modular_symbols": {"walltime": 16},
-  "sage.schemes.elliptic_curves.ell_number_field": {"walltime": 128},
+  "sage.schemes.elliptic_curves.ell_modular_symbols": {"walltime": 8},
   "sage.schemes.elliptic_curves.ell_point": {"walltime": 8},
-  "sage.schemes.elliptic_curves.ell_rational_field": {"walltime": 128},
-  "sage.schemes.elliptic_curves.gal_reps_number_field": {"walltime": 32},
-  "sage.schemes.elliptic_curves.gp_simon": {"walltime": 16},
-  "sage.schemes.elliptic_curves.heegner": {"walltime": 32},
-  "sage.schemes.elliptic_curves.height": {"walltime": 64},
-  "sage.schemes.elliptic_curves.isogeny_class": {"walltime": 32},
-  "sage.schemes.elliptic_curves.isogeny_small_degree": {"walltime": 64},
-  "sage.schemes.elliptic_curves.kraus": {"walltime": 16},
+  "sage.schemes.elliptic_curves.ell_rational_field": {"walltime": 32},
+  "sage.schemes.elliptic_curves.height": {"walltime": 8},
+  "sage.schemes.elliptic_curves.isogeny_small_degree": {"walltime": 16},
   "sage.schemes.elliptic_curves.mod_sym_num": {"walltime": 8},
   "sage.schemes.elliptic_curves.padic_lseries": {"walltime": 8},
-  "sage.schemes.elliptic_curves.padics": {"walltime": 16},
-  "sage.schemes.elliptic_curves.saturation": {"walltime": 16},
-  "sage.schemes.elliptic_curves.sha_tate": {"walltime": 32},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_finite_field": {"walltime": 64},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_generic": {"walltime": 8},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_padic_field": {"walltime": 32},
-  "sage.schemes.hyperelliptic_curves.monsky_washnitzer": {"walltime": 8},
-  "sage.schemes.projective.projective_rational_point": {"walltime": 8},
-  "sage.schemes.riemann_surfaces.riemann_surface": {"walltime": 64},
+  "sage.schemes.elliptic_curves.padics": {"walltime": 8},
+  "sage.schemes.elliptic_curves.sha_tate": {"walltime": 16},
+  "sage.schemes.hyperelliptic_curves.hyperelliptic_padic_field": {"walltime": 16},
+  "sage.schemes.riemann_surfaces.riemann_surface": {"walltime": 32},
   "sage.schemes.toric.chow_group": {"walltime": 8},
-  "sage.schemes.toric.sheaf.klyachko": {"walltime": 8},
-  "sage.stats.distributions.discrete_gaussian_integer": {"walltime": 8},
-  "sage.stats.time_series": {"walltime": 8},
-  "sage.structure.coerce_dict": {"walltime": 32},
   "sage.structure.element": {"walltime": 16},
-  "sage.structure.sage_object": {"walltime": 8},
   "sage.symbolic.expression": {"walltime": 32},
-  "sage.symbolic.integration.integral": {"walltime": 32},
-  "sage.symbolic.random_tests": {"walltime": 32},
+  "sage.symbolic.integration.integral": {"walltime": 16},
   "sage.symbolic.relation": {"walltime": 8},
-  "sage.tests.book_schilling_zabrocki_kschur_primer": {"walltime": 32},
-  "sage.tests.book_stein_ent": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.combinat_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.float_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.graphique_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.graphtheory_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.integration_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.mpoly_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.nonlinear_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.recequadiff_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.graphique_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.numbertheory_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.polynomes_doctest": {"walltime": 16},
-  "sage.tests.cmdline": {"walltime": 64},
-  "sage.tests.gosper-sum": {"walltime": 16},
-  "sage.tests.parigp": {"walltime": 8},
-  "sage.topology.simplicial_complex": {"walltime": 8},
-  "sage.topology.simplicial_complex_examples": {"walltime": 16}
+  "sage.tests.book_schilling_zabrocki_kschur_primer": {"walltime": 16},
+  "sage.tests.book_stein_ent": {"walltime": 8},
+  "sage.topology.simplicial_complex": {"walltime": 16}
 }
diff --git a/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch b/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
deleted file mode 100644
index f2f825e4fb10..000000000000
--- a/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
+++ /dev/null
@@ -1,205 +0,0 @@
-diff --git a/build/pkgs/singular/checksums.ini b/build/pkgs/singular/checksums.ini
-index 2e33a405d36..313463d2fea 100644
---- a/build/pkgs/singular/checksums.ini
-+++ b/build/pkgs/singular/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=singular-VERSION.tar.gz
--sha1=6c2b622d3681e2de3d58d30c654d43d3e32b720c
--md5=abb1e37c794472e7760655358ab66054
--cksum=17455733
-+sha1=28bb3ee97ef48d04dfa96de182fd93eebe08426c
-+md5=fc0a4f5720dadba45a52ee94324ce00c
-+cksum=1573851737
- upstream_url=ftp://jim.mathematik.uni-kl.de/pub/Math/Singular/SOURCES/4-3-1/singular-VERSION.tar.gz
-diff --git a/build/pkgs/singular/package-version.txt b/build/pkgs/singular/package-version.txt
-index 11300c77e7d..66e2bede53a 100644
---- a/build/pkgs/singular/package-version.txt
-+++ b/build/pkgs/singular/package-version.txt
-@@ -1 +1 @@
--4.3.1p1
-+4.3.1p3
-diff --git a/src/sage/libs/singular/decl.pxd b/src/sage/libs/singular/decl.pxd
-index 8e3ac314b67..747a6b1e2fb 100644
---- a/src/sage/libs/singular/decl.pxd
-+++ b/src/sage/libs/singular/decl.pxd
-@@ -574,7 +574,7 @@ cdef extern from "singular/Singular/libsingular.h":
- 
-     # gets a component out of a polynomial vector
- 
--    poly *pTakeOutComp1(poly **, int)
-+    poly *pTakeOutComp(poly **, int)
- 
-     # deep copy p
- 
-diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx
-index d8ea7b07f3c..3a1271cd59f 100644
---- a/src/sage/libs/singular/singular.pyx
-+++ b/src/sage/libs/singular/singular.pyx
-@@ -1726,20 +1726,21 @@ cdef int overflow_check(unsigned long e, ring *_ring) except -1:
- 
-     Whether an overflow occurs or not partially depends
-     on the number of variables in the ring. See trac ticket
--    :trac:`11856`. With Singular 4, it is by default optimized
--    for at least 4 variables on 64-bit and 2 variables on 32-bit,
--    which in both cases makes a maximal default exponent of
--    2^16-1.
-+    :trac:`11856`.
- 
-     EXAMPLES::
- 
-         sage: P.<x,y> = QQ[]
--        sage: y^(2^16-1)
--        y^65535
--        sage: y^2^16
-+        sage: y^(2^30)
-+        Traceback (most recent call last):             # 32-bit
-+        ...                                            # 32-bit
-+        OverflowError: exponent overflow (1073741824)  # 32-bit
-+        y^1073741824  # 64-bit
-+        sage: y^2^32
-         Traceback (most recent call last):
-         ...
--        OverflowError: exponent overflow (65536)
-+        OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+        OverflowError: exponent overflow (4294967296)  # 64-bit
-     """
-     if unlikely(e > _ring.bitmask):
-         raise OverflowError("exponent overflow (%d)"%(e))
-diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py
-index 7dc058a22f0..71494eddbc0 100644
---- a/src/sage/rings/polynomial/multi_polynomial_ideal.py
-+++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py
-@@ -60,7 +60,7 @@
- Note that the result of a computation is not necessarily reduced::
- 
-     sage: (a+b)^17
--    256*a*b^16 + 256*b^17
-+    a*b^16 + b^17
-     sage: S(17) == 0
-     True
- 
-diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-index 4dad016b33f..9bf67dd1425 100644
---- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-+++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-@@ -193,7 +193,7 @@ from sage.libs.singular.decl cimport (
-     p_IsUnit, p_IsOne, p_Series, p_Head, idInit, fast_map_common_subexp, id_Delete,
-     p_IsHomogeneous, p_Homogen, p_Totaldegree,pLDeg1_Totaldegree, singclap_pdivide, singclap_factorize,
-     idLift, IDELEMS, On, Off, SW_USE_CHINREM_GCD, SW_USE_EZGCD,
--    p_LmIsConstant, pTakeOutComp1, singclap_gcd, pp_Mult_qq, p_GetMaxExp,
-+    p_LmIsConstant, pTakeOutComp, singclap_gcd, pp_Mult_qq, p_GetMaxExp,
-     pLength, kNF, p_Neg, p_Minus_mm_Mult_qq, p_Plus_mm_Mult_qq,
-     pDiff, singclap_resultant, p_Normalize,
-     prCopyR, prCopyR_NoSort)
-@@ -1587,7 +1587,8 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_base):
-             9/4
- 
-             sage: P.monomial_quotient(x,y) # Note the wrong result
--            x*y^65535*z^65535
-+            x*y^65535*z^65535      # 32-bit
-+            x*y^1048575*z^1048575  # 64-bit
- 
-             sage: P.monomial_quotient(x,P(1))
-             x
-@@ -2247,10 +2248,11 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             9/4*x^2 - 1/4*y^2 - y - 1
- 
-             sage: P.<x,y> = PolynomialRing(QQ,order='lex')
--            sage: (x^2^15) * x^2^15
-+            sage: (x^2^32) * x^2^32
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (...)
-+            OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+            OverflowError: exponent overflow (...)  # 64-bit
-         """
-         # all currently implemented rings are commutative
-         cdef poly *_p
-@@ -2371,10 +2373,11 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             ValueError: not a 2nd power
- 
-             sage: P.<x,y> = PolynomialRing(QQ,order='lex')
--            sage: (x+y^2^15)^10
-+            sage: (x+y^2^32)^10
-             Traceback (most recent call last):
-             ....
--            OverflowError: exponent overflow (...)
-+            OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+            OverflowError: exponent overflow (...)  # 64-bit
- 
-         Test fractional powers (:trac:`22329`)::
- 
-@@ -3461,7 +3464,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             x^10000
-             no overflow
- 
--            sage: n = 1000
-+            sage: n = 100000
-             sage: try:
-             ....:     f = x^n
-             ....:     f.subs(x = x^n)
-@@ -4567,7 +4570,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
-         l = []
-         for i from 0 <= i < IDELEMS(res):
-             for j from 1 <= j <= IDELEMS(_I):
--                l.append( new_MP(parent, pTakeOutComp1(&res.m[i], j)) )
-+                l.append( new_MP(parent, pTakeOutComp(&res.m[i], 1)) )
- 
-         id_Delete(&fI, r)
-         id_Delete(&_I, r)
-@@ -4635,7 +4638,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
- 
-             sage: f = 3*x
-             sage: f.reduce([2*x,y])
--            3*x
-+            x
- 
-         The reduction is not canonical when ``I`` is not a Groebner
-         basis::
-diff --git a/src/sage/rings/polynomial/plural.pyx b/src/sage/rings/polynomial/plural.pyx
-index 1c9f35e56ba..587511c3888 100644
---- a/src/sage/rings/polynomial/plural.pyx
-+++ b/src/sage/rings/polynomial/plural.pyx
-@@ -1619,10 +1619,10 @@ cdef class NCPolynomial_plural(RingElement):
-             sage: P = A.g_algebra(relations={y*x:-x*y + z},  order='lex')
-             sage: P.inject_variables()
-             Defining x, z, y
--            sage: (x^2^15) * x^2^15
-+            sage: (x^2^31) * x^2^31
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (65536)
-+            OverflowError: exponent overflow (2147483648)
-         """
-         # all currently implemented rings are commutative
-         cdef poly *_p
-@@ -1689,10 +1689,10 @@ cdef class NCPolynomial_plural(RingElement):
-             sage: P = A.g_algebra(relations={y*x:-x*y + z},  order='lex')
-             sage: P.inject_variables()
-             Defining x, z, y
--            sage: (x+y^2^15)^10
-+            sage: (x+y^2^31)^10
-             Traceback (most recent call last):
-             ....
--            OverflowError: exponent overflow (327680)
-+            OverflowError: exponent overflow (2147483648)
-         """
-         if type(exp) is not Integer:
-             try:
-diff --git a/src/sage/structure/element.pyx b/src/sage/structure/element.pyx
-index b5d83ef71b6..5c45b3fb528 100644
---- a/src/sage/structure/element.pyx
-+++ b/src/sage/structure/element.pyx
-@@ -2705,10 +2705,10 @@ cdef class RingElement(ModuleElement):
-         with Singular 4::
- 
-             sage: K.<x,y> = ZZ[]
--            sage: (x^12345)^54321
-+            sage: (x^123456)^654321
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (670592745)
-+            OverflowError: exponent overflow (...)
-         """
-         return arith_generic_power(self, n)
- 
diff --git a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch b/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
deleted file mode 100644
index ee0f0e656b28..000000000000
--- a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py
-index d5f7157217f..8ca1f958039 100644
---- a/src/sage/rings/number_field/number_field_ideal.py
-+++ b/src/sage/rings/number_field/number_field_ideal.py
-@@ -996,16 +996,38 @@ def is_prime(self):
-             False
-             sage: K.ideal(17).is_prime()  # ramified
-             False
-+
-+        TESTS:
-+
-+        Check that we do not factor the norm of the ideal, this used
-+        to take half an hour, see :trac:`33360`::
-+
-+            sage: K.<a,b,c> = NumberField([x^2-2,x^2-3,x^2-5])
-+            sage: t = (((-2611940*c + 1925290/7653)*b - 1537130/7653*c
-+            ....:       + 10130950)*a + (1343014/7653*c - 8349770)*b
-+            ....:       + 6477058*c - 2801449990/4002519)
-+            sage: t.is_prime()
-+            False
-         """
-         try:
-             return self._pari_prime is not None
-         except AttributeError:
--            F = self.factor()  # factorization with caching
--            if len(F) != 1 or F[0][1] != 1:
--                self._pari_prime = None
--            else:
--                self._pari_prime = F[0][0]._pari_prime
--            return self._pari_prime is not None
-+            pass
-+
-+        K = self.number_field().pari_nf()
-+        I = self.pari_hnf()
-+
-+        candidate = K.idealismaximal(I) or None
-+
-+        # PARI uses probabilistic primality testing inside idealismaximal().
-+        if get_flag(None, 'arithmetic'):
-+            # proof required, check using isprime()
-+            if candidate and not candidate[0].isprime():
-+                candidate = None
-+
-+        self._pari_prime = candidate
-+
-+        return self._pari_prime is not None
- 
-     def pari_prime(self):
-         r"""
diff --git a/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch b/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
deleted file mode 100644
index 91f06fd4d173..000000000000
--- a/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-diff --git a/src/sage/misc/persist.pyx b/src/sage/misc/persist.pyx
-index 3ac5f1cc2b0..cb1f327c199 100644
---- a/src/sage/misc/persist.pyx
-+++ b/src/sage/misc/persist.pyx
-@@ -157,7 +157,7 @@ def load(*filename, compress=True, verbose=True, **kwargs):
-         ....:     _ = f.write(code)
-         sage: load(t)
-         sage: hello
--        <fortran object>
-+        <fortran ...>
-     """
-     import sage.repl.load
-     if len(filename) != 1:
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index 6f0aeab87ae..b77c69b2f77 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -461,6 +461,8 @@ def complex_to_rgb(z_values, contoured=False, tiled=False,
-             rgb[i, j, 2] = b
- 
-     sig_off()
-+    nan_indices = np.isnan(rgb).any(-1)     # Mask for undefined points
-+    rgb[nan_indices] = 1                    # Make nan_indices white
-     return rgb
- 
- 
-diff --git a/src/sage/plot/histogram.py b/src/sage/plot/histogram.py
-index 3bc2b76b58e..388c2d1391d 100644
---- a/src/sage/plot/histogram.py
-+++ b/src/sage/plot/histogram.py
-@@ -87,13 +87,8 @@ def get_minmax_data(self):
- 
-         TESTS::
- 
--            sage: h = histogram([10,3,5], normed=True)[0]
--            doctest:warning...:
--            DeprecationWarning: the 'normed' option is deprecated. Use 'density' instead.
--            See https://trac.sagemath.org/25260 for details.
-+            sage: h = histogram([10,3,5], density=True)[0]
-             sage: h.get_minmax_data()
--            doctest:warning ...
--            ...VisibleDeprecationWarning: Passing `normed=True` on non-uniform bins has always been broken, and computes neither the probability density function nor the probability mass function. The result is only correct if the bins are uniform, when density=True will produce the same result anyway. The argument will be removed in a future version of numpy.
-             {'xmax': 10.0, 'xmin': 3.0, 'ymax': 0.476190476190..., 'ymin': 0}
-         """
-         import numpy
-diff --git a/src/sage/repl/ipython_extension.py b/src/sage/repl/ipython_extension.py
-index 798671aab42..cad6a47ca8b 100644
---- a/src/sage/repl/ipython_extension.py
-+++ b/src/sage/repl/ipython_extension.py
-@@ -405,7 +405,7 @@ def fortran(self, line, cell):
-             ....: C END FILE FIB1.F
-             ....: ''')
-             sage: fib
--            <fortran object>
-+            <fortran ...>
-             sage: from numpy import array
-             sage: a = array(range(10), dtype=float)
-             sage: fib(a, 10)
diff --git a/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch b/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
deleted file mode 100644
index 2769e87f6a4b..000000000000
--- a/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-diff --git a/src/sage/interfaces/tachyon.py b/src/sage/interfaces/tachyon.py
-index 23671e50892..ce1d50f71bc 100644
---- a/src/sage/interfaces/tachyon.py
-+++ b/src/sage/interfaces/tachyon.py
-@@ -683,12 +683,14 @@
- #*****************************************************************************
- 
- import os
-+import re
- 
- from sage.cpython.string import bytes_to_str
- from sage.misc.pager import pager
- from sage.misc.superseded import deprecation
- from sage.misc.temporary_file import tmp_filename
- from sage.structure.sage_object import SageObject
-+from sage.misc.cachefunc import cached_method
- 
- 
- class TachyonRT(SageObject):
-@@ -799,6 +801,11 @@ def __call__(self, model, outfile='sage.png', verbose=1, extra_opts=''):
-             Parser failed due to an input file syntax error.
-             Aborting render.
-         """
-+        if self.version() >= '0.99.2':
-+            # this keyword was changed in 0.99.2
-+            model = model.replace(
-+                    "              focallength ",
-+                    "              focaldist ")
-         modelfile = tmp_filename(ext='.dat')
-         with open(modelfile, 'w') as file:
-             file.write(model)
-@@ -851,6 +858,25 @@ def usage(self, use_pager=True):
-         else:
-             print(r)
- 
-+    @cached_method
-+    def version(self):
-+        """
-+        Returns the version of the Tachyon raytracer being used.
-+
-+        TESTS::
-+
-+            sage: tachyon_rt.version()  # random
-+            0.98.9
-+            sage: tachyon_rt.version() >= '0.98.9'
-+            True
-+        """
-+        with os.popen('tachyon') as f:
-+            r = f.readline()
-+        res = re.search(r"Version ([\d.]*)", r)
-+        # debian patches tachyon so it won't report the version
-+        # we hardcode '0.99' since that's indeed the version they ship
-+        return res[1] if res else '0.99'
-+
-     def help(self, use_pager=True):
-         """
-         Deprecated: type 'sage.interfaces.tachyon?' for help
diff --git a/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch b/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
deleted file mode 100644
index 11eb20d4f735..000000000000
--- a/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff --git a/src/sage/arith/long.pxd b/src/sage/arith/long.pxd
-index 1c9a53387a0..d96b98f247c 100644
---- a/src/sage/arith/long.pxd
-+++ b/src/sage/arith/long.pxd
-@@ -270,6 +270,17 @@ cdef inline bint integer_check_long_py(x, long* value, int* err):
-         sage: L += [-x for x in L] + [0, long_min()]
-         sage: for v in L:
-         ....:     assert check_long_py(int(v)) == v
-+        sage: check_long_py(int(2^60))
-+        1152921504606846976                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^61))
-+        2305843009213693952                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^62))
-+        4611686018427387904                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^63))
-+        'Overflow (...)'
-         sage: check_long_py(int(2^100))
-         'Overflow (...)'
-         sage: check_long_py(int(long_max() + 1))
-@@ -309,7 +320,12 @@ cdef inline bint integer_check_long_py(x, long* value, int* err):
- 
-     cdef long lead
-     cdef long lead_2_overflow = (<long>1) << (BITS_IN_LONG - PyLong_SHIFT)
--    cdef long lead_3_overflow = (<long>1) << (BITS_IN_LONG - 2 * PyLong_SHIFT)
-+    cdef long lead_3_overflow
-+    if BITS_IN_LONG < 2 * PyLong_SHIFT:
-+        # in this case 3 digit is always overflow
-+        lead_3_overflow = 0
-+    else:
-+        lead_3_overflow = (<long>1) << (BITS_IN_LONG - 2 * PyLong_SHIFT)
-     if size == 0:
-         value[0] = 0
-         err[0] = 0
diff --git a/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch b/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
deleted file mode 100644
index c4d7d5c779d1..000000000000
--- a/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/src/sage/schemes/toric/sheaf/klyachko.py b/src/sage/schemes/toric/sheaf/klyachko.py
-index b1304a16913..77fae4b7545 100644
---- a/src/sage/schemes/toric/sheaf/klyachko.py
-+++ b/src/sage/schemes/toric/sheaf/klyachko.py
-@@ -26,7 +26,7 @@
-     (0, 0, 18, 16, 1)
-     sage: Gtilde = G_sum.random_deformation()
-     sage: V = Gtilde.wedge(2) * K                     # long time
--    sage: V.cohomology(dim=True, weight=(0,0,0,0))    # long time
-+    sage: V.cohomology(dim=True, weight=(0,0,0,0))    # long time  # random failure (see #32773)
-     (0, 0, 3, 0, 0)
- 
- REFERENCES:
-@@ -948,7 +948,7 @@ def random_deformation(self, epsilon=None):
-            sage: V.cohomology(dim=True, weight=(0,))
-            (1, 0)
-            sage: Vtilde = V.random_deformation()
--           sage: Vtilde.cohomology(dim=True, weight=(0,))
-+           sage: Vtilde.cohomology(dim=True, weight=(0,))  # random failure (see #32773)
-            (1, 0)
-         """
-         filt = self._filt.random_deformation(epsilon)
diff --git a/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch b/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
deleted file mode 100644
index d9a9835c696b..000000000000
--- a/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 9ac7840134054155545e24fa3e66402d42b91c0f Mon Sep 17 00:00:00 2001
-From: Antonio Rojas <arojas@archlinux.org>
-Date: Fri, 20 Jan 2023 21:36:27 +0100
-Subject: [PATCH] Fix tests with giac 1.9.0.35
-
----
- src/sage/libs/giac/giac.pyx   |  3 +--
- src/sage/symbolic/relation.py | 15 +++++----------
- 2 files changed, 6 insertions(+), 12 deletions(-)
-
-diff --git a/src/sage/libs/giac/giac.pyx b/src/sage/libs/giac/giac.pyx
-index 4e451dba5e7..ccad5169836 100644
---- a/src/sage/libs/giac/giac.pyx
-+++ b/src/sage/libs/giac/giac.pyx
-@@ -374,8 +374,7 @@ def _giac(s):
- 
-         sage: x = libgiac('x')
-         sage: (1+2*sin(3*x)).solve(x).simplify()
--        Warning, argument is not an equation, solving 1+2*sin(3*x)=0
--        list[-pi/18,7*pi/18]
-+        ...list[-pi/18,7*pi/18]
- 
-         sage: libgiac.solve('sin(3*x)>2*sin(x)',x)
-         Traceback (most recent call last):
-diff --git a/src/sage/symbolic/relation.py b/src/sage/symbolic/relation.py
-index e9dbc0fea30..b8896a94be9 100644
---- a/src/sage/symbolic/relation.py
-+++ b/src/sage/symbolic/relation.py
-@@ -935,8 +935,7 @@ def solve(f, *args, **kwds):
- 
-         sage: f = (sin(x) - 8*cos(x)*sin(x))*(sin(x)^2 + cos(x)) - (2*cos(x)*sin(x) - sin(x))*(-2*sin(x)^2 + 2*cos(x)^2 - cos(x))
-         sage: solve(f, x, algorithm='giac')
--        ...
--        [-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-+        ...[-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
- 
-         sage: x, y = SR.var('x,y')
-         sage: solve([x+y-4,x*y-3],[x,y],algorithm='giac')
-@@ -1440,19 +1439,15 @@ def _giac_solver(f, x, solution_dict=False):
-     EXAMPLES::
- 
-         sage: solve([(2/3)^x-2], [x], algorithm='giac')
--        ...
--        [[-log(2)/(log(3) - log(2))]]
-+        ...[[-log(2)/(log(3) - log(2))]]
-         sage: solve([(2/3)^x-2], [x], algorithm='giac', solution_dict=True)
--        ...
--        [{x: -log(2)/(log(3) - log(2))}]
-+        ...[{x: -log(2)/(log(3) - log(2))}]
- 
-         sage: f = (sin(x) - 8*cos(x)*sin(x))*(sin(x)^2 + cos(x)) - (2*cos(x)*sin(x) - sin(x))*(-2*sin(x)^2 + 2*cos(x)^2 - cos(x))
-         sage: solve(f, x, algorithm='giac')
--        ...
--        [-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-+        ...[-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-         sage: solve(f, x, algorithm='giac', solution_dict=True)
--        ...
--        [{x: -2*arctan(sqrt(2))}, {x: 0}, {x: 2*arctan(sqrt(2))}, {x: pi}]
-+        ...[{x: -2*arctan(sqrt(2))}, {x: 0}, {x: 2*arctan(sqrt(2))}, {x: pi}]
- 
-         sage: x, y = SR.var('x,y')
-         sage: solve([x+y-7,x*y-10],[x,y],algorithm='giac')
diff --git a/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch b/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
deleted file mode 100644
index 499e0c71e256..000000000000
--- a/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
+++ /dev/null
@@ -1,1303 +0,0 @@
-diff --git a/build/pkgs/gap/checksums.ini b/build/pkgs/gap/checksums.ini
-index 066e943308a..b0ea8ba8818 100644
---- a/build/pkgs/gap/checksums.ini
-+++ b/build/pkgs/gap/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=gap-VERSION.tar.gz
--sha1=4ecdd281b8f430282fb9b12690b06e0a26abde10
--md5=85dc9e459d5b6c66fcad9f468afd3e3e
--cksum=1351843158
-+sha1=a6e36f3f874a2c46f51561402634497eab705cca
-+md5=c5cd9f272f2703d7a3649ad7193b2d90
-+cksum=2760477284
- upstream_url=https://github.com/gap-system/gap/releases/download/vVERSION/gap-VERSION.tar.gz
-diff --git a/build/pkgs/gap/package-version.txt b/build/pkgs/gap/package-version.txt
-index d782fca8f64..f1cd7de1de5 100644
---- a/build/pkgs/gap/package-version.txt
-+++ b/build/pkgs/gap/package-version.txt
-@@ -1 +1 @@
--4.11.1
-+4.12.2
-diff --git a/build/pkgs/gap/spkg-check.in b/build/pkgs/gap/spkg-check.in
-index d9791d33293..d2fccda6e04 100644
---- a/build/pkgs/gap/spkg-check.in
-+++ b/build/pkgs/gap/spkg-check.in
-@@ -3,6 +3,13 @@ cd src
- # #28728: Fix test failure in tst/testinstall/strings.tst
- export LC_CTYPE=en_US.UTF-8
- 
-+# #34391: in GAP 4.12 some packages need GAP package io
-+#         to let tests run, otherwise this hangs. Thus we install io here.
-+cd pkg/io
-+./configure --with-gaproot=../..
-+make
-+cd ../..
-+
- make testinstall
- if [[ $? -ne 0 ]]; then
-     exit 1
-diff --git a/build/pkgs/gap/spkg-install.in b/build/pkgs/gap/spkg-install.in
-index 2ceadf99db4..e2c8b4dca54 100644
---- a/build/pkgs/gap/spkg-install.in
-+++ b/build/pkgs/gap/spkg-install.in
-@@ -8,8 +8,7 @@ export CFLAGS=$CFLAGS_NON_NATIVE
- export CXXFLAGS=$CXXFLAGS_NON_NATIVE
- 
- GAP_BUILD_ROOT="$(pwd)"
--GAP_ROOT="$SAGE_LOCAL/share/gap"
--DESTDIR_GAP_ROOT="$SAGE_DESTDIR$GAP_ROOT"
-+GAP_ROOT="$SAGE_LOCAL/lib/gap"
- 
- # Enable debug info if requested.
- # Note that -g3 allows you to use preprocessor macros in gdb which are widely used
-@@ -17,37 +16,17 @@ if [ "$SAGE_DEBUG" = yes ] ; then
-     export CFLAGS="-O0 -g3 -DDEBUG_MASTERPOINTERS -DDEBUG_GLOBAL_BAGS -DDEBUG_FUNCTIONS_BAGS $CFLAGS"
- fi
- 
--sdh_configure $SAGE_CONFIGURE_GMP
--sdh_make -j1
-+# LDFLAGS hack below needed by Semigroups package
-+sdh_configure $SAGE_CONFIGURE_GMP LDFLAGS="-pthread" --prefix=$SAGE_LOCAL
-+sdh_make
- 
--# GAP's "make install" is work in progress; we use bits and pieces of it
--# but we install many things manually.
--sdh_make install-headers install-libgap
--
--# Install config.h, which is not currently handled by `make install-headers`
--sdh_install gen/config.h "$SAGE_LOCAL/include/gap"
--
--# Now install the gap executable as "gap-bin"; it will be called normally
--# through our wrapper script that sets the appropriate GAP_ROOT
--SAGE_BIN="$SAGE_LOCAL/bin"
--mkdir -p "$SAGE_DESTDIR$SAGE_BIN" || sdh_die "Failed to create the directory $SAGE_BIN"
--
--./libtool --mode=install install gap "$SAGE_DESTDIR$SAGE_BIN/gap-bin" || \
--    sdh_die "Failed to install gap-bin to $SAGE_BIN"
--
--./libtool --mode=install install gac "$SAGE_DESTDIR$SAGE_BIN/gac" || \
--    sdh_die "Failed to install gac to $SAGE_BIN"
--
--# Now copy additional files GAP needs to run (and a few optional bits) into
--# GAP_ROOT; we don't need everything from the source tree
--sdh_install bin doc gen grp lib src tst sysinfo.gap "$GAP_ROOT"
--
--# GAP's copy of libtool is also used by the toolchain for build GAP packages
--# (i.e. by gac)
--sdh_install libtool "$GAP_ROOT"
-+sdh_make_install
-+# sdh_make install-headers install-libgap
-+# The 'packagemanager' package expects this https://github.com/gap-packages/PackageManager/issues/105
-+mkdir -p "$SAGE_LOCAL/lib/gap/bin"
- 
- # Install only the minimal packages GAP needs to run
--sdh_install pkg/GAPDoc-* pkg/primgrp-* pkg/SmallGrp-* pkg/transgrp "$GAP_ROOT"/pkg
-+sdh_install pkg/gapdoc pkg/primgrp pkg/smallgrp pkg/transgrp "$GAP_ROOT"/pkg
- 
- # Install additional packages that are not strictly required, but that are
- # typically "expected" to be loaded: These are the default packages that are
-@@ -58,50 +37,25 @@ sdh_install pkg/GAPDoc-* pkg/primgrp-* pkg/SmallGrp-* pkg/transgrp "$GAP_ROOT"/p
- # Also include atlasrep which is a dependency of tomlib
- sdh_install \
-     pkg/atlasrep \
--    pkg/autpgrp-* \
--    pkg/alnuth-* \
--    pkg/crisp-* \
--    pkg/ctbllib-* \
--    pkg/FactInt-* \
-+    pkg/autodoc \
-+    pkg/autpgrp \
-+    pkg/alnuth \
-+    pkg/crisp \
-+    pkg/ctbllib \
-+    pkg/factint \
-     pkg/fga \
--    pkg/irredsol-* \
--    pkg/laguna-* \
--    pkg/PackageManager-* \
--    pkg/polenta-* \
--    pkg/polycyclic-* \
--    pkg/resclasses-* \
--    pkg/sophus-* \
--    pkg/tomlib-* \
-+    pkg/irredsol \
-+    pkg/laguna \
-+    pkg/packagemanager \
-+    pkg/polenta \
-+    pkg/polycyclic \
-+    pkg/radiroot \
-+    pkg/resclasses \
-+    pkg/sophus \
-+    pkg/tomlib \
-+    pkg/utils \
-     "$GAP_ROOT"/pkg
- 
--# Install the GAP startup script; ensure it is executable
--sdh_install -T ../gap "$SAGE_BIN/gap"
--chmod +x "$SAGE_DESTDIR$SAGE_BIN/gap"
--
--# Create symlinks under $GAP_ROOT for these executables, as they are expected
--# (especially when building kernel packages) to exist
--ln -sf "../../bin/gap-bin" "$DESTDIR_GAP_ROOT/gap"
--ln -sf "../../bin/gac" "$DESTDIR_GAP_ROOT/gac"
--
--# Fix the $GAP_ROOT/bin/<arch>/src symlink to be relative (otherwise it links
--# to the actual path of the sources GAP was compiled from)
--for srclink in "$DESTDIR_GAP_ROOT"/bin/*/src; do
--    rm -f "$srclink"
--    ln -s "../../src" "$srclink"
--done
--
--# Additional fixups for some files after they have been copied into their
--# destination directory.  gac and sysinfo.gap are generated files that contain
--# in them hard-coded references to the GAP build directory, which will soon
--# be going away.  This breaks the build toolchain for some compiled GAP
--# packages.  We need to replace these paths with the final GAP_ROOT path.  The
--# below will work so long as neither of these paths contain '|', and if they do
--# then god help you.  https://trac.sagemath.org/ticket/27218
--sed -i -e "s|$GAP_BUILD_ROOT|$GAP_ROOT|g" \
--    "$SAGE_DESTDIR$SAGE_BIN/gac" "$DESTDIR_GAP_ROOT/sysinfo.gap" \
--    "$DESTDIR_GAP_ROOT/bin/gap.sh" "$DESTDIR_GAP_ROOT/doc/make_doc" || \
--    sdh_die "Failed to fix up hard-coded paths in GAP build tools."
--
- # TODO: This seems unnecessary--we are already installing all of doc/ to
- # GAP_ROOT, which is necessary for some functionality in GAP to work.  Do
- # we need this?  Maybe doc/gap could just be a symlink to gap/doc??
-diff --git a/build/pkgs/gap/spkg-legacy-uninstall b/build/pkgs/gap/spkg-legacy-uninstall
-index d17eb939eb7..a8e5c59e1fb 100755
---- a/build/pkgs/gap/spkg-legacy-uninstall
-+++ b/build/pkgs/gap/spkg-legacy-uninstall
-@@ -4,6 +4,8 @@ rm -rf "$SAGE_LOCAL/gap/gap-4."*
- rm -rf "$SAGE_SHARE/gap"
- rm -f "$SAGE_LOCAL/gap/latest"
- rm -f "$SAGE_LOCAL/bin/gap"
-+rm -f "$SAGE_LOCAL/bin/gac"
- 
--# Remove old libgap headers
-+# Remove old libgap headers and library
- rm -rf "$SAGE_LOCAL/include/gap"
-+rm -rf "$SAGE_LOCAL/lib/gap"
-diff --git a/build/pkgs/gap/spkg-prerm.in b/build/pkgs/gap/spkg-prerm.in
-deleted file mode 100644
-index 661d92621fa..00000000000
---- a/build/pkgs/gap/spkg-prerm.in
-+++ /dev/null
-@@ -1,6 +0,0 @@
--# These generated files are placed in directory provided by the SPKG, so
--# delete the generated files first so that their parent directories can be
--# removed during installation
--GAP_ROOT="$SAGE_LOCAL/share/gap"
--rm -f "$GAP_ROOT/pkg/atlasrep/datagens/"*.*
--rm -f "$GAP_ROOT/pkg/atlasrep/dataword/"*.*
-diff --git a/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch b/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch
-deleted file mode 100644
-index e45fe7d9c6f..00000000000
---- a/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch
-+++ /dev/null
-@@ -1,150 +0,0 @@
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c b/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--index 3bbdc45..7df699f 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--@@ -8,9 +8,8 @@ extern short sp[],**mat[],*psp[],**imcos[],**cpco[],lorb[],
-- short *cst,**cpst,***cdpst,**svptr,*cp,*rel;
-- short *spst,**pspst,**pptr,**cpptr,npt,nb,nph,nph2,npg,npg2,
--       rno,orno,coh_index,*invg;
---FILE  *ip,*op;
-- 
---void seeknln (void) { while (getc(ip)!='\n'); }
--+void seeknln (FILE *ip) { while (getc(ip)!='\n'); }
-- 
-- /* This program differs from most other permutation programs in that perms are
--    all stored in the single array sp. Schreier vectors are stored in the short
--@@ -23,13 +22,14 @@ void seeknln (void) { while (getc(ip)!='\n'); }
-- int 
-- crprog1 (void)
-- { short *pc,*qc,ex,neg; int x;
--+  FILE  *ip,*op;
--   short i,j,k,l,m,n,cl,rl,*p,ocl,im,pt,pt1,pn,ipt;
--   if ((ip=fopen(inf2,"r"))== 0)
--   { fprintf(stderr,"Cannot open %s.\n",inf2); return(-1);}
--   fscanf(ip,"%hd%hd%hd%hd",&npt,&nph,&nb,&k);
--   if (nb>=mb) {fprintf(stderr,"nb too big. Increase MB.\n"); return(-1);}
--   if (k<=2) {fprintf(stderr,"inf2 has illegal format.\n"); return(-1); }
---  seeknln(); seeknln();
--+  seeknln(ip); seeknln(ip);
--   for (i=1;i<=nb;i++) fscanf(ip,"%hd",lorb+i);
--   pptr=psp-1; pspst=psp+nph; svptr=cpsp-1;  cpst=cpsp+nb;
--   invg=sp; nph2=2*nph; spst=sp+nph2;
--@@ -37,7 +37,7 @@ crprog1 (void)
--   { pptr[i]=spst+(i-1)*npt-1; p=pptr[i];
--     for (j=1;j<=npt;j++) {fscanf(ip,"%hd",&k); p[k]=j; }
--     invg[2*i-2]=2*i-1; invg[2*i-1]=2*i-2;
---    seeknln();
--+    seeknln(ip);
--   }
--   spst+=(npt*nph);
--   for (i=1;i<=nb;i++)
--@@ -75,7 +75,7 @@ crprog1 (void)
--   strcpy(inf1,inf0); strcat(inf1,".rel");
--   if ((ip=fopen(inf1,"r"))==0)
--   { fprintf(stderr,"Cannot open %s.\n",inf1); return(-1);}
---  fscanf(ip,"%hd%hd",&k,&rno); seeknln();
--+  fscanf(ip,"%hd%hd",&k,&rno); seeknln(ip);
--   op=fopen(outft,"w");
-- /* Now we have read everything in, and the computation can start */
--   orno=0;
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--index a7396b2..658496f 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--@@ -20,8 +20,6 @@ short  mexp=MEXP,mcl=MCL,no,rel[RSP],wt[MEXP],exp,*rpf,*rpb,
-- extern short  prime,dim,*spv,**spm,mspace[],*vec[],**mat[],cp[],pinv[],opmats,
--         mm,mv;
-- extern int msp;
---FILE *ip,*op;
---
-- 
-- int 
-- calcmats (void)
--@@ -59,7 +57,7 @@ calcmats (void)
--   }
--   for (i=1;i<=exp;i++) trans(mat[i+exp],mat[i]);
--   if (opmats)
---  { op=fopen(outf,"w");
--+  { FILE *op=fopen(outf,"w");
--     fprintf(op,"%4d%4d%4d\n",prime,dim,exp);
--     for (i=1;i<=exp;i++) printmat(mat[i]); 
--     fclose(op);
--@@ -71,6 +69,7 @@ int
-- rdmats (void)
-- /* reads matrices of generators of P */
-- { short i; int quot;
--+  FILE *ip;
--   ip=fopen(inf4,"r");
--   if (ip==0)
--   { fprintf(stderr,"Cannot open %s\n ",inf4); return(-1); }
--@@ -90,12 +89,12 @@ rdmats (void)
--   fclose(ip);
--   return(0);
-- }
---FILE *ip;
-- 
-- int 
-- ingp (int inp)
-- /* Read in output of respcrun -s */
-- { short i,j,k,l,m,*orpf,**pcp;
--+  FILE *ip;
--   ip=fopen(inf3,"r");
--   if (ip==0) { fprintf(stderr,"Cannot open %s\n",inf3); return(-1); }
--   fscanf(ip,"%hd%hd%hd%hd%hd%hd",&prime,&exp,&i,&no,&j,&m);
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--index 0896551..6841bc8 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--@@ -9,7 +9,6 @@ extern short  intexp,mexp,mng,wksp,
--        spugen[],*tlintg[];
-- extern int ptrsp,rsp;
-- short  fac;
---FILE *ip,*op;
-- 
-- int 
-- ingp (void)
--@@ -18,6 +17,7 @@ ingp (void)
--    of nqrun, and tails are also read in.
-- */
-- { short i,j,k,l,m,x,y,no,*orpf,*orpb,**pcp;  char tails;
--+  FILE *ip;
--   if ((ip=fopen(inf1,"r"))==0)
--   { fprintf(stderr,"Cannot open %s.\n",inf1); return(-1); }
--   fscanf(ip,"%hd%hd%hd%hd%hd%hd",&prime,&exp,&nng,&no,&class,&m);
--@@ -89,6 +89,7 @@ int
-- outgp (void)
-- /* The PCP is output, together with tails */
-- { short i,k,l,**pcp,*b,*e,*c;
--+  FILE *op;
--   op=fopen(outf,"w");
--   fprintf(op,"%4d%4d%4d%4d%4d%4d\n",prime,exp,nng,exp,class,1);
--   for (i=1;i<=exp;i++) fprintf(op,"%4d",wt[i]); fprintf(op,"\n");
--@@ -379,7 +380,7 @@ restart:
--     nng--; mnng--; enexpnt--;
--     if (nng==0)
--     { if (gap)
---      { op=fopen(outfm,"w"); fprintf(op,"COHOMOLO.Multiplier:=[];\n");
--+      { FILE *op=fopen(outfm,"w"); fprintf(op,"COHOMOLO.Multiplier:=[];\n");
--         fclose(op);
--         printf("All new generators eliminated. Multiplier is trivial.\n");
--       }
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--index 01cf914..0144883 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--@@ -9,7 +9,6 @@ extern short  intexp,mng,mexp,wksp,
--        spugen[],*intg[],*imintg[],*tlintg[];
-- extern int ptrsp,rsp;
-- short  *wf,*wc; char norm;
---FILE *ip,*op;
-- 
-- /* The data structures for this program and for nqrun are similar.
--    d1 and d2 contain definitions of generators. (Def. comes from commutator
--@@ -35,6 +34,7 @@ nqmprog (void)
-- { short i,j,k,l,m,d,*gi,*gj,*ti,*tj,cl,def,*ps,*pf,**dp,*nrpb,*p,*orpf,*orpb,
--         nb,np,k1,*rno,*covrel,**pgen,tdef,sgn;
--   char nt;
--+  FILE *ip,*op;
--   if (ingp() == -1) {fprintf(stderr,"Input error.\n"); return(-1); }
--   eexpnt=expnt+exp; enexpnt=nexpnt+nng;
-- 
-diff --git a/build/pkgs/gap_packages/patches/guava_leon_includes.patch b/build/pkgs/gap_packages/patches/guava_leon_includes.patch
-deleted file mode 100644
-index cdcd19cc3e8..00000000000
---- a/build/pkgs/gap_packages/patches/guava_leon_includes.patch
-+++ /dev/null
-@@ -1,13 +0,0 @@
----- a/pkg/guava-3.15/src/leon/src/generate.c	Sat Feb 29 09:02:10 2020
----- b/pkg/guava-3.15/src/leon/src/generate.c	Thu Sep 24 13:58:36 2020
--***************
--*** 115,120 ****
----- 115,122 ----
--  #include "groupio.h"
--  #include "enum.h"
--  #include "storage.h"
--+ #include "chbase.h"
--+ #include "inform.h"
--  
--  #ifdef ALT_TIME_HEADER
--  #include "cputime.h"
-diff --git a/build/pkgs/gap_packages/spkg-install.in b/build/pkgs/gap_packages/spkg-install.in
-index 168e6b11532..6dff182a48f 100644
---- a/build/pkgs/gap_packages/spkg-install.in
-+++ b/build/pkgs/gap_packages/spkg-install.in
-@@ -1,4 +1,4 @@
--GAP_ROOT="$SAGE_LOCAL/share/gap"
-+GAP_ROOT="$SAGE_LOCAL/lib/gap"
- PKG_DIR="$GAP_ROOT/pkg"
- 
- PKG_SRC_DIR="$(pwd)/src/pkg"
-@@ -11,33 +11,31 @@ cd "$PKG_SRC_DIR"
- #    (GAP 4.8.6 still had it, but this is gone in 4.10)
- 
- sdh_install \
--    aclib-* \
--    AutoDoc-* \
--    corelg-* \
--    crime-* \
-+    aclib \
-+    corelg \
-+    crime \
-     cryst \
-     crystcat \
--    design-* \
-+    design \
-     gbnp \
--    genss-* \
--    hap-* \
--    hapcryst-* \
--    hecke-* \
--    images-* \
--    liealgdb-* \
--    liepring-* \
--    liering-* \
--    loops-* \
--    MapClass-* \
--    polymaking-* \
--    qpa-* \
--    quagroup-* \
--    radiroot-* \
--    repsn-* \
--    sla-* \
--    sonata-* \
--    Toric-* \
--    utils-* \
-+    genss \
-+    hap \
-+    hapcryst \
-+    hecke \
-+    images \
-+    liealgdb \
-+    liepring \
-+    liering \
-+    loops \
-+    mapclass \
-+    polymaking \
-+    qpa \
-+    quagroup \
-+    repsn \
-+    singular \
-+    sla \
-+    sonata \
-+    toric \
-     "$PKG_DIR"
- 
- install_compiled_pkg()
-@@ -45,27 +43,23 @@ install_compiled_pkg()
-     local pkg="$1"
-     # Install the bin/ dir (where compiled modules should end up)
-     # under <prefix>/lib/gap; we then symlink to it later
--    sdh_install bin "$SAGE_LOCAL/lib/gap/pkg/$pkg"
-+    sdh_install * "$SAGE_LOCAL/lib/gap/pkg/$pkg"
- 
-+    # TODO:
-     # Clean up any build artificts before installing the rest of the package
-     # Also remove configure/Makefiles
-     # Note: None, if any of the packages really have a proper install target
--    make clean  # Works for some packages but not all
--    rm -rf bin/
--    rm -rf configure configure.* config.* autogen.sh *.m4 Makefile* m4/
-+    #make clean  # Works for some packages but not all
-+    #rm -rf bin/
-+    #rm -rf configure configure.* config.* autogen.sh *.m4 Makefile* m4/
- 
--    # Create the bin/ symlink
--    ln -s "$SAGE_LOCAL/lib/gap/pkg/$pkg/bin" bin
--
--    # Install the rest of the package files
--    sdh_install * "$PKG_DIR/$pkg"
- }
- 
- # Build and install compiled packages:
- #
- # These packages have an old ./configure that take the GAP_ROOT as a positional
- # argument
--for pkg in cohomolo-* crypting-* grape-* guava-* orb-* datastructures-*
-+for pkg in cohomolo crypting grape guava orb datastructures
- do
-     echo "Building GAP package $pkg"
-     CFLAGS="$CFLAGS -Wno-implicit-function-declaration"
-@@ -91,7 +85,7 @@ pararr=( " " " " "--with-external-planarity" "--with-external-libsemigroups" )
- ##############################################################################
- 
- parind=0
--for pkg in nq-* io-* digraphs-* semigroups-*
-+for pkg in nq io digraphs semigroups
- do
-     echo "Building GAP package $pkg"
-     cd "$PKG_SRC_DIR/$pkg"
-diff --git a/build/pkgs/libsemigroups/checksums.ini b/build/pkgs/libsemigroups/checksums.ini
-index 62c4268515f..4e13a36cb35 100644
---- a/build/pkgs/libsemigroups/checksums.ini
-+++ b/build/pkgs/libsemigroups/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=libsemigroups-VERSION.tar.gz
--sha1=2b16c095cc5ffd3f77a71dfbf48cce188e054c03
--md5=7082cadcf7a195ccb93175cd72b6db95
--cksum=1501022358
-+sha1=86375824b47ce4b0e23570122e873f67136d0c0a
-+md5=ff79ad5fbc8bfeb64d48faaf24106b98
-+cksum=2845045455
- upstream_url=https://github.com/libsemigroups/libsemigroups/releases/download/vVERSION/libsemigroups-VERSION.tar.gz
-diff --git a/build/pkgs/libsemigroups/package-version.txt b/build/pkgs/libsemigroups/package-version.txt
-index 9084fa2f716..f90b1afc082 100644
---- a/build/pkgs/libsemigroups/package-version.txt
-+++ b/build/pkgs/libsemigroups/package-version.txt
-@@ -1 +1 @@
--1.1.0
-+2.3.2
-diff --git a/build/pkgs/libsemigroups/spkg-install.in b/build/pkgs/libsemigroups/spkg-install.in
-index 2aaf0e99043..128b54d2f99 100644
---- a/build/pkgs/libsemigroups/spkg-install.in
-+++ b/build/pkgs/libsemigroups/spkg-install.in
-@@ -1,4 +1,4 @@
- cd src
--sdh_configure
-+sdh_configure --disable-eigen
- sdh_make
- sdh_make_install
-diff --git a/build/pkgs/singular/spkg-configure.m4 b/build/pkgs/singular/spkg-configure.m4
-index d4d145defe3..6a85631f624 100644
---- a/build/pkgs/singular/spkg-configure.m4
-+++ b/build/pkgs/singular/spkg-configure.m4
-@@ -9,52 +9,7 @@ SAGE_SPKG_CONFIGURE([singular], [
-        AC_MSG_CHECKING([that Singular's help is working])
-        AS_IF([test x`printf "system(\"--browser\", \"builtin\"); \n help;" | Singular 2>&1 | grep "error occurred"` = x], [
-         AC_MSG_RESULT(yes)
--        dnl We have Singular. Now determine the shared library path on
--        dnl platforms on which sage.libs.singular needs to reload the library with RTLD_GLOBAL.
--        AS_CASE([$host_os],
--          [cygwin*], [dnl Nothing to do
--                     ],
--                     [dnl Use pkg-config to get singular's libdir while we're at it. As a
--                      dnl moral compromise for using pkg-config, this ultimately allows us
--                      dnl to pass an absolute path to dlopen(), which is the only approach
--                      dnl that POSIX guarantees will work.
--                      PKG_CHECK_VAR([SINGULAR_LIB_DIR], [Singular], [libdir])
--                      dnl The acl_shlibext variable is set in the top-level configure.ac.
--                      AC_LANG_PUSH(C)
--                      ORIG_LIBS="${LIBS}"
--                      LIBS="${LIBS} -ldl"
--                      AC_MSG_CHECKING([if we can dlopen($LIBSINGULAR_PATH)])
--                      LIBSINGULAR_PATH="${SINGULAR_LIB_DIR}/libSingular.${acl_shlibext}"
--
--                      dnl if we can dlopen() it, substitute the name for sage_conf;
--                      dnl otherwise, fall back to using the SPKG.
--                      AC_RUN_IFELSE(
--                        [AC_LANG_PROGRAM(
--                          [[#include <dlfcn.h>]],
--                          [[void* h = dlopen("${LIBSINGULAR_PATH}", RTLD_LAZY | RTLD_GLOBAL);
--                            if (h == 0) { return 1; } else { return dlclose(h); }]]
--                        )], [
--                          AC_MSG_RESULT(yes)
--                        ], [
--                          dnl try Debian-specific name
--                          LIBSINGULAR_PATH="${SINGULAR_LIB_DIR}/libsingular-Singular.${acl_shlibext}"
--                          AC_RUN_IFELSE(
--                           [AC_LANG_PROGRAM(
--                             [[#include <dlfcn.h>]],
--                             [[void* h = dlopen("${LIBSINGULAR_PATH}", RTLD_LAZY | RTLD_GLOBAL);
--                               if (h == 0) { return 1; } else { return dlclose(h); }]]
--                           )], [
--                             AC_MSG_RESULT(yes)
--                           ], [
--                            AC_MSG_RESULT(no)
--                            sage_spkg_install_singular=yes
--                          ], [AC_MSG_RESULT(yes)])
--                        ], [AC_MSG_RESULT(yes)])
--
--                      AC_LANG_POP()
--                      LIBS="${ORIG_LIBS}"
--                     ]
--       )], [
-+       ], [
-        AC_MSG_RESULT(no)
-        sage_spkg_install_singular=yes
-        ]
-@@ -64,20 +19,4 @@ SAGE_SPKG_CONFIGURE([singular], [
-       ])
-     ])
-   ])
--],[],[],[
--  dnl Post-check phase
--  dnl We make the sage_conf substitutions here, because the "default"
--  dnl substitution needs to be made even if we skipped the system-Singular
--  dnl checks themselves.
--  AS_IF([test "x${sage_spkg_install_singular}" = "xyes"], [
--    AS_CASE([$host_os],
--      [cygwin*], [dnl Nothing to do
--                 ],
--                 [dnl Set shared library path, needed for reloading the library with RTLD_GLOBAL
--                  LIBSINGULAR_PATH="\$SAGE_LOCAL/lib/libSingular.${acl_shlibext}"
--                 ]
--    )
--  ])
--
--  AC_SUBST(LIBSINGULAR_PATH, "${LIBSINGULAR_PATH}")
- ])
-diff --git a/pkgs/sage-conf/_sage_conf/_conf.py.in b/pkgs/sage-conf/_sage_conf/_conf.py.in
-index 6cd28f558a8..d66bdb3d264 100644
---- a/pkgs/sage-conf/_sage_conf/_conf.py.in
-+++ b/pkgs/sage-conf/_sage_conf/_conf.py.in
-@@ -55,9 +55,6 @@ THREEJS_DIR = SAGE_LOCAL + "/share/threejs-sage"
- OPENMP_CFLAGS = "@OPENMP_CFLAGS@"
- OPENMP_CXXFLAGS = "@OPENMP_CXXFLAGS@"
- 
--# The full absolute path to the main Singular library.
--LIBSINGULAR_PATH = "@LIBSINGULAR_PATH@".replace('$SAGE_LOCAL', SAGE_LOCAL)
--
- # Installation location of wheels. This is determined at configuration time
- # and does not depend on the installation location of sage-conf.
- SAGE_SPKG_WHEELS = "@SAGE_VENV@".replace('${SAGE_LOCAL}', SAGE_LOCAL) + "/var/lib/sage/wheels"
-diff --git a/src/doc/en/thematic_tutorials/lie/weyl_groups.rst b/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-index c917338e444..182e74aad20 100644
---- a/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-+++ b/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-@@ -139,12 +139,12 @@ string, which you can print::
-     X.1      1  1  1  1  1  1  1  1  1  1  1  1  1
-     X.2      1 -1  1  1 -1  1  1 -1 -1 -1  1  1  1
-     X.3      2  .  2 -1  .  2  2  .  .  . -1  2  2
--    X.4      3 -1 -1  .  1 -1  3 -1  1 -1  . -1  3
--    X.5      3 -1 -1  .  1  3 -1 -1 -1  1  . -1  3
--    X.6      3  1 -1  . -1 -1  3  1 -1  1  . -1  3
--    X.7      3  1 -1  . -1  3 -1  1  1 -1  . -1  3
--    X.8      3 -1  3  . -1 -1 -1 -1  1  1  . -1  3
--    X.9      3  1  3  .  1 -1 -1  1 -1 -1  . -1  3
-+    X.4      3 -1 -1  .  1  3 -1 -1 -1  1  . -1  3
-+    X.5      3  1 -1  . -1  3 -1  1  1 -1  . -1  3
-+    X.6      3 -1  3  . -1 -1 -1 -1  1  1  . -1  3
-+    X.7      3 -1 -1  .  1 -1  3 -1  1 -1  . -1  3
-+    X.8      3  1  3  .  1 -1 -1  1 -1 -1  . -1  3
-+    X.9      3  1 -1  . -1 -1  3  1 -1  1  . -1  3
-     X.10     4 -2  . -1  .  .  .  2  .  .  1  . -4
-     X.11     4  2  . -1  .  .  . -2  .  .  1  . -4
-     X.12     6  . -2  .  . -2 -2  .  .  .  .  2  6
-diff --git a/src/sage/coding/codecan/autgroup_can_label.pyx b/src/sage/coding/codecan/autgroup_can_label.pyx
-index de5db985e0b..c83b9264e44 100644
---- a/src/sage/coding/codecan/autgroup_can_label.pyx
-+++ b/src/sage/coding/codecan/autgroup_can_label.pyx
-@@ -76,7 +76,7 @@ columns do share the same coloring::
-     ((1,),
-      (2,),
-      (3, 5, 4),
--     (6, 19, 16, 9, 21, 10, 8, 15, 14, 11, 20, 13, 12, 7, 17, 18))
-+     (6, 19, 16, 21, 9, 10, 15, 8, 20, 11, 14, 13, 7, 12, 18, 17))
- 
- We can also restrict the group action to linear isometries::
- 
-diff --git a/src/sage/coding/linear_code.py b/src/sage/coding/linear_code.py
-index a3ac3ca1547..bfb9f8696e8 100644
---- a/src/sage/coding/linear_code.py
-+++ b/src/sage/coding/linear_code.py
-@@ -465,27 +465,27 @@ def automorphism_group_gens(self, equivalence="semilinear"):
-             0
-             sage: C = codes.HammingCode(GF(4, 'z'), 3)
-             sage: C.automorphism_group_gens()
--            ([((1, 1, 1, 1, 1, z + 1, z, z + 1, z, z, z, 1, 1, z + 1, z + 1, z, z + 1, z, z + 1, z + 1, z + 1); (1,14,6,7,4,10,11,19)(2,8,16,13,3,17,21,15)(9,12,18,20), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((1, 1, 1, z, z + 1, 1, 1, 1, 1, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z); (1,13,14,20)(2,21,8,18,7,16,19,15)(3,10,5,12,17,9,6,4), Ring endomorphism of Finite Field in z of size 2^2
-+                Defn: z |--> z + 1),
-+              ((z, 1, z, z, z, z + 1, z, z, z, z, z, z, z + 1, z, z, z, z, z + 1, z, z, z); (1,11,5,12,3,19)(2,8)(6,18,13)(7,17,15)(9,10,14,16,20,21), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z + 1),
--              ((z + 1, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z + 1, 1, z, z + 1, z + 1, z); (1,18,6,19,2,9,17,10,13,14,21,11,4,5,12)(3,20,7,16,8), Ring endomorphism of Finite Field in z of size 2^2
--                Defn: z |--> z),
-               ((z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z); (), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-              362880)
-             sage: C.automorphism_group_gens(equivalence="linear")
--            ([((z + 1, 1, z + 1, z + 1, z + 1, z, 1, z, 1, 1, 1, 1, z + 1, z + 1, z + 1, z, z, 1, z, z, z); (1,15,2,8,16,18,3)(4,9,12,13,20,10,11)(5,21,14,6,7,19,17), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((z, 1, z + 1, z + 1, 1, z + 1, z, 1, z + 1, z + 1, 1, z, 1, z + 1, z, 1, z, 1, z + 1, 1, 1); (1,12,11,10,6,8,9,20,13,21,5,14,3,16,17,19,7,4,2,15,18), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((z + 1, z + 1, z + 1, z + 1, z + 1, 1, z, 1, z, z, z, 1, z, 1, 1, 1, z + 1, z + 1, z + 1, 1, z); (1,15,21,8,9)(2,18,5,3,11,16,7,10,19,13,12,4,17,6,20), Ring endomorphism of Finite Field in z of size 2^2
-+              ((z + 1, z + 1, z + 1, z, 1, 1, z, z, 1, z + 1, z, 1, 1, z, 1, z + 1, z, z + 1, z + 1, 1, z); (1,3,18,2,17,6,19)(4,15,13,20,7,14,16)(5,11,8,21,12,9,10), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
-               ((z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1); (), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-              181440)
-             sage: C.automorphism_group_gens(equivalence="permutational")
--            ([((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,19)(3,17)(4,21)(5,20)(7,14)(9,12)(10,16)(11,15), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,11)(3,10)(4,9)(5,7)(12,21)(14,20)(15,19)(16,17), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,11)(3,10)(4,9)(5,7)(12,21)(14,20)(15,19)(16,17), Ring endomorphism of Finite Field in z of size 2^2
-+              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (2,18)(3,19)(4,10)(5,16)(8,13)(9,14)(11,21)(15,20), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,17)(2,8)(3,14)(4,10)(7,12)(9,19)(13,18)(15,20), Ring endomorphism of Finite Field in z of size 2^2
-+              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,19)(3,17)(4,21)(5,20)(7,14)(9,12)(10,16)(11,15), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
-               ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (2,13)(3,14)(4,20)(5,11)(8,18)(9,19)(10,15)(16,21), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-@@ -691,10 +691,10 @@ def _canonize(self, equivalence):
-             sage: C_iso == aut_group_can_label.get_canonical_form()
-             True
-             sage: aut_group_can_label.get_autom_gens()
--            [((1, 1, 1, 1, 1, z + 1, z, z + 1, z, z, z, 1, 1, z + 1, z + 1, z, z + 1, z, z + 1, z + 1, z + 1); (1,14,6,7,4,10,11,19)(2,8,16,13,3,17,21,15)(9,12,18,20), Ring endomorphism of Finite Field in z of size 2^2
-+            [((1, 1, 1, z, z + 1, 1, 1, 1, 1, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z); (1,13,14,20)(2,21,8,18,7,16,19,15)(3,10,5,12,17,9,6,4), Ring endomorphism of Finite Field in z of size 2^2
-+               Defn: z |--> z + 1),
-+             ((z, 1, z, z, z, z + 1, z, z, z, z, z, z, z + 1, z, z, z, z, z + 1, z, z, z); (1,11,5,12,3,19)(2,8)(6,18,13)(7,17,15)(9,10,14,16,20,21), Ring endomorphism of Finite Field in z of size 2^2
-                Defn: z |--> z + 1),
--             ((z + 1, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z + 1, 1, z, z + 1, z + 1, z); (1,18,6,19,2,9,17,10,13,14,21,11,4,5,12)(3,20,7,16,8), Ring endomorphism of Finite Field in z of size 2^2
--               Defn: z |--> z),
-              ((z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z); (), Ring endomorphism of Finite Field in z of size 2^2
-                Defn: z |--> z)]
-         """
-diff --git a/src/sage/combinat/posets/posets.py b/src/sage/combinat/posets/posets.py
-index 2836d59d960..8c882d5ac3b 100644
---- a/src/sage/combinat/posets/posets.py
-+++ b/src/sage/combinat/posets/posets.py
-@@ -8813,7 +8813,7 @@ def _libgap_(self):
-             sage: libgap(P)  # optional - gap_packages
-             <A poset on 5 points>
-             sage: A = libgap(GF(2)).PosetAlgebra(P); A  # optional - gap_packages
--            <GF(2)[<quiver with 5 vertices and 5 arrows>]/<two-sided ideal in <GF(2)[<quiver with 5 vertices and 5 arrows>]>, (1 generators)>>
-+            <GF(2)[<quiver with 5 vertices and 5 arrows>]/<two-sided ideal in <GF(2)[<quiver with 5 vertices and 5 arrows>]>, (1 generator)>>
-             sage: A.Dimension()  # optional - gap_packages
-             13
-         """
-diff --git a/src/sage/combinat/root_system/hecke_algebra_representation.py b/src/sage/combinat/root_system/hecke_algebra_representation.py
-index 6b756bafc30..8ac99319bec 100644
---- a/src/sage/combinat/root_system/hecke_algebra_representation.py
-+++ b/src/sage/combinat/root_system/hecke_algebra_representation.py
-@@ -357,7 +357,7 @@ def Tw(self, word, signs=None, scalar=None):
-             sage: q1, q2 = K.gens()
-             sage: KW = W.algebra(K)
-             sage: x = KW.an_element(); x
--            123 + 3*32 + 2*3 + e
-+            123 + 3*2312 + 2*31 + e
- 
-             sage: T = KW.demazure_lusztig_operators(q1,q2)
-             sage: T12 = T.Tw( (1,2) )
-diff --git a/src/sage/combinat/symmetric_group_algebra.py b/src/sage/combinat/symmetric_group_algebra.py
-index b8a0bebab44..9bccba124c8 100644
---- a/src/sage/combinat/symmetric_group_algebra.py
-+++ b/src/sage/combinat/symmetric_group_algebra.py
-@@ -101,7 +101,7 @@ def SymmetricGroupAlgebra(R, W, category=None):
-         sage: SGA.group()
-         Weyl Group of type ['A', 3] (as a matrix group acting on the ambient space)
-         sage: SGA.an_element()
--        s1*s2*s3 + 3*s3*s2 + 2*s3 + 1
-+        s1*s2*s3 + 3*s2*s3*s1*s2 + 2*s3*s1 + 1
- 
-     The preferred way to construct the symmetric group algebra is to
-     go through the usual ``algebra`` method::
-diff --git a/src/sage/env.py b/src/sage/env.py
-index 911f34b1bc6..5f7aca8599c 100644
---- a/src/sage/env.py
-+++ b/src/sage/env.py
-@@ -197,7 +197,8 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- GRAPHS_DATA_DIR = var("GRAPHS_DATA_DIR", join(SAGE_SHARE, "graphs"))
- ELLCURVE_DATA_DIR = var("ELLCURVE_DATA_DIR", join(SAGE_SHARE, "ellcurves"))
- POLYTOPE_DATA_DIR = var("POLYTOPE_DATA_DIR", join(SAGE_SHARE, "reflexive_polytopes"))
--GAP_ROOT_DIR = var("GAP_ROOT_DIR", join(SAGE_SHARE, "gap"))
-+GAP_LIB_DIR = var("GAP_LIB_DIR", join(SAGE_LOCAL, "lib", "gap"))
-+GAP_SHARE_DIR = var("GAP_SHARE_DIR", join(SAGE_SHARE, "gap"))
- THEBE_DIR = var("THEBE_DIR", join(SAGE_SHARE, "thebe"))
- COMBINATORIAL_DESIGN_DATA_DIR = var("COMBINATORIAL_DESIGN_DATA_DIR", join(SAGE_SHARE, "combinatorial_designs"))
- CREMONA_MINI_DATA_DIR = var("CREMONA_MINI_DATA_DIR", join(SAGE_SHARE, "cremona"))
-@@ -229,12 +230,6 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- LIE_INFO_DIR = var("LIE_INFO_DIR", join(SAGE_LOCAL, "lib", "LiE"))
- SINGULAR_BIN = var("SINGULAR_BIN") or "Singular"
- 
--# The path to libSingular, to be passed to dlopen(). This will
--# typically be set to an absolute path in sage_conf, but the relative
--# fallback path here works on systems where dlopen() searches the
--# system's library locations.
--LIBSINGULAR_PATH = var("LIBSINGULAR_PATH", "libSingular.so")
--
- # OpenMP
- OPENMP_CFLAGS = var("OPENMP_CFLAGS", "")
- OPENMP_CXXFLAGS = var("OPENMP_CXXFLAGS", "")
-@@ -255,81 +250,6 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- SAGE_GAP_COMMAND = var('SAGE_GAP_COMMAND', _gap_cmd)
- 
- 
--def _get_shared_lib_path(*libnames: str) -> Optional[str]:
--    """
--    Return the full path to a shared library file installed in
--    ``$SAGE_LOCAL/lib`` or the directories associated with the
--    Python sysconfig.
--
--    This can also be passed more than one library name (e.g. for cases where
--    some library may have multiple names depending on the platform) in which
--    case the first one found is returned.
--
--    This supports most *NIX variants (in which ``lib<libname>.so`` is found
--    under ``$SAGE_LOCAL/lib``), macOS (same, but with the ``.dylib``
--    extension), and Cygwin (under ``$SAGE_LOCAL/bin/cyg<libname>.dll``,
--    or ``$SAGE_LOCAL/bin/cyg<libname>-*.dll`` for versioned DLLs).
--
--    For distributions like Debian that use a multiarch layout, we also try the
--    multiarch lib paths (i.e. ``/usr/lib/<arch>/``).
--
--    This returns ``None`` if no matching library file could be found.
--
--    EXAMPLES::
--
--        sage: from sage.env import _get_shared_lib_path
--        sage: "gap" in _get_shared_lib_path("gap")
--        True
--        sage: _get_shared_lib_path("an_absurd_lib") is None
--        True
--
--    """
--
--    for libname in libnames:
--        search_directories: List[Path] = []
--        patterns: List[str] = []
--        if sys.platform == 'cygwin':
--            # Later down we take the first matching DLL found, so search
--            # SAGE_LOCAL first so that it takes precedence
--            if SAGE_LOCAL:
--                search_directories.append(Path(SAGE_LOCAL) / 'bin')
--            search_directories.append(Path(sysconfig.get_config_var('BINDIR')))
--            # Note: The following is not very robust, since if there are multible
--            # versions for the same library this just selects one more or less
--            # at arbitrary. However, practically speaking, on Cygwin, there
--            # will only ever be one version
--            patterns = [f'cyg{libname}.dll', f'cyg{libname}-*.dll']
--        else:
--            if sys.platform == 'darwin':
--                ext = 'dylib'
--            else:
--                ext = 'so'
--
--            if SAGE_LOCAL:
--                search_directories.append(Path(SAGE_LOCAL) / 'lib')
--            libdir = sysconfig.get_config_var('LIBDIR')
--            if libdir is not None:
--                libdir = Path(libdir)
--                search_directories.append(libdir)
--
--                multiarchlib = sysconfig.get_config_var('MULTIARCH')
--                if multiarchlib is not None:
--                    search_directories.append(libdir / multiarchlib),
--
--            patterns = [f'lib{libname}.{ext}']
--
--        for directory in search_directories:
--            for pattern in patterns:
--                path = next(directory.glob(pattern), None)
--                if path is not None:
--                    return str(path.resolve())
--
--    # Just return None if no files were found
--    return None
--
--# locate libgap shared object
--GAP_SO = var("GAP_SO", _get_shared_lib_path("gap", ""))
--
- # post process
- if DOT_SAGE is not None and ' ' in DOT_SAGE:
-     if UNAME[:6] == 'CYGWIN':
-diff --git a/src/sage/groups/abelian_gps/abelian_group_gap.py b/src/sage/groups/abelian_gps/abelian_group_gap.py
-index a4b047113c5..86090b43535 100644
---- a/src/sage/groups/abelian_gps/abelian_group_gap.py
-+++ b/src/sage/groups/abelian_gps/abelian_group_gap.py
-@@ -338,7 +338,7 @@ def _element_constructor_(self, x, check=True):
-         if isinstance(x, AbelianGroupElement_gap):
-             try:
-                 if x in self._cover:
--                    x = self.gap().NaturalHomomorphism().Image(x.gap())
-+                    x = self._cover.gap().NaturalHomomorphismByNormalSubgroup(self._relations).Image(x.gap())
-                 else:
-                     x = x.gap()
-             except AttributeError:
-@@ -1043,7 +1043,7 @@ def natural_homomorphism(self):
-             From: Abelian group with gap, generator orders (4,)
-             To:   Quotient abelian group with generator orders (2,)
-         """
--        phi = self.gap().NaturalHomomorphism()
-+        phi = self._cover.gap().NaturalHomomorphismByNormalSubgroup(self._relations)
-         Hom = self._cover.Hom(self)
-         return Hom(phi)
- 
-diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py
-index 8d6e443683c..1beb01af87f 100644
---- a/src/sage/groups/finitely_presented.py
-+++ b/src/sage/groups/finitely_presented.py
-@@ -596,9 +596,9 @@ def gap(self):
-             sage: k = G.rewriting_system()
-             sage: k.gap()
-             Knuth Bendix Rewriting System for Monoid( [ a, A, b, B ] ) with rules
--            [ [ a^2, <identity ...> ], [ a*A, <identity ...> ],
--              [ A*a, <identity ...> ], [ b^2, <identity ...> ],
--              [ b*B, <identity ...> ], [ B*b, <identity ...> ] ]
-+            [ [ a*A, <identity ...> ], [ A*a, <identity ...> ],
-+              [ b*B, <identity ...> ], [ B*b, <identity ...> ],
-+              [ a^2, <identity ...> ], [ b^2, <identity ...> ] ]
-         """
-         return self._gap
- 
-diff --git a/src/sage/groups/fqf_orthogonal.py b/src/sage/groups/fqf_orthogonal.py
-index 7fc4dbe7548..e5eccd45942 100644
---- a/src/sage/groups/fqf_orthogonal.py
-+++ b/src/sage/groups/fqf_orthogonal.py
-@@ -143,7 +143,7 @@ class FqfOrthogonalGroup(AbelianGroupAutomorphismGroup_subgroup):
-         [2/3   0   0]
-         [  0 2/3   0]
-         [  0   0 4/3]
--        generated by 2 elements
-+        generated by 3 elements
-         sage: q = matrix.diagonal(QQ, [3/2, 1/4, 1/4])
-         sage: T = TorsionQuadraticForm(q)
-         sage: T.orthogonal_group().order()
-diff --git a/src/sage/groups/libgap_wrapper.pyx b/src/sage/groups/libgap_wrapper.pyx
-index d25121aa792..dc81b71635b 100644
---- a/src/sage/groups/libgap_wrapper.pyx
-+++ b/src/sage/groups/libgap_wrapper.pyx
-@@ -25,7 +25,7 @@ Note how we call the constructor of both superclasses to initialize
- its output via LibGAP::
- 
-     sage: FooGroup()
--    <pc group of size 3 with 1 generators>
-+    <pc group of size 3 with 1 generator>
-     sage: type(FooGroup().gap())
-     <class 'sage.libs.gap.element.GapElement'>
- 
-@@ -106,7 +106,7 @@ class ParentLibGAP(SageObject):
-         ....:         ParentLibGAP.__init__(self, lg)
-         ....:         Group.__init__(self)
-         sage: FooGroup()
--        <pc group of size 3 with 1 generators>
-+        <pc group of size 3 with 1 generator>
-     """
- 
-     def __init__(self, libgap_parent, ambient=None):
-@@ -461,7 +461,7 @@ cdef class ElementLibGAP(MultiplicativeGroupElement):
-         ....:         ParentLibGAP.__init__(self, lg)
-         ....:         Group.__init__(self)
-         sage: FooGroup()
--        <pc group of size 3 with 1 generators>
-+        <pc group of size 3 with 1 generator>
-         sage: FooGroup().gens()
-         (f1,)
-     """
-diff --git a/src/sage/groups/matrix_gps/finitely_generated.py b/src/sage/groups/matrix_gps/finitely_generated.py
-index a6d3dc02513..63956ad5f10 100644
---- a/src/sage/groups/matrix_gps/finitely_generated.py
-+++ b/src/sage/groups/matrix_gps/finitely_generated.py
-@@ -563,9 +563,6 @@ def as_permutation_group(self, algorithm=None, seed=None):
-             21499084800
-             sage: P = G.as_permutation_group()
-             sage: Psmaller = G.as_permutation_group(algorithm="smaller", seed=6)
--            sage: P == Psmaller  # see the note below
--            True
--            sage: Psmaller = G.as_permutation_group(algorithm="smaller")
-             sage: P == Psmaller
-             False
-             sage: P.cardinality()
-diff --git a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-index f2ccca042ac..47d6862333c 100644
---- a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-+++ b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-@@ -427,7 +427,7 @@ cdef class LabelledBranching:
-             sage: from sage.groups.perm_gps.partn_ref2.refinement_generic import LabelledBranching
-             sage: L = LabelledBranching(3)
-             sage: L.small_generating_set()
--            []
-+            [()]
-             sage: L.add_gen(libgap.eval('(1,2,3)'))
-             sage: L.small_generating_set()
-             [(1,2,3)]
-diff --git a/src/sage/groups/perm_gps/permgroup.py b/src/sage/groups/perm_gps/permgroup.py
-index ebdf7c4c6eb..fb14008c8e0 100644
---- a/src/sage/groups/perm_gps/permgroup.py
-+++ b/src/sage/groups/perm_gps/permgroup.py
-@@ -926,7 +926,7 @@ def _coerce_map_from_(self, G):
-            sage: f = PG._coerce_map_from_(MG)
-            sage: mg = MG.an_element()
-            sage: p = f(mg); p
--           (2,33,32,23,31,55)(3,49,38,44,40,28)(4,17,59,62,58,46)(5,21,47,20,43,8)(6,53,50)(7,37,12,57,14,29)(9,41,56,34,64,10)(11,25,19)(13,61,26,51,22,15)(16,45,36)(18,27,35,48,52,54)(24,63,42)(30,39,60)
-+           (1,2,6,19,35,33)(3,9,26,14,31,23)(4,13,5)(7,22,17)(8,24,12)(10,16,32,27,20,28)(11,30,18)(15,25,36,34,29,21)
-            sage: PG(p._gap_()) == p
-            True
- 
-@@ -972,12 +972,12 @@ def _coerce_map_from_(self, G):
-             sage: P = G.as_permutation_group(algorithm='smaller', seed=5)
-             sage: P1 = G.as_permutation_group()
-             sage: P == P1
--            False
-+            True
-             sage: g1, g2, g3 = G.gens()
-             sage: P(g1*g2)
--            (1,3,7,12)(2,4,8,10)(5,11)(6,9)
-+            (1,4,13,11)(2,5,14,18)(3,15,8,16)(6,7)(9,20,19,12)(10,17)
-             sage: P1(g1*g2)
--            (2,29,25,68)(3,57,13,54)(4,11,72,37)(5,39,60,23)(6,64,75,63)(7,21,50,73)(8,46,38,32)(9,74,35,18)(10,44,49,48)(12,16,34,71)(14,79,27,40)(15,26)(17,62,59,76)(19,78,70,65)(20,22,58,51)(24,33,36,43)(28,81,80,52)(30,53,56,69)(31,61)(41,42,67,55)(45,77)(47,66)
-+            (1,4,13,11)(2,5,14,18)(3,15,8,16)(6,7)(9,20,19,12)(10,17)
- 
-         Another check for :trac:`5583`::
- 
-@@ -1302,7 +1302,7 @@ def gens_small(self):
-             sage: G.gens_small() # random
-             [('b','c'), ('a','c','b')] ## (on 64-bit Linux)
-             [('a','b'), ('a','c','b')] ## (on Solaris)
--            sage: len(G.gens_small()) == 2
-+            sage: len(G.gens_small()) == 2 # random
-             True
-         """
-         gens = self._libgap_().SmallGeneratingSet()
-@@ -4370,17 +4370,23 @@ def is_transitive(self, domain=None):
- 
-         ::
- 
--            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)]]) #S_5 on [1..5]
--            sage: G.is_transitive([1,4,5])
-+            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)],[(6,7)]])
-+            sage: G.is_transitive([1,2,3,4,5])
-             True
--            sage: G.is_transitive([2..6])
-+            sage: G.is_transitive([1..7])
-             False
-             sage: G.is_transitive(G.non_fixed_points())
--            True
-+            False
-             sage: H = PermutationGroup([[(1,2,3)],[(4,5,6)]])
-             sage: H.is_transitive(H.non_fixed_points())
-             False
- 
-+        If `G` does not act on the domain, it always returns ``False``::
-+
-+            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)]]) #S_5 on [1..5]
-+            sage: G.is_transitive([1,4,5])
-+            False
-+
-         Note that this differs from the definition in GAP, where
-         ``IsTransitive`` returns whether the group is transitive on the
-         set of points moved by the group.
-@@ -4436,12 +4442,16 @@ def is_primitive(self, domain=None):
-             sage: G = PermutationGroup([[(1,2,3,4)],[(2,4)]])
-             sage: G.is_primitive([1..4])
-             False
--            sage: G.is_primitive([1,2,3])
--            True
-             sage: G = PermutationGroup([[(3,4,5,6)],[(3,4)]]) #S_4 on [3..6]
-             sage: G.is_primitive(G.non_fixed_points())
-             True
- 
-+        If `G` does not act on the domain, it always returns ``False``::
-+
-+            sage: G = PermutationGroup([[(1,2,3,4)],[(2,4)]])
-+            sage: G.is_primitive([1,2,3])
-+            False
-+
-         """
-         #If the domain is not a subset of self.domain(), then the
-         #action isn't primitive.
-diff --git a/src/sage/interfaces/gap.py b/src/sage/interfaces/gap.py
-index 7ae1792e9de..ecaa9fd2341 100644
---- a/src/sage/interfaces/gap.py
-+++ b/src/sage/interfaces/gap.py
-@@ -1512,6 +1512,8 @@ def gap_reset_workspace(max_workspace_size=None, verbose=False):
-     """
-     # Create new workspace with filename WORKSPACE
-     g = Gap(use_workspace_cache=False, max_workspace_size=None)
-+    g.eval('ColorPrompt(false)')
-+    g.eval('SetUserPreference("UseColorPrompt", false)')
-     g.eval('SetUserPreference("HistoryMaxLines", 30)')
-     from sage.tests.gap_packages import all_installed_packages
-     for pkg in all_installed_packages(gap=g):
-diff --git a/src/sage/interfaces/gap_workspace.py b/src/sage/interfaces/gap_workspace.py
-index 33a87dd5076..03b40be6856 100644
---- a/src/sage/interfaces/gap_workspace.py
-+++ b/src/sage/interfaces/gap_workspace.py
-@@ -16,7 +16,8 @@
- import os
- import time
- import hashlib
--from sage.env import DOT_SAGE, GAP_SO
-+import subprocess
-+from sage.env import DOT_SAGE, HOSTNAME, GAP_LIB_DIR, GAP_SHARE_DIR
- 
- 
- def gap_workspace_file(system="gap", name="workspace", dir=None):
-@@ -59,11 +60,13 @@ def gap_workspace_file(system="gap", name="workspace", dir=None):
-     if dir is None:
-         dir = os.path.join(DOT_SAGE, 'gap')
- 
--    if GAP_SO:
--        h = hashlib.sha1(GAP_SO.encode('utf-8')).hexdigest()
--    else:
--        h = 'unknown'
--    return os.path.join(dir, '%s-%s-%s' % (system, name, h))
-+    data = f'{GAP_LIB_DIR}:{GAP_SHARE_DIR}'
-+    for path in GAP_LIB_DIR, GAP_SHARE_DIR:
-+        sysinfo = os.path.join(path, "sysinfo.gap")
-+        if os.path.exists(sysinfo):
-+            data += subprocess.getoutput(f'. "{sysinfo}" && echo ":$GAP_VERSION:$GAParch"')
-+    h = hashlib.sha1(data.encode('utf-8')).hexdigest()
-+    return os.path.join(dir, f'{system}-{name}-{HOSTNAME}-{h}')
- 
- 
- def prepare_workspace_dir(dir=None):
-diff --git a/src/sage/libs/gap/element.pyx b/src/sage/libs/gap/element.pyx
-index c555ea0333c..e3db3934baf 100644
---- a/src/sage/libs/gap/element.pyx
-+++ b/src/sage/libs/gap/element.pyx
-@@ -130,6 +130,7 @@ cdef char *capture_stdout(Obj func, Obj obj):
-     """
-     cdef Obj s, stream, output_text_string
-     cdef UInt res
-+    cdef TypOutputFile output
-     # The only way to get a string representation of an object that is truly
-     # consistent with how it would be represented at the GAP REPL is to call
-     # ViewObj on it.  Unfortunately, ViewObj *prints* to the output stream,
-@@ -145,12 +146,12 @@ cdef char *capture_stdout(Obj func, Obj obj):
-         output_text_string = GAP_ValueGlobalVariable("OutputTextString")
-         stream = CALL_2ARGS(output_text_string, s, GAP_True)
- 
--        if not OpenOutputStream(stream):
-+        if not OpenOutputStream(&output, stream):
-             raise GAPError("failed to open output capture stream for "
-                            "representing GAP object")
- 
-         CALL_1ARGS(func, obj)
--        CloseOutput()
-+        CloseOutput(&output)
-         return CSTR_STRING(s)
-     finally:
-         GAP_Leave()
-diff --git a/src/sage/libs/gap/gap_includes.pxd b/src/sage/libs/gap/gap_includes.pxd
-index 6d22e32540b..6111d18a5c7 100644
---- a/src/sage/libs/gap/gap_includes.pxd
-+++ b/src/sage/libs/gap/gap_includes.pxd
-@@ -76,8 +76,10 @@ cdef extern from "gap/intobj.h" nogil:
- 
- 
- cdef extern from "gap/io.h" nogil:
--    UInt OpenOutputStream(Obj stream)
--    UInt CloseOutput()
-+    ctypedef struct TypOutputFile:
-+        pass
-+    UInt OpenOutputStream(TypOutputFile* output, Obj stream)
-+    UInt CloseOutput(TypOutputFile* output)
- 
- 
- cdef extern from "gap/libgap-api.h" nogil:
-diff --git a/src/sage/libs/gap/libgap.pyx b/src/sage/libs/gap/libgap.pyx
-index b1a64e57939..6a36613aa8c 100644
---- a/src/sage/libs/gap/libgap.pyx
-+++ b/src/sage/libs/gap/libgap.pyx
-@@ -695,7 +695,7 @@ class Gap(Parent):
-             sage: libgap.List
-             <Gap function "List">
-             sage: libgap.GlobalRandomSource
--            <RandomSource in IsGlobalRandomSource>
-+            <RandomSource in IsGAPRandomSource>
-         """
-         if name in dir(self.__class__):
-             return getattr(self.__class__, name)
-diff --git a/src/sage/libs/gap/saved_workspace.py b/src/sage/libs/gap/saved_workspace.py
-index ad5adec36d0..7636707f557 100644
---- a/src/sage/libs/gap/saved_workspace.py
-+++ b/src/sage/libs/gap/saved_workspace.py
-@@ -8,7 +8,7 @@
- 
- import os
- import glob
--from sage.env import GAP_ROOT_DIR
-+from sage.env import GAP_LIB_DIR
- from sage.interfaces.gap_workspace import gap_workspace_file
- 
- 
-@@ -31,7 +31,7 @@ def timestamp():
-     """
-     libgap_dir = os.path.dirname(__file__)
-     libgap_files = glob.glob(os.path.join(libgap_dir, '*'))
--    gap_packages = glob.glob(os.path.join(GAP_ROOT_DIR, 'pkg', '*'))
-+    gap_packages = glob.glob(os.path.join(GAP_LIB_DIR, 'pkg', '*'))
-     files = libgap_files + gap_packages
-     if len(files) == 0:
-         print('Unable to find LibGAP files.')
-diff --git a/src/sage/libs/gap/util.pyx b/src/sage/libs/gap/util.pyx
-index 344ab88c42a..eaa659d64c7 100644
---- a/src/sage/libs/gap/util.pyx
-+++ b/src/sage/libs/gap/util.pyx
-@@ -13,7 +13,7 @@ Utility functions for GAP
- #*****************************************************************************
- 
- from libc.signal cimport signal, SIGCHLD, SIG_DFL
--from posix.dlfcn cimport dlopen, dlclose, RTLD_NOW, RTLD_GLOBAL
-+from posix.dlfcn cimport dlopen, dlclose, dlerror, RTLD_LAZY, RTLD_GLOBAL
- 
- from cpython.exc cimport PyErr_Fetch, PyErr_Restore
- from cpython.object cimport Py_LT, Py_LE, Py_EQ, Py_NE, Py_GT, Py_GE
-@@ -164,33 +164,6 @@ cdef void gasman_callback() with gil:
- ### Initialization of GAP ##################################################
- ############################################################################
- 
--def gap_root():
--    """
--    Find the location of the GAP root install which is stored in the gap
--    startup script.
--
--    EXAMPLES::
--
--        sage: from sage.libs.gap.util import gap_root
--        sage: gap_root()   # random output
--        '/home/vbraun/opt/sage-5.3.rc0/local/gap/latest'
--    """
--    if os.path.exists(sage.env.GAP_ROOT_DIR):
--        return sage.env.GAP_ROOT_DIR
--
--    # Attempt to figure out the appropriate GAP_ROOT by reading the
--    # local/bin/gap shell script; this is an ugly hack that exists for
--    # historical reasons; the best approach to setting where Sage looks for
--    # the appropriate GAP_ROOT is to set the GAP_ROOT_DIR variable
--    SAGE_LOCAL = sage.env.SAGE_LOCAL
--    with open(os.path.join(SAGE_LOCAL, 'bin', 'gap')) as f:
--        gap_sh = f.read().splitlines()
--    gapdir = next(x for x in gap_sh if x.strip().startswith('GAP_ROOT'))
--    gapdir = gapdir.split('"')[1]
--    gapdir = gapdir.replace('$SAGE_LOCAL', SAGE_LOCAL)
--    return gapdir
--
--
- # To ensure that we call initialize_libgap only once.
- cdef bint _gap_is_initialized = False
- 
-@@ -232,12 +205,12 @@ cdef initialize():
-     # this isn't portable
- 
-     cdef void* handle
--    libgapname = str_to_bytes(sage.env.GAP_SO)
--    handle = dlopen(libgapname, RTLD_NOW | RTLD_GLOBAL)
-+    # reload the current module to force reload of libgap (see #33446)
-+    lib = str_to_bytes(__loader__.path, FS_ENCODING, "surrogateescape")
-+    handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY)
-     if handle is NULL:
--        raise RuntimeError(
--                "Could not dlopen() libgap even though it should already "
--                "be loaded!")
-+        err = dlerror()
-+        raise RuntimeError(f"Could not reload gap library with RTLD_GLOBAL ({err})")
-     dlclose(handle)
- 
-     # Define argv variable, which we will pass in to
-@@ -245,7 +218,7 @@ cdef initialize():
-     cdef char* argv[16]
-     argv[0] = "sage"
-     argv[1] = "-l"
--    s = str_to_bytes(gap_root(), FS_ENCODING, "surrogateescape")
-+    s = str_to_bytes(sage.env.GAP_LIB_DIR + ";" + sage.env.GAP_SHARE_DIR, FS_ENCODING, "surrogateescape")
-     argv[2] = s
- 
-     argv[3] = "-m"
-@@ -362,15 +335,9 @@ cdef Obj gap_eval(str gap_string) except? NULL:
-         GAPError: Error, Variable: 'Complex' must have a value
-         Syntax error: ; expected in stream:1
-         Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^
-+                ^^^^^
-         Error, Variable: 'with' must have a value
--        Syntax error: ; expected in stream:1
--        Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^^^^^^^^^
-         Error, Variable: 'bits' must have a value
--        Syntax error: ; expected in stream:1
--        Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-         Error, Variable: 'precision' must have a value
- 
-     Test that on a subsequent attempt we get the same message (no garbage was
-diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx
-index d8ea7b07f3c..4beb1774df9 100644
---- a/src/sage/libs/singular/singular.pyx
-+++ b/src/sage/libs/singular/singular.pyx
-@@ -1705,14 +1705,7 @@ cdef object si2sa_intvec(intvec *v):
- cdef extern from *: # hack to get at cython macro
-     int unlikely(int)
- 
--cdef extern from "dlfcn.h":
--    void *dlopen(char *, long)
--    char *dlerror()
--    void dlclose(void *handle)
--
--cdef extern from "dlfcn.h":
--    cdef long RTLD_LAZY
--    cdef long RTLD_GLOBAL
-+from posix.dlfcn cimport dlopen, dlclose, dlerror, RTLD_LAZY, RTLD_GLOBAL
- 
- cdef int overflow_check(unsigned long e, ring *_ring) except -1:
-     """
-@@ -1762,8 +1755,6 @@ cdef init_libsingular():
- 
-     cdef void *handle = NULL
- 
--    from sage.env import LIBSINGULAR_PATH
--    lib = str_to_bytes(LIBSINGULAR_PATH, FS_ENCODING, "surrogateescape")
- 
-     # This is a workaround for https://github.com/Singular/Singular/issues/1113
-     # and can be removed once that fix makes it into release of Singular that
-@@ -1780,10 +1771,12 @@ cdef init_libsingular():
- 
-     import platform
-     if not platform.system().startswith("CYGWIN"):
-+        # reload the current module to force reload of libSingular (see #33446)
-+        lib = str_to_bytes(__loader__.path, FS_ENCODING, "surrogateescape")
-         handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY)
-         if not handle:
-             err = dlerror()
--            raise ImportError(f"cannot load Singular library from {LIBSINGULAR_PATH} ({err})")
-+            raise RuntimeError(f"Could not reload Singular library with RTLD_GLOBAL ({err})")
- 
-     # load SINGULAR
-     siInit(lib)
-diff --git a/src/sage/tests/gap_packages.py b/src/sage/tests/gap_packages.py
-index 2e4518ca226..c302b169b8a 100644
---- a/src/sage/tests/gap_packages.py
-+++ b/src/sage/tests/gap_packages.py
-@@ -103,7 +103,7 @@ def all_installed_packages(ignore_dot_gap=False, gap=None):
- 
-         sage: from sage.tests.gap_packages import all_installed_packages
-         sage: all_installed_packages()
--        (...'GAPDoc'...)
-+        (...'gapdoc'...)
-         sage: all_installed_packages(ignore_dot_gap=True) == all_installed_packages(gap=gap, ignore_dot_gap=True)
-         True
-     """
diff --git a/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch b/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
deleted file mode 100644
index d331a6573e1c..000000000000
--- a/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/src/sage/data_structures/stream.py b/src/sage/data_structures/stream.py
-index f8f6dc6a186..002e925f02f 100644
---- a/src/sage/data_structures/stream.py
-+++ b/src/sage/data_structures/stream.py
-@@ -2090,8 +2090,8 @@ def compute_product(self, n, la):
-             sage: f = Stream_exact([1]) # irrelevant for this test
-             sage: g = Stream_function(lambda n: s[n], True, 0)
-             sage: h = Stream_plethysm(f, g, True, p)
--            sage: B = p[2, 2, 1](sum(s[i] for i in range(7)))
--            sage: all(h.compute_product(k, Partition([2, 2, 1])) == B.restrict_degree(k) for k in range(7))
-+            sage: B = p[2, 2, 1](sum(p(s[i]) for i in range(7)))  # long time
-+            sage: all(h.compute_product(k, Partition([2, 2, 1])) == B.restrict_degree(k) for k in range(7))  # long time
-             True
-         """
-         # This is the approximate order of the result
diff --git a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch b/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
deleted file mode 100644
index 007f3324cfe4..000000000000
--- a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index b77c69b2f77..0586a96ae55 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -563,7 +563,7 @@ def complex_to_cmap_rgb(z_values, cmap='turbo', contoured=False, tiled=False,
-     import matplotlib as mpl
- 
-     if isinstance(cmap, str):
--        cmap = mpl.cm.get_cmap(cmap)
-+        cmap = mpl.colormaps[cmap]
- 
-     if contour_base is None:
-         if contour_type == "linear":
-@@ -1206,11 +1206,11 @@ def complex_plot(f, x_range, y_range, contoured=False, tiled=False, cmap=None,
-                 domain = np.linspace(0, 1, 256)
-                 shifted_domain = np.roll(domain, 128)
-                 default_cmap = mpl.colors.LinearSegmentedColormap.from_list(
--                    "sage_default", mpl.cm.get_cmap('hsv')(shifted_domain)
-+                    "sage_default", mpl.colormaps['hsv'](shifted_domain)
-                 )
-                 cmap = default_cmap
-             else:
--                cmap = mpl.cm.get_cmap(cmap)
-+                cmap = mpl.colormaps[cmap]
-         rgbs = complex_to_cmap_rgb(
-             z_values, cmap=cmap, contoured=contoured, tiled=tiled,
-             contour_type=contour_type, contour_base=contour_base,
-diff --git a/src/sage/plot/contour_plot.py b/src/sage/plot/contour_plot.py
-index c0cab456686..4accb309580 100644
---- a/src/sage/plot/contour_plot.py
-+++ b/src/sage/plot/contour_plot.py
-@@ -848,9 +848,7 @@ def f(x,y): return cos(x) + sin(y)
- 
-         sage: contour_plot(lambda x,y: 0, (-1,1), (-1,1),
-         ....:              contours=[0], fill=False, cmap=['blue'])
--        ...
--        UserWarning: No contour levels were found within the data range.
--        Graphics object consisting of 1 graphics primitive
-+        ...Graphics object consisting of 1 graphics primitive
- 
-     .. PLOT::
- 
-@@ -874,8 +872,7 @@ def f(x,y): return cos(x) + sin(y)
-     Check that :trac:`18074` is fixed::
- 
-         sage: contour_plot(0, (0,1), (0,1))
--        ... UserWarning: No contour levels were found within the data range.
--        Graphics object consisting of 1 graphics primitive
-+        ...Graphics object consisting of 1 graphics primitive
- 
-     Domain points in :trac:`11648` with complex output are now skipped::
- 
-diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
-index 64ea1a7e10f..cdc99ced263 100644
---- a/src/sage/plot/graphics.py
-+++ b/src/sage/plot/graphics.py
-@@ -2341,7 +2341,7 @@ def _matplotlib_tick_formatter(self, subplot, base=(10, 10),
-             sage: subplot = Figure().add_subplot(111)
-             sage: p._objects[0]._render_on_subplot(subplot)
-             sage: p._matplotlib_tick_formatter(subplot, **d)
--            (<AxesSubplot:...>,
-+            (<Axes...>,
-             <matplotlib.ticker.MaxNLocator object at ...>,
-             <matplotlib.ticker.MaxNLocator object at ...>,
-             <matplotlib.ticker.ScalarFormatter object at ...>,
-diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
-index 99c817f03a6..ae85183dc93 100644
---- a/src/sage/plot/multigraphics.py
-+++ b/src/sage/plot/multigraphics.py
-@@ -1207,7 +1207,7 @@ def _add_subplot(self, figure, index, **options):
-             sage: fig = Figure()
-             sage: ax1 = G._add_subplot(fig, 0)
-             sage: type(ax1)
--            <class 'matplotlib.axes._subplots.AxesSubplot'>
-+            <class 'matplotlib.axes...'>
-             sage: ax2 = G._add_subplot(fig, 1)
-             sage: fig.get_axes() == [ax1, ax2]
-             True
-diff --git a/src/sage/plot/plot3d/plot_field3d.py b/src/sage/plot/plot3d/plot_field3d.py
-index bdf39391d3e..fe10e27f58f 100644
---- a/src/sage/plot/plot3d/plot_field3d.py
-+++ b/src/sage/plot/plot3d/plot_field3d.py
-@@ -126,9 +126,9 @@ def plot_vector_field3d(functions, xrange, yrange, zrange,
-     vectors = [vector((ff(*point), gg(*point), hh(*point))) for point in points]
- 
-     try:
--        from matplotlib.cm import get_cmap
--        cm = get_cmap(colors)
--    except (TypeError, ValueError):
-+        import matplotlib as mpl
-+        cm = mpl.colormaps[colors]
-+    except (TypeError, KeyError):
-         cm = None
-     if cm is None:
-         if isinstance(colors, (list, tuple)):
diff --git a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch b/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
deleted file mode 100644
index 1e0a708e8068..000000000000
--- a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py
-index c9ca5e30939..9459cb70334 100644
---- a/src/sage/interfaces/maxima_lib.py
-+++ b/src/sage/interfaces/maxima_lib.py
-@@ -77,6 +77,26 @@
-     sage: bar == foo
-     True
- 
-+TESTS:
-+
-+Check our workaround for a race in ecl works, see :trac:`26968`.
-+We use a temporary `MAXIMA_USERDIR` so it's empty; we place it
-+in `DOT_SAGE` since we expect it to have more latency than `/tmp`.
-+
-+    sage: import tempfile, subprocess
-+    sage: tmpdir = tempfile.TemporaryDirectory(dir=DOT_SAGE)
-+    sage: _ = subprocess.run(['sage', '-c',  # long time
-+    ....: f'''
-+    ....: import os
-+    ....: os.environ["MAXIMA_USERDIR"] = "{tmpdir.name}"
-+    ....: if not os.fork():
-+    ....:     import sage.interfaces.maxima_lib
-+    ....: else:
-+    ....:     import sage.interfaces.maxima_lib
-+    ....:     os.wait()
-+    ....: '''])
-+    sage: tmpdir.cleanup()
-+
- """
- 
- # ****************************************************************************
-@@ -116,7 +136,23 @@
- ecl_eval("(setq $nolabels t))")
- ecl_eval("(defvar *MAXIMA-LANG-SUBDIR* NIL)")
- ecl_eval("(set-locale-subdir)")
--ecl_eval("(set-pathnames)")
-+
-+try:
-+    ecl_eval("(set-pathnames)")
-+except RuntimeError:
-+    # Recover from :trac:`26968` by creating `*maxima-objdir*` here.
-+    # This cannot be done before calling `(set-pathnames)` since
-+    # `*maxima-objdir*` is computed there.
-+    # We use python `os.makedirs()` which is immune to the race.
-+    # Using `(ensure-directories-exist ...)` in lisp would be
-+    # subject to the same race condition and since `*maxima-objdir*`
-+    # has multiple components this is quite plausible to happen.
-+    maxima_objdir = ecl_eval("*maxima-objdir*").python()[1:-1]
-+    import os
-+    os.makedirs(maxima_objdir, exist_ok=True)
-+    # Call `(set-pathnames)` again to complete its job.
-+    ecl_eval("(set-pathnames)")
-+
- ecl_eval("(defun add-lineinfo (x) x)")
- ecl_eval('(defun principal nil (cond ($noprincipal (diverg)) ((not pcprntd) (merror "Divergent Integral"))))')
- ecl_eval("(remprop 'mfactorial 'grind)")  # don't use ! for factorials (#11539)
diff --git a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch b/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
deleted file mode 100644
index fc3e40da2a88..000000000000
--- a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff --git a/src/bin/sage-cleaner b/src/bin/sage-cleaner
-index e2e578eec60..dc7d8f0482e 100755
---- a/src/bin/sage-cleaner
-+++ b/src/bin/sage-cleaner
-@@ -99,6 +99,15 @@ def cleanup():
- 
-     return len(pid_list)
- 
-+def cleanup_cruft():
-+    """ remove directories leftover from improper shutdown """
-+    tmp_dirs = os.listdir(SAGE_TMP_ROOT)
-+    for dir_entry in tmp_dirs:
-+        baddir = os.path.join(SAGE_TMP_ROOT, dir_entry)
-+        if os.path.isdir(baddir):
-+            logger.warning('Removing old directory %s from SAGE_TMP_ROOT', baddir)
-+            rm_rf(baddir)
-+
- def kill_spawned_jobs(jobfile, parent_pid):
-     logger.info("Killing %s's spawned jobs", parent_pid)
-     killed_them_all = True
-@@ -193,6 +202,7 @@ if __name__ == '__main__':
-     setup_daemon()
-     fix_old_mistakes()
-     logger.info("Starting sage-cleaner with PID %s", os.getpid())
-+    cleanup_cruft()
- 
-     if len(sys.argv) > 1:
-         wait = int(sys.argv[1])
diff --git a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch b/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
deleted file mode 100644
index ea210e20ae52..000000000000
--- a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py
-index ec6a5c19e60..9dd7bc1cb1e 100644
---- a/src/sage/graphs/generators/families.py
-+++ b/src/sage/graphs/generators/families.py
-@@ -3660,7 +3660,7 @@ def nauty_gentreeg(options="", debug=False):
- 
-         sage: gen = graphs.nauty_gentreeg("4", debug=True)
-         sage: print(next(gen))
--        >A ...gentreeg Z=2:3 D=3 n=4
-+        >A ...gentreeg ...
-         sage: gen = graphs.nauty_gentreeg("4 -q", debug=True)
-         sage: next(gen)
-         ''
-@@ -3687,7 +3687,7 @@ def nauty_gentreeg(options="", debug=False):
-         sage: list(graphs.nauty_gentreeg("3 -x", debug=True))
-         ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n [res/mod] ...
-         sage: list(graphs.nauty_gentreeg("3", debug=True))
--        ['>A ...gentreeg Z=2:2 D=2 n=3\n', Graph on 3 vertices]
-+        ['>A ...gentreeg ...\n', Graph on 3 vertices]
-     """
-     import shlex
-     from sage.features.nauty import NautyExecutable
-diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py
-index df88bbe2713..1a8016976c2 100644
---- a/src/sage/graphs/graph_generators.py
-+++ b/src/sage/graphs/graph_generators.py
-@@ -966,7 +966,7 @@ def nauty_geng(self, options="", debug=False):
-             ...
-             ValueError: wrong format of parameter option
-             sage: list(graphs.nauty_geng("-c3", debug=True))
--            ['>E Usage: ...geng [-cCmtfbd#D#] [-uygsnh] [-lvq] ...
-+            ['>E Usage: ...geng ...\n']
-             sage: list(graphs.nauty_geng("-c 3", debug=True))
-             ['>A ...geng -cd1D2 n=3 e=2-3\n', Graph on 3 vertices, Graph on 3 vertices]
-         """
diff --git a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch b/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
deleted file mode 100644
index 46bda084e48e..000000000000
--- a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-diff --git a/src/sage/repl/inputhook.py b/src/sage/repl/inputhook.py
-index da5df0268c0..7f7894f6dcf 100644
---- a/src/sage/repl/inputhook.py
-+++ b/src/sage/repl/inputhook.py
-@@ -17,6 +17,8 @@
- 
- import select
- import errno
-+import contextlib
-+import io
- 
- from IPython import get_ipython
- from IPython.terminal.pt_inputhooks import register
-@@ -47,15 +49,27 @@ def install():
-     """
-     Install the Sage input hook
- 
--    EXAMPLES::
-+    EXAMPLES:
-+
-+    Make sure ipython is running so we really test this function::
-+
-+        sage: from sage.repl.interpreter import get_test_shell
-+        sage: get_test_shell()
-+        <sage.repl.interpreter.SageTestShell object at ...>
-+
-+    Run the function twice, to check it is idempotent (see :trac:`35235`)::
- 
-         sage: from sage.repl.inputhook import install
-         sage: install()
-+        sage: install()
-     """
-     ip = get_ipython()
-     if not ip:
-         return   # Not running in ipython, e.g. doctests
--    ip.enable_gui('sage')
-+    if ip._inputhook != sage_inputhook:
-+        # silence `ip.enable_gui()` useless output
-+        with contextlib.redirect_stdout(io.StringIO()):
-+            ip.enable_gui('sage')
- 
- 
- def uninstall():
-@@ -71,4 +85,6 @@ def uninstall():
-     if not ip:
-         return
-     if ip._inputhook == sage_inputhook:
--        ip.enable_gui(None)
-+        # silence `ip.enable_gui()` useless output
-+        with contextlib.redirect_stdout(io.StringIO()):
-+            ip.enable_gui(None)
diff --git a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch b/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
deleted file mode 100644
index 2cdc674d4f9e..000000000000
--- a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 532fbbaf71bb41c73920b584108eb2a09d6deeb1 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
-Date: Tue, 4 Apr 2023 12:56:57 -0300
-Subject: [PATCH] Ignore deprecation warnings triggered by pythran 0.12.1
-
-These happen with python 3.11, setuptools 67.6.1, numpy 1.24.2.
-When pythran 0.12.1 is installed, I get 24 doctest failures due to
-deprecation warnings; they are all gone with this commit.
-
-[backported from 839a6e928c264a9863bd42860c78ae95a6d9f3e0]
----
- src/sage/all.py | 12 ++++++++++--
- 1 file changed, 10 insertions(+), 2 deletions(-)
-
-diff --git a/src/sage/all.py b/src/sage/all.py
-index 93588df1b93..ee775aad0e9 100644
---- a/src/sage/all.py
-+++ b/src/sage/all.py
-@@ -96,9 +96,17 @@ warnings.filterwarnings('ignore', category=DeprecationWarning,
- warnings.filterwarnings('ignore', category=DeprecationWarning,
-     module='(.*[.]_vendor[.])?packaging')
- 
--# Ignore numpy warnings triggered by pythran
-+# Ignore a few warnings triggered by pythran 0.12.1
- warnings.filterwarnings('ignore', category=DeprecationWarning,
--                        module='pythran')
-+    message='\n\n  `numpy.distutils` is deprecated since NumPy 1.23.0',
-+    module='pythran.dist')
-+warnings.filterwarnings('ignore', category=DeprecationWarning,
-+    message='pkg_resources is deprecated as an API|'
-+            'Deprecated call to `pkg_resources.declare_namespace(.*)`',
-+    module='pkg_resources')
-+warnings.filterwarnings('ignore', category=DeprecationWarning,
-+    message='msvccompiler is deprecated and slated to be removed',
-+    module='distutils.msvccompiler')
- 
- warnings.filterwarnings('ignore', category=DeprecationWarning,
-                         message='The distutils(.sysconfig module| package) is deprecated',
--- 
-2.40.0
-
diff --git a/srcpkgs/sagemath/patches/35584-networkx_3.1.patch b/srcpkgs/sagemath/patches/35584-networkx_3.1.patch
index 66eedecff7c6..9331258986d3 100644
--- a/srcpkgs/sagemath/patches/35584-networkx_3.1.patch
+++ b/srcpkgs/sagemath/patches/35584-networkx_3.1.patch
@@ -1,8 +1,8 @@
 diff --git a/src/sage/graphs/graph.py b/src/sage/graphs/graph.py
-index c2e42bcbd3..b6a10efbf4 100644
+index c2e42bcbd38..0d13f071dc4 100644
 --- a/src/sage/graphs/graph.py
 +++ b/src/sage/graphs/graph.py
-@@ -6786,13 +6786,21 @@ def cliques_number_of(self, vertices=None, cliques=None):
+@@ -6786,13 +6786,26 @@ def cliques_number_of(self, vertices=None, cliques=None):
              {(0, 0): 2, (0, 1): 3, (0, 2): 2, (1, 0): 2, (1, 1): 3, (1, 2): 2}
              sage: F.cliques_number_of(vertices=[(0, 1), (1, 2)])
              {(0, 1): 3, (1, 2): 2}
@@ -18,15 +18,20 @@ index c2e42bcbd3..b6a10efbf4 100644
 +        if cliques is None:
 +            cliques = self.cliques_maximal()
 +
-+        if vertices in self: # single vertex
++        if vertices in self:  # single vertex
 +            return sum(1 for c in cliques if vertices in c)
-+        else:
-+            return { v : sum(1 for c in cliques if v in c)
-+                     for v in vertices or self }
++
++        from collections import Counter
++        count = Counter()
++
++        for c in cliques:
++            count.update(c)
++
++        return {v : count[v] for v in vertices or self}
  
      @doc_index("Clique-related methods")
      def cliques_get_max_clique_graph(self):
-@@ -7493,17 +7501,32 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
+@@ -7493,17 +7506,32 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
  
              sage: C = Graph('DJ{')
              sage: C.cliques_containing_vertex()
@@ -62,7 +67,7 @@ index c2e42bcbd3..b6a10efbf4 100644
  
          Since each clique of a 2 dimensional grid corresponds to an edge, the
          number of cliques in which a vertex is involved equals its degree::
-@@ -7518,8 +7541,14 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
+@@ -7518,8 +7546,20 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
              sage: sorted(sorted(x for x in L) for L in d[(0, 1)])
              [[(0, 0), (0, 1)], [(0, 1), (0, 2)], [(0, 1), (1, 1)]]
          """
@@ -71,11 +76,17 @@ index c2e42bcbd3..b6a10efbf4 100644
 +        if cliques is None:
 +            cliques = self.cliques_maximal()
 +
-+        if vertices in self: # single vertex
++        if vertices in self:  # single vertex
 +            return [c for c in cliques if vertices in c]
-+        else:
-+            return { v : [c for c in cliques if v in c]
-+                     for v in vertices or self }
++
++        from collections import defaultdict
++        d = defaultdict(list)
++
++        for c in cliques:
++            for v in c:
++                d[v].append(c)
++
++        return {v : d[v] for v in vertices or self}
  
      @doc_index("Clique-related methods")
      def clique_complex(self):
diff --git a/srcpkgs/sagemath/patches/35612-linbox_1.7.patch b/srcpkgs/sagemath/patches/35612-linbox_1.7.0.patch
similarity index 100%
rename from srcpkgs/sagemath/patches/35612-linbox_1.7.patch
rename to srcpkgs/sagemath/patches/35612-linbox_1.7.0.patch
diff --git a/srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch b/srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch
new file mode 100644
index 000000000000..25b39424d98d
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch
@@ -0,0 +1,578 @@
+diff --git a/build/pkgs/ecl/dependencies b/build/pkgs/ecl/dependencies
+index cda6316bf5a..51a953403e9 100644
+--- a/build/pkgs/ecl/dependencies
++++ b/build/pkgs/ecl/dependencies
+@@ -1,4 +1,4 @@
+-$(MP_LIBRARY) readline gc libffi
++$(MP_LIBRARY) readline gc libffi info
+ 
+ ----------
+ All lines of this file are ignored except the first.
+diff --git a/build/pkgs/ecl/spkg-configure.m4 b/build/pkgs/ecl/spkg-configure.m4
+index ae1e0ac5e1a..7dbcfa6377b 100644
+--- a/build/pkgs/ecl/spkg-configure.m4
++++ b/build/pkgs/ecl/spkg-configure.m4
+@@ -35,10 +35,7 @@ SAGE_SPKG_CONFIGURE([ecl], [
+     AC_SUBST(SAGE_ECL_CONFIG, [$ECL_CONFIG])
+   fi
+ 
+-  # Maxima cannot yet be provided by the system, so we always use
++  # Kenzo cannot yet be provided by the system, so we always use
+   # the SAGE_LOCAL path for now.
+-  AC_SUBST(SAGE_MAXIMA_FAS, ['${prefix}'/lib/ecl/maxima.fas])
+-
+-  # Likewise for the optional Kenzo SPKG
+   AC_SUBST(SAGE_KENZO_FAS, ['${prefix}'/lib/ecl/kenzo.fas])
+ ])
+diff --git a/build/pkgs/ecl/spkg-install.in b/build/pkgs/ecl/spkg-install.in
+index ee1667aec16..72083337942 100644
+--- a/build/pkgs/ecl/spkg-install.in
++++ b/build/pkgs/ecl/spkg-install.in
+@@ -31,18 +31,6 @@ cp "$SAGE_ROOT"/config/config.* src
+ 
+ if [ x"$SAGE_SPKG_INSTALL_DOCS" != xyes ] ; then
+     ECL_CONFIGURE="$ECL_CONFIGURE --enable-manual=no"
+-else
+-    # ECL 2020 needs modern makeinfo
+-    command -v texi2any >/dev/null 2>&1
+-    if [ $? -ne 0 ]; then # texi2any not found -> makeinfo too old, if present
+-        ECL_CONFIGURE="$ECL_CONFIGURE --enable-manual=no"
+-    else
+-        if makeinfo -c foo 2>&1 | grep -q invalid; then
+-            # makeinfo found but does not support all options that ecl
+-            # likes to use
+-            ECL_CONFIGURE="$ECL_CONFIGURE --enable-manual=no"
+-        fi
+-    fi
+ fi
+ 
+ sdh_configure $SAGE_CONFIGURE_GMP \
+diff --git a/build/pkgs/giac/spkg-configure.m4 b/build/pkgs/giac/spkg-configure.m4
+index 5859e35f12e..b677184b7be 100644
+--- a/build/pkgs/giac/spkg-configure.m4
++++ b/build/pkgs/giac/spkg-configure.m4
+@@ -5,7 +5,7 @@ SAGE_SPKG_CONFIGURE([giac], [
+        m4_pushdef([GIAC_MAX_VERSION], [1.9.999])
+        AC_CACHE_CHECK([for giac >= ]GIAC_MIN_VERSION[, <= ]GIAC_MAX_VERSION, [ac_cv_path_GIAC], [
+          AC_PATH_PROGS_FEATURE_CHECK([GIAC], [giac], [
+-            giac_version=$($ac_path_GIAC --version 2> /dev/null | tail -1)
++            giac_version=$($ac_path_GIAC --version 2> /dev/null | tail -n -1)
+             AS_IF([test -n "$giac_version"], [
+                 AX_COMPARE_VERSION([$giac_version], [ge], GIAC_MIN_VERSION, [
+                     AX_COMPARE_VERSION([$giac_version], [le], GIAC_MAX_VERSION, [
+diff --git a/build/pkgs/info/spkg-configure.m4 b/build/pkgs/info/spkg-configure.m4
+index 0980a4b8ef8..85fe1ea4731 100644
+--- a/build/pkgs/info/spkg-configure.m4
++++ b/build/pkgs/info/spkg-configure.m4
+@@ -1,4 +1,14 @@
+ SAGE_SPKG_CONFIGURE([info], [
+   AC_PATH_PROG(INFO, info)
+-  AS_IF([test -z "${INFO}"], [sage_spkg_install_info=yes])
++  AS_IF([test -z "${INFO}"], [sage_spkg_install_info=yes
++    ], [
++     dnl very old makeinfo are not texi2any, newer are symlinks to texi2any
++     AC_PATH_PROG(TEXI2ANY, texi2any)
++     AS_IF([test -z "${TEXI2ANY}"], [sage_spkg_install_info=yes
++       ], [
++        AS_IF([makeinfo -c foo 2>&1 | grep -q invalid], [
++         dnl makeinfo found, but too old, and  does not support all options that ecl likes to use
++         sage_spkg_install_info=yes])
++       ])
++    ])
+ ])
+diff --git a/build/pkgs/info/spkg-install.in b/build/pkgs/info/spkg-install.in
+index 8086e4b2ec8..3ea8c053669 100644
+--- a/build/pkgs/info/spkg-install.in
++++ b/build/pkgs/info/spkg-install.in
+@@ -1,2 +1,2 @@
+-cd src/info
++cd src
+ sdh_make_install
+diff --git a/build/pkgs/info/type b/build/pkgs/info/type
+index 134d9bc32d5..a6a7b9cd726 100644
+--- a/build/pkgs/info/type
++++ b/build/pkgs/info/type
+@@ -1 +1 @@
+-optional
++standard
+diff --git a/build/pkgs/maxima/checksums.ini b/build/pkgs/maxima/checksums.ini
+index a804c7b831f..0f594389fe6 100644
+--- a/build/pkgs/maxima/checksums.ini
++++ b/build/pkgs/maxima/checksums.ini
+@@ -1,5 +1,5 @@
+ tarball=maxima-VERSION.tar.gz
+-sha1=ed15d5285794413ba94412079eca3d0fa55a47bf
+-md5=9b9ae1dace55b1386739dabaa9122e60
+-cksum=1765409766
++sha1=1010594e6d6082bbd8efaac1b7756ec1721a4ed5
++md5=3c01f1daa6936e11d8713fef7751d3fe
++cksum=2420393096
+ upstream_url=https://sourceforge.net/projects/maxima/files/Maxima-source/VERSION-source/maxima-VERSION.tar.gz/download
+diff --git a/build/pkgs/maxima/distros/arch.txt b/build/pkgs/maxima/distros/arch.txt
+index 6400290f44d..6ac052fa62b 100644
+--- a/build/pkgs/maxima/distros/arch.txt
++++ b/build/pkgs/maxima/distros/arch.txt
+@@ -1 +1 @@
+-maxima-ecl
++maxima-fas
+diff --git a/build/pkgs/maxima/distros/cygwin.txt b/build/pkgs/maxima/distros/cygwin.txt
+new file mode 100644
+index 00000000000..f5fe3fdc6cb
+--- /dev/null
++++ b/build/pkgs/maxima/distros/cygwin.txt
+@@ -0,0 +1 @@
++maxima
+diff --git a/build/pkgs/maxima/distros/freebsd.txt b/build/pkgs/maxima/distros/freebsd.txt
+new file mode 100644
+index 00000000000..766a71b5074
+--- /dev/null
++++ b/build/pkgs/maxima/distros/freebsd.txt
+@@ -0,0 +1 @@
++math/maxima
+diff --git a/build/pkgs/maxima/distros/gentoo.txt b/build/pkgs/maxima/distros/gentoo.txt
+new file mode 100644
+index 00000000000..85fb33f1610
+--- /dev/null
++++ b/build/pkgs/maxima/distros/gentoo.txt
+@@ -0,0 +1,2 @@
++sci-mathematics/maxima[ecls]
++
+diff --git a/build/pkgs/maxima/package-version.txt b/build/pkgs/maxima/package-version.txt
+index 83476624dc0..5681375f3be 100644
+--- a/build/pkgs/maxima/package-version.txt
++++ b/build/pkgs/maxima/package-version.txt
+@@ -1 +1 @@
+-5.45.0.p0
++5.46.0
+diff --git a/build/pkgs/maxima/patches/matrixexp.patch b/build/pkgs/maxima/patches/matrixexp.patch
+deleted file mode 100644
+index 5c8527c33bf..00000000000
+--- a/build/pkgs/maxima/patches/matrixexp.patch
++++ /dev/null
+@@ -1,15 +0,0 @@
+-diff --git a/share/linearalgebra/matrixexp.lisp b/share/linearalgebra/matrixexp.lisp
+-index 218bf35..f2fd468 100644
+---- a/share/linearalgebra/matrixexp.lisp
+-+++ b/share/linearalgebra/matrixexp.lisp
+-@@ -138,8 +138,8 @@
+- 	   (print `(ratvars = ,$ratvars gcd = '$gcd algebraic = ,$algebraic))
+- 	   (print `(ratfac = ,$ratfac))
+- 	   (merror "Unable to find the spectrum")))
+--   
+--    (setq res ($fullratsimp (ncpower (sub (mult z ($ident n)) mat) -1) z))
+-+
+-+    (setq res ($fullratsimp ($invert_by_lu (sub (mult z ($ident n)) mat) '$crering) z))
+-     (setq m (length sp))
+-     (dotimes (i m)
+-       (setq zi (nth i sp))
+diff --git a/build/pkgs/maxima/patches/maxima.system.patch b/build/pkgs/maxima/patches/maxima.system.patch
+deleted file mode 100644
+index 74db62e7f9f..00000000000
+--- a/build/pkgs/maxima/patches/maxima.system.patch
++++ /dev/null
+@@ -1,25 +0,0 @@
+-diff --git a/src/maxima.system b/src/maxima.system
+-index 76f2452..cf25f51 100644
+---- a/src/maxima.system
+-+++ b/src/maxima.system
+-@@ -1,5 +1,8 @@
+- ;;; -*- Lisp -*-
+- 
+-+(require :cmp)
+-+(setf c::*compile-in-constants* t)
+-+
+- (in-package :cl-user)
+- 
+- (pushnew :cl *features*)
+-@@ -75,6 +78,11 @@
+- 			     ;; Convert dir/foo.fas to dir/foo.o
+- 			     (make-pathname :type "o" :defaults p))
+- 			 files)))
+-+	(c::build-fasl "binary-ecl/maxima" :lisp-files obj
+-+			  :ld-flags
+-+			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
+-+							      (find-package "MAXIMA")))))
+-+			    (if (and x (not (string= x ""))) (list x))))
+- 	(c::build-program "binary-ecl/maxima" :lisp-files obj
+- 			  :ld-flags
+- 			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
+diff --git a/build/pkgs/maxima/spkg-configure.m4 b/build/pkgs/maxima/spkg-configure.m4
+new file mode 100644
+index 00000000000..dc54525320e
+--- /dev/null
++++ b/build/pkgs/maxima/spkg-configure.m4
+@@ -0,0 +1,46 @@
++SAGE_SPKG_CONFIGURE([maxima], [
++  m4_pushdef([SAGE_MAXIMA_MINVER],["5.45.0"])dnl this version and higher allowed
++  SAGE_SPKG_DEPCHECK([ecl], [
++    dnl First check for the "maxima" executable in the user's PATH, because
++    dnl we still use pexpect to communicate with it in a few places.
++    AC_CACHE_CHECK([for Maxima >= $SAGE_MAXIMA_MINVER], [ac_cv_path_MAXIMA], [
++        AC_PATH_PROGS_FEATURE_CHECK([MAXIMA], [maxima], [
++            maxima_version=`$ac_path_MAXIMA --version 2>&1 | tail -n -1\
++                | $SED -n -e 's/Maxima *\([[0-9]]*\.[[0-9]]*\.[[0-9]]*\)/\1/p'`
++            AS_IF([test -n "$maxima_version"], [
++                AX_COMPARE_VERSION([$maxima_version], [ge], [SAGE_MAXIMA_MINVER], [
++                    ac_cv_path_MAXIMA="$ac_path_MAXIMA"
++                    ac_path_MAXIMA_found=:
++                ])
++            ])
++        ])
++    ])
++    SAGE_MAXIMA="$ac_cv_path_MAXIMA"
++    AS_IF([test -z "${SAGE_MAXIMA}"], [
++      sage_spkg_install_maxima=yes
++    ],[
++      dnl If we have the executable, check also for the ECL library.
++      AC_MSG_CHECKING([if ECL can "require" the maxima module])
++      AS_IF([ecl --eval "(require 'maxima)" --eval "(quit)" \
++               >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD], [
++        AC_MSG_RESULT(yes)
++      ], [
++        AC_MSG_RESULT(no)
++        sage_spkg_install_maxima=yes
++      ])
++    ])
++  ])
++  m4_popdef([SAGE_MAXIMA_MINVER])
++],[],[],[
++  # post-check
++  AS_IF([test x$sage_spkg_install_maxima = xyes], [
++    dnl Leaving this variable empty will tell sagelib to load
++    dnl the maxima library (within ECL) by name instead of by
++    dnl absolute path.
++    SAGE_MAXIMA='${prefix}'/bin/maxima
++    SAGE_MAXIMA_FAS='${prefix}'/lib/ecl/maxima.fas
++  ])
++
++  AC_SUBST(SAGE_MAXIMA, "${SAGE_MAXIMA}")
++  AC_SUBST(SAGE_MAXIMA_FAS, "${SAGE_MAXIMA_FAS}")
++])
+diff --git a/build/pkgs/maxima/spkg-install.in b/build/pkgs/maxima/spkg-install.in
+index 3ae6382f9ba..cdb6fbf2069 100644
+--- a/build/pkgs/maxima/spkg-install.in
++++ b/build/pkgs/maxima/spkg-install.in
+@@ -28,28 +28,6 @@ echo
+ echo "Now configuring Maxima..."
+ sdh_configure --enable-ecl git_found=false
+ 
+-# Note the following is regression in maxima build system
+-# see https://sourceforge.net/p/maxima/bugs/3278/
+-# and https://sourceforge.net/p/maxima/bugs/2878/
+-# For the previous time it was fixed.
+-#---------------------------------------------------------------
+-# Touching html and info file to avoid to regenerate them.
+-# This must be done after configuration since the timestamp need
+-# to be later than include-maxima.texi which is generated at
+-# configuration time
+-for i in doc/info/*.html ; do
+-    touch "${i}"
+-done
+-touch doc/info/maxima.info*
+-# Maxima 5.44.0 build_html.sh is not compatible with makeinfo 4.8
+-# (which is /usr/bin/makeinfo on macOS).  #30063
+-# Do not build the HTML docs unless the user asks for it,
+-# in which case it is their problem to install a better
+-# makeinfo version.
+-if [[ "$SAGE_SPKG_INSTALL_DOCS" != yes ]] ; then
+-touch doc/info/maxima_toc.html interfaces/xmaxima/doc/xmaxima.html
+-fi
+-
+ #---------------------------------------------------------------
+ 
+ sdh_make
+diff --git a/build/pkgs/tox/spkg-configure.m4 b/build/pkgs/tox/spkg-configure.m4
+index 7d8ade4c14b..3de0b9b710d 100644
+--- a/build/pkgs/tox/spkg-configure.m4
++++ b/build/pkgs/tox/spkg-configure.m4
+@@ -5,7 +5,7 @@ SAGE_SPKG_CONFIGURE([tox], [
+        m4_pushdef([TOX4_MIN_VERSION], [4.0.15])
+        AC_CACHE_CHECK([for tox 3 >= ]TOX3_MIN_VERSION[ or tox 4 >= ]TOX4_MIN_VERSION, [ac_cv_path_TOX], [
+          AC_PATH_PROGS_FEATURE_CHECK([TOX], [tox], [
+-            tox_version=$($ac_path_TOX --version 2> /dev/null | tail -1)
++            tox_version=$($ac_path_TOX --version 2> /dev/null | tail -n -1)
+             AS_IF([test -n "$tox_version"], [
+                 AX_COMPARE_VERSION([$tox_version], [lt], [4], [
+                     AX_COMPARE_VERSION([$tox_version], [ge], TOX3_MIN_VERSION, [
+diff --git a/pkgs/sage-conf/_sage_conf/_conf.py.in b/pkgs/sage-conf/_sage_conf/_conf.py.in
+index d66bdb3d264..f2e197b45ed 100644
+--- a/pkgs/sage-conf/_sage_conf/_conf.py.in
++++ b/pkgs/sage-conf/_sage_conf/_conf.py.in
+@@ -9,9 +9,11 @@ VERSION = "@PACKAGE_VERSION@"
+ SAGE_LOCAL = "@prefix@"
+ SAGE_ROOT = "@SAGE_ROOT@"
+ 
+-MAXIMA = "@prefix@/bin/maxima"
++# The path to the standalone maxima executable.
++MAXIMA = "@SAGE_MAXIMA@".replace('${prefix}', SAGE_LOCAL)
+ 
+-# Delete this line if your ECL can load maxima without further prodding.
++# Set this to the empty string if your ECL can load maxima without
++# further prodding.
+ MAXIMA_FAS = "@SAGE_MAXIMA_FAS@".replace('${prefix}', SAGE_LOCAL)
+ 
+ # Delete this line if your ECL can load Kenzo without further prodding.
+diff --git a/src/bin/sage-env b/src/bin/sage-env
+index a7da60df28f..13b54fa7e92 100644
+--- a/src/bin/sage-env
++++ b/src/bin/sage-env
+@@ -440,9 +440,6 @@ if [ -d "$DOT_SAGE" ] ; then
+     fi
+ fi
+ 
+-if [ -n "$SAGE_LOCAL" ]; then
+-    export MAXIMA_PREFIX="$SAGE_LOCAL"
+-fi
+ export MAXIMA_USERDIR="$DOT_SAGE/maxima"
+ 
+ if [ -n "$SAGE_LOCAL" ]; then
+diff --git a/src/sage/calculus/calculus.py b/src/sage/calculus/calculus.py
+index dae380180ac..e34a70d59b0 100644
+--- a/src/sage/calculus/calculus.py
++++ b/src/sage/calculus/calculus.py
+@@ -136,10 +136,11 @@
+     [          1/2*(e^(2*sqrt(x)) + 1)*e^(x - sqrt(x)) 1/2*(x*e^(2*sqrt(x)) - x)*sqrt(x)*e^(x - sqrt(x))]
+     [  1/2*(e^(2*sqrt(x)) - 1)*e^(x - sqrt(x))/x^(3/2)           1/2*(e^(2*sqrt(x)) + 1)*e^(x - sqrt(x))]
+ 
+-And complex exponentiation works now::
++Complex exponentiation works, but may require a patched version of
++maxima (:trac:`32898`) for now::
+ 
+     sage: M = i*matrix([[pi]])
+-    sage: e^M
++    sage: e^M # not tested, requires patched maxima
+     [-1]
+     sage: M = i*matrix([[pi,0],[0,2*pi]])
+     sage: e^M
+@@ -1186,8 +1187,18 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
+         e
+         sage: f.limit(x=5)
+         7776/3125
+-        sage: f.limit(x=1.2)
++
++    Domain to real, a regression in 5.46.0, see https://sf.net/p/maxima/bugs/4138 ::
++
++        sage: maxima_calculus.eval("domain:real")
++        ...
++        sage: f.limit(x=1.2).n()
+         2.06961575467...
++        sage: maxima_calculus.eval("domain:complex");
++        ...
++
++    Otherwise, it works ::
++
+         sage: f.limit(x=I, taylor=True)
+         (-I + 1)^I
+         sage: f(x=1.2)
+@@ -1203,7 +1214,7 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
+ 
+         sage: var('a')
+         a
+-        sage: limit(x^a,x=0)
++        sage: limit(x^a,x=0) # random - maxima 5.46.0 does not need extra assumption
+         Traceback (most recent call last):
+         ...
+         ValueError: Computation failed since Maxima requested additional
+@@ -1215,7 +1226,7 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
+     With this example, Maxima is looking for a LOT of information::
+ 
+         sage: assume(a>0)
+-        sage: limit(x^a,x=0)
++        sage: limit(x^a,x=0) # random - maxima 5.46.0 does not need extra assumption
+         Traceback (most recent call last):
+         ...
+         ValueError: Computation failed since Maxima requested additional
+@@ -1224,7 +1235,7 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
+          more details)
+         Is a an integer?
+         sage: assume(a,'integer')
+-        sage: limit(x^a, x=0)
++        sage: limit(x^a, x=0) # random - maxima 5.46.0 does not need extra assumption
+         Traceback (most recent call last):
+         ...
+         ValueError: Computation failed since Maxima requested additional
+@@ -2251,10 +2262,10 @@ def symbolic_expression_from_maxima_string(x, equals_sub=False, maxima=maxima):
+         True
+         sage: sefms("x # 3") == SR(x != 3)
+         True
+-        sage: solve([x != 5], x)
+-        [[x - 5 != 0]]
++        sage: solve([x != 5], x) in [[[x - 5 != 0]], [[x < 5], [5 < x]]]
++        True
+         sage: solve([2*x==3, x != 5], x)
+-        [[x == (3/2), (-7/2) != 0]]
++        [[x == (3/2)...
+ 
+     Make sure that we don't accidentally pick up variables in the maxima namespace (:trac:`8734`)::
+ 
+diff --git a/src/sage/functions/exp_integral.py b/src/sage/functions/exp_integral.py
+index e6c888c64b6..fb0e2235e2b 100644
+--- a/src/sage/functions/exp_integral.py
++++ b/src/sage/functions/exp_integral.py
+@@ -601,8 +601,8 @@ class Function_log_integral_offset(BuiltinFunction):
+         1/log(x)
+         sage: f.integrate(x)
+         -x*log_integral(2) + x*log_integral(x) - Ei(2*log(x))
+-        sage: Li(x).integrate(x,2.0,4.5)
+-        -2.5*log_integral(2) + 5.799321147411334
++        sage: Li(x).integrate(x,2.0,4.5).n()
++        3.18641169711760
+         sage: N(f.integrate(x,2.0,3.0))   # abs tol 1e-15
+         0.601621785860587
+ 
+diff --git a/src/sage/interfaces/expect.py b/src/sage/interfaces/expect.py
+index 68ae715e4c3..84adf0341b5 100644
+--- a/src/sage/interfaces/expect.py
++++ b/src/sage/interfaces/expect.py
+@@ -620,7 +620,7 @@ def quit(self, verbose=False):
+ 
+             sage: a = maxima('y')
+             sage: maxima.quit(verbose=True)
+-            Exiting Maxima with PID ... running .../bin/maxima...
++            Exiting Maxima with PID ... running ...maxima...
+             sage: a._check_valid()
+             Traceback (most recent call last):
+             ...
+diff --git a/src/sage/interfaces/maxima.py b/src/sage/interfaces/maxima.py
+index 27b1e98a6ac..4829560f98b 100644
+--- a/src/sage/interfaces/maxima.py
++++ b/src/sage/interfaces/maxima.py
+@@ -622,11 +622,6 @@ def _start(self):
+             sage: m.is_running()
+             True
+ 
+-        Test that we can use more than 256MB RAM (see :trac:`6772`)::
+-
+-            sage: a = maxima(10)^(10^5)
+-            sage: b = a^600              # long time -- about 10-15 seconds
+-
+         """
+         Expect._start(self)
+         self._sendline(r":lisp (defun tex-derivative (x l r) (tex (if $derivabbrev (tex-dabbrev x) (tex-d x '\\partial)) l r lop rop ))")
+@@ -634,9 +629,6 @@ def _start(self):
+         # Don't use ! for factorials (#11539)
+         self._sendline(":lisp (remprop 'mfactorial 'grind)")
+ 
+-        # Remove limit on the max heapsize (since otherwise it defaults
+-        # to 256MB with ECL).
+-        self._sendline(":lisp (ext:set-limit 'ext:heap-size 0)")
+         self._eval_line('0;')
+ 
+         # set random seed
+diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py
+index c263ac65f02..d6313cba055 100644
+--- a/src/sage/interfaces/maxima_lib.py
++++ b/src/sage/interfaces/maxima_lib.py
+@@ -934,8 +934,15 @@ def sr_limit(self, expr, v, a, dir=None):
+             e
+             sage: limit(f,x = 5)
+             7776/3125
+-            sage: limit(f,x = 1.2)
++
++        Domain to real, a regression in 5.46.0, see https://sf.net/p/maxima/bugs/4138 ::
++
++            sage: maxima_calculus.eval("domain:real")
++            ...
++            sage: limit(f,x = 1.2).n()
+             2.06961575467...
++            sage: maxima_calculus.eval("domain:complex");
++            ...
+             sage: var('a')
+             a
+             sage: limit(x^a,x=0)
+@@ -947,7 +954,7 @@ def sr_limit(self, expr, v, a, dir=None):
+             for more details)
+             Is a positive, negative or zero?
+             sage: assume(a>0)
+-            sage: limit(x^a,x=0)
++            sage: limit(x^a,x=0) # random - not needed for maxima 5.46.0
+             Traceback (most recent call last):
+             ...
+             ValueError: Computation failed ...
+diff --git a/src/sage/matrix/matrix2.pyx b/src/sage/matrix/matrix2.pyx
+index e2e6449dfa9..c66e6d1606a 100644
+--- a/src/sage/matrix/matrix2.pyx
++++ b/src/sage/matrix/matrix2.pyx
+@@ -15425,9 +15425,10 @@ cdef class Matrix(Matrix1):
+ 
+         TESTS:
+ 
+-        Check that sparse matrices are handled correctly (:trac:`28935`)::
++        Sparse matrices are handled correctly (:trac:`28935`), but may
++        require a patched version of maxima (:trac:`32898`) for now::
+ 
+-            sage: matrix.diagonal([0], sparse=True).exp()
++            sage: matrix.diagonal([0], sparse=True).exp() # not tested, requires patched maxima
+             [1]
+             sage: matrix.zero(CBF, 2, sparse=True).exp()
+             [1.000000000000000                 0]
+diff --git a/src/sage/matrix/matrix_symbolic_dense.pyx b/src/sage/matrix/matrix_symbolic_dense.pyx
+index 19ca5c85cb2..58a25e002f6 100644
+--- a/src/sage/matrix/matrix_symbolic_dense.pyx
++++ b/src/sage/matrix/matrix_symbolic_dense.pyx
+@@ -402,7 +402,8 @@ cdef class Matrix_symbolic_dense(Matrix_generic_dense):
+             [1/2*(e^(2*x) + 1)*e^(-x) 1/2*(e^(2*x) - 1)*e^(-x)]
+             [1/2*(e^(2*x) - 1)*e^(-x) 1/2*(e^(2*x) + 1)*e^(-x)]
+ 
+-        Exp works on 0x0 and 1x1 matrices::
++        Exponentiation works on 0x0 and 1x1 matrices, but the 1x1 example
++        requires a patched version of maxima (:trac:`32898`) for now::
+ 
+             sage: m = matrix(SR,0,[]); m
+             []
+@@ -410,7 +411,7 @@ cdef class Matrix_symbolic_dense(Matrix_generic_dense):
+             []
+             sage: m = matrix(SR,1,[2]); m
+             [2]
+-            sage: m.exp()
++            sage: m.exp()  # not tested, requires patched maxima
+             [e^2]
+ 
+         Commuting matrices `m, n` have the property that
+@@ -451,7 +452,6 @@ cdef class Matrix_symbolic_dense(Matrix_generic_dense):
+             [                       0 1/2*(e^(2*x) + 1)*e^(-x) 1/2*(e^(2*x) - 1)*e^(-x)                        0]
+             [                       0 1/2*(e^(2*x) - 1)*e^(-x) 1/2*(e^(2*x) + 1)*e^(-x)                        0]
+             [1/2*(e^(2*x) - 1)*e^(-x)                        0                        0 1/2*(e^(2*x) + 1)*e^(-x)]
+-
+         """
+         if not self.is_square():
+             raise ValueError("exp only defined on square matrices")
+diff --git a/src/sage/symbolic/integration/integral.py b/src/sage/symbolic/integration/integral.py
+index c82e9ed73c3..e84ad357ee2 100644
+--- a/src/sage/symbolic/integration/integral.py
++++ b/src/sage/symbolic/integration/integral.py
+@@ -741,14 +741,14 @@ def integrate(expression, v=None, a=None, b=None, algorithm=None, hold=False):
+ 
+         sage: _ = var('x,y')
+         sage: f = log(x^2+y^2)
+-        sage: res = integral(f,x,0.0001414, 1.); res
++        sage: res = integral(f,x,1414/10^7, 1); res
+         Traceback (most recent call last):
+         ...
+-        ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(50015104*y^2-50015103>0)', see `assume?` for more details)
+-        Is 50015104*y^2-50015103 positive, negative or zero?
++        ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help ...
++        Is ... positive, negative or zero?
+         sage: assume(y>1)
+-        sage: res = integral(f,x,0.0001414, 1.); res
+-        2*y*arctan(1.0/y) - 2*y*arctan(0.0001414/y) + 1.0*log(1.0*y^2 + 1.0) - 0.0001414*log(1.0*y^2 + 1.9993959999999997e-08) - 1.9997172
++        sage: res = integral(f,x,1414/10^7, 1); res
++        -2*y*arctan(707/5000000/y) + 2*y*arctan(1/y) + log(y^2 + 1) - 707/5000000*log(y^2 + 499849/25000000000000) - 4999293/2500000
+         sage: nres = numerical_integral(f.subs(y=2), 0.0001414, 1.); nres
+         (1.4638323264144..., 1.6251803529759...e-14)
+         sage: res.subs(y=2).n()
+diff --git a/src/sage/symbolic/relation.py b/src/sage/symbolic/relation.py
+index 94813315181..a72ab547c76 100644
+--- a/src/sage/symbolic/relation.py
++++ b/src/sage/symbolic/relation.py
+@@ -1787,8 +1787,8 @@ def solve_ineq_fourier(ineq, vars=None):
+         sage: y = var('y')
+         sage: solve_ineq_fourier([x+y<9,x-y>4],[x,y])
+         [[y + 4 < x, x < -y + 9, y < (5/2)]]
+-        sage: solve_ineq_fourier([x+y<9,x-y>4],[y,x])
+-        [[y < min(x - 4, -x + 9)]]
++        sage: solve_ineq_fourier([x+y<9,x-y>4],[y,x])[0][0](x=42)
++        y < -33
+ 
+         sage: solve_ineq_fourier([x^2>=0])
+         [[x < +Infinity]]
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index db36086fc9f9..1e3d30c144e8 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 URL_BASE_PR="https://github.com/sagemath/sage/pull/"
-URL_BASE_COMPARE="https://github.com/sagemath/sage/compare/9.8..."
+URL_BASE_COMPARE="https://github.com/sagemath/sage/compare/10.0.rc0..."
 
 case "$1" in
 	-n)  DO=echo ;;
@@ -15,50 +15,10 @@ get_pr() {
 	$DO wget "$URL_BASE_PR$pr.$ext" -O "$pr-$desc.patch"
 }
 
-get_trac() {
-	ticket=$1
-	desc=$(echo "$2" | sed -e 's/ /_/g')
-	commit=$3
-	$DO wget "$URL_BASE_COMPARE$commit.diff" -O "$ticket-$desc-$commit.patch"
-}
-
 # run from patches dir
 cd $(dirname "$0")
 
-# merged in 10.0.beta0
-get_trac 34851 "support singular 4.3.1.p3" 5e5737a0c
-get_pr 35068 "fix tests giac 1.9.0.35" patch
-
-# merged in 10.0.beta1
-get_pr 35058 "skip unstable tests klyachko"
-
-# merged in 10.0.beta2
-get_pr 34994 "fix tests numpy 1.24"
-get_pr 34997 "fix edge case of integer_check"
-
-# merged in 10.0.beta3
-get_pr 34995 "support tachyon 0.99.2"
-
-# merged in 10.0.beta4
-get_pr 34980 "avoid factoring in is_prime"
-
-# merged in 10.0.beta5
-get_pr 35094 "support gap 4.12"					# includes PR 35093
-
-# merged in 10.0.beta6
-get_pr 35127 "fix very slow test stream.py"
-get_pr 35177 "matplotlib 3.7"
-get_pr 35195 "workaround ecl race"
-get_pr 35204 "fix sage-cleaner"
-
-# merged in 10.0.beta7
-get_pr 35250 "nauty 2.8.6"
-
-# merged in 10.0.beta8
-#get_pr 35337 "ipython 8.11"
-get_pr 35423 "ipython 8.12"						# includes PR 35337
-get_pr 35438 "pythran 0.12.1"
-
 # needs review
 get_pr 35584 "networkx 3.1"
-get_pr 35612 "linbox 1.7"
+get_pr 35612 "linbox 1.7.0"
+get_pr 35619 "maxima 5.46.0"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 6e794c931df4..28960aba45f9 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=9.8
-revision=3
+version=10.0.rc2
+revision=1
 build_wrksrc=pkgs/sagemath-standard
 build_style=python3-module
 _bindir=/usr/lib/sagemath/$version/bin
@@ -32,7 +32,7 @@ maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-or-later"
 homepage="http://sagemath.org/"
 distfiles="https://github.com/sagemath/sage/archive/refs/tags/$version.tar.gz"
-checksum=2aff28bd1d18c2d526581f5298acb8336f5b92db5675a7403dec8eaf9a86bc4c
+checksum=48aeca0bf68f6ed5e53ff1f439754008d6fe177e27170cdbff8861304bcd0e9c
 
 do_configure() {
 	# git tree needs bootstrapping

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [RFC] sagemath: update to 10.0.rc1.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (13 preceding siblings ...)
  2023-05-10 12:48 ` [PR PATCH] [Updated] " tornaria
@ 2023-05-10 12:55 ` tornaria
  2023-05-13  2:33 ` [PR PATCH] [Updated] [RFC] sagemath: update to 10.0.rc2 tornaria
                   ` (24 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: tornaria @ 2023-05-10 12:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 480 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43659#issuecomment-1542160865

Comment:
I've added maxima update from #36711 since sagemath is about to support it (https://github.com/sagemath/sage/pull/35619 is moving and the patch they have works for me in x86_64 -- testing now in musl and i686).

@jbgg are you still interested on maxima? I'll adopt the void package if you don't mind, so it's easier for me to track it.

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] sagemath: update to 10.0.rc2.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (14 preceding siblings ...)
  2023-05-10 12:55 ` tornaria
@ 2023-05-13  2:33 ` tornaria
  2023-05-13  3:14 ` [PR PATCH] [Updated] [RFC] sagemath: update to 10.0.rc3 tornaria
                   ` (23 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: tornaria @ 2023-05-13  2:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1700 bytes --]

There is an updated pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages sagemath-next
https://github.com/void-linux/void-packages/pull/43659

[RFC] sagemath: update to 10.0.rc2.
<!-- Uncomment relevant sections and delete options which are not applicable -->

This builds on top of #43225 for convenience.

#### Testing the changes
- I tested the changes in this PR: **briefly**

I've been following beta releases and now rc0 includes all of our patches :muscle:

All doctests pass with the version of packages in void except for `python-Babel` which must be updated (as in #43497) and is included  here as part of #43225.

I've switched my system sagemath to this version as everything seems to be working ok. The testsuite is 10-15% faster.

@dkwo: enjoy.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/43659.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-sagemath-next-43659.patch --]
[-- Type: text/x-diff, Size: 184669 bytes --]

From 92265256ae4fd80bd44178bf784b398e7d8b5fed Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Dec 2021 20:20:09 -0300
Subject: [PATCH 1/6] givaro: update to 4.2.0.

---
 srcpkgs/givaro/patches/197.patch | 28 ++++++++++++++++++++++++++++
 srcpkgs/givaro/template          |  9 ++++-----
 2 files changed, 32 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/givaro/patches/197.patch

diff --git a/srcpkgs/givaro/patches/197.patch b/srcpkgs/givaro/patches/197.patch
new file mode 100644
index 000000000000..bafaff3efbd9
--- /dev/null
+++ b/srcpkgs/givaro/patches/197.patch
@@ -0,0 +1,28 @@
+From ab3d332508c21daff41fb64a8658cdc7cc74fc47 Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
+Date: Thu, 16 Dec 2021 17:12:25 +0100
+Subject: [PATCH] dom_power argument is now an uint64_t to avoid problem with
+ 32bit machine
+
+---
+ src/kernel/system/givpower.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/kernel/system/givpower.h b/src/kernel/system/givpower.h
+index eb784872..5644264d 100644
+--- a/src/kernel/system/givpower.h
++++ b/src/kernel/system/givpower.h
+@@ -71,11 +71,11 @@ namespace Givaro {
+ 
+     //! dom_power
+     template<class D, class TT>
+-    TT& dom_power(TT& res, const TT& n, long l, const D& F)
++    TT& dom_power(TT& res, const TT& n, uint64_t l, const D& F)
+     {
+         if (l == 0) return F.assign(res,F.one) ;
+ 
+-        unsigned long p = (unsigned long) l ;
++        uint64_t p = l;
+         bool is_assg = false ;
+ 
+         TT puiss; F.init(puiss); F.assign(puiss,n) ;
diff --git a/srcpkgs/givaro/template b/srcpkgs/givaro/template
index 9c16de5b1974..52457c02a1ed 100644
--- a/srcpkgs/givaro/template
+++ b/srcpkgs/givaro/template
@@ -1,6 +1,6 @@
 # Template file for 'givaro'
 pkgname=givaro
-version=4.1.1
+version=4.2.0
 revision=1
 build_style=gnu-configure
 makedepends="gmpxx-devel"
@@ -8,16 +8,15 @@ short_desc="C++ library for arithmetic and algebraic computations"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="CECILL-B"
 homepage="https://github.com/linbox-team/givaro"
+changelog="https://github.com/linbox-team/givaro/raw/master/ChangeLog"
 distfiles="https://github.com/linbox-team/givaro/releases/download/v${version}/givaro-${version}.tar.gz"
-checksum=628049899386e91da245aee6cd446350fbca87e94863bc0d815066c08150487f
+checksum=865e228812feca971dfb6e776a7bc7ac959cf63ebd52b4f05492730a46e1f189
 nocross=yes
 
 build_options="native_build"
 
 if [ -z "$build_option_native_build" ]; then
-	configure_args="--enable-sse --enable-sse2
-	  --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42
-	  --disable-avx --disable-avx2 --disable-fma --disable-fma4"
+	configure_args="--without-archnative"
 fi
 
 post_install() {

From 7b5864c912997f30fe44e745bad49647455cb302 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Dec 2021 20:20:17 -0300
Subject: [PATCH 2/6] fflas-ffpack: update to 2.5.0.

---
 srcpkgs/fflas-ffpack/patches/357.patch | 35 ++++++++++++++++++++++++++
 srcpkgs/fflas-ffpack/template          | 12 ++++-----
 2 files changed, 40 insertions(+), 7 deletions(-)
 create mode 100644 srcpkgs/fflas-ffpack/patches/357.patch

diff --git a/srcpkgs/fflas-ffpack/patches/357.patch b/srcpkgs/fflas-ffpack/patches/357.patch
new file mode 100644
index 000000000000..99fd34efd93b
--- /dev/null
+++ b/srcpkgs/fflas-ffpack/patches/357.patch
@@ -0,0 +1,35 @@
+From 9b6083c663096e9ca85775b79f1f27c848dbeb98 Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
+Date: Fri, 17 Dec 2021 10:27:02 +0100
+Subject: [PATCH] Fix SimdChooser: on not x86_64 machines its value could be an
+ nonexistant struct
+
+---
+ fflas-ffpack/fflas/fflas_simd.h | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/fflas-ffpack/fflas/fflas_simd.h b/fflas-ffpack/fflas/fflas_simd.h
+index bf5d30211..84ced0fd8 100644
+--- a/fflas-ffpack/fflas/fflas_simd.h
++++ b/fflas-ffpack/fflas/fflas_simd.h
+@@ -384,6 +384,20 @@ struct SimdChooser<T, true, true> // integral number
+ #endif
+ };
+ 
++#ifndef __x86_64__
++template <>
++struct SimdChooser<uint64_t, true, true>
++{
++    using value = NoSimd<uint64_t>;
++};
++
++template <>
++struct SimdChooser<int64_t, true, true>
++{
++    using value = NoSimd<int64_t>;
++};
++#endif
++
+ template <class T> using Simd = typename SimdChooser<T>::value;
+ 
+ // template <class T> struct SimdChooser<T, true> {
diff --git a/srcpkgs/fflas-ffpack/template b/srcpkgs/fflas-ffpack/template
index 557c644c00a4..2aa599703585 100644
--- a/srcpkgs/fflas-ffpack/template
+++ b/srcpkgs/fflas-ffpack/template
@@ -1,6 +1,6 @@
 # Template file for 'fflas-ffpack'
 pkgname=fflas-ffpack
-version=2.4.3
+version=2.5.0
 revision=1
 build_style=gnu-configure
 hostmakedepends="pkg-config"
@@ -10,15 +10,13 @@ short_desc="Finite Field Linear Algebra Subroutines / Package"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="LGPL-2.1-or-later"
 homepage="http://linbox-team.github.io/fflas-ffpack/"
-distfiles="https://github.com/linbox-team/fflas-ffpack/releases/download/${version}/fflas-ffpack-${version}.tar.gz"
-checksum=f372783a17a9899ee9f88d4c9421d80facccb95556146dad7020d07a03791cc9
+changelog="https://github.com/linbox-team/fflas-ffpack/raw/master/ChangeLog"
+distfiles="https://github.com/linbox-team/fflas-ffpack/releases/download/v${version}/fflas-ffpack-${version}.tar.gz"
+checksum=dafb4c0835824d28e4f823748579be6e4c8889c9570c6ce9cce1e186c3ebbb23
 nocross=yes
 
 build_options="native_build"
 
 if [ -z "$build_option_native_build" ]; then
-	configure_args="--enable-sse --enable-sse2
-	  --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42
-	  --disable-avx --disable-avx2 --disable-fma --disable-fma4
-	  --disable-avx512f --disable-avx512dq --disable-avx512vl"
+	configure_args="--without-archnative"
 fi

From 8b56b5976ce3ec19266cdb28b4497c09d6d6d268 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Dec 2021 20:20:20 -0300
Subject: [PATCH 3/6] linbox: update to 1.7.0.

---
 srcpkgs/linbox/patches/292.patch              | 24 ++++++++++++
 srcpkgs/linbox/patches/294.patch              | 38 +++++++++++++++++++
 ...8adade10641f1f04f04b589753d928fb5443.patch | 35 -----------------
 .../remove-linboxsage-libs-from-pc.patch      | 23 -----------
 srcpkgs/linbox/template                       | 11 +++---
 5 files changed, 67 insertions(+), 64 deletions(-)
 create mode 100644 srcpkgs/linbox/patches/292.patch
 create mode 100644 srcpkgs/linbox/patches/294.patch
 delete mode 100644 srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch
 delete mode 100644 srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch

diff --git a/srcpkgs/linbox/patches/292.patch b/srcpkgs/linbox/patches/292.patch
new file mode 100644
index 000000000000..d3333cc23d0b
--- /dev/null
+++ b/srcpkgs/linbox/patches/292.patch
@@ -0,0 +1,24 @@
+From 49b9cccd0286980c1c1811c3b03df883ef0164df Mon Sep 17 00:00:00 2001
+From: Doug Torrance <dtorrance@piedmont.edu>
+Date: Tue, 14 Dec 2021 16:22:33 -0500
+Subject: [PATCH] Only register uint128_t as a TypeName when it's available.
+
+Otherwise, test-fft will fail when it isn't.
+---
+ tests/test-fft.C | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/tests/test-fft.C b/tests/test-fft.C
+index d19184c2d..5811ebc5d 100644
+--- a/tests/test-fft.C
++++ b/tests/test-fft.C
+@@ -55,7 +55,9 @@ REGISTER_TYPE_NAME(double);
+ REGISTER_TYPE_NAME(uint16_t);
+ REGISTER_TYPE_NAME(uint32_t);
+ REGISTER_TYPE_NAME(uint64_t);
++#ifdef __FFLASFFPACK_HAVE_INT128
+ REGISTER_TYPE_NAME(uint128_t);
++#endif
+ REGISTER_TYPE_NAME(Modular);
+ REGISTER_TYPE_NAME(ModularExtended);
+ 
diff --git a/srcpkgs/linbox/patches/294.patch b/srcpkgs/linbox/patches/294.patch
new file mode 100644
index 000000000000..7c645f165d39
--- /dev/null
+++ b/srcpkgs/linbox/patches/294.patch
@@ -0,0 +1,38 @@
+From f81a1f4a5e0835b7a0f3bb88a0fcbbaa32174cfa Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
+Date: Wed, 15 Dec 2021 16:00:39 +0100
+Subject: [PATCH] Only register uint128_t as a TypeName when it's available
+
+---
+ benchmarks/benchmark-fft.C                       | 2 ++
+ benchmarks/benchmark-polynomial-matrix-mul-fft.C | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/benchmarks/benchmark-fft.C b/benchmarks/benchmark-fft.C
+index 39b86c9d9..59a8be57c 100644
+--- a/benchmarks/benchmark-fft.C
++++ b/benchmarks/benchmark-fft.C
+@@ -54,7 +54,9 @@ REGISTER_TYPE_NAME(double);
+ REGISTER_TYPE_NAME(uint16_t);
+ REGISTER_TYPE_NAME(uint32_t);
+ REGISTER_TYPE_NAME(uint64_t);
++#ifdef __FFLASFFPACK_HAVE_INT128
+ REGISTER_TYPE_NAME(uint128_t);
++#endif
+ REGISTER_TYPE_NAME(Modular);
+ REGISTER_TYPE_NAME(ModularExtended);
+ 
+diff --git a/benchmarks/benchmark-polynomial-matrix-mul-fft.C b/benchmarks/benchmark-polynomial-matrix-mul-fft.C
+index e9b184bcf..7bf17f33e 100644
+--- a/benchmarks/benchmark-polynomial-matrix-mul-fft.C
++++ b/benchmarks/benchmark-polynomial-matrix-mul-fft.C
+@@ -65,7 +65,9 @@ REGISTER_TYPE_NAME(double);
+ REGISTER_TYPE_NAME(uint16_t);
+ REGISTER_TYPE_NAME(uint32_t);
+ REGISTER_TYPE_NAME(uint64_t);
++#ifdef __FFLASFFPACK_HAVE_INT128
+ REGISTER_TYPE_NAME(uint128_t);
++#endif
+ REGISTER_TYPE_NAME(Modular);
+ REGISTER_TYPE_NAME(ModularExtended);
+ 
diff --git a/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch b/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch
deleted file mode 100644
index 5afa078ec7b8..000000000000
--- a/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 892f8adade10641f1f04f04b589753d928fb5443 Mon Sep 17 00:00:00 2001
-From: Doug Torrance <dtorrance@piedmont.edu>
-Date: Sun, 9 May 2021 12:14:19 -0400
-Subject: [PATCH] Use std::ptrdiff_t for vector iterator difference type
-
-It was previously long (64-bit integers), but this will not be the
-case on 32-bit systems.
-
-Closes: #273
----
- linbox/vector/bit-vector.inl | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/linbox/vector/bit-vector.inl b/linbox/vector/bit-vector.inl
-index 5fa84b421..23a22ba47 100644
---- a/linbox/vector/bit-vector.inl
-+++ b/linbox/vector/bit-vector.inl
-@@ -46,7 +46,7 @@ namespace std
- 		typedef LinBox::BitVector::reference reference;
- 		typedef bool *pointer;
- 		typedef bool value_type;
--		typedef long difference_type;
-+		typedef std::ptrdiff_t difference_type;
- 	};
- 
- 	template <>
-@@ -56,7 +56,7 @@ namespace std
- 		typedef LinBox::BitVector::const_reference reference;
- 		typedef const bool *pointer;
- 		typedef bool value_type;
--		typedef long difference_type;
-+		typedef std::ptrdiff_t difference_type;
- 	};
- }
- 
diff --git a/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch b/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch
deleted file mode 100644
index c93915fb1b06..000000000000
--- a/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Backported from:
-
-From 426eb97ba762c7663884f57ead0909f2aa3cd6a5 Mon Sep 17 00:00:00 2001
-From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
-Date: Thu, 17 Jan 2019 16:32:19 +0100
-Subject: [PATCH] Remove @LINBOXSAGE_LIBS@ from linbox.pc.in
-
----
- linbox.pc.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/linbox.pc.in b/linbox.pc.in
-index 278f127e4..c6b8091eb 100644
---- a/linbox.pc.in
-+++ b/linbox.pc.in
-@@ -9,6 +9,6 @@ Description: Exact Linear Algebra library
- URL: http://github.com/linbox-team/linbox
- Version: @VERSION@
- Requires: fflas-ffpack >= 2.4.0, givaro >= 4.1.0
--Libs: -L${libdir} -llinbox @LINBOXSAGE_LIBS@ @NTL_LIBS@ @MPFR_LIBS@ @FPLLL_LIBS@ @IML_LIBS@ @FLINT_LIBS@ @OCL_LIBS@
-+Libs: -L${libdir} -llinbox @NTL_LIBS@ @MPFR_LIBS@ @FPLLL_LIBS@ @IML_LIBS@ @FLINT_LIBS@ @OCL_LIBS@
- Cflags: @DEFAULT_CFLAGS@ -DDISABLE_COMMENTATOR -I${includedir} @NTL_CFLAGS@ @MPFR_CFLAGS@ @FPLLL_CFLAGS@  @IML_CFLAGS@ @FLINT_CFLAGS@ 
- \-------------------------------------------------------
diff --git a/srcpkgs/linbox/template b/srcpkgs/linbox/template
index 096a15b3390b..e6edacdd0a74 100644
--- a/srcpkgs/linbox/template
+++ b/srcpkgs/linbox/template
@@ -1,7 +1,7 @@
 # Template file for 'linbox'
 pkgname=linbox
-version=1.6.3
-revision=2
+version=1.7.0
+revision=1
 build_style=gnu-configure
 hostmakedepends="pkg-config"
 makedepends="fflas-ffpack"
@@ -9,16 +9,15 @@ short_desc="C++ library for exact, high-performance linear algebra"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="LGPL-2.1-or-later"
 homepage="https://linalg.org"
+changelog="https://github.com/linbox-team/linbox/raw/master/ChangeLog"
 distfiles="https://github.com/linbox-team/linbox/releases/download/v${version}/linbox-${version}.tar.gz"
-checksum=a58a188307b07c57964e844bceb99321d3043a8a4a1fccc082a54928bb9a0057
+checksum=6d2159fd395be0298362dd37f6c696676237bc8e2757341fbc46520e3b466bcc
 nocross=yes
 
 build_options="native_build"
 
 if [ -z "$build_option_native_build" ]; then
-	configure_args="--enable-sse --enable-sse2
-	  --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42
-	  --disable-avx --disable-avx2 --disable-fma --disable-fma4"
+	configure_args="--without-archnative"
 fi
 
 linbox-devel_package() {

From 82410638b80180605d4b6b7bc36aca051d34f963 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Fri, 15 Apr 2022 14:25:08 -0300
Subject: [PATCH 4/6] maxima: update to 5.46.0.

Also:
 - disable sbcl on aarch64
 - don't makedepends on emacs (avoid a nocross build dep)
 - move maxima-emacs files to main pkg
 - adopt
---
 ...a43e5234305bd6f1de5909d4ce5d7e1ea864.patch | 24 -------------------
 srcpkgs/maxima/template                       | 23 +++++++-----------
 2 files changed, 8 insertions(+), 39 deletions(-)
 delete mode 100644 srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch

diff --git a/srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch b/srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch
deleted file mode 100644
index e1ac1e5f6086..000000000000
--- a/srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-commit a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864
-Author: Robert Dodier <robert_dodier@users.sourceforge.net>
-Date:   Mon Oct 11 22:40:13 2021 -0700
-
-    Apply patch #80: "Build a FASL library, needed by SageMath"
-    
-    This modifies maxima.system for ECL only.
-
-diff --git a/src/maxima.system b/src/maxima.system
-index d954bc2b9..525fb778e 100644
---- a/src/maxima.system
-+++ b/src/maxima.system
-@@ -75,6 +75,11 @@
- 			     ;; Convert dir/foo.fas to dir/foo.o
- 			     (make-pathname :type "o" :defaults p))
- 			 files)))
-+	(c::build-fasl "binary-ecl/maxima" :lisp-files obj
-+			  :ld-flags
-+			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
-+							      (find-package "MAXIMA")))))
-+			    (if (and x (not (string= x ""))) (list x))))
- 	(c::build-program "binary-ecl/maxima" :lisp-files obj
- 			  :ld-flags
- 			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
diff --git a/srcpkgs/maxima/template b/srcpkgs/maxima/template
index 69e85ec833e8..33a0cd1fa4a1 100644
--- a/srcpkgs/maxima/template
+++ b/srcpkgs/maxima/template
@@ -1,19 +1,20 @@
 # Template file for 'maxima'
 pkgname=maxima
-version=5.45.1
-revision=4
+version=5.46.0
+revision=1
 build_style=gnu-configure
 configure_args="$(vopt_enable clisp) $(vopt_enable sbcl sbcl-exec) $(vopt_enable ecl)"
-hostmakedepends="python3 perl emacs texinfo patchelf"
+hostmakedepends="python3 perl texinfo patchelf $(vopt_if ecl ecl)"
 makedepends="$(vopt_if clisp clisp) $(vopt_if sbcl sbcl) $(vopt_if ecl ecl)"
 depends="$(vopt_if clisp clisp) rlwrap"
 checkdepends="gnuplot"
 short_desc="Computer Algebra System"
-maintainer="Bosco Garcia <jboscogg@gmail.org>"
+maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-only"
 homepage="http://maxima.sourceforge.net"
+changelog="https://sourceforge.net/p/maxima/code/ci/master/tree/changelogs/ChangeLog-${version%.*}.md?format=raw"
 distfiles="${SOURCEFORGE_SITE}/maxima/maxima-${version}.tar.gz"
-checksum=fe9016276970bef214a1a244348558644514d7fdfaa4fc8b9d0e87afcbb4e7dc
+checksum=7390f06b48da65c9033e8b2f629b978b90056454a54022db7de70e2225aa8b07
 
 # maxima-sbcl is nopie and should NOT be stripped or it won't work
 nostrip_files=/usr/lib/maxima/$version/binary-sbcl/maxima
@@ -32,7 +33,7 @@ build_options_default="ecl"
 
 # sbcl is only available for these architectures
 case "$XBPS_TARGET_MACHINE" in
-	i686|x86_64*|armv7l|aarch64|ppc64le*)
+	i686|x86_64*|armv7l|ppc64le*)
 		build_options_default+=" sbcl"
 		;;
 esac
@@ -112,14 +113,6 @@ maxima-src_package() {
 	}
 }
 
-maxima-emacs_package() {
-	short_desc+=" - Emacs interface"
-	depends="${sourcepkg}-${version}_${revision} virtual?emacs"
-	pkg_install() {
-		vmove usr/share/emacs
-	}
-}
-
 xmaxima_package() {
 	short_desc+=" - Tk interface"
 	depends="${sourcepkg}-${version}_${revision} tk"
@@ -151,4 +144,4 @@ maxima-ecl_package() {
 	}
 }
 
-subpackages="maxima-src maxima-emacs xmaxima $(vopt_if ecl maxima-ecl)"
+subpackages="maxima-src xmaxima $(vopt_if ecl maxima-ecl)"

From 6e58b9bdf98b7478290f50bd23527d3e66f95e41 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 10 May 2023 17:10:20 -0300
Subject: [PATCH 5/6] python3-sympy: update to 1.12.

---
 srcpkgs/python3-sympy/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/python3-sympy/template b/srcpkgs/python3-sympy/template
index eb24d5c8d4bb..cb8297158027 100644
--- a/srcpkgs/python3-sympy/template
+++ b/srcpkgs/python3-sympy/template
@@ -1,7 +1,7 @@
 # Template file for 'python3-sympy'
 pkgname=python3-sympy
-version=1.11.1
-revision=2
+version=1.12
+revision=1
 build_style=python3-module
 hostmakedepends="python3-setuptools"
 depends="python3-mpmath"
@@ -12,7 +12,7 @@ license="BSD-3-Clause"
 homepage="https://sympy.org/"
 changelog="https://github.com/sympy/sympy/wiki/Release-Notes"
 distfiles="${PYPI_SITE}/s/sympy/sympy-${version}.tar.gz"
-checksum=e32380dce63cb7c0108ed525570092fd45168bdae2faa17e528221ef72e88658
+checksum=ebf595c8dac3e0fdc4152c51878b498396ec7f30e7a914d6071e674d49420fb8
 
 post_install() {
 	vman doc/man/isympy.1

From 7f7be1137e4ef76e96e3cf594b631091b215c9ea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Feb 2023 22:53:33 -0300
Subject: [PATCH 6/6] sagemath: update to 10.0.rc2.

Also:
 - support networkx 3.1 (sagemath#35584)
 - support linbox 1.7.0 (sagemath#35612)
 - support maxima 5.46.0 (sagemath#35619)
 - support sympy 1.12 (sagemath#35635)
---
 srcpkgs/sagemath/files/sage_conf.py           |    1 -
 srcpkgs/sagemath/files/timings2.json          |  405 ++---
 ...-support_singular_4.3.1.p3-5e5737a0c.patch |  205 ---
 .../34980-avoid_factoring_in_is_prime.patch   |   49 -
 .../patches/34994-fix_tests_numpy_1.24.patch  |   58 -
 .../34995-support_tachyon_0.99.2.patch        |   57 -
 ...34997-fix_edge_case_of_integer_check.patch |   36 -
 .../35058-skip_unstable_tests_klyachko.patch  |   22 -
 .../35068-fix_tests_giac_1.9.0.35.patch       |   62 -
 .../patches/35094-support_gap_4.12.patch      | 1303 -----------------
 .../35127-fix_very_slow_test_stream.py.patch  |   15 -
 .../patches/35177-matplotlib_3.7.patch        |   95 --
 .../patches/35195-workaround_ecl_race.patch   |   56 -
 .../patches/35204-fix_sage-cleaner.patch      |   28 -
 .../sagemath/patches/35250-nauty_2.8.6.patch  |   35 -
 .../sagemath/patches/35423-ipython_8.12.patch |   51 -
 .../patches/35438-pythran_0.12.1.patch        |   41 -
 .../sagemath/patches/35584-networkx_3.1.patch |   35 +-
 .../sagemath/patches/35612-linbox_1.7.0.patch |   64 +
 .../patches/35619-maxima_5.46.0.patch         |  578 ++++++++
 .../sagemath/patches/35635-sympy_1.12.patch   |   54 +
 srcpkgs/sagemath/patches/get_patches          |   46 +-
 srcpkgs/sagemath/template                     |    6 +-
 23 files changed, 833 insertions(+), 2469 deletions(-)
 delete mode 100644 srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
 delete mode 100644 srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
 delete mode 100644 srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
 delete mode 100644 srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
 delete mode 100644 srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
 delete mode 100644 srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
 delete mode 100644 srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
 delete mode 100644 srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
 delete mode 100644 srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
 delete mode 100644 srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
 delete mode 100644 srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
 delete mode 100644 srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
 delete mode 100644 srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
 delete mode 100644 srcpkgs/sagemath/patches/35423-ipython_8.12.patch
 delete mode 100644 srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
 create mode 100644 srcpkgs/sagemath/patches/35612-linbox_1.7.0.patch
 create mode 100644 srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch
 create mode 100644 srcpkgs/sagemath/patches/35635-sympy_1.12.patch

diff --git a/srcpkgs/sagemath/files/sage_conf.py b/srcpkgs/sagemath/files/sage_conf.py
index 00de40f1ee4f..bc5388de8956 100644
--- a/srcpkgs/sagemath/files/sage_conf.py
+++ b/srcpkgs/sagemath/files/sage_conf.py
@@ -1,4 +1,3 @@
 # configuration for sage on void linux
 SAGE_SHARE = "/usr/share/sagemath"
 GAP_SHARE_DIR = "/usr/share/gap"
-GAP_LIB_DIR = "/usr/lib/gap"
diff --git a/srcpkgs/sagemath/files/timings2.json b/srcpkgs/sagemath/files/timings2.json
index bb3098680502..b2b3fe818a20 100644
--- a/srcpkgs/sagemath/files/timings2.json
+++ b/srcpkgs/sagemath/files/timings2.json
@@ -1,281 +1,152 @@
 {
-  "doc.ca.intro.index": {"walltime": 8},
-  "doc.en.constructions.calculus": {"walltime": 64},
-  "doc.en.constructions.plotting": {"walltime": 32},
-  "doc.en.prep.Advanced-2DPlotting": {"walltime": 16},
-  "doc.en.prep.Calculus": {"walltime": 8},
-  "doc.en.prep.Symbolics-and-Basic-Plotting": {"walltime": 8},
-  "doc.en.thematic_tutorials.explicit_methods_in_number_theory.birds_other": {"walltime": 8},
-  "doc.en.thematic_tutorials.explicit_methods_in_number_theory.elliptic_curves": {"walltime": 8},
-  "doc.en.thematic_tutorials.geometry.polyhedra_tutorial": {"walltime": 16},
-  "doc.en.thematic_tutorials.sandpile": {"walltime": 16},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_advanced": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_cartesian": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_change": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_curvilinear": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_plane": {"walltime": 16},
-  "doc.ja.tutorial.tour_plotting": {"walltime": 8},
-  "sage.algebras.cluster_algebra": {"walltime": 8},
   "sage.algebras.commutative_dga": {"walltime": 16},
-  "sage.algebras.hecke_algebras.ariki_koike_algebra": {"walltime": 8},
-  "sage.algebras.iwahori_hecke_algebra": {"walltime": 8},
-  "sage.algebras.lie_algebras.classical_lie_algebra": {"walltime": 128},
-  "sage.algebras.lie_algebras.nilpotent_lie_algebra": {"walltime": 16},
-  "sage.algebras.quantum_clifford": {"walltime": 16},
-  "sage.algebras.quantum_groups.fock_space": {"walltime": 8},
-  "sage.algebras.quatalg.quaternion_algebra": {"walltime": 8},
-  "sage.algebras.steenrod.steenrod_algebra": {"walltime": 64},
-  "sage.algebras.steenrod.steenrod_algebra_bases": {"walltime": 8},
-  "sage.algebras.yangian": {"walltime": 8},
-  "sage.arith.misc": {"walltime": 32},
+  "sage.algebras.fusion_rings.f_matrix": {"walltime": 16},
+  "sage.algebras.fusion_rings.fusion_ring": {"walltime": 16},
+  "sage.algebras.hecke_algebras.cubic_hecke_algebra": {"walltime": 8},
+  "sage.algebras.lie_conformal_algebras.n2_lie_conformal_algebra": {"walltime": 8},
+  "sage.algebras.quantum_clifford": {"walltime": 8},
+  "sage.algebras.steenrod.steenrod_algebra": {"walltime": 8},
   "sage.calculus.calculus": {"walltime": 16},
   "sage.calculus.desolvers": {"walltime": 8},
-  "sage.calculus.functional": {"walltime": 8},
-  "sage.calculus.riemann": {"walltime": 64},
-  "sage.calculus.tests": {"walltime": 16},
-  "sage.calculus.transforms.dwt": {"walltime": 16},
+  "sage.calculus.riemann": {"walltime": 8},
   "sage.calculus.transforms.fft": {"walltime": 8},
   "sage.categories.coxeter_groups": {"walltime": 8},
-  "sage.categories.finite_monoids": {"walltime": 16},
-  "sage.categories.lie_conformal_algebras": {"walltime": 8},
+  "sage.categories.finite_monoids": {"walltime": 8},
   "sage.categories.loop_crystals": {"walltime": 8},
-  "sage.categories.pushout": {"walltime": 8},
-  "sage.categories.super_hopf_algebras_with_basis": {"walltime": 32},
-  "sage.categories.super_lie_conformal_algebras": {"walltime": 8},
-  "sage.coding.ag_code": {"walltime": 64},
-  "sage.coding.ag_code_decoders": {"walltime": 128},
-  "sage.coding.binary_code": {"walltime": 8},
-  "sage.coding.linear_code": {"walltime": 16},
-  "sage.combinat.backtrack": {"walltime": 32},
-  "sage.combinat.chas.wqsym": {"walltime": 32},
-  "sage.combinat.cluster_algebra_quiver.cluster_seed": {"walltime": 64},
-  "sage.combinat.cluster_algebra_quiver.quiver": {"walltime": 128},
-  "sage.combinat.crystals.affine_factorization": {"walltime": 16},
-  "sage.combinat.crystals.alcove_path": {"walltime": 32},
-  "sage.combinat.crystals.highest_weight_crystals": {"walltime": 8},
-  "sage.combinat.crystals.kirillov_reshetikhin": {"walltime": 16},
-  "sage.combinat.crystals.letters": {"walltime": 8},
-  "sage.combinat.crystals.littelmann_path": {"walltime": 16},
-  "sage.combinat.crystals.mv_polytopes": {"walltime": 16},
-  "sage.combinat.crystals.pbw_crystal": {"walltime": 16},
-  "sage.combinat.crystals.star_crystal": {"walltime": 8},
-  "sage.combinat.designs.bibd": {"walltime": 8},
-  "sage.combinat.designs.database": {"walltime": 16},
+  "sage.coding.ag_code": {"walltime": 32},
+  "sage.coding.ag_code_decoders": {"walltime": 32},
+  "sage.coding.linear_code": {"walltime": 32},
+  "sage.combinat.designs.database": {"walltime": 8},
   "sage.combinat.designs.difference_family": {"walltime": 8},
-  "sage.combinat.designs.gen_quadrangles_with_spread": {"walltime": 128},
-  "sage.combinat.designs.orthogonal_arrays_build_recursive": {"walltime": 16},
-  "sage.combinat.designs.orthogonal_arrays_find_recursive": {"walltime": 8},
-  "sage.combinat.diagram_algebras": {"walltime": 64},
-  "sage.combinat.fqsym": {"walltime": 32},
-  "sage.combinat.free_prelie_algebra": {"walltime": 8},
-  "sage.combinat.fully_commutative_elements": {"walltime": 8},
-  "sage.combinat.grossman_larson_algebras": {"walltime": 8},
-  "sage.combinat.interval_posets": {"walltime": 8},
+  "sage.combinat.designs.orthogonal_arrays_build_recursive": {"walltime": 8},
   "sage.combinat.k_regular_sequence": {"walltime": 8},
   "sage.combinat.k_tableau": {"walltime": 16},
   "sage.combinat.matrices.hadamard_matrix": {"walltime": 8},
   "sage.combinat.multiset_partition_into_sets_ordered": {"walltime": 8},
-  "sage.combinat.ncsf_qsym.ncsf": {"walltime": 16},
-  "sage.combinat.ncsf_qsym.qsym": {"walltime": 16},
-  "sage.combinat.partition": {"walltime": 16},
-  "sage.combinat.partition_kleshchev": {"walltime": 16},
+  "sage.combinat.ncsf_qsym.ncsf": {"walltime": 8},
+  "sage.combinat.ncsf_qsym.qsym": {"walltime": 8},
+  "sage.combinat.partition": {"walltime": 8},
   "sage.combinat.partition_tuple": {"walltime": 8},
-  "sage.combinat.posets.moebius_algebra": {"walltime": 16},
+  "sage.combinat.permutation": {"walltime": 8},
   "sage.combinat.posets.posets": {"walltime": 8},
-  "sage.combinat.rigged_configurations.kr_tableaux": {"walltime": 32},
-  "sage.combinat.rigged_configurations.rigged_configurations": {"walltime": 16},
-  "sage.combinat.rigged_configurations.tensor_product_kr_tableaux": {"walltime": 16},
+  "sage.combinat.rigged_configurations.kr_tableaux": {"walltime": 8},
   "sage.combinat.root_system.associahedron": {"walltime": 8},
-  "sage.combinat.root_system.branching_rules": {"walltime": 8},
-  "sage.combinat.root_system.fusion_ring": {"walltime": 8},
-  "sage.combinat.root_system.integrable_representations": {"walltime": 16},
-  "sage.combinat.root_system.non_symmetric_macdonald_polynomials": {"walltime": 16},
-  "sage.combinat.root_system.pieri_factors": {"walltime": 8},
-  "sage.combinat.root_system.plot": {"walltime": 32},
-  "sage.combinat.root_system.root_lattice_realization_algebras": {"walltime": 16},
-  "sage.combinat.root_system.root_lattice_realizations": {"walltime": 16},
-  "sage.combinat.root_system.root_system": {"walltime": 8},
-  "sage.combinat.root_system.weyl_group": {"walltime": 8},
-  "sage.combinat.rsk": {"walltime": 32},
-  "sage.combinat.sf.classical": {"walltime": 16},
-  "sage.combinat.sf.jack": {"walltime": 16},
-  "sage.combinat.sf.k_dual": {"walltime": 16},
-  "sage.combinat.sf.llt": {"walltime": 16},
-  "sage.combinat.sf.macdonald": {"walltime": 64},
-  "sage.combinat.sf.new_kschur": {"walltime": 8},
-  "sage.combinat.sf.sfa": {"walltime": 32},
-  "sage.combinat.shifted_primed_tableau": {"walltime": 16},
+  "sage.combinat.root_system.non_symmetric_macdonald_polynomials": {"walltime": 8},
+  "sage.combinat.root_system.plot": {"walltime": 16},
+  "sage.combinat.root_system.root_lattice_realizations": {"walltime": 8},
+  "sage.combinat.rsk": {"walltime": 8},
+  "sage.combinat.sf.k_dual": {"walltime": 8},
+  "sage.combinat.sf.sf": {"walltime": 8},
+  "sage.combinat.sf.sfa": {"walltime": 8},
+  "sage.combinat.shifted_primed_tableau": {"walltime": 8},
   "sage.combinat.skew_tableau": {"walltime": 8},
-  "sage.combinat.symmetric_group_algebra": {"walltime": 16},
-  "sage.combinat.tableau": {"walltime": 32},
-  "sage.combinat.tableau_tuple": {"walltime": 32},
-  "sage.combinat.tiling": {"walltime": 16},
-  "sage.combinat.tutorial": {"walltime": 16},
-  "sage.combinat.words.paths": {"walltime": 64},
-  "sage.crypto.block_cipher.des": {"walltime": 16},
-  "sage.crypto.mq.sr": {"walltime": 64},
-  "sage.crypto.sbox": {"walltime": 16},
+  "sage.combinat.species.generating_series": {"walltime": 8},
+  "sage.combinat.tableau": {"walltime": 8},
+  "sage.combinat.tableau_tuple": {"walltime": 8},
+  "sage.combinat.tiling": {"walltime": 8},
+  "sage.combinat.tutorial": {"walltime": 8},
   "sage.crypto.sboxes": {"walltime": 8},
   "sage.doctest.forker": {"walltime": 16},
-  "sage.doctest.sources": {"walltime": 64},
-  "sage.doctest.test": {"walltime": 128},
-  "sage.dynamics.arithmetic_dynamics.projective_ds": {"walltime": 64},
-  "sage.dynamics.arithmetic_dynamics.wehlerK3": {"walltime": 8},
-  "sage.dynamics.cellular_automata.glca": {"walltime": 8},
+  "sage.dynamics.arithmetic_dynamics.projective_ds": {"walltime": 32},
   "sage.dynamics.cellular_automata.solitons": {"walltime": 8},
-  "sage.dynamics.complex_dynamics.mandel_julia": {"walltime": 16},
   "sage.functions.bessel": {"walltime": 16},
-  "sage.functions.exp_integral": {"walltime": 8},
   "sage.functions.hypergeometric": {"walltime": 8},
+  "sage.functions.orthogonal_polys": {"walltime": 8},
   "sage.functions.other": {"walltime": 16},
   "sage.functions.piecewise": {"walltime": 8},
-  "sage.games.quantumino": {"walltime": 8},
-  "sage.geometry.cone": {"walltime": 32},
-  "sage.geometry.fan": {"walltime": 8},
   "sage.geometry.hyperbolic_space.hyperbolic_geodesic": {"walltime": 8},
-  "sage.geometry.hyperplane_arrangement.arrangement": {"walltime": 16},
-  "sage.geometry.hyperplane_arrangement.library": {"walltime": 8},
+  "sage.geometry.hyperplane_arrangement.arrangement": {"walltime": 8},
   "sage.geometry.hyperplane_arrangement.plot": {"walltime": 8},
-  "sage.geometry.lattice_polytope": {"walltime": 16},
-  "sage.geometry.polyhedral_complex": {"walltime": 8},
-  "sage.geometry.polyhedron.base": {"walltime": 32},
-  "sage.geometry.polyhedron.library": {"walltime": 32},
-  "sage.geometry.polyhedron.plot": {"walltime": 8},
+  "sage.geometry.polyhedron.base": {"walltime": 8},
+  "sage.geometry.polyhedron.base5": {"walltime": 8},
+  "sage.geometry.polyhedron.base6": {"walltime": 16},
+  "sage.geometry.polyhedron.library": {"walltime": 16},
   "sage.geometry.riemannian_manifolds.parametrized_surface3d": {"walltime": 16},
-  "sage.geometry.triangulation.base": {"walltime": 32},
-  "sage.geometry.triangulation.point_configuration": {"walltime": 16},
-  "sage.graphs.chrompoly": {"walltime": 8},
-  "sage.graphs.connectivity": {"walltime": 16},
-  "sage.graphs.generators.basic": {"walltime": 16},
-  "sage.graphs.generators.classical_geometries": {"walltime": 32},
-  "sage.graphs.generators.distance_regular": {"walltime": 256},
-  "sage.graphs.generators.families": {"walltime": 32},
-  "sage.graphs.generators.smallgraphs": {"walltime": 16},
-  "sage.graphs.generic_graph": {"walltime": 32},
-  "sage.graphs.genus": {"walltime": 16},
+  "sage.graphs.connectivity": {"walltime": 8},
+  "sage.graphs.generators.classical_geometries": {"walltime": 8},
+  "sage.graphs.generators.distance_regular": {"walltime": 32},
+  "sage.graphs.generators.smallgraphs": {"walltime": 8},
+  "sage.graphs.generic_graph": {"walltime": 16},
   "sage.graphs.graph": {"walltime": 16},
-  "sage.graphs.graph_generators": {"walltime": 8},
   "sage.graphs.graph_list": {"walltime": 8},
   "sage.graphs.graph_plot": {"walltime": 8},
-  "sage.graphs.strongly_regular_db": {"walltime": 16},
-  "sage.groups.cubic_braid": {"walltime": 16},
-  "sage.groups.fqf_orthogonal": {"walltime": 16},
-  "sage.groups.libgap_mixin": {"walltime": 8},
-  "sage.groups.libgap_morphism": {"walltime": 8},
-  "sage.groups.lie_gps.nilpotent_lie_group": {"walltime": 16},
-  "sage.groups.matrix_gps.finitely_generated": {"walltime": 8},
-  "sage.groups.matrix_gps.heisenberg": {"walltime": 32},
-  "sage.groups.matrix_gps.linear": {"walltime": 8},
-  "sage.groups.perm_gps.cubegroup": {"walltime": 16},
-  "sage.groups.perm_gps.partn_ref.refinement_graphs": {"walltime": 8},
+  "sage.graphs.strongly_regular_db": {"walltime": 8},
+  "sage.groups.cactus_group": {"walltime": 8},
+  "sage.groups.cubic_braid": {"walltime": 8},
+  "sage.groups.lie_gps.nilpotent_lie_group": {"walltime": 8},
+  "sage.groups.matrix_gps.finitely_generated_gap": {"walltime": 8},
   "sage.groups.perm_gps.permgroup": {"walltime": 8},
   "sage.groups.perm_gps.permgroup_named": {"walltime": 8},
-  "sage.homology.hochschild_complex": {"walltime": 8},
   "sage.homology.homology_vector_space_with_basis": {"walltime": 8},
-  "sage.interacts.test_jupyter": {"walltime": 16},
-  "sage.interfaces.ecm": {"walltime": 8},
-  "sage.interfaces.expect": {"walltime": 8},
-  "sage.interfaces.gap": {"walltime": 16},
-  "sage.interfaces.maxima": {"walltime": 8},
-  "sage.interfaces.maxima_abstract": {"walltime": 64},
-  "sage.interfaces.psage": {"walltime": 8},
-  "sage.interfaces.sage0": {"walltime": 8},
-  "sage.lfunctions.zero_sums": {"walltime": 8},
-  "sage.libs.eclib.interface": {"walltime": 16},
+  "sage.interfaces.gap": {"walltime": 8},
+  "sage.interfaces.gap_workspace": {"walltime": 8},
+  "sage.interfaces.sage0": {"walltime": 16},
+  "sage.libs.eclib.interface": {"walltime": 32},
   "sage.libs.eclib.mwrank": {"walltime": 16},
-  "sage.libs.gap.test_long": {"walltime": 32},
-  "sage.libs.giac": {"walltime": 32},
   "sage.manifolds.catalog": {"walltime": 8},
-  "sage.manifolds.chart": {"walltime": 32},
+  "sage.manifolds.chart": {"walltime": 16},
   "sage.manifolds.chart_func": {"walltime": 8},
   "sage.manifolds.continuous_map": {"walltime": 8},
-  "sage.manifolds.differentiable.affine_connection": {"walltime": 128},
+  "sage.manifolds.differentiable.affine_connection": {"walltime": 32},
   "sage.manifolds.differentiable.automorphismfield": {"walltime": 32},
-  "sage.manifolds.differentiable.automorphismfield_group": {"walltime": 8},
   "sage.manifolds.differentiable.bundle_connection": {"walltime": 8},
-  "sage.manifolds.differentiable.characteristic_cohomology_class": {"walltime": 64},
+  "sage.manifolds.differentiable.characteristic_cohomology_class": {"walltime": 8},
   "sage.manifolds.differentiable.curve": {"walltime": 16},
-  "sage.manifolds.differentiable.degenerate": {"walltime": 32},
-  "sage.manifolds.differentiable.degenerate_submanifold": {"walltime": 16},
-  "sage.manifolds.differentiable.diff_form": {"walltime": 64},
+  "sage.manifolds.differentiable.degenerate": {"walltime": 16},
+  "sage.manifolds.differentiable.degenerate_submanifold": {"walltime": 8},
+  "sage.manifolds.differentiable.diff_form": {"walltime": 32},
   "sage.manifolds.differentiable.diff_map": {"walltime": 8},
   "sage.manifolds.differentiable.examples.euclidean": {"walltime": 32},
   "sage.manifolds.differentiable.examples.sphere": {"walltime": 32},
   "sage.manifolds.differentiable.integrated_curve": {"walltime": 32},
-  "sage.manifolds.differentiable.levi_civita_connection": {"walltime": 32},
-  "sage.manifolds.differentiable.manifold": {"walltime": 16},
-  "sage.manifolds.differentiable.manifold_homset": {"walltime": 16},
+  "sage.manifolds.differentiable.levi_civita_connection": {"walltime": 16},
+  "sage.manifolds.differentiable.manifold": {"walltime": 8},
+  "sage.manifolds.differentiable.manifold_homset": {"walltime": 8},
   "sage.manifolds.differentiable.metric": {"walltime": 64},
   "sage.manifolds.differentiable.mixed_form": {"walltime": 16},
-  "sage.manifolds.differentiable.mixed_form_algebra": {"walltime": 8},
   "sage.manifolds.differentiable.multivectorfield": {"walltime": 64},
-  "sage.manifolds.differentiable.pseudo_riemannian": {"walltime": 16},
-  "sage.manifolds.differentiable.pseudo_riemannian_submanifold": {"walltime": 128},
-  "sage.manifolds.differentiable.scalarfield": {"walltime": 16},
+  "sage.manifolds.differentiable.pseudo_riemannian": {"walltime": 8},
+  "sage.manifolds.differentiable.pseudo_riemannian_submanifold": {"walltime": 32},
+  "sage.manifolds.differentiable.scalarfield": {"walltime": 8},
   "sage.manifolds.differentiable.scalarfield_algebra": {"walltime": 8},
-  "sage.manifolds.differentiable.tangent_vector": {"walltime": 16},
+  "sage.manifolds.differentiable.tangent_vector": {"walltime": 8},
   "sage.manifolds.differentiable.tensorfield": {"walltime": 128},
   "sage.manifolds.differentiable.tensorfield_paral": {"walltime": 16},
-  "sage.manifolds.differentiable.vector_bundle": {"walltime": 16},
-  "sage.manifolds.differentiable.vectorfield": {"walltime": 64},
-  "sage.manifolds.differentiable.vectorframe": {"walltime": 8},
+  "sage.manifolds.differentiable.vectorfield": {"walltime": 16},
   "sage.manifolds.point": {"walltime": 16},
   "sage.manifolds.scalarfield": {"walltime": 16},
-  "sage.manifolds.scalarfield_algebra": {"walltime": 8},
-  "sage.manifolds.section": {"walltime": 32},
-  "sage.manifolds.trivialization": {"walltime": 8},
-  "sage.manifolds.vector_bundle": {"walltime": 8},
-  "sage.matrix.benchmark": {"walltime": 8},
+  "sage.manifolds.section": {"walltime": 16},
   "sage.matrix.matrix2": {"walltime": 16},
-  "sage.matrix.matrix_integer_dense": {"walltime": 16},
-  "sage.matrix.matrix_integer_dense_hnf": {"walltime": 32},
-  "sage.matrix.matrix_mod2_dense": {"walltime": 8},
   "sage.matrix.matrix_rational_dense": {"walltime": 8},
   "sage.matrix.special": {"walltime": 8},
-  "sage.matroids.catalog": {"walltime": 64},
   "sage.misc.cachefunc": {"walltime": 16},
-  "sage.misc.cython": {"walltime": 8},
   "sage.misc.functional": {"walltime": 8},
   "sage.misc.randstate": {"walltime": 16},
-  "sage.misc.sagedoc": {"walltime": 64},
-  "sage.misc.sageinspect": {"walltime": 32},
-  "sage.modular.abvar.abvar": {"walltime": 16},
+  "sage.misc.sagedoc": {"walltime": 16},
+  "sage.misc.sageinspect": {"walltime": 16},
+  "sage.misc.trace": {"walltime": 8},
+  "sage.modular.abvar.abvar": {"walltime": 8},
   "sage.modular.abvar.homspace": {"walltime": 8},
-  "sage.modular.abvar.lseries": {"walltime": 8},
-  "sage.modular.arithgroup.arithgroup_perm": {"walltime": 8},
-  "sage.modular.arithgroup.tests": {"walltime": 8},
-  "sage.modular.btquotients.pautomorphicform": {"walltime": 32},
-  "sage.modular.hypergeometric_motive": {"walltime": 16},
-  "sage.modular.local_comp.local_comp": {"walltime": 32},
-  "sage.modular.local_comp.type_space": {"walltime": 16},
-  "sage.modular.modform.ambient_R": {"walltime": 16},
-  "sage.modular.modform.constructor": {"walltime": 8},
-  "sage.modular.modform.cuspidal_submodule": {"walltime": 16},
-  "sage.modular.modform.element": {"walltime": 64},
-  "sage.modular.modform.ring": {"walltime": 64},
-  "sage.modular.modform.space": {"walltime": 8},
+  "sage.modular.btquotients.btquotient": {"walltime": 8},
+  "sage.modular.btquotients.pautomorphicform": {"walltime": 16},
+  "sage.modular.hecke.submodule": {"walltime": 8},
+  "sage.modular.hypergeometric_motive": {"walltime": 8},
+  "sage.modular.local_comp.local_comp": {"walltime": 16},
+  "sage.modular.local_comp.type_space": {"walltime": 8},
+  "sage.modular.modform.element": {"walltime": 32},
   "sage.modular.modform_hecketriangle.abstract_space": {"walltime": 16},
   "sage.modular.modform_hecketriangle.graded_ring_element": {"walltime": 16},
   "sage.modular.modform_hecketriangle.hecke_triangle_group_element": {"walltime": 32},
   "sage.modular.modform_hecketriangle.readme": {"walltime": 16},
-  "sage.modular.modform_hecketriangle.space": {"walltime": 8},
   "sage.modular.modsym.ambient": {"walltime": 16},
   "sage.modular.modsym.space": {"walltime": 8},
-  "sage.modular.pollack_stevens.modsym": {"walltime": 64},
-  "sage.modular.pollack_stevens.padic_lseries": {"walltime": 32},
-  "sage.modules.finite_submodule_iter": {"walltime": 16},
-  "sage.modules.free_module": {"walltime": 16},
-  "sage.modules.free_module_element": {"walltime": 8},
-  "sage.modules.free_module_integer": {"walltime": 32},
-  "sage.modules.free_quadratic_module_integer_symmetric": {"walltime": 8},
-  "sage.modules.torsion_quadratic_module": {"walltime": 16},
+  "sage.modular.overconvergent.genus0": {"walltime": 8},
+  "sage.modular.pollack_stevens.modsym": {"walltime": 8},
+  "sage.modules.fp_graded.morphism": {"walltime": 8},
+  "sage.modules.free_module": {"walltime": 8},
   "sage.parallel.map_reduce": {"walltime": 8},
-  "sage.plot.animate": {"walltime": 16},
-  "sage.plot.arrow": {"walltime": 8},
-  "sage.plot.circle": {"walltime": 8},
-  "sage.plot.complex_plot": {"walltime": 8},
+  "sage.plot.complex_plot": {"walltime": 16},
   "sage.plot.contour_plot": {"walltime": 32},
-  "sage.plot.density_plot": {"walltime": 8},
   "sage.plot.graphics": {"walltime": 32},
   "sage.plot.line": {"walltime": 8},
   "sage.plot.matrix_plot": {"walltime": 16},
@@ -283,115 +154,53 @@
   "sage.plot.plot": {"walltime": 64},
   "sage.plot.plot3d.base": {"walltime": 8},
   "sage.plot.plot3d.implicit_plot3d": {"walltime": 16},
-  "sage.plot.plot3d.implicit_surface": {"walltime": 8},
-  "sage.plot.plot3d.parametric_plot3d": {"walltime": 8},
+  "sage.plot.plot3d.parametric_plot3d": {"walltime": 16},
   "sage.plot.plot3d.parametric_surface": {"walltime": 8},
   "sage.plot.plot3d.plot3d": {"walltime": 16},
-  "sage.plot.plot3d.tachyon": {"walltime": 8},
-  "sage.plot.plot3d.transform": {"walltime": 32},
   "sage.plot.point": {"walltime": 8},
   "sage.plot.polygon": {"walltime": 8},
   "sage.plot.streamline_plot": {"walltime": 8},
-  "sage.quadratic_forms.genera.genus": {"walltime": 16},
-  "sage.quadratic_forms.quadratic_form__automorphisms": {"walltime": 8},
-  "sage.quadratic_forms.quadratic_form__local_representation_conditions": {"walltime": 64},
-  "sage.quadratic_forms.quadratic_form__neighbors": {"walltime": 8},
-  "sage.quadratic_forms.quadratic_form__siegel_product": {"walltime": 8},
   "sage.repl.ipython_extension": {"walltime": 8},
-  "sage.rings.asymptotic.asymptotic_expansion_generators": {"walltime": 64},
+  "sage.rings.asymptotic.asymptotic_expansion_generators": {"walltime": 16},
   "sage.rings.asymptotic.asymptotic_ring": {"walltime": 8},
-  "sage.rings.asymptotic.asymptotics_multivariate_generating_functions": {"walltime": 32},
-  "sage.rings.asymptotic.term_monoid": {"walltime": 8},
-  "sage.rings.continued_fraction": {"walltime": 8},
+  "sage.rings.asymptotic.asymptotics_multivariate_generating_functions": {"walltime": 8},
   "sage.rings.finite_rings.finite_field_base": {"walltime": 8},
-  "sage.rings.function_field.function_field": {"walltime": 128},
-  "sage.rings.function_field.function_field_valuation": {"walltime": 64},
+  "sage.rings.function_field.function_field": {"walltime": 8},
   "sage.rings.function_field.ideal": {"walltime": 8},
-  "sage.rings.function_field.place": {"walltime": 8},
-  "sage.rings.integer": {"walltime": 64},
-  "sage.rings.invariants.invariant_theory": {"walltime": 8},
-  "sage.rings.number_field.bdd_height": {"walltime": 8},
-  "sage.rings.number_field.number_field": {"walltime": 64},
-  "sage.rings.number_field.number_field_element": {"walltime": 16},
-  "sage.rings.number_field.splitting_field": {"walltime": 8},
-  "sage.rings.number_field.totallyreal": {"walltime": 16},
-  "sage.rings.number_field.totallyreal_rel": {"walltime": 8},
-  "sage.rings.padics.padic_base_leaves": {"walltime": 64},
-  "sage.rings.padics.padic_extension_leaves": {"walltime": 64},
-  "sage.rings.padics.padic_generic_element": {"walltime": 16},
-  "sage.rings.padics.padic_lattice_element": {"walltime": 32},
-  "sage.rings.padics.relative_extension_leaves": {"walltime": 32},
+  "sage.rings.lazy_series": {"walltime": 8},
+  "sage.rings.lazy_series_ring": {"walltime": 32},
+  "sage.rings.number_field.number_field": {"walltime": 32},
+  "sage.rings.number_field.number_field_element": {"walltime": 8},
+  "sage.rings.padics.padic_base_leaves": {"walltime": 8},
+  "sage.rings.padics.padic_generic_element": {"walltime": 8},
   "sage.rings.polynomial.multi_polynomial_ideal": {"walltime": 8},
-  "sage.rings.polynomial.multi_polynomial_sequence": {"walltime": 8},
-  "sage.rings.polynomial.ore_function_element": {"walltime": 8},
   "sage.rings.polynomial.polynomial_element": {"walltime": 16},
-  "sage.rings.polynomial.polynomial_rational_flint": {"walltime": 8},
   "sage.rings.qqbar": {"walltime": 16},
-  "sage.rings.tests": {"walltime": 16},
-  "sage.rings.valuation.augmented_valuation": {"walltime": 32},
-  "sage.rings.valuation.mapped_valuation": {"walltime": 64},
-  "sage.rings.valuation.valuation": {"walltime": 8},
-  "sage.sandpiles.sandpile": {"walltime": 16},
+  "sage.sandpiles.sandpile": {"walltime": 8},
   "sage.schemes.curves.affine_curve": {"walltime": 16},
   "sage.schemes.curves.closed_point": {"walltime": 8},
   "sage.schemes.curves.projective_curve": {"walltime": 32},
-  "sage.schemes.cyclic_covers.cycliccover_finite_field": {"walltime": 64},
   "sage.schemes.elliptic_curves.BSD": {"walltime": 8},
   "sage.schemes.elliptic_curves.Qcurves": {"walltime": 8},
-  "sage.schemes.elliptic_curves.constructor": {"walltime": 32},
-  "sage.schemes.elliptic_curves.ell_curve_isogeny": {"walltime": 16},
-  "sage.schemes.elliptic_curves.ell_egros": {"walltime": 32},
-  "sage.schemes.elliptic_curves.ell_finite_field": {"walltime": 8},
+  "sage.schemes.elliptic_curves.ell_curve_isogeny": {"walltime": 8},
   "sage.schemes.elliptic_curves.ell_generic": {"walltime": 8},
-  "sage.schemes.elliptic_curves.ell_modular_symbols": {"walltime": 16},
-  "sage.schemes.elliptic_curves.ell_number_field": {"walltime": 128},
+  "sage.schemes.elliptic_curves.ell_modular_symbols": {"walltime": 8},
   "sage.schemes.elliptic_curves.ell_point": {"walltime": 8},
-  "sage.schemes.elliptic_curves.ell_rational_field": {"walltime": 128},
-  "sage.schemes.elliptic_curves.gal_reps_number_field": {"walltime": 32},
-  "sage.schemes.elliptic_curves.gp_simon": {"walltime": 16},
-  "sage.schemes.elliptic_curves.heegner": {"walltime": 32},
-  "sage.schemes.elliptic_curves.height": {"walltime": 64},
-  "sage.schemes.elliptic_curves.isogeny_class": {"walltime": 32},
-  "sage.schemes.elliptic_curves.isogeny_small_degree": {"walltime": 64},
-  "sage.schemes.elliptic_curves.kraus": {"walltime": 16},
+  "sage.schemes.elliptic_curves.ell_rational_field": {"walltime": 32},
+  "sage.schemes.elliptic_curves.height": {"walltime": 8},
+  "sage.schemes.elliptic_curves.isogeny_small_degree": {"walltime": 16},
   "sage.schemes.elliptic_curves.mod_sym_num": {"walltime": 8},
   "sage.schemes.elliptic_curves.padic_lseries": {"walltime": 8},
-  "sage.schemes.elliptic_curves.padics": {"walltime": 16},
-  "sage.schemes.elliptic_curves.saturation": {"walltime": 16},
-  "sage.schemes.elliptic_curves.sha_tate": {"walltime": 32},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_finite_field": {"walltime": 64},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_generic": {"walltime": 8},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_padic_field": {"walltime": 32},
-  "sage.schemes.hyperelliptic_curves.monsky_washnitzer": {"walltime": 8},
-  "sage.schemes.projective.projective_rational_point": {"walltime": 8},
-  "sage.schemes.riemann_surfaces.riemann_surface": {"walltime": 64},
+  "sage.schemes.elliptic_curves.padics": {"walltime": 8},
+  "sage.schemes.elliptic_curves.sha_tate": {"walltime": 16},
+  "sage.schemes.hyperelliptic_curves.hyperelliptic_padic_field": {"walltime": 16},
+  "sage.schemes.riemann_surfaces.riemann_surface": {"walltime": 32},
   "sage.schemes.toric.chow_group": {"walltime": 8},
-  "sage.schemes.toric.sheaf.klyachko": {"walltime": 8},
-  "sage.stats.distributions.discrete_gaussian_integer": {"walltime": 8},
-  "sage.stats.time_series": {"walltime": 8},
-  "sage.structure.coerce_dict": {"walltime": 32},
   "sage.structure.element": {"walltime": 16},
-  "sage.structure.sage_object": {"walltime": 8},
   "sage.symbolic.expression": {"walltime": 32},
-  "sage.symbolic.integration.integral": {"walltime": 32},
-  "sage.symbolic.random_tests": {"walltime": 32},
+  "sage.symbolic.integration.integral": {"walltime": 16},
   "sage.symbolic.relation": {"walltime": 8},
-  "sage.tests.book_schilling_zabrocki_kschur_primer": {"walltime": 32},
-  "sage.tests.book_stein_ent": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.combinat_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.float_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.graphique_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.graphtheory_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.integration_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.mpoly_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.nonlinear_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.recequadiff_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.graphique_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.numbertheory_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.polynomes_doctest": {"walltime": 16},
-  "sage.tests.cmdline": {"walltime": 64},
-  "sage.tests.gosper-sum": {"walltime": 16},
-  "sage.tests.parigp": {"walltime": 8},
-  "sage.topology.simplicial_complex": {"walltime": 8},
-  "sage.topology.simplicial_complex_examples": {"walltime": 16}
+  "sage.tests.book_schilling_zabrocki_kschur_primer": {"walltime": 16},
+  "sage.tests.book_stein_ent": {"walltime": 8},
+  "sage.topology.simplicial_complex": {"walltime": 16}
 }
diff --git a/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch b/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
deleted file mode 100644
index f2f825e4fb10..000000000000
--- a/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
+++ /dev/null
@@ -1,205 +0,0 @@
-diff --git a/build/pkgs/singular/checksums.ini b/build/pkgs/singular/checksums.ini
-index 2e33a405d36..313463d2fea 100644
---- a/build/pkgs/singular/checksums.ini
-+++ b/build/pkgs/singular/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=singular-VERSION.tar.gz
--sha1=6c2b622d3681e2de3d58d30c654d43d3e32b720c
--md5=abb1e37c794472e7760655358ab66054
--cksum=17455733
-+sha1=28bb3ee97ef48d04dfa96de182fd93eebe08426c
-+md5=fc0a4f5720dadba45a52ee94324ce00c
-+cksum=1573851737
- upstream_url=ftp://jim.mathematik.uni-kl.de/pub/Math/Singular/SOURCES/4-3-1/singular-VERSION.tar.gz
-diff --git a/build/pkgs/singular/package-version.txt b/build/pkgs/singular/package-version.txt
-index 11300c77e7d..66e2bede53a 100644
---- a/build/pkgs/singular/package-version.txt
-+++ b/build/pkgs/singular/package-version.txt
-@@ -1 +1 @@
--4.3.1p1
-+4.3.1p3
-diff --git a/src/sage/libs/singular/decl.pxd b/src/sage/libs/singular/decl.pxd
-index 8e3ac314b67..747a6b1e2fb 100644
---- a/src/sage/libs/singular/decl.pxd
-+++ b/src/sage/libs/singular/decl.pxd
-@@ -574,7 +574,7 @@ cdef extern from "singular/Singular/libsingular.h":
- 
-     # gets a component out of a polynomial vector
- 
--    poly *pTakeOutComp1(poly **, int)
-+    poly *pTakeOutComp(poly **, int)
- 
-     # deep copy p
- 
-diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx
-index d8ea7b07f3c..3a1271cd59f 100644
---- a/src/sage/libs/singular/singular.pyx
-+++ b/src/sage/libs/singular/singular.pyx
-@@ -1726,20 +1726,21 @@ cdef int overflow_check(unsigned long e, ring *_ring) except -1:
- 
-     Whether an overflow occurs or not partially depends
-     on the number of variables in the ring. See trac ticket
--    :trac:`11856`. With Singular 4, it is by default optimized
--    for at least 4 variables on 64-bit and 2 variables on 32-bit,
--    which in both cases makes a maximal default exponent of
--    2^16-1.
-+    :trac:`11856`.
- 
-     EXAMPLES::
- 
-         sage: P.<x,y> = QQ[]
--        sage: y^(2^16-1)
--        y^65535
--        sage: y^2^16
-+        sage: y^(2^30)
-+        Traceback (most recent call last):             # 32-bit
-+        ...                                            # 32-bit
-+        OverflowError: exponent overflow (1073741824)  # 32-bit
-+        y^1073741824  # 64-bit
-+        sage: y^2^32
-         Traceback (most recent call last):
-         ...
--        OverflowError: exponent overflow (65536)
-+        OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+        OverflowError: exponent overflow (4294967296)  # 64-bit
-     """
-     if unlikely(e > _ring.bitmask):
-         raise OverflowError("exponent overflow (%d)"%(e))
-diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py
-index 7dc058a22f0..71494eddbc0 100644
---- a/src/sage/rings/polynomial/multi_polynomial_ideal.py
-+++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py
-@@ -60,7 +60,7 @@
- Note that the result of a computation is not necessarily reduced::
- 
-     sage: (a+b)^17
--    256*a*b^16 + 256*b^17
-+    a*b^16 + b^17
-     sage: S(17) == 0
-     True
- 
-diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-index 4dad016b33f..9bf67dd1425 100644
---- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-+++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-@@ -193,7 +193,7 @@ from sage.libs.singular.decl cimport (
-     p_IsUnit, p_IsOne, p_Series, p_Head, idInit, fast_map_common_subexp, id_Delete,
-     p_IsHomogeneous, p_Homogen, p_Totaldegree,pLDeg1_Totaldegree, singclap_pdivide, singclap_factorize,
-     idLift, IDELEMS, On, Off, SW_USE_CHINREM_GCD, SW_USE_EZGCD,
--    p_LmIsConstant, pTakeOutComp1, singclap_gcd, pp_Mult_qq, p_GetMaxExp,
-+    p_LmIsConstant, pTakeOutComp, singclap_gcd, pp_Mult_qq, p_GetMaxExp,
-     pLength, kNF, p_Neg, p_Minus_mm_Mult_qq, p_Plus_mm_Mult_qq,
-     pDiff, singclap_resultant, p_Normalize,
-     prCopyR, prCopyR_NoSort)
-@@ -1587,7 +1587,8 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_base):
-             9/4
- 
-             sage: P.monomial_quotient(x,y) # Note the wrong result
--            x*y^65535*z^65535
-+            x*y^65535*z^65535      # 32-bit
-+            x*y^1048575*z^1048575  # 64-bit
- 
-             sage: P.monomial_quotient(x,P(1))
-             x
-@@ -2247,10 +2248,11 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             9/4*x^2 - 1/4*y^2 - y - 1
- 
-             sage: P.<x,y> = PolynomialRing(QQ,order='lex')
--            sage: (x^2^15) * x^2^15
-+            sage: (x^2^32) * x^2^32
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (...)
-+            OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+            OverflowError: exponent overflow (...)  # 64-bit
-         """
-         # all currently implemented rings are commutative
-         cdef poly *_p
-@@ -2371,10 +2373,11 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             ValueError: not a 2nd power
- 
-             sage: P.<x,y> = PolynomialRing(QQ,order='lex')
--            sage: (x+y^2^15)^10
-+            sage: (x+y^2^32)^10
-             Traceback (most recent call last):
-             ....
--            OverflowError: exponent overflow (...)
-+            OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+            OverflowError: exponent overflow (...)  # 64-bit
- 
-         Test fractional powers (:trac:`22329`)::
- 
-@@ -3461,7 +3464,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             x^10000
-             no overflow
- 
--            sage: n = 1000
-+            sage: n = 100000
-             sage: try:
-             ....:     f = x^n
-             ....:     f.subs(x = x^n)
-@@ -4567,7 +4570,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
-         l = []
-         for i from 0 <= i < IDELEMS(res):
-             for j from 1 <= j <= IDELEMS(_I):
--                l.append( new_MP(parent, pTakeOutComp1(&res.m[i], j)) )
-+                l.append( new_MP(parent, pTakeOutComp(&res.m[i], 1)) )
- 
-         id_Delete(&fI, r)
-         id_Delete(&_I, r)
-@@ -4635,7 +4638,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
- 
-             sage: f = 3*x
-             sage: f.reduce([2*x,y])
--            3*x
-+            x
- 
-         The reduction is not canonical when ``I`` is not a Groebner
-         basis::
-diff --git a/src/sage/rings/polynomial/plural.pyx b/src/sage/rings/polynomial/plural.pyx
-index 1c9f35e56ba..587511c3888 100644
---- a/src/sage/rings/polynomial/plural.pyx
-+++ b/src/sage/rings/polynomial/plural.pyx
-@@ -1619,10 +1619,10 @@ cdef class NCPolynomial_plural(RingElement):
-             sage: P = A.g_algebra(relations={y*x:-x*y + z},  order='lex')
-             sage: P.inject_variables()
-             Defining x, z, y
--            sage: (x^2^15) * x^2^15
-+            sage: (x^2^31) * x^2^31
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (65536)
-+            OverflowError: exponent overflow (2147483648)
-         """
-         # all currently implemented rings are commutative
-         cdef poly *_p
-@@ -1689,10 +1689,10 @@ cdef class NCPolynomial_plural(RingElement):
-             sage: P = A.g_algebra(relations={y*x:-x*y + z},  order='lex')
-             sage: P.inject_variables()
-             Defining x, z, y
--            sage: (x+y^2^15)^10
-+            sage: (x+y^2^31)^10
-             Traceback (most recent call last):
-             ....
--            OverflowError: exponent overflow (327680)
-+            OverflowError: exponent overflow (2147483648)
-         """
-         if type(exp) is not Integer:
-             try:
-diff --git a/src/sage/structure/element.pyx b/src/sage/structure/element.pyx
-index b5d83ef71b6..5c45b3fb528 100644
---- a/src/sage/structure/element.pyx
-+++ b/src/sage/structure/element.pyx
-@@ -2705,10 +2705,10 @@ cdef class RingElement(ModuleElement):
-         with Singular 4::
- 
-             sage: K.<x,y> = ZZ[]
--            sage: (x^12345)^54321
-+            sage: (x^123456)^654321
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (670592745)
-+            OverflowError: exponent overflow (...)
-         """
-         return arith_generic_power(self, n)
- 
diff --git a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch b/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
deleted file mode 100644
index ee0f0e656b28..000000000000
--- a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py
-index d5f7157217f..8ca1f958039 100644
---- a/src/sage/rings/number_field/number_field_ideal.py
-+++ b/src/sage/rings/number_field/number_field_ideal.py
-@@ -996,16 +996,38 @@ def is_prime(self):
-             False
-             sage: K.ideal(17).is_prime()  # ramified
-             False
-+
-+        TESTS:
-+
-+        Check that we do not factor the norm of the ideal, this used
-+        to take half an hour, see :trac:`33360`::
-+
-+            sage: K.<a,b,c> = NumberField([x^2-2,x^2-3,x^2-5])
-+            sage: t = (((-2611940*c + 1925290/7653)*b - 1537130/7653*c
-+            ....:       + 10130950)*a + (1343014/7653*c - 8349770)*b
-+            ....:       + 6477058*c - 2801449990/4002519)
-+            sage: t.is_prime()
-+            False
-         """
-         try:
-             return self._pari_prime is not None
-         except AttributeError:
--            F = self.factor()  # factorization with caching
--            if len(F) != 1 or F[0][1] != 1:
--                self._pari_prime = None
--            else:
--                self._pari_prime = F[0][0]._pari_prime
--            return self._pari_prime is not None
-+            pass
-+
-+        K = self.number_field().pari_nf()
-+        I = self.pari_hnf()
-+
-+        candidate = K.idealismaximal(I) or None
-+
-+        # PARI uses probabilistic primality testing inside idealismaximal().
-+        if get_flag(None, 'arithmetic'):
-+            # proof required, check using isprime()
-+            if candidate and not candidate[0].isprime():
-+                candidate = None
-+
-+        self._pari_prime = candidate
-+
-+        return self._pari_prime is not None
- 
-     def pari_prime(self):
-         r"""
diff --git a/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch b/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
deleted file mode 100644
index 91f06fd4d173..000000000000
--- a/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-diff --git a/src/sage/misc/persist.pyx b/src/sage/misc/persist.pyx
-index 3ac5f1cc2b0..cb1f327c199 100644
---- a/src/sage/misc/persist.pyx
-+++ b/src/sage/misc/persist.pyx
-@@ -157,7 +157,7 @@ def load(*filename, compress=True, verbose=True, **kwargs):
-         ....:     _ = f.write(code)
-         sage: load(t)
-         sage: hello
--        <fortran object>
-+        <fortran ...>
-     """
-     import sage.repl.load
-     if len(filename) != 1:
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index 6f0aeab87ae..b77c69b2f77 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -461,6 +461,8 @@ def complex_to_rgb(z_values, contoured=False, tiled=False,
-             rgb[i, j, 2] = b
- 
-     sig_off()
-+    nan_indices = np.isnan(rgb).any(-1)     # Mask for undefined points
-+    rgb[nan_indices] = 1                    # Make nan_indices white
-     return rgb
- 
- 
-diff --git a/src/sage/plot/histogram.py b/src/sage/plot/histogram.py
-index 3bc2b76b58e..388c2d1391d 100644
---- a/src/sage/plot/histogram.py
-+++ b/src/sage/plot/histogram.py
-@@ -87,13 +87,8 @@ def get_minmax_data(self):
- 
-         TESTS::
- 
--            sage: h = histogram([10,3,5], normed=True)[0]
--            doctest:warning...:
--            DeprecationWarning: the 'normed' option is deprecated. Use 'density' instead.
--            See https://trac.sagemath.org/25260 for details.
-+            sage: h = histogram([10,3,5], density=True)[0]
-             sage: h.get_minmax_data()
--            doctest:warning ...
--            ...VisibleDeprecationWarning: Passing `normed=True` on non-uniform bins has always been broken, and computes neither the probability density function nor the probability mass function. The result is only correct if the bins are uniform, when density=True will produce the same result anyway. The argument will be removed in a future version of numpy.
-             {'xmax': 10.0, 'xmin': 3.0, 'ymax': 0.476190476190..., 'ymin': 0}
-         """
-         import numpy
-diff --git a/src/sage/repl/ipython_extension.py b/src/sage/repl/ipython_extension.py
-index 798671aab42..cad6a47ca8b 100644
---- a/src/sage/repl/ipython_extension.py
-+++ b/src/sage/repl/ipython_extension.py
-@@ -405,7 +405,7 @@ def fortran(self, line, cell):
-             ....: C END FILE FIB1.F
-             ....: ''')
-             sage: fib
--            <fortran object>
-+            <fortran ...>
-             sage: from numpy import array
-             sage: a = array(range(10), dtype=float)
-             sage: fib(a, 10)
diff --git a/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch b/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
deleted file mode 100644
index 2769e87f6a4b..000000000000
--- a/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-diff --git a/src/sage/interfaces/tachyon.py b/src/sage/interfaces/tachyon.py
-index 23671e50892..ce1d50f71bc 100644
---- a/src/sage/interfaces/tachyon.py
-+++ b/src/sage/interfaces/tachyon.py
-@@ -683,12 +683,14 @@
- #*****************************************************************************
- 
- import os
-+import re
- 
- from sage.cpython.string import bytes_to_str
- from sage.misc.pager import pager
- from sage.misc.superseded import deprecation
- from sage.misc.temporary_file import tmp_filename
- from sage.structure.sage_object import SageObject
-+from sage.misc.cachefunc import cached_method
- 
- 
- class TachyonRT(SageObject):
-@@ -799,6 +801,11 @@ def __call__(self, model, outfile='sage.png', verbose=1, extra_opts=''):
-             Parser failed due to an input file syntax error.
-             Aborting render.
-         """
-+        if self.version() >= '0.99.2':
-+            # this keyword was changed in 0.99.2
-+            model = model.replace(
-+                    "              focallength ",
-+                    "              focaldist ")
-         modelfile = tmp_filename(ext='.dat')
-         with open(modelfile, 'w') as file:
-             file.write(model)
-@@ -851,6 +858,25 @@ def usage(self, use_pager=True):
-         else:
-             print(r)
- 
-+    @cached_method
-+    def version(self):
-+        """
-+        Returns the version of the Tachyon raytracer being used.
-+
-+        TESTS::
-+
-+            sage: tachyon_rt.version()  # random
-+            0.98.9
-+            sage: tachyon_rt.version() >= '0.98.9'
-+            True
-+        """
-+        with os.popen('tachyon') as f:
-+            r = f.readline()
-+        res = re.search(r"Version ([\d.]*)", r)
-+        # debian patches tachyon so it won't report the version
-+        # we hardcode '0.99' since that's indeed the version they ship
-+        return res[1] if res else '0.99'
-+
-     def help(self, use_pager=True):
-         """
-         Deprecated: type 'sage.interfaces.tachyon?' for help
diff --git a/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch b/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
deleted file mode 100644
index 11eb20d4f735..000000000000
--- a/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff --git a/src/sage/arith/long.pxd b/src/sage/arith/long.pxd
-index 1c9a53387a0..d96b98f247c 100644
---- a/src/sage/arith/long.pxd
-+++ b/src/sage/arith/long.pxd
-@@ -270,6 +270,17 @@ cdef inline bint integer_check_long_py(x, long* value, int* err):
-         sage: L += [-x for x in L] + [0, long_min()]
-         sage: for v in L:
-         ....:     assert check_long_py(int(v)) == v
-+        sage: check_long_py(int(2^60))
-+        1152921504606846976                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^61))
-+        2305843009213693952                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^62))
-+        4611686018427387904                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^63))
-+        'Overflow (...)'
-         sage: check_long_py(int(2^100))
-         'Overflow (...)'
-         sage: check_long_py(int(long_max() + 1))
-@@ -309,7 +320,12 @@ cdef inline bint integer_check_long_py(x, long* value, int* err):
- 
-     cdef long lead
-     cdef long lead_2_overflow = (<long>1) << (BITS_IN_LONG - PyLong_SHIFT)
--    cdef long lead_3_overflow = (<long>1) << (BITS_IN_LONG - 2 * PyLong_SHIFT)
-+    cdef long lead_3_overflow
-+    if BITS_IN_LONG < 2 * PyLong_SHIFT:
-+        # in this case 3 digit is always overflow
-+        lead_3_overflow = 0
-+    else:
-+        lead_3_overflow = (<long>1) << (BITS_IN_LONG - 2 * PyLong_SHIFT)
-     if size == 0:
-         value[0] = 0
-         err[0] = 0
diff --git a/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch b/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
deleted file mode 100644
index c4d7d5c779d1..000000000000
--- a/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/src/sage/schemes/toric/sheaf/klyachko.py b/src/sage/schemes/toric/sheaf/klyachko.py
-index b1304a16913..77fae4b7545 100644
---- a/src/sage/schemes/toric/sheaf/klyachko.py
-+++ b/src/sage/schemes/toric/sheaf/klyachko.py
-@@ -26,7 +26,7 @@
-     (0, 0, 18, 16, 1)
-     sage: Gtilde = G_sum.random_deformation()
-     sage: V = Gtilde.wedge(2) * K                     # long time
--    sage: V.cohomology(dim=True, weight=(0,0,0,0))    # long time
-+    sage: V.cohomology(dim=True, weight=(0,0,0,0))    # long time  # random failure (see #32773)
-     (0, 0, 3, 0, 0)
- 
- REFERENCES:
-@@ -948,7 +948,7 @@ def random_deformation(self, epsilon=None):
-            sage: V.cohomology(dim=True, weight=(0,))
-            (1, 0)
-            sage: Vtilde = V.random_deformation()
--           sage: Vtilde.cohomology(dim=True, weight=(0,))
-+           sage: Vtilde.cohomology(dim=True, weight=(0,))  # random failure (see #32773)
-            (1, 0)
-         """
-         filt = self._filt.random_deformation(epsilon)
diff --git a/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch b/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
deleted file mode 100644
index d9a9835c696b..000000000000
--- a/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 9ac7840134054155545e24fa3e66402d42b91c0f Mon Sep 17 00:00:00 2001
-From: Antonio Rojas <arojas@archlinux.org>
-Date: Fri, 20 Jan 2023 21:36:27 +0100
-Subject: [PATCH] Fix tests with giac 1.9.0.35
-
----
- src/sage/libs/giac/giac.pyx   |  3 +--
- src/sage/symbolic/relation.py | 15 +++++----------
- 2 files changed, 6 insertions(+), 12 deletions(-)
-
-diff --git a/src/sage/libs/giac/giac.pyx b/src/sage/libs/giac/giac.pyx
-index 4e451dba5e7..ccad5169836 100644
---- a/src/sage/libs/giac/giac.pyx
-+++ b/src/sage/libs/giac/giac.pyx
-@@ -374,8 +374,7 @@ def _giac(s):
- 
-         sage: x = libgiac('x')
-         sage: (1+2*sin(3*x)).solve(x).simplify()
--        Warning, argument is not an equation, solving 1+2*sin(3*x)=0
--        list[-pi/18,7*pi/18]
-+        ...list[-pi/18,7*pi/18]
- 
-         sage: libgiac.solve('sin(3*x)>2*sin(x)',x)
-         Traceback (most recent call last):
-diff --git a/src/sage/symbolic/relation.py b/src/sage/symbolic/relation.py
-index e9dbc0fea30..b8896a94be9 100644
---- a/src/sage/symbolic/relation.py
-+++ b/src/sage/symbolic/relation.py
-@@ -935,8 +935,7 @@ def solve(f, *args, **kwds):
- 
-         sage: f = (sin(x) - 8*cos(x)*sin(x))*(sin(x)^2 + cos(x)) - (2*cos(x)*sin(x) - sin(x))*(-2*sin(x)^2 + 2*cos(x)^2 - cos(x))
-         sage: solve(f, x, algorithm='giac')
--        ...
--        [-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-+        ...[-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
- 
-         sage: x, y = SR.var('x,y')
-         sage: solve([x+y-4,x*y-3],[x,y],algorithm='giac')
-@@ -1440,19 +1439,15 @@ def _giac_solver(f, x, solution_dict=False):
-     EXAMPLES::
- 
-         sage: solve([(2/3)^x-2], [x], algorithm='giac')
--        ...
--        [[-log(2)/(log(3) - log(2))]]
-+        ...[[-log(2)/(log(3) - log(2))]]
-         sage: solve([(2/3)^x-2], [x], algorithm='giac', solution_dict=True)
--        ...
--        [{x: -log(2)/(log(3) - log(2))}]
-+        ...[{x: -log(2)/(log(3) - log(2))}]
- 
-         sage: f = (sin(x) - 8*cos(x)*sin(x))*(sin(x)^2 + cos(x)) - (2*cos(x)*sin(x) - sin(x))*(-2*sin(x)^2 + 2*cos(x)^2 - cos(x))
-         sage: solve(f, x, algorithm='giac')
--        ...
--        [-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-+        ...[-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-         sage: solve(f, x, algorithm='giac', solution_dict=True)
--        ...
--        [{x: -2*arctan(sqrt(2))}, {x: 0}, {x: 2*arctan(sqrt(2))}, {x: pi}]
-+        ...[{x: -2*arctan(sqrt(2))}, {x: 0}, {x: 2*arctan(sqrt(2))}, {x: pi}]
- 
-         sage: x, y = SR.var('x,y')
-         sage: solve([x+y-7,x*y-10],[x,y],algorithm='giac')
diff --git a/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch b/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
deleted file mode 100644
index 499e0c71e256..000000000000
--- a/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
+++ /dev/null
@@ -1,1303 +0,0 @@
-diff --git a/build/pkgs/gap/checksums.ini b/build/pkgs/gap/checksums.ini
-index 066e943308a..b0ea8ba8818 100644
---- a/build/pkgs/gap/checksums.ini
-+++ b/build/pkgs/gap/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=gap-VERSION.tar.gz
--sha1=4ecdd281b8f430282fb9b12690b06e0a26abde10
--md5=85dc9e459d5b6c66fcad9f468afd3e3e
--cksum=1351843158
-+sha1=a6e36f3f874a2c46f51561402634497eab705cca
-+md5=c5cd9f272f2703d7a3649ad7193b2d90
-+cksum=2760477284
- upstream_url=https://github.com/gap-system/gap/releases/download/vVERSION/gap-VERSION.tar.gz
-diff --git a/build/pkgs/gap/package-version.txt b/build/pkgs/gap/package-version.txt
-index d782fca8f64..f1cd7de1de5 100644
---- a/build/pkgs/gap/package-version.txt
-+++ b/build/pkgs/gap/package-version.txt
-@@ -1 +1 @@
--4.11.1
-+4.12.2
-diff --git a/build/pkgs/gap/spkg-check.in b/build/pkgs/gap/spkg-check.in
-index d9791d33293..d2fccda6e04 100644
---- a/build/pkgs/gap/spkg-check.in
-+++ b/build/pkgs/gap/spkg-check.in
-@@ -3,6 +3,13 @@ cd src
- # #28728: Fix test failure in tst/testinstall/strings.tst
- export LC_CTYPE=en_US.UTF-8
- 
-+# #34391: in GAP 4.12 some packages need GAP package io
-+#         to let tests run, otherwise this hangs. Thus we install io here.
-+cd pkg/io
-+./configure --with-gaproot=../..
-+make
-+cd ../..
-+
- make testinstall
- if [[ $? -ne 0 ]]; then
-     exit 1
-diff --git a/build/pkgs/gap/spkg-install.in b/build/pkgs/gap/spkg-install.in
-index 2ceadf99db4..e2c8b4dca54 100644
---- a/build/pkgs/gap/spkg-install.in
-+++ b/build/pkgs/gap/spkg-install.in
-@@ -8,8 +8,7 @@ export CFLAGS=$CFLAGS_NON_NATIVE
- export CXXFLAGS=$CXXFLAGS_NON_NATIVE
- 
- GAP_BUILD_ROOT="$(pwd)"
--GAP_ROOT="$SAGE_LOCAL/share/gap"
--DESTDIR_GAP_ROOT="$SAGE_DESTDIR$GAP_ROOT"
-+GAP_ROOT="$SAGE_LOCAL/lib/gap"
- 
- # Enable debug info if requested.
- # Note that -g3 allows you to use preprocessor macros in gdb which are widely used
-@@ -17,37 +16,17 @@ if [ "$SAGE_DEBUG" = yes ] ; then
-     export CFLAGS="-O0 -g3 -DDEBUG_MASTERPOINTERS -DDEBUG_GLOBAL_BAGS -DDEBUG_FUNCTIONS_BAGS $CFLAGS"
- fi
- 
--sdh_configure $SAGE_CONFIGURE_GMP
--sdh_make -j1
-+# LDFLAGS hack below needed by Semigroups package
-+sdh_configure $SAGE_CONFIGURE_GMP LDFLAGS="-pthread" --prefix=$SAGE_LOCAL
-+sdh_make
- 
--# GAP's "make install" is work in progress; we use bits and pieces of it
--# but we install many things manually.
--sdh_make install-headers install-libgap
--
--# Install config.h, which is not currently handled by `make install-headers`
--sdh_install gen/config.h "$SAGE_LOCAL/include/gap"
--
--# Now install the gap executable as "gap-bin"; it will be called normally
--# through our wrapper script that sets the appropriate GAP_ROOT
--SAGE_BIN="$SAGE_LOCAL/bin"
--mkdir -p "$SAGE_DESTDIR$SAGE_BIN" || sdh_die "Failed to create the directory $SAGE_BIN"
--
--./libtool --mode=install install gap "$SAGE_DESTDIR$SAGE_BIN/gap-bin" || \
--    sdh_die "Failed to install gap-bin to $SAGE_BIN"
--
--./libtool --mode=install install gac "$SAGE_DESTDIR$SAGE_BIN/gac" || \
--    sdh_die "Failed to install gac to $SAGE_BIN"
--
--# Now copy additional files GAP needs to run (and a few optional bits) into
--# GAP_ROOT; we don't need everything from the source tree
--sdh_install bin doc gen grp lib src tst sysinfo.gap "$GAP_ROOT"
--
--# GAP's copy of libtool is also used by the toolchain for build GAP packages
--# (i.e. by gac)
--sdh_install libtool "$GAP_ROOT"
-+sdh_make_install
-+# sdh_make install-headers install-libgap
-+# The 'packagemanager' package expects this https://github.com/gap-packages/PackageManager/issues/105
-+mkdir -p "$SAGE_LOCAL/lib/gap/bin"
- 
- # Install only the minimal packages GAP needs to run
--sdh_install pkg/GAPDoc-* pkg/primgrp-* pkg/SmallGrp-* pkg/transgrp "$GAP_ROOT"/pkg
-+sdh_install pkg/gapdoc pkg/primgrp pkg/smallgrp pkg/transgrp "$GAP_ROOT"/pkg
- 
- # Install additional packages that are not strictly required, but that are
- # typically "expected" to be loaded: These are the default packages that are
-@@ -58,50 +37,25 @@ sdh_install pkg/GAPDoc-* pkg/primgrp-* pkg/SmallGrp-* pkg/transgrp "$GAP_ROOT"/p
- # Also include atlasrep which is a dependency of tomlib
- sdh_install \
-     pkg/atlasrep \
--    pkg/autpgrp-* \
--    pkg/alnuth-* \
--    pkg/crisp-* \
--    pkg/ctbllib-* \
--    pkg/FactInt-* \
-+    pkg/autodoc \
-+    pkg/autpgrp \
-+    pkg/alnuth \
-+    pkg/crisp \
-+    pkg/ctbllib \
-+    pkg/factint \
-     pkg/fga \
--    pkg/irredsol-* \
--    pkg/laguna-* \
--    pkg/PackageManager-* \
--    pkg/polenta-* \
--    pkg/polycyclic-* \
--    pkg/resclasses-* \
--    pkg/sophus-* \
--    pkg/tomlib-* \
-+    pkg/irredsol \
-+    pkg/laguna \
-+    pkg/packagemanager \
-+    pkg/polenta \
-+    pkg/polycyclic \
-+    pkg/radiroot \
-+    pkg/resclasses \
-+    pkg/sophus \
-+    pkg/tomlib \
-+    pkg/utils \
-     "$GAP_ROOT"/pkg
- 
--# Install the GAP startup script; ensure it is executable
--sdh_install -T ../gap "$SAGE_BIN/gap"
--chmod +x "$SAGE_DESTDIR$SAGE_BIN/gap"
--
--# Create symlinks under $GAP_ROOT for these executables, as they are expected
--# (especially when building kernel packages) to exist
--ln -sf "../../bin/gap-bin" "$DESTDIR_GAP_ROOT/gap"
--ln -sf "../../bin/gac" "$DESTDIR_GAP_ROOT/gac"
--
--# Fix the $GAP_ROOT/bin/<arch>/src symlink to be relative (otherwise it links
--# to the actual path of the sources GAP was compiled from)
--for srclink in "$DESTDIR_GAP_ROOT"/bin/*/src; do
--    rm -f "$srclink"
--    ln -s "../../src" "$srclink"
--done
--
--# Additional fixups for some files after they have been copied into their
--# destination directory.  gac and sysinfo.gap are generated files that contain
--# in them hard-coded references to the GAP build directory, which will soon
--# be going away.  This breaks the build toolchain for some compiled GAP
--# packages.  We need to replace these paths with the final GAP_ROOT path.  The
--# below will work so long as neither of these paths contain '|', and if they do
--# then god help you.  https://trac.sagemath.org/ticket/27218
--sed -i -e "s|$GAP_BUILD_ROOT|$GAP_ROOT|g" \
--    "$SAGE_DESTDIR$SAGE_BIN/gac" "$DESTDIR_GAP_ROOT/sysinfo.gap" \
--    "$DESTDIR_GAP_ROOT/bin/gap.sh" "$DESTDIR_GAP_ROOT/doc/make_doc" || \
--    sdh_die "Failed to fix up hard-coded paths in GAP build tools."
--
- # TODO: This seems unnecessary--we are already installing all of doc/ to
- # GAP_ROOT, which is necessary for some functionality in GAP to work.  Do
- # we need this?  Maybe doc/gap could just be a symlink to gap/doc??
-diff --git a/build/pkgs/gap/spkg-legacy-uninstall b/build/pkgs/gap/spkg-legacy-uninstall
-index d17eb939eb7..a8e5c59e1fb 100755
---- a/build/pkgs/gap/spkg-legacy-uninstall
-+++ b/build/pkgs/gap/spkg-legacy-uninstall
-@@ -4,6 +4,8 @@ rm -rf "$SAGE_LOCAL/gap/gap-4."*
- rm -rf "$SAGE_SHARE/gap"
- rm -f "$SAGE_LOCAL/gap/latest"
- rm -f "$SAGE_LOCAL/bin/gap"
-+rm -f "$SAGE_LOCAL/bin/gac"
- 
--# Remove old libgap headers
-+# Remove old libgap headers and library
- rm -rf "$SAGE_LOCAL/include/gap"
-+rm -rf "$SAGE_LOCAL/lib/gap"
-diff --git a/build/pkgs/gap/spkg-prerm.in b/build/pkgs/gap/spkg-prerm.in
-deleted file mode 100644
-index 661d92621fa..00000000000
---- a/build/pkgs/gap/spkg-prerm.in
-+++ /dev/null
-@@ -1,6 +0,0 @@
--# These generated files are placed in directory provided by the SPKG, so
--# delete the generated files first so that their parent directories can be
--# removed during installation
--GAP_ROOT="$SAGE_LOCAL/share/gap"
--rm -f "$GAP_ROOT/pkg/atlasrep/datagens/"*.*
--rm -f "$GAP_ROOT/pkg/atlasrep/dataword/"*.*
-diff --git a/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch b/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch
-deleted file mode 100644
-index e45fe7d9c6f..00000000000
---- a/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch
-+++ /dev/null
-@@ -1,150 +0,0 @@
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c b/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--index 3bbdc45..7df699f 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--@@ -8,9 +8,8 @@ extern short sp[],**mat[],*psp[],**imcos[],**cpco[],lorb[],
-- short *cst,**cpst,***cdpst,**svptr,*cp,*rel;
-- short *spst,**pspst,**pptr,**cpptr,npt,nb,nph,nph2,npg,npg2,
--       rno,orno,coh_index,*invg;
---FILE  *ip,*op;
-- 
---void seeknln (void) { while (getc(ip)!='\n'); }
--+void seeknln (FILE *ip) { while (getc(ip)!='\n'); }
-- 
-- /* This program differs from most other permutation programs in that perms are
--    all stored in the single array sp. Schreier vectors are stored in the short
--@@ -23,13 +22,14 @@ void seeknln (void) { while (getc(ip)!='\n'); }
-- int 
-- crprog1 (void)
-- { short *pc,*qc,ex,neg; int x;
--+  FILE  *ip,*op;
--   short i,j,k,l,m,n,cl,rl,*p,ocl,im,pt,pt1,pn,ipt;
--   if ((ip=fopen(inf2,"r"))== 0)
--   { fprintf(stderr,"Cannot open %s.\n",inf2); return(-1);}
--   fscanf(ip,"%hd%hd%hd%hd",&npt,&nph,&nb,&k);
--   if (nb>=mb) {fprintf(stderr,"nb too big. Increase MB.\n"); return(-1);}
--   if (k<=2) {fprintf(stderr,"inf2 has illegal format.\n"); return(-1); }
---  seeknln(); seeknln();
--+  seeknln(ip); seeknln(ip);
--   for (i=1;i<=nb;i++) fscanf(ip,"%hd",lorb+i);
--   pptr=psp-1; pspst=psp+nph; svptr=cpsp-1;  cpst=cpsp+nb;
--   invg=sp; nph2=2*nph; spst=sp+nph2;
--@@ -37,7 +37,7 @@ crprog1 (void)
--   { pptr[i]=spst+(i-1)*npt-1; p=pptr[i];
--     for (j=1;j<=npt;j++) {fscanf(ip,"%hd",&k); p[k]=j; }
--     invg[2*i-2]=2*i-1; invg[2*i-1]=2*i-2;
---    seeknln();
--+    seeknln(ip);
--   }
--   spst+=(npt*nph);
--   for (i=1;i<=nb;i++)
--@@ -75,7 +75,7 @@ crprog1 (void)
--   strcpy(inf1,inf0); strcat(inf1,".rel");
--   if ((ip=fopen(inf1,"r"))==0)
--   { fprintf(stderr,"Cannot open %s.\n",inf1); return(-1);}
---  fscanf(ip,"%hd%hd",&k,&rno); seeknln();
--+  fscanf(ip,"%hd%hd",&k,&rno); seeknln(ip);
--   op=fopen(outft,"w");
-- /* Now we have read everything in, and the computation can start */
--   orno=0;
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--index a7396b2..658496f 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--@@ -20,8 +20,6 @@ short  mexp=MEXP,mcl=MCL,no,rel[RSP],wt[MEXP],exp,*rpf,*rpb,
-- extern short  prime,dim,*spv,**spm,mspace[],*vec[],**mat[],cp[],pinv[],opmats,
--         mm,mv;
-- extern int msp;
---FILE *ip,*op;
---
-- 
-- int 
-- calcmats (void)
--@@ -59,7 +57,7 @@ calcmats (void)
--   }
--   for (i=1;i<=exp;i++) trans(mat[i+exp],mat[i]);
--   if (opmats)
---  { op=fopen(outf,"w");
--+  { FILE *op=fopen(outf,"w");
--     fprintf(op,"%4d%4d%4d\n",prime,dim,exp);
--     for (i=1;i<=exp;i++) printmat(mat[i]); 
--     fclose(op);
--@@ -71,6 +69,7 @@ int
-- rdmats (void)
-- /* reads matrices of generators of P */
-- { short i; int quot;
--+  FILE *ip;
--   ip=fopen(inf4,"r");
--   if (ip==0)
--   { fprintf(stderr,"Cannot open %s\n ",inf4); return(-1); }
--@@ -90,12 +89,12 @@ rdmats (void)
--   fclose(ip);
--   return(0);
-- }
---FILE *ip;
-- 
-- int 
-- ingp (int inp)
-- /* Read in output of respcrun -s */
-- { short i,j,k,l,m,*orpf,**pcp;
--+  FILE *ip;
--   ip=fopen(inf3,"r");
--   if (ip==0) { fprintf(stderr,"Cannot open %s\n",inf3); return(-1); }
--   fscanf(ip,"%hd%hd%hd%hd%hd%hd",&prime,&exp,&i,&no,&j,&m);
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--index 0896551..6841bc8 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--@@ -9,7 +9,6 @@ extern short  intexp,mexp,mng,wksp,
--        spugen[],*tlintg[];
-- extern int ptrsp,rsp;
-- short  fac;
---FILE *ip,*op;
-- 
-- int 
-- ingp (void)
--@@ -18,6 +17,7 @@ ingp (void)
--    of nqrun, and tails are also read in.
-- */
-- { short i,j,k,l,m,x,y,no,*orpf,*orpb,**pcp;  char tails;
--+  FILE *ip;
--   if ((ip=fopen(inf1,"r"))==0)
--   { fprintf(stderr,"Cannot open %s.\n",inf1); return(-1); }
--   fscanf(ip,"%hd%hd%hd%hd%hd%hd",&prime,&exp,&nng,&no,&class,&m);
--@@ -89,6 +89,7 @@ int
-- outgp (void)
-- /* The PCP is output, together with tails */
-- { short i,k,l,**pcp,*b,*e,*c;
--+  FILE *op;
--   op=fopen(outf,"w");
--   fprintf(op,"%4d%4d%4d%4d%4d%4d\n",prime,exp,nng,exp,class,1);
--   for (i=1;i<=exp;i++) fprintf(op,"%4d",wt[i]); fprintf(op,"\n");
--@@ -379,7 +380,7 @@ restart:
--     nng--; mnng--; enexpnt--;
--     if (nng==0)
--     { if (gap)
---      { op=fopen(outfm,"w"); fprintf(op,"COHOMOLO.Multiplier:=[];\n");
--+      { FILE *op=fopen(outfm,"w"); fprintf(op,"COHOMOLO.Multiplier:=[];\n");
--         fclose(op);
--         printf("All new generators eliminated. Multiplier is trivial.\n");
--       }
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--index 01cf914..0144883 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--@@ -9,7 +9,6 @@ extern short  intexp,mng,mexp,wksp,
--        spugen[],*intg[],*imintg[],*tlintg[];
-- extern int ptrsp,rsp;
-- short  *wf,*wc; char norm;
---FILE *ip,*op;
-- 
-- /* The data structures for this program and for nqrun are similar.
--    d1 and d2 contain definitions of generators. (Def. comes from commutator
--@@ -35,6 +34,7 @@ nqmprog (void)
-- { short i,j,k,l,m,d,*gi,*gj,*ti,*tj,cl,def,*ps,*pf,**dp,*nrpb,*p,*orpf,*orpb,
--         nb,np,k1,*rno,*covrel,**pgen,tdef,sgn;
--   char nt;
--+  FILE *ip,*op;
--   if (ingp() == -1) {fprintf(stderr,"Input error.\n"); return(-1); }
--   eexpnt=expnt+exp; enexpnt=nexpnt+nng;
-- 
-diff --git a/build/pkgs/gap_packages/patches/guava_leon_includes.patch b/build/pkgs/gap_packages/patches/guava_leon_includes.patch
-deleted file mode 100644
-index cdcd19cc3e8..00000000000
---- a/build/pkgs/gap_packages/patches/guava_leon_includes.patch
-+++ /dev/null
-@@ -1,13 +0,0 @@
----- a/pkg/guava-3.15/src/leon/src/generate.c	Sat Feb 29 09:02:10 2020
----- b/pkg/guava-3.15/src/leon/src/generate.c	Thu Sep 24 13:58:36 2020
--***************
--*** 115,120 ****
----- 115,122 ----
--  #include "groupio.h"
--  #include "enum.h"
--  #include "storage.h"
--+ #include "chbase.h"
--+ #include "inform.h"
--  
--  #ifdef ALT_TIME_HEADER
--  #include "cputime.h"
-diff --git a/build/pkgs/gap_packages/spkg-install.in b/build/pkgs/gap_packages/spkg-install.in
-index 168e6b11532..6dff182a48f 100644
---- a/build/pkgs/gap_packages/spkg-install.in
-+++ b/build/pkgs/gap_packages/spkg-install.in
-@@ -1,4 +1,4 @@
--GAP_ROOT="$SAGE_LOCAL/share/gap"
-+GAP_ROOT="$SAGE_LOCAL/lib/gap"
- PKG_DIR="$GAP_ROOT/pkg"
- 
- PKG_SRC_DIR="$(pwd)/src/pkg"
-@@ -11,33 +11,31 @@ cd "$PKG_SRC_DIR"
- #    (GAP 4.8.6 still had it, but this is gone in 4.10)
- 
- sdh_install \
--    aclib-* \
--    AutoDoc-* \
--    corelg-* \
--    crime-* \
-+    aclib \
-+    corelg \
-+    crime \
-     cryst \
-     crystcat \
--    design-* \
-+    design \
-     gbnp \
--    genss-* \
--    hap-* \
--    hapcryst-* \
--    hecke-* \
--    images-* \
--    liealgdb-* \
--    liepring-* \
--    liering-* \
--    loops-* \
--    MapClass-* \
--    polymaking-* \
--    qpa-* \
--    quagroup-* \
--    radiroot-* \
--    repsn-* \
--    sla-* \
--    sonata-* \
--    Toric-* \
--    utils-* \
-+    genss \
-+    hap \
-+    hapcryst \
-+    hecke \
-+    images \
-+    liealgdb \
-+    liepring \
-+    liering \
-+    loops \
-+    mapclass \
-+    polymaking \
-+    qpa \
-+    quagroup \
-+    repsn \
-+    singular \
-+    sla \
-+    sonata \
-+    toric \
-     "$PKG_DIR"
- 
- install_compiled_pkg()
-@@ -45,27 +43,23 @@ install_compiled_pkg()
-     local pkg="$1"
-     # Install the bin/ dir (where compiled modules should end up)
-     # under <prefix>/lib/gap; we then symlink to it later
--    sdh_install bin "$SAGE_LOCAL/lib/gap/pkg/$pkg"
-+    sdh_install * "$SAGE_LOCAL/lib/gap/pkg/$pkg"
- 
-+    # TODO:
-     # Clean up any build artificts before installing the rest of the package
-     # Also remove configure/Makefiles
-     # Note: None, if any of the packages really have a proper install target
--    make clean  # Works for some packages but not all
--    rm -rf bin/
--    rm -rf configure configure.* config.* autogen.sh *.m4 Makefile* m4/
-+    #make clean  # Works for some packages but not all
-+    #rm -rf bin/
-+    #rm -rf configure configure.* config.* autogen.sh *.m4 Makefile* m4/
- 
--    # Create the bin/ symlink
--    ln -s "$SAGE_LOCAL/lib/gap/pkg/$pkg/bin" bin
--
--    # Install the rest of the package files
--    sdh_install * "$PKG_DIR/$pkg"
- }
- 
- # Build and install compiled packages:
- #
- # These packages have an old ./configure that take the GAP_ROOT as a positional
- # argument
--for pkg in cohomolo-* crypting-* grape-* guava-* orb-* datastructures-*
-+for pkg in cohomolo crypting grape guava orb datastructures
- do
-     echo "Building GAP package $pkg"
-     CFLAGS="$CFLAGS -Wno-implicit-function-declaration"
-@@ -91,7 +85,7 @@ pararr=( " " " " "--with-external-planarity" "--with-external-libsemigroups" )
- ##############################################################################
- 
- parind=0
--for pkg in nq-* io-* digraphs-* semigroups-*
-+for pkg in nq io digraphs semigroups
- do
-     echo "Building GAP package $pkg"
-     cd "$PKG_SRC_DIR/$pkg"
-diff --git a/build/pkgs/libsemigroups/checksums.ini b/build/pkgs/libsemigroups/checksums.ini
-index 62c4268515f..4e13a36cb35 100644
---- a/build/pkgs/libsemigroups/checksums.ini
-+++ b/build/pkgs/libsemigroups/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=libsemigroups-VERSION.tar.gz
--sha1=2b16c095cc5ffd3f77a71dfbf48cce188e054c03
--md5=7082cadcf7a195ccb93175cd72b6db95
--cksum=1501022358
-+sha1=86375824b47ce4b0e23570122e873f67136d0c0a
-+md5=ff79ad5fbc8bfeb64d48faaf24106b98
-+cksum=2845045455
- upstream_url=https://github.com/libsemigroups/libsemigroups/releases/download/vVERSION/libsemigroups-VERSION.tar.gz
-diff --git a/build/pkgs/libsemigroups/package-version.txt b/build/pkgs/libsemigroups/package-version.txt
-index 9084fa2f716..f90b1afc082 100644
---- a/build/pkgs/libsemigroups/package-version.txt
-+++ b/build/pkgs/libsemigroups/package-version.txt
-@@ -1 +1 @@
--1.1.0
-+2.3.2
-diff --git a/build/pkgs/libsemigroups/spkg-install.in b/build/pkgs/libsemigroups/spkg-install.in
-index 2aaf0e99043..128b54d2f99 100644
---- a/build/pkgs/libsemigroups/spkg-install.in
-+++ b/build/pkgs/libsemigroups/spkg-install.in
-@@ -1,4 +1,4 @@
- cd src
--sdh_configure
-+sdh_configure --disable-eigen
- sdh_make
- sdh_make_install
-diff --git a/build/pkgs/singular/spkg-configure.m4 b/build/pkgs/singular/spkg-configure.m4
-index d4d145defe3..6a85631f624 100644
---- a/build/pkgs/singular/spkg-configure.m4
-+++ b/build/pkgs/singular/spkg-configure.m4
-@@ -9,52 +9,7 @@ SAGE_SPKG_CONFIGURE([singular], [
-        AC_MSG_CHECKING([that Singular's help is working])
-        AS_IF([test x`printf "system(\"--browser\", \"builtin\"); \n help;" | Singular 2>&1 | grep "error occurred"` = x], [
-         AC_MSG_RESULT(yes)
--        dnl We have Singular. Now determine the shared library path on
--        dnl platforms on which sage.libs.singular needs to reload the library with RTLD_GLOBAL.
--        AS_CASE([$host_os],
--          [cygwin*], [dnl Nothing to do
--                     ],
--                     [dnl Use pkg-config to get singular's libdir while we're at it. As a
--                      dnl moral compromise for using pkg-config, this ultimately allows us
--                      dnl to pass an absolute path to dlopen(), which is the only approach
--                      dnl that POSIX guarantees will work.
--                      PKG_CHECK_VAR([SINGULAR_LIB_DIR], [Singular], [libdir])
--                      dnl The acl_shlibext variable is set in the top-level configure.ac.
--                      AC_LANG_PUSH(C)
--                      ORIG_LIBS="${LIBS}"
--                      LIBS="${LIBS} -ldl"
--                      AC_MSG_CHECKING([if we can dlopen($LIBSINGULAR_PATH)])
--                      LIBSINGULAR_PATH="${SINGULAR_LIB_DIR}/libSingular.${acl_shlibext}"
--
--                      dnl if we can dlopen() it, substitute the name for sage_conf;
--                      dnl otherwise, fall back to using the SPKG.
--                      AC_RUN_IFELSE(
--                        [AC_LANG_PROGRAM(
--                          [[#include <dlfcn.h>]],
--                          [[void* h = dlopen("${LIBSINGULAR_PATH}", RTLD_LAZY | RTLD_GLOBAL);
--                            if (h == 0) { return 1; } else { return dlclose(h); }]]
--                        )], [
--                          AC_MSG_RESULT(yes)
--                        ], [
--                          dnl try Debian-specific name
--                          LIBSINGULAR_PATH="${SINGULAR_LIB_DIR}/libsingular-Singular.${acl_shlibext}"
--                          AC_RUN_IFELSE(
--                           [AC_LANG_PROGRAM(
--                             [[#include <dlfcn.h>]],
--                             [[void* h = dlopen("${LIBSINGULAR_PATH}", RTLD_LAZY | RTLD_GLOBAL);
--                               if (h == 0) { return 1; } else { return dlclose(h); }]]
--                           )], [
--                             AC_MSG_RESULT(yes)
--                           ], [
--                            AC_MSG_RESULT(no)
--                            sage_spkg_install_singular=yes
--                          ], [AC_MSG_RESULT(yes)])
--                        ], [AC_MSG_RESULT(yes)])
--
--                      AC_LANG_POP()
--                      LIBS="${ORIG_LIBS}"
--                     ]
--       )], [
-+       ], [
-        AC_MSG_RESULT(no)
-        sage_spkg_install_singular=yes
-        ]
-@@ -64,20 +19,4 @@ SAGE_SPKG_CONFIGURE([singular], [
-       ])
-     ])
-   ])
--],[],[],[
--  dnl Post-check phase
--  dnl We make the sage_conf substitutions here, because the "default"
--  dnl substitution needs to be made even if we skipped the system-Singular
--  dnl checks themselves.
--  AS_IF([test "x${sage_spkg_install_singular}" = "xyes"], [
--    AS_CASE([$host_os],
--      [cygwin*], [dnl Nothing to do
--                 ],
--                 [dnl Set shared library path, needed for reloading the library with RTLD_GLOBAL
--                  LIBSINGULAR_PATH="\$SAGE_LOCAL/lib/libSingular.${acl_shlibext}"
--                 ]
--    )
--  ])
--
--  AC_SUBST(LIBSINGULAR_PATH, "${LIBSINGULAR_PATH}")
- ])
-diff --git a/pkgs/sage-conf/_sage_conf/_conf.py.in b/pkgs/sage-conf/_sage_conf/_conf.py.in
-index 6cd28f558a8..d66bdb3d264 100644
---- a/pkgs/sage-conf/_sage_conf/_conf.py.in
-+++ b/pkgs/sage-conf/_sage_conf/_conf.py.in
-@@ -55,9 +55,6 @@ THREEJS_DIR = SAGE_LOCAL + "/share/threejs-sage"
- OPENMP_CFLAGS = "@OPENMP_CFLAGS@"
- OPENMP_CXXFLAGS = "@OPENMP_CXXFLAGS@"
- 
--# The full absolute path to the main Singular library.
--LIBSINGULAR_PATH = "@LIBSINGULAR_PATH@".replace('$SAGE_LOCAL', SAGE_LOCAL)
--
- # Installation location of wheels. This is determined at configuration time
- # and does not depend on the installation location of sage-conf.
- SAGE_SPKG_WHEELS = "@SAGE_VENV@".replace('${SAGE_LOCAL}', SAGE_LOCAL) + "/var/lib/sage/wheels"
-diff --git a/src/doc/en/thematic_tutorials/lie/weyl_groups.rst b/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-index c917338e444..182e74aad20 100644
---- a/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-+++ b/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-@@ -139,12 +139,12 @@ string, which you can print::
-     X.1      1  1  1  1  1  1  1  1  1  1  1  1  1
-     X.2      1 -1  1  1 -1  1  1 -1 -1 -1  1  1  1
-     X.3      2  .  2 -1  .  2  2  .  .  . -1  2  2
--    X.4      3 -1 -1  .  1 -1  3 -1  1 -1  . -1  3
--    X.5      3 -1 -1  .  1  3 -1 -1 -1  1  . -1  3
--    X.6      3  1 -1  . -1 -1  3  1 -1  1  . -1  3
--    X.7      3  1 -1  . -1  3 -1  1  1 -1  . -1  3
--    X.8      3 -1  3  . -1 -1 -1 -1  1  1  . -1  3
--    X.9      3  1  3  .  1 -1 -1  1 -1 -1  . -1  3
-+    X.4      3 -1 -1  .  1  3 -1 -1 -1  1  . -1  3
-+    X.5      3  1 -1  . -1  3 -1  1  1 -1  . -1  3
-+    X.6      3 -1  3  . -1 -1 -1 -1  1  1  . -1  3
-+    X.7      3 -1 -1  .  1 -1  3 -1  1 -1  . -1  3
-+    X.8      3  1  3  .  1 -1 -1  1 -1 -1  . -1  3
-+    X.9      3  1 -1  . -1 -1  3  1 -1  1  . -1  3
-     X.10     4 -2  . -1  .  .  .  2  .  .  1  . -4
-     X.11     4  2  . -1  .  .  . -2  .  .  1  . -4
-     X.12     6  . -2  .  . -2 -2  .  .  .  .  2  6
-diff --git a/src/sage/coding/codecan/autgroup_can_label.pyx b/src/sage/coding/codecan/autgroup_can_label.pyx
-index de5db985e0b..c83b9264e44 100644
---- a/src/sage/coding/codecan/autgroup_can_label.pyx
-+++ b/src/sage/coding/codecan/autgroup_can_label.pyx
-@@ -76,7 +76,7 @@ columns do share the same coloring::
-     ((1,),
-      (2,),
-      (3, 5, 4),
--     (6, 19, 16, 9, 21, 10, 8, 15, 14, 11, 20, 13, 12, 7, 17, 18))
-+     (6, 19, 16, 21, 9, 10, 15, 8, 20, 11, 14, 13, 7, 12, 18, 17))
- 
- We can also restrict the group action to linear isometries::
- 
-diff --git a/src/sage/coding/linear_code.py b/src/sage/coding/linear_code.py
-index a3ac3ca1547..bfb9f8696e8 100644
---- a/src/sage/coding/linear_code.py
-+++ b/src/sage/coding/linear_code.py
-@@ -465,27 +465,27 @@ def automorphism_group_gens(self, equivalence="semilinear"):
-             0
-             sage: C = codes.HammingCode(GF(4, 'z'), 3)
-             sage: C.automorphism_group_gens()
--            ([((1, 1, 1, 1, 1, z + 1, z, z + 1, z, z, z, 1, 1, z + 1, z + 1, z, z + 1, z, z + 1, z + 1, z + 1); (1,14,6,7,4,10,11,19)(2,8,16,13,3,17,21,15)(9,12,18,20), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((1, 1, 1, z, z + 1, 1, 1, 1, 1, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z); (1,13,14,20)(2,21,8,18,7,16,19,15)(3,10,5,12,17,9,6,4), Ring endomorphism of Finite Field in z of size 2^2
-+                Defn: z |--> z + 1),
-+              ((z, 1, z, z, z, z + 1, z, z, z, z, z, z, z + 1, z, z, z, z, z + 1, z, z, z); (1,11,5,12,3,19)(2,8)(6,18,13)(7,17,15)(9,10,14,16,20,21), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z + 1),
--              ((z + 1, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z + 1, 1, z, z + 1, z + 1, z); (1,18,6,19,2,9,17,10,13,14,21,11,4,5,12)(3,20,7,16,8), Ring endomorphism of Finite Field in z of size 2^2
--                Defn: z |--> z),
-               ((z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z); (), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-              362880)
-             sage: C.automorphism_group_gens(equivalence="linear")
--            ([((z + 1, 1, z + 1, z + 1, z + 1, z, 1, z, 1, 1, 1, 1, z + 1, z + 1, z + 1, z, z, 1, z, z, z); (1,15,2,8,16,18,3)(4,9,12,13,20,10,11)(5,21,14,6,7,19,17), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((z, 1, z + 1, z + 1, 1, z + 1, z, 1, z + 1, z + 1, 1, z, 1, z + 1, z, 1, z, 1, z + 1, 1, 1); (1,12,11,10,6,8,9,20,13,21,5,14,3,16,17,19,7,4,2,15,18), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((z + 1, z + 1, z + 1, z + 1, z + 1, 1, z, 1, z, z, z, 1, z, 1, 1, 1, z + 1, z + 1, z + 1, 1, z); (1,15,21,8,9)(2,18,5,3,11,16,7,10,19,13,12,4,17,6,20), Ring endomorphism of Finite Field in z of size 2^2
-+              ((z + 1, z + 1, z + 1, z, 1, 1, z, z, 1, z + 1, z, 1, 1, z, 1, z + 1, z, z + 1, z + 1, 1, z); (1,3,18,2,17,6,19)(4,15,13,20,7,14,16)(5,11,8,21,12,9,10), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
-               ((z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1); (), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-              181440)
-             sage: C.automorphism_group_gens(equivalence="permutational")
--            ([((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,19)(3,17)(4,21)(5,20)(7,14)(9,12)(10,16)(11,15), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,11)(3,10)(4,9)(5,7)(12,21)(14,20)(15,19)(16,17), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,11)(3,10)(4,9)(5,7)(12,21)(14,20)(15,19)(16,17), Ring endomorphism of Finite Field in z of size 2^2
-+              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (2,18)(3,19)(4,10)(5,16)(8,13)(9,14)(11,21)(15,20), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,17)(2,8)(3,14)(4,10)(7,12)(9,19)(13,18)(15,20), Ring endomorphism of Finite Field in z of size 2^2
-+              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,19)(3,17)(4,21)(5,20)(7,14)(9,12)(10,16)(11,15), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
-               ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (2,13)(3,14)(4,20)(5,11)(8,18)(9,19)(10,15)(16,21), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-@@ -691,10 +691,10 @@ def _canonize(self, equivalence):
-             sage: C_iso == aut_group_can_label.get_canonical_form()
-             True
-             sage: aut_group_can_label.get_autom_gens()
--            [((1, 1, 1, 1, 1, z + 1, z, z + 1, z, z, z, 1, 1, z + 1, z + 1, z, z + 1, z, z + 1, z + 1, z + 1); (1,14,6,7,4,10,11,19)(2,8,16,13,3,17,21,15)(9,12,18,20), Ring endomorphism of Finite Field in z of size 2^2
-+            [((1, 1, 1, z, z + 1, 1, 1, 1, 1, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z); (1,13,14,20)(2,21,8,18,7,16,19,15)(3,10,5,12,17,9,6,4), Ring endomorphism of Finite Field in z of size 2^2
-+               Defn: z |--> z + 1),
-+             ((z, 1, z, z, z, z + 1, z, z, z, z, z, z, z + 1, z, z, z, z, z + 1, z, z, z); (1,11,5,12,3,19)(2,8)(6,18,13)(7,17,15)(9,10,14,16,20,21), Ring endomorphism of Finite Field in z of size 2^2
-                Defn: z |--> z + 1),
--             ((z + 1, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z + 1, 1, z, z + 1, z + 1, z); (1,18,6,19,2,9,17,10,13,14,21,11,4,5,12)(3,20,7,16,8), Ring endomorphism of Finite Field in z of size 2^2
--               Defn: z |--> z),
-              ((z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z); (), Ring endomorphism of Finite Field in z of size 2^2
-                Defn: z |--> z)]
-         """
-diff --git a/src/sage/combinat/posets/posets.py b/src/sage/combinat/posets/posets.py
-index 2836d59d960..8c882d5ac3b 100644
---- a/src/sage/combinat/posets/posets.py
-+++ b/src/sage/combinat/posets/posets.py
-@@ -8813,7 +8813,7 @@ def _libgap_(self):
-             sage: libgap(P)  # optional - gap_packages
-             <A poset on 5 points>
-             sage: A = libgap(GF(2)).PosetAlgebra(P); A  # optional - gap_packages
--            <GF(2)[<quiver with 5 vertices and 5 arrows>]/<two-sided ideal in <GF(2)[<quiver with 5 vertices and 5 arrows>]>, (1 generators)>>
-+            <GF(2)[<quiver with 5 vertices and 5 arrows>]/<two-sided ideal in <GF(2)[<quiver with 5 vertices and 5 arrows>]>, (1 generator)>>
-             sage: A.Dimension()  # optional - gap_packages
-             13
-         """
-diff --git a/src/sage/combinat/root_system/hecke_algebra_representation.py b/src/sage/combinat/root_system/hecke_algebra_representation.py
-index 6b756bafc30..8ac99319bec 100644
---- a/src/sage/combinat/root_system/hecke_algebra_representation.py
-+++ b/src/sage/combinat/root_system/hecke_algebra_representation.py
-@@ -357,7 +357,7 @@ def Tw(self, word, signs=None, scalar=None):
-             sage: q1, q2 = K.gens()
-             sage: KW = W.algebra(K)
-             sage: x = KW.an_element(); x
--            123 + 3*32 + 2*3 + e
-+            123 + 3*2312 + 2*31 + e
- 
-             sage: T = KW.demazure_lusztig_operators(q1,q2)
-             sage: T12 = T.Tw( (1,2) )
-diff --git a/src/sage/combinat/symmetric_group_algebra.py b/src/sage/combinat/symmetric_group_algebra.py
-index b8a0bebab44..9bccba124c8 100644
---- a/src/sage/combinat/symmetric_group_algebra.py
-+++ b/src/sage/combinat/symmetric_group_algebra.py
-@@ -101,7 +101,7 @@ def SymmetricGroupAlgebra(R, W, category=None):
-         sage: SGA.group()
-         Weyl Group of type ['A', 3] (as a matrix group acting on the ambient space)
-         sage: SGA.an_element()
--        s1*s2*s3 + 3*s3*s2 + 2*s3 + 1
-+        s1*s2*s3 + 3*s2*s3*s1*s2 + 2*s3*s1 + 1
- 
-     The preferred way to construct the symmetric group algebra is to
-     go through the usual ``algebra`` method::
-diff --git a/src/sage/env.py b/src/sage/env.py
-index 911f34b1bc6..5f7aca8599c 100644
---- a/src/sage/env.py
-+++ b/src/sage/env.py
-@@ -197,7 +197,8 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- GRAPHS_DATA_DIR = var("GRAPHS_DATA_DIR", join(SAGE_SHARE, "graphs"))
- ELLCURVE_DATA_DIR = var("ELLCURVE_DATA_DIR", join(SAGE_SHARE, "ellcurves"))
- POLYTOPE_DATA_DIR = var("POLYTOPE_DATA_DIR", join(SAGE_SHARE, "reflexive_polytopes"))
--GAP_ROOT_DIR = var("GAP_ROOT_DIR", join(SAGE_SHARE, "gap"))
-+GAP_LIB_DIR = var("GAP_LIB_DIR", join(SAGE_LOCAL, "lib", "gap"))
-+GAP_SHARE_DIR = var("GAP_SHARE_DIR", join(SAGE_SHARE, "gap"))
- THEBE_DIR = var("THEBE_DIR", join(SAGE_SHARE, "thebe"))
- COMBINATORIAL_DESIGN_DATA_DIR = var("COMBINATORIAL_DESIGN_DATA_DIR", join(SAGE_SHARE, "combinatorial_designs"))
- CREMONA_MINI_DATA_DIR = var("CREMONA_MINI_DATA_DIR", join(SAGE_SHARE, "cremona"))
-@@ -229,12 +230,6 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- LIE_INFO_DIR = var("LIE_INFO_DIR", join(SAGE_LOCAL, "lib", "LiE"))
- SINGULAR_BIN = var("SINGULAR_BIN") or "Singular"
- 
--# The path to libSingular, to be passed to dlopen(). This will
--# typically be set to an absolute path in sage_conf, but the relative
--# fallback path here works on systems where dlopen() searches the
--# system's library locations.
--LIBSINGULAR_PATH = var("LIBSINGULAR_PATH", "libSingular.so")
--
- # OpenMP
- OPENMP_CFLAGS = var("OPENMP_CFLAGS", "")
- OPENMP_CXXFLAGS = var("OPENMP_CXXFLAGS", "")
-@@ -255,81 +250,6 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- SAGE_GAP_COMMAND = var('SAGE_GAP_COMMAND', _gap_cmd)
- 
- 
--def _get_shared_lib_path(*libnames: str) -> Optional[str]:
--    """
--    Return the full path to a shared library file installed in
--    ``$SAGE_LOCAL/lib`` or the directories associated with the
--    Python sysconfig.
--
--    This can also be passed more than one library name (e.g. for cases where
--    some library may have multiple names depending on the platform) in which
--    case the first one found is returned.
--
--    This supports most *NIX variants (in which ``lib<libname>.so`` is found
--    under ``$SAGE_LOCAL/lib``), macOS (same, but with the ``.dylib``
--    extension), and Cygwin (under ``$SAGE_LOCAL/bin/cyg<libname>.dll``,
--    or ``$SAGE_LOCAL/bin/cyg<libname>-*.dll`` for versioned DLLs).
--
--    For distributions like Debian that use a multiarch layout, we also try the
--    multiarch lib paths (i.e. ``/usr/lib/<arch>/``).
--
--    This returns ``None`` if no matching library file could be found.
--
--    EXAMPLES::
--
--        sage: from sage.env import _get_shared_lib_path
--        sage: "gap" in _get_shared_lib_path("gap")
--        True
--        sage: _get_shared_lib_path("an_absurd_lib") is None
--        True
--
--    """
--
--    for libname in libnames:
--        search_directories: List[Path] = []
--        patterns: List[str] = []
--        if sys.platform == 'cygwin':
--            # Later down we take the first matching DLL found, so search
--            # SAGE_LOCAL first so that it takes precedence
--            if SAGE_LOCAL:
--                search_directories.append(Path(SAGE_LOCAL) / 'bin')
--            search_directories.append(Path(sysconfig.get_config_var('BINDIR')))
--            # Note: The following is not very robust, since if there are multible
--            # versions for the same library this just selects one more or less
--            # at arbitrary. However, practically speaking, on Cygwin, there
--            # will only ever be one version
--            patterns = [f'cyg{libname}.dll', f'cyg{libname}-*.dll']
--        else:
--            if sys.platform == 'darwin':
--                ext = 'dylib'
--            else:
--                ext = 'so'
--
--            if SAGE_LOCAL:
--                search_directories.append(Path(SAGE_LOCAL) / 'lib')
--            libdir = sysconfig.get_config_var('LIBDIR')
--            if libdir is not None:
--                libdir = Path(libdir)
--                search_directories.append(libdir)
--
--                multiarchlib = sysconfig.get_config_var('MULTIARCH')
--                if multiarchlib is not None:
--                    search_directories.append(libdir / multiarchlib),
--
--            patterns = [f'lib{libname}.{ext}']
--
--        for directory in search_directories:
--            for pattern in patterns:
--                path = next(directory.glob(pattern), None)
--                if path is not None:
--                    return str(path.resolve())
--
--    # Just return None if no files were found
--    return None
--
--# locate libgap shared object
--GAP_SO = var("GAP_SO", _get_shared_lib_path("gap", ""))
--
- # post process
- if DOT_SAGE is not None and ' ' in DOT_SAGE:
-     if UNAME[:6] == 'CYGWIN':
-diff --git a/src/sage/groups/abelian_gps/abelian_group_gap.py b/src/sage/groups/abelian_gps/abelian_group_gap.py
-index a4b047113c5..86090b43535 100644
---- a/src/sage/groups/abelian_gps/abelian_group_gap.py
-+++ b/src/sage/groups/abelian_gps/abelian_group_gap.py
-@@ -338,7 +338,7 @@ def _element_constructor_(self, x, check=True):
-         if isinstance(x, AbelianGroupElement_gap):
-             try:
-                 if x in self._cover:
--                    x = self.gap().NaturalHomomorphism().Image(x.gap())
-+                    x = self._cover.gap().NaturalHomomorphismByNormalSubgroup(self._relations).Image(x.gap())
-                 else:
-                     x = x.gap()
-             except AttributeError:
-@@ -1043,7 +1043,7 @@ def natural_homomorphism(self):
-             From: Abelian group with gap, generator orders (4,)
-             To:   Quotient abelian group with generator orders (2,)
-         """
--        phi = self.gap().NaturalHomomorphism()
-+        phi = self._cover.gap().NaturalHomomorphismByNormalSubgroup(self._relations)
-         Hom = self._cover.Hom(self)
-         return Hom(phi)
- 
-diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py
-index 8d6e443683c..1beb01af87f 100644
---- a/src/sage/groups/finitely_presented.py
-+++ b/src/sage/groups/finitely_presented.py
-@@ -596,9 +596,9 @@ def gap(self):
-             sage: k = G.rewriting_system()
-             sage: k.gap()
-             Knuth Bendix Rewriting System for Monoid( [ a, A, b, B ] ) with rules
--            [ [ a^2, <identity ...> ], [ a*A, <identity ...> ],
--              [ A*a, <identity ...> ], [ b^2, <identity ...> ],
--              [ b*B, <identity ...> ], [ B*b, <identity ...> ] ]
-+            [ [ a*A, <identity ...> ], [ A*a, <identity ...> ],
-+              [ b*B, <identity ...> ], [ B*b, <identity ...> ],
-+              [ a^2, <identity ...> ], [ b^2, <identity ...> ] ]
-         """
-         return self._gap
- 
-diff --git a/src/sage/groups/fqf_orthogonal.py b/src/sage/groups/fqf_orthogonal.py
-index 7fc4dbe7548..e5eccd45942 100644
---- a/src/sage/groups/fqf_orthogonal.py
-+++ b/src/sage/groups/fqf_orthogonal.py
-@@ -143,7 +143,7 @@ class FqfOrthogonalGroup(AbelianGroupAutomorphismGroup_subgroup):
-         [2/3   0   0]
-         [  0 2/3   0]
-         [  0   0 4/3]
--        generated by 2 elements
-+        generated by 3 elements
-         sage: q = matrix.diagonal(QQ, [3/2, 1/4, 1/4])
-         sage: T = TorsionQuadraticForm(q)
-         sage: T.orthogonal_group().order()
-diff --git a/src/sage/groups/libgap_wrapper.pyx b/src/sage/groups/libgap_wrapper.pyx
-index d25121aa792..dc81b71635b 100644
---- a/src/sage/groups/libgap_wrapper.pyx
-+++ b/src/sage/groups/libgap_wrapper.pyx
-@@ -25,7 +25,7 @@ Note how we call the constructor of both superclasses to initialize
- its output via LibGAP::
- 
-     sage: FooGroup()
--    <pc group of size 3 with 1 generators>
-+    <pc group of size 3 with 1 generator>
-     sage: type(FooGroup().gap())
-     <class 'sage.libs.gap.element.GapElement'>
- 
-@@ -106,7 +106,7 @@ class ParentLibGAP(SageObject):
-         ....:         ParentLibGAP.__init__(self, lg)
-         ....:         Group.__init__(self)
-         sage: FooGroup()
--        <pc group of size 3 with 1 generators>
-+        <pc group of size 3 with 1 generator>
-     """
- 
-     def __init__(self, libgap_parent, ambient=None):
-@@ -461,7 +461,7 @@ cdef class ElementLibGAP(MultiplicativeGroupElement):
-         ....:         ParentLibGAP.__init__(self, lg)
-         ....:         Group.__init__(self)
-         sage: FooGroup()
--        <pc group of size 3 with 1 generators>
-+        <pc group of size 3 with 1 generator>
-         sage: FooGroup().gens()
-         (f1,)
-     """
-diff --git a/src/sage/groups/matrix_gps/finitely_generated.py b/src/sage/groups/matrix_gps/finitely_generated.py
-index a6d3dc02513..63956ad5f10 100644
---- a/src/sage/groups/matrix_gps/finitely_generated.py
-+++ b/src/sage/groups/matrix_gps/finitely_generated.py
-@@ -563,9 +563,6 @@ def as_permutation_group(self, algorithm=None, seed=None):
-             21499084800
-             sage: P = G.as_permutation_group()
-             sage: Psmaller = G.as_permutation_group(algorithm="smaller", seed=6)
--            sage: P == Psmaller  # see the note below
--            True
--            sage: Psmaller = G.as_permutation_group(algorithm="smaller")
-             sage: P == Psmaller
-             False
-             sage: P.cardinality()
-diff --git a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-index f2ccca042ac..47d6862333c 100644
---- a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-+++ b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-@@ -427,7 +427,7 @@ cdef class LabelledBranching:
-             sage: from sage.groups.perm_gps.partn_ref2.refinement_generic import LabelledBranching
-             sage: L = LabelledBranching(3)
-             sage: L.small_generating_set()
--            []
-+            [()]
-             sage: L.add_gen(libgap.eval('(1,2,3)'))
-             sage: L.small_generating_set()
-             [(1,2,3)]
-diff --git a/src/sage/groups/perm_gps/permgroup.py b/src/sage/groups/perm_gps/permgroup.py
-index ebdf7c4c6eb..fb14008c8e0 100644
---- a/src/sage/groups/perm_gps/permgroup.py
-+++ b/src/sage/groups/perm_gps/permgroup.py
-@@ -926,7 +926,7 @@ def _coerce_map_from_(self, G):
-            sage: f = PG._coerce_map_from_(MG)
-            sage: mg = MG.an_element()
-            sage: p = f(mg); p
--           (2,33,32,23,31,55)(3,49,38,44,40,28)(4,17,59,62,58,46)(5,21,47,20,43,8)(6,53,50)(7,37,12,57,14,29)(9,41,56,34,64,10)(11,25,19)(13,61,26,51,22,15)(16,45,36)(18,27,35,48,52,54)(24,63,42)(30,39,60)
-+           (1,2,6,19,35,33)(3,9,26,14,31,23)(4,13,5)(7,22,17)(8,24,12)(10,16,32,27,20,28)(11,30,18)(15,25,36,34,29,21)
-            sage: PG(p._gap_()) == p
-            True
- 
-@@ -972,12 +972,12 @@ def _coerce_map_from_(self, G):
-             sage: P = G.as_permutation_group(algorithm='smaller', seed=5)
-             sage: P1 = G.as_permutation_group()
-             sage: P == P1
--            False
-+            True
-             sage: g1, g2, g3 = G.gens()
-             sage: P(g1*g2)
--            (1,3,7,12)(2,4,8,10)(5,11)(6,9)
-+            (1,4,13,11)(2,5,14,18)(3,15,8,16)(6,7)(9,20,19,12)(10,17)
-             sage: P1(g1*g2)
--            (2,29,25,68)(3,57,13,54)(4,11,72,37)(5,39,60,23)(6,64,75,63)(7,21,50,73)(8,46,38,32)(9,74,35,18)(10,44,49,48)(12,16,34,71)(14,79,27,40)(15,26)(17,62,59,76)(19,78,70,65)(20,22,58,51)(24,33,36,43)(28,81,80,52)(30,53,56,69)(31,61)(41,42,67,55)(45,77)(47,66)
-+            (1,4,13,11)(2,5,14,18)(3,15,8,16)(6,7)(9,20,19,12)(10,17)
- 
-         Another check for :trac:`5583`::
- 
-@@ -1302,7 +1302,7 @@ def gens_small(self):
-             sage: G.gens_small() # random
-             [('b','c'), ('a','c','b')] ## (on 64-bit Linux)
-             [('a','b'), ('a','c','b')] ## (on Solaris)
--            sage: len(G.gens_small()) == 2
-+            sage: len(G.gens_small()) == 2 # random
-             True
-         """
-         gens = self._libgap_().SmallGeneratingSet()
-@@ -4370,17 +4370,23 @@ def is_transitive(self, domain=None):
- 
-         ::
- 
--            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)]]) #S_5 on [1..5]
--            sage: G.is_transitive([1,4,5])
-+            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)],[(6,7)]])
-+            sage: G.is_transitive([1,2,3,4,5])
-             True
--            sage: G.is_transitive([2..6])
-+            sage: G.is_transitive([1..7])
-             False
-             sage: G.is_transitive(G.non_fixed_points())
--            True
-+            False
-             sage: H = PermutationGroup([[(1,2,3)],[(4,5,6)]])
-             sage: H.is_transitive(H.non_fixed_points())
-             False
- 
-+        If `G` does not act on the domain, it always returns ``False``::
-+
-+            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)]]) #S_5 on [1..5]
-+            sage: G.is_transitive([1,4,5])
-+            False
-+
-         Note that this differs from the definition in GAP, where
-         ``IsTransitive`` returns whether the group is transitive on the
-         set of points moved by the group.
-@@ -4436,12 +4442,16 @@ def is_primitive(self, domain=None):
-             sage: G = PermutationGroup([[(1,2,3,4)],[(2,4)]])
-             sage: G.is_primitive([1..4])
-             False
--            sage: G.is_primitive([1,2,3])
--            True
-             sage: G = PermutationGroup([[(3,4,5,6)],[(3,4)]]) #S_4 on [3..6]
-             sage: G.is_primitive(G.non_fixed_points())
-             True
- 
-+        If `G` does not act on the domain, it always returns ``False``::
-+
-+            sage: G = PermutationGroup([[(1,2,3,4)],[(2,4)]])
-+            sage: G.is_primitive([1,2,3])
-+            False
-+
-         """
-         #If the domain is not a subset of self.domain(), then the
-         #action isn't primitive.
-diff --git a/src/sage/interfaces/gap.py b/src/sage/interfaces/gap.py
-index 7ae1792e9de..ecaa9fd2341 100644
---- a/src/sage/interfaces/gap.py
-+++ b/src/sage/interfaces/gap.py
-@@ -1512,6 +1512,8 @@ def gap_reset_workspace(max_workspace_size=None, verbose=False):
-     """
-     # Create new workspace with filename WORKSPACE
-     g = Gap(use_workspace_cache=False, max_workspace_size=None)
-+    g.eval('ColorPrompt(false)')
-+    g.eval('SetUserPreference("UseColorPrompt", false)')
-     g.eval('SetUserPreference("HistoryMaxLines", 30)')
-     from sage.tests.gap_packages import all_installed_packages
-     for pkg in all_installed_packages(gap=g):
-diff --git a/src/sage/interfaces/gap_workspace.py b/src/sage/interfaces/gap_workspace.py
-index 33a87dd5076..03b40be6856 100644
---- a/src/sage/interfaces/gap_workspace.py
-+++ b/src/sage/interfaces/gap_workspace.py
-@@ -16,7 +16,8 @@
- import os
- import time
- import hashlib
--from sage.env import DOT_SAGE, GAP_SO
-+import subprocess
-+from sage.env import DOT_SAGE, HOSTNAME, GAP_LIB_DIR, GAP_SHARE_DIR
- 
- 
- def gap_workspace_file(system="gap", name="workspace", dir=None):
-@@ -59,11 +60,13 @@ def gap_workspace_file(system="gap", name="workspace", dir=None):
-     if dir is None:
-         dir = os.path.join(DOT_SAGE, 'gap')
- 
--    if GAP_SO:
--        h = hashlib.sha1(GAP_SO.encode('utf-8')).hexdigest()
--    else:
--        h = 'unknown'
--    return os.path.join(dir, '%s-%s-%s' % (system, name, h))
-+    data = f'{GAP_LIB_DIR}:{GAP_SHARE_DIR}'
-+    for path in GAP_LIB_DIR, GAP_SHARE_DIR:
-+        sysinfo = os.path.join(path, "sysinfo.gap")
-+        if os.path.exists(sysinfo):
-+            data += subprocess.getoutput(f'. "{sysinfo}" && echo ":$GAP_VERSION:$GAParch"')
-+    h = hashlib.sha1(data.encode('utf-8')).hexdigest()
-+    return os.path.join(dir, f'{system}-{name}-{HOSTNAME}-{h}')
- 
- 
- def prepare_workspace_dir(dir=None):
-diff --git a/src/sage/libs/gap/element.pyx b/src/sage/libs/gap/element.pyx
-index c555ea0333c..e3db3934baf 100644
---- a/src/sage/libs/gap/element.pyx
-+++ b/src/sage/libs/gap/element.pyx
-@@ -130,6 +130,7 @@ cdef char *capture_stdout(Obj func, Obj obj):
-     """
-     cdef Obj s, stream, output_text_string
-     cdef UInt res
-+    cdef TypOutputFile output
-     # The only way to get a string representation of an object that is truly
-     # consistent with how it would be represented at the GAP REPL is to call
-     # ViewObj on it.  Unfortunately, ViewObj *prints* to the output stream,
-@@ -145,12 +146,12 @@ cdef char *capture_stdout(Obj func, Obj obj):
-         output_text_string = GAP_ValueGlobalVariable("OutputTextString")
-         stream = CALL_2ARGS(output_text_string, s, GAP_True)
- 
--        if not OpenOutputStream(stream):
-+        if not OpenOutputStream(&output, stream):
-             raise GAPError("failed to open output capture stream for "
-                            "representing GAP object")
- 
-         CALL_1ARGS(func, obj)
--        CloseOutput()
-+        CloseOutput(&output)
-         return CSTR_STRING(s)
-     finally:
-         GAP_Leave()
-diff --git a/src/sage/libs/gap/gap_includes.pxd b/src/sage/libs/gap/gap_includes.pxd
-index 6d22e32540b..6111d18a5c7 100644
---- a/src/sage/libs/gap/gap_includes.pxd
-+++ b/src/sage/libs/gap/gap_includes.pxd
-@@ -76,8 +76,10 @@ cdef extern from "gap/intobj.h" nogil:
- 
- 
- cdef extern from "gap/io.h" nogil:
--    UInt OpenOutputStream(Obj stream)
--    UInt CloseOutput()
-+    ctypedef struct TypOutputFile:
-+        pass
-+    UInt OpenOutputStream(TypOutputFile* output, Obj stream)
-+    UInt CloseOutput(TypOutputFile* output)
- 
- 
- cdef extern from "gap/libgap-api.h" nogil:
-diff --git a/src/sage/libs/gap/libgap.pyx b/src/sage/libs/gap/libgap.pyx
-index b1a64e57939..6a36613aa8c 100644
---- a/src/sage/libs/gap/libgap.pyx
-+++ b/src/sage/libs/gap/libgap.pyx
-@@ -695,7 +695,7 @@ class Gap(Parent):
-             sage: libgap.List
-             <Gap function "List">
-             sage: libgap.GlobalRandomSource
--            <RandomSource in IsGlobalRandomSource>
-+            <RandomSource in IsGAPRandomSource>
-         """
-         if name in dir(self.__class__):
-             return getattr(self.__class__, name)
-diff --git a/src/sage/libs/gap/saved_workspace.py b/src/sage/libs/gap/saved_workspace.py
-index ad5adec36d0..7636707f557 100644
---- a/src/sage/libs/gap/saved_workspace.py
-+++ b/src/sage/libs/gap/saved_workspace.py
-@@ -8,7 +8,7 @@
- 
- import os
- import glob
--from sage.env import GAP_ROOT_DIR
-+from sage.env import GAP_LIB_DIR
- from sage.interfaces.gap_workspace import gap_workspace_file
- 
- 
-@@ -31,7 +31,7 @@ def timestamp():
-     """
-     libgap_dir = os.path.dirname(__file__)
-     libgap_files = glob.glob(os.path.join(libgap_dir, '*'))
--    gap_packages = glob.glob(os.path.join(GAP_ROOT_DIR, 'pkg', '*'))
-+    gap_packages = glob.glob(os.path.join(GAP_LIB_DIR, 'pkg', '*'))
-     files = libgap_files + gap_packages
-     if len(files) == 0:
-         print('Unable to find LibGAP files.')
-diff --git a/src/sage/libs/gap/util.pyx b/src/sage/libs/gap/util.pyx
-index 344ab88c42a..eaa659d64c7 100644
---- a/src/sage/libs/gap/util.pyx
-+++ b/src/sage/libs/gap/util.pyx
-@@ -13,7 +13,7 @@ Utility functions for GAP
- #*****************************************************************************
- 
- from libc.signal cimport signal, SIGCHLD, SIG_DFL
--from posix.dlfcn cimport dlopen, dlclose, RTLD_NOW, RTLD_GLOBAL
-+from posix.dlfcn cimport dlopen, dlclose, dlerror, RTLD_LAZY, RTLD_GLOBAL
- 
- from cpython.exc cimport PyErr_Fetch, PyErr_Restore
- from cpython.object cimport Py_LT, Py_LE, Py_EQ, Py_NE, Py_GT, Py_GE
-@@ -164,33 +164,6 @@ cdef void gasman_callback() with gil:
- ### Initialization of GAP ##################################################
- ############################################################################
- 
--def gap_root():
--    """
--    Find the location of the GAP root install which is stored in the gap
--    startup script.
--
--    EXAMPLES::
--
--        sage: from sage.libs.gap.util import gap_root
--        sage: gap_root()   # random output
--        '/home/vbraun/opt/sage-5.3.rc0/local/gap/latest'
--    """
--    if os.path.exists(sage.env.GAP_ROOT_DIR):
--        return sage.env.GAP_ROOT_DIR
--
--    # Attempt to figure out the appropriate GAP_ROOT by reading the
--    # local/bin/gap shell script; this is an ugly hack that exists for
--    # historical reasons; the best approach to setting where Sage looks for
--    # the appropriate GAP_ROOT is to set the GAP_ROOT_DIR variable
--    SAGE_LOCAL = sage.env.SAGE_LOCAL
--    with open(os.path.join(SAGE_LOCAL, 'bin', 'gap')) as f:
--        gap_sh = f.read().splitlines()
--    gapdir = next(x for x in gap_sh if x.strip().startswith('GAP_ROOT'))
--    gapdir = gapdir.split('"')[1]
--    gapdir = gapdir.replace('$SAGE_LOCAL', SAGE_LOCAL)
--    return gapdir
--
--
- # To ensure that we call initialize_libgap only once.
- cdef bint _gap_is_initialized = False
- 
-@@ -232,12 +205,12 @@ cdef initialize():
-     # this isn't portable
- 
-     cdef void* handle
--    libgapname = str_to_bytes(sage.env.GAP_SO)
--    handle = dlopen(libgapname, RTLD_NOW | RTLD_GLOBAL)
-+    # reload the current module to force reload of libgap (see #33446)
-+    lib = str_to_bytes(__loader__.path, FS_ENCODING, "surrogateescape")
-+    handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY)
-     if handle is NULL:
--        raise RuntimeError(
--                "Could not dlopen() libgap even though it should already "
--                "be loaded!")
-+        err = dlerror()
-+        raise RuntimeError(f"Could not reload gap library with RTLD_GLOBAL ({err})")
-     dlclose(handle)
- 
-     # Define argv variable, which we will pass in to
-@@ -245,7 +218,7 @@ cdef initialize():
-     cdef char* argv[16]
-     argv[0] = "sage"
-     argv[1] = "-l"
--    s = str_to_bytes(gap_root(), FS_ENCODING, "surrogateescape")
-+    s = str_to_bytes(sage.env.GAP_LIB_DIR + ";" + sage.env.GAP_SHARE_DIR, FS_ENCODING, "surrogateescape")
-     argv[2] = s
- 
-     argv[3] = "-m"
-@@ -362,15 +335,9 @@ cdef Obj gap_eval(str gap_string) except? NULL:
-         GAPError: Error, Variable: 'Complex' must have a value
-         Syntax error: ; expected in stream:1
-         Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^
-+                ^^^^^
-         Error, Variable: 'with' must have a value
--        Syntax error: ; expected in stream:1
--        Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^^^^^^^^^
-         Error, Variable: 'bits' must have a value
--        Syntax error: ; expected in stream:1
--        Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-         Error, Variable: 'precision' must have a value
- 
-     Test that on a subsequent attempt we get the same message (no garbage was
-diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx
-index d8ea7b07f3c..4beb1774df9 100644
---- a/src/sage/libs/singular/singular.pyx
-+++ b/src/sage/libs/singular/singular.pyx
-@@ -1705,14 +1705,7 @@ cdef object si2sa_intvec(intvec *v):
- cdef extern from *: # hack to get at cython macro
-     int unlikely(int)
- 
--cdef extern from "dlfcn.h":
--    void *dlopen(char *, long)
--    char *dlerror()
--    void dlclose(void *handle)
--
--cdef extern from "dlfcn.h":
--    cdef long RTLD_LAZY
--    cdef long RTLD_GLOBAL
-+from posix.dlfcn cimport dlopen, dlclose, dlerror, RTLD_LAZY, RTLD_GLOBAL
- 
- cdef int overflow_check(unsigned long e, ring *_ring) except -1:
-     """
-@@ -1762,8 +1755,6 @@ cdef init_libsingular():
- 
-     cdef void *handle = NULL
- 
--    from sage.env import LIBSINGULAR_PATH
--    lib = str_to_bytes(LIBSINGULAR_PATH, FS_ENCODING, "surrogateescape")
- 
-     # This is a workaround for https://github.com/Singular/Singular/issues/1113
-     # and can be removed once that fix makes it into release of Singular that
-@@ -1780,10 +1771,12 @@ cdef init_libsingular():
- 
-     import platform
-     if not platform.system().startswith("CYGWIN"):
-+        # reload the current module to force reload of libSingular (see #33446)
-+        lib = str_to_bytes(__loader__.path, FS_ENCODING, "surrogateescape")
-         handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY)
-         if not handle:
-             err = dlerror()
--            raise ImportError(f"cannot load Singular library from {LIBSINGULAR_PATH} ({err})")
-+            raise RuntimeError(f"Could not reload Singular library with RTLD_GLOBAL ({err})")
- 
-     # load SINGULAR
-     siInit(lib)
-diff --git a/src/sage/tests/gap_packages.py b/src/sage/tests/gap_packages.py
-index 2e4518ca226..c302b169b8a 100644
---- a/src/sage/tests/gap_packages.py
-+++ b/src/sage/tests/gap_packages.py
-@@ -103,7 +103,7 @@ def all_installed_packages(ignore_dot_gap=False, gap=None):
- 
-         sage: from sage.tests.gap_packages import all_installed_packages
-         sage: all_installed_packages()
--        (...'GAPDoc'...)
-+        (...'gapdoc'...)
-         sage: all_installed_packages(ignore_dot_gap=True) == all_installed_packages(gap=gap, ignore_dot_gap=True)
-         True
-     """
diff --git a/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch b/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
deleted file mode 100644
index d331a6573e1c..000000000000
--- a/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/src/sage/data_structures/stream.py b/src/sage/data_structures/stream.py
-index f8f6dc6a186..002e925f02f 100644
---- a/src/sage/data_structures/stream.py
-+++ b/src/sage/data_structures/stream.py
-@@ -2090,8 +2090,8 @@ def compute_product(self, n, la):
-             sage: f = Stream_exact([1]) # irrelevant for this test
-             sage: g = Stream_function(lambda n: s[n], True, 0)
-             sage: h = Stream_plethysm(f, g, True, p)
--            sage: B = p[2, 2, 1](sum(s[i] for i in range(7)))
--            sage: all(h.compute_product(k, Partition([2, 2, 1])) == B.restrict_degree(k) for k in range(7))
-+            sage: B = p[2, 2, 1](sum(p(s[i]) for i in range(7)))  # long time
-+            sage: all(h.compute_product(k, Partition([2, 2, 1])) == B.restrict_degree(k) for k in range(7))  # long time
-             True
-         """
-         # This is the approximate order of the result
diff --git a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch b/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
deleted file mode 100644
index 007f3324cfe4..000000000000
--- a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index b77c69b2f77..0586a96ae55 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -563,7 +563,7 @@ def complex_to_cmap_rgb(z_values, cmap='turbo', contoured=False, tiled=False,
-     import matplotlib as mpl
- 
-     if isinstance(cmap, str):
--        cmap = mpl.cm.get_cmap(cmap)
-+        cmap = mpl.colormaps[cmap]
- 
-     if contour_base is None:
-         if contour_type == "linear":
-@@ -1206,11 +1206,11 @@ def complex_plot(f, x_range, y_range, contoured=False, tiled=False, cmap=None,
-                 domain = np.linspace(0, 1, 256)
-                 shifted_domain = np.roll(domain, 128)
-                 default_cmap = mpl.colors.LinearSegmentedColormap.from_list(
--                    "sage_default", mpl.cm.get_cmap('hsv')(shifted_domain)
-+                    "sage_default", mpl.colormaps['hsv'](shifted_domain)
-                 )
-                 cmap = default_cmap
-             else:
--                cmap = mpl.cm.get_cmap(cmap)
-+                cmap = mpl.colormaps[cmap]
-         rgbs = complex_to_cmap_rgb(
-             z_values, cmap=cmap, contoured=contoured, tiled=tiled,
-             contour_type=contour_type, contour_base=contour_base,
-diff --git a/src/sage/plot/contour_plot.py b/src/sage/plot/contour_plot.py
-index c0cab456686..4accb309580 100644
---- a/src/sage/plot/contour_plot.py
-+++ b/src/sage/plot/contour_plot.py
-@@ -848,9 +848,7 @@ def f(x,y): return cos(x) + sin(y)
- 
-         sage: contour_plot(lambda x,y: 0, (-1,1), (-1,1),
-         ....:              contours=[0], fill=False, cmap=['blue'])
--        ...
--        UserWarning: No contour levels were found within the data range.
--        Graphics object consisting of 1 graphics primitive
-+        ...Graphics object consisting of 1 graphics primitive
- 
-     .. PLOT::
- 
-@@ -874,8 +872,7 @@ def f(x,y): return cos(x) + sin(y)
-     Check that :trac:`18074` is fixed::
- 
-         sage: contour_plot(0, (0,1), (0,1))
--        ... UserWarning: No contour levels were found within the data range.
--        Graphics object consisting of 1 graphics primitive
-+        ...Graphics object consisting of 1 graphics primitive
- 
-     Domain points in :trac:`11648` with complex output are now skipped::
- 
-diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
-index 64ea1a7e10f..cdc99ced263 100644
---- a/src/sage/plot/graphics.py
-+++ b/src/sage/plot/graphics.py
-@@ -2341,7 +2341,7 @@ def _matplotlib_tick_formatter(self, subplot, base=(10, 10),
-             sage: subplot = Figure().add_subplot(111)
-             sage: p._objects[0]._render_on_subplot(subplot)
-             sage: p._matplotlib_tick_formatter(subplot, **d)
--            (<AxesSubplot:...>,
-+            (<Axes...>,
-             <matplotlib.ticker.MaxNLocator object at ...>,
-             <matplotlib.ticker.MaxNLocator object at ...>,
-             <matplotlib.ticker.ScalarFormatter object at ...>,
-diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
-index 99c817f03a6..ae85183dc93 100644
---- a/src/sage/plot/multigraphics.py
-+++ b/src/sage/plot/multigraphics.py
-@@ -1207,7 +1207,7 @@ def _add_subplot(self, figure, index, **options):
-             sage: fig = Figure()
-             sage: ax1 = G._add_subplot(fig, 0)
-             sage: type(ax1)
--            <class 'matplotlib.axes._subplots.AxesSubplot'>
-+            <class 'matplotlib.axes...'>
-             sage: ax2 = G._add_subplot(fig, 1)
-             sage: fig.get_axes() == [ax1, ax2]
-             True
-diff --git a/src/sage/plot/plot3d/plot_field3d.py b/src/sage/plot/plot3d/plot_field3d.py
-index bdf39391d3e..fe10e27f58f 100644
---- a/src/sage/plot/plot3d/plot_field3d.py
-+++ b/src/sage/plot/plot3d/plot_field3d.py
-@@ -126,9 +126,9 @@ def plot_vector_field3d(functions, xrange, yrange, zrange,
-     vectors = [vector((ff(*point), gg(*point), hh(*point))) for point in points]
- 
-     try:
--        from matplotlib.cm import get_cmap
--        cm = get_cmap(colors)
--    except (TypeError, ValueError):
-+        import matplotlib as mpl
-+        cm = mpl.colormaps[colors]
-+    except (TypeError, KeyError):
-         cm = None
-     if cm is None:
-         if isinstance(colors, (list, tuple)):
diff --git a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch b/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
deleted file mode 100644
index 1e0a708e8068..000000000000
--- a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py
-index c9ca5e30939..9459cb70334 100644
---- a/src/sage/interfaces/maxima_lib.py
-+++ b/src/sage/interfaces/maxima_lib.py
-@@ -77,6 +77,26 @@
-     sage: bar == foo
-     True
- 
-+TESTS:
-+
-+Check our workaround for a race in ecl works, see :trac:`26968`.
-+We use a temporary `MAXIMA_USERDIR` so it's empty; we place it
-+in `DOT_SAGE` since we expect it to have more latency than `/tmp`.
-+
-+    sage: import tempfile, subprocess
-+    sage: tmpdir = tempfile.TemporaryDirectory(dir=DOT_SAGE)
-+    sage: _ = subprocess.run(['sage', '-c',  # long time
-+    ....: f'''
-+    ....: import os
-+    ....: os.environ["MAXIMA_USERDIR"] = "{tmpdir.name}"
-+    ....: if not os.fork():
-+    ....:     import sage.interfaces.maxima_lib
-+    ....: else:
-+    ....:     import sage.interfaces.maxima_lib
-+    ....:     os.wait()
-+    ....: '''])
-+    sage: tmpdir.cleanup()
-+
- """
- 
- # ****************************************************************************
-@@ -116,7 +136,23 @@
- ecl_eval("(setq $nolabels t))")
- ecl_eval("(defvar *MAXIMA-LANG-SUBDIR* NIL)")
- ecl_eval("(set-locale-subdir)")
--ecl_eval("(set-pathnames)")
-+
-+try:
-+    ecl_eval("(set-pathnames)")
-+except RuntimeError:
-+    # Recover from :trac:`26968` by creating `*maxima-objdir*` here.
-+    # This cannot be done before calling `(set-pathnames)` since
-+    # `*maxima-objdir*` is computed there.
-+    # We use python `os.makedirs()` which is immune to the race.
-+    # Using `(ensure-directories-exist ...)` in lisp would be
-+    # subject to the same race condition and since `*maxima-objdir*`
-+    # has multiple components this is quite plausible to happen.
-+    maxima_objdir = ecl_eval("*maxima-objdir*").python()[1:-1]
-+    import os
-+    os.makedirs(maxima_objdir, exist_ok=True)
-+    # Call `(set-pathnames)` again to complete its job.
-+    ecl_eval("(set-pathnames)")
-+
- ecl_eval("(defun add-lineinfo (x) x)")
- ecl_eval('(defun principal nil (cond ($noprincipal (diverg)) ((not pcprntd) (merror "Divergent Integral"))))')
- ecl_eval("(remprop 'mfactorial 'grind)")  # don't use ! for factorials (#11539)
diff --git a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch b/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
deleted file mode 100644
index fc3e40da2a88..000000000000
--- a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff --git a/src/bin/sage-cleaner b/src/bin/sage-cleaner
-index e2e578eec60..dc7d8f0482e 100755
---- a/src/bin/sage-cleaner
-+++ b/src/bin/sage-cleaner
-@@ -99,6 +99,15 @@ def cleanup():
- 
-     return len(pid_list)
- 
-+def cleanup_cruft():
-+    """ remove directories leftover from improper shutdown """
-+    tmp_dirs = os.listdir(SAGE_TMP_ROOT)
-+    for dir_entry in tmp_dirs:
-+        baddir = os.path.join(SAGE_TMP_ROOT, dir_entry)
-+        if os.path.isdir(baddir):
-+            logger.warning('Removing old directory %s from SAGE_TMP_ROOT', baddir)
-+            rm_rf(baddir)
-+
- def kill_spawned_jobs(jobfile, parent_pid):
-     logger.info("Killing %s's spawned jobs", parent_pid)
-     killed_them_all = True
-@@ -193,6 +202,7 @@ if __name__ == '__main__':
-     setup_daemon()
-     fix_old_mistakes()
-     logger.info("Starting sage-cleaner with PID %s", os.getpid())
-+    cleanup_cruft()
- 
-     if len(sys.argv) > 1:
-         wait = int(sys.argv[1])
diff --git a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch b/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
deleted file mode 100644
index ea210e20ae52..000000000000
--- a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py
-index ec6a5c19e60..9dd7bc1cb1e 100644
---- a/src/sage/graphs/generators/families.py
-+++ b/src/sage/graphs/generators/families.py
-@@ -3660,7 +3660,7 @@ def nauty_gentreeg(options="", debug=False):
- 
-         sage: gen = graphs.nauty_gentreeg("4", debug=True)
-         sage: print(next(gen))
--        >A ...gentreeg Z=2:3 D=3 n=4
-+        >A ...gentreeg ...
-         sage: gen = graphs.nauty_gentreeg("4 -q", debug=True)
-         sage: next(gen)
-         ''
-@@ -3687,7 +3687,7 @@ def nauty_gentreeg(options="", debug=False):
-         sage: list(graphs.nauty_gentreeg("3 -x", debug=True))
-         ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n [res/mod] ...
-         sage: list(graphs.nauty_gentreeg("3", debug=True))
--        ['>A ...gentreeg Z=2:2 D=2 n=3\n', Graph on 3 vertices]
-+        ['>A ...gentreeg ...\n', Graph on 3 vertices]
-     """
-     import shlex
-     from sage.features.nauty import NautyExecutable
-diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py
-index df88bbe2713..1a8016976c2 100644
---- a/src/sage/graphs/graph_generators.py
-+++ b/src/sage/graphs/graph_generators.py
-@@ -966,7 +966,7 @@ def nauty_geng(self, options="", debug=False):
-             ...
-             ValueError: wrong format of parameter option
-             sage: list(graphs.nauty_geng("-c3", debug=True))
--            ['>E Usage: ...geng [-cCmtfbd#D#] [-uygsnh] [-lvq] ...
-+            ['>E Usage: ...geng ...\n']
-             sage: list(graphs.nauty_geng("-c 3", debug=True))
-             ['>A ...geng -cd1D2 n=3 e=2-3\n', Graph on 3 vertices, Graph on 3 vertices]
-         """
diff --git a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch b/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
deleted file mode 100644
index 46bda084e48e..000000000000
--- a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-diff --git a/src/sage/repl/inputhook.py b/src/sage/repl/inputhook.py
-index da5df0268c0..7f7894f6dcf 100644
---- a/src/sage/repl/inputhook.py
-+++ b/src/sage/repl/inputhook.py
-@@ -17,6 +17,8 @@
- 
- import select
- import errno
-+import contextlib
-+import io
- 
- from IPython import get_ipython
- from IPython.terminal.pt_inputhooks import register
-@@ -47,15 +49,27 @@ def install():
-     """
-     Install the Sage input hook
- 
--    EXAMPLES::
-+    EXAMPLES:
-+
-+    Make sure ipython is running so we really test this function::
-+
-+        sage: from sage.repl.interpreter import get_test_shell
-+        sage: get_test_shell()
-+        <sage.repl.interpreter.SageTestShell object at ...>
-+
-+    Run the function twice, to check it is idempotent (see :trac:`35235`)::
- 
-         sage: from sage.repl.inputhook import install
-         sage: install()
-+        sage: install()
-     """
-     ip = get_ipython()
-     if not ip:
-         return   # Not running in ipython, e.g. doctests
--    ip.enable_gui('sage')
-+    if ip._inputhook != sage_inputhook:
-+        # silence `ip.enable_gui()` useless output
-+        with contextlib.redirect_stdout(io.StringIO()):
-+            ip.enable_gui('sage')
- 
- 
- def uninstall():
-@@ -71,4 +85,6 @@ def uninstall():
-     if not ip:
-         return
-     if ip._inputhook == sage_inputhook:
--        ip.enable_gui(None)
-+        # silence `ip.enable_gui()` useless output
-+        with contextlib.redirect_stdout(io.StringIO()):
-+            ip.enable_gui(None)
diff --git a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch b/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
deleted file mode 100644
index 2cdc674d4f9e..000000000000
--- a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 532fbbaf71bb41c73920b584108eb2a09d6deeb1 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
-Date: Tue, 4 Apr 2023 12:56:57 -0300
-Subject: [PATCH] Ignore deprecation warnings triggered by pythran 0.12.1
-
-These happen with python 3.11, setuptools 67.6.1, numpy 1.24.2.
-When pythran 0.12.1 is installed, I get 24 doctest failures due to
-deprecation warnings; they are all gone with this commit.
-
-[backported from 839a6e928c264a9863bd42860c78ae95a6d9f3e0]
----
- src/sage/all.py | 12 ++++++++++--
- 1 file changed, 10 insertions(+), 2 deletions(-)
-
-diff --git a/src/sage/all.py b/src/sage/all.py
-index 93588df1b93..ee775aad0e9 100644
---- a/src/sage/all.py
-+++ b/src/sage/all.py
-@@ -96,9 +96,17 @@ warnings.filterwarnings('ignore', category=DeprecationWarning,
- warnings.filterwarnings('ignore', category=DeprecationWarning,
-     module='(.*[.]_vendor[.])?packaging')
- 
--# Ignore numpy warnings triggered by pythran
-+# Ignore a few warnings triggered by pythran 0.12.1
- warnings.filterwarnings('ignore', category=DeprecationWarning,
--                        module='pythran')
-+    message='\n\n  `numpy.distutils` is deprecated since NumPy 1.23.0',
-+    module='pythran.dist')
-+warnings.filterwarnings('ignore', category=DeprecationWarning,
-+    message='pkg_resources is deprecated as an API|'
-+            'Deprecated call to `pkg_resources.declare_namespace(.*)`',
-+    module='pkg_resources')
-+warnings.filterwarnings('ignore', category=DeprecationWarning,
-+    message='msvccompiler is deprecated and slated to be removed',
-+    module='distutils.msvccompiler')
- 
- warnings.filterwarnings('ignore', category=DeprecationWarning,
-                         message='The distutils(.sysconfig module| package) is deprecated',
--- 
-2.40.0
-
diff --git a/srcpkgs/sagemath/patches/35584-networkx_3.1.patch b/srcpkgs/sagemath/patches/35584-networkx_3.1.patch
index 66eedecff7c6..9331258986d3 100644
--- a/srcpkgs/sagemath/patches/35584-networkx_3.1.patch
+++ b/srcpkgs/sagemath/patches/35584-networkx_3.1.patch
@@ -1,8 +1,8 @@
 diff --git a/src/sage/graphs/graph.py b/src/sage/graphs/graph.py
-index c2e42bcbd3..b6a10efbf4 100644
+index c2e42bcbd38..0d13f071dc4 100644
 --- a/src/sage/graphs/graph.py
 +++ b/src/sage/graphs/graph.py
-@@ -6786,13 +6786,21 @@ def cliques_number_of(self, vertices=None, cliques=None):
+@@ -6786,13 +6786,26 @@ def cliques_number_of(self, vertices=None, cliques=None):
              {(0, 0): 2, (0, 1): 3, (0, 2): 2, (1, 0): 2, (1, 1): 3, (1, 2): 2}
              sage: F.cliques_number_of(vertices=[(0, 1), (1, 2)])
              {(0, 1): 3, (1, 2): 2}
@@ -18,15 +18,20 @@ index c2e42bcbd3..b6a10efbf4 100644
 +        if cliques is None:
 +            cliques = self.cliques_maximal()
 +
-+        if vertices in self: # single vertex
++        if vertices in self:  # single vertex
 +            return sum(1 for c in cliques if vertices in c)
-+        else:
-+            return { v : sum(1 for c in cliques if v in c)
-+                     for v in vertices or self }
++
++        from collections import Counter
++        count = Counter()
++
++        for c in cliques:
++            count.update(c)
++
++        return {v : count[v] for v in vertices or self}
  
      @doc_index("Clique-related methods")
      def cliques_get_max_clique_graph(self):
-@@ -7493,17 +7501,32 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
+@@ -7493,17 +7506,32 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
  
              sage: C = Graph('DJ{')
              sage: C.cliques_containing_vertex()
@@ -62,7 +67,7 @@ index c2e42bcbd3..b6a10efbf4 100644
  
          Since each clique of a 2 dimensional grid corresponds to an edge, the
          number of cliques in which a vertex is involved equals its degree::
-@@ -7518,8 +7541,14 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
+@@ -7518,8 +7546,20 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
              sage: sorted(sorted(x for x in L) for L in d[(0, 1)])
              [[(0, 0), (0, 1)], [(0, 1), (0, 2)], [(0, 1), (1, 1)]]
          """
@@ -71,11 +76,17 @@ index c2e42bcbd3..b6a10efbf4 100644
 +        if cliques is None:
 +            cliques = self.cliques_maximal()
 +
-+        if vertices in self: # single vertex
++        if vertices in self:  # single vertex
 +            return [c for c in cliques if vertices in c]
-+        else:
-+            return { v : [c for c in cliques if v in c]
-+                     for v in vertices or self }
++
++        from collections import defaultdict
++        d = defaultdict(list)
++
++        for c in cliques:
++            for v in c:
++                d[v].append(c)
++
++        return {v : d[v] for v in vertices or self}
  
      @doc_index("Clique-related methods")
      def clique_complex(self):
diff --git a/srcpkgs/sagemath/patches/35612-linbox_1.7.0.patch b/srcpkgs/sagemath/patches/35612-linbox_1.7.0.patch
new file mode 100644
index 000000000000..58dddf34a69d
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35612-linbox_1.7.0.patch
@@ -0,0 +1,64 @@
+diff --git a/src/sage/libs/linbox/conversion.pxd b/src/sage/libs/linbox/conversion.pxd
+index 7794c9edc39..1753277b1f1 100644
+--- a/src/sage/libs/linbox/conversion.pxd
++++ b/src/sage/libs/linbox/conversion.pxd
+@@ -177,9 +177,8 @@ cdef inline Vector_integer_dense new_sage_vector_integer_dense(P, DenseVector_in
+     - v -- linbox vector
+     """
+     cdef Vector_integer_dense res = P()
+-    cdef cppvector[Integer] * vec = &v.refRep()
+     cdef size_t i
+     for i in range(<size_t> res._degree):
+-        mpz_set(res._entries[i], vec[0][i].get_mpz_const())
++        mpz_set(res._entries[i], v.getEntry(i).get_mpz_const())
+ 
+     return res
+diff --git a/src/sage/libs/linbox/linbox.pxd b/src/sage/libs/linbox/linbox.pxd
+index 9112d151f8b..bfeda4b6042 100644
+--- a/src/sage/libs/linbox/linbox.pxd
++++ b/src/sage/libs/linbox/linbox.pxd
+@@ -32,7 +32,6 @@ cdef extern from "linbox/matrix/dense-matrix.h":
+         ctypedef Modular_double Field
+         ctypedef double Element
+         DenseMatrix_Modular_double(Field F, size_t m, size_t n)
+-        DenseMatrix_Modular_double(Field F, Element*, size_t m, size_t n)
+         void setEntry(size_t i, size_t j, Element& a)
+         Element &getEntry(size_t i, size_t j)
+ 
+@@ -42,7 +41,6 @@ cdef extern from "linbox/matrix/dense-matrix.h":
+         ctypedef Modular_float Field
+         ctypedef float Element
+         DenseMatrix_Modular_float(Field F, size_t m, size_t n)
+-        DenseMatrix_Modular_float(Field F, Element*, size_t m, size_t n)
+         void setEntry(size_t i, size_t j, Element& a)
+         Element &getEntry(size_t i, size_t j)
+ 
+@@ -101,7 +99,6 @@ cdef extern from "linbox/vector/vector.h":
+         DenseVector_integer (Field &F)
+         DenseVector_integer (Field &F, long& m)
+         DenseVector_integer (Field &F, cppvector[Integer]&)
+-        cppvector[Element]& refRep()
+         size_t size()
+         void resize(size_t)
+         void resize(size_t n, const Element&)
+diff --git a/src/sage/matrix/matrix_modn_dense_template.pxi b/src/sage/matrix/matrix_modn_dense_template.pxi
+index abf29badce6..68b869ce314 100644
+--- a/src/sage/matrix/matrix_modn_dense_template.pxi
++++ b/src/sage/matrix/matrix_modn_dense_template.pxi
+@@ -221,9 +221,14 @@ cdef inline linbox_echelonize_efd(celement modulus, celement* entries, Py_ssize_
+         return 0,[]
+ 
+     cdef ModField *F = new ModField(<long>modulus)
+-    cdef DenseMatrix *A = new DenseMatrix(F[0], <ModField.Element*>entries,<Py_ssize_t>nrows, <Py_ssize_t>ncols)
+-    cdef Py_ssize_t r = reducedRowEchelonize(A[0])
++    cdef DenseMatrix *A = new DenseMatrix(F[0], nrows, ncols)
++
+     cdef Py_ssize_t i,j
++    for i in range(nrows):
++        for j in range(ncols):
++            A.setEntry(i, j, entries[i*ncols+j])
++
++    cdef Py_ssize_t r = reducedRowEchelonize(A[0])
+     for i in range(nrows):
+         for j in range(ncols):
+             entries[i*ncols+j] = <celement>A.getEntry(i,j)
diff --git a/srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch b/srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch
new file mode 100644
index 000000000000..9f00fb17271c
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch
@@ -0,0 +1,578 @@
+diff --git a/build/pkgs/ecl/dependencies b/build/pkgs/ecl/dependencies
+index cda6316bf5a..51a953403e9 100644
+--- a/build/pkgs/ecl/dependencies
++++ b/build/pkgs/ecl/dependencies
+@@ -1,4 +1,4 @@
+-$(MP_LIBRARY) readline gc libffi
++$(MP_LIBRARY) readline gc libffi info
+ 
+ ----------
+ All lines of this file are ignored except the first.
+diff --git a/build/pkgs/ecl/spkg-configure.m4 b/build/pkgs/ecl/spkg-configure.m4
+index ae1e0ac5e1a..7dbcfa6377b 100644
+--- a/build/pkgs/ecl/spkg-configure.m4
++++ b/build/pkgs/ecl/spkg-configure.m4
+@@ -35,10 +35,7 @@ SAGE_SPKG_CONFIGURE([ecl], [
+     AC_SUBST(SAGE_ECL_CONFIG, [$ECL_CONFIG])
+   fi
+ 
+-  # Maxima cannot yet be provided by the system, so we always use
++  # Kenzo cannot yet be provided by the system, so we always use
+   # the SAGE_LOCAL path for now.
+-  AC_SUBST(SAGE_MAXIMA_FAS, ['${prefix}'/lib/ecl/maxima.fas])
+-
+-  # Likewise for the optional Kenzo SPKG
+   AC_SUBST(SAGE_KENZO_FAS, ['${prefix}'/lib/ecl/kenzo.fas])
+ ])
+diff --git a/build/pkgs/ecl/spkg-install.in b/build/pkgs/ecl/spkg-install.in
+index ee1667aec16..72083337942 100644
+--- a/build/pkgs/ecl/spkg-install.in
++++ b/build/pkgs/ecl/spkg-install.in
+@@ -31,18 +31,6 @@ cp "$SAGE_ROOT"/config/config.* src
+ 
+ if [ x"$SAGE_SPKG_INSTALL_DOCS" != xyes ] ; then
+     ECL_CONFIGURE="$ECL_CONFIGURE --enable-manual=no"
+-else
+-    # ECL 2020 needs modern makeinfo
+-    command -v texi2any >/dev/null 2>&1
+-    if [ $? -ne 0 ]; then # texi2any not found -> makeinfo too old, if present
+-        ECL_CONFIGURE="$ECL_CONFIGURE --enable-manual=no"
+-    else
+-        if makeinfo -c foo 2>&1 | grep -q invalid; then
+-            # makeinfo found but does not support all options that ecl
+-            # likes to use
+-            ECL_CONFIGURE="$ECL_CONFIGURE --enable-manual=no"
+-        fi
+-    fi
+ fi
+ 
+ sdh_configure $SAGE_CONFIGURE_GMP \
+diff --git a/build/pkgs/giac/spkg-configure.m4 b/build/pkgs/giac/spkg-configure.m4
+index 5859e35f12e..b677184b7be 100644
+--- a/build/pkgs/giac/spkg-configure.m4
++++ b/build/pkgs/giac/spkg-configure.m4
+@@ -5,7 +5,7 @@ SAGE_SPKG_CONFIGURE([giac], [
+        m4_pushdef([GIAC_MAX_VERSION], [1.9.999])
+        AC_CACHE_CHECK([for giac >= ]GIAC_MIN_VERSION[, <= ]GIAC_MAX_VERSION, [ac_cv_path_GIAC], [
+          AC_PATH_PROGS_FEATURE_CHECK([GIAC], [giac], [
+-            giac_version=$($ac_path_GIAC --version 2> /dev/null | tail -1)
++            giac_version=$($ac_path_GIAC --version 2> /dev/null | tail -n -1)
+             AS_IF([test -n "$giac_version"], [
+                 AX_COMPARE_VERSION([$giac_version], [ge], GIAC_MIN_VERSION, [
+                     AX_COMPARE_VERSION([$giac_version], [le], GIAC_MAX_VERSION, [
+diff --git a/build/pkgs/info/spkg-configure.m4 b/build/pkgs/info/spkg-configure.m4
+index 0980a4b8ef8..85fe1ea4731 100644
+--- a/build/pkgs/info/spkg-configure.m4
++++ b/build/pkgs/info/spkg-configure.m4
+@@ -1,4 +1,14 @@
+ SAGE_SPKG_CONFIGURE([info], [
+   AC_PATH_PROG(INFO, info)
+-  AS_IF([test -z "${INFO}"], [sage_spkg_install_info=yes])
++  AS_IF([test -z "${INFO}"], [sage_spkg_install_info=yes
++    ], [
++     dnl very old makeinfo are not texi2any, newer are symlinks to texi2any
++     AC_PATH_PROG(TEXI2ANY, texi2any)
++     AS_IF([test -z "${TEXI2ANY}"], [sage_spkg_install_info=yes
++       ], [
++        AS_IF([makeinfo -c foo 2>&1 | grep -q invalid], [
++         dnl makeinfo found, but too old, and  does not support all options that ecl likes to use
++         sage_spkg_install_info=yes])
++       ])
++    ])
+ ])
+diff --git a/build/pkgs/info/spkg-install.in b/build/pkgs/info/spkg-install.in
+index 8086e4b2ec8..3ea8c053669 100644
+--- a/build/pkgs/info/spkg-install.in
++++ b/build/pkgs/info/spkg-install.in
+@@ -1,2 +1,2 @@
+-cd src/info
++cd src
+ sdh_make_install
+diff --git a/build/pkgs/info/type b/build/pkgs/info/type
+index 134d9bc32d5..a6a7b9cd726 100644
+--- a/build/pkgs/info/type
++++ b/build/pkgs/info/type
+@@ -1 +1 @@
+-optional
++standard
+diff --git a/build/pkgs/maxima/checksums.ini b/build/pkgs/maxima/checksums.ini
+index a804c7b831f..0f594389fe6 100644
+--- a/build/pkgs/maxima/checksums.ini
++++ b/build/pkgs/maxima/checksums.ini
+@@ -1,5 +1,5 @@
+ tarball=maxima-VERSION.tar.gz
+-sha1=ed15d5285794413ba94412079eca3d0fa55a47bf
+-md5=9b9ae1dace55b1386739dabaa9122e60
+-cksum=1765409766
++sha1=1010594e6d6082bbd8efaac1b7756ec1721a4ed5
++md5=3c01f1daa6936e11d8713fef7751d3fe
++cksum=2420393096
+ upstream_url=https://sourceforge.net/projects/maxima/files/Maxima-source/VERSION-source/maxima-VERSION.tar.gz/download
+diff --git a/build/pkgs/maxima/distros/arch.txt b/build/pkgs/maxima/distros/arch.txt
+index 6400290f44d..6ac052fa62b 100644
+--- a/build/pkgs/maxima/distros/arch.txt
++++ b/build/pkgs/maxima/distros/arch.txt
+@@ -1 +1 @@
+-maxima-ecl
++maxima-fas
+diff --git a/build/pkgs/maxima/distros/cygwin.txt b/build/pkgs/maxima/distros/cygwin.txt
+new file mode 100644
+index 00000000000..f5fe3fdc6cb
+--- /dev/null
++++ b/build/pkgs/maxima/distros/cygwin.txt
+@@ -0,0 +1 @@
++maxima
+diff --git a/build/pkgs/maxima/distros/freebsd.txt b/build/pkgs/maxima/distros/freebsd.txt
+new file mode 100644
+index 00000000000..766a71b5074
+--- /dev/null
++++ b/build/pkgs/maxima/distros/freebsd.txt
+@@ -0,0 +1 @@
++math/maxima
+diff --git a/build/pkgs/maxima/distros/gentoo.txt b/build/pkgs/maxima/distros/gentoo.txt
+new file mode 100644
+index 00000000000..85fb33f1610
+--- /dev/null
++++ b/build/pkgs/maxima/distros/gentoo.txt
+@@ -0,0 +1,2 @@
++sci-mathematics/maxima[ecls]
++
+diff --git a/build/pkgs/maxima/package-version.txt b/build/pkgs/maxima/package-version.txt
+index 83476624dc0..5681375f3be 100644
+--- a/build/pkgs/maxima/package-version.txt
++++ b/build/pkgs/maxima/package-version.txt
+@@ -1 +1 @@
+-5.45.0.p0
++5.46.0
+diff --git a/build/pkgs/maxima/patches/matrixexp.patch b/build/pkgs/maxima/patches/matrixexp.patch
+deleted file mode 100644
+index 5c8527c33bf..00000000000
+--- a/build/pkgs/maxima/patches/matrixexp.patch
++++ /dev/null
+@@ -1,15 +0,0 @@
+-diff --git a/share/linearalgebra/matrixexp.lisp b/share/linearalgebra/matrixexp.lisp
+-index 218bf35..f2fd468 100644
+---- a/share/linearalgebra/matrixexp.lisp
+-+++ b/share/linearalgebra/matrixexp.lisp
+-@@ -138,8 +138,8 @@
+- 	   (print `(ratvars = ,$ratvars gcd = '$gcd algebraic = ,$algebraic))
+- 	   (print `(ratfac = ,$ratfac))
+- 	   (merror "Unable to find the spectrum")))
+--   
+--    (setq res ($fullratsimp (ncpower (sub (mult z ($ident n)) mat) -1) z))
+-+
+-+    (setq res ($fullratsimp ($invert_by_lu (sub (mult z ($ident n)) mat) '$crering) z))
+-     (setq m (length sp))
+-     (dotimes (i m)
+-       (setq zi (nth i sp))
+diff --git a/build/pkgs/maxima/patches/maxima.system.patch b/build/pkgs/maxima/patches/maxima.system.patch
+deleted file mode 100644
+index 74db62e7f9f..00000000000
+--- a/build/pkgs/maxima/patches/maxima.system.patch
++++ /dev/null
+@@ -1,25 +0,0 @@
+-diff --git a/src/maxima.system b/src/maxima.system
+-index 76f2452..cf25f51 100644
+---- a/src/maxima.system
+-+++ b/src/maxima.system
+-@@ -1,5 +1,8 @@
+- ;;; -*- Lisp -*-
+- 
+-+(require :cmp)
+-+(setf c::*compile-in-constants* t)
+-+
+- (in-package :cl-user)
+- 
+- (pushnew :cl *features*)
+-@@ -75,6 +78,11 @@
+- 			     ;; Convert dir/foo.fas to dir/foo.o
+- 			     (make-pathname :type "o" :defaults p))
+- 			 files)))
+-+	(c::build-fasl "binary-ecl/maxima" :lisp-files obj
+-+			  :ld-flags
+-+			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
+-+							      (find-package "MAXIMA")))))
+-+			    (if (and x (not (string= x ""))) (list x))))
+- 	(c::build-program "binary-ecl/maxima" :lisp-files obj
+- 			  :ld-flags
+- 			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
+diff --git a/build/pkgs/maxima/spkg-configure.m4 b/build/pkgs/maxima/spkg-configure.m4
+new file mode 100644
+index 00000000000..dc54525320e
+--- /dev/null
++++ b/build/pkgs/maxima/spkg-configure.m4
+@@ -0,0 +1,46 @@
++SAGE_SPKG_CONFIGURE([maxima], [
++  m4_pushdef([SAGE_MAXIMA_MINVER],["5.45.0"])dnl this version and higher allowed
++  SAGE_SPKG_DEPCHECK([ecl], [
++    dnl First check for the "maxima" executable in the user's PATH, because
++    dnl we still use pexpect to communicate with it in a few places.
++    AC_CACHE_CHECK([for Maxima >= $SAGE_MAXIMA_MINVER], [ac_cv_path_MAXIMA], [
++        AC_PATH_PROGS_FEATURE_CHECK([MAXIMA], [maxima], [
++            maxima_version=`$ac_path_MAXIMA --version 2>&1 | tail -n -1\
++                | $SED -n -e 's/Maxima *\([[0-9]]*\.[[0-9]]*\.[[0-9]]*\)/\1/p'`
++            AS_IF([test -n "$maxima_version"], [
++                AX_COMPARE_VERSION([$maxima_version], [ge], [SAGE_MAXIMA_MINVER], [
++                    ac_cv_path_MAXIMA="$ac_path_MAXIMA"
++                    ac_path_MAXIMA_found=:
++                ])
++            ])
++        ])
++    ])
++    SAGE_MAXIMA="$ac_cv_path_MAXIMA"
++    AS_IF([test -z "${SAGE_MAXIMA}"], [
++      sage_spkg_install_maxima=yes
++    ],[
++      dnl If we have the executable, check also for the ECL library.
++      AC_MSG_CHECKING([if ECL can "require" the maxima module])
++      AS_IF([ecl --eval "(require 'maxima)" --eval "(quit)" \
++               >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD], [
++        AC_MSG_RESULT(yes)
++      ], [
++        AC_MSG_RESULT(no)
++        sage_spkg_install_maxima=yes
++      ])
++    ])
++  ])
++  m4_popdef([SAGE_MAXIMA_MINVER])
++],[],[],[
++  # post-check
++  AS_IF([test x$sage_spkg_install_maxima = xyes], [
++    dnl Leaving this variable empty will tell sagelib to load
++    dnl the maxima library (within ECL) by name instead of by
++    dnl absolute path.
++    SAGE_MAXIMA='${prefix}'/bin/maxima
++    SAGE_MAXIMA_FAS='${prefix}'/lib/ecl/maxima.fas
++  ])
++
++  AC_SUBST(SAGE_MAXIMA, "${SAGE_MAXIMA}")
++  AC_SUBST(SAGE_MAXIMA_FAS, "${SAGE_MAXIMA_FAS}")
++])
+diff --git a/build/pkgs/maxima/spkg-install.in b/build/pkgs/maxima/spkg-install.in
+index 3ae6382f9ba..cdb6fbf2069 100644
+--- a/build/pkgs/maxima/spkg-install.in
++++ b/build/pkgs/maxima/spkg-install.in
+@@ -28,28 +28,6 @@ echo
+ echo "Now configuring Maxima..."
+ sdh_configure --enable-ecl git_found=false
+ 
+-# Note the following is regression in maxima build system
+-# see https://sourceforge.net/p/maxima/bugs/3278/
+-# and https://sourceforge.net/p/maxima/bugs/2878/
+-# For the previous time it was fixed.
+-#---------------------------------------------------------------
+-# Touching html and info file to avoid to regenerate them.
+-# This must be done after configuration since the timestamp need
+-# to be later than include-maxima.texi which is generated at
+-# configuration time
+-for i in doc/info/*.html ; do
+-    touch "${i}"
+-done
+-touch doc/info/maxima.info*
+-# Maxima 5.44.0 build_html.sh is not compatible with makeinfo 4.8
+-# (which is /usr/bin/makeinfo on macOS).  #30063
+-# Do not build the HTML docs unless the user asks for it,
+-# in which case it is their problem to install a better
+-# makeinfo version.
+-if [[ "$SAGE_SPKG_INSTALL_DOCS" != yes ]] ; then
+-touch doc/info/maxima_toc.html interfaces/xmaxima/doc/xmaxima.html
+-fi
+-
+ #---------------------------------------------------------------
+ 
+ sdh_make
+diff --git a/build/pkgs/tox/spkg-configure.m4 b/build/pkgs/tox/spkg-configure.m4
+index 7d8ade4c14b..3de0b9b710d 100644
+--- a/build/pkgs/tox/spkg-configure.m4
++++ b/build/pkgs/tox/spkg-configure.m4
+@@ -5,7 +5,7 @@ SAGE_SPKG_CONFIGURE([tox], [
+        m4_pushdef([TOX4_MIN_VERSION], [4.0.15])
+        AC_CACHE_CHECK([for tox 3 >= ]TOX3_MIN_VERSION[ or tox 4 >= ]TOX4_MIN_VERSION, [ac_cv_path_TOX], [
+          AC_PATH_PROGS_FEATURE_CHECK([TOX], [tox], [
+-            tox_version=$($ac_path_TOX --version 2> /dev/null | tail -1)
++            tox_version=$($ac_path_TOX --version 2> /dev/null | tail -n -1)
+             AS_IF([test -n "$tox_version"], [
+                 AX_COMPARE_VERSION([$tox_version], [lt], [4], [
+                     AX_COMPARE_VERSION([$tox_version], [ge], TOX3_MIN_VERSION, [
+diff --git a/pkgs/sage-conf/_sage_conf/_conf.py.in b/pkgs/sage-conf/_sage_conf/_conf.py.in
+index d66bdb3d264..f2e197b45ed 100644
+--- a/pkgs/sage-conf/_sage_conf/_conf.py.in
++++ b/pkgs/sage-conf/_sage_conf/_conf.py.in
+@@ -9,9 +9,11 @@ VERSION = "@PACKAGE_VERSION@"
+ SAGE_LOCAL = "@prefix@"
+ SAGE_ROOT = "@SAGE_ROOT@"
+ 
+-MAXIMA = "@prefix@/bin/maxima"
++# The path to the standalone maxima executable.
++MAXIMA = "@SAGE_MAXIMA@".replace('${prefix}', SAGE_LOCAL)
+ 
+-# Delete this line if your ECL can load maxima without further prodding.
++# Set this to the empty string if your ECL can load maxima without
++# further prodding.
+ MAXIMA_FAS = "@SAGE_MAXIMA_FAS@".replace('${prefix}', SAGE_LOCAL)
+ 
+ # Delete this line if your ECL can load Kenzo without further prodding.
+diff --git a/src/bin/sage-env b/src/bin/sage-env
+index a7da60df28f..13b54fa7e92 100644
+--- a/src/bin/sage-env
++++ b/src/bin/sage-env
+@@ -440,9 +440,6 @@ if [ -d "$DOT_SAGE" ] ; then
+     fi
+ fi
+ 
+-if [ -n "$SAGE_LOCAL" ]; then
+-    export MAXIMA_PREFIX="$SAGE_LOCAL"
+-fi
+ export MAXIMA_USERDIR="$DOT_SAGE/maxima"
+ 
+ if [ -n "$SAGE_LOCAL" ]; then
+diff --git a/src/sage/calculus/calculus.py b/src/sage/calculus/calculus.py
+index dae380180ac..ccb8219062b 100644
+--- a/src/sage/calculus/calculus.py
++++ b/src/sage/calculus/calculus.py
+@@ -136,10 +136,11 @@
+     [          1/2*(e^(2*sqrt(x)) + 1)*e^(x - sqrt(x)) 1/2*(x*e^(2*sqrt(x)) - x)*sqrt(x)*e^(x - sqrt(x))]
+     [  1/2*(e^(2*sqrt(x)) - 1)*e^(x - sqrt(x))/x^(3/2)           1/2*(e^(2*sqrt(x)) + 1)*e^(x - sqrt(x))]
+ 
+-And complex exponentiation works now::
++Complex exponentiation works, but may require a patched version of
++maxima (:trac:`32898`) for now::
+ 
+     sage: M = i*matrix([[pi]])
+-    sage: e^M
++    sage: e^M  # not tested, requires patched maxima
+     [-1]
+     sage: M = i*matrix([[pi,0],[0,2*pi]])
+     sage: e^M
+@@ -1186,8 +1187,18 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
+         e
+         sage: f.limit(x=5)
+         7776/3125
+-        sage: f.limit(x=1.2)
++
++    Domain to real, a regression in 5.46.0, see https://sf.net/p/maxima/bugs/4138 ::
++
++        sage: maxima_calculus.eval("domain:real")
++        ...
++        sage: f.limit(x=1.2).n()
+         2.06961575467...
++        sage: maxima_calculus.eval("domain:complex");
++        ...
++
++    Otherwise, it works ::
++
+         sage: f.limit(x=I, taylor=True)
+         (-I + 1)^I
+         sage: f(x=1.2)
+@@ -1203,7 +1214,7 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
+ 
+         sage: var('a')
+         a
+-        sage: limit(x^a,x=0)
++        sage: limit(x^a,x=0)  # random - maxima 5.46.0 does not need extra assumption
+         Traceback (most recent call last):
+         ...
+         ValueError: Computation failed since Maxima requested additional
+@@ -1215,7 +1226,7 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
+     With this example, Maxima is looking for a LOT of information::
+ 
+         sage: assume(a>0)
+-        sage: limit(x^a,x=0)
++        sage: limit(x^a,x=0)  # random - maxima 5.46.0 does not need extra assumption
+         Traceback (most recent call last):
+         ...
+         ValueError: Computation failed since Maxima requested additional
+@@ -1224,7 +1235,7 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
+          more details)
+         Is a an integer?
+         sage: assume(a,'integer')
+-        sage: limit(x^a, x=0)
++        sage: limit(x^a, x=0)  # random - maxima 5.46.0 does not need extra assumption
+         Traceback (most recent call last):
+         ...
+         ValueError: Computation failed since Maxima requested additional
+@@ -2251,10 +2262,10 @@ def symbolic_expression_from_maxima_string(x, equals_sub=False, maxima=maxima):
+         True
+         sage: sefms("x # 3") == SR(x != 3)
+         True
+-        sage: solve([x != 5], x)
+-        [[x - 5 != 0]]
++        sage: solve([x != 5], x) in [[[x - 5 != 0]], [[x < 5], [5 < x]]]
++        True
+         sage: solve([2*x==3, x != 5], x)
+-        [[x == (3/2), (-7/2) != 0]]
++        [[x == (3/2)...
+ 
+     Make sure that we don't accidentally pick up variables in the maxima namespace (:trac:`8734`)::
+ 
+diff --git a/src/sage/functions/exp_integral.py b/src/sage/functions/exp_integral.py
+index e6c888c64b6..fb0e2235e2b 100644
+--- a/src/sage/functions/exp_integral.py
++++ b/src/sage/functions/exp_integral.py
+@@ -601,8 +601,8 @@ class Function_log_integral_offset(BuiltinFunction):
+         1/log(x)
+         sage: f.integrate(x)
+         -x*log_integral(2) + x*log_integral(x) - Ei(2*log(x))
+-        sage: Li(x).integrate(x,2.0,4.5)
+-        -2.5*log_integral(2) + 5.799321147411334
++        sage: Li(x).integrate(x,2.0,4.5).n()
++        3.18641169711760
+         sage: N(f.integrate(x,2.0,3.0))   # abs tol 1e-15
+         0.601621785860587
+ 
+diff --git a/src/sage/interfaces/expect.py b/src/sage/interfaces/expect.py
+index 68ae715e4c3..84adf0341b5 100644
+--- a/src/sage/interfaces/expect.py
++++ b/src/sage/interfaces/expect.py
+@@ -620,7 +620,7 @@ def quit(self, verbose=False):
+ 
+             sage: a = maxima('y')
+             sage: maxima.quit(verbose=True)
+-            Exiting Maxima with PID ... running .../bin/maxima...
++            Exiting Maxima with PID ... running ...maxima...
+             sage: a._check_valid()
+             Traceback (most recent call last):
+             ...
+diff --git a/src/sage/interfaces/maxima.py b/src/sage/interfaces/maxima.py
+index 27b1e98a6ac..4829560f98b 100644
+--- a/src/sage/interfaces/maxima.py
++++ b/src/sage/interfaces/maxima.py
+@@ -622,11 +622,6 @@ def _start(self):
+             sage: m.is_running()
+             True
+ 
+-        Test that we can use more than 256MB RAM (see :trac:`6772`)::
+-
+-            sage: a = maxima(10)^(10^5)
+-            sage: b = a^600              # long time -- about 10-15 seconds
+-
+         """
+         Expect._start(self)
+         self._sendline(r":lisp (defun tex-derivative (x l r) (tex (if $derivabbrev (tex-dabbrev x) (tex-d x '\\partial)) l r lop rop ))")
+@@ -634,9 +629,6 @@ def _start(self):
+         # Don't use ! for factorials (#11539)
+         self._sendline(":lisp (remprop 'mfactorial 'grind)")
+ 
+-        # Remove limit on the max heapsize (since otherwise it defaults
+-        # to 256MB with ECL).
+-        self._sendline(":lisp (ext:set-limit 'ext:heap-size 0)")
+         self._eval_line('0;')
+ 
+         # set random seed
+diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py
+index c263ac65f02..bba8504aa92 100644
+--- a/src/sage/interfaces/maxima_lib.py
++++ b/src/sage/interfaces/maxima_lib.py
+@@ -934,8 +934,15 @@ def sr_limit(self, expr, v, a, dir=None):
+             e
+             sage: limit(f,x = 5)
+             7776/3125
+-            sage: limit(f,x = 1.2)
++
++        Domain to real, a regression in 5.46.0, see https://sf.net/p/maxima/bugs/4138 ::
++
++            sage: maxima_calculus.eval("domain:real")
++            ...
++            sage: limit(f,x = 1.2).n()
+             2.06961575467...
++            sage: maxima_calculus.eval("domain:complex");
++            ...
+             sage: var('a')
+             a
+             sage: limit(x^a,x=0)
+@@ -947,7 +954,7 @@ def sr_limit(self, expr, v, a, dir=None):
+             for more details)
+             Is a positive, negative or zero?
+             sage: assume(a>0)
+-            sage: limit(x^a,x=0)
++            sage: limit(x^a,x=0)  # random - not needed for maxima 5.46.0
+             Traceback (most recent call last):
+             ...
+             ValueError: Computation failed ...
+diff --git a/src/sage/matrix/matrix2.pyx b/src/sage/matrix/matrix2.pyx
+index e2e6449dfa9..15914b0be3e 100644
+--- a/src/sage/matrix/matrix2.pyx
++++ b/src/sage/matrix/matrix2.pyx
+@@ -15425,9 +15425,10 @@ cdef class Matrix(Matrix1):
+ 
+         TESTS:
+ 
+-        Check that sparse matrices are handled correctly (:trac:`28935`)::
++        Sparse matrices are handled correctly (:trac:`28935`), but may
++        require a patched version of maxima (:trac:`32898`) for now::
+ 
+-            sage: matrix.diagonal([0], sparse=True).exp()
++            sage: matrix.diagonal([0], sparse=True).exp()  # not tested, requires patched maxima
+             [1]
+             sage: matrix.zero(CBF, 2, sparse=True).exp()
+             [1.000000000000000                 0]
+diff --git a/src/sage/matrix/matrix_symbolic_dense.pyx b/src/sage/matrix/matrix_symbolic_dense.pyx
+index 19ca5c85cb2..58a25e002f6 100644
+--- a/src/sage/matrix/matrix_symbolic_dense.pyx
++++ b/src/sage/matrix/matrix_symbolic_dense.pyx
+@@ -402,7 +402,8 @@ cdef class Matrix_symbolic_dense(Matrix_generic_dense):
+             [1/2*(e^(2*x) + 1)*e^(-x) 1/2*(e^(2*x) - 1)*e^(-x)]
+             [1/2*(e^(2*x) - 1)*e^(-x) 1/2*(e^(2*x) + 1)*e^(-x)]
+ 
+-        Exp works on 0x0 and 1x1 matrices::
++        Exponentiation works on 0x0 and 1x1 matrices, but the 1x1 example
++        requires a patched version of maxima (:trac:`32898`) for now::
+ 
+             sage: m = matrix(SR,0,[]); m
+             []
+@@ -410,7 +411,7 @@ cdef class Matrix_symbolic_dense(Matrix_generic_dense):
+             []
+             sage: m = matrix(SR,1,[2]); m
+             [2]
+-            sage: m.exp()
++            sage: m.exp()  # not tested, requires patched maxima
+             [e^2]
+ 
+         Commuting matrices `m, n` have the property that
+@@ -451,7 +452,6 @@ cdef class Matrix_symbolic_dense(Matrix_generic_dense):
+             [                       0 1/2*(e^(2*x) + 1)*e^(-x) 1/2*(e^(2*x) - 1)*e^(-x)                        0]
+             [                       0 1/2*(e^(2*x) - 1)*e^(-x) 1/2*(e^(2*x) + 1)*e^(-x)                        0]
+             [1/2*(e^(2*x) - 1)*e^(-x)                        0                        0 1/2*(e^(2*x) + 1)*e^(-x)]
+-
+         """
+         if not self.is_square():
+             raise ValueError("exp only defined on square matrices")
+diff --git a/src/sage/symbolic/integration/integral.py b/src/sage/symbolic/integration/integral.py
+index c82e9ed73c3..e84ad357ee2 100644
+--- a/src/sage/symbolic/integration/integral.py
++++ b/src/sage/symbolic/integration/integral.py
+@@ -741,14 +741,14 @@ def integrate(expression, v=None, a=None, b=None, algorithm=None, hold=False):
+ 
+         sage: _ = var('x,y')
+         sage: f = log(x^2+y^2)
+-        sage: res = integral(f,x,0.0001414, 1.); res
++        sage: res = integral(f,x,1414/10^7, 1); res
+         Traceback (most recent call last):
+         ...
+-        ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(50015104*y^2-50015103>0)', see `assume?` for more details)
+-        Is 50015104*y^2-50015103 positive, negative or zero?
++        ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help ...
++        Is ... positive, negative or zero?
+         sage: assume(y>1)
+-        sage: res = integral(f,x,0.0001414, 1.); res
+-        2*y*arctan(1.0/y) - 2*y*arctan(0.0001414/y) + 1.0*log(1.0*y^2 + 1.0) - 0.0001414*log(1.0*y^2 + 1.9993959999999997e-08) - 1.9997172
++        sage: res = integral(f,x,1414/10^7, 1); res
++        -2*y*arctan(707/5000000/y) + 2*y*arctan(1/y) + log(y^2 + 1) - 707/5000000*log(y^2 + 499849/25000000000000) - 4999293/2500000
+         sage: nres = numerical_integral(f.subs(y=2), 0.0001414, 1.); nres
+         (1.4638323264144..., 1.6251803529759...e-14)
+         sage: res.subs(y=2).n()
+diff --git a/src/sage/symbolic/relation.py b/src/sage/symbolic/relation.py
+index 94813315181..a72ab547c76 100644
+--- a/src/sage/symbolic/relation.py
++++ b/src/sage/symbolic/relation.py
+@@ -1787,8 +1787,8 @@ def solve_ineq_fourier(ineq, vars=None):
+         sage: y = var('y')
+         sage: solve_ineq_fourier([x+y<9,x-y>4],[x,y])
+         [[y + 4 < x, x < -y + 9, y < (5/2)]]
+-        sage: solve_ineq_fourier([x+y<9,x-y>4],[y,x])
+-        [[y < min(x - 4, -x + 9)]]
++        sage: solve_ineq_fourier([x+y<9,x-y>4],[y,x])[0][0](x=42)
++        y < -33
+ 
+         sage: solve_ineq_fourier([x^2>=0])
+         [[x < +Infinity]]
diff --git a/srcpkgs/sagemath/patches/35635-sympy_1.12.patch b/srcpkgs/sagemath/patches/35635-sympy_1.12.patch
new file mode 100644
index 000000000000..9cfc69c2adb6
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35635-sympy_1.12.patch
@@ -0,0 +1,54 @@
+diff --git a/src/sage/calculus/calculus.py b/src/sage/calculus/calculus.py
+index dae380180ac..ca3c59e63d2 100644
+--- a/src/sage/calculus/calculus.py
++++ b/src/sage/calculus/calculus.py
+@@ -1690,8 +1690,11 @@ def laplace(ex, t, s, algorithm='maxima'):
+ 
+     Testing SymPy::
+ 
+-        sage: laplace(t^n, t, s, algorithm='sympy')
+-        (gamma(n + 1)/(s*s^n), 0, re(n) > -1)
++        sage: F, a, cond = laplace(t^n, t, s, algorithm='sympy')
++        sage: a, cond
++        (0, re(n) > -1)
++        sage: F.simplify()
++        s^(-n - 1)*gamma(n + 1)
+ 
+     Testing Maxima::
+ 
+@@ -1700,17 +1703,19 @@ def laplace(ex, t, s, algorithm='maxima'):
+ 
+     Check that :trac:`24212` is fixed::
+ 
+-        sage: laplace(cos(t^2), t, s, algorithm='sympy')
+-        (-1/2*sqrt(pi)*(sqrt(2)*cos(1/4*s^2)*fresnel_sin(1/2*sqrt(2)*s/sqrt(pi)) -
+-        sqrt(2)*fresnel_cos(1/2*sqrt(2)*s/sqrt(pi))*sin(1/4*s^2) - cos(1/4*pi + 1/4*s^2)),
+-        0, True)
++        sage: F, a, cond = laplace(cos(t^2), t, s, algorithm='sympy')
++        sage: a, cond
++        (0, True)
++        sage: F._sympy_().simplify()
++        sqrt(pi)*(sqrt(2)*sin(s**2/4)*fresnelc(sqrt(2)*s/(2*sqrt(pi))) -
++        sqrt(2)*cos(s**2/4)*fresnels(sqrt(2)*s/(2*sqrt(pi))) + cos(s**2/4 + pi/4))/2
+ 
+     Testing result from SymPy that Sage doesn't know how to handle::
+ 
+         sage: laplace(cos(-1/t), t, s, algorithm='sympy')
+         Traceback (most recent call last):
+         ...
+-        AttributeError: Unable to convert SymPy result (=meijerg(((), ()), ((-1/2, 0, 1/2), (0,)), s**2/16)/4) into Sage
++        AttributeError: Unable to convert SymPy result (=meijerg(((), ()), ((-1/2, 0, 1/2), (0,)), ...)/4) into Sage
+     """
+     if not isinstance(ex, (Expression, Function)):
+         ex = SR(ex)
+@@ -1817,8 +1822,8 @@ def inverse_laplace(ex, s, t, algorithm='maxima'):
+ 
+     Transform an expression involving a time-shift, via SymPy::
+ 
+-        sage: inverse_laplace(1/s^2*exp(-s), s, t, algorithm='sympy')
+-        -(log(e^(-t)) + 1)*heaviside(t - 1)
++        sage: inverse_laplace(1/s^2*exp(-s), s, t, algorithm='sympy').simplify()
++        (t - 1)*heaviside(t - 1)
+ 
+     The same instance with Giac::
+ 
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 871ae38577fd..d510bb367c7a 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 URL_BASE_PR="https://github.com/sagemath/sage/pull/"
-URL_BASE_COMPARE="https://github.com/sagemath/sage/compare/9.8..."
+URL_BASE_COMPARE="https://github.com/sagemath/sage/compare/10.0.rc0..."
 
 case "$1" in
 	-n)  DO=echo ;;
@@ -15,49 +15,11 @@ get_pr() {
 	$DO wget "$URL_BASE_PR$pr.$ext" -O "$pr-$desc.patch"
 }
 
-get_trac() {
-	ticket=$1
-	desc=$(echo "$2" | sed -e 's/ /_/g')
-	commit=$3
-	$DO wget "$URL_BASE_COMPARE$commit.diff" -O "$ticket-$desc-$commit.patch"
-}
-
 # run from patches dir
 cd $(dirname "$0")
 
-# merged in 10.0.beta0
-get_trac 34851 "support singular 4.3.1.p3" 5e5737a0c
-get_pr 35068 "fix tests giac 1.9.0.35" patch
-
-# merged in 10.0.beta1
-get_pr 35058 "skip unstable tests klyachko"
-
-# merged in 10.0.beta2
-get_pr 34994 "fix tests numpy 1.24"
-get_pr 34997 "fix edge case of integer_check"
-
-# merged in 10.0.beta3
-get_pr 34995 "support tachyon 0.99.2"
-
-# merged in 10.0.beta4
-get_pr 34980 "avoid factoring in is_prime"
-
-# merged in 10.0.beta5
-get_pr 35094 "support gap 4.12"					# includes PR 35093
-
-# merged in 10.0.beta6
-get_pr 35127 "fix very slow test stream.py"
-get_pr 35177 "matplotlib 3.7"
-get_pr 35195 "workaround ecl race"
-get_pr 35204 "fix sage-cleaner"
-
-# merged in 10.0.beta7
-get_pr 35250 "nauty 2.8.6"
-
-# merged in 10.0.beta8
-#get_pr 35337 "ipython 8.11"
-get_pr 35423 "ipython 8.12"						# includes PR 35337
-get_pr 35438 "pythran 0.12.1"
-
 # needs review
 get_pr 35584 "networkx 3.1"
+get_pr 35612 "linbox 1.7.0"
+get_pr 35619 "maxima 5.46.0"
+get_pr 35635 "sympy 1.12"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 66a543efd21d..eb63ba98d5e8 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=9.8
-revision=2
+version=10.0.rc3
+revision=1
 build_wrksrc=pkgs/sagemath-standard
 build_style=python3-module
 _bindir=/usr/lib/sagemath/$version/bin
@@ -32,7 +32,7 @@ maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-or-later"
 homepage="http://sagemath.org/"
 distfiles="https://github.com/sagemath/sage/archive/refs/tags/$version.tar.gz"
-checksum=2aff28bd1d18c2d526581f5298acb8336f5b92db5675a7403dec8eaf9a86bc4c
+checksum=2fcc4fc6bd24027688bf8af373783b86e6139773ee53aee81156de8bc61656f0
 
 do_configure() {
 	# git tree needs bootstrapping

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] sagemath: update to 10.0.rc3.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (15 preceding siblings ...)
  2023-05-13  2:33 ` [PR PATCH] [Updated] [RFC] sagemath: update to 10.0.rc2 tornaria
@ 2023-05-13  3:14 ` tornaria
  2023-05-13 18:12 ` dkwo
                   ` (22 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: tornaria @ 2023-05-13  3:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1700 bytes --]

There is an updated pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages sagemath-next
https://github.com/void-linux/void-packages/pull/43659

[RFC] sagemath: update to 10.0.rc3.
<!-- Uncomment relevant sections and delete options which are not applicable -->

This builds on top of #43225 for convenience.

#### Testing the changes
- I tested the changes in this PR: **briefly**

I've been following beta releases and now rc0 includes all of our patches :muscle:

All doctests pass with the version of packages in void except for `python-Babel` which must be updated (as in #43497) and is included  here as part of #43225.

I've switched my system sagemath to this version as everything seems to be working ok. The testsuite is 10-15% faster.

@dkwo: enjoy.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/43659.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-sagemath-next-43659.patch --]
[-- Type: text/x-diff, Size: 184683 bytes --]

From 92265256ae4fd80bd44178bf784b398e7d8b5fed Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Dec 2021 20:20:09 -0300
Subject: [PATCH 1/6] givaro: update to 4.2.0.

---
 srcpkgs/givaro/patches/197.patch | 28 ++++++++++++++++++++++++++++
 srcpkgs/givaro/template          |  9 ++++-----
 2 files changed, 32 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/givaro/patches/197.patch

diff --git a/srcpkgs/givaro/patches/197.patch b/srcpkgs/givaro/patches/197.patch
new file mode 100644
index 000000000000..bafaff3efbd9
--- /dev/null
+++ b/srcpkgs/givaro/patches/197.patch
@@ -0,0 +1,28 @@
+From ab3d332508c21daff41fb64a8658cdc7cc74fc47 Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
+Date: Thu, 16 Dec 2021 17:12:25 +0100
+Subject: [PATCH] dom_power argument is now an uint64_t to avoid problem with
+ 32bit machine
+
+---
+ src/kernel/system/givpower.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/kernel/system/givpower.h b/src/kernel/system/givpower.h
+index eb784872..5644264d 100644
+--- a/src/kernel/system/givpower.h
++++ b/src/kernel/system/givpower.h
+@@ -71,11 +71,11 @@ namespace Givaro {
+ 
+     //! dom_power
+     template<class D, class TT>
+-    TT& dom_power(TT& res, const TT& n, long l, const D& F)
++    TT& dom_power(TT& res, const TT& n, uint64_t l, const D& F)
+     {
+         if (l == 0) return F.assign(res,F.one) ;
+ 
+-        unsigned long p = (unsigned long) l ;
++        uint64_t p = l;
+         bool is_assg = false ;
+ 
+         TT puiss; F.init(puiss); F.assign(puiss,n) ;
diff --git a/srcpkgs/givaro/template b/srcpkgs/givaro/template
index 9c16de5b1974..52457c02a1ed 100644
--- a/srcpkgs/givaro/template
+++ b/srcpkgs/givaro/template
@@ -1,6 +1,6 @@
 # Template file for 'givaro'
 pkgname=givaro
-version=4.1.1
+version=4.2.0
 revision=1
 build_style=gnu-configure
 makedepends="gmpxx-devel"
@@ -8,16 +8,15 @@ short_desc="C++ library for arithmetic and algebraic computations"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="CECILL-B"
 homepage="https://github.com/linbox-team/givaro"
+changelog="https://github.com/linbox-team/givaro/raw/master/ChangeLog"
 distfiles="https://github.com/linbox-team/givaro/releases/download/v${version}/givaro-${version}.tar.gz"
-checksum=628049899386e91da245aee6cd446350fbca87e94863bc0d815066c08150487f
+checksum=865e228812feca971dfb6e776a7bc7ac959cf63ebd52b4f05492730a46e1f189
 nocross=yes
 
 build_options="native_build"
 
 if [ -z "$build_option_native_build" ]; then
-	configure_args="--enable-sse --enable-sse2
-	  --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42
-	  --disable-avx --disable-avx2 --disable-fma --disable-fma4"
+	configure_args="--without-archnative"
 fi
 
 post_install() {

From 7b5864c912997f30fe44e745bad49647455cb302 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Dec 2021 20:20:17 -0300
Subject: [PATCH 2/6] fflas-ffpack: update to 2.5.0.

---
 srcpkgs/fflas-ffpack/patches/357.patch | 35 ++++++++++++++++++++++++++
 srcpkgs/fflas-ffpack/template          | 12 ++++-----
 2 files changed, 40 insertions(+), 7 deletions(-)
 create mode 100644 srcpkgs/fflas-ffpack/patches/357.patch

diff --git a/srcpkgs/fflas-ffpack/patches/357.patch b/srcpkgs/fflas-ffpack/patches/357.patch
new file mode 100644
index 000000000000..99fd34efd93b
--- /dev/null
+++ b/srcpkgs/fflas-ffpack/patches/357.patch
@@ -0,0 +1,35 @@
+From 9b6083c663096e9ca85775b79f1f27c848dbeb98 Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
+Date: Fri, 17 Dec 2021 10:27:02 +0100
+Subject: [PATCH] Fix SimdChooser: on not x86_64 machines its value could be an
+ nonexistant struct
+
+---
+ fflas-ffpack/fflas/fflas_simd.h | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/fflas-ffpack/fflas/fflas_simd.h b/fflas-ffpack/fflas/fflas_simd.h
+index bf5d30211..84ced0fd8 100644
+--- a/fflas-ffpack/fflas/fflas_simd.h
++++ b/fflas-ffpack/fflas/fflas_simd.h
+@@ -384,6 +384,20 @@ struct SimdChooser<T, true, true> // integral number
+ #endif
+ };
+ 
++#ifndef __x86_64__
++template <>
++struct SimdChooser<uint64_t, true, true>
++{
++    using value = NoSimd<uint64_t>;
++};
++
++template <>
++struct SimdChooser<int64_t, true, true>
++{
++    using value = NoSimd<int64_t>;
++};
++#endif
++
+ template <class T> using Simd = typename SimdChooser<T>::value;
+ 
+ // template <class T> struct SimdChooser<T, true> {
diff --git a/srcpkgs/fflas-ffpack/template b/srcpkgs/fflas-ffpack/template
index 557c644c00a4..2aa599703585 100644
--- a/srcpkgs/fflas-ffpack/template
+++ b/srcpkgs/fflas-ffpack/template
@@ -1,6 +1,6 @@
 # Template file for 'fflas-ffpack'
 pkgname=fflas-ffpack
-version=2.4.3
+version=2.5.0
 revision=1
 build_style=gnu-configure
 hostmakedepends="pkg-config"
@@ -10,15 +10,13 @@ short_desc="Finite Field Linear Algebra Subroutines / Package"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="LGPL-2.1-or-later"
 homepage="http://linbox-team.github.io/fflas-ffpack/"
-distfiles="https://github.com/linbox-team/fflas-ffpack/releases/download/${version}/fflas-ffpack-${version}.tar.gz"
-checksum=f372783a17a9899ee9f88d4c9421d80facccb95556146dad7020d07a03791cc9
+changelog="https://github.com/linbox-team/fflas-ffpack/raw/master/ChangeLog"
+distfiles="https://github.com/linbox-team/fflas-ffpack/releases/download/v${version}/fflas-ffpack-${version}.tar.gz"
+checksum=dafb4c0835824d28e4f823748579be6e4c8889c9570c6ce9cce1e186c3ebbb23
 nocross=yes
 
 build_options="native_build"
 
 if [ -z "$build_option_native_build" ]; then
-	configure_args="--enable-sse --enable-sse2
-	  --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42
-	  --disable-avx --disable-avx2 --disable-fma --disable-fma4
-	  --disable-avx512f --disable-avx512dq --disable-avx512vl"
+	configure_args="--without-archnative"
 fi

From 8b56b5976ce3ec19266cdb28b4497c09d6d6d268 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Dec 2021 20:20:20 -0300
Subject: [PATCH 3/6] linbox: update to 1.7.0.

---
 srcpkgs/linbox/patches/292.patch              | 24 ++++++++++++
 srcpkgs/linbox/patches/294.patch              | 38 +++++++++++++++++++
 ...8adade10641f1f04f04b589753d928fb5443.patch | 35 -----------------
 .../remove-linboxsage-libs-from-pc.patch      | 23 -----------
 srcpkgs/linbox/template                       | 11 +++---
 5 files changed, 67 insertions(+), 64 deletions(-)
 create mode 100644 srcpkgs/linbox/patches/292.patch
 create mode 100644 srcpkgs/linbox/patches/294.patch
 delete mode 100644 srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch
 delete mode 100644 srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch

diff --git a/srcpkgs/linbox/patches/292.patch b/srcpkgs/linbox/patches/292.patch
new file mode 100644
index 000000000000..d3333cc23d0b
--- /dev/null
+++ b/srcpkgs/linbox/patches/292.patch
@@ -0,0 +1,24 @@
+From 49b9cccd0286980c1c1811c3b03df883ef0164df Mon Sep 17 00:00:00 2001
+From: Doug Torrance <dtorrance@piedmont.edu>
+Date: Tue, 14 Dec 2021 16:22:33 -0500
+Subject: [PATCH] Only register uint128_t as a TypeName when it's available.
+
+Otherwise, test-fft will fail when it isn't.
+---
+ tests/test-fft.C | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/tests/test-fft.C b/tests/test-fft.C
+index d19184c2d..5811ebc5d 100644
+--- a/tests/test-fft.C
++++ b/tests/test-fft.C
+@@ -55,7 +55,9 @@ REGISTER_TYPE_NAME(double);
+ REGISTER_TYPE_NAME(uint16_t);
+ REGISTER_TYPE_NAME(uint32_t);
+ REGISTER_TYPE_NAME(uint64_t);
++#ifdef __FFLASFFPACK_HAVE_INT128
+ REGISTER_TYPE_NAME(uint128_t);
++#endif
+ REGISTER_TYPE_NAME(Modular);
+ REGISTER_TYPE_NAME(ModularExtended);
+ 
diff --git a/srcpkgs/linbox/patches/294.patch b/srcpkgs/linbox/patches/294.patch
new file mode 100644
index 000000000000..7c645f165d39
--- /dev/null
+++ b/srcpkgs/linbox/patches/294.patch
@@ -0,0 +1,38 @@
+From f81a1f4a5e0835b7a0f3bb88a0fcbbaa32174cfa Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
+Date: Wed, 15 Dec 2021 16:00:39 +0100
+Subject: [PATCH] Only register uint128_t as a TypeName when it's available
+
+---
+ benchmarks/benchmark-fft.C                       | 2 ++
+ benchmarks/benchmark-polynomial-matrix-mul-fft.C | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/benchmarks/benchmark-fft.C b/benchmarks/benchmark-fft.C
+index 39b86c9d9..59a8be57c 100644
+--- a/benchmarks/benchmark-fft.C
++++ b/benchmarks/benchmark-fft.C
+@@ -54,7 +54,9 @@ REGISTER_TYPE_NAME(double);
+ REGISTER_TYPE_NAME(uint16_t);
+ REGISTER_TYPE_NAME(uint32_t);
+ REGISTER_TYPE_NAME(uint64_t);
++#ifdef __FFLASFFPACK_HAVE_INT128
+ REGISTER_TYPE_NAME(uint128_t);
++#endif
+ REGISTER_TYPE_NAME(Modular);
+ REGISTER_TYPE_NAME(ModularExtended);
+ 
+diff --git a/benchmarks/benchmark-polynomial-matrix-mul-fft.C b/benchmarks/benchmark-polynomial-matrix-mul-fft.C
+index e9b184bcf..7bf17f33e 100644
+--- a/benchmarks/benchmark-polynomial-matrix-mul-fft.C
++++ b/benchmarks/benchmark-polynomial-matrix-mul-fft.C
+@@ -65,7 +65,9 @@ REGISTER_TYPE_NAME(double);
+ REGISTER_TYPE_NAME(uint16_t);
+ REGISTER_TYPE_NAME(uint32_t);
+ REGISTER_TYPE_NAME(uint64_t);
++#ifdef __FFLASFFPACK_HAVE_INT128
+ REGISTER_TYPE_NAME(uint128_t);
++#endif
+ REGISTER_TYPE_NAME(Modular);
+ REGISTER_TYPE_NAME(ModularExtended);
+ 
diff --git a/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch b/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch
deleted file mode 100644
index 5afa078ec7b8..000000000000
--- a/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 892f8adade10641f1f04f04b589753d928fb5443 Mon Sep 17 00:00:00 2001
-From: Doug Torrance <dtorrance@piedmont.edu>
-Date: Sun, 9 May 2021 12:14:19 -0400
-Subject: [PATCH] Use std::ptrdiff_t for vector iterator difference type
-
-It was previously long (64-bit integers), but this will not be the
-case on 32-bit systems.
-
-Closes: #273
----
- linbox/vector/bit-vector.inl | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/linbox/vector/bit-vector.inl b/linbox/vector/bit-vector.inl
-index 5fa84b421..23a22ba47 100644
---- a/linbox/vector/bit-vector.inl
-+++ b/linbox/vector/bit-vector.inl
-@@ -46,7 +46,7 @@ namespace std
- 		typedef LinBox::BitVector::reference reference;
- 		typedef bool *pointer;
- 		typedef bool value_type;
--		typedef long difference_type;
-+		typedef std::ptrdiff_t difference_type;
- 	};
- 
- 	template <>
-@@ -56,7 +56,7 @@ namespace std
- 		typedef LinBox::BitVector::const_reference reference;
- 		typedef const bool *pointer;
- 		typedef bool value_type;
--		typedef long difference_type;
-+		typedef std::ptrdiff_t difference_type;
- 	};
- }
- 
diff --git a/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch b/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch
deleted file mode 100644
index c93915fb1b06..000000000000
--- a/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Backported from:
-
-From 426eb97ba762c7663884f57ead0909f2aa3cd6a5 Mon Sep 17 00:00:00 2001
-From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
-Date: Thu, 17 Jan 2019 16:32:19 +0100
-Subject: [PATCH] Remove @LINBOXSAGE_LIBS@ from linbox.pc.in
-
----
- linbox.pc.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/linbox.pc.in b/linbox.pc.in
-index 278f127e4..c6b8091eb 100644
---- a/linbox.pc.in
-+++ b/linbox.pc.in
-@@ -9,6 +9,6 @@ Description: Exact Linear Algebra library
- URL: http://github.com/linbox-team/linbox
- Version: @VERSION@
- Requires: fflas-ffpack >= 2.4.0, givaro >= 4.1.0
--Libs: -L${libdir} -llinbox @LINBOXSAGE_LIBS@ @NTL_LIBS@ @MPFR_LIBS@ @FPLLL_LIBS@ @IML_LIBS@ @FLINT_LIBS@ @OCL_LIBS@
-+Libs: -L${libdir} -llinbox @NTL_LIBS@ @MPFR_LIBS@ @FPLLL_LIBS@ @IML_LIBS@ @FLINT_LIBS@ @OCL_LIBS@
- Cflags: @DEFAULT_CFLAGS@ -DDISABLE_COMMENTATOR -I${includedir} @NTL_CFLAGS@ @MPFR_CFLAGS@ @FPLLL_CFLAGS@  @IML_CFLAGS@ @FLINT_CFLAGS@ 
- \-------------------------------------------------------
diff --git a/srcpkgs/linbox/template b/srcpkgs/linbox/template
index 096a15b3390b..e6edacdd0a74 100644
--- a/srcpkgs/linbox/template
+++ b/srcpkgs/linbox/template
@@ -1,7 +1,7 @@
 # Template file for 'linbox'
 pkgname=linbox
-version=1.6.3
-revision=2
+version=1.7.0
+revision=1
 build_style=gnu-configure
 hostmakedepends="pkg-config"
 makedepends="fflas-ffpack"
@@ -9,16 +9,15 @@ short_desc="C++ library for exact, high-performance linear algebra"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="LGPL-2.1-or-later"
 homepage="https://linalg.org"
+changelog="https://github.com/linbox-team/linbox/raw/master/ChangeLog"
 distfiles="https://github.com/linbox-team/linbox/releases/download/v${version}/linbox-${version}.tar.gz"
-checksum=a58a188307b07c57964e844bceb99321d3043a8a4a1fccc082a54928bb9a0057
+checksum=6d2159fd395be0298362dd37f6c696676237bc8e2757341fbc46520e3b466bcc
 nocross=yes
 
 build_options="native_build"
 
 if [ -z "$build_option_native_build" ]; then
-	configure_args="--enable-sse --enable-sse2
-	  --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42
-	  --disable-avx --disable-avx2 --disable-fma --disable-fma4"
+	configure_args="--without-archnative"
 fi
 
 linbox-devel_package() {

From 252917a5155d1aeb85eb5b90eaab5fbf7815ecf1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Fri, 15 Apr 2022 14:25:08 -0300
Subject: [PATCH 4/6] maxima: update to 5.46.0.

Also:
 - disable sbcl on aarch64
 - don't makedepends on emacs (avoid a nocross build dep)
 - move maxima-emacs files to main pkg
 - adopt
---
 ...a43e5234305bd6f1de5909d4ce5d7e1ea864.patch | 24 -------------------
 srcpkgs/maxima/template                       | 24 +++++++------------
 2 files changed, 9 insertions(+), 39 deletions(-)
 delete mode 100644 srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch

diff --git a/srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch b/srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch
deleted file mode 100644
index e1ac1e5f6086..000000000000
--- a/srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-commit a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864
-Author: Robert Dodier <robert_dodier@users.sourceforge.net>
-Date:   Mon Oct 11 22:40:13 2021 -0700
-
-    Apply patch #80: "Build a FASL library, needed by SageMath"
-    
-    This modifies maxima.system for ECL only.
-
-diff --git a/src/maxima.system b/src/maxima.system
-index d954bc2b9..525fb778e 100644
---- a/src/maxima.system
-+++ b/src/maxima.system
-@@ -75,6 +75,11 @@
- 			     ;; Convert dir/foo.fas to dir/foo.o
- 			     (make-pathname :type "o" :defaults p))
- 			 files)))
-+	(c::build-fasl "binary-ecl/maxima" :lisp-files obj
-+			  :ld-flags
-+			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
-+							      (find-package "MAXIMA")))))
-+			    (if (and x (not (string= x ""))) (list x))))
- 	(c::build-program "binary-ecl/maxima" :lisp-files obj
- 			  :ld-flags
- 			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
diff --git a/srcpkgs/maxima/template b/srcpkgs/maxima/template
index 69e85ec833e8..c0002aa2b3ab 100644
--- a/srcpkgs/maxima/template
+++ b/srcpkgs/maxima/template
@@ -1,19 +1,21 @@
 # Template file for 'maxima'
 pkgname=maxima
-version=5.45.1
-revision=4
+version=5.46.0
+revision=1
 build_style=gnu-configure
 configure_args="$(vopt_enable clisp) $(vopt_enable sbcl sbcl-exec) $(vopt_enable ecl)"
-hostmakedepends="python3 perl emacs texinfo patchelf"
+hostmakedepends="python3 perl texinfo patchelf $(vopt_if ecl ecl)"
 makedepends="$(vopt_if clisp clisp) $(vopt_if sbcl sbcl) $(vopt_if ecl ecl)"
 depends="$(vopt_if clisp clisp) rlwrap"
 checkdepends="gnuplot"
 short_desc="Computer Algebra System"
-maintainer="Bosco Garcia <jboscogg@gmail.org>"
+maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-only"
 homepage="http://maxima.sourceforge.net"
+changelog="https://sourceforge.net/p/maxima/code/ci/master/tree/changelogs/ChangeLog-${version%.*}.md?format=raw"
 distfiles="${SOURCEFORGE_SITE}/maxima/maxima-${version}.tar.gz"
-checksum=fe9016276970bef214a1a244348558644514d7fdfaa4fc8b9d0e87afcbb4e7dc
+checksum=7390f06b48da65c9033e8b2f629b978b90056454a54022db7de70e2225aa8b07
+nocross=yes
 
 # maxima-sbcl is nopie and should NOT be stripped or it won't work
 nostrip_files=/usr/lib/maxima/$version/binary-sbcl/maxima
@@ -32,7 +34,7 @@ build_options_default="ecl"
 
 # sbcl is only available for these architectures
 case "$XBPS_TARGET_MACHINE" in
-	i686|x86_64*|armv7l|aarch64|ppc64le*)
+	i686|x86_64*|armv7l|ppc64le*)
 		build_options_default+=" sbcl"
 		;;
 esac
@@ -112,14 +114,6 @@ maxima-src_package() {
 	}
 }
 
-maxima-emacs_package() {
-	short_desc+=" - Emacs interface"
-	depends="${sourcepkg}-${version}_${revision} virtual?emacs"
-	pkg_install() {
-		vmove usr/share/emacs
-	}
-}
-
 xmaxima_package() {
 	short_desc+=" - Tk interface"
 	depends="${sourcepkg}-${version}_${revision} tk"
@@ -151,4 +145,4 @@ maxima-ecl_package() {
 	}
 }
 
-subpackages="maxima-src maxima-emacs xmaxima $(vopt_if ecl maxima-ecl)"
+subpackages="maxima-src xmaxima $(vopt_if ecl maxima-ecl)"

From 33f97203f0d7f0a88e169157c38d435be1e654fe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 10 May 2023 17:10:20 -0300
Subject: [PATCH 5/6] python3-sympy: update to 1.12.

---
 srcpkgs/python3-sympy/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/python3-sympy/template b/srcpkgs/python3-sympy/template
index eb24d5c8d4bb..cb8297158027 100644
--- a/srcpkgs/python3-sympy/template
+++ b/srcpkgs/python3-sympy/template
@@ -1,7 +1,7 @@
 # Template file for 'python3-sympy'
 pkgname=python3-sympy
-version=1.11.1
-revision=2
+version=1.12
+revision=1
 build_style=python3-module
 hostmakedepends="python3-setuptools"
 depends="python3-mpmath"
@@ -12,7 +12,7 @@ license="BSD-3-Clause"
 homepage="https://sympy.org/"
 changelog="https://github.com/sympy/sympy/wiki/Release-Notes"
 distfiles="${PYPI_SITE}/s/sympy/sympy-${version}.tar.gz"
-checksum=e32380dce63cb7c0108ed525570092fd45168bdae2faa17e528221ef72e88658
+checksum=ebf595c8dac3e0fdc4152c51878b498396ec7f30e7a914d6071e674d49420fb8
 
 post_install() {
 	vman doc/man/isympy.1

From 957bec8c2a15b7927813b8952f9c129057f7266b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Feb 2023 22:53:33 -0300
Subject: [PATCH 6/6] sagemath: update to 10.0.rc3.

Also:
 - support networkx 3.1 (sagemath#35584)
 - support linbox 1.7.0 (sagemath#35612)
 - support maxima 5.46.0 (sagemath#35619)
 - support sympy 1.12 (sagemath#35635)
---
 srcpkgs/sagemath/files/sage_conf.py           |    1 -
 srcpkgs/sagemath/files/timings2.json          |  405 ++---
 ...-support_singular_4.3.1.p3-5e5737a0c.patch |  205 ---
 .../34980-avoid_factoring_in_is_prime.patch   |   49 -
 .../patches/34994-fix_tests_numpy_1.24.patch  |   58 -
 .../34995-support_tachyon_0.99.2.patch        |   57 -
 ...34997-fix_edge_case_of_integer_check.patch |   36 -
 .../35058-skip_unstable_tests_klyachko.patch  |   22 -
 .../35068-fix_tests_giac_1.9.0.35.patch       |   62 -
 .../patches/35094-support_gap_4.12.patch      | 1303 -----------------
 .../35127-fix_very_slow_test_stream.py.patch  |   15 -
 .../patches/35177-matplotlib_3.7.patch        |   95 --
 .../patches/35195-workaround_ecl_race.patch   |   56 -
 .../patches/35204-fix_sage-cleaner.patch      |   28 -
 .../sagemath/patches/35250-nauty_2.8.6.patch  |   35 -
 .../sagemath/patches/35423-ipython_8.12.patch |   51 -
 .../patches/35438-pythran_0.12.1.patch        |   41 -
 .../sagemath/patches/35584-networkx_3.1.patch |   35 +-
 .../sagemath/patches/35612-linbox_1.7.0.patch |   64 +
 .../patches/35619-maxima_5.46.0.patch         |  578 ++++++++
 .../sagemath/patches/35635-sympy_1.12.patch   |   54 +
 srcpkgs/sagemath/patches/get_patches          |   46 +-
 srcpkgs/sagemath/template                     |    6 +-
 23 files changed, 833 insertions(+), 2469 deletions(-)
 delete mode 100644 srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
 delete mode 100644 srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
 delete mode 100644 srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
 delete mode 100644 srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
 delete mode 100644 srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
 delete mode 100644 srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
 delete mode 100644 srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
 delete mode 100644 srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
 delete mode 100644 srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
 delete mode 100644 srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
 delete mode 100644 srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
 delete mode 100644 srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
 delete mode 100644 srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
 delete mode 100644 srcpkgs/sagemath/patches/35423-ipython_8.12.patch
 delete mode 100644 srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
 create mode 100644 srcpkgs/sagemath/patches/35612-linbox_1.7.0.patch
 create mode 100644 srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch
 create mode 100644 srcpkgs/sagemath/patches/35635-sympy_1.12.patch

diff --git a/srcpkgs/sagemath/files/sage_conf.py b/srcpkgs/sagemath/files/sage_conf.py
index 00de40f1ee4f..bc5388de8956 100644
--- a/srcpkgs/sagemath/files/sage_conf.py
+++ b/srcpkgs/sagemath/files/sage_conf.py
@@ -1,4 +1,3 @@
 # configuration for sage on void linux
 SAGE_SHARE = "/usr/share/sagemath"
 GAP_SHARE_DIR = "/usr/share/gap"
-GAP_LIB_DIR = "/usr/lib/gap"
diff --git a/srcpkgs/sagemath/files/timings2.json b/srcpkgs/sagemath/files/timings2.json
index bb3098680502..b2b3fe818a20 100644
--- a/srcpkgs/sagemath/files/timings2.json
+++ b/srcpkgs/sagemath/files/timings2.json
@@ -1,281 +1,152 @@
 {
-  "doc.ca.intro.index": {"walltime": 8},
-  "doc.en.constructions.calculus": {"walltime": 64},
-  "doc.en.constructions.plotting": {"walltime": 32},
-  "doc.en.prep.Advanced-2DPlotting": {"walltime": 16},
-  "doc.en.prep.Calculus": {"walltime": 8},
-  "doc.en.prep.Symbolics-and-Basic-Plotting": {"walltime": 8},
-  "doc.en.thematic_tutorials.explicit_methods_in_number_theory.birds_other": {"walltime": 8},
-  "doc.en.thematic_tutorials.explicit_methods_in_number_theory.elliptic_curves": {"walltime": 8},
-  "doc.en.thematic_tutorials.geometry.polyhedra_tutorial": {"walltime": 16},
-  "doc.en.thematic_tutorials.sandpile": {"walltime": 16},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_advanced": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_cartesian": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_change": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_curvilinear": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_plane": {"walltime": 16},
-  "doc.ja.tutorial.tour_plotting": {"walltime": 8},
-  "sage.algebras.cluster_algebra": {"walltime": 8},
   "sage.algebras.commutative_dga": {"walltime": 16},
-  "sage.algebras.hecke_algebras.ariki_koike_algebra": {"walltime": 8},
-  "sage.algebras.iwahori_hecke_algebra": {"walltime": 8},
-  "sage.algebras.lie_algebras.classical_lie_algebra": {"walltime": 128},
-  "sage.algebras.lie_algebras.nilpotent_lie_algebra": {"walltime": 16},
-  "sage.algebras.quantum_clifford": {"walltime": 16},
-  "sage.algebras.quantum_groups.fock_space": {"walltime": 8},
-  "sage.algebras.quatalg.quaternion_algebra": {"walltime": 8},
-  "sage.algebras.steenrod.steenrod_algebra": {"walltime": 64},
-  "sage.algebras.steenrod.steenrod_algebra_bases": {"walltime": 8},
-  "sage.algebras.yangian": {"walltime": 8},
-  "sage.arith.misc": {"walltime": 32},
+  "sage.algebras.fusion_rings.f_matrix": {"walltime": 16},
+  "sage.algebras.fusion_rings.fusion_ring": {"walltime": 16},
+  "sage.algebras.hecke_algebras.cubic_hecke_algebra": {"walltime": 8},
+  "sage.algebras.lie_conformal_algebras.n2_lie_conformal_algebra": {"walltime": 8},
+  "sage.algebras.quantum_clifford": {"walltime": 8},
+  "sage.algebras.steenrod.steenrod_algebra": {"walltime": 8},
   "sage.calculus.calculus": {"walltime": 16},
   "sage.calculus.desolvers": {"walltime": 8},
-  "sage.calculus.functional": {"walltime": 8},
-  "sage.calculus.riemann": {"walltime": 64},
-  "sage.calculus.tests": {"walltime": 16},
-  "sage.calculus.transforms.dwt": {"walltime": 16},
+  "sage.calculus.riemann": {"walltime": 8},
   "sage.calculus.transforms.fft": {"walltime": 8},
   "sage.categories.coxeter_groups": {"walltime": 8},
-  "sage.categories.finite_monoids": {"walltime": 16},
-  "sage.categories.lie_conformal_algebras": {"walltime": 8},
+  "sage.categories.finite_monoids": {"walltime": 8},
   "sage.categories.loop_crystals": {"walltime": 8},
-  "sage.categories.pushout": {"walltime": 8},
-  "sage.categories.super_hopf_algebras_with_basis": {"walltime": 32},
-  "sage.categories.super_lie_conformal_algebras": {"walltime": 8},
-  "sage.coding.ag_code": {"walltime": 64},
-  "sage.coding.ag_code_decoders": {"walltime": 128},
-  "sage.coding.binary_code": {"walltime": 8},
-  "sage.coding.linear_code": {"walltime": 16},
-  "sage.combinat.backtrack": {"walltime": 32},
-  "sage.combinat.chas.wqsym": {"walltime": 32},
-  "sage.combinat.cluster_algebra_quiver.cluster_seed": {"walltime": 64},
-  "sage.combinat.cluster_algebra_quiver.quiver": {"walltime": 128},
-  "sage.combinat.crystals.affine_factorization": {"walltime": 16},
-  "sage.combinat.crystals.alcove_path": {"walltime": 32},
-  "sage.combinat.crystals.highest_weight_crystals": {"walltime": 8},
-  "sage.combinat.crystals.kirillov_reshetikhin": {"walltime": 16},
-  "sage.combinat.crystals.letters": {"walltime": 8},
-  "sage.combinat.crystals.littelmann_path": {"walltime": 16},
-  "sage.combinat.crystals.mv_polytopes": {"walltime": 16},
-  "sage.combinat.crystals.pbw_crystal": {"walltime": 16},
-  "sage.combinat.crystals.star_crystal": {"walltime": 8},
-  "sage.combinat.designs.bibd": {"walltime": 8},
-  "sage.combinat.designs.database": {"walltime": 16},
+  "sage.coding.ag_code": {"walltime": 32},
+  "sage.coding.ag_code_decoders": {"walltime": 32},
+  "sage.coding.linear_code": {"walltime": 32},
+  "sage.combinat.designs.database": {"walltime": 8},
   "sage.combinat.designs.difference_family": {"walltime": 8},
-  "sage.combinat.designs.gen_quadrangles_with_spread": {"walltime": 128},
-  "sage.combinat.designs.orthogonal_arrays_build_recursive": {"walltime": 16},
-  "sage.combinat.designs.orthogonal_arrays_find_recursive": {"walltime": 8},
-  "sage.combinat.diagram_algebras": {"walltime": 64},
-  "sage.combinat.fqsym": {"walltime": 32},
-  "sage.combinat.free_prelie_algebra": {"walltime": 8},
-  "sage.combinat.fully_commutative_elements": {"walltime": 8},
-  "sage.combinat.grossman_larson_algebras": {"walltime": 8},
-  "sage.combinat.interval_posets": {"walltime": 8},
+  "sage.combinat.designs.orthogonal_arrays_build_recursive": {"walltime": 8},
   "sage.combinat.k_regular_sequence": {"walltime": 8},
   "sage.combinat.k_tableau": {"walltime": 16},
   "sage.combinat.matrices.hadamard_matrix": {"walltime": 8},
   "sage.combinat.multiset_partition_into_sets_ordered": {"walltime": 8},
-  "sage.combinat.ncsf_qsym.ncsf": {"walltime": 16},
-  "sage.combinat.ncsf_qsym.qsym": {"walltime": 16},
-  "sage.combinat.partition": {"walltime": 16},
-  "sage.combinat.partition_kleshchev": {"walltime": 16},
+  "sage.combinat.ncsf_qsym.ncsf": {"walltime": 8},
+  "sage.combinat.ncsf_qsym.qsym": {"walltime": 8},
+  "sage.combinat.partition": {"walltime": 8},
   "sage.combinat.partition_tuple": {"walltime": 8},
-  "sage.combinat.posets.moebius_algebra": {"walltime": 16},
+  "sage.combinat.permutation": {"walltime": 8},
   "sage.combinat.posets.posets": {"walltime": 8},
-  "sage.combinat.rigged_configurations.kr_tableaux": {"walltime": 32},
-  "sage.combinat.rigged_configurations.rigged_configurations": {"walltime": 16},
-  "sage.combinat.rigged_configurations.tensor_product_kr_tableaux": {"walltime": 16},
+  "sage.combinat.rigged_configurations.kr_tableaux": {"walltime": 8},
   "sage.combinat.root_system.associahedron": {"walltime": 8},
-  "sage.combinat.root_system.branching_rules": {"walltime": 8},
-  "sage.combinat.root_system.fusion_ring": {"walltime": 8},
-  "sage.combinat.root_system.integrable_representations": {"walltime": 16},
-  "sage.combinat.root_system.non_symmetric_macdonald_polynomials": {"walltime": 16},
-  "sage.combinat.root_system.pieri_factors": {"walltime": 8},
-  "sage.combinat.root_system.plot": {"walltime": 32},
-  "sage.combinat.root_system.root_lattice_realization_algebras": {"walltime": 16},
-  "sage.combinat.root_system.root_lattice_realizations": {"walltime": 16},
-  "sage.combinat.root_system.root_system": {"walltime": 8},
-  "sage.combinat.root_system.weyl_group": {"walltime": 8},
-  "sage.combinat.rsk": {"walltime": 32},
-  "sage.combinat.sf.classical": {"walltime": 16},
-  "sage.combinat.sf.jack": {"walltime": 16},
-  "sage.combinat.sf.k_dual": {"walltime": 16},
-  "sage.combinat.sf.llt": {"walltime": 16},
-  "sage.combinat.sf.macdonald": {"walltime": 64},
-  "sage.combinat.sf.new_kschur": {"walltime": 8},
-  "sage.combinat.sf.sfa": {"walltime": 32},
-  "sage.combinat.shifted_primed_tableau": {"walltime": 16},
+  "sage.combinat.root_system.non_symmetric_macdonald_polynomials": {"walltime": 8},
+  "sage.combinat.root_system.plot": {"walltime": 16},
+  "sage.combinat.root_system.root_lattice_realizations": {"walltime": 8},
+  "sage.combinat.rsk": {"walltime": 8},
+  "sage.combinat.sf.k_dual": {"walltime": 8},
+  "sage.combinat.sf.sf": {"walltime": 8},
+  "sage.combinat.sf.sfa": {"walltime": 8},
+  "sage.combinat.shifted_primed_tableau": {"walltime": 8},
   "sage.combinat.skew_tableau": {"walltime": 8},
-  "sage.combinat.symmetric_group_algebra": {"walltime": 16},
-  "sage.combinat.tableau": {"walltime": 32},
-  "sage.combinat.tableau_tuple": {"walltime": 32},
-  "sage.combinat.tiling": {"walltime": 16},
-  "sage.combinat.tutorial": {"walltime": 16},
-  "sage.combinat.words.paths": {"walltime": 64},
-  "sage.crypto.block_cipher.des": {"walltime": 16},
-  "sage.crypto.mq.sr": {"walltime": 64},
-  "sage.crypto.sbox": {"walltime": 16},
+  "sage.combinat.species.generating_series": {"walltime": 8},
+  "sage.combinat.tableau": {"walltime": 8},
+  "sage.combinat.tableau_tuple": {"walltime": 8},
+  "sage.combinat.tiling": {"walltime": 8},
+  "sage.combinat.tutorial": {"walltime": 8},
   "sage.crypto.sboxes": {"walltime": 8},
   "sage.doctest.forker": {"walltime": 16},
-  "sage.doctest.sources": {"walltime": 64},
-  "sage.doctest.test": {"walltime": 128},
-  "sage.dynamics.arithmetic_dynamics.projective_ds": {"walltime": 64},
-  "sage.dynamics.arithmetic_dynamics.wehlerK3": {"walltime": 8},
-  "sage.dynamics.cellular_automata.glca": {"walltime": 8},
+  "sage.dynamics.arithmetic_dynamics.projective_ds": {"walltime": 32},
   "sage.dynamics.cellular_automata.solitons": {"walltime": 8},
-  "sage.dynamics.complex_dynamics.mandel_julia": {"walltime": 16},
   "sage.functions.bessel": {"walltime": 16},
-  "sage.functions.exp_integral": {"walltime": 8},
   "sage.functions.hypergeometric": {"walltime": 8},
+  "sage.functions.orthogonal_polys": {"walltime": 8},
   "sage.functions.other": {"walltime": 16},
   "sage.functions.piecewise": {"walltime": 8},
-  "sage.games.quantumino": {"walltime": 8},
-  "sage.geometry.cone": {"walltime": 32},
-  "sage.geometry.fan": {"walltime": 8},
   "sage.geometry.hyperbolic_space.hyperbolic_geodesic": {"walltime": 8},
-  "sage.geometry.hyperplane_arrangement.arrangement": {"walltime": 16},
-  "sage.geometry.hyperplane_arrangement.library": {"walltime": 8},
+  "sage.geometry.hyperplane_arrangement.arrangement": {"walltime": 8},
   "sage.geometry.hyperplane_arrangement.plot": {"walltime": 8},
-  "sage.geometry.lattice_polytope": {"walltime": 16},
-  "sage.geometry.polyhedral_complex": {"walltime": 8},
-  "sage.geometry.polyhedron.base": {"walltime": 32},
-  "sage.geometry.polyhedron.library": {"walltime": 32},
-  "sage.geometry.polyhedron.plot": {"walltime": 8},
+  "sage.geometry.polyhedron.base": {"walltime": 8},
+  "sage.geometry.polyhedron.base5": {"walltime": 8},
+  "sage.geometry.polyhedron.base6": {"walltime": 16},
+  "sage.geometry.polyhedron.library": {"walltime": 16},
   "sage.geometry.riemannian_manifolds.parametrized_surface3d": {"walltime": 16},
-  "sage.geometry.triangulation.base": {"walltime": 32},
-  "sage.geometry.triangulation.point_configuration": {"walltime": 16},
-  "sage.graphs.chrompoly": {"walltime": 8},
-  "sage.graphs.connectivity": {"walltime": 16},
-  "sage.graphs.generators.basic": {"walltime": 16},
-  "sage.graphs.generators.classical_geometries": {"walltime": 32},
-  "sage.graphs.generators.distance_regular": {"walltime": 256},
-  "sage.graphs.generators.families": {"walltime": 32},
-  "sage.graphs.generators.smallgraphs": {"walltime": 16},
-  "sage.graphs.generic_graph": {"walltime": 32},
-  "sage.graphs.genus": {"walltime": 16},
+  "sage.graphs.connectivity": {"walltime": 8},
+  "sage.graphs.generators.classical_geometries": {"walltime": 8},
+  "sage.graphs.generators.distance_regular": {"walltime": 32},
+  "sage.graphs.generators.smallgraphs": {"walltime": 8},
+  "sage.graphs.generic_graph": {"walltime": 16},
   "sage.graphs.graph": {"walltime": 16},
-  "sage.graphs.graph_generators": {"walltime": 8},
   "sage.graphs.graph_list": {"walltime": 8},
   "sage.graphs.graph_plot": {"walltime": 8},
-  "sage.graphs.strongly_regular_db": {"walltime": 16},
-  "sage.groups.cubic_braid": {"walltime": 16},
-  "sage.groups.fqf_orthogonal": {"walltime": 16},
-  "sage.groups.libgap_mixin": {"walltime": 8},
-  "sage.groups.libgap_morphism": {"walltime": 8},
-  "sage.groups.lie_gps.nilpotent_lie_group": {"walltime": 16},
-  "sage.groups.matrix_gps.finitely_generated": {"walltime": 8},
-  "sage.groups.matrix_gps.heisenberg": {"walltime": 32},
-  "sage.groups.matrix_gps.linear": {"walltime": 8},
-  "sage.groups.perm_gps.cubegroup": {"walltime": 16},
-  "sage.groups.perm_gps.partn_ref.refinement_graphs": {"walltime": 8},
+  "sage.graphs.strongly_regular_db": {"walltime": 8},
+  "sage.groups.cactus_group": {"walltime": 8},
+  "sage.groups.cubic_braid": {"walltime": 8},
+  "sage.groups.lie_gps.nilpotent_lie_group": {"walltime": 8},
+  "sage.groups.matrix_gps.finitely_generated_gap": {"walltime": 8},
   "sage.groups.perm_gps.permgroup": {"walltime": 8},
   "sage.groups.perm_gps.permgroup_named": {"walltime": 8},
-  "sage.homology.hochschild_complex": {"walltime": 8},
   "sage.homology.homology_vector_space_with_basis": {"walltime": 8},
-  "sage.interacts.test_jupyter": {"walltime": 16},
-  "sage.interfaces.ecm": {"walltime": 8},
-  "sage.interfaces.expect": {"walltime": 8},
-  "sage.interfaces.gap": {"walltime": 16},
-  "sage.interfaces.maxima": {"walltime": 8},
-  "sage.interfaces.maxima_abstract": {"walltime": 64},
-  "sage.interfaces.psage": {"walltime": 8},
-  "sage.interfaces.sage0": {"walltime": 8},
-  "sage.lfunctions.zero_sums": {"walltime": 8},
-  "sage.libs.eclib.interface": {"walltime": 16},
+  "sage.interfaces.gap": {"walltime": 8},
+  "sage.interfaces.gap_workspace": {"walltime": 8},
+  "sage.interfaces.sage0": {"walltime": 16},
+  "sage.libs.eclib.interface": {"walltime": 32},
   "sage.libs.eclib.mwrank": {"walltime": 16},
-  "sage.libs.gap.test_long": {"walltime": 32},
-  "sage.libs.giac": {"walltime": 32},
   "sage.manifolds.catalog": {"walltime": 8},
-  "sage.manifolds.chart": {"walltime": 32},
+  "sage.manifolds.chart": {"walltime": 16},
   "sage.manifolds.chart_func": {"walltime": 8},
   "sage.manifolds.continuous_map": {"walltime": 8},
-  "sage.manifolds.differentiable.affine_connection": {"walltime": 128},
+  "sage.manifolds.differentiable.affine_connection": {"walltime": 32},
   "sage.manifolds.differentiable.automorphismfield": {"walltime": 32},
-  "sage.manifolds.differentiable.automorphismfield_group": {"walltime": 8},
   "sage.manifolds.differentiable.bundle_connection": {"walltime": 8},
-  "sage.manifolds.differentiable.characteristic_cohomology_class": {"walltime": 64},
+  "sage.manifolds.differentiable.characteristic_cohomology_class": {"walltime": 8},
   "sage.manifolds.differentiable.curve": {"walltime": 16},
-  "sage.manifolds.differentiable.degenerate": {"walltime": 32},
-  "sage.manifolds.differentiable.degenerate_submanifold": {"walltime": 16},
-  "sage.manifolds.differentiable.diff_form": {"walltime": 64},
+  "sage.manifolds.differentiable.degenerate": {"walltime": 16},
+  "sage.manifolds.differentiable.degenerate_submanifold": {"walltime": 8},
+  "sage.manifolds.differentiable.diff_form": {"walltime": 32},
   "sage.manifolds.differentiable.diff_map": {"walltime": 8},
   "sage.manifolds.differentiable.examples.euclidean": {"walltime": 32},
   "sage.manifolds.differentiable.examples.sphere": {"walltime": 32},
   "sage.manifolds.differentiable.integrated_curve": {"walltime": 32},
-  "sage.manifolds.differentiable.levi_civita_connection": {"walltime": 32},
-  "sage.manifolds.differentiable.manifold": {"walltime": 16},
-  "sage.manifolds.differentiable.manifold_homset": {"walltime": 16},
+  "sage.manifolds.differentiable.levi_civita_connection": {"walltime": 16},
+  "sage.manifolds.differentiable.manifold": {"walltime": 8},
+  "sage.manifolds.differentiable.manifold_homset": {"walltime": 8},
   "sage.manifolds.differentiable.metric": {"walltime": 64},
   "sage.manifolds.differentiable.mixed_form": {"walltime": 16},
-  "sage.manifolds.differentiable.mixed_form_algebra": {"walltime": 8},
   "sage.manifolds.differentiable.multivectorfield": {"walltime": 64},
-  "sage.manifolds.differentiable.pseudo_riemannian": {"walltime": 16},
-  "sage.manifolds.differentiable.pseudo_riemannian_submanifold": {"walltime": 128},
-  "sage.manifolds.differentiable.scalarfield": {"walltime": 16},
+  "sage.manifolds.differentiable.pseudo_riemannian": {"walltime": 8},
+  "sage.manifolds.differentiable.pseudo_riemannian_submanifold": {"walltime": 32},
+  "sage.manifolds.differentiable.scalarfield": {"walltime": 8},
   "sage.manifolds.differentiable.scalarfield_algebra": {"walltime": 8},
-  "sage.manifolds.differentiable.tangent_vector": {"walltime": 16},
+  "sage.manifolds.differentiable.tangent_vector": {"walltime": 8},
   "sage.manifolds.differentiable.tensorfield": {"walltime": 128},
   "sage.manifolds.differentiable.tensorfield_paral": {"walltime": 16},
-  "sage.manifolds.differentiable.vector_bundle": {"walltime": 16},
-  "sage.manifolds.differentiable.vectorfield": {"walltime": 64},
-  "sage.manifolds.differentiable.vectorframe": {"walltime": 8},
+  "sage.manifolds.differentiable.vectorfield": {"walltime": 16},
   "sage.manifolds.point": {"walltime": 16},
   "sage.manifolds.scalarfield": {"walltime": 16},
-  "sage.manifolds.scalarfield_algebra": {"walltime": 8},
-  "sage.manifolds.section": {"walltime": 32},
-  "sage.manifolds.trivialization": {"walltime": 8},
-  "sage.manifolds.vector_bundle": {"walltime": 8},
-  "sage.matrix.benchmark": {"walltime": 8},
+  "sage.manifolds.section": {"walltime": 16},
   "sage.matrix.matrix2": {"walltime": 16},
-  "sage.matrix.matrix_integer_dense": {"walltime": 16},
-  "sage.matrix.matrix_integer_dense_hnf": {"walltime": 32},
-  "sage.matrix.matrix_mod2_dense": {"walltime": 8},
   "sage.matrix.matrix_rational_dense": {"walltime": 8},
   "sage.matrix.special": {"walltime": 8},
-  "sage.matroids.catalog": {"walltime": 64},
   "sage.misc.cachefunc": {"walltime": 16},
-  "sage.misc.cython": {"walltime": 8},
   "sage.misc.functional": {"walltime": 8},
   "sage.misc.randstate": {"walltime": 16},
-  "sage.misc.sagedoc": {"walltime": 64},
-  "sage.misc.sageinspect": {"walltime": 32},
-  "sage.modular.abvar.abvar": {"walltime": 16},
+  "sage.misc.sagedoc": {"walltime": 16},
+  "sage.misc.sageinspect": {"walltime": 16},
+  "sage.misc.trace": {"walltime": 8},
+  "sage.modular.abvar.abvar": {"walltime": 8},
   "sage.modular.abvar.homspace": {"walltime": 8},
-  "sage.modular.abvar.lseries": {"walltime": 8},
-  "sage.modular.arithgroup.arithgroup_perm": {"walltime": 8},
-  "sage.modular.arithgroup.tests": {"walltime": 8},
-  "sage.modular.btquotients.pautomorphicform": {"walltime": 32},
-  "sage.modular.hypergeometric_motive": {"walltime": 16},
-  "sage.modular.local_comp.local_comp": {"walltime": 32},
-  "sage.modular.local_comp.type_space": {"walltime": 16},
-  "sage.modular.modform.ambient_R": {"walltime": 16},
-  "sage.modular.modform.constructor": {"walltime": 8},
-  "sage.modular.modform.cuspidal_submodule": {"walltime": 16},
-  "sage.modular.modform.element": {"walltime": 64},
-  "sage.modular.modform.ring": {"walltime": 64},
-  "sage.modular.modform.space": {"walltime": 8},
+  "sage.modular.btquotients.btquotient": {"walltime": 8},
+  "sage.modular.btquotients.pautomorphicform": {"walltime": 16},
+  "sage.modular.hecke.submodule": {"walltime": 8},
+  "sage.modular.hypergeometric_motive": {"walltime": 8},
+  "sage.modular.local_comp.local_comp": {"walltime": 16},
+  "sage.modular.local_comp.type_space": {"walltime": 8},
+  "sage.modular.modform.element": {"walltime": 32},
   "sage.modular.modform_hecketriangle.abstract_space": {"walltime": 16},
   "sage.modular.modform_hecketriangle.graded_ring_element": {"walltime": 16},
   "sage.modular.modform_hecketriangle.hecke_triangle_group_element": {"walltime": 32},
   "sage.modular.modform_hecketriangle.readme": {"walltime": 16},
-  "sage.modular.modform_hecketriangle.space": {"walltime": 8},
   "sage.modular.modsym.ambient": {"walltime": 16},
   "sage.modular.modsym.space": {"walltime": 8},
-  "sage.modular.pollack_stevens.modsym": {"walltime": 64},
-  "sage.modular.pollack_stevens.padic_lseries": {"walltime": 32},
-  "sage.modules.finite_submodule_iter": {"walltime": 16},
-  "sage.modules.free_module": {"walltime": 16},
-  "sage.modules.free_module_element": {"walltime": 8},
-  "sage.modules.free_module_integer": {"walltime": 32},
-  "sage.modules.free_quadratic_module_integer_symmetric": {"walltime": 8},
-  "sage.modules.torsion_quadratic_module": {"walltime": 16},
+  "sage.modular.overconvergent.genus0": {"walltime": 8},
+  "sage.modular.pollack_stevens.modsym": {"walltime": 8},
+  "sage.modules.fp_graded.morphism": {"walltime": 8},
+  "sage.modules.free_module": {"walltime": 8},
   "sage.parallel.map_reduce": {"walltime": 8},
-  "sage.plot.animate": {"walltime": 16},
-  "sage.plot.arrow": {"walltime": 8},
-  "sage.plot.circle": {"walltime": 8},
-  "sage.plot.complex_plot": {"walltime": 8},
+  "sage.plot.complex_plot": {"walltime": 16},
   "sage.plot.contour_plot": {"walltime": 32},
-  "sage.plot.density_plot": {"walltime": 8},
   "sage.plot.graphics": {"walltime": 32},
   "sage.plot.line": {"walltime": 8},
   "sage.plot.matrix_plot": {"walltime": 16},
@@ -283,115 +154,53 @@
   "sage.plot.plot": {"walltime": 64},
   "sage.plot.plot3d.base": {"walltime": 8},
   "sage.plot.plot3d.implicit_plot3d": {"walltime": 16},
-  "sage.plot.plot3d.implicit_surface": {"walltime": 8},
-  "sage.plot.plot3d.parametric_plot3d": {"walltime": 8},
+  "sage.plot.plot3d.parametric_plot3d": {"walltime": 16},
   "sage.plot.plot3d.parametric_surface": {"walltime": 8},
   "sage.plot.plot3d.plot3d": {"walltime": 16},
-  "sage.plot.plot3d.tachyon": {"walltime": 8},
-  "sage.plot.plot3d.transform": {"walltime": 32},
   "sage.plot.point": {"walltime": 8},
   "sage.plot.polygon": {"walltime": 8},
   "sage.plot.streamline_plot": {"walltime": 8},
-  "sage.quadratic_forms.genera.genus": {"walltime": 16},
-  "sage.quadratic_forms.quadratic_form__automorphisms": {"walltime": 8},
-  "sage.quadratic_forms.quadratic_form__local_representation_conditions": {"walltime": 64},
-  "sage.quadratic_forms.quadratic_form__neighbors": {"walltime": 8},
-  "sage.quadratic_forms.quadratic_form__siegel_product": {"walltime": 8},
   "sage.repl.ipython_extension": {"walltime": 8},
-  "sage.rings.asymptotic.asymptotic_expansion_generators": {"walltime": 64},
+  "sage.rings.asymptotic.asymptotic_expansion_generators": {"walltime": 16},
   "sage.rings.asymptotic.asymptotic_ring": {"walltime": 8},
-  "sage.rings.asymptotic.asymptotics_multivariate_generating_functions": {"walltime": 32},
-  "sage.rings.asymptotic.term_monoid": {"walltime": 8},
-  "sage.rings.continued_fraction": {"walltime": 8},
+  "sage.rings.asymptotic.asymptotics_multivariate_generating_functions": {"walltime": 8},
   "sage.rings.finite_rings.finite_field_base": {"walltime": 8},
-  "sage.rings.function_field.function_field": {"walltime": 128},
-  "sage.rings.function_field.function_field_valuation": {"walltime": 64},
+  "sage.rings.function_field.function_field": {"walltime": 8},
   "sage.rings.function_field.ideal": {"walltime": 8},
-  "sage.rings.function_field.place": {"walltime": 8},
-  "sage.rings.integer": {"walltime": 64},
-  "sage.rings.invariants.invariant_theory": {"walltime": 8},
-  "sage.rings.number_field.bdd_height": {"walltime": 8},
-  "sage.rings.number_field.number_field": {"walltime": 64},
-  "sage.rings.number_field.number_field_element": {"walltime": 16},
-  "sage.rings.number_field.splitting_field": {"walltime": 8},
-  "sage.rings.number_field.totallyreal": {"walltime": 16},
-  "sage.rings.number_field.totallyreal_rel": {"walltime": 8},
-  "sage.rings.padics.padic_base_leaves": {"walltime": 64},
-  "sage.rings.padics.padic_extension_leaves": {"walltime": 64},
-  "sage.rings.padics.padic_generic_element": {"walltime": 16},
-  "sage.rings.padics.padic_lattice_element": {"walltime": 32},
-  "sage.rings.padics.relative_extension_leaves": {"walltime": 32},
+  "sage.rings.lazy_series": {"walltime": 8},
+  "sage.rings.lazy_series_ring": {"walltime": 32},
+  "sage.rings.number_field.number_field": {"walltime": 32},
+  "sage.rings.number_field.number_field_element": {"walltime": 8},
+  "sage.rings.padics.padic_base_leaves": {"walltime": 8},
+  "sage.rings.padics.padic_generic_element": {"walltime": 8},
   "sage.rings.polynomial.multi_polynomial_ideal": {"walltime": 8},
-  "sage.rings.polynomial.multi_polynomial_sequence": {"walltime": 8},
-  "sage.rings.polynomial.ore_function_element": {"walltime": 8},
   "sage.rings.polynomial.polynomial_element": {"walltime": 16},
-  "sage.rings.polynomial.polynomial_rational_flint": {"walltime": 8},
   "sage.rings.qqbar": {"walltime": 16},
-  "sage.rings.tests": {"walltime": 16},
-  "sage.rings.valuation.augmented_valuation": {"walltime": 32},
-  "sage.rings.valuation.mapped_valuation": {"walltime": 64},
-  "sage.rings.valuation.valuation": {"walltime": 8},
-  "sage.sandpiles.sandpile": {"walltime": 16},
+  "sage.sandpiles.sandpile": {"walltime": 8},
   "sage.schemes.curves.affine_curve": {"walltime": 16},
   "sage.schemes.curves.closed_point": {"walltime": 8},
   "sage.schemes.curves.projective_curve": {"walltime": 32},
-  "sage.schemes.cyclic_covers.cycliccover_finite_field": {"walltime": 64},
   "sage.schemes.elliptic_curves.BSD": {"walltime": 8},
   "sage.schemes.elliptic_curves.Qcurves": {"walltime": 8},
-  "sage.schemes.elliptic_curves.constructor": {"walltime": 32},
-  "sage.schemes.elliptic_curves.ell_curve_isogeny": {"walltime": 16},
-  "sage.schemes.elliptic_curves.ell_egros": {"walltime": 32},
-  "sage.schemes.elliptic_curves.ell_finite_field": {"walltime": 8},
+  "sage.schemes.elliptic_curves.ell_curve_isogeny": {"walltime": 8},
   "sage.schemes.elliptic_curves.ell_generic": {"walltime": 8},
-  "sage.schemes.elliptic_curves.ell_modular_symbols": {"walltime": 16},
-  "sage.schemes.elliptic_curves.ell_number_field": {"walltime": 128},
+  "sage.schemes.elliptic_curves.ell_modular_symbols": {"walltime": 8},
   "sage.schemes.elliptic_curves.ell_point": {"walltime": 8},
-  "sage.schemes.elliptic_curves.ell_rational_field": {"walltime": 128},
-  "sage.schemes.elliptic_curves.gal_reps_number_field": {"walltime": 32},
-  "sage.schemes.elliptic_curves.gp_simon": {"walltime": 16},
-  "sage.schemes.elliptic_curves.heegner": {"walltime": 32},
-  "sage.schemes.elliptic_curves.height": {"walltime": 64},
-  "sage.schemes.elliptic_curves.isogeny_class": {"walltime": 32},
-  "sage.schemes.elliptic_curves.isogeny_small_degree": {"walltime": 64},
-  "sage.schemes.elliptic_curves.kraus": {"walltime": 16},
+  "sage.schemes.elliptic_curves.ell_rational_field": {"walltime": 32},
+  "sage.schemes.elliptic_curves.height": {"walltime": 8},
+  "sage.schemes.elliptic_curves.isogeny_small_degree": {"walltime": 16},
   "sage.schemes.elliptic_curves.mod_sym_num": {"walltime": 8},
   "sage.schemes.elliptic_curves.padic_lseries": {"walltime": 8},
-  "sage.schemes.elliptic_curves.padics": {"walltime": 16},
-  "sage.schemes.elliptic_curves.saturation": {"walltime": 16},
-  "sage.schemes.elliptic_curves.sha_tate": {"walltime": 32},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_finite_field": {"walltime": 64},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_generic": {"walltime": 8},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_padic_field": {"walltime": 32},
-  "sage.schemes.hyperelliptic_curves.monsky_washnitzer": {"walltime": 8},
-  "sage.schemes.projective.projective_rational_point": {"walltime": 8},
-  "sage.schemes.riemann_surfaces.riemann_surface": {"walltime": 64},
+  "sage.schemes.elliptic_curves.padics": {"walltime": 8},
+  "sage.schemes.elliptic_curves.sha_tate": {"walltime": 16},
+  "sage.schemes.hyperelliptic_curves.hyperelliptic_padic_field": {"walltime": 16},
+  "sage.schemes.riemann_surfaces.riemann_surface": {"walltime": 32},
   "sage.schemes.toric.chow_group": {"walltime": 8},
-  "sage.schemes.toric.sheaf.klyachko": {"walltime": 8},
-  "sage.stats.distributions.discrete_gaussian_integer": {"walltime": 8},
-  "sage.stats.time_series": {"walltime": 8},
-  "sage.structure.coerce_dict": {"walltime": 32},
   "sage.structure.element": {"walltime": 16},
-  "sage.structure.sage_object": {"walltime": 8},
   "sage.symbolic.expression": {"walltime": 32},
-  "sage.symbolic.integration.integral": {"walltime": 32},
-  "sage.symbolic.random_tests": {"walltime": 32},
+  "sage.symbolic.integration.integral": {"walltime": 16},
   "sage.symbolic.relation": {"walltime": 8},
-  "sage.tests.book_schilling_zabrocki_kschur_primer": {"walltime": 32},
-  "sage.tests.book_stein_ent": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.combinat_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.float_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.graphique_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.graphtheory_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.integration_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.mpoly_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.nonlinear_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.recequadiff_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.graphique_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.numbertheory_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.polynomes_doctest": {"walltime": 16},
-  "sage.tests.cmdline": {"walltime": 64},
-  "sage.tests.gosper-sum": {"walltime": 16},
-  "sage.tests.parigp": {"walltime": 8},
-  "sage.topology.simplicial_complex": {"walltime": 8},
-  "sage.topology.simplicial_complex_examples": {"walltime": 16}
+  "sage.tests.book_schilling_zabrocki_kschur_primer": {"walltime": 16},
+  "sage.tests.book_stein_ent": {"walltime": 8},
+  "sage.topology.simplicial_complex": {"walltime": 16}
 }
diff --git a/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch b/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
deleted file mode 100644
index f2f825e4fb10..000000000000
--- a/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
+++ /dev/null
@@ -1,205 +0,0 @@
-diff --git a/build/pkgs/singular/checksums.ini b/build/pkgs/singular/checksums.ini
-index 2e33a405d36..313463d2fea 100644
---- a/build/pkgs/singular/checksums.ini
-+++ b/build/pkgs/singular/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=singular-VERSION.tar.gz
--sha1=6c2b622d3681e2de3d58d30c654d43d3e32b720c
--md5=abb1e37c794472e7760655358ab66054
--cksum=17455733
-+sha1=28bb3ee97ef48d04dfa96de182fd93eebe08426c
-+md5=fc0a4f5720dadba45a52ee94324ce00c
-+cksum=1573851737
- upstream_url=ftp://jim.mathematik.uni-kl.de/pub/Math/Singular/SOURCES/4-3-1/singular-VERSION.tar.gz
-diff --git a/build/pkgs/singular/package-version.txt b/build/pkgs/singular/package-version.txt
-index 11300c77e7d..66e2bede53a 100644
---- a/build/pkgs/singular/package-version.txt
-+++ b/build/pkgs/singular/package-version.txt
-@@ -1 +1 @@
--4.3.1p1
-+4.3.1p3
-diff --git a/src/sage/libs/singular/decl.pxd b/src/sage/libs/singular/decl.pxd
-index 8e3ac314b67..747a6b1e2fb 100644
---- a/src/sage/libs/singular/decl.pxd
-+++ b/src/sage/libs/singular/decl.pxd
-@@ -574,7 +574,7 @@ cdef extern from "singular/Singular/libsingular.h":
- 
-     # gets a component out of a polynomial vector
- 
--    poly *pTakeOutComp1(poly **, int)
-+    poly *pTakeOutComp(poly **, int)
- 
-     # deep copy p
- 
-diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx
-index d8ea7b07f3c..3a1271cd59f 100644
---- a/src/sage/libs/singular/singular.pyx
-+++ b/src/sage/libs/singular/singular.pyx
-@@ -1726,20 +1726,21 @@ cdef int overflow_check(unsigned long e, ring *_ring) except -1:
- 
-     Whether an overflow occurs or not partially depends
-     on the number of variables in the ring. See trac ticket
--    :trac:`11856`. With Singular 4, it is by default optimized
--    for at least 4 variables on 64-bit and 2 variables on 32-bit,
--    which in both cases makes a maximal default exponent of
--    2^16-1.
-+    :trac:`11856`.
- 
-     EXAMPLES::
- 
-         sage: P.<x,y> = QQ[]
--        sage: y^(2^16-1)
--        y^65535
--        sage: y^2^16
-+        sage: y^(2^30)
-+        Traceback (most recent call last):             # 32-bit
-+        ...                                            # 32-bit
-+        OverflowError: exponent overflow (1073741824)  # 32-bit
-+        y^1073741824  # 64-bit
-+        sage: y^2^32
-         Traceback (most recent call last):
-         ...
--        OverflowError: exponent overflow (65536)
-+        OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+        OverflowError: exponent overflow (4294967296)  # 64-bit
-     """
-     if unlikely(e > _ring.bitmask):
-         raise OverflowError("exponent overflow (%d)"%(e))
-diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py
-index 7dc058a22f0..71494eddbc0 100644
---- a/src/sage/rings/polynomial/multi_polynomial_ideal.py
-+++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py
-@@ -60,7 +60,7 @@
- Note that the result of a computation is not necessarily reduced::
- 
-     sage: (a+b)^17
--    256*a*b^16 + 256*b^17
-+    a*b^16 + b^17
-     sage: S(17) == 0
-     True
- 
-diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-index 4dad016b33f..9bf67dd1425 100644
---- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-+++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-@@ -193,7 +193,7 @@ from sage.libs.singular.decl cimport (
-     p_IsUnit, p_IsOne, p_Series, p_Head, idInit, fast_map_common_subexp, id_Delete,
-     p_IsHomogeneous, p_Homogen, p_Totaldegree,pLDeg1_Totaldegree, singclap_pdivide, singclap_factorize,
-     idLift, IDELEMS, On, Off, SW_USE_CHINREM_GCD, SW_USE_EZGCD,
--    p_LmIsConstant, pTakeOutComp1, singclap_gcd, pp_Mult_qq, p_GetMaxExp,
-+    p_LmIsConstant, pTakeOutComp, singclap_gcd, pp_Mult_qq, p_GetMaxExp,
-     pLength, kNF, p_Neg, p_Minus_mm_Mult_qq, p_Plus_mm_Mult_qq,
-     pDiff, singclap_resultant, p_Normalize,
-     prCopyR, prCopyR_NoSort)
-@@ -1587,7 +1587,8 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_base):
-             9/4
- 
-             sage: P.monomial_quotient(x,y) # Note the wrong result
--            x*y^65535*z^65535
-+            x*y^65535*z^65535      # 32-bit
-+            x*y^1048575*z^1048575  # 64-bit
- 
-             sage: P.monomial_quotient(x,P(1))
-             x
-@@ -2247,10 +2248,11 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             9/4*x^2 - 1/4*y^2 - y - 1
- 
-             sage: P.<x,y> = PolynomialRing(QQ,order='lex')
--            sage: (x^2^15) * x^2^15
-+            sage: (x^2^32) * x^2^32
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (...)
-+            OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+            OverflowError: exponent overflow (...)  # 64-bit
-         """
-         # all currently implemented rings are commutative
-         cdef poly *_p
-@@ -2371,10 +2373,11 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             ValueError: not a 2nd power
- 
-             sage: P.<x,y> = PolynomialRing(QQ,order='lex')
--            sage: (x+y^2^15)^10
-+            sage: (x+y^2^32)^10
-             Traceback (most recent call last):
-             ....
--            OverflowError: exponent overflow (...)
-+            OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+            OverflowError: exponent overflow (...)  # 64-bit
- 
-         Test fractional powers (:trac:`22329`)::
- 
-@@ -3461,7 +3464,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             x^10000
-             no overflow
- 
--            sage: n = 1000
-+            sage: n = 100000
-             sage: try:
-             ....:     f = x^n
-             ....:     f.subs(x = x^n)
-@@ -4567,7 +4570,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
-         l = []
-         for i from 0 <= i < IDELEMS(res):
-             for j from 1 <= j <= IDELEMS(_I):
--                l.append( new_MP(parent, pTakeOutComp1(&res.m[i], j)) )
-+                l.append( new_MP(parent, pTakeOutComp(&res.m[i], 1)) )
- 
-         id_Delete(&fI, r)
-         id_Delete(&_I, r)
-@@ -4635,7 +4638,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
- 
-             sage: f = 3*x
-             sage: f.reduce([2*x,y])
--            3*x
-+            x
- 
-         The reduction is not canonical when ``I`` is not a Groebner
-         basis::
-diff --git a/src/sage/rings/polynomial/plural.pyx b/src/sage/rings/polynomial/plural.pyx
-index 1c9f35e56ba..587511c3888 100644
---- a/src/sage/rings/polynomial/plural.pyx
-+++ b/src/sage/rings/polynomial/plural.pyx
-@@ -1619,10 +1619,10 @@ cdef class NCPolynomial_plural(RingElement):
-             sage: P = A.g_algebra(relations={y*x:-x*y + z},  order='lex')
-             sage: P.inject_variables()
-             Defining x, z, y
--            sage: (x^2^15) * x^2^15
-+            sage: (x^2^31) * x^2^31
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (65536)
-+            OverflowError: exponent overflow (2147483648)
-         """
-         # all currently implemented rings are commutative
-         cdef poly *_p
-@@ -1689,10 +1689,10 @@ cdef class NCPolynomial_plural(RingElement):
-             sage: P = A.g_algebra(relations={y*x:-x*y + z},  order='lex')
-             sage: P.inject_variables()
-             Defining x, z, y
--            sage: (x+y^2^15)^10
-+            sage: (x+y^2^31)^10
-             Traceback (most recent call last):
-             ....
--            OverflowError: exponent overflow (327680)
-+            OverflowError: exponent overflow (2147483648)
-         """
-         if type(exp) is not Integer:
-             try:
-diff --git a/src/sage/structure/element.pyx b/src/sage/structure/element.pyx
-index b5d83ef71b6..5c45b3fb528 100644
---- a/src/sage/structure/element.pyx
-+++ b/src/sage/structure/element.pyx
-@@ -2705,10 +2705,10 @@ cdef class RingElement(ModuleElement):
-         with Singular 4::
- 
-             sage: K.<x,y> = ZZ[]
--            sage: (x^12345)^54321
-+            sage: (x^123456)^654321
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (670592745)
-+            OverflowError: exponent overflow (...)
-         """
-         return arith_generic_power(self, n)
- 
diff --git a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch b/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
deleted file mode 100644
index ee0f0e656b28..000000000000
--- a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py
-index d5f7157217f..8ca1f958039 100644
---- a/src/sage/rings/number_field/number_field_ideal.py
-+++ b/src/sage/rings/number_field/number_field_ideal.py
-@@ -996,16 +996,38 @@ def is_prime(self):
-             False
-             sage: K.ideal(17).is_prime()  # ramified
-             False
-+
-+        TESTS:
-+
-+        Check that we do not factor the norm of the ideal, this used
-+        to take half an hour, see :trac:`33360`::
-+
-+            sage: K.<a,b,c> = NumberField([x^2-2,x^2-3,x^2-5])
-+            sage: t = (((-2611940*c + 1925290/7653)*b - 1537130/7653*c
-+            ....:       + 10130950)*a + (1343014/7653*c - 8349770)*b
-+            ....:       + 6477058*c - 2801449990/4002519)
-+            sage: t.is_prime()
-+            False
-         """
-         try:
-             return self._pari_prime is not None
-         except AttributeError:
--            F = self.factor()  # factorization with caching
--            if len(F) != 1 or F[0][1] != 1:
--                self._pari_prime = None
--            else:
--                self._pari_prime = F[0][0]._pari_prime
--            return self._pari_prime is not None
-+            pass
-+
-+        K = self.number_field().pari_nf()
-+        I = self.pari_hnf()
-+
-+        candidate = K.idealismaximal(I) or None
-+
-+        # PARI uses probabilistic primality testing inside idealismaximal().
-+        if get_flag(None, 'arithmetic'):
-+            # proof required, check using isprime()
-+            if candidate and not candidate[0].isprime():
-+                candidate = None
-+
-+        self._pari_prime = candidate
-+
-+        return self._pari_prime is not None
- 
-     def pari_prime(self):
-         r"""
diff --git a/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch b/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
deleted file mode 100644
index 91f06fd4d173..000000000000
--- a/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-diff --git a/src/sage/misc/persist.pyx b/src/sage/misc/persist.pyx
-index 3ac5f1cc2b0..cb1f327c199 100644
---- a/src/sage/misc/persist.pyx
-+++ b/src/sage/misc/persist.pyx
-@@ -157,7 +157,7 @@ def load(*filename, compress=True, verbose=True, **kwargs):
-         ....:     _ = f.write(code)
-         sage: load(t)
-         sage: hello
--        <fortran object>
-+        <fortran ...>
-     """
-     import sage.repl.load
-     if len(filename) != 1:
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index 6f0aeab87ae..b77c69b2f77 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -461,6 +461,8 @@ def complex_to_rgb(z_values, contoured=False, tiled=False,
-             rgb[i, j, 2] = b
- 
-     sig_off()
-+    nan_indices = np.isnan(rgb).any(-1)     # Mask for undefined points
-+    rgb[nan_indices] = 1                    # Make nan_indices white
-     return rgb
- 
- 
-diff --git a/src/sage/plot/histogram.py b/src/sage/plot/histogram.py
-index 3bc2b76b58e..388c2d1391d 100644
---- a/src/sage/plot/histogram.py
-+++ b/src/sage/plot/histogram.py
-@@ -87,13 +87,8 @@ def get_minmax_data(self):
- 
-         TESTS::
- 
--            sage: h = histogram([10,3,5], normed=True)[0]
--            doctest:warning...:
--            DeprecationWarning: the 'normed' option is deprecated. Use 'density' instead.
--            See https://trac.sagemath.org/25260 for details.
-+            sage: h = histogram([10,3,5], density=True)[0]
-             sage: h.get_minmax_data()
--            doctest:warning ...
--            ...VisibleDeprecationWarning: Passing `normed=True` on non-uniform bins has always been broken, and computes neither the probability density function nor the probability mass function. The result is only correct if the bins are uniform, when density=True will produce the same result anyway. The argument will be removed in a future version of numpy.
-             {'xmax': 10.0, 'xmin': 3.0, 'ymax': 0.476190476190..., 'ymin': 0}
-         """
-         import numpy
-diff --git a/src/sage/repl/ipython_extension.py b/src/sage/repl/ipython_extension.py
-index 798671aab42..cad6a47ca8b 100644
---- a/src/sage/repl/ipython_extension.py
-+++ b/src/sage/repl/ipython_extension.py
-@@ -405,7 +405,7 @@ def fortran(self, line, cell):
-             ....: C END FILE FIB1.F
-             ....: ''')
-             sage: fib
--            <fortran object>
-+            <fortran ...>
-             sage: from numpy import array
-             sage: a = array(range(10), dtype=float)
-             sage: fib(a, 10)
diff --git a/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch b/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
deleted file mode 100644
index 2769e87f6a4b..000000000000
--- a/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-diff --git a/src/sage/interfaces/tachyon.py b/src/sage/interfaces/tachyon.py
-index 23671e50892..ce1d50f71bc 100644
---- a/src/sage/interfaces/tachyon.py
-+++ b/src/sage/interfaces/tachyon.py
-@@ -683,12 +683,14 @@
- #*****************************************************************************
- 
- import os
-+import re
- 
- from sage.cpython.string import bytes_to_str
- from sage.misc.pager import pager
- from sage.misc.superseded import deprecation
- from sage.misc.temporary_file import tmp_filename
- from sage.structure.sage_object import SageObject
-+from sage.misc.cachefunc import cached_method
- 
- 
- class TachyonRT(SageObject):
-@@ -799,6 +801,11 @@ def __call__(self, model, outfile='sage.png', verbose=1, extra_opts=''):
-             Parser failed due to an input file syntax error.
-             Aborting render.
-         """
-+        if self.version() >= '0.99.2':
-+            # this keyword was changed in 0.99.2
-+            model = model.replace(
-+                    "              focallength ",
-+                    "              focaldist ")
-         modelfile = tmp_filename(ext='.dat')
-         with open(modelfile, 'w') as file:
-             file.write(model)
-@@ -851,6 +858,25 @@ def usage(self, use_pager=True):
-         else:
-             print(r)
- 
-+    @cached_method
-+    def version(self):
-+        """
-+        Returns the version of the Tachyon raytracer being used.
-+
-+        TESTS::
-+
-+            sage: tachyon_rt.version()  # random
-+            0.98.9
-+            sage: tachyon_rt.version() >= '0.98.9'
-+            True
-+        """
-+        with os.popen('tachyon') as f:
-+            r = f.readline()
-+        res = re.search(r"Version ([\d.]*)", r)
-+        # debian patches tachyon so it won't report the version
-+        # we hardcode '0.99' since that's indeed the version they ship
-+        return res[1] if res else '0.99'
-+
-     def help(self, use_pager=True):
-         """
-         Deprecated: type 'sage.interfaces.tachyon?' for help
diff --git a/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch b/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
deleted file mode 100644
index 11eb20d4f735..000000000000
--- a/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff --git a/src/sage/arith/long.pxd b/src/sage/arith/long.pxd
-index 1c9a53387a0..d96b98f247c 100644
---- a/src/sage/arith/long.pxd
-+++ b/src/sage/arith/long.pxd
-@@ -270,6 +270,17 @@ cdef inline bint integer_check_long_py(x, long* value, int* err):
-         sage: L += [-x for x in L] + [0, long_min()]
-         sage: for v in L:
-         ....:     assert check_long_py(int(v)) == v
-+        sage: check_long_py(int(2^60))
-+        1152921504606846976                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^61))
-+        2305843009213693952                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^62))
-+        4611686018427387904                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^63))
-+        'Overflow (...)'
-         sage: check_long_py(int(2^100))
-         'Overflow (...)'
-         sage: check_long_py(int(long_max() + 1))
-@@ -309,7 +320,12 @@ cdef inline bint integer_check_long_py(x, long* value, int* err):
- 
-     cdef long lead
-     cdef long lead_2_overflow = (<long>1) << (BITS_IN_LONG - PyLong_SHIFT)
--    cdef long lead_3_overflow = (<long>1) << (BITS_IN_LONG - 2 * PyLong_SHIFT)
-+    cdef long lead_3_overflow
-+    if BITS_IN_LONG < 2 * PyLong_SHIFT:
-+        # in this case 3 digit is always overflow
-+        lead_3_overflow = 0
-+    else:
-+        lead_3_overflow = (<long>1) << (BITS_IN_LONG - 2 * PyLong_SHIFT)
-     if size == 0:
-         value[0] = 0
-         err[0] = 0
diff --git a/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch b/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
deleted file mode 100644
index c4d7d5c779d1..000000000000
--- a/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/src/sage/schemes/toric/sheaf/klyachko.py b/src/sage/schemes/toric/sheaf/klyachko.py
-index b1304a16913..77fae4b7545 100644
---- a/src/sage/schemes/toric/sheaf/klyachko.py
-+++ b/src/sage/schemes/toric/sheaf/klyachko.py
-@@ -26,7 +26,7 @@
-     (0, 0, 18, 16, 1)
-     sage: Gtilde = G_sum.random_deformation()
-     sage: V = Gtilde.wedge(2) * K                     # long time
--    sage: V.cohomology(dim=True, weight=(0,0,0,0))    # long time
-+    sage: V.cohomology(dim=True, weight=(0,0,0,0))    # long time  # random failure (see #32773)
-     (0, 0, 3, 0, 0)
- 
- REFERENCES:
-@@ -948,7 +948,7 @@ def random_deformation(self, epsilon=None):
-            sage: V.cohomology(dim=True, weight=(0,))
-            (1, 0)
-            sage: Vtilde = V.random_deformation()
--           sage: Vtilde.cohomology(dim=True, weight=(0,))
-+           sage: Vtilde.cohomology(dim=True, weight=(0,))  # random failure (see #32773)
-            (1, 0)
-         """
-         filt = self._filt.random_deformation(epsilon)
diff --git a/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch b/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
deleted file mode 100644
index d9a9835c696b..000000000000
--- a/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 9ac7840134054155545e24fa3e66402d42b91c0f Mon Sep 17 00:00:00 2001
-From: Antonio Rojas <arojas@archlinux.org>
-Date: Fri, 20 Jan 2023 21:36:27 +0100
-Subject: [PATCH] Fix tests with giac 1.9.0.35
-
----
- src/sage/libs/giac/giac.pyx   |  3 +--
- src/sage/symbolic/relation.py | 15 +++++----------
- 2 files changed, 6 insertions(+), 12 deletions(-)
-
-diff --git a/src/sage/libs/giac/giac.pyx b/src/sage/libs/giac/giac.pyx
-index 4e451dba5e7..ccad5169836 100644
---- a/src/sage/libs/giac/giac.pyx
-+++ b/src/sage/libs/giac/giac.pyx
-@@ -374,8 +374,7 @@ def _giac(s):
- 
-         sage: x = libgiac('x')
-         sage: (1+2*sin(3*x)).solve(x).simplify()
--        Warning, argument is not an equation, solving 1+2*sin(3*x)=0
--        list[-pi/18,7*pi/18]
-+        ...list[-pi/18,7*pi/18]
- 
-         sage: libgiac.solve('sin(3*x)>2*sin(x)',x)
-         Traceback (most recent call last):
-diff --git a/src/sage/symbolic/relation.py b/src/sage/symbolic/relation.py
-index e9dbc0fea30..b8896a94be9 100644
---- a/src/sage/symbolic/relation.py
-+++ b/src/sage/symbolic/relation.py
-@@ -935,8 +935,7 @@ def solve(f, *args, **kwds):
- 
-         sage: f = (sin(x) - 8*cos(x)*sin(x))*(sin(x)^2 + cos(x)) - (2*cos(x)*sin(x) - sin(x))*(-2*sin(x)^2 + 2*cos(x)^2 - cos(x))
-         sage: solve(f, x, algorithm='giac')
--        ...
--        [-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-+        ...[-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
- 
-         sage: x, y = SR.var('x,y')
-         sage: solve([x+y-4,x*y-3],[x,y],algorithm='giac')
-@@ -1440,19 +1439,15 @@ def _giac_solver(f, x, solution_dict=False):
-     EXAMPLES::
- 
-         sage: solve([(2/3)^x-2], [x], algorithm='giac')
--        ...
--        [[-log(2)/(log(3) - log(2))]]
-+        ...[[-log(2)/(log(3) - log(2))]]
-         sage: solve([(2/3)^x-2], [x], algorithm='giac', solution_dict=True)
--        ...
--        [{x: -log(2)/(log(3) - log(2))}]
-+        ...[{x: -log(2)/(log(3) - log(2))}]
- 
-         sage: f = (sin(x) - 8*cos(x)*sin(x))*(sin(x)^2 + cos(x)) - (2*cos(x)*sin(x) - sin(x))*(-2*sin(x)^2 + 2*cos(x)^2 - cos(x))
-         sage: solve(f, x, algorithm='giac')
--        ...
--        [-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-+        ...[-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-         sage: solve(f, x, algorithm='giac', solution_dict=True)
--        ...
--        [{x: -2*arctan(sqrt(2))}, {x: 0}, {x: 2*arctan(sqrt(2))}, {x: pi}]
-+        ...[{x: -2*arctan(sqrt(2))}, {x: 0}, {x: 2*arctan(sqrt(2))}, {x: pi}]
- 
-         sage: x, y = SR.var('x,y')
-         sage: solve([x+y-7,x*y-10],[x,y],algorithm='giac')
diff --git a/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch b/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
deleted file mode 100644
index 499e0c71e256..000000000000
--- a/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
+++ /dev/null
@@ -1,1303 +0,0 @@
-diff --git a/build/pkgs/gap/checksums.ini b/build/pkgs/gap/checksums.ini
-index 066e943308a..b0ea8ba8818 100644
---- a/build/pkgs/gap/checksums.ini
-+++ b/build/pkgs/gap/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=gap-VERSION.tar.gz
--sha1=4ecdd281b8f430282fb9b12690b06e0a26abde10
--md5=85dc9e459d5b6c66fcad9f468afd3e3e
--cksum=1351843158
-+sha1=a6e36f3f874a2c46f51561402634497eab705cca
-+md5=c5cd9f272f2703d7a3649ad7193b2d90
-+cksum=2760477284
- upstream_url=https://github.com/gap-system/gap/releases/download/vVERSION/gap-VERSION.tar.gz
-diff --git a/build/pkgs/gap/package-version.txt b/build/pkgs/gap/package-version.txt
-index d782fca8f64..f1cd7de1de5 100644
---- a/build/pkgs/gap/package-version.txt
-+++ b/build/pkgs/gap/package-version.txt
-@@ -1 +1 @@
--4.11.1
-+4.12.2
-diff --git a/build/pkgs/gap/spkg-check.in b/build/pkgs/gap/spkg-check.in
-index d9791d33293..d2fccda6e04 100644
---- a/build/pkgs/gap/spkg-check.in
-+++ b/build/pkgs/gap/spkg-check.in
-@@ -3,6 +3,13 @@ cd src
- # #28728: Fix test failure in tst/testinstall/strings.tst
- export LC_CTYPE=en_US.UTF-8
- 
-+# #34391: in GAP 4.12 some packages need GAP package io
-+#         to let tests run, otherwise this hangs. Thus we install io here.
-+cd pkg/io
-+./configure --with-gaproot=../..
-+make
-+cd ../..
-+
- make testinstall
- if [[ $? -ne 0 ]]; then
-     exit 1
-diff --git a/build/pkgs/gap/spkg-install.in b/build/pkgs/gap/spkg-install.in
-index 2ceadf99db4..e2c8b4dca54 100644
---- a/build/pkgs/gap/spkg-install.in
-+++ b/build/pkgs/gap/spkg-install.in
-@@ -8,8 +8,7 @@ export CFLAGS=$CFLAGS_NON_NATIVE
- export CXXFLAGS=$CXXFLAGS_NON_NATIVE
- 
- GAP_BUILD_ROOT="$(pwd)"
--GAP_ROOT="$SAGE_LOCAL/share/gap"
--DESTDIR_GAP_ROOT="$SAGE_DESTDIR$GAP_ROOT"
-+GAP_ROOT="$SAGE_LOCAL/lib/gap"
- 
- # Enable debug info if requested.
- # Note that -g3 allows you to use preprocessor macros in gdb which are widely used
-@@ -17,37 +16,17 @@ if [ "$SAGE_DEBUG" = yes ] ; then
-     export CFLAGS="-O0 -g3 -DDEBUG_MASTERPOINTERS -DDEBUG_GLOBAL_BAGS -DDEBUG_FUNCTIONS_BAGS $CFLAGS"
- fi
- 
--sdh_configure $SAGE_CONFIGURE_GMP
--sdh_make -j1
-+# LDFLAGS hack below needed by Semigroups package
-+sdh_configure $SAGE_CONFIGURE_GMP LDFLAGS="-pthread" --prefix=$SAGE_LOCAL
-+sdh_make
- 
--# GAP's "make install" is work in progress; we use bits and pieces of it
--# but we install many things manually.
--sdh_make install-headers install-libgap
--
--# Install config.h, which is not currently handled by `make install-headers`
--sdh_install gen/config.h "$SAGE_LOCAL/include/gap"
--
--# Now install the gap executable as "gap-bin"; it will be called normally
--# through our wrapper script that sets the appropriate GAP_ROOT
--SAGE_BIN="$SAGE_LOCAL/bin"
--mkdir -p "$SAGE_DESTDIR$SAGE_BIN" || sdh_die "Failed to create the directory $SAGE_BIN"
--
--./libtool --mode=install install gap "$SAGE_DESTDIR$SAGE_BIN/gap-bin" || \
--    sdh_die "Failed to install gap-bin to $SAGE_BIN"
--
--./libtool --mode=install install gac "$SAGE_DESTDIR$SAGE_BIN/gac" || \
--    sdh_die "Failed to install gac to $SAGE_BIN"
--
--# Now copy additional files GAP needs to run (and a few optional bits) into
--# GAP_ROOT; we don't need everything from the source tree
--sdh_install bin doc gen grp lib src tst sysinfo.gap "$GAP_ROOT"
--
--# GAP's copy of libtool is also used by the toolchain for build GAP packages
--# (i.e. by gac)
--sdh_install libtool "$GAP_ROOT"
-+sdh_make_install
-+# sdh_make install-headers install-libgap
-+# The 'packagemanager' package expects this https://github.com/gap-packages/PackageManager/issues/105
-+mkdir -p "$SAGE_LOCAL/lib/gap/bin"
- 
- # Install only the minimal packages GAP needs to run
--sdh_install pkg/GAPDoc-* pkg/primgrp-* pkg/SmallGrp-* pkg/transgrp "$GAP_ROOT"/pkg
-+sdh_install pkg/gapdoc pkg/primgrp pkg/smallgrp pkg/transgrp "$GAP_ROOT"/pkg
- 
- # Install additional packages that are not strictly required, but that are
- # typically "expected" to be loaded: These are the default packages that are
-@@ -58,50 +37,25 @@ sdh_install pkg/GAPDoc-* pkg/primgrp-* pkg/SmallGrp-* pkg/transgrp "$GAP_ROOT"/p
- # Also include atlasrep which is a dependency of tomlib
- sdh_install \
-     pkg/atlasrep \
--    pkg/autpgrp-* \
--    pkg/alnuth-* \
--    pkg/crisp-* \
--    pkg/ctbllib-* \
--    pkg/FactInt-* \
-+    pkg/autodoc \
-+    pkg/autpgrp \
-+    pkg/alnuth \
-+    pkg/crisp \
-+    pkg/ctbllib \
-+    pkg/factint \
-     pkg/fga \
--    pkg/irredsol-* \
--    pkg/laguna-* \
--    pkg/PackageManager-* \
--    pkg/polenta-* \
--    pkg/polycyclic-* \
--    pkg/resclasses-* \
--    pkg/sophus-* \
--    pkg/tomlib-* \
-+    pkg/irredsol \
-+    pkg/laguna \
-+    pkg/packagemanager \
-+    pkg/polenta \
-+    pkg/polycyclic \
-+    pkg/radiroot \
-+    pkg/resclasses \
-+    pkg/sophus \
-+    pkg/tomlib \
-+    pkg/utils \
-     "$GAP_ROOT"/pkg
- 
--# Install the GAP startup script; ensure it is executable
--sdh_install -T ../gap "$SAGE_BIN/gap"
--chmod +x "$SAGE_DESTDIR$SAGE_BIN/gap"
--
--# Create symlinks under $GAP_ROOT for these executables, as they are expected
--# (especially when building kernel packages) to exist
--ln -sf "../../bin/gap-bin" "$DESTDIR_GAP_ROOT/gap"
--ln -sf "../../bin/gac" "$DESTDIR_GAP_ROOT/gac"
--
--# Fix the $GAP_ROOT/bin/<arch>/src symlink to be relative (otherwise it links
--# to the actual path of the sources GAP was compiled from)
--for srclink in "$DESTDIR_GAP_ROOT"/bin/*/src; do
--    rm -f "$srclink"
--    ln -s "../../src" "$srclink"
--done
--
--# Additional fixups for some files after they have been copied into their
--# destination directory.  gac and sysinfo.gap are generated files that contain
--# in them hard-coded references to the GAP build directory, which will soon
--# be going away.  This breaks the build toolchain for some compiled GAP
--# packages.  We need to replace these paths with the final GAP_ROOT path.  The
--# below will work so long as neither of these paths contain '|', and if they do
--# then god help you.  https://trac.sagemath.org/ticket/27218
--sed -i -e "s|$GAP_BUILD_ROOT|$GAP_ROOT|g" \
--    "$SAGE_DESTDIR$SAGE_BIN/gac" "$DESTDIR_GAP_ROOT/sysinfo.gap" \
--    "$DESTDIR_GAP_ROOT/bin/gap.sh" "$DESTDIR_GAP_ROOT/doc/make_doc" || \
--    sdh_die "Failed to fix up hard-coded paths in GAP build tools."
--
- # TODO: This seems unnecessary--we are already installing all of doc/ to
- # GAP_ROOT, which is necessary for some functionality in GAP to work.  Do
- # we need this?  Maybe doc/gap could just be a symlink to gap/doc??
-diff --git a/build/pkgs/gap/spkg-legacy-uninstall b/build/pkgs/gap/spkg-legacy-uninstall
-index d17eb939eb7..a8e5c59e1fb 100755
---- a/build/pkgs/gap/spkg-legacy-uninstall
-+++ b/build/pkgs/gap/spkg-legacy-uninstall
-@@ -4,6 +4,8 @@ rm -rf "$SAGE_LOCAL/gap/gap-4."*
- rm -rf "$SAGE_SHARE/gap"
- rm -f "$SAGE_LOCAL/gap/latest"
- rm -f "$SAGE_LOCAL/bin/gap"
-+rm -f "$SAGE_LOCAL/bin/gac"
- 
--# Remove old libgap headers
-+# Remove old libgap headers and library
- rm -rf "$SAGE_LOCAL/include/gap"
-+rm -rf "$SAGE_LOCAL/lib/gap"
-diff --git a/build/pkgs/gap/spkg-prerm.in b/build/pkgs/gap/spkg-prerm.in
-deleted file mode 100644
-index 661d92621fa..00000000000
---- a/build/pkgs/gap/spkg-prerm.in
-+++ /dev/null
-@@ -1,6 +0,0 @@
--# These generated files are placed in directory provided by the SPKG, so
--# delete the generated files first so that their parent directories can be
--# removed during installation
--GAP_ROOT="$SAGE_LOCAL/share/gap"
--rm -f "$GAP_ROOT/pkg/atlasrep/datagens/"*.*
--rm -f "$GAP_ROOT/pkg/atlasrep/dataword/"*.*
-diff --git a/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch b/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch
-deleted file mode 100644
-index e45fe7d9c6f..00000000000
---- a/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch
-+++ /dev/null
-@@ -1,150 +0,0 @@
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c b/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--index 3bbdc45..7df699f 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--@@ -8,9 +8,8 @@ extern short sp[],**mat[],*psp[],**imcos[],**cpco[],lorb[],
-- short *cst,**cpst,***cdpst,**svptr,*cp,*rel;
-- short *spst,**pspst,**pptr,**cpptr,npt,nb,nph,nph2,npg,npg2,
--       rno,orno,coh_index,*invg;
---FILE  *ip,*op;
-- 
---void seeknln (void) { while (getc(ip)!='\n'); }
--+void seeknln (FILE *ip) { while (getc(ip)!='\n'); }
-- 
-- /* This program differs from most other permutation programs in that perms are
--    all stored in the single array sp. Schreier vectors are stored in the short
--@@ -23,13 +22,14 @@ void seeknln (void) { while (getc(ip)!='\n'); }
-- int 
-- crprog1 (void)
-- { short *pc,*qc,ex,neg; int x;
--+  FILE  *ip,*op;
--   short i,j,k,l,m,n,cl,rl,*p,ocl,im,pt,pt1,pn,ipt;
--   if ((ip=fopen(inf2,"r"))== 0)
--   { fprintf(stderr,"Cannot open %s.\n",inf2); return(-1);}
--   fscanf(ip,"%hd%hd%hd%hd",&npt,&nph,&nb,&k);
--   if (nb>=mb) {fprintf(stderr,"nb too big. Increase MB.\n"); return(-1);}
--   if (k<=2) {fprintf(stderr,"inf2 has illegal format.\n"); return(-1); }
---  seeknln(); seeknln();
--+  seeknln(ip); seeknln(ip);
--   for (i=1;i<=nb;i++) fscanf(ip,"%hd",lorb+i);
--   pptr=psp-1; pspst=psp+nph; svptr=cpsp-1;  cpst=cpsp+nb;
--   invg=sp; nph2=2*nph; spst=sp+nph2;
--@@ -37,7 +37,7 @@ crprog1 (void)
--   { pptr[i]=spst+(i-1)*npt-1; p=pptr[i];
--     for (j=1;j<=npt;j++) {fscanf(ip,"%hd",&k); p[k]=j; }
--     invg[2*i-2]=2*i-1; invg[2*i-1]=2*i-2;
---    seeknln();
--+    seeknln(ip);
--   }
--   spst+=(npt*nph);
--   for (i=1;i<=nb;i++)
--@@ -75,7 +75,7 @@ crprog1 (void)
--   strcpy(inf1,inf0); strcat(inf1,".rel");
--   if ((ip=fopen(inf1,"r"))==0)
--   { fprintf(stderr,"Cannot open %s.\n",inf1); return(-1);}
---  fscanf(ip,"%hd%hd",&k,&rno); seeknln();
--+  fscanf(ip,"%hd%hd",&k,&rno); seeknln(ip);
--   op=fopen(outft,"w");
-- /* Now we have read everything in, and the computation can start */
--   orno=0;
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--index a7396b2..658496f 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--@@ -20,8 +20,6 @@ short  mexp=MEXP,mcl=MCL,no,rel[RSP],wt[MEXP],exp,*rpf,*rpb,
-- extern short  prime,dim,*spv,**spm,mspace[],*vec[],**mat[],cp[],pinv[],opmats,
--         mm,mv;
-- extern int msp;
---FILE *ip,*op;
---
-- 
-- int 
-- calcmats (void)
--@@ -59,7 +57,7 @@ calcmats (void)
--   }
--   for (i=1;i<=exp;i++) trans(mat[i+exp],mat[i]);
--   if (opmats)
---  { op=fopen(outf,"w");
--+  { FILE *op=fopen(outf,"w");
--     fprintf(op,"%4d%4d%4d\n",prime,dim,exp);
--     for (i=1;i<=exp;i++) printmat(mat[i]); 
--     fclose(op);
--@@ -71,6 +69,7 @@ int
-- rdmats (void)
-- /* reads matrices of generators of P */
-- { short i; int quot;
--+  FILE *ip;
--   ip=fopen(inf4,"r");
--   if (ip==0)
--   { fprintf(stderr,"Cannot open %s\n ",inf4); return(-1); }
--@@ -90,12 +89,12 @@ rdmats (void)
--   fclose(ip);
--   return(0);
-- }
---FILE *ip;
-- 
-- int 
-- ingp (int inp)
-- /* Read in output of respcrun -s */
-- { short i,j,k,l,m,*orpf,**pcp;
--+  FILE *ip;
--   ip=fopen(inf3,"r");
--   if (ip==0) { fprintf(stderr,"Cannot open %s\n",inf3); return(-1); }
--   fscanf(ip,"%hd%hd%hd%hd%hd%hd",&prime,&exp,&i,&no,&j,&m);
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--index 0896551..6841bc8 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--@@ -9,7 +9,6 @@ extern short  intexp,mexp,mng,wksp,
--        spugen[],*tlintg[];
-- extern int ptrsp,rsp;
-- short  fac;
---FILE *ip,*op;
-- 
-- int 
-- ingp (void)
--@@ -18,6 +17,7 @@ ingp (void)
--    of nqrun, and tails are also read in.
-- */
-- { short i,j,k,l,m,x,y,no,*orpf,*orpb,**pcp;  char tails;
--+  FILE *ip;
--   if ((ip=fopen(inf1,"r"))==0)
--   { fprintf(stderr,"Cannot open %s.\n",inf1); return(-1); }
--   fscanf(ip,"%hd%hd%hd%hd%hd%hd",&prime,&exp,&nng,&no,&class,&m);
--@@ -89,6 +89,7 @@ int
-- outgp (void)
-- /* The PCP is output, together with tails */
-- { short i,k,l,**pcp,*b,*e,*c;
--+  FILE *op;
--   op=fopen(outf,"w");
--   fprintf(op,"%4d%4d%4d%4d%4d%4d\n",prime,exp,nng,exp,class,1);
--   for (i=1;i<=exp;i++) fprintf(op,"%4d",wt[i]); fprintf(op,"\n");
--@@ -379,7 +380,7 @@ restart:
--     nng--; mnng--; enexpnt--;
--     if (nng==0)
--     { if (gap)
---      { op=fopen(outfm,"w"); fprintf(op,"COHOMOLO.Multiplier:=[];\n");
--+      { FILE *op=fopen(outfm,"w"); fprintf(op,"COHOMOLO.Multiplier:=[];\n");
--         fclose(op);
--         printf("All new generators eliminated. Multiplier is trivial.\n");
--       }
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--index 01cf914..0144883 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--@@ -9,7 +9,6 @@ extern short  intexp,mng,mexp,wksp,
--        spugen[],*intg[],*imintg[],*tlintg[];
-- extern int ptrsp,rsp;
-- short  *wf,*wc; char norm;
---FILE *ip,*op;
-- 
-- /* The data structures for this program and for nqrun are similar.
--    d1 and d2 contain definitions of generators. (Def. comes from commutator
--@@ -35,6 +34,7 @@ nqmprog (void)
-- { short i,j,k,l,m,d,*gi,*gj,*ti,*tj,cl,def,*ps,*pf,**dp,*nrpb,*p,*orpf,*orpb,
--         nb,np,k1,*rno,*covrel,**pgen,tdef,sgn;
--   char nt;
--+  FILE *ip,*op;
--   if (ingp() == -1) {fprintf(stderr,"Input error.\n"); return(-1); }
--   eexpnt=expnt+exp; enexpnt=nexpnt+nng;
-- 
-diff --git a/build/pkgs/gap_packages/patches/guava_leon_includes.patch b/build/pkgs/gap_packages/patches/guava_leon_includes.patch
-deleted file mode 100644
-index cdcd19cc3e8..00000000000
---- a/build/pkgs/gap_packages/patches/guava_leon_includes.patch
-+++ /dev/null
-@@ -1,13 +0,0 @@
----- a/pkg/guava-3.15/src/leon/src/generate.c	Sat Feb 29 09:02:10 2020
----- b/pkg/guava-3.15/src/leon/src/generate.c	Thu Sep 24 13:58:36 2020
--***************
--*** 115,120 ****
----- 115,122 ----
--  #include "groupio.h"
--  #include "enum.h"
--  #include "storage.h"
--+ #include "chbase.h"
--+ #include "inform.h"
--  
--  #ifdef ALT_TIME_HEADER
--  #include "cputime.h"
-diff --git a/build/pkgs/gap_packages/spkg-install.in b/build/pkgs/gap_packages/spkg-install.in
-index 168e6b11532..6dff182a48f 100644
---- a/build/pkgs/gap_packages/spkg-install.in
-+++ b/build/pkgs/gap_packages/spkg-install.in
-@@ -1,4 +1,4 @@
--GAP_ROOT="$SAGE_LOCAL/share/gap"
-+GAP_ROOT="$SAGE_LOCAL/lib/gap"
- PKG_DIR="$GAP_ROOT/pkg"
- 
- PKG_SRC_DIR="$(pwd)/src/pkg"
-@@ -11,33 +11,31 @@ cd "$PKG_SRC_DIR"
- #    (GAP 4.8.6 still had it, but this is gone in 4.10)
- 
- sdh_install \
--    aclib-* \
--    AutoDoc-* \
--    corelg-* \
--    crime-* \
-+    aclib \
-+    corelg \
-+    crime \
-     cryst \
-     crystcat \
--    design-* \
-+    design \
-     gbnp \
--    genss-* \
--    hap-* \
--    hapcryst-* \
--    hecke-* \
--    images-* \
--    liealgdb-* \
--    liepring-* \
--    liering-* \
--    loops-* \
--    MapClass-* \
--    polymaking-* \
--    qpa-* \
--    quagroup-* \
--    radiroot-* \
--    repsn-* \
--    sla-* \
--    sonata-* \
--    Toric-* \
--    utils-* \
-+    genss \
-+    hap \
-+    hapcryst \
-+    hecke \
-+    images \
-+    liealgdb \
-+    liepring \
-+    liering \
-+    loops \
-+    mapclass \
-+    polymaking \
-+    qpa \
-+    quagroup \
-+    repsn \
-+    singular \
-+    sla \
-+    sonata \
-+    toric \
-     "$PKG_DIR"
- 
- install_compiled_pkg()
-@@ -45,27 +43,23 @@ install_compiled_pkg()
-     local pkg="$1"
-     # Install the bin/ dir (where compiled modules should end up)
-     # under <prefix>/lib/gap; we then symlink to it later
--    sdh_install bin "$SAGE_LOCAL/lib/gap/pkg/$pkg"
-+    sdh_install * "$SAGE_LOCAL/lib/gap/pkg/$pkg"
- 
-+    # TODO:
-     # Clean up any build artificts before installing the rest of the package
-     # Also remove configure/Makefiles
-     # Note: None, if any of the packages really have a proper install target
--    make clean  # Works for some packages but not all
--    rm -rf bin/
--    rm -rf configure configure.* config.* autogen.sh *.m4 Makefile* m4/
-+    #make clean  # Works for some packages but not all
-+    #rm -rf bin/
-+    #rm -rf configure configure.* config.* autogen.sh *.m4 Makefile* m4/
- 
--    # Create the bin/ symlink
--    ln -s "$SAGE_LOCAL/lib/gap/pkg/$pkg/bin" bin
--
--    # Install the rest of the package files
--    sdh_install * "$PKG_DIR/$pkg"
- }
- 
- # Build and install compiled packages:
- #
- # These packages have an old ./configure that take the GAP_ROOT as a positional
- # argument
--for pkg in cohomolo-* crypting-* grape-* guava-* orb-* datastructures-*
-+for pkg in cohomolo crypting grape guava orb datastructures
- do
-     echo "Building GAP package $pkg"
-     CFLAGS="$CFLAGS -Wno-implicit-function-declaration"
-@@ -91,7 +85,7 @@ pararr=( " " " " "--with-external-planarity" "--with-external-libsemigroups" )
- ##############################################################################
- 
- parind=0
--for pkg in nq-* io-* digraphs-* semigroups-*
-+for pkg in nq io digraphs semigroups
- do
-     echo "Building GAP package $pkg"
-     cd "$PKG_SRC_DIR/$pkg"
-diff --git a/build/pkgs/libsemigroups/checksums.ini b/build/pkgs/libsemigroups/checksums.ini
-index 62c4268515f..4e13a36cb35 100644
---- a/build/pkgs/libsemigroups/checksums.ini
-+++ b/build/pkgs/libsemigroups/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=libsemigroups-VERSION.tar.gz
--sha1=2b16c095cc5ffd3f77a71dfbf48cce188e054c03
--md5=7082cadcf7a195ccb93175cd72b6db95
--cksum=1501022358
-+sha1=86375824b47ce4b0e23570122e873f67136d0c0a
-+md5=ff79ad5fbc8bfeb64d48faaf24106b98
-+cksum=2845045455
- upstream_url=https://github.com/libsemigroups/libsemigroups/releases/download/vVERSION/libsemigroups-VERSION.tar.gz
-diff --git a/build/pkgs/libsemigroups/package-version.txt b/build/pkgs/libsemigroups/package-version.txt
-index 9084fa2f716..f90b1afc082 100644
---- a/build/pkgs/libsemigroups/package-version.txt
-+++ b/build/pkgs/libsemigroups/package-version.txt
-@@ -1 +1 @@
--1.1.0
-+2.3.2
-diff --git a/build/pkgs/libsemigroups/spkg-install.in b/build/pkgs/libsemigroups/spkg-install.in
-index 2aaf0e99043..128b54d2f99 100644
---- a/build/pkgs/libsemigroups/spkg-install.in
-+++ b/build/pkgs/libsemigroups/spkg-install.in
-@@ -1,4 +1,4 @@
- cd src
--sdh_configure
-+sdh_configure --disable-eigen
- sdh_make
- sdh_make_install
-diff --git a/build/pkgs/singular/spkg-configure.m4 b/build/pkgs/singular/spkg-configure.m4
-index d4d145defe3..6a85631f624 100644
---- a/build/pkgs/singular/spkg-configure.m4
-+++ b/build/pkgs/singular/spkg-configure.m4
-@@ -9,52 +9,7 @@ SAGE_SPKG_CONFIGURE([singular], [
-        AC_MSG_CHECKING([that Singular's help is working])
-        AS_IF([test x`printf "system(\"--browser\", \"builtin\"); \n help;" | Singular 2>&1 | grep "error occurred"` = x], [
-         AC_MSG_RESULT(yes)
--        dnl We have Singular. Now determine the shared library path on
--        dnl platforms on which sage.libs.singular needs to reload the library with RTLD_GLOBAL.
--        AS_CASE([$host_os],
--          [cygwin*], [dnl Nothing to do
--                     ],
--                     [dnl Use pkg-config to get singular's libdir while we're at it. As a
--                      dnl moral compromise for using pkg-config, this ultimately allows us
--                      dnl to pass an absolute path to dlopen(), which is the only approach
--                      dnl that POSIX guarantees will work.
--                      PKG_CHECK_VAR([SINGULAR_LIB_DIR], [Singular], [libdir])
--                      dnl The acl_shlibext variable is set in the top-level configure.ac.
--                      AC_LANG_PUSH(C)
--                      ORIG_LIBS="${LIBS}"
--                      LIBS="${LIBS} -ldl"
--                      AC_MSG_CHECKING([if we can dlopen($LIBSINGULAR_PATH)])
--                      LIBSINGULAR_PATH="${SINGULAR_LIB_DIR}/libSingular.${acl_shlibext}"
--
--                      dnl if we can dlopen() it, substitute the name for sage_conf;
--                      dnl otherwise, fall back to using the SPKG.
--                      AC_RUN_IFELSE(
--                        [AC_LANG_PROGRAM(
--                          [[#include <dlfcn.h>]],
--                          [[void* h = dlopen("${LIBSINGULAR_PATH}", RTLD_LAZY | RTLD_GLOBAL);
--                            if (h == 0) { return 1; } else { return dlclose(h); }]]
--                        )], [
--                          AC_MSG_RESULT(yes)
--                        ], [
--                          dnl try Debian-specific name
--                          LIBSINGULAR_PATH="${SINGULAR_LIB_DIR}/libsingular-Singular.${acl_shlibext}"
--                          AC_RUN_IFELSE(
--                           [AC_LANG_PROGRAM(
--                             [[#include <dlfcn.h>]],
--                             [[void* h = dlopen("${LIBSINGULAR_PATH}", RTLD_LAZY | RTLD_GLOBAL);
--                               if (h == 0) { return 1; } else { return dlclose(h); }]]
--                           )], [
--                             AC_MSG_RESULT(yes)
--                           ], [
--                            AC_MSG_RESULT(no)
--                            sage_spkg_install_singular=yes
--                          ], [AC_MSG_RESULT(yes)])
--                        ], [AC_MSG_RESULT(yes)])
--
--                      AC_LANG_POP()
--                      LIBS="${ORIG_LIBS}"
--                     ]
--       )], [
-+       ], [
-        AC_MSG_RESULT(no)
-        sage_spkg_install_singular=yes
-        ]
-@@ -64,20 +19,4 @@ SAGE_SPKG_CONFIGURE([singular], [
-       ])
-     ])
-   ])
--],[],[],[
--  dnl Post-check phase
--  dnl We make the sage_conf substitutions here, because the "default"
--  dnl substitution needs to be made even if we skipped the system-Singular
--  dnl checks themselves.
--  AS_IF([test "x${sage_spkg_install_singular}" = "xyes"], [
--    AS_CASE([$host_os],
--      [cygwin*], [dnl Nothing to do
--                 ],
--                 [dnl Set shared library path, needed for reloading the library with RTLD_GLOBAL
--                  LIBSINGULAR_PATH="\$SAGE_LOCAL/lib/libSingular.${acl_shlibext}"
--                 ]
--    )
--  ])
--
--  AC_SUBST(LIBSINGULAR_PATH, "${LIBSINGULAR_PATH}")
- ])
-diff --git a/pkgs/sage-conf/_sage_conf/_conf.py.in b/pkgs/sage-conf/_sage_conf/_conf.py.in
-index 6cd28f558a8..d66bdb3d264 100644
---- a/pkgs/sage-conf/_sage_conf/_conf.py.in
-+++ b/pkgs/sage-conf/_sage_conf/_conf.py.in
-@@ -55,9 +55,6 @@ THREEJS_DIR = SAGE_LOCAL + "/share/threejs-sage"
- OPENMP_CFLAGS = "@OPENMP_CFLAGS@"
- OPENMP_CXXFLAGS = "@OPENMP_CXXFLAGS@"
- 
--# The full absolute path to the main Singular library.
--LIBSINGULAR_PATH = "@LIBSINGULAR_PATH@".replace('$SAGE_LOCAL', SAGE_LOCAL)
--
- # Installation location of wheels. This is determined at configuration time
- # and does not depend on the installation location of sage-conf.
- SAGE_SPKG_WHEELS = "@SAGE_VENV@".replace('${SAGE_LOCAL}', SAGE_LOCAL) + "/var/lib/sage/wheels"
-diff --git a/src/doc/en/thematic_tutorials/lie/weyl_groups.rst b/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-index c917338e444..182e74aad20 100644
---- a/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-+++ b/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-@@ -139,12 +139,12 @@ string, which you can print::
-     X.1      1  1  1  1  1  1  1  1  1  1  1  1  1
-     X.2      1 -1  1  1 -1  1  1 -1 -1 -1  1  1  1
-     X.3      2  .  2 -1  .  2  2  .  .  . -1  2  2
--    X.4      3 -1 -1  .  1 -1  3 -1  1 -1  . -1  3
--    X.5      3 -1 -1  .  1  3 -1 -1 -1  1  . -1  3
--    X.6      3  1 -1  . -1 -1  3  1 -1  1  . -1  3
--    X.7      3  1 -1  . -1  3 -1  1  1 -1  . -1  3
--    X.8      3 -1  3  . -1 -1 -1 -1  1  1  . -1  3
--    X.9      3  1  3  .  1 -1 -1  1 -1 -1  . -1  3
-+    X.4      3 -1 -1  .  1  3 -1 -1 -1  1  . -1  3
-+    X.5      3  1 -1  . -1  3 -1  1  1 -1  . -1  3
-+    X.6      3 -1  3  . -1 -1 -1 -1  1  1  . -1  3
-+    X.7      3 -1 -1  .  1 -1  3 -1  1 -1  . -1  3
-+    X.8      3  1  3  .  1 -1 -1  1 -1 -1  . -1  3
-+    X.9      3  1 -1  . -1 -1  3  1 -1  1  . -1  3
-     X.10     4 -2  . -1  .  .  .  2  .  .  1  . -4
-     X.11     4  2  . -1  .  .  . -2  .  .  1  . -4
-     X.12     6  . -2  .  . -2 -2  .  .  .  .  2  6
-diff --git a/src/sage/coding/codecan/autgroup_can_label.pyx b/src/sage/coding/codecan/autgroup_can_label.pyx
-index de5db985e0b..c83b9264e44 100644
---- a/src/sage/coding/codecan/autgroup_can_label.pyx
-+++ b/src/sage/coding/codecan/autgroup_can_label.pyx
-@@ -76,7 +76,7 @@ columns do share the same coloring::
-     ((1,),
-      (2,),
-      (3, 5, 4),
--     (6, 19, 16, 9, 21, 10, 8, 15, 14, 11, 20, 13, 12, 7, 17, 18))
-+     (6, 19, 16, 21, 9, 10, 15, 8, 20, 11, 14, 13, 7, 12, 18, 17))
- 
- We can also restrict the group action to linear isometries::
- 
-diff --git a/src/sage/coding/linear_code.py b/src/sage/coding/linear_code.py
-index a3ac3ca1547..bfb9f8696e8 100644
---- a/src/sage/coding/linear_code.py
-+++ b/src/sage/coding/linear_code.py
-@@ -465,27 +465,27 @@ def automorphism_group_gens(self, equivalence="semilinear"):
-             0
-             sage: C = codes.HammingCode(GF(4, 'z'), 3)
-             sage: C.automorphism_group_gens()
--            ([((1, 1, 1, 1, 1, z + 1, z, z + 1, z, z, z, 1, 1, z + 1, z + 1, z, z + 1, z, z + 1, z + 1, z + 1); (1,14,6,7,4,10,11,19)(2,8,16,13,3,17,21,15)(9,12,18,20), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((1, 1, 1, z, z + 1, 1, 1, 1, 1, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z); (1,13,14,20)(2,21,8,18,7,16,19,15)(3,10,5,12,17,9,6,4), Ring endomorphism of Finite Field in z of size 2^2
-+                Defn: z |--> z + 1),
-+              ((z, 1, z, z, z, z + 1, z, z, z, z, z, z, z + 1, z, z, z, z, z + 1, z, z, z); (1,11,5,12,3,19)(2,8)(6,18,13)(7,17,15)(9,10,14,16,20,21), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z + 1),
--              ((z + 1, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z + 1, 1, z, z + 1, z + 1, z); (1,18,6,19,2,9,17,10,13,14,21,11,4,5,12)(3,20,7,16,8), Ring endomorphism of Finite Field in z of size 2^2
--                Defn: z |--> z),
-               ((z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z); (), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-              362880)
-             sage: C.automorphism_group_gens(equivalence="linear")
--            ([((z + 1, 1, z + 1, z + 1, z + 1, z, 1, z, 1, 1, 1, 1, z + 1, z + 1, z + 1, z, z, 1, z, z, z); (1,15,2,8,16,18,3)(4,9,12,13,20,10,11)(5,21,14,6,7,19,17), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((z, 1, z + 1, z + 1, 1, z + 1, z, 1, z + 1, z + 1, 1, z, 1, z + 1, z, 1, z, 1, z + 1, 1, 1); (1,12,11,10,6,8,9,20,13,21,5,14,3,16,17,19,7,4,2,15,18), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((z + 1, z + 1, z + 1, z + 1, z + 1, 1, z, 1, z, z, z, 1, z, 1, 1, 1, z + 1, z + 1, z + 1, 1, z); (1,15,21,8,9)(2,18,5,3,11,16,7,10,19,13,12,4,17,6,20), Ring endomorphism of Finite Field in z of size 2^2
-+              ((z + 1, z + 1, z + 1, z, 1, 1, z, z, 1, z + 1, z, 1, 1, z, 1, z + 1, z, z + 1, z + 1, 1, z); (1,3,18,2,17,6,19)(4,15,13,20,7,14,16)(5,11,8,21,12,9,10), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
-               ((z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1); (), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-              181440)
-             sage: C.automorphism_group_gens(equivalence="permutational")
--            ([((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,19)(3,17)(4,21)(5,20)(7,14)(9,12)(10,16)(11,15), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,11)(3,10)(4,9)(5,7)(12,21)(14,20)(15,19)(16,17), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,11)(3,10)(4,9)(5,7)(12,21)(14,20)(15,19)(16,17), Ring endomorphism of Finite Field in z of size 2^2
-+              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (2,18)(3,19)(4,10)(5,16)(8,13)(9,14)(11,21)(15,20), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,17)(2,8)(3,14)(4,10)(7,12)(9,19)(13,18)(15,20), Ring endomorphism of Finite Field in z of size 2^2
-+              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,19)(3,17)(4,21)(5,20)(7,14)(9,12)(10,16)(11,15), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
-               ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (2,13)(3,14)(4,20)(5,11)(8,18)(9,19)(10,15)(16,21), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-@@ -691,10 +691,10 @@ def _canonize(self, equivalence):
-             sage: C_iso == aut_group_can_label.get_canonical_form()
-             True
-             sage: aut_group_can_label.get_autom_gens()
--            [((1, 1, 1, 1, 1, z + 1, z, z + 1, z, z, z, 1, 1, z + 1, z + 1, z, z + 1, z, z + 1, z + 1, z + 1); (1,14,6,7,4,10,11,19)(2,8,16,13,3,17,21,15)(9,12,18,20), Ring endomorphism of Finite Field in z of size 2^2
-+            [((1, 1, 1, z, z + 1, 1, 1, 1, 1, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z); (1,13,14,20)(2,21,8,18,7,16,19,15)(3,10,5,12,17,9,6,4), Ring endomorphism of Finite Field in z of size 2^2
-+               Defn: z |--> z + 1),
-+             ((z, 1, z, z, z, z + 1, z, z, z, z, z, z, z + 1, z, z, z, z, z + 1, z, z, z); (1,11,5,12,3,19)(2,8)(6,18,13)(7,17,15)(9,10,14,16,20,21), Ring endomorphism of Finite Field in z of size 2^2
-                Defn: z |--> z + 1),
--             ((z + 1, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z + 1, 1, z, z + 1, z + 1, z); (1,18,6,19,2,9,17,10,13,14,21,11,4,5,12)(3,20,7,16,8), Ring endomorphism of Finite Field in z of size 2^2
--               Defn: z |--> z),
-              ((z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z); (), Ring endomorphism of Finite Field in z of size 2^2
-                Defn: z |--> z)]
-         """
-diff --git a/src/sage/combinat/posets/posets.py b/src/sage/combinat/posets/posets.py
-index 2836d59d960..8c882d5ac3b 100644
---- a/src/sage/combinat/posets/posets.py
-+++ b/src/sage/combinat/posets/posets.py
-@@ -8813,7 +8813,7 @@ def _libgap_(self):
-             sage: libgap(P)  # optional - gap_packages
-             <A poset on 5 points>
-             sage: A = libgap(GF(2)).PosetAlgebra(P); A  # optional - gap_packages
--            <GF(2)[<quiver with 5 vertices and 5 arrows>]/<two-sided ideal in <GF(2)[<quiver with 5 vertices and 5 arrows>]>, (1 generators)>>
-+            <GF(2)[<quiver with 5 vertices and 5 arrows>]/<two-sided ideal in <GF(2)[<quiver with 5 vertices and 5 arrows>]>, (1 generator)>>
-             sage: A.Dimension()  # optional - gap_packages
-             13
-         """
-diff --git a/src/sage/combinat/root_system/hecke_algebra_representation.py b/src/sage/combinat/root_system/hecke_algebra_representation.py
-index 6b756bafc30..8ac99319bec 100644
---- a/src/sage/combinat/root_system/hecke_algebra_representation.py
-+++ b/src/sage/combinat/root_system/hecke_algebra_representation.py
-@@ -357,7 +357,7 @@ def Tw(self, word, signs=None, scalar=None):
-             sage: q1, q2 = K.gens()
-             sage: KW = W.algebra(K)
-             sage: x = KW.an_element(); x
--            123 + 3*32 + 2*3 + e
-+            123 + 3*2312 + 2*31 + e
- 
-             sage: T = KW.demazure_lusztig_operators(q1,q2)
-             sage: T12 = T.Tw( (1,2) )
-diff --git a/src/sage/combinat/symmetric_group_algebra.py b/src/sage/combinat/symmetric_group_algebra.py
-index b8a0bebab44..9bccba124c8 100644
---- a/src/sage/combinat/symmetric_group_algebra.py
-+++ b/src/sage/combinat/symmetric_group_algebra.py
-@@ -101,7 +101,7 @@ def SymmetricGroupAlgebra(R, W, category=None):
-         sage: SGA.group()
-         Weyl Group of type ['A', 3] (as a matrix group acting on the ambient space)
-         sage: SGA.an_element()
--        s1*s2*s3 + 3*s3*s2 + 2*s3 + 1
-+        s1*s2*s3 + 3*s2*s3*s1*s2 + 2*s3*s1 + 1
- 
-     The preferred way to construct the symmetric group algebra is to
-     go through the usual ``algebra`` method::
-diff --git a/src/sage/env.py b/src/sage/env.py
-index 911f34b1bc6..5f7aca8599c 100644
---- a/src/sage/env.py
-+++ b/src/sage/env.py
-@@ -197,7 +197,8 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- GRAPHS_DATA_DIR = var("GRAPHS_DATA_DIR", join(SAGE_SHARE, "graphs"))
- ELLCURVE_DATA_DIR = var("ELLCURVE_DATA_DIR", join(SAGE_SHARE, "ellcurves"))
- POLYTOPE_DATA_DIR = var("POLYTOPE_DATA_DIR", join(SAGE_SHARE, "reflexive_polytopes"))
--GAP_ROOT_DIR = var("GAP_ROOT_DIR", join(SAGE_SHARE, "gap"))
-+GAP_LIB_DIR = var("GAP_LIB_DIR", join(SAGE_LOCAL, "lib", "gap"))
-+GAP_SHARE_DIR = var("GAP_SHARE_DIR", join(SAGE_SHARE, "gap"))
- THEBE_DIR = var("THEBE_DIR", join(SAGE_SHARE, "thebe"))
- COMBINATORIAL_DESIGN_DATA_DIR = var("COMBINATORIAL_DESIGN_DATA_DIR", join(SAGE_SHARE, "combinatorial_designs"))
- CREMONA_MINI_DATA_DIR = var("CREMONA_MINI_DATA_DIR", join(SAGE_SHARE, "cremona"))
-@@ -229,12 +230,6 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- LIE_INFO_DIR = var("LIE_INFO_DIR", join(SAGE_LOCAL, "lib", "LiE"))
- SINGULAR_BIN = var("SINGULAR_BIN") or "Singular"
- 
--# The path to libSingular, to be passed to dlopen(). This will
--# typically be set to an absolute path in sage_conf, but the relative
--# fallback path here works on systems where dlopen() searches the
--# system's library locations.
--LIBSINGULAR_PATH = var("LIBSINGULAR_PATH", "libSingular.so")
--
- # OpenMP
- OPENMP_CFLAGS = var("OPENMP_CFLAGS", "")
- OPENMP_CXXFLAGS = var("OPENMP_CXXFLAGS", "")
-@@ -255,81 +250,6 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- SAGE_GAP_COMMAND = var('SAGE_GAP_COMMAND', _gap_cmd)
- 
- 
--def _get_shared_lib_path(*libnames: str) -> Optional[str]:
--    """
--    Return the full path to a shared library file installed in
--    ``$SAGE_LOCAL/lib`` or the directories associated with the
--    Python sysconfig.
--
--    This can also be passed more than one library name (e.g. for cases where
--    some library may have multiple names depending on the platform) in which
--    case the first one found is returned.
--
--    This supports most *NIX variants (in which ``lib<libname>.so`` is found
--    under ``$SAGE_LOCAL/lib``), macOS (same, but with the ``.dylib``
--    extension), and Cygwin (under ``$SAGE_LOCAL/bin/cyg<libname>.dll``,
--    or ``$SAGE_LOCAL/bin/cyg<libname>-*.dll`` for versioned DLLs).
--
--    For distributions like Debian that use a multiarch layout, we also try the
--    multiarch lib paths (i.e. ``/usr/lib/<arch>/``).
--
--    This returns ``None`` if no matching library file could be found.
--
--    EXAMPLES::
--
--        sage: from sage.env import _get_shared_lib_path
--        sage: "gap" in _get_shared_lib_path("gap")
--        True
--        sage: _get_shared_lib_path("an_absurd_lib") is None
--        True
--
--    """
--
--    for libname in libnames:
--        search_directories: List[Path] = []
--        patterns: List[str] = []
--        if sys.platform == 'cygwin':
--            # Later down we take the first matching DLL found, so search
--            # SAGE_LOCAL first so that it takes precedence
--            if SAGE_LOCAL:
--                search_directories.append(Path(SAGE_LOCAL) / 'bin')
--            search_directories.append(Path(sysconfig.get_config_var('BINDIR')))
--            # Note: The following is not very robust, since if there are multible
--            # versions for the same library this just selects one more or less
--            # at arbitrary. However, practically speaking, on Cygwin, there
--            # will only ever be one version
--            patterns = [f'cyg{libname}.dll', f'cyg{libname}-*.dll']
--        else:
--            if sys.platform == 'darwin':
--                ext = 'dylib'
--            else:
--                ext = 'so'
--
--            if SAGE_LOCAL:
--                search_directories.append(Path(SAGE_LOCAL) / 'lib')
--            libdir = sysconfig.get_config_var('LIBDIR')
--            if libdir is not None:
--                libdir = Path(libdir)
--                search_directories.append(libdir)
--
--                multiarchlib = sysconfig.get_config_var('MULTIARCH')
--                if multiarchlib is not None:
--                    search_directories.append(libdir / multiarchlib),
--
--            patterns = [f'lib{libname}.{ext}']
--
--        for directory in search_directories:
--            for pattern in patterns:
--                path = next(directory.glob(pattern), None)
--                if path is not None:
--                    return str(path.resolve())
--
--    # Just return None if no files were found
--    return None
--
--# locate libgap shared object
--GAP_SO = var("GAP_SO", _get_shared_lib_path("gap", ""))
--
- # post process
- if DOT_SAGE is not None and ' ' in DOT_SAGE:
-     if UNAME[:6] == 'CYGWIN':
-diff --git a/src/sage/groups/abelian_gps/abelian_group_gap.py b/src/sage/groups/abelian_gps/abelian_group_gap.py
-index a4b047113c5..86090b43535 100644
---- a/src/sage/groups/abelian_gps/abelian_group_gap.py
-+++ b/src/sage/groups/abelian_gps/abelian_group_gap.py
-@@ -338,7 +338,7 @@ def _element_constructor_(self, x, check=True):
-         if isinstance(x, AbelianGroupElement_gap):
-             try:
-                 if x in self._cover:
--                    x = self.gap().NaturalHomomorphism().Image(x.gap())
-+                    x = self._cover.gap().NaturalHomomorphismByNormalSubgroup(self._relations).Image(x.gap())
-                 else:
-                     x = x.gap()
-             except AttributeError:
-@@ -1043,7 +1043,7 @@ def natural_homomorphism(self):
-             From: Abelian group with gap, generator orders (4,)
-             To:   Quotient abelian group with generator orders (2,)
-         """
--        phi = self.gap().NaturalHomomorphism()
-+        phi = self._cover.gap().NaturalHomomorphismByNormalSubgroup(self._relations)
-         Hom = self._cover.Hom(self)
-         return Hom(phi)
- 
-diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py
-index 8d6e443683c..1beb01af87f 100644
---- a/src/sage/groups/finitely_presented.py
-+++ b/src/sage/groups/finitely_presented.py
-@@ -596,9 +596,9 @@ def gap(self):
-             sage: k = G.rewriting_system()
-             sage: k.gap()
-             Knuth Bendix Rewriting System for Monoid( [ a, A, b, B ] ) with rules
--            [ [ a^2, <identity ...> ], [ a*A, <identity ...> ],
--              [ A*a, <identity ...> ], [ b^2, <identity ...> ],
--              [ b*B, <identity ...> ], [ B*b, <identity ...> ] ]
-+            [ [ a*A, <identity ...> ], [ A*a, <identity ...> ],
-+              [ b*B, <identity ...> ], [ B*b, <identity ...> ],
-+              [ a^2, <identity ...> ], [ b^2, <identity ...> ] ]
-         """
-         return self._gap
- 
-diff --git a/src/sage/groups/fqf_orthogonal.py b/src/sage/groups/fqf_orthogonal.py
-index 7fc4dbe7548..e5eccd45942 100644
---- a/src/sage/groups/fqf_orthogonal.py
-+++ b/src/sage/groups/fqf_orthogonal.py
-@@ -143,7 +143,7 @@ class FqfOrthogonalGroup(AbelianGroupAutomorphismGroup_subgroup):
-         [2/3   0   0]
-         [  0 2/3   0]
-         [  0   0 4/3]
--        generated by 2 elements
-+        generated by 3 elements
-         sage: q = matrix.diagonal(QQ, [3/2, 1/4, 1/4])
-         sage: T = TorsionQuadraticForm(q)
-         sage: T.orthogonal_group().order()
-diff --git a/src/sage/groups/libgap_wrapper.pyx b/src/sage/groups/libgap_wrapper.pyx
-index d25121aa792..dc81b71635b 100644
---- a/src/sage/groups/libgap_wrapper.pyx
-+++ b/src/sage/groups/libgap_wrapper.pyx
-@@ -25,7 +25,7 @@ Note how we call the constructor of both superclasses to initialize
- its output via LibGAP::
- 
-     sage: FooGroup()
--    <pc group of size 3 with 1 generators>
-+    <pc group of size 3 with 1 generator>
-     sage: type(FooGroup().gap())
-     <class 'sage.libs.gap.element.GapElement'>
- 
-@@ -106,7 +106,7 @@ class ParentLibGAP(SageObject):
-         ....:         ParentLibGAP.__init__(self, lg)
-         ....:         Group.__init__(self)
-         sage: FooGroup()
--        <pc group of size 3 with 1 generators>
-+        <pc group of size 3 with 1 generator>
-     """
- 
-     def __init__(self, libgap_parent, ambient=None):
-@@ -461,7 +461,7 @@ cdef class ElementLibGAP(MultiplicativeGroupElement):
-         ....:         ParentLibGAP.__init__(self, lg)
-         ....:         Group.__init__(self)
-         sage: FooGroup()
--        <pc group of size 3 with 1 generators>
-+        <pc group of size 3 with 1 generator>
-         sage: FooGroup().gens()
-         (f1,)
-     """
-diff --git a/src/sage/groups/matrix_gps/finitely_generated.py b/src/sage/groups/matrix_gps/finitely_generated.py
-index a6d3dc02513..63956ad5f10 100644
---- a/src/sage/groups/matrix_gps/finitely_generated.py
-+++ b/src/sage/groups/matrix_gps/finitely_generated.py
-@@ -563,9 +563,6 @@ def as_permutation_group(self, algorithm=None, seed=None):
-             21499084800
-             sage: P = G.as_permutation_group()
-             sage: Psmaller = G.as_permutation_group(algorithm="smaller", seed=6)
--            sage: P == Psmaller  # see the note below
--            True
--            sage: Psmaller = G.as_permutation_group(algorithm="smaller")
-             sage: P == Psmaller
-             False
-             sage: P.cardinality()
-diff --git a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-index f2ccca042ac..47d6862333c 100644
---- a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-+++ b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-@@ -427,7 +427,7 @@ cdef class LabelledBranching:
-             sage: from sage.groups.perm_gps.partn_ref2.refinement_generic import LabelledBranching
-             sage: L = LabelledBranching(3)
-             sage: L.small_generating_set()
--            []
-+            [()]
-             sage: L.add_gen(libgap.eval('(1,2,3)'))
-             sage: L.small_generating_set()
-             [(1,2,3)]
-diff --git a/src/sage/groups/perm_gps/permgroup.py b/src/sage/groups/perm_gps/permgroup.py
-index ebdf7c4c6eb..fb14008c8e0 100644
---- a/src/sage/groups/perm_gps/permgroup.py
-+++ b/src/sage/groups/perm_gps/permgroup.py
-@@ -926,7 +926,7 @@ def _coerce_map_from_(self, G):
-            sage: f = PG._coerce_map_from_(MG)
-            sage: mg = MG.an_element()
-            sage: p = f(mg); p
--           (2,33,32,23,31,55)(3,49,38,44,40,28)(4,17,59,62,58,46)(5,21,47,20,43,8)(6,53,50)(7,37,12,57,14,29)(9,41,56,34,64,10)(11,25,19)(13,61,26,51,22,15)(16,45,36)(18,27,35,48,52,54)(24,63,42)(30,39,60)
-+           (1,2,6,19,35,33)(3,9,26,14,31,23)(4,13,5)(7,22,17)(8,24,12)(10,16,32,27,20,28)(11,30,18)(15,25,36,34,29,21)
-            sage: PG(p._gap_()) == p
-            True
- 
-@@ -972,12 +972,12 @@ def _coerce_map_from_(self, G):
-             sage: P = G.as_permutation_group(algorithm='smaller', seed=5)
-             sage: P1 = G.as_permutation_group()
-             sage: P == P1
--            False
-+            True
-             sage: g1, g2, g3 = G.gens()
-             sage: P(g1*g2)
--            (1,3,7,12)(2,4,8,10)(5,11)(6,9)
-+            (1,4,13,11)(2,5,14,18)(3,15,8,16)(6,7)(9,20,19,12)(10,17)
-             sage: P1(g1*g2)
--            (2,29,25,68)(3,57,13,54)(4,11,72,37)(5,39,60,23)(6,64,75,63)(7,21,50,73)(8,46,38,32)(9,74,35,18)(10,44,49,48)(12,16,34,71)(14,79,27,40)(15,26)(17,62,59,76)(19,78,70,65)(20,22,58,51)(24,33,36,43)(28,81,80,52)(30,53,56,69)(31,61)(41,42,67,55)(45,77)(47,66)
-+            (1,4,13,11)(2,5,14,18)(3,15,8,16)(6,7)(9,20,19,12)(10,17)
- 
-         Another check for :trac:`5583`::
- 
-@@ -1302,7 +1302,7 @@ def gens_small(self):
-             sage: G.gens_small() # random
-             [('b','c'), ('a','c','b')] ## (on 64-bit Linux)
-             [('a','b'), ('a','c','b')] ## (on Solaris)
--            sage: len(G.gens_small()) == 2
-+            sage: len(G.gens_small()) == 2 # random
-             True
-         """
-         gens = self._libgap_().SmallGeneratingSet()
-@@ -4370,17 +4370,23 @@ def is_transitive(self, domain=None):
- 
-         ::
- 
--            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)]]) #S_5 on [1..5]
--            sage: G.is_transitive([1,4,5])
-+            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)],[(6,7)]])
-+            sage: G.is_transitive([1,2,3,4,5])
-             True
--            sage: G.is_transitive([2..6])
-+            sage: G.is_transitive([1..7])
-             False
-             sage: G.is_transitive(G.non_fixed_points())
--            True
-+            False
-             sage: H = PermutationGroup([[(1,2,3)],[(4,5,6)]])
-             sage: H.is_transitive(H.non_fixed_points())
-             False
- 
-+        If `G` does not act on the domain, it always returns ``False``::
-+
-+            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)]]) #S_5 on [1..5]
-+            sage: G.is_transitive([1,4,5])
-+            False
-+
-         Note that this differs from the definition in GAP, where
-         ``IsTransitive`` returns whether the group is transitive on the
-         set of points moved by the group.
-@@ -4436,12 +4442,16 @@ def is_primitive(self, domain=None):
-             sage: G = PermutationGroup([[(1,2,3,4)],[(2,4)]])
-             sage: G.is_primitive([1..4])
-             False
--            sage: G.is_primitive([1,2,3])
--            True
-             sage: G = PermutationGroup([[(3,4,5,6)],[(3,4)]]) #S_4 on [3..6]
-             sage: G.is_primitive(G.non_fixed_points())
-             True
- 
-+        If `G` does not act on the domain, it always returns ``False``::
-+
-+            sage: G = PermutationGroup([[(1,2,3,4)],[(2,4)]])
-+            sage: G.is_primitive([1,2,3])
-+            False
-+
-         """
-         #If the domain is not a subset of self.domain(), then the
-         #action isn't primitive.
-diff --git a/src/sage/interfaces/gap.py b/src/sage/interfaces/gap.py
-index 7ae1792e9de..ecaa9fd2341 100644
---- a/src/sage/interfaces/gap.py
-+++ b/src/sage/interfaces/gap.py
-@@ -1512,6 +1512,8 @@ def gap_reset_workspace(max_workspace_size=None, verbose=False):
-     """
-     # Create new workspace with filename WORKSPACE
-     g = Gap(use_workspace_cache=False, max_workspace_size=None)
-+    g.eval('ColorPrompt(false)')
-+    g.eval('SetUserPreference("UseColorPrompt", false)')
-     g.eval('SetUserPreference("HistoryMaxLines", 30)')
-     from sage.tests.gap_packages import all_installed_packages
-     for pkg in all_installed_packages(gap=g):
-diff --git a/src/sage/interfaces/gap_workspace.py b/src/sage/interfaces/gap_workspace.py
-index 33a87dd5076..03b40be6856 100644
---- a/src/sage/interfaces/gap_workspace.py
-+++ b/src/sage/interfaces/gap_workspace.py
-@@ -16,7 +16,8 @@
- import os
- import time
- import hashlib
--from sage.env import DOT_SAGE, GAP_SO
-+import subprocess
-+from sage.env import DOT_SAGE, HOSTNAME, GAP_LIB_DIR, GAP_SHARE_DIR
- 
- 
- def gap_workspace_file(system="gap", name="workspace", dir=None):
-@@ -59,11 +60,13 @@ def gap_workspace_file(system="gap", name="workspace", dir=None):
-     if dir is None:
-         dir = os.path.join(DOT_SAGE, 'gap')
- 
--    if GAP_SO:
--        h = hashlib.sha1(GAP_SO.encode('utf-8')).hexdigest()
--    else:
--        h = 'unknown'
--    return os.path.join(dir, '%s-%s-%s' % (system, name, h))
-+    data = f'{GAP_LIB_DIR}:{GAP_SHARE_DIR}'
-+    for path in GAP_LIB_DIR, GAP_SHARE_DIR:
-+        sysinfo = os.path.join(path, "sysinfo.gap")
-+        if os.path.exists(sysinfo):
-+            data += subprocess.getoutput(f'. "{sysinfo}" && echo ":$GAP_VERSION:$GAParch"')
-+    h = hashlib.sha1(data.encode('utf-8')).hexdigest()
-+    return os.path.join(dir, f'{system}-{name}-{HOSTNAME}-{h}')
- 
- 
- def prepare_workspace_dir(dir=None):
-diff --git a/src/sage/libs/gap/element.pyx b/src/sage/libs/gap/element.pyx
-index c555ea0333c..e3db3934baf 100644
---- a/src/sage/libs/gap/element.pyx
-+++ b/src/sage/libs/gap/element.pyx
-@@ -130,6 +130,7 @@ cdef char *capture_stdout(Obj func, Obj obj):
-     """
-     cdef Obj s, stream, output_text_string
-     cdef UInt res
-+    cdef TypOutputFile output
-     # The only way to get a string representation of an object that is truly
-     # consistent with how it would be represented at the GAP REPL is to call
-     # ViewObj on it.  Unfortunately, ViewObj *prints* to the output stream,
-@@ -145,12 +146,12 @@ cdef char *capture_stdout(Obj func, Obj obj):
-         output_text_string = GAP_ValueGlobalVariable("OutputTextString")
-         stream = CALL_2ARGS(output_text_string, s, GAP_True)
- 
--        if not OpenOutputStream(stream):
-+        if not OpenOutputStream(&output, stream):
-             raise GAPError("failed to open output capture stream for "
-                            "representing GAP object")
- 
-         CALL_1ARGS(func, obj)
--        CloseOutput()
-+        CloseOutput(&output)
-         return CSTR_STRING(s)
-     finally:
-         GAP_Leave()
-diff --git a/src/sage/libs/gap/gap_includes.pxd b/src/sage/libs/gap/gap_includes.pxd
-index 6d22e32540b..6111d18a5c7 100644
---- a/src/sage/libs/gap/gap_includes.pxd
-+++ b/src/sage/libs/gap/gap_includes.pxd
-@@ -76,8 +76,10 @@ cdef extern from "gap/intobj.h" nogil:
- 
- 
- cdef extern from "gap/io.h" nogil:
--    UInt OpenOutputStream(Obj stream)
--    UInt CloseOutput()
-+    ctypedef struct TypOutputFile:
-+        pass
-+    UInt OpenOutputStream(TypOutputFile* output, Obj stream)
-+    UInt CloseOutput(TypOutputFile* output)
- 
- 
- cdef extern from "gap/libgap-api.h" nogil:
-diff --git a/src/sage/libs/gap/libgap.pyx b/src/sage/libs/gap/libgap.pyx
-index b1a64e57939..6a36613aa8c 100644
---- a/src/sage/libs/gap/libgap.pyx
-+++ b/src/sage/libs/gap/libgap.pyx
-@@ -695,7 +695,7 @@ class Gap(Parent):
-             sage: libgap.List
-             <Gap function "List">
-             sage: libgap.GlobalRandomSource
--            <RandomSource in IsGlobalRandomSource>
-+            <RandomSource in IsGAPRandomSource>
-         """
-         if name in dir(self.__class__):
-             return getattr(self.__class__, name)
-diff --git a/src/sage/libs/gap/saved_workspace.py b/src/sage/libs/gap/saved_workspace.py
-index ad5adec36d0..7636707f557 100644
---- a/src/sage/libs/gap/saved_workspace.py
-+++ b/src/sage/libs/gap/saved_workspace.py
-@@ -8,7 +8,7 @@
- 
- import os
- import glob
--from sage.env import GAP_ROOT_DIR
-+from sage.env import GAP_LIB_DIR
- from sage.interfaces.gap_workspace import gap_workspace_file
- 
- 
-@@ -31,7 +31,7 @@ def timestamp():
-     """
-     libgap_dir = os.path.dirname(__file__)
-     libgap_files = glob.glob(os.path.join(libgap_dir, '*'))
--    gap_packages = glob.glob(os.path.join(GAP_ROOT_DIR, 'pkg', '*'))
-+    gap_packages = glob.glob(os.path.join(GAP_LIB_DIR, 'pkg', '*'))
-     files = libgap_files + gap_packages
-     if len(files) == 0:
-         print('Unable to find LibGAP files.')
-diff --git a/src/sage/libs/gap/util.pyx b/src/sage/libs/gap/util.pyx
-index 344ab88c42a..eaa659d64c7 100644
---- a/src/sage/libs/gap/util.pyx
-+++ b/src/sage/libs/gap/util.pyx
-@@ -13,7 +13,7 @@ Utility functions for GAP
- #*****************************************************************************
- 
- from libc.signal cimport signal, SIGCHLD, SIG_DFL
--from posix.dlfcn cimport dlopen, dlclose, RTLD_NOW, RTLD_GLOBAL
-+from posix.dlfcn cimport dlopen, dlclose, dlerror, RTLD_LAZY, RTLD_GLOBAL
- 
- from cpython.exc cimport PyErr_Fetch, PyErr_Restore
- from cpython.object cimport Py_LT, Py_LE, Py_EQ, Py_NE, Py_GT, Py_GE
-@@ -164,33 +164,6 @@ cdef void gasman_callback() with gil:
- ### Initialization of GAP ##################################################
- ############################################################################
- 
--def gap_root():
--    """
--    Find the location of the GAP root install which is stored in the gap
--    startup script.
--
--    EXAMPLES::
--
--        sage: from sage.libs.gap.util import gap_root
--        sage: gap_root()   # random output
--        '/home/vbraun/opt/sage-5.3.rc0/local/gap/latest'
--    """
--    if os.path.exists(sage.env.GAP_ROOT_DIR):
--        return sage.env.GAP_ROOT_DIR
--
--    # Attempt to figure out the appropriate GAP_ROOT by reading the
--    # local/bin/gap shell script; this is an ugly hack that exists for
--    # historical reasons; the best approach to setting where Sage looks for
--    # the appropriate GAP_ROOT is to set the GAP_ROOT_DIR variable
--    SAGE_LOCAL = sage.env.SAGE_LOCAL
--    with open(os.path.join(SAGE_LOCAL, 'bin', 'gap')) as f:
--        gap_sh = f.read().splitlines()
--    gapdir = next(x for x in gap_sh if x.strip().startswith('GAP_ROOT'))
--    gapdir = gapdir.split('"')[1]
--    gapdir = gapdir.replace('$SAGE_LOCAL', SAGE_LOCAL)
--    return gapdir
--
--
- # To ensure that we call initialize_libgap only once.
- cdef bint _gap_is_initialized = False
- 
-@@ -232,12 +205,12 @@ cdef initialize():
-     # this isn't portable
- 
-     cdef void* handle
--    libgapname = str_to_bytes(sage.env.GAP_SO)
--    handle = dlopen(libgapname, RTLD_NOW | RTLD_GLOBAL)
-+    # reload the current module to force reload of libgap (see #33446)
-+    lib = str_to_bytes(__loader__.path, FS_ENCODING, "surrogateescape")
-+    handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY)
-     if handle is NULL:
--        raise RuntimeError(
--                "Could not dlopen() libgap even though it should already "
--                "be loaded!")
-+        err = dlerror()
-+        raise RuntimeError(f"Could not reload gap library with RTLD_GLOBAL ({err})")
-     dlclose(handle)
- 
-     # Define argv variable, which we will pass in to
-@@ -245,7 +218,7 @@ cdef initialize():
-     cdef char* argv[16]
-     argv[0] = "sage"
-     argv[1] = "-l"
--    s = str_to_bytes(gap_root(), FS_ENCODING, "surrogateescape")
-+    s = str_to_bytes(sage.env.GAP_LIB_DIR + ";" + sage.env.GAP_SHARE_DIR, FS_ENCODING, "surrogateescape")
-     argv[2] = s
- 
-     argv[3] = "-m"
-@@ -362,15 +335,9 @@ cdef Obj gap_eval(str gap_string) except? NULL:
-         GAPError: Error, Variable: 'Complex' must have a value
-         Syntax error: ; expected in stream:1
-         Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^
-+                ^^^^^
-         Error, Variable: 'with' must have a value
--        Syntax error: ; expected in stream:1
--        Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^^^^^^^^^
-         Error, Variable: 'bits' must have a value
--        Syntax error: ; expected in stream:1
--        Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-         Error, Variable: 'precision' must have a value
- 
-     Test that on a subsequent attempt we get the same message (no garbage was
-diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx
-index d8ea7b07f3c..4beb1774df9 100644
---- a/src/sage/libs/singular/singular.pyx
-+++ b/src/sage/libs/singular/singular.pyx
-@@ -1705,14 +1705,7 @@ cdef object si2sa_intvec(intvec *v):
- cdef extern from *: # hack to get at cython macro
-     int unlikely(int)
- 
--cdef extern from "dlfcn.h":
--    void *dlopen(char *, long)
--    char *dlerror()
--    void dlclose(void *handle)
--
--cdef extern from "dlfcn.h":
--    cdef long RTLD_LAZY
--    cdef long RTLD_GLOBAL
-+from posix.dlfcn cimport dlopen, dlclose, dlerror, RTLD_LAZY, RTLD_GLOBAL
- 
- cdef int overflow_check(unsigned long e, ring *_ring) except -1:
-     """
-@@ -1762,8 +1755,6 @@ cdef init_libsingular():
- 
-     cdef void *handle = NULL
- 
--    from sage.env import LIBSINGULAR_PATH
--    lib = str_to_bytes(LIBSINGULAR_PATH, FS_ENCODING, "surrogateescape")
- 
-     # This is a workaround for https://github.com/Singular/Singular/issues/1113
-     # and can be removed once that fix makes it into release of Singular that
-@@ -1780,10 +1771,12 @@ cdef init_libsingular():
- 
-     import platform
-     if not platform.system().startswith("CYGWIN"):
-+        # reload the current module to force reload of libSingular (see #33446)
-+        lib = str_to_bytes(__loader__.path, FS_ENCODING, "surrogateescape")
-         handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY)
-         if not handle:
-             err = dlerror()
--            raise ImportError(f"cannot load Singular library from {LIBSINGULAR_PATH} ({err})")
-+            raise RuntimeError(f"Could not reload Singular library with RTLD_GLOBAL ({err})")
- 
-     # load SINGULAR
-     siInit(lib)
-diff --git a/src/sage/tests/gap_packages.py b/src/sage/tests/gap_packages.py
-index 2e4518ca226..c302b169b8a 100644
---- a/src/sage/tests/gap_packages.py
-+++ b/src/sage/tests/gap_packages.py
-@@ -103,7 +103,7 @@ def all_installed_packages(ignore_dot_gap=False, gap=None):
- 
-         sage: from sage.tests.gap_packages import all_installed_packages
-         sage: all_installed_packages()
--        (...'GAPDoc'...)
-+        (...'gapdoc'...)
-         sage: all_installed_packages(ignore_dot_gap=True) == all_installed_packages(gap=gap, ignore_dot_gap=True)
-         True
-     """
diff --git a/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch b/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
deleted file mode 100644
index d331a6573e1c..000000000000
--- a/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/src/sage/data_structures/stream.py b/src/sage/data_structures/stream.py
-index f8f6dc6a186..002e925f02f 100644
---- a/src/sage/data_structures/stream.py
-+++ b/src/sage/data_structures/stream.py
-@@ -2090,8 +2090,8 @@ def compute_product(self, n, la):
-             sage: f = Stream_exact([1]) # irrelevant for this test
-             sage: g = Stream_function(lambda n: s[n], True, 0)
-             sage: h = Stream_plethysm(f, g, True, p)
--            sage: B = p[2, 2, 1](sum(s[i] for i in range(7)))
--            sage: all(h.compute_product(k, Partition([2, 2, 1])) == B.restrict_degree(k) for k in range(7))
-+            sage: B = p[2, 2, 1](sum(p(s[i]) for i in range(7)))  # long time
-+            sage: all(h.compute_product(k, Partition([2, 2, 1])) == B.restrict_degree(k) for k in range(7))  # long time
-             True
-         """
-         # This is the approximate order of the result
diff --git a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch b/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
deleted file mode 100644
index 007f3324cfe4..000000000000
--- a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index b77c69b2f77..0586a96ae55 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -563,7 +563,7 @@ def complex_to_cmap_rgb(z_values, cmap='turbo', contoured=False, tiled=False,
-     import matplotlib as mpl
- 
-     if isinstance(cmap, str):
--        cmap = mpl.cm.get_cmap(cmap)
-+        cmap = mpl.colormaps[cmap]
- 
-     if contour_base is None:
-         if contour_type == "linear":
-@@ -1206,11 +1206,11 @@ def complex_plot(f, x_range, y_range, contoured=False, tiled=False, cmap=None,
-                 domain = np.linspace(0, 1, 256)
-                 shifted_domain = np.roll(domain, 128)
-                 default_cmap = mpl.colors.LinearSegmentedColormap.from_list(
--                    "sage_default", mpl.cm.get_cmap('hsv')(shifted_domain)
-+                    "sage_default", mpl.colormaps['hsv'](shifted_domain)
-                 )
-                 cmap = default_cmap
-             else:
--                cmap = mpl.cm.get_cmap(cmap)
-+                cmap = mpl.colormaps[cmap]
-         rgbs = complex_to_cmap_rgb(
-             z_values, cmap=cmap, contoured=contoured, tiled=tiled,
-             contour_type=contour_type, contour_base=contour_base,
-diff --git a/src/sage/plot/contour_plot.py b/src/sage/plot/contour_plot.py
-index c0cab456686..4accb309580 100644
---- a/src/sage/plot/contour_plot.py
-+++ b/src/sage/plot/contour_plot.py
-@@ -848,9 +848,7 @@ def f(x,y): return cos(x) + sin(y)
- 
-         sage: contour_plot(lambda x,y: 0, (-1,1), (-1,1),
-         ....:              contours=[0], fill=False, cmap=['blue'])
--        ...
--        UserWarning: No contour levels were found within the data range.
--        Graphics object consisting of 1 graphics primitive
-+        ...Graphics object consisting of 1 graphics primitive
- 
-     .. PLOT::
- 
-@@ -874,8 +872,7 @@ def f(x,y): return cos(x) + sin(y)
-     Check that :trac:`18074` is fixed::
- 
-         sage: contour_plot(0, (0,1), (0,1))
--        ... UserWarning: No contour levels were found within the data range.
--        Graphics object consisting of 1 graphics primitive
-+        ...Graphics object consisting of 1 graphics primitive
- 
-     Domain points in :trac:`11648` with complex output are now skipped::
- 
-diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
-index 64ea1a7e10f..cdc99ced263 100644
---- a/src/sage/plot/graphics.py
-+++ b/src/sage/plot/graphics.py
-@@ -2341,7 +2341,7 @@ def _matplotlib_tick_formatter(self, subplot, base=(10, 10),
-             sage: subplot = Figure().add_subplot(111)
-             sage: p._objects[0]._render_on_subplot(subplot)
-             sage: p._matplotlib_tick_formatter(subplot, **d)
--            (<AxesSubplot:...>,
-+            (<Axes...>,
-             <matplotlib.ticker.MaxNLocator object at ...>,
-             <matplotlib.ticker.MaxNLocator object at ...>,
-             <matplotlib.ticker.ScalarFormatter object at ...>,
-diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
-index 99c817f03a6..ae85183dc93 100644
---- a/src/sage/plot/multigraphics.py
-+++ b/src/sage/plot/multigraphics.py
-@@ -1207,7 +1207,7 @@ def _add_subplot(self, figure, index, **options):
-             sage: fig = Figure()
-             sage: ax1 = G._add_subplot(fig, 0)
-             sage: type(ax1)
--            <class 'matplotlib.axes._subplots.AxesSubplot'>
-+            <class 'matplotlib.axes...'>
-             sage: ax2 = G._add_subplot(fig, 1)
-             sage: fig.get_axes() == [ax1, ax2]
-             True
-diff --git a/src/sage/plot/plot3d/plot_field3d.py b/src/sage/plot/plot3d/plot_field3d.py
-index bdf39391d3e..fe10e27f58f 100644
---- a/src/sage/plot/plot3d/plot_field3d.py
-+++ b/src/sage/plot/plot3d/plot_field3d.py
-@@ -126,9 +126,9 @@ def plot_vector_field3d(functions, xrange, yrange, zrange,
-     vectors = [vector((ff(*point), gg(*point), hh(*point))) for point in points]
- 
-     try:
--        from matplotlib.cm import get_cmap
--        cm = get_cmap(colors)
--    except (TypeError, ValueError):
-+        import matplotlib as mpl
-+        cm = mpl.colormaps[colors]
-+    except (TypeError, KeyError):
-         cm = None
-     if cm is None:
-         if isinstance(colors, (list, tuple)):
diff --git a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch b/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
deleted file mode 100644
index 1e0a708e8068..000000000000
--- a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py
-index c9ca5e30939..9459cb70334 100644
---- a/src/sage/interfaces/maxima_lib.py
-+++ b/src/sage/interfaces/maxima_lib.py
-@@ -77,6 +77,26 @@
-     sage: bar == foo
-     True
- 
-+TESTS:
-+
-+Check our workaround for a race in ecl works, see :trac:`26968`.
-+We use a temporary `MAXIMA_USERDIR` so it's empty; we place it
-+in `DOT_SAGE` since we expect it to have more latency than `/tmp`.
-+
-+    sage: import tempfile, subprocess
-+    sage: tmpdir = tempfile.TemporaryDirectory(dir=DOT_SAGE)
-+    sage: _ = subprocess.run(['sage', '-c',  # long time
-+    ....: f'''
-+    ....: import os
-+    ....: os.environ["MAXIMA_USERDIR"] = "{tmpdir.name}"
-+    ....: if not os.fork():
-+    ....:     import sage.interfaces.maxima_lib
-+    ....: else:
-+    ....:     import sage.interfaces.maxima_lib
-+    ....:     os.wait()
-+    ....: '''])
-+    sage: tmpdir.cleanup()
-+
- """
- 
- # ****************************************************************************
-@@ -116,7 +136,23 @@
- ecl_eval("(setq $nolabels t))")
- ecl_eval("(defvar *MAXIMA-LANG-SUBDIR* NIL)")
- ecl_eval("(set-locale-subdir)")
--ecl_eval("(set-pathnames)")
-+
-+try:
-+    ecl_eval("(set-pathnames)")
-+except RuntimeError:
-+    # Recover from :trac:`26968` by creating `*maxima-objdir*` here.
-+    # This cannot be done before calling `(set-pathnames)` since
-+    # `*maxima-objdir*` is computed there.
-+    # We use python `os.makedirs()` which is immune to the race.
-+    # Using `(ensure-directories-exist ...)` in lisp would be
-+    # subject to the same race condition and since `*maxima-objdir*`
-+    # has multiple components this is quite plausible to happen.
-+    maxima_objdir = ecl_eval("*maxima-objdir*").python()[1:-1]
-+    import os
-+    os.makedirs(maxima_objdir, exist_ok=True)
-+    # Call `(set-pathnames)` again to complete its job.
-+    ecl_eval("(set-pathnames)")
-+
- ecl_eval("(defun add-lineinfo (x) x)")
- ecl_eval('(defun principal nil (cond ($noprincipal (diverg)) ((not pcprntd) (merror "Divergent Integral"))))')
- ecl_eval("(remprop 'mfactorial 'grind)")  # don't use ! for factorials (#11539)
diff --git a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch b/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
deleted file mode 100644
index fc3e40da2a88..000000000000
--- a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff --git a/src/bin/sage-cleaner b/src/bin/sage-cleaner
-index e2e578eec60..dc7d8f0482e 100755
---- a/src/bin/sage-cleaner
-+++ b/src/bin/sage-cleaner
-@@ -99,6 +99,15 @@ def cleanup():
- 
-     return len(pid_list)
- 
-+def cleanup_cruft():
-+    """ remove directories leftover from improper shutdown """
-+    tmp_dirs = os.listdir(SAGE_TMP_ROOT)
-+    for dir_entry in tmp_dirs:
-+        baddir = os.path.join(SAGE_TMP_ROOT, dir_entry)
-+        if os.path.isdir(baddir):
-+            logger.warning('Removing old directory %s from SAGE_TMP_ROOT', baddir)
-+            rm_rf(baddir)
-+
- def kill_spawned_jobs(jobfile, parent_pid):
-     logger.info("Killing %s's spawned jobs", parent_pid)
-     killed_them_all = True
-@@ -193,6 +202,7 @@ if __name__ == '__main__':
-     setup_daemon()
-     fix_old_mistakes()
-     logger.info("Starting sage-cleaner with PID %s", os.getpid())
-+    cleanup_cruft()
- 
-     if len(sys.argv) > 1:
-         wait = int(sys.argv[1])
diff --git a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch b/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
deleted file mode 100644
index ea210e20ae52..000000000000
--- a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py
-index ec6a5c19e60..9dd7bc1cb1e 100644
---- a/src/sage/graphs/generators/families.py
-+++ b/src/sage/graphs/generators/families.py
-@@ -3660,7 +3660,7 @@ def nauty_gentreeg(options="", debug=False):
- 
-         sage: gen = graphs.nauty_gentreeg("4", debug=True)
-         sage: print(next(gen))
--        >A ...gentreeg Z=2:3 D=3 n=4
-+        >A ...gentreeg ...
-         sage: gen = graphs.nauty_gentreeg("4 -q", debug=True)
-         sage: next(gen)
-         ''
-@@ -3687,7 +3687,7 @@ def nauty_gentreeg(options="", debug=False):
-         sage: list(graphs.nauty_gentreeg("3 -x", debug=True))
-         ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n [res/mod] ...
-         sage: list(graphs.nauty_gentreeg("3", debug=True))
--        ['>A ...gentreeg Z=2:2 D=2 n=3\n', Graph on 3 vertices]
-+        ['>A ...gentreeg ...\n', Graph on 3 vertices]
-     """
-     import shlex
-     from sage.features.nauty import NautyExecutable
-diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py
-index df88bbe2713..1a8016976c2 100644
---- a/src/sage/graphs/graph_generators.py
-+++ b/src/sage/graphs/graph_generators.py
-@@ -966,7 +966,7 @@ def nauty_geng(self, options="", debug=False):
-             ...
-             ValueError: wrong format of parameter option
-             sage: list(graphs.nauty_geng("-c3", debug=True))
--            ['>E Usage: ...geng [-cCmtfbd#D#] [-uygsnh] [-lvq] ...
-+            ['>E Usage: ...geng ...\n']
-             sage: list(graphs.nauty_geng("-c 3", debug=True))
-             ['>A ...geng -cd1D2 n=3 e=2-3\n', Graph on 3 vertices, Graph on 3 vertices]
-         """
diff --git a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch b/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
deleted file mode 100644
index 46bda084e48e..000000000000
--- a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-diff --git a/src/sage/repl/inputhook.py b/src/sage/repl/inputhook.py
-index da5df0268c0..7f7894f6dcf 100644
---- a/src/sage/repl/inputhook.py
-+++ b/src/sage/repl/inputhook.py
-@@ -17,6 +17,8 @@
- 
- import select
- import errno
-+import contextlib
-+import io
- 
- from IPython import get_ipython
- from IPython.terminal.pt_inputhooks import register
-@@ -47,15 +49,27 @@ def install():
-     """
-     Install the Sage input hook
- 
--    EXAMPLES::
-+    EXAMPLES:
-+
-+    Make sure ipython is running so we really test this function::
-+
-+        sage: from sage.repl.interpreter import get_test_shell
-+        sage: get_test_shell()
-+        <sage.repl.interpreter.SageTestShell object at ...>
-+
-+    Run the function twice, to check it is idempotent (see :trac:`35235`)::
- 
-         sage: from sage.repl.inputhook import install
-         sage: install()
-+        sage: install()
-     """
-     ip = get_ipython()
-     if not ip:
-         return   # Not running in ipython, e.g. doctests
--    ip.enable_gui('sage')
-+    if ip._inputhook != sage_inputhook:
-+        # silence `ip.enable_gui()` useless output
-+        with contextlib.redirect_stdout(io.StringIO()):
-+            ip.enable_gui('sage')
- 
- 
- def uninstall():
-@@ -71,4 +85,6 @@ def uninstall():
-     if not ip:
-         return
-     if ip._inputhook == sage_inputhook:
--        ip.enable_gui(None)
-+        # silence `ip.enable_gui()` useless output
-+        with contextlib.redirect_stdout(io.StringIO()):
-+            ip.enable_gui(None)
diff --git a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch b/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
deleted file mode 100644
index 2cdc674d4f9e..000000000000
--- a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 532fbbaf71bb41c73920b584108eb2a09d6deeb1 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
-Date: Tue, 4 Apr 2023 12:56:57 -0300
-Subject: [PATCH] Ignore deprecation warnings triggered by pythran 0.12.1
-
-These happen with python 3.11, setuptools 67.6.1, numpy 1.24.2.
-When pythran 0.12.1 is installed, I get 24 doctest failures due to
-deprecation warnings; they are all gone with this commit.
-
-[backported from 839a6e928c264a9863bd42860c78ae95a6d9f3e0]
----
- src/sage/all.py | 12 ++++++++++--
- 1 file changed, 10 insertions(+), 2 deletions(-)
-
-diff --git a/src/sage/all.py b/src/sage/all.py
-index 93588df1b93..ee775aad0e9 100644
---- a/src/sage/all.py
-+++ b/src/sage/all.py
-@@ -96,9 +96,17 @@ warnings.filterwarnings('ignore', category=DeprecationWarning,
- warnings.filterwarnings('ignore', category=DeprecationWarning,
-     module='(.*[.]_vendor[.])?packaging')
- 
--# Ignore numpy warnings triggered by pythran
-+# Ignore a few warnings triggered by pythran 0.12.1
- warnings.filterwarnings('ignore', category=DeprecationWarning,
--                        module='pythran')
-+    message='\n\n  `numpy.distutils` is deprecated since NumPy 1.23.0',
-+    module='pythran.dist')
-+warnings.filterwarnings('ignore', category=DeprecationWarning,
-+    message='pkg_resources is deprecated as an API|'
-+            'Deprecated call to `pkg_resources.declare_namespace(.*)`',
-+    module='pkg_resources')
-+warnings.filterwarnings('ignore', category=DeprecationWarning,
-+    message='msvccompiler is deprecated and slated to be removed',
-+    module='distutils.msvccompiler')
- 
- warnings.filterwarnings('ignore', category=DeprecationWarning,
-                         message='The distutils(.sysconfig module| package) is deprecated',
--- 
-2.40.0
-
diff --git a/srcpkgs/sagemath/patches/35584-networkx_3.1.patch b/srcpkgs/sagemath/patches/35584-networkx_3.1.patch
index 66eedecff7c6..9331258986d3 100644
--- a/srcpkgs/sagemath/patches/35584-networkx_3.1.patch
+++ b/srcpkgs/sagemath/patches/35584-networkx_3.1.patch
@@ -1,8 +1,8 @@
 diff --git a/src/sage/graphs/graph.py b/src/sage/graphs/graph.py
-index c2e42bcbd3..b6a10efbf4 100644
+index c2e42bcbd38..0d13f071dc4 100644
 --- a/src/sage/graphs/graph.py
 +++ b/src/sage/graphs/graph.py
-@@ -6786,13 +6786,21 @@ def cliques_number_of(self, vertices=None, cliques=None):
+@@ -6786,13 +6786,26 @@ def cliques_number_of(self, vertices=None, cliques=None):
              {(0, 0): 2, (0, 1): 3, (0, 2): 2, (1, 0): 2, (1, 1): 3, (1, 2): 2}
              sage: F.cliques_number_of(vertices=[(0, 1), (1, 2)])
              {(0, 1): 3, (1, 2): 2}
@@ -18,15 +18,20 @@ index c2e42bcbd3..b6a10efbf4 100644
 +        if cliques is None:
 +            cliques = self.cliques_maximal()
 +
-+        if vertices in self: # single vertex
++        if vertices in self:  # single vertex
 +            return sum(1 for c in cliques if vertices in c)
-+        else:
-+            return { v : sum(1 for c in cliques if v in c)
-+                     for v in vertices or self }
++
++        from collections import Counter
++        count = Counter()
++
++        for c in cliques:
++            count.update(c)
++
++        return {v : count[v] for v in vertices or self}
  
      @doc_index("Clique-related methods")
      def cliques_get_max_clique_graph(self):
-@@ -7493,17 +7501,32 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
+@@ -7493,17 +7506,32 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
  
              sage: C = Graph('DJ{')
              sage: C.cliques_containing_vertex()
@@ -62,7 +67,7 @@ index c2e42bcbd3..b6a10efbf4 100644
  
          Since each clique of a 2 dimensional grid corresponds to an edge, the
          number of cliques in which a vertex is involved equals its degree::
-@@ -7518,8 +7541,14 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
+@@ -7518,8 +7546,20 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
              sage: sorted(sorted(x for x in L) for L in d[(0, 1)])
              [[(0, 0), (0, 1)], [(0, 1), (0, 2)], [(0, 1), (1, 1)]]
          """
@@ -71,11 +76,17 @@ index c2e42bcbd3..b6a10efbf4 100644
 +        if cliques is None:
 +            cliques = self.cliques_maximal()
 +
-+        if vertices in self: # single vertex
++        if vertices in self:  # single vertex
 +            return [c for c in cliques if vertices in c]
-+        else:
-+            return { v : [c for c in cliques if v in c]
-+                     for v in vertices or self }
++
++        from collections import defaultdict
++        d = defaultdict(list)
++
++        for c in cliques:
++            for v in c:
++                d[v].append(c)
++
++        return {v : d[v] for v in vertices or self}
  
      @doc_index("Clique-related methods")
      def clique_complex(self):
diff --git a/srcpkgs/sagemath/patches/35612-linbox_1.7.0.patch b/srcpkgs/sagemath/patches/35612-linbox_1.7.0.patch
new file mode 100644
index 000000000000..58dddf34a69d
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35612-linbox_1.7.0.patch
@@ -0,0 +1,64 @@
+diff --git a/src/sage/libs/linbox/conversion.pxd b/src/sage/libs/linbox/conversion.pxd
+index 7794c9edc39..1753277b1f1 100644
+--- a/src/sage/libs/linbox/conversion.pxd
++++ b/src/sage/libs/linbox/conversion.pxd
+@@ -177,9 +177,8 @@ cdef inline Vector_integer_dense new_sage_vector_integer_dense(P, DenseVector_in
+     - v -- linbox vector
+     """
+     cdef Vector_integer_dense res = P()
+-    cdef cppvector[Integer] * vec = &v.refRep()
+     cdef size_t i
+     for i in range(<size_t> res._degree):
+-        mpz_set(res._entries[i], vec[0][i].get_mpz_const())
++        mpz_set(res._entries[i], v.getEntry(i).get_mpz_const())
+ 
+     return res
+diff --git a/src/sage/libs/linbox/linbox.pxd b/src/sage/libs/linbox/linbox.pxd
+index 9112d151f8b..bfeda4b6042 100644
+--- a/src/sage/libs/linbox/linbox.pxd
++++ b/src/sage/libs/linbox/linbox.pxd
+@@ -32,7 +32,6 @@ cdef extern from "linbox/matrix/dense-matrix.h":
+         ctypedef Modular_double Field
+         ctypedef double Element
+         DenseMatrix_Modular_double(Field F, size_t m, size_t n)
+-        DenseMatrix_Modular_double(Field F, Element*, size_t m, size_t n)
+         void setEntry(size_t i, size_t j, Element& a)
+         Element &getEntry(size_t i, size_t j)
+ 
+@@ -42,7 +41,6 @@ cdef extern from "linbox/matrix/dense-matrix.h":
+         ctypedef Modular_float Field
+         ctypedef float Element
+         DenseMatrix_Modular_float(Field F, size_t m, size_t n)
+-        DenseMatrix_Modular_float(Field F, Element*, size_t m, size_t n)
+         void setEntry(size_t i, size_t j, Element& a)
+         Element &getEntry(size_t i, size_t j)
+ 
+@@ -101,7 +99,6 @@ cdef extern from "linbox/vector/vector.h":
+         DenseVector_integer (Field &F)
+         DenseVector_integer (Field &F, long& m)
+         DenseVector_integer (Field &F, cppvector[Integer]&)
+-        cppvector[Element]& refRep()
+         size_t size()
+         void resize(size_t)
+         void resize(size_t n, const Element&)
+diff --git a/src/sage/matrix/matrix_modn_dense_template.pxi b/src/sage/matrix/matrix_modn_dense_template.pxi
+index abf29badce6..68b869ce314 100644
+--- a/src/sage/matrix/matrix_modn_dense_template.pxi
++++ b/src/sage/matrix/matrix_modn_dense_template.pxi
+@@ -221,9 +221,14 @@ cdef inline linbox_echelonize_efd(celement modulus, celement* entries, Py_ssize_
+         return 0,[]
+ 
+     cdef ModField *F = new ModField(<long>modulus)
+-    cdef DenseMatrix *A = new DenseMatrix(F[0], <ModField.Element*>entries,<Py_ssize_t>nrows, <Py_ssize_t>ncols)
+-    cdef Py_ssize_t r = reducedRowEchelonize(A[0])
++    cdef DenseMatrix *A = new DenseMatrix(F[0], nrows, ncols)
++
+     cdef Py_ssize_t i,j
++    for i in range(nrows):
++        for j in range(ncols):
++            A.setEntry(i, j, entries[i*ncols+j])
++
++    cdef Py_ssize_t r = reducedRowEchelonize(A[0])
+     for i in range(nrows):
+         for j in range(ncols):
+             entries[i*ncols+j] = <celement>A.getEntry(i,j)
diff --git a/srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch b/srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch
new file mode 100644
index 000000000000..9f00fb17271c
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch
@@ -0,0 +1,578 @@
+diff --git a/build/pkgs/ecl/dependencies b/build/pkgs/ecl/dependencies
+index cda6316bf5a..51a953403e9 100644
+--- a/build/pkgs/ecl/dependencies
++++ b/build/pkgs/ecl/dependencies
+@@ -1,4 +1,4 @@
+-$(MP_LIBRARY) readline gc libffi
++$(MP_LIBRARY) readline gc libffi info
+ 
+ ----------
+ All lines of this file are ignored except the first.
+diff --git a/build/pkgs/ecl/spkg-configure.m4 b/build/pkgs/ecl/spkg-configure.m4
+index ae1e0ac5e1a..7dbcfa6377b 100644
+--- a/build/pkgs/ecl/spkg-configure.m4
++++ b/build/pkgs/ecl/spkg-configure.m4
+@@ -35,10 +35,7 @@ SAGE_SPKG_CONFIGURE([ecl], [
+     AC_SUBST(SAGE_ECL_CONFIG, [$ECL_CONFIG])
+   fi
+ 
+-  # Maxima cannot yet be provided by the system, so we always use
++  # Kenzo cannot yet be provided by the system, so we always use
+   # the SAGE_LOCAL path for now.
+-  AC_SUBST(SAGE_MAXIMA_FAS, ['${prefix}'/lib/ecl/maxima.fas])
+-
+-  # Likewise for the optional Kenzo SPKG
+   AC_SUBST(SAGE_KENZO_FAS, ['${prefix}'/lib/ecl/kenzo.fas])
+ ])
+diff --git a/build/pkgs/ecl/spkg-install.in b/build/pkgs/ecl/spkg-install.in
+index ee1667aec16..72083337942 100644
+--- a/build/pkgs/ecl/spkg-install.in
++++ b/build/pkgs/ecl/spkg-install.in
+@@ -31,18 +31,6 @@ cp "$SAGE_ROOT"/config/config.* src
+ 
+ if [ x"$SAGE_SPKG_INSTALL_DOCS" != xyes ] ; then
+     ECL_CONFIGURE="$ECL_CONFIGURE --enable-manual=no"
+-else
+-    # ECL 2020 needs modern makeinfo
+-    command -v texi2any >/dev/null 2>&1
+-    if [ $? -ne 0 ]; then # texi2any not found -> makeinfo too old, if present
+-        ECL_CONFIGURE="$ECL_CONFIGURE --enable-manual=no"
+-    else
+-        if makeinfo -c foo 2>&1 | grep -q invalid; then
+-            # makeinfo found but does not support all options that ecl
+-            # likes to use
+-            ECL_CONFIGURE="$ECL_CONFIGURE --enable-manual=no"
+-        fi
+-    fi
+ fi
+ 
+ sdh_configure $SAGE_CONFIGURE_GMP \
+diff --git a/build/pkgs/giac/spkg-configure.m4 b/build/pkgs/giac/spkg-configure.m4
+index 5859e35f12e..b677184b7be 100644
+--- a/build/pkgs/giac/spkg-configure.m4
++++ b/build/pkgs/giac/spkg-configure.m4
+@@ -5,7 +5,7 @@ SAGE_SPKG_CONFIGURE([giac], [
+        m4_pushdef([GIAC_MAX_VERSION], [1.9.999])
+        AC_CACHE_CHECK([for giac >= ]GIAC_MIN_VERSION[, <= ]GIAC_MAX_VERSION, [ac_cv_path_GIAC], [
+          AC_PATH_PROGS_FEATURE_CHECK([GIAC], [giac], [
+-            giac_version=$($ac_path_GIAC --version 2> /dev/null | tail -1)
++            giac_version=$($ac_path_GIAC --version 2> /dev/null | tail -n -1)
+             AS_IF([test -n "$giac_version"], [
+                 AX_COMPARE_VERSION([$giac_version], [ge], GIAC_MIN_VERSION, [
+                     AX_COMPARE_VERSION([$giac_version], [le], GIAC_MAX_VERSION, [
+diff --git a/build/pkgs/info/spkg-configure.m4 b/build/pkgs/info/spkg-configure.m4
+index 0980a4b8ef8..85fe1ea4731 100644
+--- a/build/pkgs/info/spkg-configure.m4
++++ b/build/pkgs/info/spkg-configure.m4
+@@ -1,4 +1,14 @@
+ SAGE_SPKG_CONFIGURE([info], [
+   AC_PATH_PROG(INFO, info)
+-  AS_IF([test -z "${INFO}"], [sage_spkg_install_info=yes])
++  AS_IF([test -z "${INFO}"], [sage_spkg_install_info=yes
++    ], [
++     dnl very old makeinfo are not texi2any, newer are symlinks to texi2any
++     AC_PATH_PROG(TEXI2ANY, texi2any)
++     AS_IF([test -z "${TEXI2ANY}"], [sage_spkg_install_info=yes
++       ], [
++        AS_IF([makeinfo -c foo 2>&1 | grep -q invalid], [
++         dnl makeinfo found, but too old, and  does not support all options that ecl likes to use
++         sage_spkg_install_info=yes])
++       ])
++    ])
+ ])
+diff --git a/build/pkgs/info/spkg-install.in b/build/pkgs/info/spkg-install.in
+index 8086e4b2ec8..3ea8c053669 100644
+--- a/build/pkgs/info/spkg-install.in
++++ b/build/pkgs/info/spkg-install.in
+@@ -1,2 +1,2 @@
+-cd src/info
++cd src
+ sdh_make_install
+diff --git a/build/pkgs/info/type b/build/pkgs/info/type
+index 134d9bc32d5..a6a7b9cd726 100644
+--- a/build/pkgs/info/type
++++ b/build/pkgs/info/type
+@@ -1 +1 @@
+-optional
++standard
+diff --git a/build/pkgs/maxima/checksums.ini b/build/pkgs/maxima/checksums.ini
+index a804c7b831f..0f594389fe6 100644
+--- a/build/pkgs/maxima/checksums.ini
++++ b/build/pkgs/maxima/checksums.ini
+@@ -1,5 +1,5 @@
+ tarball=maxima-VERSION.tar.gz
+-sha1=ed15d5285794413ba94412079eca3d0fa55a47bf
+-md5=9b9ae1dace55b1386739dabaa9122e60
+-cksum=1765409766
++sha1=1010594e6d6082bbd8efaac1b7756ec1721a4ed5
++md5=3c01f1daa6936e11d8713fef7751d3fe
++cksum=2420393096
+ upstream_url=https://sourceforge.net/projects/maxima/files/Maxima-source/VERSION-source/maxima-VERSION.tar.gz/download
+diff --git a/build/pkgs/maxima/distros/arch.txt b/build/pkgs/maxima/distros/arch.txt
+index 6400290f44d..6ac052fa62b 100644
+--- a/build/pkgs/maxima/distros/arch.txt
++++ b/build/pkgs/maxima/distros/arch.txt
+@@ -1 +1 @@
+-maxima-ecl
++maxima-fas
+diff --git a/build/pkgs/maxima/distros/cygwin.txt b/build/pkgs/maxima/distros/cygwin.txt
+new file mode 100644
+index 00000000000..f5fe3fdc6cb
+--- /dev/null
++++ b/build/pkgs/maxima/distros/cygwin.txt
+@@ -0,0 +1 @@
++maxima
+diff --git a/build/pkgs/maxima/distros/freebsd.txt b/build/pkgs/maxima/distros/freebsd.txt
+new file mode 100644
+index 00000000000..766a71b5074
+--- /dev/null
++++ b/build/pkgs/maxima/distros/freebsd.txt
+@@ -0,0 +1 @@
++math/maxima
+diff --git a/build/pkgs/maxima/distros/gentoo.txt b/build/pkgs/maxima/distros/gentoo.txt
+new file mode 100644
+index 00000000000..85fb33f1610
+--- /dev/null
++++ b/build/pkgs/maxima/distros/gentoo.txt
+@@ -0,0 +1,2 @@
++sci-mathematics/maxima[ecls]
++
+diff --git a/build/pkgs/maxima/package-version.txt b/build/pkgs/maxima/package-version.txt
+index 83476624dc0..5681375f3be 100644
+--- a/build/pkgs/maxima/package-version.txt
++++ b/build/pkgs/maxima/package-version.txt
+@@ -1 +1 @@
+-5.45.0.p0
++5.46.0
+diff --git a/build/pkgs/maxima/patches/matrixexp.patch b/build/pkgs/maxima/patches/matrixexp.patch
+deleted file mode 100644
+index 5c8527c33bf..00000000000
+--- a/build/pkgs/maxima/patches/matrixexp.patch
++++ /dev/null
+@@ -1,15 +0,0 @@
+-diff --git a/share/linearalgebra/matrixexp.lisp b/share/linearalgebra/matrixexp.lisp
+-index 218bf35..f2fd468 100644
+---- a/share/linearalgebra/matrixexp.lisp
+-+++ b/share/linearalgebra/matrixexp.lisp
+-@@ -138,8 +138,8 @@
+- 	   (print `(ratvars = ,$ratvars gcd = '$gcd algebraic = ,$algebraic))
+- 	   (print `(ratfac = ,$ratfac))
+- 	   (merror "Unable to find the spectrum")))
+--   
+--    (setq res ($fullratsimp (ncpower (sub (mult z ($ident n)) mat) -1) z))
+-+
+-+    (setq res ($fullratsimp ($invert_by_lu (sub (mult z ($ident n)) mat) '$crering) z))
+-     (setq m (length sp))
+-     (dotimes (i m)
+-       (setq zi (nth i sp))
+diff --git a/build/pkgs/maxima/patches/maxima.system.patch b/build/pkgs/maxima/patches/maxima.system.patch
+deleted file mode 100644
+index 74db62e7f9f..00000000000
+--- a/build/pkgs/maxima/patches/maxima.system.patch
++++ /dev/null
+@@ -1,25 +0,0 @@
+-diff --git a/src/maxima.system b/src/maxima.system
+-index 76f2452..cf25f51 100644
+---- a/src/maxima.system
+-+++ b/src/maxima.system
+-@@ -1,5 +1,8 @@
+- ;;; -*- Lisp -*-
+- 
+-+(require :cmp)
+-+(setf c::*compile-in-constants* t)
+-+
+- (in-package :cl-user)
+- 
+- (pushnew :cl *features*)
+-@@ -75,6 +78,11 @@
+- 			     ;; Convert dir/foo.fas to dir/foo.o
+- 			     (make-pathname :type "o" :defaults p))
+- 			 files)))
+-+	(c::build-fasl "binary-ecl/maxima" :lisp-files obj
+-+			  :ld-flags
+-+			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
+-+							      (find-package "MAXIMA")))))
+-+			    (if (and x (not (string= x ""))) (list x))))
+- 	(c::build-program "binary-ecl/maxima" :lisp-files obj
+- 			  :ld-flags
+- 			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
+diff --git a/build/pkgs/maxima/spkg-configure.m4 b/build/pkgs/maxima/spkg-configure.m4
+new file mode 100644
+index 00000000000..dc54525320e
+--- /dev/null
++++ b/build/pkgs/maxima/spkg-configure.m4
+@@ -0,0 +1,46 @@
++SAGE_SPKG_CONFIGURE([maxima], [
++  m4_pushdef([SAGE_MAXIMA_MINVER],["5.45.0"])dnl this version and higher allowed
++  SAGE_SPKG_DEPCHECK([ecl], [
++    dnl First check for the "maxima" executable in the user's PATH, because
++    dnl we still use pexpect to communicate with it in a few places.
++    AC_CACHE_CHECK([for Maxima >= $SAGE_MAXIMA_MINVER], [ac_cv_path_MAXIMA], [
++        AC_PATH_PROGS_FEATURE_CHECK([MAXIMA], [maxima], [
++            maxima_version=`$ac_path_MAXIMA --version 2>&1 | tail -n -1\
++                | $SED -n -e 's/Maxima *\([[0-9]]*\.[[0-9]]*\.[[0-9]]*\)/\1/p'`
++            AS_IF([test -n "$maxima_version"], [
++                AX_COMPARE_VERSION([$maxima_version], [ge], [SAGE_MAXIMA_MINVER], [
++                    ac_cv_path_MAXIMA="$ac_path_MAXIMA"
++                    ac_path_MAXIMA_found=:
++                ])
++            ])
++        ])
++    ])
++    SAGE_MAXIMA="$ac_cv_path_MAXIMA"
++    AS_IF([test -z "${SAGE_MAXIMA}"], [
++      sage_spkg_install_maxima=yes
++    ],[
++      dnl If we have the executable, check also for the ECL library.
++      AC_MSG_CHECKING([if ECL can "require" the maxima module])
++      AS_IF([ecl --eval "(require 'maxima)" --eval "(quit)" \
++               >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD], [
++        AC_MSG_RESULT(yes)
++      ], [
++        AC_MSG_RESULT(no)
++        sage_spkg_install_maxima=yes
++      ])
++    ])
++  ])
++  m4_popdef([SAGE_MAXIMA_MINVER])
++],[],[],[
++  # post-check
++  AS_IF([test x$sage_spkg_install_maxima = xyes], [
++    dnl Leaving this variable empty will tell sagelib to load
++    dnl the maxima library (within ECL) by name instead of by
++    dnl absolute path.
++    SAGE_MAXIMA='${prefix}'/bin/maxima
++    SAGE_MAXIMA_FAS='${prefix}'/lib/ecl/maxima.fas
++  ])
++
++  AC_SUBST(SAGE_MAXIMA, "${SAGE_MAXIMA}")
++  AC_SUBST(SAGE_MAXIMA_FAS, "${SAGE_MAXIMA_FAS}")
++])
+diff --git a/build/pkgs/maxima/spkg-install.in b/build/pkgs/maxima/spkg-install.in
+index 3ae6382f9ba..cdb6fbf2069 100644
+--- a/build/pkgs/maxima/spkg-install.in
++++ b/build/pkgs/maxima/spkg-install.in
+@@ -28,28 +28,6 @@ echo
+ echo "Now configuring Maxima..."
+ sdh_configure --enable-ecl git_found=false
+ 
+-# Note the following is regression in maxima build system
+-# see https://sourceforge.net/p/maxima/bugs/3278/
+-# and https://sourceforge.net/p/maxima/bugs/2878/
+-# For the previous time it was fixed.
+-#---------------------------------------------------------------
+-# Touching html and info file to avoid to regenerate them.
+-# This must be done after configuration since the timestamp need
+-# to be later than include-maxima.texi which is generated at
+-# configuration time
+-for i in doc/info/*.html ; do
+-    touch "${i}"
+-done
+-touch doc/info/maxima.info*
+-# Maxima 5.44.0 build_html.sh is not compatible with makeinfo 4.8
+-# (which is /usr/bin/makeinfo on macOS).  #30063
+-# Do not build the HTML docs unless the user asks for it,
+-# in which case it is their problem to install a better
+-# makeinfo version.
+-if [[ "$SAGE_SPKG_INSTALL_DOCS" != yes ]] ; then
+-touch doc/info/maxima_toc.html interfaces/xmaxima/doc/xmaxima.html
+-fi
+-
+ #---------------------------------------------------------------
+ 
+ sdh_make
+diff --git a/build/pkgs/tox/spkg-configure.m4 b/build/pkgs/tox/spkg-configure.m4
+index 7d8ade4c14b..3de0b9b710d 100644
+--- a/build/pkgs/tox/spkg-configure.m4
++++ b/build/pkgs/tox/spkg-configure.m4
+@@ -5,7 +5,7 @@ SAGE_SPKG_CONFIGURE([tox], [
+        m4_pushdef([TOX4_MIN_VERSION], [4.0.15])
+        AC_CACHE_CHECK([for tox 3 >= ]TOX3_MIN_VERSION[ or tox 4 >= ]TOX4_MIN_VERSION, [ac_cv_path_TOX], [
+          AC_PATH_PROGS_FEATURE_CHECK([TOX], [tox], [
+-            tox_version=$($ac_path_TOX --version 2> /dev/null | tail -1)
++            tox_version=$($ac_path_TOX --version 2> /dev/null | tail -n -1)
+             AS_IF([test -n "$tox_version"], [
+                 AX_COMPARE_VERSION([$tox_version], [lt], [4], [
+                     AX_COMPARE_VERSION([$tox_version], [ge], TOX3_MIN_VERSION, [
+diff --git a/pkgs/sage-conf/_sage_conf/_conf.py.in b/pkgs/sage-conf/_sage_conf/_conf.py.in
+index d66bdb3d264..f2e197b45ed 100644
+--- a/pkgs/sage-conf/_sage_conf/_conf.py.in
++++ b/pkgs/sage-conf/_sage_conf/_conf.py.in
+@@ -9,9 +9,11 @@ VERSION = "@PACKAGE_VERSION@"
+ SAGE_LOCAL = "@prefix@"
+ SAGE_ROOT = "@SAGE_ROOT@"
+ 
+-MAXIMA = "@prefix@/bin/maxima"
++# The path to the standalone maxima executable.
++MAXIMA = "@SAGE_MAXIMA@".replace('${prefix}', SAGE_LOCAL)
+ 
+-# Delete this line if your ECL can load maxima without further prodding.
++# Set this to the empty string if your ECL can load maxima without
++# further prodding.
+ MAXIMA_FAS = "@SAGE_MAXIMA_FAS@".replace('${prefix}', SAGE_LOCAL)
+ 
+ # Delete this line if your ECL can load Kenzo without further prodding.
+diff --git a/src/bin/sage-env b/src/bin/sage-env
+index a7da60df28f..13b54fa7e92 100644
+--- a/src/bin/sage-env
++++ b/src/bin/sage-env
+@@ -440,9 +440,6 @@ if [ -d "$DOT_SAGE" ] ; then
+     fi
+ fi
+ 
+-if [ -n "$SAGE_LOCAL" ]; then
+-    export MAXIMA_PREFIX="$SAGE_LOCAL"
+-fi
+ export MAXIMA_USERDIR="$DOT_SAGE/maxima"
+ 
+ if [ -n "$SAGE_LOCAL" ]; then
+diff --git a/src/sage/calculus/calculus.py b/src/sage/calculus/calculus.py
+index dae380180ac..ccb8219062b 100644
+--- a/src/sage/calculus/calculus.py
++++ b/src/sage/calculus/calculus.py
+@@ -136,10 +136,11 @@
+     [          1/2*(e^(2*sqrt(x)) + 1)*e^(x - sqrt(x)) 1/2*(x*e^(2*sqrt(x)) - x)*sqrt(x)*e^(x - sqrt(x))]
+     [  1/2*(e^(2*sqrt(x)) - 1)*e^(x - sqrt(x))/x^(3/2)           1/2*(e^(2*sqrt(x)) + 1)*e^(x - sqrt(x))]
+ 
+-And complex exponentiation works now::
++Complex exponentiation works, but may require a patched version of
++maxima (:trac:`32898`) for now::
+ 
+     sage: M = i*matrix([[pi]])
+-    sage: e^M
++    sage: e^M  # not tested, requires patched maxima
+     [-1]
+     sage: M = i*matrix([[pi,0],[0,2*pi]])
+     sage: e^M
+@@ -1186,8 +1187,18 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
+         e
+         sage: f.limit(x=5)
+         7776/3125
+-        sage: f.limit(x=1.2)
++
++    Domain to real, a regression in 5.46.0, see https://sf.net/p/maxima/bugs/4138 ::
++
++        sage: maxima_calculus.eval("domain:real")
++        ...
++        sage: f.limit(x=1.2).n()
+         2.06961575467...
++        sage: maxima_calculus.eval("domain:complex");
++        ...
++
++    Otherwise, it works ::
++
+         sage: f.limit(x=I, taylor=True)
+         (-I + 1)^I
+         sage: f(x=1.2)
+@@ -1203,7 +1214,7 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
+ 
+         sage: var('a')
+         a
+-        sage: limit(x^a,x=0)
++        sage: limit(x^a,x=0)  # random - maxima 5.46.0 does not need extra assumption
+         Traceback (most recent call last):
+         ...
+         ValueError: Computation failed since Maxima requested additional
+@@ -1215,7 +1226,7 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
+     With this example, Maxima is looking for a LOT of information::
+ 
+         sage: assume(a>0)
+-        sage: limit(x^a,x=0)
++        sage: limit(x^a,x=0)  # random - maxima 5.46.0 does not need extra assumption
+         Traceback (most recent call last):
+         ...
+         ValueError: Computation failed since Maxima requested additional
+@@ -1224,7 +1235,7 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
+          more details)
+         Is a an integer?
+         sage: assume(a,'integer')
+-        sage: limit(x^a, x=0)
++        sage: limit(x^a, x=0)  # random - maxima 5.46.0 does not need extra assumption
+         Traceback (most recent call last):
+         ...
+         ValueError: Computation failed since Maxima requested additional
+@@ -2251,10 +2262,10 @@ def symbolic_expression_from_maxima_string(x, equals_sub=False, maxima=maxima):
+         True
+         sage: sefms("x # 3") == SR(x != 3)
+         True
+-        sage: solve([x != 5], x)
+-        [[x - 5 != 0]]
++        sage: solve([x != 5], x) in [[[x - 5 != 0]], [[x < 5], [5 < x]]]
++        True
+         sage: solve([2*x==3, x != 5], x)
+-        [[x == (3/2), (-7/2) != 0]]
++        [[x == (3/2)...
+ 
+     Make sure that we don't accidentally pick up variables in the maxima namespace (:trac:`8734`)::
+ 
+diff --git a/src/sage/functions/exp_integral.py b/src/sage/functions/exp_integral.py
+index e6c888c64b6..fb0e2235e2b 100644
+--- a/src/sage/functions/exp_integral.py
++++ b/src/sage/functions/exp_integral.py
+@@ -601,8 +601,8 @@ class Function_log_integral_offset(BuiltinFunction):
+         1/log(x)
+         sage: f.integrate(x)
+         -x*log_integral(2) + x*log_integral(x) - Ei(2*log(x))
+-        sage: Li(x).integrate(x,2.0,4.5)
+-        -2.5*log_integral(2) + 5.799321147411334
++        sage: Li(x).integrate(x,2.0,4.5).n()
++        3.18641169711760
+         sage: N(f.integrate(x,2.0,3.0))   # abs tol 1e-15
+         0.601621785860587
+ 
+diff --git a/src/sage/interfaces/expect.py b/src/sage/interfaces/expect.py
+index 68ae715e4c3..84adf0341b5 100644
+--- a/src/sage/interfaces/expect.py
++++ b/src/sage/interfaces/expect.py
+@@ -620,7 +620,7 @@ def quit(self, verbose=False):
+ 
+             sage: a = maxima('y')
+             sage: maxima.quit(verbose=True)
+-            Exiting Maxima with PID ... running .../bin/maxima...
++            Exiting Maxima with PID ... running ...maxima...
+             sage: a._check_valid()
+             Traceback (most recent call last):
+             ...
+diff --git a/src/sage/interfaces/maxima.py b/src/sage/interfaces/maxima.py
+index 27b1e98a6ac..4829560f98b 100644
+--- a/src/sage/interfaces/maxima.py
++++ b/src/sage/interfaces/maxima.py
+@@ -622,11 +622,6 @@ def _start(self):
+             sage: m.is_running()
+             True
+ 
+-        Test that we can use more than 256MB RAM (see :trac:`6772`)::
+-
+-            sage: a = maxima(10)^(10^5)
+-            sage: b = a^600              # long time -- about 10-15 seconds
+-
+         """
+         Expect._start(self)
+         self._sendline(r":lisp (defun tex-derivative (x l r) (tex (if $derivabbrev (tex-dabbrev x) (tex-d x '\\partial)) l r lop rop ))")
+@@ -634,9 +629,6 @@ def _start(self):
+         # Don't use ! for factorials (#11539)
+         self._sendline(":lisp (remprop 'mfactorial 'grind)")
+ 
+-        # Remove limit on the max heapsize (since otherwise it defaults
+-        # to 256MB with ECL).
+-        self._sendline(":lisp (ext:set-limit 'ext:heap-size 0)")
+         self._eval_line('0;')
+ 
+         # set random seed
+diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py
+index c263ac65f02..bba8504aa92 100644
+--- a/src/sage/interfaces/maxima_lib.py
++++ b/src/sage/interfaces/maxima_lib.py
+@@ -934,8 +934,15 @@ def sr_limit(self, expr, v, a, dir=None):
+             e
+             sage: limit(f,x = 5)
+             7776/3125
+-            sage: limit(f,x = 1.2)
++
++        Domain to real, a regression in 5.46.0, see https://sf.net/p/maxima/bugs/4138 ::
++
++            sage: maxima_calculus.eval("domain:real")
++            ...
++            sage: limit(f,x = 1.2).n()
+             2.06961575467...
++            sage: maxima_calculus.eval("domain:complex");
++            ...
+             sage: var('a')
+             a
+             sage: limit(x^a,x=0)
+@@ -947,7 +954,7 @@ def sr_limit(self, expr, v, a, dir=None):
+             for more details)
+             Is a positive, negative or zero?
+             sage: assume(a>0)
+-            sage: limit(x^a,x=0)
++            sage: limit(x^a,x=0)  # random - not needed for maxima 5.46.0
+             Traceback (most recent call last):
+             ...
+             ValueError: Computation failed ...
+diff --git a/src/sage/matrix/matrix2.pyx b/src/sage/matrix/matrix2.pyx
+index e2e6449dfa9..15914b0be3e 100644
+--- a/src/sage/matrix/matrix2.pyx
++++ b/src/sage/matrix/matrix2.pyx
+@@ -15425,9 +15425,10 @@ cdef class Matrix(Matrix1):
+ 
+         TESTS:
+ 
+-        Check that sparse matrices are handled correctly (:trac:`28935`)::
++        Sparse matrices are handled correctly (:trac:`28935`), but may
++        require a patched version of maxima (:trac:`32898`) for now::
+ 
+-            sage: matrix.diagonal([0], sparse=True).exp()
++            sage: matrix.diagonal([0], sparse=True).exp()  # not tested, requires patched maxima
+             [1]
+             sage: matrix.zero(CBF, 2, sparse=True).exp()
+             [1.000000000000000                 0]
+diff --git a/src/sage/matrix/matrix_symbolic_dense.pyx b/src/sage/matrix/matrix_symbolic_dense.pyx
+index 19ca5c85cb2..58a25e002f6 100644
+--- a/src/sage/matrix/matrix_symbolic_dense.pyx
++++ b/src/sage/matrix/matrix_symbolic_dense.pyx
+@@ -402,7 +402,8 @@ cdef class Matrix_symbolic_dense(Matrix_generic_dense):
+             [1/2*(e^(2*x) + 1)*e^(-x) 1/2*(e^(2*x) - 1)*e^(-x)]
+             [1/2*(e^(2*x) - 1)*e^(-x) 1/2*(e^(2*x) + 1)*e^(-x)]
+ 
+-        Exp works on 0x0 and 1x1 matrices::
++        Exponentiation works on 0x0 and 1x1 matrices, but the 1x1 example
++        requires a patched version of maxima (:trac:`32898`) for now::
+ 
+             sage: m = matrix(SR,0,[]); m
+             []
+@@ -410,7 +411,7 @@ cdef class Matrix_symbolic_dense(Matrix_generic_dense):
+             []
+             sage: m = matrix(SR,1,[2]); m
+             [2]
+-            sage: m.exp()
++            sage: m.exp()  # not tested, requires patched maxima
+             [e^2]
+ 
+         Commuting matrices `m, n` have the property that
+@@ -451,7 +452,6 @@ cdef class Matrix_symbolic_dense(Matrix_generic_dense):
+             [                       0 1/2*(e^(2*x) + 1)*e^(-x) 1/2*(e^(2*x) - 1)*e^(-x)                        0]
+             [                       0 1/2*(e^(2*x) - 1)*e^(-x) 1/2*(e^(2*x) + 1)*e^(-x)                        0]
+             [1/2*(e^(2*x) - 1)*e^(-x)                        0                        0 1/2*(e^(2*x) + 1)*e^(-x)]
+-
+         """
+         if not self.is_square():
+             raise ValueError("exp only defined on square matrices")
+diff --git a/src/sage/symbolic/integration/integral.py b/src/sage/symbolic/integration/integral.py
+index c82e9ed73c3..e84ad357ee2 100644
+--- a/src/sage/symbolic/integration/integral.py
++++ b/src/sage/symbolic/integration/integral.py
+@@ -741,14 +741,14 @@ def integrate(expression, v=None, a=None, b=None, algorithm=None, hold=False):
+ 
+         sage: _ = var('x,y')
+         sage: f = log(x^2+y^2)
+-        sage: res = integral(f,x,0.0001414, 1.); res
++        sage: res = integral(f,x,1414/10^7, 1); res
+         Traceback (most recent call last):
+         ...
+-        ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(50015104*y^2-50015103>0)', see `assume?` for more details)
+-        Is 50015104*y^2-50015103 positive, negative or zero?
++        ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help ...
++        Is ... positive, negative or zero?
+         sage: assume(y>1)
+-        sage: res = integral(f,x,0.0001414, 1.); res
+-        2*y*arctan(1.0/y) - 2*y*arctan(0.0001414/y) + 1.0*log(1.0*y^2 + 1.0) - 0.0001414*log(1.0*y^2 + 1.9993959999999997e-08) - 1.9997172
++        sage: res = integral(f,x,1414/10^7, 1); res
++        -2*y*arctan(707/5000000/y) + 2*y*arctan(1/y) + log(y^2 + 1) - 707/5000000*log(y^2 + 499849/25000000000000) - 4999293/2500000
+         sage: nres = numerical_integral(f.subs(y=2), 0.0001414, 1.); nres
+         (1.4638323264144..., 1.6251803529759...e-14)
+         sage: res.subs(y=2).n()
+diff --git a/src/sage/symbolic/relation.py b/src/sage/symbolic/relation.py
+index 94813315181..a72ab547c76 100644
+--- a/src/sage/symbolic/relation.py
++++ b/src/sage/symbolic/relation.py
+@@ -1787,8 +1787,8 @@ def solve_ineq_fourier(ineq, vars=None):
+         sage: y = var('y')
+         sage: solve_ineq_fourier([x+y<9,x-y>4],[x,y])
+         [[y + 4 < x, x < -y + 9, y < (5/2)]]
+-        sage: solve_ineq_fourier([x+y<9,x-y>4],[y,x])
+-        [[y < min(x - 4, -x + 9)]]
++        sage: solve_ineq_fourier([x+y<9,x-y>4],[y,x])[0][0](x=42)
++        y < -33
+ 
+         sage: solve_ineq_fourier([x^2>=0])
+         [[x < +Infinity]]
diff --git a/srcpkgs/sagemath/patches/35635-sympy_1.12.patch b/srcpkgs/sagemath/patches/35635-sympy_1.12.patch
new file mode 100644
index 000000000000..9cfc69c2adb6
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35635-sympy_1.12.patch
@@ -0,0 +1,54 @@
+diff --git a/src/sage/calculus/calculus.py b/src/sage/calculus/calculus.py
+index dae380180ac..ca3c59e63d2 100644
+--- a/src/sage/calculus/calculus.py
++++ b/src/sage/calculus/calculus.py
+@@ -1690,8 +1690,11 @@ def laplace(ex, t, s, algorithm='maxima'):
+ 
+     Testing SymPy::
+ 
+-        sage: laplace(t^n, t, s, algorithm='sympy')
+-        (gamma(n + 1)/(s*s^n), 0, re(n) > -1)
++        sage: F, a, cond = laplace(t^n, t, s, algorithm='sympy')
++        sage: a, cond
++        (0, re(n) > -1)
++        sage: F.simplify()
++        s^(-n - 1)*gamma(n + 1)
+ 
+     Testing Maxima::
+ 
+@@ -1700,17 +1703,19 @@ def laplace(ex, t, s, algorithm='maxima'):
+ 
+     Check that :trac:`24212` is fixed::
+ 
+-        sage: laplace(cos(t^2), t, s, algorithm='sympy')
+-        (-1/2*sqrt(pi)*(sqrt(2)*cos(1/4*s^2)*fresnel_sin(1/2*sqrt(2)*s/sqrt(pi)) -
+-        sqrt(2)*fresnel_cos(1/2*sqrt(2)*s/sqrt(pi))*sin(1/4*s^2) - cos(1/4*pi + 1/4*s^2)),
+-        0, True)
++        sage: F, a, cond = laplace(cos(t^2), t, s, algorithm='sympy')
++        sage: a, cond
++        (0, True)
++        sage: F._sympy_().simplify()
++        sqrt(pi)*(sqrt(2)*sin(s**2/4)*fresnelc(sqrt(2)*s/(2*sqrt(pi))) -
++        sqrt(2)*cos(s**2/4)*fresnels(sqrt(2)*s/(2*sqrt(pi))) + cos(s**2/4 + pi/4))/2
+ 
+     Testing result from SymPy that Sage doesn't know how to handle::
+ 
+         sage: laplace(cos(-1/t), t, s, algorithm='sympy')
+         Traceback (most recent call last):
+         ...
+-        AttributeError: Unable to convert SymPy result (=meijerg(((), ()), ((-1/2, 0, 1/2), (0,)), s**2/16)/4) into Sage
++        AttributeError: Unable to convert SymPy result (=meijerg(((), ()), ((-1/2, 0, 1/2), (0,)), ...)/4) into Sage
+     """
+     if not isinstance(ex, (Expression, Function)):
+         ex = SR(ex)
+@@ -1817,8 +1822,8 @@ def inverse_laplace(ex, s, t, algorithm='maxima'):
+ 
+     Transform an expression involving a time-shift, via SymPy::
+ 
+-        sage: inverse_laplace(1/s^2*exp(-s), s, t, algorithm='sympy')
+-        -(log(e^(-t)) + 1)*heaviside(t - 1)
++        sage: inverse_laplace(1/s^2*exp(-s), s, t, algorithm='sympy').simplify()
++        (t - 1)*heaviside(t - 1)
+ 
+     The same instance with Giac::
+ 
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 871ae38577fd..d510bb367c7a 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 URL_BASE_PR="https://github.com/sagemath/sage/pull/"
-URL_BASE_COMPARE="https://github.com/sagemath/sage/compare/9.8..."
+URL_BASE_COMPARE="https://github.com/sagemath/sage/compare/10.0.rc0..."
 
 case "$1" in
 	-n)  DO=echo ;;
@@ -15,49 +15,11 @@ get_pr() {
 	$DO wget "$URL_BASE_PR$pr.$ext" -O "$pr-$desc.patch"
 }
 
-get_trac() {
-	ticket=$1
-	desc=$(echo "$2" | sed -e 's/ /_/g')
-	commit=$3
-	$DO wget "$URL_BASE_COMPARE$commit.diff" -O "$ticket-$desc-$commit.patch"
-}
-
 # run from patches dir
 cd $(dirname "$0")
 
-# merged in 10.0.beta0
-get_trac 34851 "support singular 4.3.1.p3" 5e5737a0c
-get_pr 35068 "fix tests giac 1.9.0.35" patch
-
-# merged in 10.0.beta1
-get_pr 35058 "skip unstable tests klyachko"
-
-# merged in 10.0.beta2
-get_pr 34994 "fix tests numpy 1.24"
-get_pr 34997 "fix edge case of integer_check"
-
-# merged in 10.0.beta3
-get_pr 34995 "support tachyon 0.99.2"
-
-# merged in 10.0.beta4
-get_pr 34980 "avoid factoring in is_prime"
-
-# merged in 10.0.beta5
-get_pr 35094 "support gap 4.12"					# includes PR 35093
-
-# merged in 10.0.beta6
-get_pr 35127 "fix very slow test stream.py"
-get_pr 35177 "matplotlib 3.7"
-get_pr 35195 "workaround ecl race"
-get_pr 35204 "fix sage-cleaner"
-
-# merged in 10.0.beta7
-get_pr 35250 "nauty 2.8.6"
-
-# merged in 10.0.beta8
-#get_pr 35337 "ipython 8.11"
-get_pr 35423 "ipython 8.12"						# includes PR 35337
-get_pr 35438 "pythran 0.12.1"
-
 # needs review
 get_pr 35584 "networkx 3.1"
+get_pr 35612 "linbox 1.7.0"
+get_pr 35619 "maxima 5.46.0"
+get_pr 35635 "sympy 1.12"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 66a543efd21d..eb63ba98d5e8 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=9.8
-revision=2
+version=10.0.rc3
+revision=1
 build_wrksrc=pkgs/sagemath-standard
 build_style=python3-module
 _bindir=/usr/lib/sagemath/$version/bin
@@ -32,7 +32,7 @@ maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-or-later"
 homepage="http://sagemath.org/"
 distfiles="https://github.com/sagemath/sage/archive/refs/tags/$version.tar.gz"
-checksum=2aff28bd1d18c2d526581f5298acb8336f5b92db5675a7403dec8eaf9a86bc4c
+checksum=2fcc4fc6bd24027688bf8af373783b86e6139773ee53aee81156de8bc61656f0
 
 do_configure() {
 	# git tree needs bootstrapping

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [RFC] sagemath: update to 10.0.rc3.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (16 preceding siblings ...)
  2023-05-13  3:14 ` [PR PATCH] [Updated] [RFC] sagemath: update to 10.0.rc3 tornaria
@ 2023-05-13 18:12 ` dkwo
  2023-05-13 22:12 ` [PR PATCH] [Updated] " tornaria
                   ` (21 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: dkwo @ 2023-05-13 18:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 162 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43659#issuecomment-1546723246

Comment:
thanks! I'll test soon.

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] sagemath: update to 10.0.rc3.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (17 preceding siblings ...)
  2023-05-13 18:12 ` dkwo
@ 2023-05-13 22:12 ` tornaria
  2023-05-15 15:04 ` dkwo
                   ` (20 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: tornaria @ 2023-05-13 22:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1700 bytes --]

There is an updated pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages sagemath-next
https://github.com/void-linux/void-packages/pull/43659

[RFC] sagemath: update to 10.0.rc3.
<!-- Uncomment relevant sections and delete options which are not applicable -->

This builds on top of #43225 for convenience.

#### Testing the changes
- I tested the changes in this PR: **briefly**

I've been following beta releases and now rc0 includes all of our patches :muscle:

All doctests pass with the version of packages in void except for `python-Babel` which must be updated (as in #43497) and is included  here as part of #43225.

I've switched my system sagemath to this version as everything seems to be working ok. The testsuite is 10-15% faster.

@dkwo: enjoy.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/43659.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-sagemath-next-43659.patch --]
[-- Type: text/x-diff, Size: 184683 bytes --]

From 344caff539dfb205c4093fe94bd08f0cbb59fee4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Dec 2021 20:20:09 -0300
Subject: [PATCH 1/6] givaro: update to 4.2.0.

---
 srcpkgs/givaro/patches/197.patch | 28 ++++++++++++++++++++++++++++
 srcpkgs/givaro/template          |  9 ++++-----
 2 files changed, 32 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/givaro/patches/197.patch

diff --git a/srcpkgs/givaro/patches/197.patch b/srcpkgs/givaro/patches/197.patch
new file mode 100644
index 000000000000..bafaff3efbd9
--- /dev/null
+++ b/srcpkgs/givaro/patches/197.patch
@@ -0,0 +1,28 @@
+From ab3d332508c21daff41fb64a8658cdc7cc74fc47 Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
+Date: Thu, 16 Dec 2021 17:12:25 +0100
+Subject: [PATCH] dom_power argument is now an uint64_t to avoid problem with
+ 32bit machine
+
+---
+ src/kernel/system/givpower.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/kernel/system/givpower.h b/src/kernel/system/givpower.h
+index eb784872..5644264d 100644
+--- a/src/kernel/system/givpower.h
++++ b/src/kernel/system/givpower.h
+@@ -71,11 +71,11 @@ namespace Givaro {
+ 
+     //! dom_power
+     template<class D, class TT>
+-    TT& dom_power(TT& res, const TT& n, long l, const D& F)
++    TT& dom_power(TT& res, const TT& n, uint64_t l, const D& F)
+     {
+         if (l == 0) return F.assign(res,F.one) ;
+ 
+-        unsigned long p = (unsigned long) l ;
++        uint64_t p = l;
+         bool is_assg = false ;
+ 
+         TT puiss; F.init(puiss); F.assign(puiss,n) ;
diff --git a/srcpkgs/givaro/template b/srcpkgs/givaro/template
index 9c16de5b1974..52457c02a1ed 100644
--- a/srcpkgs/givaro/template
+++ b/srcpkgs/givaro/template
@@ -1,6 +1,6 @@
 # Template file for 'givaro'
 pkgname=givaro
-version=4.1.1
+version=4.2.0
 revision=1
 build_style=gnu-configure
 makedepends="gmpxx-devel"
@@ -8,16 +8,15 @@ short_desc="C++ library for arithmetic and algebraic computations"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="CECILL-B"
 homepage="https://github.com/linbox-team/givaro"
+changelog="https://github.com/linbox-team/givaro/raw/master/ChangeLog"
 distfiles="https://github.com/linbox-team/givaro/releases/download/v${version}/givaro-${version}.tar.gz"
-checksum=628049899386e91da245aee6cd446350fbca87e94863bc0d815066c08150487f
+checksum=865e228812feca971dfb6e776a7bc7ac959cf63ebd52b4f05492730a46e1f189
 nocross=yes
 
 build_options="native_build"
 
 if [ -z "$build_option_native_build" ]; then
-	configure_args="--enable-sse --enable-sse2
-	  --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42
-	  --disable-avx --disable-avx2 --disable-fma --disable-fma4"
+	configure_args="--without-archnative"
 fi
 
 post_install() {

From e6b3a8911e7e4fd75b98e36ddab10fa505908980 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Dec 2021 20:20:17 -0300
Subject: [PATCH 2/6] fflas-ffpack: update to 2.5.0.

---
 srcpkgs/fflas-ffpack/patches/357.patch | 35 ++++++++++++++++++++++++++
 srcpkgs/fflas-ffpack/template          | 12 ++++-----
 2 files changed, 40 insertions(+), 7 deletions(-)
 create mode 100644 srcpkgs/fflas-ffpack/patches/357.patch

diff --git a/srcpkgs/fflas-ffpack/patches/357.patch b/srcpkgs/fflas-ffpack/patches/357.patch
new file mode 100644
index 000000000000..99fd34efd93b
--- /dev/null
+++ b/srcpkgs/fflas-ffpack/patches/357.patch
@@ -0,0 +1,35 @@
+From 9b6083c663096e9ca85775b79f1f27c848dbeb98 Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
+Date: Fri, 17 Dec 2021 10:27:02 +0100
+Subject: [PATCH] Fix SimdChooser: on not x86_64 machines its value could be an
+ nonexistant struct
+
+---
+ fflas-ffpack/fflas/fflas_simd.h | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/fflas-ffpack/fflas/fflas_simd.h b/fflas-ffpack/fflas/fflas_simd.h
+index bf5d30211..84ced0fd8 100644
+--- a/fflas-ffpack/fflas/fflas_simd.h
++++ b/fflas-ffpack/fflas/fflas_simd.h
+@@ -384,6 +384,20 @@ struct SimdChooser<T, true, true> // integral number
+ #endif
+ };
+ 
++#ifndef __x86_64__
++template <>
++struct SimdChooser<uint64_t, true, true>
++{
++    using value = NoSimd<uint64_t>;
++};
++
++template <>
++struct SimdChooser<int64_t, true, true>
++{
++    using value = NoSimd<int64_t>;
++};
++#endif
++
+ template <class T> using Simd = typename SimdChooser<T>::value;
+ 
+ // template <class T> struct SimdChooser<T, true> {
diff --git a/srcpkgs/fflas-ffpack/template b/srcpkgs/fflas-ffpack/template
index 557c644c00a4..2aa599703585 100644
--- a/srcpkgs/fflas-ffpack/template
+++ b/srcpkgs/fflas-ffpack/template
@@ -1,6 +1,6 @@
 # Template file for 'fflas-ffpack'
 pkgname=fflas-ffpack
-version=2.4.3
+version=2.5.0
 revision=1
 build_style=gnu-configure
 hostmakedepends="pkg-config"
@@ -10,15 +10,13 @@ short_desc="Finite Field Linear Algebra Subroutines / Package"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="LGPL-2.1-or-later"
 homepage="http://linbox-team.github.io/fflas-ffpack/"
-distfiles="https://github.com/linbox-team/fflas-ffpack/releases/download/${version}/fflas-ffpack-${version}.tar.gz"
-checksum=f372783a17a9899ee9f88d4c9421d80facccb95556146dad7020d07a03791cc9
+changelog="https://github.com/linbox-team/fflas-ffpack/raw/master/ChangeLog"
+distfiles="https://github.com/linbox-team/fflas-ffpack/releases/download/v${version}/fflas-ffpack-${version}.tar.gz"
+checksum=dafb4c0835824d28e4f823748579be6e4c8889c9570c6ce9cce1e186c3ebbb23
 nocross=yes
 
 build_options="native_build"
 
 if [ -z "$build_option_native_build" ]; then
-	configure_args="--enable-sse --enable-sse2
-	  --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42
-	  --disable-avx --disable-avx2 --disable-fma --disable-fma4
-	  --disable-avx512f --disable-avx512dq --disable-avx512vl"
+	configure_args="--without-archnative"
 fi

From f2d245ec1f1aab5a1878ff7094e3fe4c3100232e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Dec 2021 20:20:20 -0300
Subject: [PATCH 3/6] linbox: update to 1.7.0.

---
 srcpkgs/linbox/patches/292.patch              | 24 ++++++++++++
 srcpkgs/linbox/patches/294.patch              | 38 +++++++++++++++++++
 ...8adade10641f1f04f04b589753d928fb5443.patch | 35 -----------------
 .../remove-linboxsage-libs-from-pc.patch      | 23 -----------
 srcpkgs/linbox/template                       | 11 +++---
 5 files changed, 67 insertions(+), 64 deletions(-)
 create mode 100644 srcpkgs/linbox/patches/292.patch
 create mode 100644 srcpkgs/linbox/patches/294.patch
 delete mode 100644 srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch
 delete mode 100644 srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch

diff --git a/srcpkgs/linbox/patches/292.patch b/srcpkgs/linbox/patches/292.patch
new file mode 100644
index 000000000000..d3333cc23d0b
--- /dev/null
+++ b/srcpkgs/linbox/patches/292.patch
@@ -0,0 +1,24 @@
+From 49b9cccd0286980c1c1811c3b03df883ef0164df Mon Sep 17 00:00:00 2001
+From: Doug Torrance <dtorrance@piedmont.edu>
+Date: Tue, 14 Dec 2021 16:22:33 -0500
+Subject: [PATCH] Only register uint128_t as a TypeName when it's available.
+
+Otherwise, test-fft will fail when it isn't.
+---
+ tests/test-fft.C | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/tests/test-fft.C b/tests/test-fft.C
+index d19184c2d..5811ebc5d 100644
+--- a/tests/test-fft.C
++++ b/tests/test-fft.C
+@@ -55,7 +55,9 @@ REGISTER_TYPE_NAME(double);
+ REGISTER_TYPE_NAME(uint16_t);
+ REGISTER_TYPE_NAME(uint32_t);
+ REGISTER_TYPE_NAME(uint64_t);
++#ifdef __FFLASFFPACK_HAVE_INT128
+ REGISTER_TYPE_NAME(uint128_t);
++#endif
+ REGISTER_TYPE_NAME(Modular);
+ REGISTER_TYPE_NAME(ModularExtended);
+ 
diff --git a/srcpkgs/linbox/patches/294.patch b/srcpkgs/linbox/patches/294.patch
new file mode 100644
index 000000000000..7c645f165d39
--- /dev/null
+++ b/srcpkgs/linbox/patches/294.patch
@@ -0,0 +1,38 @@
+From f81a1f4a5e0835b7a0f3bb88a0fcbbaa32174cfa Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
+Date: Wed, 15 Dec 2021 16:00:39 +0100
+Subject: [PATCH] Only register uint128_t as a TypeName when it's available
+
+---
+ benchmarks/benchmark-fft.C                       | 2 ++
+ benchmarks/benchmark-polynomial-matrix-mul-fft.C | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/benchmarks/benchmark-fft.C b/benchmarks/benchmark-fft.C
+index 39b86c9d9..59a8be57c 100644
+--- a/benchmarks/benchmark-fft.C
++++ b/benchmarks/benchmark-fft.C
+@@ -54,7 +54,9 @@ REGISTER_TYPE_NAME(double);
+ REGISTER_TYPE_NAME(uint16_t);
+ REGISTER_TYPE_NAME(uint32_t);
+ REGISTER_TYPE_NAME(uint64_t);
++#ifdef __FFLASFFPACK_HAVE_INT128
+ REGISTER_TYPE_NAME(uint128_t);
++#endif
+ REGISTER_TYPE_NAME(Modular);
+ REGISTER_TYPE_NAME(ModularExtended);
+ 
+diff --git a/benchmarks/benchmark-polynomial-matrix-mul-fft.C b/benchmarks/benchmark-polynomial-matrix-mul-fft.C
+index e9b184bcf..7bf17f33e 100644
+--- a/benchmarks/benchmark-polynomial-matrix-mul-fft.C
++++ b/benchmarks/benchmark-polynomial-matrix-mul-fft.C
+@@ -65,7 +65,9 @@ REGISTER_TYPE_NAME(double);
+ REGISTER_TYPE_NAME(uint16_t);
+ REGISTER_TYPE_NAME(uint32_t);
+ REGISTER_TYPE_NAME(uint64_t);
++#ifdef __FFLASFFPACK_HAVE_INT128
+ REGISTER_TYPE_NAME(uint128_t);
++#endif
+ REGISTER_TYPE_NAME(Modular);
+ REGISTER_TYPE_NAME(ModularExtended);
+ 
diff --git a/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch b/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch
deleted file mode 100644
index 5afa078ec7b8..000000000000
--- a/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 892f8adade10641f1f04f04b589753d928fb5443 Mon Sep 17 00:00:00 2001
-From: Doug Torrance <dtorrance@piedmont.edu>
-Date: Sun, 9 May 2021 12:14:19 -0400
-Subject: [PATCH] Use std::ptrdiff_t for vector iterator difference type
-
-It was previously long (64-bit integers), but this will not be the
-case on 32-bit systems.
-
-Closes: #273
----
- linbox/vector/bit-vector.inl | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/linbox/vector/bit-vector.inl b/linbox/vector/bit-vector.inl
-index 5fa84b421..23a22ba47 100644
---- a/linbox/vector/bit-vector.inl
-+++ b/linbox/vector/bit-vector.inl
-@@ -46,7 +46,7 @@ namespace std
- 		typedef LinBox::BitVector::reference reference;
- 		typedef bool *pointer;
- 		typedef bool value_type;
--		typedef long difference_type;
-+		typedef std::ptrdiff_t difference_type;
- 	};
- 
- 	template <>
-@@ -56,7 +56,7 @@ namespace std
- 		typedef LinBox::BitVector::const_reference reference;
- 		typedef const bool *pointer;
- 		typedef bool value_type;
--		typedef long difference_type;
-+		typedef std::ptrdiff_t difference_type;
- 	};
- }
- 
diff --git a/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch b/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch
deleted file mode 100644
index c93915fb1b06..000000000000
--- a/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Backported from:
-
-From 426eb97ba762c7663884f57ead0909f2aa3cd6a5 Mon Sep 17 00:00:00 2001
-From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
-Date: Thu, 17 Jan 2019 16:32:19 +0100
-Subject: [PATCH] Remove @LINBOXSAGE_LIBS@ from linbox.pc.in
-
----
- linbox.pc.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/linbox.pc.in b/linbox.pc.in
-index 278f127e4..c6b8091eb 100644
---- a/linbox.pc.in
-+++ b/linbox.pc.in
-@@ -9,6 +9,6 @@ Description: Exact Linear Algebra library
- URL: http://github.com/linbox-team/linbox
- Version: @VERSION@
- Requires: fflas-ffpack >= 2.4.0, givaro >= 4.1.0
--Libs: -L${libdir} -llinbox @LINBOXSAGE_LIBS@ @NTL_LIBS@ @MPFR_LIBS@ @FPLLL_LIBS@ @IML_LIBS@ @FLINT_LIBS@ @OCL_LIBS@
-+Libs: -L${libdir} -llinbox @NTL_LIBS@ @MPFR_LIBS@ @FPLLL_LIBS@ @IML_LIBS@ @FLINT_LIBS@ @OCL_LIBS@
- Cflags: @DEFAULT_CFLAGS@ -DDISABLE_COMMENTATOR -I${includedir} @NTL_CFLAGS@ @MPFR_CFLAGS@ @FPLLL_CFLAGS@  @IML_CFLAGS@ @FLINT_CFLAGS@ 
- \-------------------------------------------------------
diff --git a/srcpkgs/linbox/template b/srcpkgs/linbox/template
index 096a15b3390b..e6edacdd0a74 100644
--- a/srcpkgs/linbox/template
+++ b/srcpkgs/linbox/template
@@ -1,7 +1,7 @@
 # Template file for 'linbox'
 pkgname=linbox
-version=1.6.3
-revision=2
+version=1.7.0
+revision=1
 build_style=gnu-configure
 hostmakedepends="pkg-config"
 makedepends="fflas-ffpack"
@@ -9,16 +9,15 @@ short_desc="C++ library for exact, high-performance linear algebra"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="LGPL-2.1-or-later"
 homepage="https://linalg.org"
+changelog="https://github.com/linbox-team/linbox/raw/master/ChangeLog"
 distfiles="https://github.com/linbox-team/linbox/releases/download/v${version}/linbox-${version}.tar.gz"
-checksum=a58a188307b07c57964e844bceb99321d3043a8a4a1fccc082a54928bb9a0057
+checksum=6d2159fd395be0298362dd37f6c696676237bc8e2757341fbc46520e3b466bcc
 nocross=yes
 
 build_options="native_build"
 
 if [ -z "$build_option_native_build" ]; then
-	configure_args="--enable-sse --enable-sse2
-	  --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42
-	  --disable-avx --disable-avx2 --disable-fma --disable-fma4"
+	configure_args="--without-archnative"
 fi
 
 linbox-devel_package() {

From 34571858f8c8e12121e4776f126fe8e97e94431b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Fri, 15 Apr 2022 14:25:08 -0300
Subject: [PATCH 4/6] maxima: update to 5.46.0.

Also:
 - disable sbcl on aarch64
 - don't makedepends on emacs (avoid a nocross build dep)
 - move maxima-emacs files to main pkg
 - adopt
---
 ...a43e5234305bd6f1de5909d4ce5d7e1ea864.patch | 24 -------------------
 srcpkgs/maxima/template                       | 24 +++++++------------
 2 files changed, 9 insertions(+), 39 deletions(-)
 delete mode 100644 srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch

diff --git a/srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch b/srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch
deleted file mode 100644
index e1ac1e5f6086..000000000000
--- a/srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-commit a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864
-Author: Robert Dodier <robert_dodier@users.sourceforge.net>
-Date:   Mon Oct 11 22:40:13 2021 -0700
-
-    Apply patch #80: "Build a FASL library, needed by SageMath"
-    
-    This modifies maxima.system for ECL only.
-
-diff --git a/src/maxima.system b/src/maxima.system
-index d954bc2b9..525fb778e 100644
---- a/src/maxima.system
-+++ b/src/maxima.system
-@@ -75,6 +75,11 @@
- 			     ;; Convert dir/foo.fas to dir/foo.o
- 			     (make-pathname :type "o" :defaults p))
- 			 files)))
-+	(c::build-fasl "binary-ecl/maxima" :lisp-files obj
-+			  :ld-flags
-+			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
-+							      (find-package "MAXIMA")))))
-+			    (if (and x (not (string= x ""))) (list x))))
- 	(c::build-program "binary-ecl/maxima" :lisp-files obj
- 			  :ld-flags
- 			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
diff --git a/srcpkgs/maxima/template b/srcpkgs/maxima/template
index 69e85ec833e8..c0002aa2b3ab 100644
--- a/srcpkgs/maxima/template
+++ b/srcpkgs/maxima/template
@@ -1,19 +1,21 @@
 # Template file for 'maxima'
 pkgname=maxima
-version=5.45.1
-revision=4
+version=5.46.0
+revision=1
 build_style=gnu-configure
 configure_args="$(vopt_enable clisp) $(vopt_enable sbcl sbcl-exec) $(vopt_enable ecl)"
-hostmakedepends="python3 perl emacs texinfo patchelf"
+hostmakedepends="python3 perl texinfo patchelf $(vopt_if ecl ecl)"
 makedepends="$(vopt_if clisp clisp) $(vopt_if sbcl sbcl) $(vopt_if ecl ecl)"
 depends="$(vopt_if clisp clisp) rlwrap"
 checkdepends="gnuplot"
 short_desc="Computer Algebra System"
-maintainer="Bosco Garcia <jboscogg@gmail.org>"
+maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-only"
 homepage="http://maxima.sourceforge.net"
+changelog="https://sourceforge.net/p/maxima/code/ci/master/tree/changelogs/ChangeLog-${version%.*}.md?format=raw"
 distfiles="${SOURCEFORGE_SITE}/maxima/maxima-${version}.tar.gz"
-checksum=fe9016276970bef214a1a244348558644514d7fdfaa4fc8b9d0e87afcbb4e7dc
+checksum=7390f06b48da65c9033e8b2f629b978b90056454a54022db7de70e2225aa8b07
+nocross=yes
 
 # maxima-sbcl is nopie and should NOT be stripped or it won't work
 nostrip_files=/usr/lib/maxima/$version/binary-sbcl/maxima
@@ -32,7 +34,7 @@ build_options_default="ecl"
 
 # sbcl is only available for these architectures
 case "$XBPS_TARGET_MACHINE" in
-	i686|x86_64*|armv7l|aarch64|ppc64le*)
+	i686|x86_64*|armv7l|ppc64le*)
 		build_options_default+=" sbcl"
 		;;
 esac
@@ -112,14 +114,6 @@ maxima-src_package() {
 	}
 }
 
-maxima-emacs_package() {
-	short_desc+=" - Emacs interface"
-	depends="${sourcepkg}-${version}_${revision} virtual?emacs"
-	pkg_install() {
-		vmove usr/share/emacs
-	}
-}
-
 xmaxima_package() {
 	short_desc+=" - Tk interface"
 	depends="${sourcepkg}-${version}_${revision} tk"
@@ -151,4 +145,4 @@ maxima-ecl_package() {
 	}
 }
 
-subpackages="maxima-src maxima-emacs xmaxima $(vopt_if ecl maxima-ecl)"
+subpackages="maxima-src xmaxima $(vopt_if ecl maxima-ecl)"

From cbaaa6f154433d50e4b60a1b464598c646db4a54 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 10 May 2023 17:10:20 -0300
Subject: [PATCH 5/6] python3-sympy: update to 1.12.

---
 srcpkgs/python3-sympy/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/python3-sympy/template b/srcpkgs/python3-sympy/template
index eb24d5c8d4bb..cb8297158027 100644
--- a/srcpkgs/python3-sympy/template
+++ b/srcpkgs/python3-sympy/template
@@ -1,7 +1,7 @@
 # Template file for 'python3-sympy'
 pkgname=python3-sympy
-version=1.11.1
-revision=2
+version=1.12
+revision=1
 build_style=python3-module
 hostmakedepends="python3-setuptools"
 depends="python3-mpmath"
@@ -12,7 +12,7 @@ license="BSD-3-Clause"
 homepage="https://sympy.org/"
 changelog="https://github.com/sympy/sympy/wiki/Release-Notes"
 distfiles="${PYPI_SITE}/s/sympy/sympy-${version}.tar.gz"
-checksum=e32380dce63cb7c0108ed525570092fd45168bdae2faa17e528221ef72e88658
+checksum=ebf595c8dac3e0fdc4152c51878b498396ec7f30e7a914d6071e674d49420fb8
 
 post_install() {
 	vman doc/man/isympy.1

From d91d1e1c3dec01b8ea1e480615120fe1e602bb9a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Feb 2023 22:53:33 -0300
Subject: [PATCH 6/6] sagemath: update to 10.0.rc3.

Also:
 - support networkx 3.1 (sagemath#35584)
 - support linbox 1.7.0 (sagemath#35612)
 - support maxima 5.46.0 (sagemath#35619)
 - support sympy 1.12 (sagemath#35635)
---
 srcpkgs/sagemath/files/sage_conf.py           |    1 -
 srcpkgs/sagemath/files/timings2.json          |  405 ++---
 ...-support_singular_4.3.1.p3-5e5737a0c.patch |  205 ---
 .../34980-avoid_factoring_in_is_prime.patch   |   49 -
 .../patches/34994-fix_tests_numpy_1.24.patch  |   58 -
 .../34995-support_tachyon_0.99.2.patch        |   57 -
 ...34997-fix_edge_case_of_integer_check.patch |   36 -
 .../35058-skip_unstable_tests_klyachko.patch  |   22 -
 .../35068-fix_tests_giac_1.9.0.35.patch       |   62 -
 .../patches/35094-support_gap_4.12.patch      | 1303 -----------------
 .../35127-fix_very_slow_test_stream.py.patch  |   15 -
 .../patches/35177-matplotlib_3.7.patch        |   95 --
 .../patches/35195-workaround_ecl_race.patch   |   56 -
 .../patches/35204-fix_sage-cleaner.patch      |   28 -
 .../sagemath/patches/35250-nauty_2.8.6.patch  |   35 -
 .../sagemath/patches/35423-ipython_8.12.patch |   51 -
 .../patches/35438-pythran_0.12.1.patch        |   41 -
 .../sagemath/patches/35584-networkx_3.1.patch |   35 +-
 .../sagemath/patches/35612-linbox_1.7.0.patch |   64 +
 .../patches/35619-maxima_5.46.0.patch         |  578 ++++++++
 .../sagemath/patches/35635-sympy_1.12.patch   |   54 +
 srcpkgs/sagemath/patches/get_patches          |   46 +-
 srcpkgs/sagemath/template                     |    6 +-
 23 files changed, 833 insertions(+), 2469 deletions(-)
 delete mode 100644 srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
 delete mode 100644 srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
 delete mode 100644 srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
 delete mode 100644 srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
 delete mode 100644 srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
 delete mode 100644 srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
 delete mode 100644 srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
 delete mode 100644 srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
 delete mode 100644 srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
 delete mode 100644 srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
 delete mode 100644 srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
 delete mode 100644 srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
 delete mode 100644 srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
 delete mode 100644 srcpkgs/sagemath/patches/35423-ipython_8.12.patch
 delete mode 100644 srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
 create mode 100644 srcpkgs/sagemath/patches/35612-linbox_1.7.0.patch
 create mode 100644 srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch
 create mode 100644 srcpkgs/sagemath/patches/35635-sympy_1.12.patch

diff --git a/srcpkgs/sagemath/files/sage_conf.py b/srcpkgs/sagemath/files/sage_conf.py
index 00de40f1ee4f..bc5388de8956 100644
--- a/srcpkgs/sagemath/files/sage_conf.py
+++ b/srcpkgs/sagemath/files/sage_conf.py
@@ -1,4 +1,3 @@
 # configuration for sage on void linux
 SAGE_SHARE = "/usr/share/sagemath"
 GAP_SHARE_DIR = "/usr/share/gap"
-GAP_LIB_DIR = "/usr/lib/gap"
diff --git a/srcpkgs/sagemath/files/timings2.json b/srcpkgs/sagemath/files/timings2.json
index bb3098680502..b2b3fe818a20 100644
--- a/srcpkgs/sagemath/files/timings2.json
+++ b/srcpkgs/sagemath/files/timings2.json
@@ -1,281 +1,152 @@
 {
-  "doc.ca.intro.index": {"walltime": 8},
-  "doc.en.constructions.calculus": {"walltime": 64},
-  "doc.en.constructions.plotting": {"walltime": 32},
-  "doc.en.prep.Advanced-2DPlotting": {"walltime": 16},
-  "doc.en.prep.Calculus": {"walltime": 8},
-  "doc.en.prep.Symbolics-and-Basic-Plotting": {"walltime": 8},
-  "doc.en.thematic_tutorials.explicit_methods_in_number_theory.birds_other": {"walltime": 8},
-  "doc.en.thematic_tutorials.explicit_methods_in_number_theory.elliptic_curves": {"walltime": 8},
-  "doc.en.thematic_tutorials.geometry.polyhedra_tutorial": {"walltime": 16},
-  "doc.en.thematic_tutorials.sandpile": {"walltime": 16},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_advanced": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_cartesian": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_change": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_curvilinear": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_plane": {"walltime": 16},
-  "doc.ja.tutorial.tour_plotting": {"walltime": 8},
-  "sage.algebras.cluster_algebra": {"walltime": 8},
   "sage.algebras.commutative_dga": {"walltime": 16},
-  "sage.algebras.hecke_algebras.ariki_koike_algebra": {"walltime": 8},
-  "sage.algebras.iwahori_hecke_algebra": {"walltime": 8},
-  "sage.algebras.lie_algebras.classical_lie_algebra": {"walltime": 128},
-  "sage.algebras.lie_algebras.nilpotent_lie_algebra": {"walltime": 16},
-  "sage.algebras.quantum_clifford": {"walltime": 16},
-  "sage.algebras.quantum_groups.fock_space": {"walltime": 8},
-  "sage.algebras.quatalg.quaternion_algebra": {"walltime": 8},
-  "sage.algebras.steenrod.steenrod_algebra": {"walltime": 64},
-  "sage.algebras.steenrod.steenrod_algebra_bases": {"walltime": 8},
-  "sage.algebras.yangian": {"walltime": 8},
-  "sage.arith.misc": {"walltime": 32},
+  "sage.algebras.fusion_rings.f_matrix": {"walltime": 16},
+  "sage.algebras.fusion_rings.fusion_ring": {"walltime": 16},
+  "sage.algebras.hecke_algebras.cubic_hecke_algebra": {"walltime": 8},
+  "sage.algebras.lie_conformal_algebras.n2_lie_conformal_algebra": {"walltime": 8},
+  "sage.algebras.quantum_clifford": {"walltime": 8},
+  "sage.algebras.steenrod.steenrod_algebra": {"walltime": 8},
   "sage.calculus.calculus": {"walltime": 16},
   "sage.calculus.desolvers": {"walltime": 8},
-  "sage.calculus.functional": {"walltime": 8},
-  "sage.calculus.riemann": {"walltime": 64},
-  "sage.calculus.tests": {"walltime": 16},
-  "sage.calculus.transforms.dwt": {"walltime": 16},
+  "sage.calculus.riemann": {"walltime": 8},
   "sage.calculus.transforms.fft": {"walltime": 8},
   "sage.categories.coxeter_groups": {"walltime": 8},
-  "sage.categories.finite_monoids": {"walltime": 16},
-  "sage.categories.lie_conformal_algebras": {"walltime": 8},
+  "sage.categories.finite_monoids": {"walltime": 8},
   "sage.categories.loop_crystals": {"walltime": 8},
-  "sage.categories.pushout": {"walltime": 8},
-  "sage.categories.super_hopf_algebras_with_basis": {"walltime": 32},
-  "sage.categories.super_lie_conformal_algebras": {"walltime": 8},
-  "sage.coding.ag_code": {"walltime": 64},
-  "sage.coding.ag_code_decoders": {"walltime": 128},
-  "sage.coding.binary_code": {"walltime": 8},
-  "sage.coding.linear_code": {"walltime": 16},
-  "sage.combinat.backtrack": {"walltime": 32},
-  "sage.combinat.chas.wqsym": {"walltime": 32},
-  "sage.combinat.cluster_algebra_quiver.cluster_seed": {"walltime": 64},
-  "sage.combinat.cluster_algebra_quiver.quiver": {"walltime": 128},
-  "sage.combinat.crystals.affine_factorization": {"walltime": 16},
-  "sage.combinat.crystals.alcove_path": {"walltime": 32},
-  "sage.combinat.crystals.highest_weight_crystals": {"walltime": 8},
-  "sage.combinat.crystals.kirillov_reshetikhin": {"walltime": 16},
-  "sage.combinat.crystals.letters": {"walltime": 8},
-  "sage.combinat.crystals.littelmann_path": {"walltime": 16},
-  "sage.combinat.crystals.mv_polytopes": {"walltime": 16},
-  "sage.combinat.crystals.pbw_crystal": {"walltime": 16},
-  "sage.combinat.crystals.star_crystal": {"walltime": 8},
-  "sage.combinat.designs.bibd": {"walltime": 8},
-  "sage.combinat.designs.database": {"walltime": 16},
+  "sage.coding.ag_code": {"walltime": 32},
+  "sage.coding.ag_code_decoders": {"walltime": 32},
+  "sage.coding.linear_code": {"walltime": 32},
+  "sage.combinat.designs.database": {"walltime": 8},
   "sage.combinat.designs.difference_family": {"walltime": 8},
-  "sage.combinat.designs.gen_quadrangles_with_spread": {"walltime": 128},
-  "sage.combinat.designs.orthogonal_arrays_build_recursive": {"walltime": 16},
-  "sage.combinat.designs.orthogonal_arrays_find_recursive": {"walltime": 8},
-  "sage.combinat.diagram_algebras": {"walltime": 64},
-  "sage.combinat.fqsym": {"walltime": 32},
-  "sage.combinat.free_prelie_algebra": {"walltime": 8},
-  "sage.combinat.fully_commutative_elements": {"walltime": 8},
-  "sage.combinat.grossman_larson_algebras": {"walltime": 8},
-  "sage.combinat.interval_posets": {"walltime": 8},
+  "sage.combinat.designs.orthogonal_arrays_build_recursive": {"walltime": 8},
   "sage.combinat.k_regular_sequence": {"walltime": 8},
   "sage.combinat.k_tableau": {"walltime": 16},
   "sage.combinat.matrices.hadamard_matrix": {"walltime": 8},
   "sage.combinat.multiset_partition_into_sets_ordered": {"walltime": 8},
-  "sage.combinat.ncsf_qsym.ncsf": {"walltime": 16},
-  "sage.combinat.ncsf_qsym.qsym": {"walltime": 16},
-  "sage.combinat.partition": {"walltime": 16},
-  "sage.combinat.partition_kleshchev": {"walltime": 16},
+  "sage.combinat.ncsf_qsym.ncsf": {"walltime": 8},
+  "sage.combinat.ncsf_qsym.qsym": {"walltime": 8},
+  "sage.combinat.partition": {"walltime": 8},
   "sage.combinat.partition_tuple": {"walltime": 8},
-  "sage.combinat.posets.moebius_algebra": {"walltime": 16},
+  "sage.combinat.permutation": {"walltime": 8},
   "sage.combinat.posets.posets": {"walltime": 8},
-  "sage.combinat.rigged_configurations.kr_tableaux": {"walltime": 32},
-  "sage.combinat.rigged_configurations.rigged_configurations": {"walltime": 16},
-  "sage.combinat.rigged_configurations.tensor_product_kr_tableaux": {"walltime": 16},
+  "sage.combinat.rigged_configurations.kr_tableaux": {"walltime": 8},
   "sage.combinat.root_system.associahedron": {"walltime": 8},
-  "sage.combinat.root_system.branching_rules": {"walltime": 8},
-  "sage.combinat.root_system.fusion_ring": {"walltime": 8},
-  "sage.combinat.root_system.integrable_representations": {"walltime": 16},
-  "sage.combinat.root_system.non_symmetric_macdonald_polynomials": {"walltime": 16},
-  "sage.combinat.root_system.pieri_factors": {"walltime": 8},
-  "sage.combinat.root_system.plot": {"walltime": 32},
-  "sage.combinat.root_system.root_lattice_realization_algebras": {"walltime": 16},
-  "sage.combinat.root_system.root_lattice_realizations": {"walltime": 16},
-  "sage.combinat.root_system.root_system": {"walltime": 8},
-  "sage.combinat.root_system.weyl_group": {"walltime": 8},
-  "sage.combinat.rsk": {"walltime": 32},
-  "sage.combinat.sf.classical": {"walltime": 16},
-  "sage.combinat.sf.jack": {"walltime": 16},
-  "sage.combinat.sf.k_dual": {"walltime": 16},
-  "sage.combinat.sf.llt": {"walltime": 16},
-  "sage.combinat.sf.macdonald": {"walltime": 64},
-  "sage.combinat.sf.new_kschur": {"walltime": 8},
-  "sage.combinat.sf.sfa": {"walltime": 32},
-  "sage.combinat.shifted_primed_tableau": {"walltime": 16},
+  "sage.combinat.root_system.non_symmetric_macdonald_polynomials": {"walltime": 8},
+  "sage.combinat.root_system.plot": {"walltime": 16},
+  "sage.combinat.root_system.root_lattice_realizations": {"walltime": 8},
+  "sage.combinat.rsk": {"walltime": 8},
+  "sage.combinat.sf.k_dual": {"walltime": 8},
+  "sage.combinat.sf.sf": {"walltime": 8},
+  "sage.combinat.sf.sfa": {"walltime": 8},
+  "sage.combinat.shifted_primed_tableau": {"walltime": 8},
   "sage.combinat.skew_tableau": {"walltime": 8},
-  "sage.combinat.symmetric_group_algebra": {"walltime": 16},
-  "sage.combinat.tableau": {"walltime": 32},
-  "sage.combinat.tableau_tuple": {"walltime": 32},
-  "sage.combinat.tiling": {"walltime": 16},
-  "sage.combinat.tutorial": {"walltime": 16},
-  "sage.combinat.words.paths": {"walltime": 64},
-  "sage.crypto.block_cipher.des": {"walltime": 16},
-  "sage.crypto.mq.sr": {"walltime": 64},
-  "sage.crypto.sbox": {"walltime": 16},
+  "sage.combinat.species.generating_series": {"walltime": 8},
+  "sage.combinat.tableau": {"walltime": 8},
+  "sage.combinat.tableau_tuple": {"walltime": 8},
+  "sage.combinat.tiling": {"walltime": 8},
+  "sage.combinat.tutorial": {"walltime": 8},
   "sage.crypto.sboxes": {"walltime": 8},
   "sage.doctest.forker": {"walltime": 16},
-  "sage.doctest.sources": {"walltime": 64},
-  "sage.doctest.test": {"walltime": 128},
-  "sage.dynamics.arithmetic_dynamics.projective_ds": {"walltime": 64},
-  "sage.dynamics.arithmetic_dynamics.wehlerK3": {"walltime": 8},
-  "sage.dynamics.cellular_automata.glca": {"walltime": 8},
+  "sage.dynamics.arithmetic_dynamics.projective_ds": {"walltime": 32},
   "sage.dynamics.cellular_automata.solitons": {"walltime": 8},
-  "sage.dynamics.complex_dynamics.mandel_julia": {"walltime": 16},
   "sage.functions.bessel": {"walltime": 16},
-  "sage.functions.exp_integral": {"walltime": 8},
   "sage.functions.hypergeometric": {"walltime": 8},
+  "sage.functions.orthogonal_polys": {"walltime": 8},
   "sage.functions.other": {"walltime": 16},
   "sage.functions.piecewise": {"walltime": 8},
-  "sage.games.quantumino": {"walltime": 8},
-  "sage.geometry.cone": {"walltime": 32},
-  "sage.geometry.fan": {"walltime": 8},
   "sage.geometry.hyperbolic_space.hyperbolic_geodesic": {"walltime": 8},
-  "sage.geometry.hyperplane_arrangement.arrangement": {"walltime": 16},
-  "sage.geometry.hyperplane_arrangement.library": {"walltime": 8},
+  "sage.geometry.hyperplane_arrangement.arrangement": {"walltime": 8},
   "sage.geometry.hyperplane_arrangement.plot": {"walltime": 8},
-  "sage.geometry.lattice_polytope": {"walltime": 16},
-  "sage.geometry.polyhedral_complex": {"walltime": 8},
-  "sage.geometry.polyhedron.base": {"walltime": 32},
-  "sage.geometry.polyhedron.library": {"walltime": 32},
-  "sage.geometry.polyhedron.plot": {"walltime": 8},
+  "sage.geometry.polyhedron.base": {"walltime": 8},
+  "sage.geometry.polyhedron.base5": {"walltime": 8},
+  "sage.geometry.polyhedron.base6": {"walltime": 16},
+  "sage.geometry.polyhedron.library": {"walltime": 16},
   "sage.geometry.riemannian_manifolds.parametrized_surface3d": {"walltime": 16},
-  "sage.geometry.triangulation.base": {"walltime": 32},
-  "sage.geometry.triangulation.point_configuration": {"walltime": 16},
-  "sage.graphs.chrompoly": {"walltime": 8},
-  "sage.graphs.connectivity": {"walltime": 16},
-  "sage.graphs.generators.basic": {"walltime": 16},
-  "sage.graphs.generators.classical_geometries": {"walltime": 32},
-  "sage.graphs.generators.distance_regular": {"walltime": 256},
-  "sage.graphs.generators.families": {"walltime": 32},
-  "sage.graphs.generators.smallgraphs": {"walltime": 16},
-  "sage.graphs.generic_graph": {"walltime": 32},
-  "sage.graphs.genus": {"walltime": 16},
+  "sage.graphs.connectivity": {"walltime": 8},
+  "sage.graphs.generators.classical_geometries": {"walltime": 8},
+  "sage.graphs.generators.distance_regular": {"walltime": 32},
+  "sage.graphs.generators.smallgraphs": {"walltime": 8},
+  "sage.graphs.generic_graph": {"walltime": 16},
   "sage.graphs.graph": {"walltime": 16},
-  "sage.graphs.graph_generators": {"walltime": 8},
   "sage.graphs.graph_list": {"walltime": 8},
   "sage.graphs.graph_plot": {"walltime": 8},
-  "sage.graphs.strongly_regular_db": {"walltime": 16},
-  "sage.groups.cubic_braid": {"walltime": 16},
-  "sage.groups.fqf_orthogonal": {"walltime": 16},
-  "sage.groups.libgap_mixin": {"walltime": 8},
-  "sage.groups.libgap_morphism": {"walltime": 8},
-  "sage.groups.lie_gps.nilpotent_lie_group": {"walltime": 16},
-  "sage.groups.matrix_gps.finitely_generated": {"walltime": 8},
-  "sage.groups.matrix_gps.heisenberg": {"walltime": 32},
-  "sage.groups.matrix_gps.linear": {"walltime": 8},
-  "sage.groups.perm_gps.cubegroup": {"walltime": 16},
-  "sage.groups.perm_gps.partn_ref.refinement_graphs": {"walltime": 8},
+  "sage.graphs.strongly_regular_db": {"walltime": 8},
+  "sage.groups.cactus_group": {"walltime": 8},
+  "sage.groups.cubic_braid": {"walltime": 8},
+  "sage.groups.lie_gps.nilpotent_lie_group": {"walltime": 8},
+  "sage.groups.matrix_gps.finitely_generated_gap": {"walltime": 8},
   "sage.groups.perm_gps.permgroup": {"walltime": 8},
   "sage.groups.perm_gps.permgroup_named": {"walltime": 8},
-  "sage.homology.hochschild_complex": {"walltime": 8},
   "sage.homology.homology_vector_space_with_basis": {"walltime": 8},
-  "sage.interacts.test_jupyter": {"walltime": 16},
-  "sage.interfaces.ecm": {"walltime": 8},
-  "sage.interfaces.expect": {"walltime": 8},
-  "sage.interfaces.gap": {"walltime": 16},
-  "sage.interfaces.maxima": {"walltime": 8},
-  "sage.interfaces.maxima_abstract": {"walltime": 64},
-  "sage.interfaces.psage": {"walltime": 8},
-  "sage.interfaces.sage0": {"walltime": 8},
-  "sage.lfunctions.zero_sums": {"walltime": 8},
-  "sage.libs.eclib.interface": {"walltime": 16},
+  "sage.interfaces.gap": {"walltime": 8},
+  "sage.interfaces.gap_workspace": {"walltime": 8},
+  "sage.interfaces.sage0": {"walltime": 16},
+  "sage.libs.eclib.interface": {"walltime": 32},
   "sage.libs.eclib.mwrank": {"walltime": 16},
-  "sage.libs.gap.test_long": {"walltime": 32},
-  "sage.libs.giac": {"walltime": 32},
   "sage.manifolds.catalog": {"walltime": 8},
-  "sage.manifolds.chart": {"walltime": 32},
+  "sage.manifolds.chart": {"walltime": 16},
   "sage.manifolds.chart_func": {"walltime": 8},
   "sage.manifolds.continuous_map": {"walltime": 8},
-  "sage.manifolds.differentiable.affine_connection": {"walltime": 128},
+  "sage.manifolds.differentiable.affine_connection": {"walltime": 32},
   "sage.manifolds.differentiable.automorphismfield": {"walltime": 32},
-  "sage.manifolds.differentiable.automorphismfield_group": {"walltime": 8},
   "sage.manifolds.differentiable.bundle_connection": {"walltime": 8},
-  "sage.manifolds.differentiable.characteristic_cohomology_class": {"walltime": 64},
+  "sage.manifolds.differentiable.characteristic_cohomology_class": {"walltime": 8},
   "sage.manifolds.differentiable.curve": {"walltime": 16},
-  "sage.manifolds.differentiable.degenerate": {"walltime": 32},
-  "sage.manifolds.differentiable.degenerate_submanifold": {"walltime": 16},
-  "sage.manifolds.differentiable.diff_form": {"walltime": 64},
+  "sage.manifolds.differentiable.degenerate": {"walltime": 16},
+  "sage.manifolds.differentiable.degenerate_submanifold": {"walltime": 8},
+  "sage.manifolds.differentiable.diff_form": {"walltime": 32},
   "sage.manifolds.differentiable.diff_map": {"walltime": 8},
   "sage.manifolds.differentiable.examples.euclidean": {"walltime": 32},
   "sage.manifolds.differentiable.examples.sphere": {"walltime": 32},
   "sage.manifolds.differentiable.integrated_curve": {"walltime": 32},
-  "sage.manifolds.differentiable.levi_civita_connection": {"walltime": 32},
-  "sage.manifolds.differentiable.manifold": {"walltime": 16},
-  "sage.manifolds.differentiable.manifold_homset": {"walltime": 16},
+  "sage.manifolds.differentiable.levi_civita_connection": {"walltime": 16},
+  "sage.manifolds.differentiable.manifold": {"walltime": 8},
+  "sage.manifolds.differentiable.manifold_homset": {"walltime": 8},
   "sage.manifolds.differentiable.metric": {"walltime": 64},
   "sage.manifolds.differentiable.mixed_form": {"walltime": 16},
-  "sage.manifolds.differentiable.mixed_form_algebra": {"walltime": 8},
   "sage.manifolds.differentiable.multivectorfield": {"walltime": 64},
-  "sage.manifolds.differentiable.pseudo_riemannian": {"walltime": 16},
-  "sage.manifolds.differentiable.pseudo_riemannian_submanifold": {"walltime": 128},
-  "sage.manifolds.differentiable.scalarfield": {"walltime": 16},
+  "sage.manifolds.differentiable.pseudo_riemannian": {"walltime": 8},
+  "sage.manifolds.differentiable.pseudo_riemannian_submanifold": {"walltime": 32},
+  "sage.manifolds.differentiable.scalarfield": {"walltime": 8},
   "sage.manifolds.differentiable.scalarfield_algebra": {"walltime": 8},
-  "sage.manifolds.differentiable.tangent_vector": {"walltime": 16},
+  "sage.manifolds.differentiable.tangent_vector": {"walltime": 8},
   "sage.manifolds.differentiable.tensorfield": {"walltime": 128},
   "sage.manifolds.differentiable.tensorfield_paral": {"walltime": 16},
-  "sage.manifolds.differentiable.vector_bundle": {"walltime": 16},
-  "sage.manifolds.differentiable.vectorfield": {"walltime": 64},
-  "sage.manifolds.differentiable.vectorframe": {"walltime": 8},
+  "sage.manifolds.differentiable.vectorfield": {"walltime": 16},
   "sage.manifolds.point": {"walltime": 16},
   "sage.manifolds.scalarfield": {"walltime": 16},
-  "sage.manifolds.scalarfield_algebra": {"walltime": 8},
-  "sage.manifolds.section": {"walltime": 32},
-  "sage.manifolds.trivialization": {"walltime": 8},
-  "sage.manifolds.vector_bundle": {"walltime": 8},
-  "sage.matrix.benchmark": {"walltime": 8},
+  "sage.manifolds.section": {"walltime": 16},
   "sage.matrix.matrix2": {"walltime": 16},
-  "sage.matrix.matrix_integer_dense": {"walltime": 16},
-  "sage.matrix.matrix_integer_dense_hnf": {"walltime": 32},
-  "sage.matrix.matrix_mod2_dense": {"walltime": 8},
   "sage.matrix.matrix_rational_dense": {"walltime": 8},
   "sage.matrix.special": {"walltime": 8},
-  "sage.matroids.catalog": {"walltime": 64},
   "sage.misc.cachefunc": {"walltime": 16},
-  "sage.misc.cython": {"walltime": 8},
   "sage.misc.functional": {"walltime": 8},
   "sage.misc.randstate": {"walltime": 16},
-  "sage.misc.sagedoc": {"walltime": 64},
-  "sage.misc.sageinspect": {"walltime": 32},
-  "sage.modular.abvar.abvar": {"walltime": 16},
+  "sage.misc.sagedoc": {"walltime": 16},
+  "sage.misc.sageinspect": {"walltime": 16},
+  "sage.misc.trace": {"walltime": 8},
+  "sage.modular.abvar.abvar": {"walltime": 8},
   "sage.modular.abvar.homspace": {"walltime": 8},
-  "sage.modular.abvar.lseries": {"walltime": 8},
-  "sage.modular.arithgroup.arithgroup_perm": {"walltime": 8},
-  "sage.modular.arithgroup.tests": {"walltime": 8},
-  "sage.modular.btquotients.pautomorphicform": {"walltime": 32},
-  "sage.modular.hypergeometric_motive": {"walltime": 16},
-  "sage.modular.local_comp.local_comp": {"walltime": 32},
-  "sage.modular.local_comp.type_space": {"walltime": 16},
-  "sage.modular.modform.ambient_R": {"walltime": 16},
-  "sage.modular.modform.constructor": {"walltime": 8},
-  "sage.modular.modform.cuspidal_submodule": {"walltime": 16},
-  "sage.modular.modform.element": {"walltime": 64},
-  "sage.modular.modform.ring": {"walltime": 64},
-  "sage.modular.modform.space": {"walltime": 8},
+  "sage.modular.btquotients.btquotient": {"walltime": 8},
+  "sage.modular.btquotients.pautomorphicform": {"walltime": 16},
+  "sage.modular.hecke.submodule": {"walltime": 8},
+  "sage.modular.hypergeometric_motive": {"walltime": 8},
+  "sage.modular.local_comp.local_comp": {"walltime": 16},
+  "sage.modular.local_comp.type_space": {"walltime": 8},
+  "sage.modular.modform.element": {"walltime": 32},
   "sage.modular.modform_hecketriangle.abstract_space": {"walltime": 16},
   "sage.modular.modform_hecketriangle.graded_ring_element": {"walltime": 16},
   "sage.modular.modform_hecketriangle.hecke_triangle_group_element": {"walltime": 32},
   "sage.modular.modform_hecketriangle.readme": {"walltime": 16},
-  "sage.modular.modform_hecketriangle.space": {"walltime": 8},
   "sage.modular.modsym.ambient": {"walltime": 16},
   "sage.modular.modsym.space": {"walltime": 8},
-  "sage.modular.pollack_stevens.modsym": {"walltime": 64},
-  "sage.modular.pollack_stevens.padic_lseries": {"walltime": 32},
-  "sage.modules.finite_submodule_iter": {"walltime": 16},
-  "sage.modules.free_module": {"walltime": 16},
-  "sage.modules.free_module_element": {"walltime": 8},
-  "sage.modules.free_module_integer": {"walltime": 32},
-  "sage.modules.free_quadratic_module_integer_symmetric": {"walltime": 8},
-  "sage.modules.torsion_quadratic_module": {"walltime": 16},
+  "sage.modular.overconvergent.genus0": {"walltime": 8},
+  "sage.modular.pollack_stevens.modsym": {"walltime": 8},
+  "sage.modules.fp_graded.morphism": {"walltime": 8},
+  "sage.modules.free_module": {"walltime": 8},
   "sage.parallel.map_reduce": {"walltime": 8},
-  "sage.plot.animate": {"walltime": 16},
-  "sage.plot.arrow": {"walltime": 8},
-  "sage.plot.circle": {"walltime": 8},
-  "sage.plot.complex_plot": {"walltime": 8},
+  "sage.plot.complex_plot": {"walltime": 16},
   "sage.plot.contour_plot": {"walltime": 32},
-  "sage.plot.density_plot": {"walltime": 8},
   "sage.plot.graphics": {"walltime": 32},
   "sage.plot.line": {"walltime": 8},
   "sage.plot.matrix_plot": {"walltime": 16},
@@ -283,115 +154,53 @@
   "sage.plot.plot": {"walltime": 64},
   "sage.plot.plot3d.base": {"walltime": 8},
   "sage.plot.plot3d.implicit_plot3d": {"walltime": 16},
-  "sage.plot.plot3d.implicit_surface": {"walltime": 8},
-  "sage.plot.plot3d.parametric_plot3d": {"walltime": 8},
+  "sage.plot.plot3d.parametric_plot3d": {"walltime": 16},
   "sage.plot.plot3d.parametric_surface": {"walltime": 8},
   "sage.plot.plot3d.plot3d": {"walltime": 16},
-  "sage.plot.plot3d.tachyon": {"walltime": 8},
-  "sage.plot.plot3d.transform": {"walltime": 32},
   "sage.plot.point": {"walltime": 8},
   "sage.plot.polygon": {"walltime": 8},
   "sage.plot.streamline_plot": {"walltime": 8},
-  "sage.quadratic_forms.genera.genus": {"walltime": 16},
-  "sage.quadratic_forms.quadratic_form__automorphisms": {"walltime": 8},
-  "sage.quadratic_forms.quadratic_form__local_representation_conditions": {"walltime": 64},
-  "sage.quadratic_forms.quadratic_form__neighbors": {"walltime": 8},
-  "sage.quadratic_forms.quadratic_form__siegel_product": {"walltime": 8},
   "sage.repl.ipython_extension": {"walltime": 8},
-  "sage.rings.asymptotic.asymptotic_expansion_generators": {"walltime": 64},
+  "sage.rings.asymptotic.asymptotic_expansion_generators": {"walltime": 16},
   "sage.rings.asymptotic.asymptotic_ring": {"walltime": 8},
-  "sage.rings.asymptotic.asymptotics_multivariate_generating_functions": {"walltime": 32},
-  "sage.rings.asymptotic.term_monoid": {"walltime": 8},
-  "sage.rings.continued_fraction": {"walltime": 8},
+  "sage.rings.asymptotic.asymptotics_multivariate_generating_functions": {"walltime": 8},
   "sage.rings.finite_rings.finite_field_base": {"walltime": 8},
-  "sage.rings.function_field.function_field": {"walltime": 128},
-  "sage.rings.function_field.function_field_valuation": {"walltime": 64},
+  "sage.rings.function_field.function_field": {"walltime": 8},
   "sage.rings.function_field.ideal": {"walltime": 8},
-  "sage.rings.function_field.place": {"walltime": 8},
-  "sage.rings.integer": {"walltime": 64},
-  "sage.rings.invariants.invariant_theory": {"walltime": 8},
-  "sage.rings.number_field.bdd_height": {"walltime": 8},
-  "sage.rings.number_field.number_field": {"walltime": 64},
-  "sage.rings.number_field.number_field_element": {"walltime": 16},
-  "sage.rings.number_field.splitting_field": {"walltime": 8},
-  "sage.rings.number_field.totallyreal": {"walltime": 16},
-  "sage.rings.number_field.totallyreal_rel": {"walltime": 8},
-  "sage.rings.padics.padic_base_leaves": {"walltime": 64},
-  "sage.rings.padics.padic_extension_leaves": {"walltime": 64},
-  "sage.rings.padics.padic_generic_element": {"walltime": 16},
-  "sage.rings.padics.padic_lattice_element": {"walltime": 32},
-  "sage.rings.padics.relative_extension_leaves": {"walltime": 32},
+  "sage.rings.lazy_series": {"walltime": 8},
+  "sage.rings.lazy_series_ring": {"walltime": 32},
+  "sage.rings.number_field.number_field": {"walltime": 32},
+  "sage.rings.number_field.number_field_element": {"walltime": 8},
+  "sage.rings.padics.padic_base_leaves": {"walltime": 8},
+  "sage.rings.padics.padic_generic_element": {"walltime": 8},
   "sage.rings.polynomial.multi_polynomial_ideal": {"walltime": 8},
-  "sage.rings.polynomial.multi_polynomial_sequence": {"walltime": 8},
-  "sage.rings.polynomial.ore_function_element": {"walltime": 8},
   "sage.rings.polynomial.polynomial_element": {"walltime": 16},
-  "sage.rings.polynomial.polynomial_rational_flint": {"walltime": 8},
   "sage.rings.qqbar": {"walltime": 16},
-  "sage.rings.tests": {"walltime": 16},
-  "sage.rings.valuation.augmented_valuation": {"walltime": 32},
-  "sage.rings.valuation.mapped_valuation": {"walltime": 64},
-  "sage.rings.valuation.valuation": {"walltime": 8},
-  "sage.sandpiles.sandpile": {"walltime": 16},
+  "sage.sandpiles.sandpile": {"walltime": 8},
   "sage.schemes.curves.affine_curve": {"walltime": 16},
   "sage.schemes.curves.closed_point": {"walltime": 8},
   "sage.schemes.curves.projective_curve": {"walltime": 32},
-  "sage.schemes.cyclic_covers.cycliccover_finite_field": {"walltime": 64},
   "sage.schemes.elliptic_curves.BSD": {"walltime": 8},
   "sage.schemes.elliptic_curves.Qcurves": {"walltime": 8},
-  "sage.schemes.elliptic_curves.constructor": {"walltime": 32},
-  "sage.schemes.elliptic_curves.ell_curve_isogeny": {"walltime": 16},
-  "sage.schemes.elliptic_curves.ell_egros": {"walltime": 32},
-  "sage.schemes.elliptic_curves.ell_finite_field": {"walltime": 8},
+  "sage.schemes.elliptic_curves.ell_curve_isogeny": {"walltime": 8},
   "sage.schemes.elliptic_curves.ell_generic": {"walltime": 8},
-  "sage.schemes.elliptic_curves.ell_modular_symbols": {"walltime": 16},
-  "sage.schemes.elliptic_curves.ell_number_field": {"walltime": 128},
+  "sage.schemes.elliptic_curves.ell_modular_symbols": {"walltime": 8},
   "sage.schemes.elliptic_curves.ell_point": {"walltime": 8},
-  "sage.schemes.elliptic_curves.ell_rational_field": {"walltime": 128},
-  "sage.schemes.elliptic_curves.gal_reps_number_field": {"walltime": 32},
-  "sage.schemes.elliptic_curves.gp_simon": {"walltime": 16},
-  "sage.schemes.elliptic_curves.heegner": {"walltime": 32},
-  "sage.schemes.elliptic_curves.height": {"walltime": 64},
-  "sage.schemes.elliptic_curves.isogeny_class": {"walltime": 32},
-  "sage.schemes.elliptic_curves.isogeny_small_degree": {"walltime": 64},
-  "sage.schemes.elliptic_curves.kraus": {"walltime": 16},
+  "sage.schemes.elliptic_curves.ell_rational_field": {"walltime": 32},
+  "sage.schemes.elliptic_curves.height": {"walltime": 8},
+  "sage.schemes.elliptic_curves.isogeny_small_degree": {"walltime": 16},
   "sage.schemes.elliptic_curves.mod_sym_num": {"walltime": 8},
   "sage.schemes.elliptic_curves.padic_lseries": {"walltime": 8},
-  "sage.schemes.elliptic_curves.padics": {"walltime": 16},
-  "sage.schemes.elliptic_curves.saturation": {"walltime": 16},
-  "sage.schemes.elliptic_curves.sha_tate": {"walltime": 32},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_finite_field": {"walltime": 64},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_generic": {"walltime": 8},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_padic_field": {"walltime": 32},
-  "sage.schemes.hyperelliptic_curves.monsky_washnitzer": {"walltime": 8},
-  "sage.schemes.projective.projective_rational_point": {"walltime": 8},
-  "sage.schemes.riemann_surfaces.riemann_surface": {"walltime": 64},
+  "sage.schemes.elliptic_curves.padics": {"walltime": 8},
+  "sage.schemes.elliptic_curves.sha_tate": {"walltime": 16},
+  "sage.schemes.hyperelliptic_curves.hyperelliptic_padic_field": {"walltime": 16},
+  "sage.schemes.riemann_surfaces.riemann_surface": {"walltime": 32},
   "sage.schemes.toric.chow_group": {"walltime": 8},
-  "sage.schemes.toric.sheaf.klyachko": {"walltime": 8},
-  "sage.stats.distributions.discrete_gaussian_integer": {"walltime": 8},
-  "sage.stats.time_series": {"walltime": 8},
-  "sage.structure.coerce_dict": {"walltime": 32},
   "sage.structure.element": {"walltime": 16},
-  "sage.structure.sage_object": {"walltime": 8},
   "sage.symbolic.expression": {"walltime": 32},
-  "sage.symbolic.integration.integral": {"walltime": 32},
-  "sage.symbolic.random_tests": {"walltime": 32},
+  "sage.symbolic.integration.integral": {"walltime": 16},
   "sage.symbolic.relation": {"walltime": 8},
-  "sage.tests.book_schilling_zabrocki_kschur_primer": {"walltime": 32},
-  "sage.tests.book_stein_ent": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.combinat_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.float_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.graphique_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.graphtheory_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.integration_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.mpoly_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.nonlinear_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.recequadiff_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.graphique_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.numbertheory_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.polynomes_doctest": {"walltime": 16},
-  "sage.tests.cmdline": {"walltime": 64},
-  "sage.tests.gosper-sum": {"walltime": 16},
-  "sage.tests.parigp": {"walltime": 8},
-  "sage.topology.simplicial_complex": {"walltime": 8},
-  "sage.topology.simplicial_complex_examples": {"walltime": 16}
+  "sage.tests.book_schilling_zabrocki_kschur_primer": {"walltime": 16},
+  "sage.tests.book_stein_ent": {"walltime": 8},
+  "sage.topology.simplicial_complex": {"walltime": 16}
 }
diff --git a/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch b/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
deleted file mode 100644
index f2f825e4fb10..000000000000
--- a/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
+++ /dev/null
@@ -1,205 +0,0 @@
-diff --git a/build/pkgs/singular/checksums.ini b/build/pkgs/singular/checksums.ini
-index 2e33a405d36..313463d2fea 100644
---- a/build/pkgs/singular/checksums.ini
-+++ b/build/pkgs/singular/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=singular-VERSION.tar.gz
--sha1=6c2b622d3681e2de3d58d30c654d43d3e32b720c
--md5=abb1e37c794472e7760655358ab66054
--cksum=17455733
-+sha1=28bb3ee97ef48d04dfa96de182fd93eebe08426c
-+md5=fc0a4f5720dadba45a52ee94324ce00c
-+cksum=1573851737
- upstream_url=ftp://jim.mathematik.uni-kl.de/pub/Math/Singular/SOURCES/4-3-1/singular-VERSION.tar.gz
-diff --git a/build/pkgs/singular/package-version.txt b/build/pkgs/singular/package-version.txt
-index 11300c77e7d..66e2bede53a 100644
---- a/build/pkgs/singular/package-version.txt
-+++ b/build/pkgs/singular/package-version.txt
-@@ -1 +1 @@
--4.3.1p1
-+4.3.1p3
-diff --git a/src/sage/libs/singular/decl.pxd b/src/sage/libs/singular/decl.pxd
-index 8e3ac314b67..747a6b1e2fb 100644
---- a/src/sage/libs/singular/decl.pxd
-+++ b/src/sage/libs/singular/decl.pxd
-@@ -574,7 +574,7 @@ cdef extern from "singular/Singular/libsingular.h":
- 
-     # gets a component out of a polynomial vector
- 
--    poly *pTakeOutComp1(poly **, int)
-+    poly *pTakeOutComp(poly **, int)
- 
-     # deep copy p
- 
-diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx
-index d8ea7b07f3c..3a1271cd59f 100644
---- a/src/sage/libs/singular/singular.pyx
-+++ b/src/sage/libs/singular/singular.pyx
-@@ -1726,20 +1726,21 @@ cdef int overflow_check(unsigned long e, ring *_ring) except -1:
- 
-     Whether an overflow occurs or not partially depends
-     on the number of variables in the ring. See trac ticket
--    :trac:`11856`. With Singular 4, it is by default optimized
--    for at least 4 variables on 64-bit and 2 variables on 32-bit,
--    which in both cases makes a maximal default exponent of
--    2^16-1.
-+    :trac:`11856`.
- 
-     EXAMPLES::
- 
-         sage: P.<x,y> = QQ[]
--        sage: y^(2^16-1)
--        y^65535
--        sage: y^2^16
-+        sage: y^(2^30)
-+        Traceback (most recent call last):             # 32-bit
-+        ...                                            # 32-bit
-+        OverflowError: exponent overflow (1073741824)  # 32-bit
-+        y^1073741824  # 64-bit
-+        sage: y^2^32
-         Traceback (most recent call last):
-         ...
--        OverflowError: exponent overflow (65536)
-+        OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+        OverflowError: exponent overflow (4294967296)  # 64-bit
-     """
-     if unlikely(e > _ring.bitmask):
-         raise OverflowError("exponent overflow (%d)"%(e))
-diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py
-index 7dc058a22f0..71494eddbc0 100644
---- a/src/sage/rings/polynomial/multi_polynomial_ideal.py
-+++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py
-@@ -60,7 +60,7 @@
- Note that the result of a computation is not necessarily reduced::
- 
-     sage: (a+b)^17
--    256*a*b^16 + 256*b^17
-+    a*b^16 + b^17
-     sage: S(17) == 0
-     True
- 
-diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-index 4dad016b33f..9bf67dd1425 100644
---- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-+++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-@@ -193,7 +193,7 @@ from sage.libs.singular.decl cimport (
-     p_IsUnit, p_IsOne, p_Series, p_Head, idInit, fast_map_common_subexp, id_Delete,
-     p_IsHomogeneous, p_Homogen, p_Totaldegree,pLDeg1_Totaldegree, singclap_pdivide, singclap_factorize,
-     idLift, IDELEMS, On, Off, SW_USE_CHINREM_GCD, SW_USE_EZGCD,
--    p_LmIsConstant, pTakeOutComp1, singclap_gcd, pp_Mult_qq, p_GetMaxExp,
-+    p_LmIsConstant, pTakeOutComp, singclap_gcd, pp_Mult_qq, p_GetMaxExp,
-     pLength, kNF, p_Neg, p_Minus_mm_Mult_qq, p_Plus_mm_Mult_qq,
-     pDiff, singclap_resultant, p_Normalize,
-     prCopyR, prCopyR_NoSort)
-@@ -1587,7 +1587,8 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_base):
-             9/4
- 
-             sage: P.monomial_quotient(x,y) # Note the wrong result
--            x*y^65535*z^65535
-+            x*y^65535*z^65535      # 32-bit
-+            x*y^1048575*z^1048575  # 64-bit
- 
-             sage: P.monomial_quotient(x,P(1))
-             x
-@@ -2247,10 +2248,11 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             9/4*x^2 - 1/4*y^2 - y - 1
- 
-             sage: P.<x,y> = PolynomialRing(QQ,order='lex')
--            sage: (x^2^15) * x^2^15
-+            sage: (x^2^32) * x^2^32
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (...)
-+            OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+            OverflowError: exponent overflow (...)  # 64-bit
-         """
-         # all currently implemented rings are commutative
-         cdef poly *_p
-@@ -2371,10 +2373,11 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             ValueError: not a 2nd power
- 
-             sage: P.<x,y> = PolynomialRing(QQ,order='lex')
--            sage: (x+y^2^15)^10
-+            sage: (x+y^2^32)^10
-             Traceback (most recent call last):
-             ....
--            OverflowError: exponent overflow (...)
-+            OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+            OverflowError: exponent overflow (...)  # 64-bit
- 
-         Test fractional powers (:trac:`22329`)::
- 
-@@ -3461,7 +3464,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             x^10000
-             no overflow
- 
--            sage: n = 1000
-+            sage: n = 100000
-             sage: try:
-             ....:     f = x^n
-             ....:     f.subs(x = x^n)
-@@ -4567,7 +4570,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
-         l = []
-         for i from 0 <= i < IDELEMS(res):
-             for j from 1 <= j <= IDELEMS(_I):
--                l.append( new_MP(parent, pTakeOutComp1(&res.m[i], j)) )
-+                l.append( new_MP(parent, pTakeOutComp(&res.m[i], 1)) )
- 
-         id_Delete(&fI, r)
-         id_Delete(&_I, r)
-@@ -4635,7 +4638,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
- 
-             sage: f = 3*x
-             sage: f.reduce([2*x,y])
--            3*x
-+            x
- 
-         The reduction is not canonical when ``I`` is not a Groebner
-         basis::
-diff --git a/src/sage/rings/polynomial/plural.pyx b/src/sage/rings/polynomial/plural.pyx
-index 1c9f35e56ba..587511c3888 100644
---- a/src/sage/rings/polynomial/plural.pyx
-+++ b/src/sage/rings/polynomial/plural.pyx
-@@ -1619,10 +1619,10 @@ cdef class NCPolynomial_plural(RingElement):
-             sage: P = A.g_algebra(relations={y*x:-x*y + z},  order='lex')
-             sage: P.inject_variables()
-             Defining x, z, y
--            sage: (x^2^15) * x^2^15
-+            sage: (x^2^31) * x^2^31
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (65536)
-+            OverflowError: exponent overflow (2147483648)
-         """
-         # all currently implemented rings are commutative
-         cdef poly *_p
-@@ -1689,10 +1689,10 @@ cdef class NCPolynomial_plural(RingElement):
-             sage: P = A.g_algebra(relations={y*x:-x*y + z},  order='lex')
-             sage: P.inject_variables()
-             Defining x, z, y
--            sage: (x+y^2^15)^10
-+            sage: (x+y^2^31)^10
-             Traceback (most recent call last):
-             ....
--            OverflowError: exponent overflow (327680)
-+            OverflowError: exponent overflow (2147483648)
-         """
-         if type(exp) is not Integer:
-             try:
-diff --git a/src/sage/structure/element.pyx b/src/sage/structure/element.pyx
-index b5d83ef71b6..5c45b3fb528 100644
---- a/src/sage/structure/element.pyx
-+++ b/src/sage/structure/element.pyx
-@@ -2705,10 +2705,10 @@ cdef class RingElement(ModuleElement):
-         with Singular 4::
- 
-             sage: K.<x,y> = ZZ[]
--            sage: (x^12345)^54321
-+            sage: (x^123456)^654321
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (670592745)
-+            OverflowError: exponent overflow (...)
-         """
-         return arith_generic_power(self, n)
- 
diff --git a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch b/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
deleted file mode 100644
index ee0f0e656b28..000000000000
--- a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py
-index d5f7157217f..8ca1f958039 100644
---- a/src/sage/rings/number_field/number_field_ideal.py
-+++ b/src/sage/rings/number_field/number_field_ideal.py
-@@ -996,16 +996,38 @@ def is_prime(self):
-             False
-             sage: K.ideal(17).is_prime()  # ramified
-             False
-+
-+        TESTS:
-+
-+        Check that we do not factor the norm of the ideal, this used
-+        to take half an hour, see :trac:`33360`::
-+
-+            sage: K.<a,b,c> = NumberField([x^2-2,x^2-3,x^2-5])
-+            sage: t = (((-2611940*c + 1925290/7653)*b - 1537130/7653*c
-+            ....:       + 10130950)*a + (1343014/7653*c - 8349770)*b
-+            ....:       + 6477058*c - 2801449990/4002519)
-+            sage: t.is_prime()
-+            False
-         """
-         try:
-             return self._pari_prime is not None
-         except AttributeError:
--            F = self.factor()  # factorization with caching
--            if len(F) != 1 or F[0][1] != 1:
--                self._pari_prime = None
--            else:
--                self._pari_prime = F[0][0]._pari_prime
--            return self._pari_prime is not None
-+            pass
-+
-+        K = self.number_field().pari_nf()
-+        I = self.pari_hnf()
-+
-+        candidate = K.idealismaximal(I) or None
-+
-+        # PARI uses probabilistic primality testing inside idealismaximal().
-+        if get_flag(None, 'arithmetic'):
-+            # proof required, check using isprime()
-+            if candidate and not candidate[0].isprime():
-+                candidate = None
-+
-+        self._pari_prime = candidate
-+
-+        return self._pari_prime is not None
- 
-     def pari_prime(self):
-         r"""
diff --git a/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch b/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
deleted file mode 100644
index 91f06fd4d173..000000000000
--- a/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-diff --git a/src/sage/misc/persist.pyx b/src/sage/misc/persist.pyx
-index 3ac5f1cc2b0..cb1f327c199 100644
---- a/src/sage/misc/persist.pyx
-+++ b/src/sage/misc/persist.pyx
-@@ -157,7 +157,7 @@ def load(*filename, compress=True, verbose=True, **kwargs):
-         ....:     _ = f.write(code)
-         sage: load(t)
-         sage: hello
--        <fortran object>
-+        <fortran ...>
-     """
-     import sage.repl.load
-     if len(filename) != 1:
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index 6f0aeab87ae..b77c69b2f77 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -461,6 +461,8 @@ def complex_to_rgb(z_values, contoured=False, tiled=False,
-             rgb[i, j, 2] = b
- 
-     sig_off()
-+    nan_indices = np.isnan(rgb).any(-1)     # Mask for undefined points
-+    rgb[nan_indices] = 1                    # Make nan_indices white
-     return rgb
- 
- 
-diff --git a/src/sage/plot/histogram.py b/src/sage/plot/histogram.py
-index 3bc2b76b58e..388c2d1391d 100644
---- a/src/sage/plot/histogram.py
-+++ b/src/sage/plot/histogram.py
-@@ -87,13 +87,8 @@ def get_minmax_data(self):
- 
-         TESTS::
- 
--            sage: h = histogram([10,3,5], normed=True)[0]
--            doctest:warning...:
--            DeprecationWarning: the 'normed' option is deprecated. Use 'density' instead.
--            See https://trac.sagemath.org/25260 for details.
-+            sage: h = histogram([10,3,5], density=True)[0]
-             sage: h.get_minmax_data()
--            doctest:warning ...
--            ...VisibleDeprecationWarning: Passing `normed=True` on non-uniform bins has always been broken, and computes neither the probability density function nor the probability mass function. The result is only correct if the bins are uniform, when density=True will produce the same result anyway. The argument will be removed in a future version of numpy.
-             {'xmax': 10.0, 'xmin': 3.0, 'ymax': 0.476190476190..., 'ymin': 0}
-         """
-         import numpy
-diff --git a/src/sage/repl/ipython_extension.py b/src/sage/repl/ipython_extension.py
-index 798671aab42..cad6a47ca8b 100644
---- a/src/sage/repl/ipython_extension.py
-+++ b/src/sage/repl/ipython_extension.py
-@@ -405,7 +405,7 @@ def fortran(self, line, cell):
-             ....: C END FILE FIB1.F
-             ....: ''')
-             sage: fib
--            <fortran object>
-+            <fortran ...>
-             sage: from numpy import array
-             sage: a = array(range(10), dtype=float)
-             sage: fib(a, 10)
diff --git a/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch b/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
deleted file mode 100644
index 2769e87f6a4b..000000000000
--- a/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-diff --git a/src/sage/interfaces/tachyon.py b/src/sage/interfaces/tachyon.py
-index 23671e50892..ce1d50f71bc 100644
---- a/src/sage/interfaces/tachyon.py
-+++ b/src/sage/interfaces/tachyon.py
-@@ -683,12 +683,14 @@
- #*****************************************************************************
- 
- import os
-+import re
- 
- from sage.cpython.string import bytes_to_str
- from sage.misc.pager import pager
- from sage.misc.superseded import deprecation
- from sage.misc.temporary_file import tmp_filename
- from sage.structure.sage_object import SageObject
-+from sage.misc.cachefunc import cached_method
- 
- 
- class TachyonRT(SageObject):
-@@ -799,6 +801,11 @@ def __call__(self, model, outfile='sage.png', verbose=1, extra_opts=''):
-             Parser failed due to an input file syntax error.
-             Aborting render.
-         """
-+        if self.version() >= '0.99.2':
-+            # this keyword was changed in 0.99.2
-+            model = model.replace(
-+                    "              focallength ",
-+                    "              focaldist ")
-         modelfile = tmp_filename(ext='.dat')
-         with open(modelfile, 'w') as file:
-             file.write(model)
-@@ -851,6 +858,25 @@ def usage(self, use_pager=True):
-         else:
-             print(r)
- 
-+    @cached_method
-+    def version(self):
-+        """
-+        Returns the version of the Tachyon raytracer being used.
-+
-+        TESTS::
-+
-+            sage: tachyon_rt.version()  # random
-+            0.98.9
-+            sage: tachyon_rt.version() >= '0.98.9'
-+            True
-+        """
-+        with os.popen('tachyon') as f:
-+            r = f.readline()
-+        res = re.search(r"Version ([\d.]*)", r)
-+        # debian patches tachyon so it won't report the version
-+        # we hardcode '0.99' since that's indeed the version they ship
-+        return res[1] if res else '0.99'
-+
-     def help(self, use_pager=True):
-         """
-         Deprecated: type 'sage.interfaces.tachyon?' for help
diff --git a/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch b/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
deleted file mode 100644
index 11eb20d4f735..000000000000
--- a/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff --git a/src/sage/arith/long.pxd b/src/sage/arith/long.pxd
-index 1c9a53387a0..d96b98f247c 100644
---- a/src/sage/arith/long.pxd
-+++ b/src/sage/arith/long.pxd
-@@ -270,6 +270,17 @@ cdef inline bint integer_check_long_py(x, long* value, int* err):
-         sage: L += [-x for x in L] + [0, long_min()]
-         sage: for v in L:
-         ....:     assert check_long_py(int(v)) == v
-+        sage: check_long_py(int(2^60))
-+        1152921504606846976                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^61))
-+        2305843009213693952                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^62))
-+        4611686018427387904                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^63))
-+        'Overflow (...)'
-         sage: check_long_py(int(2^100))
-         'Overflow (...)'
-         sage: check_long_py(int(long_max() + 1))
-@@ -309,7 +320,12 @@ cdef inline bint integer_check_long_py(x, long* value, int* err):
- 
-     cdef long lead
-     cdef long lead_2_overflow = (<long>1) << (BITS_IN_LONG - PyLong_SHIFT)
--    cdef long lead_3_overflow = (<long>1) << (BITS_IN_LONG - 2 * PyLong_SHIFT)
-+    cdef long lead_3_overflow
-+    if BITS_IN_LONG < 2 * PyLong_SHIFT:
-+        # in this case 3 digit is always overflow
-+        lead_3_overflow = 0
-+    else:
-+        lead_3_overflow = (<long>1) << (BITS_IN_LONG - 2 * PyLong_SHIFT)
-     if size == 0:
-         value[0] = 0
-         err[0] = 0
diff --git a/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch b/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
deleted file mode 100644
index c4d7d5c779d1..000000000000
--- a/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/src/sage/schemes/toric/sheaf/klyachko.py b/src/sage/schemes/toric/sheaf/klyachko.py
-index b1304a16913..77fae4b7545 100644
---- a/src/sage/schemes/toric/sheaf/klyachko.py
-+++ b/src/sage/schemes/toric/sheaf/klyachko.py
-@@ -26,7 +26,7 @@
-     (0, 0, 18, 16, 1)
-     sage: Gtilde = G_sum.random_deformation()
-     sage: V = Gtilde.wedge(2) * K                     # long time
--    sage: V.cohomology(dim=True, weight=(0,0,0,0))    # long time
-+    sage: V.cohomology(dim=True, weight=(0,0,0,0))    # long time  # random failure (see #32773)
-     (0, 0, 3, 0, 0)
- 
- REFERENCES:
-@@ -948,7 +948,7 @@ def random_deformation(self, epsilon=None):
-            sage: V.cohomology(dim=True, weight=(0,))
-            (1, 0)
-            sage: Vtilde = V.random_deformation()
--           sage: Vtilde.cohomology(dim=True, weight=(0,))
-+           sage: Vtilde.cohomology(dim=True, weight=(0,))  # random failure (see #32773)
-            (1, 0)
-         """
-         filt = self._filt.random_deformation(epsilon)
diff --git a/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch b/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
deleted file mode 100644
index d9a9835c696b..000000000000
--- a/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 9ac7840134054155545e24fa3e66402d42b91c0f Mon Sep 17 00:00:00 2001
-From: Antonio Rojas <arojas@archlinux.org>
-Date: Fri, 20 Jan 2023 21:36:27 +0100
-Subject: [PATCH] Fix tests with giac 1.9.0.35
-
----
- src/sage/libs/giac/giac.pyx   |  3 +--
- src/sage/symbolic/relation.py | 15 +++++----------
- 2 files changed, 6 insertions(+), 12 deletions(-)
-
-diff --git a/src/sage/libs/giac/giac.pyx b/src/sage/libs/giac/giac.pyx
-index 4e451dba5e7..ccad5169836 100644
---- a/src/sage/libs/giac/giac.pyx
-+++ b/src/sage/libs/giac/giac.pyx
-@@ -374,8 +374,7 @@ def _giac(s):
- 
-         sage: x = libgiac('x')
-         sage: (1+2*sin(3*x)).solve(x).simplify()
--        Warning, argument is not an equation, solving 1+2*sin(3*x)=0
--        list[-pi/18,7*pi/18]
-+        ...list[-pi/18,7*pi/18]
- 
-         sage: libgiac.solve('sin(3*x)>2*sin(x)',x)
-         Traceback (most recent call last):
-diff --git a/src/sage/symbolic/relation.py b/src/sage/symbolic/relation.py
-index e9dbc0fea30..b8896a94be9 100644
---- a/src/sage/symbolic/relation.py
-+++ b/src/sage/symbolic/relation.py
-@@ -935,8 +935,7 @@ def solve(f, *args, **kwds):
- 
-         sage: f = (sin(x) - 8*cos(x)*sin(x))*(sin(x)^2 + cos(x)) - (2*cos(x)*sin(x) - sin(x))*(-2*sin(x)^2 + 2*cos(x)^2 - cos(x))
-         sage: solve(f, x, algorithm='giac')
--        ...
--        [-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-+        ...[-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
- 
-         sage: x, y = SR.var('x,y')
-         sage: solve([x+y-4,x*y-3],[x,y],algorithm='giac')
-@@ -1440,19 +1439,15 @@ def _giac_solver(f, x, solution_dict=False):
-     EXAMPLES::
- 
-         sage: solve([(2/3)^x-2], [x], algorithm='giac')
--        ...
--        [[-log(2)/(log(3) - log(2))]]
-+        ...[[-log(2)/(log(3) - log(2))]]
-         sage: solve([(2/3)^x-2], [x], algorithm='giac', solution_dict=True)
--        ...
--        [{x: -log(2)/(log(3) - log(2))}]
-+        ...[{x: -log(2)/(log(3) - log(2))}]
- 
-         sage: f = (sin(x) - 8*cos(x)*sin(x))*(sin(x)^2 + cos(x)) - (2*cos(x)*sin(x) - sin(x))*(-2*sin(x)^2 + 2*cos(x)^2 - cos(x))
-         sage: solve(f, x, algorithm='giac')
--        ...
--        [-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-+        ...[-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-         sage: solve(f, x, algorithm='giac', solution_dict=True)
--        ...
--        [{x: -2*arctan(sqrt(2))}, {x: 0}, {x: 2*arctan(sqrt(2))}, {x: pi}]
-+        ...[{x: -2*arctan(sqrt(2))}, {x: 0}, {x: 2*arctan(sqrt(2))}, {x: pi}]
- 
-         sage: x, y = SR.var('x,y')
-         sage: solve([x+y-7,x*y-10],[x,y],algorithm='giac')
diff --git a/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch b/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
deleted file mode 100644
index 499e0c71e256..000000000000
--- a/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
+++ /dev/null
@@ -1,1303 +0,0 @@
-diff --git a/build/pkgs/gap/checksums.ini b/build/pkgs/gap/checksums.ini
-index 066e943308a..b0ea8ba8818 100644
---- a/build/pkgs/gap/checksums.ini
-+++ b/build/pkgs/gap/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=gap-VERSION.tar.gz
--sha1=4ecdd281b8f430282fb9b12690b06e0a26abde10
--md5=85dc9e459d5b6c66fcad9f468afd3e3e
--cksum=1351843158
-+sha1=a6e36f3f874a2c46f51561402634497eab705cca
-+md5=c5cd9f272f2703d7a3649ad7193b2d90
-+cksum=2760477284
- upstream_url=https://github.com/gap-system/gap/releases/download/vVERSION/gap-VERSION.tar.gz
-diff --git a/build/pkgs/gap/package-version.txt b/build/pkgs/gap/package-version.txt
-index d782fca8f64..f1cd7de1de5 100644
---- a/build/pkgs/gap/package-version.txt
-+++ b/build/pkgs/gap/package-version.txt
-@@ -1 +1 @@
--4.11.1
-+4.12.2
-diff --git a/build/pkgs/gap/spkg-check.in b/build/pkgs/gap/spkg-check.in
-index d9791d33293..d2fccda6e04 100644
---- a/build/pkgs/gap/spkg-check.in
-+++ b/build/pkgs/gap/spkg-check.in
-@@ -3,6 +3,13 @@ cd src
- # #28728: Fix test failure in tst/testinstall/strings.tst
- export LC_CTYPE=en_US.UTF-8
- 
-+# #34391: in GAP 4.12 some packages need GAP package io
-+#         to let tests run, otherwise this hangs. Thus we install io here.
-+cd pkg/io
-+./configure --with-gaproot=../..
-+make
-+cd ../..
-+
- make testinstall
- if [[ $? -ne 0 ]]; then
-     exit 1
-diff --git a/build/pkgs/gap/spkg-install.in b/build/pkgs/gap/spkg-install.in
-index 2ceadf99db4..e2c8b4dca54 100644
---- a/build/pkgs/gap/spkg-install.in
-+++ b/build/pkgs/gap/spkg-install.in
-@@ -8,8 +8,7 @@ export CFLAGS=$CFLAGS_NON_NATIVE
- export CXXFLAGS=$CXXFLAGS_NON_NATIVE
- 
- GAP_BUILD_ROOT="$(pwd)"
--GAP_ROOT="$SAGE_LOCAL/share/gap"
--DESTDIR_GAP_ROOT="$SAGE_DESTDIR$GAP_ROOT"
-+GAP_ROOT="$SAGE_LOCAL/lib/gap"
- 
- # Enable debug info if requested.
- # Note that -g3 allows you to use preprocessor macros in gdb which are widely used
-@@ -17,37 +16,17 @@ if [ "$SAGE_DEBUG" = yes ] ; then
-     export CFLAGS="-O0 -g3 -DDEBUG_MASTERPOINTERS -DDEBUG_GLOBAL_BAGS -DDEBUG_FUNCTIONS_BAGS $CFLAGS"
- fi
- 
--sdh_configure $SAGE_CONFIGURE_GMP
--sdh_make -j1
-+# LDFLAGS hack below needed by Semigroups package
-+sdh_configure $SAGE_CONFIGURE_GMP LDFLAGS="-pthread" --prefix=$SAGE_LOCAL
-+sdh_make
- 
--# GAP's "make install" is work in progress; we use bits and pieces of it
--# but we install many things manually.
--sdh_make install-headers install-libgap
--
--# Install config.h, which is not currently handled by `make install-headers`
--sdh_install gen/config.h "$SAGE_LOCAL/include/gap"
--
--# Now install the gap executable as "gap-bin"; it will be called normally
--# through our wrapper script that sets the appropriate GAP_ROOT
--SAGE_BIN="$SAGE_LOCAL/bin"
--mkdir -p "$SAGE_DESTDIR$SAGE_BIN" || sdh_die "Failed to create the directory $SAGE_BIN"
--
--./libtool --mode=install install gap "$SAGE_DESTDIR$SAGE_BIN/gap-bin" || \
--    sdh_die "Failed to install gap-bin to $SAGE_BIN"
--
--./libtool --mode=install install gac "$SAGE_DESTDIR$SAGE_BIN/gac" || \
--    sdh_die "Failed to install gac to $SAGE_BIN"
--
--# Now copy additional files GAP needs to run (and a few optional bits) into
--# GAP_ROOT; we don't need everything from the source tree
--sdh_install bin doc gen grp lib src tst sysinfo.gap "$GAP_ROOT"
--
--# GAP's copy of libtool is also used by the toolchain for build GAP packages
--# (i.e. by gac)
--sdh_install libtool "$GAP_ROOT"
-+sdh_make_install
-+# sdh_make install-headers install-libgap
-+# The 'packagemanager' package expects this https://github.com/gap-packages/PackageManager/issues/105
-+mkdir -p "$SAGE_LOCAL/lib/gap/bin"
- 
- # Install only the minimal packages GAP needs to run
--sdh_install pkg/GAPDoc-* pkg/primgrp-* pkg/SmallGrp-* pkg/transgrp "$GAP_ROOT"/pkg
-+sdh_install pkg/gapdoc pkg/primgrp pkg/smallgrp pkg/transgrp "$GAP_ROOT"/pkg
- 
- # Install additional packages that are not strictly required, but that are
- # typically "expected" to be loaded: These are the default packages that are
-@@ -58,50 +37,25 @@ sdh_install pkg/GAPDoc-* pkg/primgrp-* pkg/SmallGrp-* pkg/transgrp "$GAP_ROOT"/p
- # Also include atlasrep which is a dependency of tomlib
- sdh_install \
-     pkg/atlasrep \
--    pkg/autpgrp-* \
--    pkg/alnuth-* \
--    pkg/crisp-* \
--    pkg/ctbllib-* \
--    pkg/FactInt-* \
-+    pkg/autodoc \
-+    pkg/autpgrp \
-+    pkg/alnuth \
-+    pkg/crisp \
-+    pkg/ctbllib \
-+    pkg/factint \
-     pkg/fga \
--    pkg/irredsol-* \
--    pkg/laguna-* \
--    pkg/PackageManager-* \
--    pkg/polenta-* \
--    pkg/polycyclic-* \
--    pkg/resclasses-* \
--    pkg/sophus-* \
--    pkg/tomlib-* \
-+    pkg/irredsol \
-+    pkg/laguna \
-+    pkg/packagemanager \
-+    pkg/polenta \
-+    pkg/polycyclic \
-+    pkg/radiroot \
-+    pkg/resclasses \
-+    pkg/sophus \
-+    pkg/tomlib \
-+    pkg/utils \
-     "$GAP_ROOT"/pkg
- 
--# Install the GAP startup script; ensure it is executable
--sdh_install -T ../gap "$SAGE_BIN/gap"
--chmod +x "$SAGE_DESTDIR$SAGE_BIN/gap"
--
--# Create symlinks under $GAP_ROOT for these executables, as they are expected
--# (especially when building kernel packages) to exist
--ln -sf "../../bin/gap-bin" "$DESTDIR_GAP_ROOT/gap"
--ln -sf "../../bin/gac" "$DESTDIR_GAP_ROOT/gac"
--
--# Fix the $GAP_ROOT/bin/<arch>/src symlink to be relative (otherwise it links
--# to the actual path of the sources GAP was compiled from)
--for srclink in "$DESTDIR_GAP_ROOT"/bin/*/src; do
--    rm -f "$srclink"
--    ln -s "../../src" "$srclink"
--done
--
--# Additional fixups for some files after they have been copied into their
--# destination directory.  gac and sysinfo.gap are generated files that contain
--# in them hard-coded references to the GAP build directory, which will soon
--# be going away.  This breaks the build toolchain for some compiled GAP
--# packages.  We need to replace these paths with the final GAP_ROOT path.  The
--# below will work so long as neither of these paths contain '|', and if they do
--# then god help you.  https://trac.sagemath.org/ticket/27218
--sed -i -e "s|$GAP_BUILD_ROOT|$GAP_ROOT|g" \
--    "$SAGE_DESTDIR$SAGE_BIN/gac" "$DESTDIR_GAP_ROOT/sysinfo.gap" \
--    "$DESTDIR_GAP_ROOT/bin/gap.sh" "$DESTDIR_GAP_ROOT/doc/make_doc" || \
--    sdh_die "Failed to fix up hard-coded paths in GAP build tools."
--
- # TODO: This seems unnecessary--we are already installing all of doc/ to
- # GAP_ROOT, which is necessary for some functionality in GAP to work.  Do
- # we need this?  Maybe doc/gap could just be a symlink to gap/doc??
-diff --git a/build/pkgs/gap/spkg-legacy-uninstall b/build/pkgs/gap/spkg-legacy-uninstall
-index d17eb939eb7..a8e5c59e1fb 100755
---- a/build/pkgs/gap/spkg-legacy-uninstall
-+++ b/build/pkgs/gap/spkg-legacy-uninstall
-@@ -4,6 +4,8 @@ rm -rf "$SAGE_LOCAL/gap/gap-4."*
- rm -rf "$SAGE_SHARE/gap"
- rm -f "$SAGE_LOCAL/gap/latest"
- rm -f "$SAGE_LOCAL/bin/gap"
-+rm -f "$SAGE_LOCAL/bin/gac"
- 
--# Remove old libgap headers
-+# Remove old libgap headers and library
- rm -rf "$SAGE_LOCAL/include/gap"
-+rm -rf "$SAGE_LOCAL/lib/gap"
-diff --git a/build/pkgs/gap/spkg-prerm.in b/build/pkgs/gap/spkg-prerm.in
-deleted file mode 100644
-index 661d92621fa..00000000000
---- a/build/pkgs/gap/spkg-prerm.in
-+++ /dev/null
-@@ -1,6 +0,0 @@
--# These generated files are placed in directory provided by the SPKG, so
--# delete the generated files first so that their parent directories can be
--# removed during installation
--GAP_ROOT="$SAGE_LOCAL/share/gap"
--rm -f "$GAP_ROOT/pkg/atlasrep/datagens/"*.*
--rm -f "$GAP_ROOT/pkg/atlasrep/dataword/"*.*
-diff --git a/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch b/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch
-deleted file mode 100644
-index e45fe7d9c6f..00000000000
---- a/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch
-+++ /dev/null
-@@ -1,150 +0,0 @@
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c b/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--index 3bbdc45..7df699f 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--@@ -8,9 +8,8 @@ extern short sp[],**mat[],*psp[],**imcos[],**cpco[],lorb[],
-- short *cst,**cpst,***cdpst,**svptr,*cp,*rel;
-- short *spst,**pspst,**pptr,**cpptr,npt,nb,nph,nph2,npg,npg2,
--       rno,orno,coh_index,*invg;
---FILE  *ip,*op;
-- 
---void seeknln (void) { while (getc(ip)!='\n'); }
--+void seeknln (FILE *ip) { while (getc(ip)!='\n'); }
-- 
-- /* This program differs from most other permutation programs in that perms are
--    all stored in the single array sp. Schreier vectors are stored in the short
--@@ -23,13 +22,14 @@ void seeknln (void) { while (getc(ip)!='\n'); }
-- int 
-- crprog1 (void)
-- { short *pc,*qc,ex,neg; int x;
--+  FILE  *ip,*op;
--   short i,j,k,l,m,n,cl,rl,*p,ocl,im,pt,pt1,pn,ipt;
--   if ((ip=fopen(inf2,"r"))== 0)
--   { fprintf(stderr,"Cannot open %s.\n",inf2); return(-1);}
--   fscanf(ip,"%hd%hd%hd%hd",&npt,&nph,&nb,&k);
--   if (nb>=mb) {fprintf(stderr,"nb too big. Increase MB.\n"); return(-1);}
--   if (k<=2) {fprintf(stderr,"inf2 has illegal format.\n"); return(-1); }
---  seeknln(); seeknln();
--+  seeknln(ip); seeknln(ip);
--   for (i=1;i<=nb;i++) fscanf(ip,"%hd",lorb+i);
--   pptr=psp-1; pspst=psp+nph; svptr=cpsp-1;  cpst=cpsp+nb;
--   invg=sp; nph2=2*nph; spst=sp+nph2;
--@@ -37,7 +37,7 @@ crprog1 (void)
--   { pptr[i]=spst+(i-1)*npt-1; p=pptr[i];
--     for (j=1;j<=npt;j++) {fscanf(ip,"%hd",&k); p[k]=j; }
--     invg[2*i-2]=2*i-1; invg[2*i-1]=2*i-2;
---    seeknln();
--+    seeknln(ip);
--   }
--   spst+=(npt*nph);
--   for (i=1;i<=nb;i++)
--@@ -75,7 +75,7 @@ crprog1 (void)
--   strcpy(inf1,inf0); strcat(inf1,".rel");
--   if ((ip=fopen(inf1,"r"))==0)
--   { fprintf(stderr,"Cannot open %s.\n",inf1); return(-1);}
---  fscanf(ip,"%hd%hd",&k,&rno); seeknln();
--+  fscanf(ip,"%hd%hd",&k,&rno); seeknln(ip);
--   op=fopen(outft,"w");
-- /* Now we have read everything in, and the computation can start */
--   orno=0;
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--index a7396b2..658496f 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--@@ -20,8 +20,6 @@ short  mexp=MEXP,mcl=MCL,no,rel[RSP],wt[MEXP],exp,*rpf,*rpb,
-- extern short  prime,dim,*spv,**spm,mspace[],*vec[],**mat[],cp[],pinv[],opmats,
--         mm,mv;
-- extern int msp;
---FILE *ip,*op;
---
-- 
-- int 
-- calcmats (void)
--@@ -59,7 +57,7 @@ calcmats (void)
--   }
--   for (i=1;i<=exp;i++) trans(mat[i+exp],mat[i]);
--   if (opmats)
---  { op=fopen(outf,"w");
--+  { FILE *op=fopen(outf,"w");
--     fprintf(op,"%4d%4d%4d\n",prime,dim,exp);
--     for (i=1;i<=exp;i++) printmat(mat[i]); 
--     fclose(op);
--@@ -71,6 +69,7 @@ int
-- rdmats (void)
-- /* reads matrices of generators of P */
-- { short i; int quot;
--+  FILE *ip;
--   ip=fopen(inf4,"r");
--   if (ip==0)
--   { fprintf(stderr,"Cannot open %s\n ",inf4); return(-1); }
--@@ -90,12 +89,12 @@ rdmats (void)
--   fclose(ip);
--   return(0);
-- }
---FILE *ip;
-- 
-- int 
-- ingp (int inp)
-- /* Read in output of respcrun -s */
-- { short i,j,k,l,m,*orpf,**pcp;
--+  FILE *ip;
--   ip=fopen(inf3,"r");
--   if (ip==0) { fprintf(stderr,"Cannot open %s\n",inf3); return(-1); }
--   fscanf(ip,"%hd%hd%hd%hd%hd%hd",&prime,&exp,&i,&no,&j,&m);
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--index 0896551..6841bc8 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--@@ -9,7 +9,6 @@ extern short  intexp,mexp,mng,wksp,
--        spugen[],*tlintg[];
-- extern int ptrsp,rsp;
-- short  fac;
---FILE *ip,*op;
-- 
-- int 
-- ingp (void)
--@@ -18,6 +17,7 @@ ingp (void)
--    of nqrun, and tails are also read in.
-- */
-- { short i,j,k,l,m,x,y,no,*orpf,*orpb,**pcp;  char tails;
--+  FILE *ip;
--   if ((ip=fopen(inf1,"r"))==0)
--   { fprintf(stderr,"Cannot open %s.\n",inf1); return(-1); }
--   fscanf(ip,"%hd%hd%hd%hd%hd%hd",&prime,&exp,&nng,&no,&class,&m);
--@@ -89,6 +89,7 @@ int
-- outgp (void)
-- /* The PCP is output, together with tails */
-- { short i,k,l,**pcp,*b,*e,*c;
--+  FILE *op;
--   op=fopen(outf,"w");
--   fprintf(op,"%4d%4d%4d%4d%4d%4d\n",prime,exp,nng,exp,class,1);
--   for (i=1;i<=exp;i++) fprintf(op,"%4d",wt[i]); fprintf(op,"\n");
--@@ -379,7 +380,7 @@ restart:
--     nng--; mnng--; enexpnt--;
--     if (nng==0)
--     { if (gap)
---      { op=fopen(outfm,"w"); fprintf(op,"COHOMOLO.Multiplier:=[];\n");
--+      { FILE *op=fopen(outfm,"w"); fprintf(op,"COHOMOLO.Multiplier:=[];\n");
--         fclose(op);
--         printf("All new generators eliminated. Multiplier is trivial.\n");
--       }
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--index 01cf914..0144883 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--@@ -9,7 +9,6 @@ extern short  intexp,mng,mexp,wksp,
--        spugen[],*intg[],*imintg[],*tlintg[];
-- extern int ptrsp,rsp;
-- short  *wf,*wc; char norm;
---FILE *ip,*op;
-- 
-- /* The data structures for this program and for nqrun are similar.
--    d1 and d2 contain definitions of generators. (Def. comes from commutator
--@@ -35,6 +34,7 @@ nqmprog (void)
-- { short i,j,k,l,m,d,*gi,*gj,*ti,*tj,cl,def,*ps,*pf,**dp,*nrpb,*p,*orpf,*orpb,
--         nb,np,k1,*rno,*covrel,**pgen,tdef,sgn;
--   char nt;
--+  FILE *ip,*op;
--   if (ingp() == -1) {fprintf(stderr,"Input error.\n"); return(-1); }
--   eexpnt=expnt+exp; enexpnt=nexpnt+nng;
-- 
-diff --git a/build/pkgs/gap_packages/patches/guava_leon_includes.patch b/build/pkgs/gap_packages/patches/guava_leon_includes.patch
-deleted file mode 100644
-index cdcd19cc3e8..00000000000
---- a/build/pkgs/gap_packages/patches/guava_leon_includes.patch
-+++ /dev/null
-@@ -1,13 +0,0 @@
----- a/pkg/guava-3.15/src/leon/src/generate.c	Sat Feb 29 09:02:10 2020
----- b/pkg/guava-3.15/src/leon/src/generate.c	Thu Sep 24 13:58:36 2020
--***************
--*** 115,120 ****
----- 115,122 ----
--  #include "groupio.h"
--  #include "enum.h"
--  #include "storage.h"
--+ #include "chbase.h"
--+ #include "inform.h"
--  
--  #ifdef ALT_TIME_HEADER
--  #include "cputime.h"
-diff --git a/build/pkgs/gap_packages/spkg-install.in b/build/pkgs/gap_packages/spkg-install.in
-index 168e6b11532..6dff182a48f 100644
---- a/build/pkgs/gap_packages/spkg-install.in
-+++ b/build/pkgs/gap_packages/spkg-install.in
-@@ -1,4 +1,4 @@
--GAP_ROOT="$SAGE_LOCAL/share/gap"
-+GAP_ROOT="$SAGE_LOCAL/lib/gap"
- PKG_DIR="$GAP_ROOT/pkg"
- 
- PKG_SRC_DIR="$(pwd)/src/pkg"
-@@ -11,33 +11,31 @@ cd "$PKG_SRC_DIR"
- #    (GAP 4.8.6 still had it, but this is gone in 4.10)
- 
- sdh_install \
--    aclib-* \
--    AutoDoc-* \
--    corelg-* \
--    crime-* \
-+    aclib \
-+    corelg \
-+    crime \
-     cryst \
-     crystcat \
--    design-* \
-+    design \
-     gbnp \
--    genss-* \
--    hap-* \
--    hapcryst-* \
--    hecke-* \
--    images-* \
--    liealgdb-* \
--    liepring-* \
--    liering-* \
--    loops-* \
--    MapClass-* \
--    polymaking-* \
--    qpa-* \
--    quagroup-* \
--    radiroot-* \
--    repsn-* \
--    sla-* \
--    sonata-* \
--    Toric-* \
--    utils-* \
-+    genss \
-+    hap \
-+    hapcryst \
-+    hecke \
-+    images \
-+    liealgdb \
-+    liepring \
-+    liering \
-+    loops \
-+    mapclass \
-+    polymaking \
-+    qpa \
-+    quagroup \
-+    repsn \
-+    singular \
-+    sla \
-+    sonata \
-+    toric \
-     "$PKG_DIR"
- 
- install_compiled_pkg()
-@@ -45,27 +43,23 @@ install_compiled_pkg()
-     local pkg="$1"
-     # Install the bin/ dir (where compiled modules should end up)
-     # under <prefix>/lib/gap; we then symlink to it later
--    sdh_install bin "$SAGE_LOCAL/lib/gap/pkg/$pkg"
-+    sdh_install * "$SAGE_LOCAL/lib/gap/pkg/$pkg"
- 
-+    # TODO:
-     # Clean up any build artificts before installing the rest of the package
-     # Also remove configure/Makefiles
-     # Note: None, if any of the packages really have a proper install target
--    make clean  # Works for some packages but not all
--    rm -rf bin/
--    rm -rf configure configure.* config.* autogen.sh *.m4 Makefile* m4/
-+    #make clean  # Works for some packages but not all
-+    #rm -rf bin/
-+    #rm -rf configure configure.* config.* autogen.sh *.m4 Makefile* m4/
- 
--    # Create the bin/ symlink
--    ln -s "$SAGE_LOCAL/lib/gap/pkg/$pkg/bin" bin
--
--    # Install the rest of the package files
--    sdh_install * "$PKG_DIR/$pkg"
- }
- 
- # Build and install compiled packages:
- #
- # These packages have an old ./configure that take the GAP_ROOT as a positional
- # argument
--for pkg in cohomolo-* crypting-* grape-* guava-* orb-* datastructures-*
-+for pkg in cohomolo crypting grape guava orb datastructures
- do
-     echo "Building GAP package $pkg"
-     CFLAGS="$CFLAGS -Wno-implicit-function-declaration"
-@@ -91,7 +85,7 @@ pararr=( " " " " "--with-external-planarity" "--with-external-libsemigroups" )
- ##############################################################################
- 
- parind=0
--for pkg in nq-* io-* digraphs-* semigroups-*
-+for pkg in nq io digraphs semigroups
- do
-     echo "Building GAP package $pkg"
-     cd "$PKG_SRC_DIR/$pkg"
-diff --git a/build/pkgs/libsemigroups/checksums.ini b/build/pkgs/libsemigroups/checksums.ini
-index 62c4268515f..4e13a36cb35 100644
---- a/build/pkgs/libsemigroups/checksums.ini
-+++ b/build/pkgs/libsemigroups/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=libsemigroups-VERSION.tar.gz
--sha1=2b16c095cc5ffd3f77a71dfbf48cce188e054c03
--md5=7082cadcf7a195ccb93175cd72b6db95
--cksum=1501022358
-+sha1=86375824b47ce4b0e23570122e873f67136d0c0a
-+md5=ff79ad5fbc8bfeb64d48faaf24106b98
-+cksum=2845045455
- upstream_url=https://github.com/libsemigroups/libsemigroups/releases/download/vVERSION/libsemigroups-VERSION.tar.gz
-diff --git a/build/pkgs/libsemigroups/package-version.txt b/build/pkgs/libsemigroups/package-version.txt
-index 9084fa2f716..f90b1afc082 100644
---- a/build/pkgs/libsemigroups/package-version.txt
-+++ b/build/pkgs/libsemigroups/package-version.txt
-@@ -1 +1 @@
--1.1.0
-+2.3.2
-diff --git a/build/pkgs/libsemigroups/spkg-install.in b/build/pkgs/libsemigroups/spkg-install.in
-index 2aaf0e99043..128b54d2f99 100644
---- a/build/pkgs/libsemigroups/spkg-install.in
-+++ b/build/pkgs/libsemigroups/spkg-install.in
-@@ -1,4 +1,4 @@
- cd src
--sdh_configure
-+sdh_configure --disable-eigen
- sdh_make
- sdh_make_install
-diff --git a/build/pkgs/singular/spkg-configure.m4 b/build/pkgs/singular/spkg-configure.m4
-index d4d145defe3..6a85631f624 100644
---- a/build/pkgs/singular/spkg-configure.m4
-+++ b/build/pkgs/singular/spkg-configure.m4
-@@ -9,52 +9,7 @@ SAGE_SPKG_CONFIGURE([singular], [
-        AC_MSG_CHECKING([that Singular's help is working])
-        AS_IF([test x`printf "system(\"--browser\", \"builtin\"); \n help;" | Singular 2>&1 | grep "error occurred"` = x], [
-         AC_MSG_RESULT(yes)
--        dnl We have Singular. Now determine the shared library path on
--        dnl platforms on which sage.libs.singular needs to reload the library with RTLD_GLOBAL.
--        AS_CASE([$host_os],
--          [cygwin*], [dnl Nothing to do
--                     ],
--                     [dnl Use pkg-config to get singular's libdir while we're at it. As a
--                      dnl moral compromise for using pkg-config, this ultimately allows us
--                      dnl to pass an absolute path to dlopen(), which is the only approach
--                      dnl that POSIX guarantees will work.
--                      PKG_CHECK_VAR([SINGULAR_LIB_DIR], [Singular], [libdir])
--                      dnl The acl_shlibext variable is set in the top-level configure.ac.
--                      AC_LANG_PUSH(C)
--                      ORIG_LIBS="${LIBS}"
--                      LIBS="${LIBS} -ldl"
--                      AC_MSG_CHECKING([if we can dlopen($LIBSINGULAR_PATH)])
--                      LIBSINGULAR_PATH="${SINGULAR_LIB_DIR}/libSingular.${acl_shlibext}"
--
--                      dnl if we can dlopen() it, substitute the name for sage_conf;
--                      dnl otherwise, fall back to using the SPKG.
--                      AC_RUN_IFELSE(
--                        [AC_LANG_PROGRAM(
--                          [[#include <dlfcn.h>]],
--                          [[void* h = dlopen("${LIBSINGULAR_PATH}", RTLD_LAZY | RTLD_GLOBAL);
--                            if (h == 0) { return 1; } else { return dlclose(h); }]]
--                        )], [
--                          AC_MSG_RESULT(yes)
--                        ], [
--                          dnl try Debian-specific name
--                          LIBSINGULAR_PATH="${SINGULAR_LIB_DIR}/libsingular-Singular.${acl_shlibext}"
--                          AC_RUN_IFELSE(
--                           [AC_LANG_PROGRAM(
--                             [[#include <dlfcn.h>]],
--                             [[void* h = dlopen("${LIBSINGULAR_PATH}", RTLD_LAZY | RTLD_GLOBAL);
--                               if (h == 0) { return 1; } else { return dlclose(h); }]]
--                           )], [
--                             AC_MSG_RESULT(yes)
--                           ], [
--                            AC_MSG_RESULT(no)
--                            sage_spkg_install_singular=yes
--                          ], [AC_MSG_RESULT(yes)])
--                        ], [AC_MSG_RESULT(yes)])
--
--                      AC_LANG_POP()
--                      LIBS="${ORIG_LIBS}"
--                     ]
--       )], [
-+       ], [
-        AC_MSG_RESULT(no)
-        sage_spkg_install_singular=yes
-        ]
-@@ -64,20 +19,4 @@ SAGE_SPKG_CONFIGURE([singular], [
-       ])
-     ])
-   ])
--],[],[],[
--  dnl Post-check phase
--  dnl We make the sage_conf substitutions here, because the "default"
--  dnl substitution needs to be made even if we skipped the system-Singular
--  dnl checks themselves.
--  AS_IF([test "x${sage_spkg_install_singular}" = "xyes"], [
--    AS_CASE([$host_os],
--      [cygwin*], [dnl Nothing to do
--                 ],
--                 [dnl Set shared library path, needed for reloading the library with RTLD_GLOBAL
--                  LIBSINGULAR_PATH="\$SAGE_LOCAL/lib/libSingular.${acl_shlibext}"
--                 ]
--    )
--  ])
--
--  AC_SUBST(LIBSINGULAR_PATH, "${LIBSINGULAR_PATH}")
- ])
-diff --git a/pkgs/sage-conf/_sage_conf/_conf.py.in b/pkgs/sage-conf/_sage_conf/_conf.py.in
-index 6cd28f558a8..d66bdb3d264 100644
---- a/pkgs/sage-conf/_sage_conf/_conf.py.in
-+++ b/pkgs/sage-conf/_sage_conf/_conf.py.in
-@@ -55,9 +55,6 @@ THREEJS_DIR = SAGE_LOCAL + "/share/threejs-sage"
- OPENMP_CFLAGS = "@OPENMP_CFLAGS@"
- OPENMP_CXXFLAGS = "@OPENMP_CXXFLAGS@"
- 
--# The full absolute path to the main Singular library.
--LIBSINGULAR_PATH = "@LIBSINGULAR_PATH@".replace('$SAGE_LOCAL', SAGE_LOCAL)
--
- # Installation location of wheels. This is determined at configuration time
- # and does not depend on the installation location of sage-conf.
- SAGE_SPKG_WHEELS = "@SAGE_VENV@".replace('${SAGE_LOCAL}', SAGE_LOCAL) + "/var/lib/sage/wheels"
-diff --git a/src/doc/en/thematic_tutorials/lie/weyl_groups.rst b/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-index c917338e444..182e74aad20 100644
---- a/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-+++ b/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-@@ -139,12 +139,12 @@ string, which you can print::
-     X.1      1  1  1  1  1  1  1  1  1  1  1  1  1
-     X.2      1 -1  1  1 -1  1  1 -1 -1 -1  1  1  1
-     X.3      2  .  2 -1  .  2  2  .  .  . -1  2  2
--    X.4      3 -1 -1  .  1 -1  3 -1  1 -1  . -1  3
--    X.5      3 -1 -1  .  1  3 -1 -1 -1  1  . -1  3
--    X.6      3  1 -1  . -1 -1  3  1 -1  1  . -1  3
--    X.7      3  1 -1  . -1  3 -1  1  1 -1  . -1  3
--    X.8      3 -1  3  . -1 -1 -1 -1  1  1  . -1  3
--    X.9      3  1  3  .  1 -1 -1  1 -1 -1  . -1  3
-+    X.4      3 -1 -1  .  1  3 -1 -1 -1  1  . -1  3
-+    X.5      3  1 -1  . -1  3 -1  1  1 -1  . -1  3
-+    X.6      3 -1  3  . -1 -1 -1 -1  1  1  . -1  3
-+    X.7      3 -1 -1  .  1 -1  3 -1  1 -1  . -1  3
-+    X.8      3  1  3  .  1 -1 -1  1 -1 -1  . -1  3
-+    X.9      3  1 -1  . -1 -1  3  1 -1  1  . -1  3
-     X.10     4 -2  . -1  .  .  .  2  .  .  1  . -4
-     X.11     4  2  . -1  .  .  . -2  .  .  1  . -4
-     X.12     6  . -2  .  . -2 -2  .  .  .  .  2  6
-diff --git a/src/sage/coding/codecan/autgroup_can_label.pyx b/src/sage/coding/codecan/autgroup_can_label.pyx
-index de5db985e0b..c83b9264e44 100644
---- a/src/sage/coding/codecan/autgroup_can_label.pyx
-+++ b/src/sage/coding/codecan/autgroup_can_label.pyx
-@@ -76,7 +76,7 @@ columns do share the same coloring::
-     ((1,),
-      (2,),
-      (3, 5, 4),
--     (6, 19, 16, 9, 21, 10, 8, 15, 14, 11, 20, 13, 12, 7, 17, 18))
-+     (6, 19, 16, 21, 9, 10, 15, 8, 20, 11, 14, 13, 7, 12, 18, 17))
- 
- We can also restrict the group action to linear isometries::
- 
-diff --git a/src/sage/coding/linear_code.py b/src/sage/coding/linear_code.py
-index a3ac3ca1547..bfb9f8696e8 100644
---- a/src/sage/coding/linear_code.py
-+++ b/src/sage/coding/linear_code.py
-@@ -465,27 +465,27 @@ def automorphism_group_gens(self, equivalence="semilinear"):
-             0
-             sage: C = codes.HammingCode(GF(4, 'z'), 3)
-             sage: C.automorphism_group_gens()
--            ([((1, 1, 1, 1, 1, z + 1, z, z + 1, z, z, z, 1, 1, z + 1, z + 1, z, z + 1, z, z + 1, z + 1, z + 1); (1,14,6,7,4,10,11,19)(2,8,16,13,3,17,21,15)(9,12,18,20), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((1, 1, 1, z, z + 1, 1, 1, 1, 1, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z); (1,13,14,20)(2,21,8,18,7,16,19,15)(3,10,5,12,17,9,6,4), Ring endomorphism of Finite Field in z of size 2^2
-+                Defn: z |--> z + 1),
-+              ((z, 1, z, z, z, z + 1, z, z, z, z, z, z, z + 1, z, z, z, z, z + 1, z, z, z); (1,11,5,12,3,19)(2,8)(6,18,13)(7,17,15)(9,10,14,16,20,21), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z + 1),
--              ((z + 1, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z + 1, 1, z, z + 1, z + 1, z); (1,18,6,19,2,9,17,10,13,14,21,11,4,5,12)(3,20,7,16,8), Ring endomorphism of Finite Field in z of size 2^2
--                Defn: z |--> z),
-               ((z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z); (), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-              362880)
-             sage: C.automorphism_group_gens(equivalence="linear")
--            ([((z + 1, 1, z + 1, z + 1, z + 1, z, 1, z, 1, 1, 1, 1, z + 1, z + 1, z + 1, z, z, 1, z, z, z); (1,15,2,8,16,18,3)(4,9,12,13,20,10,11)(5,21,14,6,7,19,17), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((z, 1, z + 1, z + 1, 1, z + 1, z, 1, z + 1, z + 1, 1, z, 1, z + 1, z, 1, z, 1, z + 1, 1, 1); (1,12,11,10,6,8,9,20,13,21,5,14,3,16,17,19,7,4,2,15,18), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((z + 1, z + 1, z + 1, z + 1, z + 1, 1, z, 1, z, z, z, 1, z, 1, 1, 1, z + 1, z + 1, z + 1, 1, z); (1,15,21,8,9)(2,18,5,3,11,16,7,10,19,13,12,4,17,6,20), Ring endomorphism of Finite Field in z of size 2^2
-+              ((z + 1, z + 1, z + 1, z, 1, 1, z, z, 1, z + 1, z, 1, 1, z, 1, z + 1, z, z + 1, z + 1, 1, z); (1,3,18,2,17,6,19)(4,15,13,20,7,14,16)(5,11,8,21,12,9,10), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
-               ((z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1); (), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-              181440)
-             sage: C.automorphism_group_gens(equivalence="permutational")
--            ([((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,19)(3,17)(4,21)(5,20)(7,14)(9,12)(10,16)(11,15), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,11)(3,10)(4,9)(5,7)(12,21)(14,20)(15,19)(16,17), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,11)(3,10)(4,9)(5,7)(12,21)(14,20)(15,19)(16,17), Ring endomorphism of Finite Field in z of size 2^2
-+              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (2,18)(3,19)(4,10)(5,16)(8,13)(9,14)(11,21)(15,20), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,17)(2,8)(3,14)(4,10)(7,12)(9,19)(13,18)(15,20), Ring endomorphism of Finite Field in z of size 2^2
-+              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,19)(3,17)(4,21)(5,20)(7,14)(9,12)(10,16)(11,15), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
-               ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (2,13)(3,14)(4,20)(5,11)(8,18)(9,19)(10,15)(16,21), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-@@ -691,10 +691,10 @@ def _canonize(self, equivalence):
-             sage: C_iso == aut_group_can_label.get_canonical_form()
-             True
-             sage: aut_group_can_label.get_autom_gens()
--            [((1, 1, 1, 1, 1, z + 1, z, z + 1, z, z, z, 1, 1, z + 1, z + 1, z, z + 1, z, z + 1, z + 1, z + 1); (1,14,6,7,4,10,11,19)(2,8,16,13,3,17,21,15)(9,12,18,20), Ring endomorphism of Finite Field in z of size 2^2
-+            [((1, 1, 1, z, z + 1, 1, 1, 1, 1, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z); (1,13,14,20)(2,21,8,18,7,16,19,15)(3,10,5,12,17,9,6,4), Ring endomorphism of Finite Field in z of size 2^2
-+               Defn: z |--> z + 1),
-+             ((z, 1, z, z, z, z + 1, z, z, z, z, z, z, z + 1, z, z, z, z, z + 1, z, z, z); (1,11,5,12,3,19)(2,8)(6,18,13)(7,17,15)(9,10,14,16,20,21), Ring endomorphism of Finite Field in z of size 2^2
-                Defn: z |--> z + 1),
--             ((z + 1, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z + 1, 1, z, z + 1, z + 1, z); (1,18,6,19,2,9,17,10,13,14,21,11,4,5,12)(3,20,7,16,8), Ring endomorphism of Finite Field in z of size 2^2
--               Defn: z |--> z),
-              ((z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z); (), Ring endomorphism of Finite Field in z of size 2^2
-                Defn: z |--> z)]
-         """
-diff --git a/src/sage/combinat/posets/posets.py b/src/sage/combinat/posets/posets.py
-index 2836d59d960..8c882d5ac3b 100644
---- a/src/sage/combinat/posets/posets.py
-+++ b/src/sage/combinat/posets/posets.py
-@@ -8813,7 +8813,7 @@ def _libgap_(self):
-             sage: libgap(P)  # optional - gap_packages
-             <A poset on 5 points>
-             sage: A = libgap(GF(2)).PosetAlgebra(P); A  # optional - gap_packages
--            <GF(2)[<quiver with 5 vertices and 5 arrows>]/<two-sided ideal in <GF(2)[<quiver with 5 vertices and 5 arrows>]>, (1 generators)>>
-+            <GF(2)[<quiver with 5 vertices and 5 arrows>]/<two-sided ideal in <GF(2)[<quiver with 5 vertices and 5 arrows>]>, (1 generator)>>
-             sage: A.Dimension()  # optional - gap_packages
-             13
-         """
-diff --git a/src/sage/combinat/root_system/hecke_algebra_representation.py b/src/sage/combinat/root_system/hecke_algebra_representation.py
-index 6b756bafc30..8ac99319bec 100644
---- a/src/sage/combinat/root_system/hecke_algebra_representation.py
-+++ b/src/sage/combinat/root_system/hecke_algebra_representation.py
-@@ -357,7 +357,7 @@ def Tw(self, word, signs=None, scalar=None):
-             sage: q1, q2 = K.gens()
-             sage: KW = W.algebra(K)
-             sage: x = KW.an_element(); x
--            123 + 3*32 + 2*3 + e
-+            123 + 3*2312 + 2*31 + e
- 
-             sage: T = KW.demazure_lusztig_operators(q1,q2)
-             sage: T12 = T.Tw( (1,2) )
-diff --git a/src/sage/combinat/symmetric_group_algebra.py b/src/sage/combinat/symmetric_group_algebra.py
-index b8a0bebab44..9bccba124c8 100644
---- a/src/sage/combinat/symmetric_group_algebra.py
-+++ b/src/sage/combinat/symmetric_group_algebra.py
-@@ -101,7 +101,7 @@ def SymmetricGroupAlgebra(R, W, category=None):
-         sage: SGA.group()
-         Weyl Group of type ['A', 3] (as a matrix group acting on the ambient space)
-         sage: SGA.an_element()
--        s1*s2*s3 + 3*s3*s2 + 2*s3 + 1
-+        s1*s2*s3 + 3*s2*s3*s1*s2 + 2*s3*s1 + 1
- 
-     The preferred way to construct the symmetric group algebra is to
-     go through the usual ``algebra`` method::
-diff --git a/src/sage/env.py b/src/sage/env.py
-index 911f34b1bc6..5f7aca8599c 100644
---- a/src/sage/env.py
-+++ b/src/sage/env.py
-@@ -197,7 +197,8 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- GRAPHS_DATA_DIR = var("GRAPHS_DATA_DIR", join(SAGE_SHARE, "graphs"))
- ELLCURVE_DATA_DIR = var("ELLCURVE_DATA_DIR", join(SAGE_SHARE, "ellcurves"))
- POLYTOPE_DATA_DIR = var("POLYTOPE_DATA_DIR", join(SAGE_SHARE, "reflexive_polytopes"))
--GAP_ROOT_DIR = var("GAP_ROOT_DIR", join(SAGE_SHARE, "gap"))
-+GAP_LIB_DIR = var("GAP_LIB_DIR", join(SAGE_LOCAL, "lib", "gap"))
-+GAP_SHARE_DIR = var("GAP_SHARE_DIR", join(SAGE_SHARE, "gap"))
- THEBE_DIR = var("THEBE_DIR", join(SAGE_SHARE, "thebe"))
- COMBINATORIAL_DESIGN_DATA_DIR = var("COMBINATORIAL_DESIGN_DATA_DIR", join(SAGE_SHARE, "combinatorial_designs"))
- CREMONA_MINI_DATA_DIR = var("CREMONA_MINI_DATA_DIR", join(SAGE_SHARE, "cremona"))
-@@ -229,12 +230,6 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- LIE_INFO_DIR = var("LIE_INFO_DIR", join(SAGE_LOCAL, "lib", "LiE"))
- SINGULAR_BIN = var("SINGULAR_BIN") or "Singular"
- 
--# The path to libSingular, to be passed to dlopen(). This will
--# typically be set to an absolute path in sage_conf, but the relative
--# fallback path here works on systems where dlopen() searches the
--# system's library locations.
--LIBSINGULAR_PATH = var("LIBSINGULAR_PATH", "libSingular.so")
--
- # OpenMP
- OPENMP_CFLAGS = var("OPENMP_CFLAGS", "")
- OPENMP_CXXFLAGS = var("OPENMP_CXXFLAGS", "")
-@@ -255,81 +250,6 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- SAGE_GAP_COMMAND = var('SAGE_GAP_COMMAND', _gap_cmd)
- 
- 
--def _get_shared_lib_path(*libnames: str) -> Optional[str]:
--    """
--    Return the full path to a shared library file installed in
--    ``$SAGE_LOCAL/lib`` or the directories associated with the
--    Python sysconfig.
--
--    This can also be passed more than one library name (e.g. for cases where
--    some library may have multiple names depending on the platform) in which
--    case the first one found is returned.
--
--    This supports most *NIX variants (in which ``lib<libname>.so`` is found
--    under ``$SAGE_LOCAL/lib``), macOS (same, but with the ``.dylib``
--    extension), and Cygwin (under ``$SAGE_LOCAL/bin/cyg<libname>.dll``,
--    or ``$SAGE_LOCAL/bin/cyg<libname>-*.dll`` for versioned DLLs).
--
--    For distributions like Debian that use a multiarch layout, we also try the
--    multiarch lib paths (i.e. ``/usr/lib/<arch>/``).
--
--    This returns ``None`` if no matching library file could be found.
--
--    EXAMPLES::
--
--        sage: from sage.env import _get_shared_lib_path
--        sage: "gap" in _get_shared_lib_path("gap")
--        True
--        sage: _get_shared_lib_path("an_absurd_lib") is None
--        True
--
--    """
--
--    for libname in libnames:
--        search_directories: List[Path] = []
--        patterns: List[str] = []
--        if sys.platform == 'cygwin':
--            # Later down we take the first matching DLL found, so search
--            # SAGE_LOCAL first so that it takes precedence
--            if SAGE_LOCAL:
--                search_directories.append(Path(SAGE_LOCAL) / 'bin')
--            search_directories.append(Path(sysconfig.get_config_var('BINDIR')))
--            # Note: The following is not very robust, since if there are multible
--            # versions for the same library this just selects one more or less
--            # at arbitrary. However, practically speaking, on Cygwin, there
--            # will only ever be one version
--            patterns = [f'cyg{libname}.dll', f'cyg{libname}-*.dll']
--        else:
--            if sys.platform == 'darwin':
--                ext = 'dylib'
--            else:
--                ext = 'so'
--
--            if SAGE_LOCAL:
--                search_directories.append(Path(SAGE_LOCAL) / 'lib')
--            libdir = sysconfig.get_config_var('LIBDIR')
--            if libdir is not None:
--                libdir = Path(libdir)
--                search_directories.append(libdir)
--
--                multiarchlib = sysconfig.get_config_var('MULTIARCH')
--                if multiarchlib is not None:
--                    search_directories.append(libdir / multiarchlib),
--
--            patterns = [f'lib{libname}.{ext}']
--
--        for directory in search_directories:
--            for pattern in patterns:
--                path = next(directory.glob(pattern), None)
--                if path is not None:
--                    return str(path.resolve())
--
--    # Just return None if no files were found
--    return None
--
--# locate libgap shared object
--GAP_SO = var("GAP_SO", _get_shared_lib_path("gap", ""))
--
- # post process
- if DOT_SAGE is not None and ' ' in DOT_SAGE:
-     if UNAME[:6] == 'CYGWIN':
-diff --git a/src/sage/groups/abelian_gps/abelian_group_gap.py b/src/sage/groups/abelian_gps/abelian_group_gap.py
-index a4b047113c5..86090b43535 100644
---- a/src/sage/groups/abelian_gps/abelian_group_gap.py
-+++ b/src/sage/groups/abelian_gps/abelian_group_gap.py
-@@ -338,7 +338,7 @@ def _element_constructor_(self, x, check=True):
-         if isinstance(x, AbelianGroupElement_gap):
-             try:
-                 if x in self._cover:
--                    x = self.gap().NaturalHomomorphism().Image(x.gap())
-+                    x = self._cover.gap().NaturalHomomorphismByNormalSubgroup(self._relations).Image(x.gap())
-                 else:
-                     x = x.gap()
-             except AttributeError:
-@@ -1043,7 +1043,7 @@ def natural_homomorphism(self):
-             From: Abelian group with gap, generator orders (4,)
-             To:   Quotient abelian group with generator orders (2,)
-         """
--        phi = self.gap().NaturalHomomorphism()
-+        phi = self._cover.gap().NaturalHomomorphismByNormalSubgroup(self._relations)
-         Hom = self._cover.Hom(self)
-         return Hom(phi)
- 
-diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py
-index 8d6e443683c..1beb01af87f 100644
---- a/src/sage/groups/finitely_presented.py
-+++ b/src/sage/groups/finitely_presented.py
-@@ -596,9 +596,9 @@ def gap(self):
-             sage: k = G.rewriting_system()
-             sage: k.gap()
-             Knuth Bendix Rewriting System for Monoid( [ a, A, b, B ] ) with rules
--            [ [ a^2, <identity ...> ], [ a*A, <identity ...> ],
--              [ A*a, <identity ...> ], [ b^2, <identity ...> ],
--              [ b*B, <identity ...> ], [ B*b, <identity ...> ] ]
-+            [ [ a*A, <identity ...> ], [ A*a, <identity ...> ],
-+              [ b*B, <identity ...> ], [ B*b, <identity ...> ],
-+              [ a^2, <identity ...> ], [ b^2, <identity ...> ] ]
-         """
-         return self._gap
- 
-diff --git a/src/sage/groups/fqf_orthogonal.py b/src/sage/groups/fqf_orthogonal.py
-index 7fc4dbe7548..e5eccd45942 100644
---- a/src/sage/groups/fqf_orthogonal.py
-+++ b/src/sage/groups/fqf_orthogonal.py
-@@ -143,7 +143,7 @@ class FqfOrthogonalGroup(AbelianGroupAutomorphismGroup_subgroup):
-         [2/3   0   0]
-         [  0 2/3   0]
-         [  0   0 4/3]
--        generated by 2 elements
-+        generated by 3 elements
-         sage: q = matrix.diagonal(QQ, [3/2, 1/4, 1/4])
-         sage: T = TorsionQuadraticForm(q)
-         sage: T.orthogonal_group().order()
-diff --git a/src/sage/groups/libgap_wrapper.pyx b/src/sage/groups/libgap_wrapper.pyx
-index d25121aa792..dc81b71635b 100644
---- a/src/sage/groups/libgap_wrapper.pyx
-+++ b/src/sage/groups/libgap_wrapper.pyx
-@@ -25,7 +25,7 @@ Note how we call the constructor of both superclasses to initialize
- its output via LibGAP::
- 
-     sage: FooGroup()
--    <pc group of size 3 with 1 generators>
-+    <pc group of size 3 with 1 generator>
-     sage: type(FooGroup().gap())
-     <class 'sage.libs.gap.element.GapElement'>
- 
-@@ -106,7 +106,7 @@ class ParentLibGAP(SageObject):
-         ....:         ParentLibGAP.__init__(self, lg)
-         ....:         Group.__init__(self)
-         sage: FooGroup()
--        <pc group of size 3 with 1 generators>
-+        <pc group of size 3 with 1 generator>
-     """
- 
-     def __init__(self, libgap_parent, ambient=None):
-@@ -461,7 +461,7 @@ cdef class ElementLibGAP(MultiplicativeGroupElement):
-         ....:         ParentLibGAP.__init__(self, lg)
-         ....:         Group.__init__(self)
-         sage: FooGroup()
--        <pc group of size 3 with 1 generators>
-+        <pc group of size 3 with 1 generator>
-         sage: FooGroup().gens()
-         (f1,)
-     """
-diff --git a/src/sage/groups/matrix_gps/finitely_generated.py b/src/sage/groups/matrix_gps/finitely_generated.py
-index a6d3dc02513..63956ad5f10 100644
---- a/src/sage/groups/matrix_gps/finitely_generated.py
-+++ b/src/sage/groups/matrix_gps/finitely_generated.py
-@@ -563,9 +563,6 @@ def as_permutation_group(self, algorithm=None, seed=None):
-             21499084800
-             sage: P = G.as_permutation_group()
-             sage: Psmaller = G.as_permutation_group(algorithm="smaller", seed=6)
--            sage: P == Psmaller  # see the note below
--            True
--            sage: Psmaller = G.as_permutation_group(algorithm="smaller")
-             sage: P == Psmaller
-             False
-             sage: P.cardinality()
-diff --git a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-index f2ccca042ac..47d6862333c 100644
---- a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-+++ b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-@@ -427,7 +427,7 @@ cdef class LabelledBranching:
-             sage: from sage.groups.perm_gps.partn_ref2.refinement_generic import LabelledBranching
-             sage: L = LabelledBranching(3)
-             sage: L.small_generating_set()
--            []
-+            [()]
-             sage: L.add_gen(libgap.eval('(1,2,3)'))
-             sage: L.small_generating_set()
-             [(1,2,3)]
-diff --git a/src/sage/groups/perm_gps/permgroup.py b/src/sage/groups/perm_gps/permgroup.py
-index ebdf7c4c6eb..fb14008c8e0 100644
---- a/src/sage/groups/perm_gps/permgroup.py
-+++ b/src/sage/groups/perm_gps/permgroup.py
-@@ -926,7 +926,7 @@ def _coerce_map_from_(self, G):
-            sage: f = PG._coerce_map_from_(MG)
-            sage: mg = MG.an_element()
-            sage: p = f(mg); p
--           (2,33,32,23,31,55)(3,49,38,44,40,28)(4,17,59,62,58,46)(5,21,47,20,43,8)(6,53,50)(7,37,12,57,14,29)(9,41,56,34,64,10)(11,25,19)(13,61,26,51,22,15)(16,45,36)(18,27,35,48,52,54)(24,63,42)(30,39,60)
-+           (1,2,6,19,35,33)(3,9,26,14,31,23)(4,13,5)(7,22,17)(8,24,12)(10,16,32,27,20,28)(11,30,18)(15,25,36,34,29,21)
-            sage: PG(p._gap_()) == p
-            True
- 
-@@ -972,12 +972,12 @@ def _coerce_map_from_(self, G):
-             sage: P = G.as_permutation_group(algorithm='smaller', seed=5)
-             sage: P1 = G.as_permutation_group()
-             sage: P == P1
--            False
-+            True
-             sage: g1, g2, g3 = G.gens()
-             sage: P(g1*g2)
--            (1,3,7,12)(2,4,8,10)(5,11)(6,9)
-+            (1,4,13,11)(2,5,14,18)(3,15,8,16)(6,7)(9,20,19,12)(10,17)
-             sage: P1(g1*g2)
--            (2,29,25,68)(3,57,13,54)(4,11,72,37)(5,39,60,23)(6,64,75,63)(7,21,50,73)(8,46,38,32)(9,74,35,18)(10,44,49,48)(12,16,34,71)(14,79,27,40)(15,26)(17,62,59,76)(19,78,70,65)(20,22,58,51)(24,33,36,43)(28,81,80,52)(30,53,56,69)(31,61)(41,42,67,55)(45,77)(47,66)
-+            (1,4,13,11)(2,5,14,18)(3,15,8,16)(6,7)(9,20,19,12)(10,17)
- 
-         Another check for :trac:`5583`::
- 
-@@ -1302,7 +1302,7 @@ def gens_small(self):
-             sage: G.gens_small() # random
-             [('b','c'), ('a','c','b')] ## (on 64-bit Linux)
-             [('a','b'), ('a','c','b')] ## (on Solaris)
--            sage: len(G.gens_small()) == 2
-+            sage: len(G.gens_small()) == 2 # random
-             True
-         """
-         gens = self._libgap_().SmallGeneratingSet()
-@@ -4370,17 +4370,23 @@ def is_transitive(self, domain=None):
- 
-         ::
- 
--            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)]]) #S_5 on [1..5]
--            sage: G.is_transitive([1,4,5])
-+            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)],[(6,7)]])
-+            sage: G.is_transitive([1,2,3,4,5])
-             True
--            sage: G.is_transitive([2..6])
-+            sage: G.is_transitive([1..7])
-             False
-             sage: G.is_transitive(G.non_fixed_points())
--            True
-+            False
-             sage: H = PermutationGroup([[(1,2,3)],[(4,5,6)]])
-             sage: H.is_transitive(H.non_fixed_points())
-             False
- 
-+        If `G` does not act on the domain, it always returns ``False``::
-+
-+            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)]]) #S_5 on [1..5]
-+            sage: G.is_transitive([1,4,5])
-+            False
-+
-         Note that this differs from the definition in GAP, where
-         ``IsTransitive`` returns whether the group is transitive on the
-         set of points moved by the group.
-@@ -4436,12 +4442,16 @@ def is_primitive(self, domain=None):
-             sage: G = PermutationGroup([[(1,2,3,4)],[(2,4)]])
-             sage: G.is_primitive([1..4])
-             False
--            sage: G.is_primitive([1,2,3])
--            True
-             sage: G = PermutationGroup([[(3,4,5,6)],[(3,4)]]) #S_4 on [3..6]
-             sage: G.is_primitive(G.non_fixed_points())
-             True
- 
-+        If `G` does not act on the domain, it always returns ``False``::
-+
-+            sage: G = PermutationGroup([[(1,2,3,4)],[(2,4)]])
-+            sage: G.is_primitive([1,2,3])
-+            False
-+
-         """
-         #If the domain is not a subset of self.domain(), then the
-         #action isn't primitive.
-diff --git a/src/sage/interfaces/gap.py b/src/sage/interfaces/gap.py
-index 7ae1792e9de..ecaa9fd2341 100644
---- a/src/sage/interfaces/gap.py
-+++ b/src/sage/interfaces/gap.py
-@@ -1512,6 +1512,8 @@ def gap_reset_workspace(max_workspace_size=None, verbose=False):
-     """
-     # Create new workspace with filename WORKSPACE
-     g = Gap(use_workspace_cache=False, max_workspace_size=None)
-+    g.eval('ColorPrompt(false)')
-+    g.eval('SetUserPreference("UseColorPrompt", false)')
-     g.eval('SetUserPreference("HistoryMaxLines", 30)')
-     from sage.tests.gap_packages import all_installed_packages
-     for pkg in all_installed_packages(gap=g):
-diff --git a/src/sage/interfaces/gap_workspace.py b/src/sage/interfaces/gap_workspace.py
-index 33a87dd5076..03b40be6856 100644
---- a/src/sage/interfaces/gap_workspace.py
-+++ b/src/sage/interfaces/gap_workspace.py
-@@ -16,7 +16,8 @@
- import os
- import time
- import hashlib
--from sage.env import DOT_SAGE, GAP_SO
-+import subprocess
-+from sage.env import DOT_SAGE, HOSTNAME, GAP_LIB_DIR, GAP_SHARE_DIR
- 
- 
- def gap_workspace_file(system="gap", name="workspace", dir=None):
-@@ -59,11 +60,13 @@ def gap_workspace_file(system="gap", name="workspace", dir=None):
-     if dir is None:
-         dir = os.path.join(DOT_SAGE, 'gap')
- 
--    if GAP_SO:
--        h = hashlib.sha1(GAP_SO.encode('utf-8')).hexdigest()
--    else:
--        h = 'unknown'
--    return os.path.join(dir, '%s-%s-%s' % (system, name, h))
-+    data = f'{GAP_LIB_DIR}:{GAP_SHARE_DIR}'
-+    for path in GAP_LIB_DIR, GAP_SHARE_DIR:
-+        sysinfo = os.path.join(path, "sysinfo.gap")
-+        if os.path.exists(sysinfo):
-+            data += subprocess.getoutput(f'. "{sysinfo}" && echo ":$GAP_VERSION:$GAParch"')
-+    h = hashlib.sha1(data.encode('utf-8')).hexdigest()
-+    return os.path.join(dir, f'{system}-{name}-{HOSTNAME}-{h}')
- 
- 
- def prepare_workspace_dir(dir=None):
-diff --git a/src/sage/libs/gap/element.pyx b/src/sage/libs/gap/element.pyx
-index c555ea0333c..e3db3934baf 100644
---- a/src/sage/libs/gap/element.pyx
-+++ b/src/sage/libs/gap/element.pyx
-@@ -130,6 +130,7 @@ cdef char *capture_stdout(Obj func, Obj obj):
-     """
-     cdef Obj s, stream, output_text_string
-     cdef UInt res
-+    cdef TypOutputFile output
-     # The only way to get a string representation of an object that is truly
-     # consistent with how it would be represented at the GAP REPL is to call
-     # ViewObj on it.  Unfortunately, ViewObj *prints* to the output stream,
-@@ -145,12 +146,12 @@ cdef char *capture_stdout(Obj func, Obj obj):
-         output_text_string = GAP_ValueGlobalVariable("OutputTextString")
-         stream = CALL_2ARGS(output_text_string, s, GAP_True)
- 
--        if not OpenOutputStream(stream):
-+        if not OpenOutputStream(&output, stream):
-             raise GAPError("failed to open output capture stream for "
-                            "representing GAP object")
- 
-         CALL_1ARGS(func, obj)
--        CloseOutput()
-+        CloseOutput(&output)
-         return CSTR_STRING(s)
-     finally:
-         GAP_Leave()
-diff --git a/src/sage/libs/gap/gap_includes.pxd b/src/sage/libs/gap/gap_includes.pxd
-index 6d22e32540b..6111d18a5c7 100644
---- a/src/sage/libs/gap/gap_includes.pxd
-+++ b/src/sage/libs/gap/gap_includes.pxd
-@@ -76,8 +76,10 @@ cdef extern from "gap/intobj.h" nogil:
- 
- 
- cdef extern from "gap/io.h" nogil:
--    UInt OpenOutputStream(Obj stream)
--    UInt CloseOutput()
-+    ctypedef struct TypOutputFile:
-+        pass
-+    UInt OpenOutputStream(TypOutputFile* output, Obj stream)
-+    UInt CloseOutput(TypOutputFile* output)
- 
- 
- cdef extern from "gap/libgap-api.h" nogil:
-diff --git a/src/sage/libs/gap/libgap.pyx b/src/sage/libs/gap/libgap.pyx
-index b1a64e57939..6a36613aa8c 100644
---- a/src/sage/libs/gap/libgap.pyx
-+++ b/src/sage/libs/gap/libgap.pyx
-@@ -695,7 +695,7 @@ class Gap(Parent):
-             sage: libgap.List
-             <Gap function "List">
-             sage: libgap.GlobalRandomSource
--            <RandomSource in IsGlobalRandomSource>
-+            <RandomSource in IsGAPRandomSource>
-         """
-         if name in dir(self.__class__):
-             return getattr(self.__class__, name)
-diff --git a/src/sage/libs/gap/saved_workspace.py b/src/sage/libs/gap/saved_workspace.py
-index ad5adec36d0..7636707f557 100644
---- a/src/sage/libs/gap/saved_workspace.py
-+++ b/src/sage/libs/gap/saved_workspace.py
-@@ -8,7 +8,7 @@
- 
- import os
- import glob
--from sage.env import GAP_ROOT_DIR
-+from sage.env import GAP_LIB_DIR
- from sage.interfaces.gap_workspace import gap_workspace_file
- 
- 
-@@ -31,7 +31,7 @@ def timestamp():
-     """
-     libgap_dir = os.path.dirname(__file__)
-     libgap_files = glob.glob(os.path.join(libgap_dir, '*'))
--    gap_packages = glob.glob(os.path.join(GAP_ROOT_DIR, 'pkg', '*'))
-+    gap_packages = glob.glob(os.path.join(GAP_LIB_DIR, 'pkg', '*'))
-     files = libgap_files + gap_packages
-     if len(files) == 0:
-         print('Unable to find LibGAP files.')
-diff --git a/src/sage/libs/gap/util.pyx b/src/sage/libs/gap/util.pyx
-index 344ab88c42a..eaa659d64c7 100644
---- a/src/sage/libs/gap/util.pyx
-+++ b/src/sage/libs/gap/util.pyx
-@@ -13,7 +13,7 @@ Utility functions for GAP
- #*****************************************************************************
- 
- from libc.signal cimport signal, SIGCHLD, SIG_DFL
--from posix.dlfcn cimport dlopen, dlclose, RTLD_NOW, RTLD_GLOBAL
-+from posix.dlfcn cimport dlopen, dlclose, dlerror, RTLD_LAZY, RTLD_GLOBAL
- 
- from cpython.exc cimport PyErr_Fetch, PyErr_Restore
- from cpython.object cimport Py_LT, Py_LE, Py_EQ, Py_NE, Py_GT, Py_GE
-@@ -164,33 +164,6 @@ cdef void gasman_callback() with gil:
- ### Initialization of GAP ##################################################
- ############################################################################
- 
--def gap_root():
--    """
--    Find the location of the GAP root install which is stored in the gap
--    startup script.
--
--    EXAMPLES::
--
--        sage: from sage.libs.gap.util import gap_root
--        sage: gap_root()   # random output
--        '/home/vbraun/opt/sage-5.3.rc0/local/gap/latest'
--    """
--    if os.path.exists(sage.env.GAP_ROOT_DIR):
--        return sage.env.GAP_ROOT_DIR
--
--    # Attempt to figure out the appropriate GAP_ROOT by reading the
--    # local/bin/gap shell script; this is an ugly hack that exists for
--    # historical reasons; the best approach to setting where Sage looks for
--    # the appropriate GAP_ROOT is to set the GAP_ROOT_DIR variable
--    SAGE_LOCAL = sage.env.SAGE_LOCAL
--    with open(os.path.join(SAGE_LOCAL, 'bin', 'gap')) as f:
--        gap_sh = f.read().splitlines()
--    gapdir = next(x for x in gap_sh if x.strip().startswith('GAP_ROOT'))
--    gapdir = gapdir.split('"')[1]
--    gapdir = gapdir.replace('$SAGE_LOCAL', SAGE_LOCAL)
--    return gapdir
--
--
- # To ensure that we call initialize_libgap only once.
- cdef bint _gap_is_initialized = False
- 
-@@ -232,12 +205,12 @@ cdef initialize():
-     # this isn't portable
- 
-     cdef void* handle
--    libgapname = str_to_bytes(sage.env.GAP_SO)
--    handle = dlopen(libgapname, RTLD_NOW | RTLD_GLOBAL)
-+    # reload the current module to force reload of libgap (see #33446)
-+    lib = str_to_bytes(__loader__.path, FS_ENCODING, "surrogateescape")
-+    handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY)
-     if handle is NULL:
--        raise RuntimeError(
--                "Could not dlopen() libgap even though it should already "
--                "be loaded!")
-+        err = dlerror()
-+        raise RuntimeError(f"Could not reload gap library with RTLD_GLOBAL ({err})")
-     dlclose(handle)
- 
-     # Define argv variable, which we will pass in to
-@@ -245,7 +218,7 @@ cdef initialize():
-     cdef char* argv[16]
-     argv[0] = "sage"
-     argv[1] = "-l"
--    s = str_to_bytes(gap_root(), FS_ENCODING, "surrogateescape")
-+    s = str_to_bytes(sage.env.GAP_LIB_DIR + ";" + sage.env.GAP_SHARE_DIR, FS_ENCODING, "surrogateescape")
-     argv[2] = s
- 
-     argv[3] = "-m"
-@@ -362,15 +335,9 @@ cdef Obj gap_eval(str gap_string) except? NULL:
-         GAPError: Error, Variable: 'Complex' must have a value
-         Syntax error: ; expected in stream:1
-         Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^
-+                ^^^^^
-         Error, Variable: 'with' must have a value
--        Syntax error: ; expected in stream:1
--        Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^^^^^^^^^
-         Error, Variable: 'bits' must have a value
--        Syntax error: ; expected in stream:1
--        Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-         Error, Variable: 'precision' must have a value
- 
-     Test that on a subsequent attempt we get the same message (no garbage was
-diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx
-index d8ea7b07f3c..4beb1774df9 100644
---- a/src/sage/libs/singular/singular.pyx
-+++ b/src/sage/libs/singular/singular.pyx
-@@ -1705,14 +1705,7 @@ cdef object si2sa_intvec(intvec *v):
- cdef extern from *: # hack to get at cython macro
-     int unlikely(int)
- 
--cdef extern from "dlfcn.h":
--    void *dlopen(char *, long)
--    char *dlerror()
--    void dlclose(void *handle)
--
--cdef extern from "dlfcn.h":
--    cdef long RTLD_LAZY
--    cdef long RTLD_GLOBAL
-+from posix.dlfcn cimport dlopen, dlclose, dlerror, RTLD_LAZY, RTLD_GLOBAL
- 
- cdef int overflow_check(unsigned long e, ring *_ring) except -1:
-     """
-@@ -1762,8 +1755,6 @@ cdef init_libsingular():
- 
-     cdef void *handle = NULL
- 
--    from sage.env import LIBSINGULAR_PATH
--    lib = str_to_bytes(LIBSINGULAR_PATH, FS_ENCODING, "surrogateescape")
- 
-     # This is a workaround for https://github.com/Singular/Singular/issues/1113
-     # and can be removed once that fix makes it into release of Singular that
-@@ -1780,10 +1771,12 @@ cdef init_libsingular():
- 
-     import platform
-     if not platform.system().startswith("CYGWIN"):
-+        # reload the current module to force reload of libSingular (see #33446)
-+        lib = str_to_bytes(__loader__.path, FS_ENCODING, "surrogateescape")
-         handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY)
-         if not handle:
-             err = dlerror()
--            raise ImportError(f"cannot load Singular library from {LIBSINGULAR_PATH} ({err})")
-+            raise RuntimeError(f"Could not reload Singular library with RTLD_GLOBAL ({err})")
- 
-     # load SINGULAR
-     siInit(lib)
-diff --git a/src/sage/tests/gap_packages.py b/src/sage/tests/gap_packages.py
-index 2e4518ca226..c302b169b8a 100644
---- a/src/sage/tests/gap_packages.py
-+++ b/src/sage/tests/gap_packages.py
-@@ -103,7 +103,7 @@ def all_installed_packages(ignore_dot_gap=False, gap=None):
- 
-         sage: from sage.tests.gap_packages import all_installed_packages
-         sage: all_installed_packages()
--        (...'GAPDoc'...)
-+        (...'gapdoc'...)
-         sage: all_installed_packages(ignore_dot_gap=True) == all_installed_packages(gap=gap, ignore_dot_gap=True)
-         True
-     """
diff --git a/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch b/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
deleted file mode 100644
index d331a6573e1c..000000000000
--- a/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/src/sage/data_structures/stream.py b/src/sage/data_structures/stream.py
-index f8f6dc6a186..002e925f02f 100644
---- a/src/sage/data_structures/stream.py
-+++ b/src/sage/data_structures/stream.py
-@@ -2090,8 +2090,8 @@ def compute_product(self, n, la):
-             sage: f = Stream_exact([1]) # irrelevant for this test
-             sage: g = Stream_function(lambda n: s[n], True, 0)
-             sage: h = Stream_plethysm(f, g, True, p)
--            sage: B = p[2, 2, 1](sum(s[i] for i in range(7)))
--            sage: all(h.compute_product(k, Partition([2, 2, 1])) == B.restrict_degree(k) for k in range(7))
-+            sage: B = p[2, 2, 1](sum(p(s[i]) for i in range(7)))  # long time
-+            sage: all(h.compute_product(k, Partition([2, 2, 1])) == B.restrict_degree(k) for k in range(7))  # long time
-             True
-         """
-         # This is the approximate order of the result
diff --git a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch b/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
deleted file mode 100644
index 007f3324cfe4..000000000000
--- a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index b77c69b2f77..0586a96ae55 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -563,7 +563,7 @@ def complex_to_cmap_rgb(z_values, cmap='turbo', contoured=False, tiled=False,
-     import matplotlib as mpl
- 
-     if isinstance(cmap, str):
--        cmap = mpl.cm.get_cmap(cmap)
-+        cmap = mpl.colormaps[cmap]
- 
-     if contour_base is None:
-         if contour_type == "linear":
-@@ -1206,11 +1206,11 @@ def complex_plot(f, x_range, y_range, contoured=False, tiled=False, cmap=None,
-                 domain = np.linspace(0, 1, 256)
-                 shifted_domain = np.roll(domain, 128)
-                 default_cmap = mpl.colors.LinearSegmentedColormap.from_list(
--                    "sage_default", mpl.cm.get_cmap('hsv')(shifted_domain)
-+                    "sage_default", mpl.colormaps['hsv'](shifted_domain)
-                 )
-                 cmap = default_cmap
-             else:
--                cmap = mpl.cm.get_cmap(cmap)
-+                cmap = mpl.colormaps[cmap]
-         rgbs = complex_to_cmap_rgb(
-             z_values, cmap=cmap, contoured=contoured, tiled=tiled,
-             contour_type=contour_type, contour_base=contour_base,
-diff --git a/src/sage/plot/contour_plot.py b/src/sage/plot/contour_plot.py
-index c0cab456686..4accb309580 100644
---- a/src/sage/plot/contour_plot.py
-+++ b/src/sage/plot/contour_plot.py
-@@ -848,9 +848,7 @@ def f(x,y): return cos(x) + sin(y)
- 
-         sage: contour_plot(lambda x,y: 0, (-1,1), (-1,1),
-         ....:              contours=[0], fill=False, cmap=['blue'])
--        ...
--        UserWarning: No contour levels were found within the data range.
--        Graphics object consisting of 1 graphics primitive
-+        ...Graphics object consisting of 1 graphics primitive
- 
-     .. PLOT::
- 
-@@ -874,8 +872,7 @@ def f(x,y): return cos(x) + sin(y)
-     Check that :trac:`18074` is fixed::
- 
-         sage: contour_plot(0, (0,1), (0,1))
--        ... UserWarning: No contour levels were found within the data range.
--        Graphics object consisting of 1 graphics primitive
-+        ...Graphics object consisting of 1 graphics primitive
- 
-     Domain points in :trac:`11648` with complex output are now skipped::
- 
-diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
-index 64ea1a7e10f..cdc99ced263 100644
---- a/src/sage/plot/graphics.py
-+++ b/src/sage/plot/graphics.py
-@@ -2341,7 +2341,7 @@ def _matplotlib_tick_formatter(self, subplot, base=(10, 10),
-             sage: subplot = Figure().add_subplot(111)
-             sage: p._objects[0]._render_on_subplot(subplot)
-             sage: p._matplotlib_tick_formatter(subplot, **d)
--            (<AxesSubplot:...>,
-+            (<Axes...>,
-             <matplotlib.ticker.MaxNLocator object at ...>,
-             <matplotlib.ticker.MaxNLocator object at ...>,
-             <matplotlib.ticker.ScalarFormatter object at ...>,
-diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
-index 99c817f03a6..ae85183dc93 100644
---- a/src/sage/plot/multigraphics.py
-+++ b/src/sage/plot/multigraphics.py
-@@ -1207,7 +1207,7 @@ def _add_subplot(self, figure, index, **options):
-             sage: fig = Figure()
-             sage: ax1 = G._add_subplot(fig, 0)
-             sage: type(ax1)
--            <class 'matplotlib.axes._subplots.AxesSubplot'>
-+            <class 'matplotlib.axes...'>
-             sage: ax2 = G._add_subplot(fig, 1)
-             sage: fig.get_axes() == [ax1, ax2]
-             True
-diff --git a/src/sage/plot/plot3d/plot_field3d.py b/src/sage/plot/plot3d/plot_field3d.py
-index bdf39391d3e..fe10e27f58f 100644
---- a/src/sage/plot/plot3d/plot_field3d.py
-+++ b/src/sage/plot/plot3d/plot_field3d.py
-@@ -126,9 +126,9 @@ def plot_vector_field3d(functions, xrange, yrange, zrange,
-     vectors = [vector((ff(*point), gg(*point), hh(*point))) for point in points]
- 
-     try:
--        from matplotlib.cm import get_cmap
--        cm = get_cmap(colors)
--    except (TypeError, ValueError):
-+        import matplotlib as mpl
-+        cm = mpl.colormaps[colors]
-+    except (TypeError, KeyError):
-         cm = None
-     if cm is None:
-         if isinstance(colors, (list, tuple)):
diff --git a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch b/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
deleted file mode 100644
index 1e0a708e8068..000000000000
--- a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py
-index c9ca5e30939..9459cb70334 100644
---- a/src/sage/interfaces/maxima_lib.py
-+++ b/src/sage/interfaces/maxima_lib.py
-@@ -77,6 +77,26 @@
-     sage: bar == foo
-     True
- 
-+TESTS:
-+
-+Check our workaround for a race in ecl works, see :trac:`26968`.
-+We use a temporary `MAXIMA_USERDIR` so it's empty; we place it
-+in `DOT_SAGE` since we expect it to have more latency than `/tmp`.
-+
-+    sage: import tempfile, subprocess
-+    sage: tmpdir = tempfile.TemporaryDirectory(dir=DOT_SAGE)
-+    sage: _ = subprocess.run(['sage', '-c',  # long time
-+    ....: f'''
-+    ....: import os
-+    ....: os.environ["MAXIMA_USERDIR"] = "{tmpdir.name}"
-+    ....: if not os.fork():
-+    ....:     import sage.interfaces.maxima_lib
-+    ....: else:
-+    ....:     import sage.interfaces.maxima_lib
-+    ....:     os.wait()
-+    ....: '''])
-+    sage: tmpdir.cleanup()
-+
- """
- 
- # ****************************************************************************
-@@ -116,7 +136,23 @@
- ecl_eval("(setq $nolabels t))")
- ecl_eval("(defvar *MAXIMA-LANG-SUBDIR* NIL)")
- ecl_eval("(set-locale-subdir)")
--ecl_eval("(set-pathnames)")
-+
-+try:
-+    ecl_eval("(set-pathnames)")
-+except RuntimeError:
-+    # Recover from :trac:`26968` by creating `*maxima-objdir*` here.
-+    # This cannot be done before calling `(set-pathnames)` since
-+    # `*maxima-objdir*` is computed there.
-+    # We use python `os.makedirs()` which is immune to the race.
-+    # Using `(ensure-directories-exist ...)` in lisp would be
-+    # subject to the same race condition and since `*maxima-objdir*`
-+    # has multiple components this is quite plausible to happen.
-+    maxima_objdir = ecl_eval("*maxima-objdir*").python()[1:-1]
-+    import os
-+    os.makedirs(maxima_objdir, exist_ok=True)
-+    # Call `(set-pathnames)` again to complete its job.
-+    ecl_eval("(set-pathnames)")
-+
- ecl_eval("(defun add-lineinfo (x) x)")
- ecl_eval('(defun principal nil (cond ($noprincipal (diverg)) ((not pcprntd) (merror "Divergent Integral"))))')
- ecl_eval("(remprop 'mfactorial 'grind)")  # don't use ! for factorials (#11539)
diff --git a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch b/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
deleted file mode 100644
index fc3e40da2a88..000000000000
--- a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff --git a/src/bin/sage-cleaner b/src/bin/sage-cleaner
-index e2e578eec60..dc7d8f0482e 100755
---- a/src/bin/sage-cleaner
-+++ b/src/bin/sage-cleaner
-@@ -99,6 +99,15 @@ def cleanup():
- 
-     return len(pid_list)
- 
-+def cleanup_cruft():
-+    """ remove directories leftover from improper shutdown """
-+    tmp_dirs = os.listdir(SAGE_TMP_ROOT)
-+    for dir_entry in tmp_dirs:
-+        baddir = os.path.join(SAGE_TMP_ROOT, dir_entry)
-+        if os.path.isdir(baddir):
-+            logger.warning('Removing old directory %s from SAGE_TMP_ROOT', baddir)
-+            rm_rf(baddir)
-+
- def kill_spawned_jobs(jobfile, parent_pid):
-     logger.info("Killing %s's spawned jobs", parent_pid)
-     killed_them_all = True
-@@ -193,6 +202,7 @@ if __name__ == '__main__':
-     setup_daemon()
-     fix_old_mistakes()
-     logger.info("Starting sage-cleaner with PID %s", os.getpid())
-+    cleanup_cruft()
- 
-     if len(sys.argv) > 1:
-         wait = int(sys.argv[1])
diff --git a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch b/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
deleted file mode 100644
index ea210e20ae52..000000000000
--- a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py
-index ec6a5c19e60..9dd7bc1cb1e 100644
---- a/src/sage/graphs/generators/families.py
-+++ b/src/sage/graphs/generators/families.py
-@@ -3660,7 +3660,7 @@ def nauty_gentreeg(options="", debug=False):
- 
-         sage: gen = graphs.nauty_gentreeg("4", debug=True)
-         sage: print(next(gen))
--        >A ...gentreeg Z=2:3 D=3 n=4
-+        >A ...gentreeg ...
-         sage: gen = graphs.nauty_gentreeg("4 -q", debug=True)
-         sage: next(gen)
-         ''
-@@ -3687,7 +3687,7 @@ def nauty_gentreeg(options="", debug=False):
-         sage: list(graphs.nauty_gentreeg("3 -x", debug=True))
-         ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n [res/mod] ...
-         sage: list(graphs.nauty_gentreeg("3", debug=True))
--        ['>A ...gentreeg Z=2:2 D=2 n=3\n', Graph on 3 vertices]
-+        ['>A ...gentreeg ...\n', Graph on 3 vertices]
-     """
-     import shlex
-     from sage.features.nauty import NautyExecutable
-diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py
-index df88bbe2713..1a8016976c2 100644
---- a/src/sage/graphs/graph_generators.py
-+++ b/src/sage/graphs/graph_generators.py
-@@ -966,7 +966,7 @@ def nauty_geng(self, options="", debug=False):
-             ...
-             ValueError: wrong format of parameter option
-             sage: list(graphs.nauty_geng("-c3", debug=True))
--            ['>E Usage: ...geng [-cCmtfbd#D#] [-uygsnh] [-lvq] ...
-+            ['>E Usage: ...geng ...\n']
-             sage: list(graphs.nauty_geng("-c 3", debug=True))
-             ['>A ...geng -cd1D2 n=3 e=2-3\n', Graph on 3 vertices, Graph on 3 vertices]
-         """
diff --git a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch b/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
deleted file mode 100644
index 46bda084e48e..000000000000
--- a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-diff --git a/src/sage/repl/inputhook.py b/src/sage/repl/inputhook.py
-index da5df0268c0..7f7894f6dcf 100644
---- a/src/sage/repl/inputhook.py
-+++ b/src/sage/repl/inputhook.py
-@@ -17,6 +17,8 @@
- 
- import select
- import errno
-+import contextlib
-+import io
- 
- from IPython import get_ipython
- from IPython.terminal.pt_inputhooks import register
-@@ -47,15 +49,27 @@ def install():
-     """
-     Install the Sage input hook
- 
--    EXAMPLES::
-+    EXAMPLES:
-+
-+    Make sure ipython is running so we really test this function::
-+
-+        sage: from sage.repl.interpreter import get_test_shell
-+        sage: get_test_shell()
-+        <sage.repl.interpreter.SageTestShell object at ...>
-+
-+    Run the function twice, to check it is idempotent (see :trac:`35235`)::
- 
-         sage: from sage.repl.inputhook import install
-         sage: install()
-+        sage: install()
-     """
-     ip = get_ipython()
-     if not ip:
-         return   # Not running in ipython, e.g. doctests
--    ip.enable_gui('sage')
-+    if ip._inputhook != sage_inputhook:
-+        # silence `ip.enable_gui()` useless output
-+        with contextlib.redirect_stdout(io.StringIO()):
-+            ip.enable_gui('sage')
- 
- 
- def uninstall():
-@@ -71,4 +85,6 @@ def uninstall():
-     if not ip:
-         return
-     if ip._inputhook == sage_inputhook:
--        ip.enable_gui(None)
-+        # silence `ip.enable_gui()` useless output
-+        with contextlib.redirect_stdout(io.StringIO()):
-+            ip.enable_gui(None)
diff --git a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch b/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
deleted file mode 100644
index 2cdc674d4f9e..000000000000
--- a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 532fbbaf71bb41c73920b584108eb2a09d6deeb1 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
-Date: Tue, 4 Apr 2023 12:56:57 -0300
-Subject: [PATCH] Ignore deprecation warnings triggered by pythran 0.12.1
-
-These happen with python 3.11, setuptools 67.6.1, numpy 1.24.2.
-When pythran 0.12.1 is installed, I get 24 doctest failures due to
-deprecation warnings; they are all gone with this commit.
-
-[backported from 839a6e928c264a9863bd42860c78ae95a6d9f3e0]
----
- src/sage/all.py | 12 ++++++++++--
- 1 file changed, 10 insertions(+), 2 deletions(-)
-
-diff --git a/src/sage/all.py b/src/sage/all.py
-index 93588df1b93..ee775aad0e9 100644
---- a/src/sage/all.py
-+++ b/src/sage/all.py
-@@ -96,9 +96,17 @@ warnings.filterwarnings('ignore', category=DeprecationWarning,
- warnings.filterwarnings('ignore', category=DeprecationWarning,
-     module='(.*[.]_vendor[.])?packaging')
- 
--# Ignore numpy warnings triggered by pythran
-+# Ignore a few warnings triggered by pythran 0.12.1
- warnings.filterwarnings('ignore', category=DeprecationWarning,
--                        module='pythran')
-+    message='\n\n  `numpy.distutils` is deprecated since NumPy 1.23.0',
-+    module='pythran.dist')
-+warnings.filterwarnings('ignore', category=DeprecationWarning,
-+    message='pkg_resources is deprecated as an API|'
-+            'Deprecated call to `pkg_resources.declare_namespace(.*)`',
-+    module='pkg_resources')
-+warnings.filterwarnings('ignore', category=DeprecationWarning,
-+    message='msvccompiler is deprecated and slated to be removed',
-+    module='distutils.msvccompiler')
- 
- warnings.filterwarnings('ignore', category=DeprecationWarning,
-                         message='The distutils(.sysconfig module| package) is deprecated',
--- 
-2.40.0
-
diff --git a/srcpkgs/sagemath/patches/35584-networkx_3.1.patch b/srcpkgs/sagemath/patches/35584-networkx_3.1.patch
index 66eedecff7c6..9331258986d3 100644
--- a/srcpkgs/sagemath/patches/35584-networkx_3.1.patch
+++ b/srcpkgs/sagemath/patches/35584-networkx_3.1.patch
@@ -1,8 +1,8 @@
 diff --git a/src/sage/graphs/graph.py b/src/sage/graphs/graph.py
-index c2e42bcbd3..b6a10efbf4 100644
+index c2e42bcbd38..0d13f071dc4 100644
 --- a/src/sage/graphs/graph.py
 +++ b/src/sage/graphs/graph.py
-@@ -6786,13 +6786,21 @@ def cliques_number_of(self, vertices=None, cliques=None):
+@@ -6786,13 +6786,26 @@ def cliques_number_of(self, vertices=None, cliques=None):
              {(0, 0): 2, (0, 1): 3, (0, 2): 2, (1, 0): 2, (1, 1): 3, (1, 2): 2}
              sage: F.cliques_number_of(vertices=[(0, 1), (1, 2)])
              {(0, 1): 3, (1, 2): 2}
@@ -18,15 +18,20 @@ index c2e42bcbd3..b6a10efbf4 100644
 +        if cliques is None:
 +            cliques = self.cliques_maximal()
 +
-+        if vertices in self: # single vertex
++        if vertices in self:  # single vertex
 +            return sum(1 for c in cliques if vertices in c)
-+        else:
-+            return { v : sum(1 for c in cliques if v in c)
-+                     for v in vertices or self }
++
++        from collections import Counter
++        count = Counter()
++
++        for c in cliques:
++            count.update(c)
++
++        return {v : count[v] for v in vertices or self}
  
      @doc_index("Clique-related methods")
      def cliques_get_max_clique_graph(self):
-@@ -7493,17 +7501,32 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
+@@ -7493,17 +7506,32 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
  
              sage: C = Graph('DJ{')
              sage: C.cliques_containing_vertex()
@@ -62,7 +67,7 @@ index c2e42bcbd3..b6a10efbf4 100644
  
          Since each clique of a 2 dimensional grid corresponds to an edge, the
          number of cliques in which a vertex is involved equals its degree::
-@@ -7518,8 +7541,14 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
+@@ -7518,8 +7546,20 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
              sage: sorted(sorted(x for x in L) for L in d[(0, 1)])
              [[(0, 0), (0, 1)], [(0, 1), (0, 2)], [(0, 1), (1, 1)]]
          """
@@ -71,11 +76,17 @@ index c2e42bcbd3..b6a10efbf4 100644
 +        if cliques is None:
 +            cliques = self.cliques_maximal()
 +
-+        if vertices in self: # single vertex
++        if vertices in self:  # single vertex
 +            return [c for c in cliques if vertices in c]
-+        else:
-+            return { v : [c for c in cliques if v in c]
-+                     for v in vertices or self }
++
++        from collections import defaultdict
++        d = defaultdict(list)
++
++        for c in cliques:
++            for v in c:
++                d[v].append(c)
++
++        return {v : d[v] for v in vertices or self}
  
      @doc_index("Clique-related methods")
      def clique_complex(self):
diff --git a/srcpkgs/sagemath/patches/35612-linbox_1.7.0.patch b/srcpkgs/sagemath/patches/35612-linbox_1.7.0.patch
new file mode 100644
index 000000000000..58dddf34a69d
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35612-linbox_1.7.0.patch
@@ -0,0 +1,64 @@
+diff --git a/src/sage/libs/linbox/conversion.pxd b/src/sage/libs/linbox/conversion.pxd
+index 7794c9edc39..1753277b1f1 100644
+--- a/src/sage/libs/linbox/conversion.pxd
++++ b/src/sage/libs/linbox/conversion.pxd
+@@ -177,9 +177,8 @@ cdef inline Vector_integer_dense new_sage_vector_integer_dense(P, DenseVector_in
+     - v -- linbox vector
+     """
+     cdef Vector_integer_dense res = P()
+-    cdef cppvector[Integer] * vec = &v.refRep()
+     cdef size_t i
+     for i in range(<size_t> res._degree):
+-        mpz_set(res._entries[i], vec[0][i].get_mpz_const())
++        mpz_set(res._entries[i], v.getEntry(i).get_mpz_const())
+ 
+     return res
+diff --git a/src/sage/libs/linbox/linbox.pxd b/src/sage/libs/linbox/linbox.pxd
+index 9112d151f8b..bfeda4b6042 100644
+--- a/src/sage/libs/linbox/linbox.pxd
++++ b/src/sage/libs/linbox/linbox.pxd
+@@ -32,7 +32,6 @@ cdef extern from "linbox/matrix/dense-matrix.h":
+         ctypedef Modular_double Field
+         ctypedef double Element
+         DenseMatrix_Modular_double(Field F, size_t m, size_t n)
+-        DenseMatrix_Modular_double(Field F, Element*, size_t m, size_t n)
+         void setEntry(size_t i, size_t j, Element& a)
+         Element &getEntry(size_t i, size_t j)
+ 
+@@ -42,7 +41,6 @@ cdef extern from "linbox/matrix/dense-matrix.h":
+         ctypedef Modular_float Field
+         ctypedef float Element
+         DenseMatrix_Modular_float(Field F, size_t m, size_t n)
+-        DenseMatrix_Modular_float(Field F, Element*, size_t m, size_t n)
+         void setEntry(size_t i, size_t j, Element& a)
+         Element &getEntry(size_t i, size_t j)
+ 
+@@ -101,7 +99,6 @@ cdef extern from "linbox/vector/vector.h":
+         DenseVector_integer (Field &F)
+         DenseVector_integer (Field &F, long& m)
+         DenseVector_integer (Field &F, cppvector[Integer]&)
+-        cppvector[Element]& refRep()
+         size_t size()
+         void resize(size_t)
+         void resize(size_t n, const Element&)
+diff --git a/src/sage/matrix/matrix_modn_dense_template.pxi b/src/sage/matrix/matrix_modn_dense_template.pxi
+index abf29badce6..68b869ce314 100644
+--- a/src/sage/matrix/matrix_modn_dense_template.pxi
++++ b/src/sage/matrix/matrix_modn_dense_template.pxi
+@@ -221,9 +221,14 @@ cdef inline linbox_echelonize_efd(celement modulus, celement* entries, Py_ssize_
+         return 0,[]
+ 
+     cdef ModField *F = new ModField(<long>modulus)
+-    cdef DenseMatrix *A = new DenseMatrix(F[0], <ModField.Element*>entries,<Py_ssize_t>nrows, <Py_ssize_t>ncols)
+-    cdef Py_ssize_t r = reducedRowEchelonize(A[0])
++    cdef DenseMatrix *A = new DenseMatrix(F[0], nrows, ncols)
++
+     cdef Py_ssize_t i,j
++    for i in range(nrows):
++        for j in range(ncols):
++            A.setEntry(i, j, entries[i*ncols+j])
++
++    cdef Py_ssize_t r = reducedRowEchelonize(A[0])
+     for i in range(nrows):
+         for j in range(ncols):
+             entries[i*ncols+j] = <celement>A.getEntry(i,j)
diff --git a/srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch b/srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch
new file mode 100644
index 000000000000..9f00fb17271c
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch
@@ -0,0 +1,578 @@
+diff --git a/build/pkgs/ecl/dependencies b/build/pkgs/ecl/dependencies
+index cda6316bf5a..51a953403e9 100644
+--- a/build/pkgs/ecl/dependencies
++++ b/build/pkgs/ecl/dependencies
+@@ -1,4 +1,4 @@
+-$(MP_LIBRARY) readline gc libffi
++$(MP_LIBRARY) readline gc libffi info
+ 
+ ----------
+ All lines of this file are ignored except the first.
+diff --git a/build/pkgs/ecl/spkg-configure.m4 b/build/pkgs/ecl/spkg-configure.m4
+index ae1e0ac5e1a..7dbcfa6377b 100644
+--- a/build/pkgs/ecl/spkg-configure.m4
++++ b/build/pkgs/ecl/spkg-configure.m4
+@@ -35,10 +35,7 @@ SAGE_SPKG_CONFIGURE([ecl], [
+     AC_SUBST(SAGE_ECL_CONFIG, [$ECL_CONFIG])
+   fi
+ 
+-  # Maxima cannot yet be provided by the system, so we always use
++  # Kenzo cannot yet be provided by the system, so we always use
+   # the SAGE_LOCAL path for now.
+-  AC_SUBST(SAGE_MAXIMA_FAS, ['${prefix}'/lib/ecl/maxima.fas])
+-
+-  # Likewise for the optional Kenzo SPKG
+   AC_SUBST(SAGE_KENZO_FAS, ['${prefix}'/lib/ecl/kenzo.fas])
+ ])
+diff --git a/build/pkgs/ecl/spkg-install.in b/build/pkgs/ecl/spkg-install.in
+index ee1667aec16..72083337942 100644
+--- a/build/pkgs/ecl/spkg-install.in
++++ b/build/pkgs/ecl/spkg-install.in
+@@ -31,18 +31,6 @@ cp "$SAGE_ROOT"/config/config.* src
+ 
+ if [ x"$SAGE_SPKG_INSTALL_DOCS" != xyes ] ; then
+     ECL_CONFIGURE="$ECL_CONFIGURE --enable-manual=no"
+-else
+-    # ECL 2020 needs modern makeinfo
+-    command -v texi2any >/dev/null 2>&1
+-    if [ $? -ne 0 ]; then # texi2any not found -> makeinfo too old, if present
+-        ECL_CONFIGURE="$ECL_CONFIGURE --enable-manual=no"
+-    else
+-        if makeinfo -c foo 2>&1 | grep -q invalid; then
+-            # makeinfo found but does not support all options that ecl
+-            # likes to use
+-            ECL_CONFIGURE="$ECL_CONFIGURE --enable-manual=no"
+-        fi
+-    fi
+ fi
+ 
+ sdh_configure $SAGE_CONFIGURE_GMP \
+diff --git a/build/pkgs/giac/spkg-configure.m4 b/build/pkgs/giac/spkg-configure.m4
+index 5859e35f12e..b677184b7be 100644
+--- a/build/pkgs/giac/spkg-configure.m4
++++ b/build/pkgs/giac/spkg-configure.m4
+@@ -5,7 +5,7 @@ SAGE_SPKG_CONFIGURE([giac], [
+        m4_pushdef([GIAC_MAX_VERSION], [1.9.999])
+        AC_CACHE_CHECK([for giac >= ]GIAC_MIN_VERSION[, <= ]GIAC_MAX_VERSION, [ac_cv_path_GIAC], [
+          AC_PATH_PROGS_FEATURE_CHECK([GIAC], [giac], [
+-            giac_version=$($ac_path_GIAC --version 2> /dev/null | tail -1)
++            giac_version=$($ac_path_GIAC --version 2> /dev/null | tail -n -1)
+             AS_IF([test -n "$giac_version"], [
+                 AX_COMPARE_VERSION([$giac_version], [ge], GIAC_MIN_VERSION, [
+                     AX_COMPARE_VERSION([$giac_version], [le], GIAC_MAX_VERSION, [
+diff --git a/build/pkgs/info/spkg-configure.m4 b/build/pkgs/info/spkg-configure.m4
+index 0980a4b8ef8..85fe1ea4731 100644
+--- a/build/pkgs/info/spkg-configure.m4
++++ b/build/pkgs/info/spkg-configure.m4
+@@ -1,4 +1,14 @@
+ SAGE_SPKG_CONFIGURE([info], [
+   AC_PATH_PROG(INFO, info)
+-  AS_IF([test -z "${INFO}"], [sage_spkg_install_info=yes])
++  AS_IF([test -z "${INFO}"], [sage_spkg_install_info=yes
++    ], [
++     dnl very old makeinfo are not texi2any, newer are symlinks to texi2any
++     AC_PATH_PROG(TEXI2ANY, texi2any)
++     AS_IF([test -z "${TEXI2ANY}"], [sage_spkg_install_info=yes
++       ], [
++        AS_IF([makeinfo -c foo 2>&1 | grep -q invalid], [
++         dnl makeinfo found, but too old, and  does not support all options that ecl likes to use
++         sage_spkg_install_info=yes])
++       ])
++    ])
+ ])
+diff --git a/build/pkgs/info/spkg-install.in b/build/pkgs/info/spkg-install.in
+index 8086e4b2ec8..3ea8c053669 100644
+--- a/build/pkgs/info/spkg-install.in
++++ b/build/pkgs/info/spkg-install.in
+@@ -1,2 +1,2 @@
+-cd src/info
++cd src
+ sdh_make_install
+diff --git a/build/pkgs/info/type b/build/pkgs/info/type
+index 134d9bc32d5..a6a7b9cd726 100644
+--- a/build/pkgs/info/type
++++ b/build/pkgs/info/type
+@@ -1 +1 @@
+-optional
++standard
+diff --git a/build/pkgs/maxima/checksums.ini b/build/pkgs/maxima/checksums.ini
+index a804c7b831f..0f594389fe6 100644
+--- a/build/pkgs/maxima/checksums.ini
++++ b/build/pkgs/maxima/checksums.ini
+@@ -1,5 +1,5 @@
+ tarball=maxima-VERSION.tar.gz
+-sha1=ed15d5285794413ba94412079eca3d0fa55a47bf
+-md5=9b9ae1dace55b1386739dabaa9122e60
+-cksum=1765409766
++sha1=1010594e6d6082bbd8efaac1b7756ec1721a4ed5
++md5=3c01f1daa6936e11d8713fef7751d3fe
++cksum=2420393096
+ upstream_url=https://sourceforge.net/projects/maxima/files/Maxima-source/VERSION-source/maxima-VERSION.tar.gz/download
+diff --git a/build/pkgs/maxima/distros/arch.txt b/build/pkgs/maxima/distros/arch.txt
+index 6400290f44d..6ac052fa62b 100644
+--- a/build/pkgs/maxima/distros/arch.txt
++++ b/build/pkgs/maxima/distros/arch.txt
+@@ -1 +1 @@
+-maxima-ecl
++maxima-fas
+diff --git a/build/pkgs/maxima/distros/cygwin.txt b/build/pkgs/maxima/distros/cygwin.txt
+new file mode 100644
+index 00000000000..f5fe3fdc6cb
+--- /dev/null
++++ b/build/pkgs/maxima/distros/cygwin.txt
+@@ -0,0 +1 @@
++maxima
+diff --git a/build/pkgs/maxima/distros/freebsd.txt b/build/pkgs/maxima/distros/freebsd.txt
+new file mode 100644
+index 00000000000..766a71b5074
+--- /dev/null
++++ b/build/pkgs/maxima/distros/freebsd.txt
+@@ -0,0 +1 @@
++math/maxima
+diff --git a/build/pkgs/maxima/distros/gentoo.txt b/build/pkgs/maxima/distros/gentoo.txt
+new file mode 100644
+index 00000000000..85fb33f1610
+--- /dev/null
++++ b/build/pkgs/maxima/distros/gentoo.txt
+@@ -0,0 +1,2 @@
++sci-mathematics/maxima[ecls]
++
+diff --git a/build/pkgs/maxima/package-version.txt b/build/pkgs/maxima/package-version.txt
+index 83476624dc0..5681375f3be 100644
+--- a/build/pkgs/maxima/package-version.txt
++++ b/build/pkgs/maxima/package-version.txt
+@@ -1 +1 @@
+-5.45.0.p0
++5.46.0
+diff --git a/build/pkgs/maxima/patches/matrixexp.patch b/build/pkgs/maxima/patches/matrixexp.patch
+deleted file mode 100644
+index 5c8527c33bf..00000000000
+--- a/build/pkgs/maxima/patches/matrixexp.patch
++++ /dev/null
+@@ -1,15 +0,0 @@
+-diff --git a/share/linearalgebra/matrixexp.lisp b/share/linearalgebra/matrixexp.lisp
+-index 218bf35..f2fd468 100644
+---- a/share/linearalgebra/matrixexp.lisp
+-+++ b/share/linearalgebra/matrixexp.lisp
+-@@ -138,8 +138,8 @@
+- 	   (print `(ratvars = ,$ratvars gcd = '$gcd algebraic = ,$algebraic))
+- 	   (print `(ratfac = ,$ratfac))
+- 	   (merror "Unable to find the spectrum")))
+--   
+--    (setq res ($fullratsimp (ncpower (sub (mult z ($ident n)) mat) -1) z))
+-+
+-+    (setq res ($fullratsimp ($invert_by_lu (sub (mult z ($ident n)) mat) '$crering) z))
+-     (setq m (length sp))
+-     (dotimes (i m)
+-       (setq zi (nth i sp))
+diff --git a/build/pkgs/maxima/patches/maxima.system.patch b/build/pkgs/maxima/patches/maxima.system.patch
+deleted file mode 100644
+index 74db62e7f9f..00000000000
+--- a/build/pkgs/maxima/patches/maxima.system.patch
++++ /dev/null
+@@ -1,25 +0,0 @@
+-diff --git a/src/maxima.system b/src/maxima.system
+-index 76f2452..cf25f51 100644
+---- a/src/maxima.system
+-+++ b/src/maxima.system
+-@@ -1,5 +1,8 @@
+- ;;; -*- Lisp -*-
+- 
+-+(require :cmp)
+-+(setf c::*compile-in-constants* t)
+-+
+- (in-package :cl-user)
+- 
+- (pushnew :cl *features*)
+-@@ -75,6 +78,11 @@
+- 			     ;; Convert dir/foo.fas to dir/foo.o
+- 			     (make-pathname :type "o" :defaults p))
+- 			 files)))
+-+	(c::build-fasl "binary-ecl/maxima" :lisp-files obj
+-+			  :ld-flags
+-+			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
+-+							      (find-package "MAXIMA")))))
+-+			    (if (and x (not (string= x ""))) (list x))))
+- 	(c::build-program "binary-ecl/maxima" :lisp-files obj
+- 			  :ld-flags
+- 			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
+diff --git a/build/pkgs/maxima/spkg-configure.m4 b/build/pkgs/maxima/spkg-configure.m4
+new file mode 100644
+index 00000000000..dc54525320e
+--- /dev/null
++++ b/build/pkgs/maxima/spkg-configure.m4
+@@ -0,0 +1,46 @@
++SAGE_SPKG_CONFIGURE([maxima], [
++  m4_pushdef([SAGE_MAXIMA_MINVER],["5.45.0"])dnl this version and higher allowed
++  SAGE_SPKG_DEPCHECK([ecl], [
++    dnl First check for the "maxima" executable in the user's PATH, because
++    dnl we still use pexpect to communicate with it in a few places.
++    AC_CACHE_CHECK([for Maxima >= $SAGE_MAXIMA_MINVER], [ac_cv_path_MAXIMA], [
++        AC_PATH_PROGS_FEATURE_CHECK([MAXIMA], [maxima], [
++            maxima_version=`$ac_path_MAXIMA --version 2>&1 | tail -n -1\
++                | $SED -n -e 's/Maxima *\([[0-9]]*\.[[0-9]]*\.[[0-9]]*\)/\1/p'`
++            AS_IF([test -n "$maxima_version"], [
++                AX_COMPARE_VERSION([$maxima_version], [ge], [SAGE_MAXIMA_MINVER], [
++                    ac_cv_path_MAXIMA="$ac_path_MAXIMA"
++                    ac_path_MAXIMA_found=:
++                ])
++            ])
++        ])
++    ])
++    SAGE_MAXIMA="$ac_cv_path_MAXIMA"
++    AS_IF([test -z "${SAGE_MAXIMA}"], [
++      sage_spkg_install_maxima=yes
++    ],[
++      dnl If we have the executable, check also for the ECL library.
++      AC_MSG_CHECKING([if ECL can "require" the maxima module])
++      AS_IF([ecl --eval "(require 'maxima)" --eval "(quit)" \
++               >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD], [
++        AC_MSG_RESULT(yes)
++      ], [
++        AC_MSG_RESULT(no)
++        sage_spkg_install_maxima=yes
++      ])
++    ])
++  ])
++  m4_popdef([SAGE_MAXIMA_MINVER])
++],[],[],[
++  # post-check
++  AS_IF([test x$sage_spkg_install_maxima = xyes], [
++    dnl Leaving this variable empty will tell sagelib to load
++    dnl the maxima library (within ECL) by name instead of by
++    dnl absolute path.
++    SAGE_MAXIMA='${prefix}'/bin/maxima
++    SAGE_MAXIMA_FAS='${prefix}'/lib/ecl/maxima.fas
++  ])
++
++  AC_SUBST(SAGE_MAXIMA, "${SAGE_MAXIMA}")
++  AC_SUBST(SAGE_MAXIMA_FAS, "${SAGE_MAXIMA_FAS}")
++])
+diff --git a/build/pkgs/maxima/spkg-install.in b/build/pkgs/maxima/spkg-install.in
+index 3ae6382f9ba..cdb6fbf2069 100644
+--- a/build/pkgs/maxima/spkg-install.in
++++ b/build/pkgs/maxima/spkg-install.in
+@@ -28,28 +28,6 @@ echo
+ echo "Now configuring Maxima..."
+ sdh_configure --enable-ecl git_found=false
+ 
+-# Note the following is regression in maxima build system
+-# see https://sourceforge.net/p/maxima/bugs/3278/
+-# and https://sourceforge.net/p/maxima/bugs/2878/
+-# For the previous time it was fixed.
+-#---------------------------------------------------------------
+-# Touching html and info file to avoid to regenerate them.
+-# This must be done after configuration since the timestamp need
+-# to be later than include-maxima.texi which is generated at
+-# configuration time
+-for i in doc/info/*.html ; do
+-    touch "${i}"
+-done
+-touch doc/info/maxima.info*
+-# Maxima 5.44.0 build_html.sh is not compatible with makeinfo 4.8
+-# (which is /usr/bin/makeinfo on macOS).  #30063
+-# Do not build the HTML docs unless the user asks for it,
+-# in which case it is their problem to install a better
+-# makeinfo version.
+-if [[ "$SAGE_SPKG_INSTALL_DOCS" != yes ]] ; then
+-touch doc/info/maxima_toc.html interfaces/xmaxima/doc/xmaxima.html
+-fi
+-
+ #---------------------------------------------------------------
+ 
+ sdh_make
+diff --git a/build/pkgs/tox/spkg-configure.m4 b/build/pkgs/tox/spkg-configure.m4
+index 7d8ade4c14b..3de0b9b710d 100644
+--- a/build/pkgs/tox/spkg-configure.m4
++++ b/build/pkgs/tox/spkg-configure.m4
+@@ -5,7 +5,7 @@ SAGE_SPKG_CONFIGURE([tox], [
+        m4_pushdef([TOX4_MIN_VERSION], [4.0.15])
+        AC_CACHE_CHECK([for tox 3 >= ]TOX3_MIN_VERSION[ or tox 4 >= ]TOX4_MIN_VERSION, [ac_cv_path_TOX], [
+          AC_PATH_PROGS_FEATURE_CHECK([TOX], [tox], [
+-            tox_version=$($ac_path_TOX --version 2> /dev/null | tail -1)
++            tox_version=$($ac_path_TOX --version 2> /dev/null | tail -n -1)
+             AS_IF([test -n "$tox_version"], [
+                 AX_COMPARE_VERSION([$tox_version], [lt], [4], [
+                     AX_COMPARE_VERSION([$tox_version], [ge], TOX3_MIN_VERSION, [
+diff --git a/pkgs/sage-conf/_sage_conf/_conf.py.in b/pkgs/sage-conf/_sage_conf/_conf.py.in
+index d66bdb3d264..f2e197b45ed 100644
+--- a/pkgs/sage-conf/_sage_conf/_conf.py.in
++++ b/pkgs/sage-conf/_sage_conf/_conf.py.in
+@@ -9,9 +9,11 @@ VERSION = "@PACKAGE_VERSION@"
+ SAGE_LOCAL = "@prefix@"
+ SAGE_ROOT = "@SAGE_ROOT@"
+ 
+-MAXIMA = "@prefix@/bin/maxima"
++# The path to the standalone maxima executable.
++MAXIMA = "@SAGE_MAXIMA@".replace('${prefix}', SAGE_LOCAL)
+ 
+-# Delete this line if your ECL can load maxima without further prodding.
++# Set this to the empty string if your ECL can load maxima without
++# further prodding.
+ MAXIMA_FAS = "@SAGE_MAXIMA_FAS@".replace('${prefix}', SAGE_LOCAL)
+ 
+ # Delete this line if your ECL can load Kenzo without further prodding.
+diff --git a/src/bin/sage-env b/src/bin/sage-env
+index a7da60df28f..13b54fa7e92 100644
+--- a/src/bin/sage-env
++++ b/src/bin/sage-env
+@@ -440,9 +440,6 @@ if [ -d "$DOT_SAGE" ] ; then
+     fi
+ fi
+ 
+-if [ -n "$SAGE_LOCAL" ]; then
+-    export MAXIMA_PREFIX="$SAGE_LOCAL"
+-fi
+ export MAXIMA_USERDIR="$DOT_SAGE/maxima"
+ 
+ if [ -n "$SAGE_LOCAL" ]; then
+diff --git a/src/sage/calculus/calculus.py b/src/sage/calculus/calculus.py
+index dae380180ac..ccb8219062b 100644
+--- a/src/sage/calculus/calculus.py
++++ b/src/sage/calculus/calculus.py
+@@ -136,10 +136,11 @@
+     [          1/2*(e^(2*sqrt(x)) + 1)*e^(x - sqrt(x)) 1/2*(x*e^(2*sqrt(x)) - x)*sqrt(x)*e^(x - sqrt(x))]
+     [  1/2*(e^(2*sqrt(x)) - 1)*e^(x - sqrt(x))/x^(3/2)           1/2*(e^(2*sqrt(x)) + 1)*e^(x - sqrt(x))]
+ 
+-And complex exponentiation works now::
++Complex exponentiation works, but may require a patched version of
++maxima (:trac:`32898`) for now::
+ 
+     sage: M = i*matrix([[pi]])
+-    sage: e^M
++    sage: e^M  # not tested, requires patched maxima
+     [-1]
+     sage: M = i*matrix([[pi,0],[0,2*pi]])
+     sage: e^M
+@@ -1186,8 +1187,18 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
+         e
+         sage: f.limit(x=5)
+         7776/3125
+-        sage: f.limit(x=1.2)
++
++    Domain to real, a regression in 5.46.0, see https://sf.net/p/maxima/bugs/4138 ::
++
++        sage: maxima_calculus.eval("domain:real")
++        ...
++        sage: f.limit(x=1.2).n()
+         2.06961575467...
++        sage: maxima_calculus.eval("domain:complex");
++        ...
++
++    Otherwise, it works ::
++
+         sage: f.limit(x=I, taylor=True)
+         (-I + 1)^I
+         sage: f(x=1.2)
+@@ -1203,7 +1214,7 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
+ 
+         sage: var('a')
+         a
+-        sage: limit(x^a,x=0)
++        sage: limit(x^a,x=0)  # random - maxima 5.46.0 does not need extra assumption
+         Traceback (most recent call last):
+         ...
+         ValueError: Computation failed since Maxima requested additional
+@@ -1215,7 +1226,7 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
+     With this example, Maxima is looking for a LOT of information::
+ 
+         sage: assume(a>0)
+-        sage: limit(x^a,x=0)
++        sage: limit(x^a,x=0)  # random - maxima 5.46.0 does not need extra assumption
+         Traceback (most recent call last):
+         ...
+         ValueError: Computation failed since Maxima requested additional
+@@ -1224,7 +1235,7 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
+          more details)
+         Is a an integer?
+         sage: assume(a,'integer')
+-        sage: limit(x^a, x=0)
++        sage: limit(x^a, x=0)  # random - maxima 5.46.0 does not need extra assumption
+         Traceback (most recent call last):
+         ...
+         ValueError: Computation failed since Maxima requested additional
+@@ -2251,10 +2262,10 @@ def symbolic_expression_from_maxima_string(x, equals_sub=False, maxima=maxima):
+         True
+         sage: sefms("x # 3") == SR(x != 3)
+         True
+-        sage: solve([x != 5], x)
+-        [[x - 5 != 0]]
++        sage: solve([x != 5], x) in [[[x - 5 != 0]], [[x < 5], [5 < x]]]
++        True
+         sage: solve([2*x==3, x != 5], x)
+-        [[x == (3/2), (-7/2) != 0]]
++        [[x == (3/2)...
+ 
+     Make sure that we don't accidentally pick up variables in the maxima namespace (:trac:`8734`)::
+ 
+diff --git a/src/sage/functions/exp_integral.py b/src/sage/functions/exp_integral.py
+index e6c888c64b6..fb0e2235e2b 100644
+--- a/src/sage/functions/exp_integral.py
++++ b/src/sage/functions/exp_integral.py
+@@ -601,8 +601,8 @@ class Function_log_integral_offset(BuiltinFunction):
+         1/log(x)
+         sage: f.integrate(x)
+         -x*log_integral(2) + x*log_integral(x) - Ei(2*log(x))
+-        sage: Li(x).integrate(x,2.0,4.5)
+-        -2.5*log_integral(2) + 5.799321147411334
++        sage: Li(x).integrate(x,2.0,4.5).n()
++        3.18641169711760
+         sage: N(f.integrate(x,2.0,3.0))   # abs tol 1e-15
+         0.601621785860587
+ 
+diff --git a/src/sage/interfaces/expect.py b/src/sage/interfaces/expect.py
+index 68ae715e4c3..84adf0341b5 100644
+--- a/src/sage/interfaces/expect.py
++++ b/src/sage/interfaces/expect.py
+@@ -620,7 +620,7 @@ def quit(self, verbose=False):
+ 
+             sage: a = maxima('y')
+             sage: maxima.quit(verbose=True)
+-            Exiting Maxima with PID ... running .../bin/maxima...
++            Exiting Maxima with PID ... running ...maxima...
+             sage: a._check_valid()
+             Traceback (most recent call last):
+             ...
+diff --git a/src/sage/interfaces/maxima.py b/src/sage/interfaces/maxima.py
+index 27b1e98a6ac..4829560f98b 100644
+--- a/src/sage/interfaces/maxima.py
++++ b/src/sage/interfaces/maxima.py
+@@ -622,11 +622,6 @@ def _start(self):
+             sage: m.is_running()
+             True
+ 
+-        Test that we can use more than 256MB RAM (see :trac:`6772`)::
+-
+-            sage: a = maxima(10)^(10^5)
+-            sage: b = a^600              # long time -- about 10-15 seconds
+-
+         """
+         Expect._start(self)
+         self._sendline(r":lisp (defun tex-derivative (x l r) (tex (if $derivabbrev (tex-dabbrev x) (tex-d x '\\partial)) l r lop rop ))")
+@@ -634,9 +629,6 @@ def _start(self):
+         # Don't use ! for factorials (#11539)
+         self._sendline(":lisp (remprop 'mfactorial 'grind)")
+ 
+-        # Remove limit on the max heapsize (since otherwise it defaults
+-        # to 256MB with ECL).
+-        self._sendline(":lisp (ext:set-limit 'ext:heap-size 0)")
+         self._eval_line('0;')
+ 
+         # set random seed
+diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py
+index c263ac65f02..bba8504aa92 100644
+--- a/src/sage/interfaces/maxima_lib.py
++++ b/src/sage/interfaces/maxima_lib.py
+@@ -934,8 +934,15 @@ def sr_limit(self, expr, v, a, dir=None):
+             e
+             sage: limit(f,x = 5)
+             7776/3125
+-            sage: limit(f,x = 1.2)
++
++        Domain to real, a regression in 5.46.0, see https://sf.net/p/maxima/bugs/4138 ::
++
++            sage: maxima_calculus.eval("domain:real")
++            ...
++            sage: limit(f,x = 1.2).n()
+             2.06961575467...
++            sage: maxima_calculus.eval("domain:complex");
++            ...
+             sage: var('a')
+             a
+             sage: limit(x^a,x=0)
+@@ -947,7 +954,7 @@ def sr_limit(self, expr, v, a, dir=None):
+             for more details)
+             Is a positive, negative or zero?
+             sage: assume(a>0)
+-            sage: limit(x^a,x=0)
++            sage: limit(x^a,x=0)  # random - not needed for maxima 5.46.0
+             Traceback (most recent call last):
+             ...
+             ValueError: Computation failed ...
+diff --git a/src/sage/matrix/matrix2.pyx b/src/sage/matrix/matrix2.pyx
+index e2e6449dfa9..15914b0be3e 100644
+--- a/src/sage/matrix/matrix2.pyx
++++ b/src/sage/matrix/matrix2.pyx
+@@ -15425,9 +15425,10 @@ cdef class Matrix(Matrix1):
+ 
+         TESTS:
+ 
+-        Check that sparse matrices are handled correctly (:trac:`28935`)::
++        Sparse matrices are handled correctly (:trac:`28935`), but may
++        require a patched version of maxima (:trac:`32898`) for now::
+ 
+-            sage: matrix.diagonal([0], sparse=True).exp()
++            sage: matrix.diagonal([0], sparse=True).exp()  # not tested, requires patched maxima
+             [1]
+             sage: matrix.zero(CBF, 2, sparse=True).exp()
+             [1.000000000000000                 0]
+diff --git a/src/sage/matrix/matrix_symbolic_dense.pyx b/src/sage/matrix/matrix_symbolic_dense.pyx
+index 19ca5c85cb2..58a25e002f6 100644
+--- a/src/sage/matrix/matrix_symbolic_dense.pyx
++++ b/src/sage/matrix/matrix_symbolic_dense.pyx
+@@ -402,7 +402,8 @@ cdef class Matrix_symbolic_dense(Matrix_generic_dense):
+             [1/2*(e^(2*x) + 1)*e^(-x) 1/2*(e^(2*x) - 1)*e^(-x)]
+             [1/2*(e^(2*x) - 1)*e^(-x) 1/2*(e^(2*x) + 1)*e^(-x)]
+ 
+-        Exp works on 0x0 and 1x1 matrices::
++        Exponentiation works on 0x0 and 1x1 matrices, but the 1x1 example
++        requires a patched version of maxima (:trac:`32898`) for now::
+ 
+             sage: m = matrix(SR,0,[]); m
+             []
+@@ -410,7 +411,7 @@ cdef class Matrix_symbolic_dense(Matrix_generic_dense):
+             []
+             sage: m = matrix(SR,1,[2]); m
+             [2]
+-            sage: m.exp()
++            sage: m.exp()  # not tested, requires patched maxima
+             [e^2]
+ 
+         Commuting matrices `m, n` have the property that
+@@ -451,7 +452,6 @@ cdef class Matrix_symbolic_dense(Matrix_generic_dense):
+             [                       0 1/2*(e^(2*x) + 1)*e^(-x) 1/2*(e^(2*x) - 1)*e^(-x)                        0]
+             [                       0 1/2*(e^(2*x) - 1)*e^(-x) 1/2*(e^(2*x) + 1)*e^(-x)                        0]
+             [1/2*(e^(2*x) - 1)*e^(-x)                        0                        0 1/2*(e^(2*x) + 1)*e^(-x)]
+-
+         """
+         if not self.is_square():
+             raise ValueError("exp only defined on square matrices")
+diff --git a/src/sage/symbolic/integration/integral.py b/src/sage/symbolic/integration/integral.py
+index c82e9ed73c3..e84ad357ee2 100644
+--- a/src/sage/symbolic/integration/integral.py
++++ b/src/sage/symbolic/integration/integral.py
+@@ -741,14 +741,14 @@ def integrate(expression, v=None, a=None, b=None, algorithm=None, hold=False):
+ 
+         sage: _ = var('x,y')
+         sage: f = log(x^2+y^2)
+-        sage: res = integral(f,x,0.0001414, 1.); res
++        sage: res = integral(f,x,1414/10^7, 1); res
+         Traceback (most recent call last):
+         ...
+-        ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(50015104*y^2-50015103>0)', see `assume?` for more details)
+-        Is 50015104*y^2-50015103 positive, negative or zero?
++        ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help ...
++        Is ... positive, negative or zero?
+         sage: assume(y>1)
+-        sage: res = integral(f,x,0.0001414, 1.); res
+-        2*y*arctan(1.0/y) - 2*y*arctan(0.0001414/y) + 1.0*log(1.0*y^2 + 1.0) - 0.0001414*log(1.0*y^2 + 1.9993959999999997e-08) - 1.9997172
++        sage: res = integral(f,x,1414/10^7, 1); res
++        -2*y*arctan(707/5000000/y) + 2*y*arctan(1/y) + log(y^2 + 1) - 707/5000000*log(y^2 + 499849/25000000000000) - 4999293/2500000
+         sage: nres = numerical_integral(f.subs(y=2), 0.0001414, 1.); nres
+         (1.4638323264144..., 1.6251803529759...e-14)
+         sage: res.subs(y=2).n()
+diff --git a/src/sage/symbolic/relation.py b/src/sage/symbolic/relation.py
+index 94813315181..a72ab547c76 100644
+--- a/src/sage/symbolic/relation.py
++++ b/src/sage/symbolic/relation.py
+@@ -1787,8 +1787,8 @@ def solve_ineq_fourier(ineq, vars=None):
+         sage: y = var('y')
+         sage: solve_ineq_fourier([x+y<9,x-y>4],[x,y])
+         [[y + 4 < x, x < -y + 9, y < (5/2)]]
+-        sage: solve_ineq_fourier([x+y<9,x-y>4],[y,x])
+-        [[y < min(x - 4, -x + 9)]]
++        sage: solve_ineq_fourier([x+y<9,x-y>4],[y,x])[0][0](x=42)
++        y < -33
+ 
+         sage: solve_ineq_fourier([x^2>=0])
+         [[x < +Infinity]]
diff --git a/srcpkgs/sagemath/patches/35635-sympy_1.12.patch b/srcpkgs/sagemath/patches/35635-sympy_1.12.patch
new file mode 100644
index 000000000000..9cfc69c2adb6
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35635-sympy_1.12.patch
@@ -0,0 +1,54 @@
+diff --git a/src/sage/calculus/calculus.py b/src/sage/calculus/calculus.py
+index dae380180ac..ca3c59e63d2 100644
+--- a/src/sage/calculus/calculus.py
++++ b/src/sage/calculus/calculus.py
+@@ -1690,8 +1690,11 @@ def laplace(ex, t, s, algorithm='maxima'):
+ 
+     Testing SymPy::
+ 
+-        sage: laplace(t^n, t, s, algorithm='sympy')
+-        (gamma(n + 1)/(s*s^n), 0, re(n) > -1)
++        sage: F, a, cond = laplace(t^n, t, s, algorithm='sympy')
++        sage: a, cond
++        (0, re(n) > -1)
++        sage: F.simplify()
++        s^(-n - 1)*gamma(n + 1)
+ 
+     Testing Maxima::
+ 
+@@ -1700,17 +1703,19 @@ def laplace(ex, t, s, algorithm='maxima'):
+ 
+     Check that :trac:`24212` is fixed::
+ 
+-        sage: laplace(cos(t^2), t, s, algorithm='sympy')
+-        (-1/2*sqrt(pi)*(sqrt(2)*cos(1/4*s^2)*fresnel_sin(1/2*sqrt(2)*s/sqrt(pi)) -
+-        sqrt(2)*fresnel_cos(1/2*sqrt(2)*s/sqrt(pi))*sin(1/4*s^2) - cos(1/4*pi + 1/4*s^2)),
+-        0, True)
++        sage: F, a, cond = laplace(cos(t^2), t, s, algorithm='sympy')
++        sage: a, cond
++        (0, True)
++        sage: F._sympy_().simplify()
++        sqrt(pi)*(sqrt(2)*sin(s**2/4)*fresnelc(sqrt(2)*s/(2*sqrt(pi))) -
++        sqrt(2)*cos(s**2/4)*fresnels(sqrt(2)*s/(2*sqrt(pi))) + cos(s**2/4 + pi/4))/2
+ 
+     Testing result from SymPy that Sage doesn't know how to handle::
+ 
+         sage: laplace(cos(-1/t), t, s, algorithm='sympy')
+         Traceback (most recent call last):
+         ...
+-        AttributeError: Unable to convert SymPy result (=meijerg(((), ()), ((-1/2, 0, 1/2), (0,)), s**2/16)/4) into Sage
++        AttributeError: Unable to convert SymPy result (=meijerg(((), ()), ((-1/2, 0, 1/2), (0,)), ...)/4) into Sage
+     """
+     if not isinstance(ex, (Expression, Function)):
+         ex = SR(ex)
+@@ -1817,8 +1822,8 @@ def inverse_laplace(ex, s, t, algorithm='maxima'):
+ 
+     Transform an expression involving a time-shift, via SymPy::
+ 
+-        sage: inverse_laplace(1/s^2*exp(-s), s, t, algorithm='sympy')
+-        -(log(e^(-t)) + 1)*heaviside(t - 1)
++        sage: inverse_laplace(1/s^2*exp(-s), s, t, algorithm='sympy').simplify()
++        (t - 1)*heaviside(t - 1)
+ 
+     The same instance with Giac::
+ 
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 871ae38577fd..d510bb367c7a 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 URL_BASE_PR="https://github.com/sagemath/sage/pull/"
-URL_BASE_COMPARE="https://github.com/sagemath/sage/compare/9.8..."
+URL_BASE_COMPARE="https://github.com/sagemath/sage/compare/10.0.rc0..."
 
 case "$1" in
 	-n)  DO=echo ;;
@@ -15,49 +15,11 @@ get_pr() {
 	$DO wget "$URL_BASE_PR$pr.$ext" -O "$pr-$desc.patch"
 }
 
-get_trac() {
-	ticket=$1
-	desc=$(echo "$2" | sed -e 's/ /_/g')
-	commit=$3
-	$DO wget "$URL_BASE_COMPARE$commit.diff" -O "$ticket-$desc-$commit.patch"
-}
-
 # run from patches dir
 cd $(dirname "$0")
 
-# merged in 10.0.beta0
-get_trac 34851 "support singular 4.3.1.p3" 5e5737a0c
-get_pr 35068 "fix tests giac 1.9.0.35" patch
-
-# merged in 10.0.beta1
-get_pr 35058 "skip unstable tests klyachko"
-
-# merged in 10.0.beta2
-get_pr 34994 "fix tests numpy 1.24"
-get_pr 34997 "fix edge case of integer_check"
-
-# merged in 10.0.beta3
-get_pr 34995 "support tachyon 0.99.2"
-
-# merged in 10.0.beta4
-get_pr 34980 "avoid factoring in is_prime"
-
-# merged in 10.0.beta5
-get_pr 35094 "support gap 4.12"					# includes PR 35093
-
-# merged in 10.0.beta6
-get_pr 35127 "fix very slow test stream.py"
-get_pr 35177 "matplotlib 3.7"
-get_pr 35195 "workaround ecl race"
-get_pr 35204 "fix sage-cleaner"
-
-# merged in 10.0.beta7
-get_pr 35250 "nauty 2.8.6"
-
-# merged in 10.0.beta8
-#get_pr 35337 "ipython 8.11"
-get_pr 35423 "ipython 8.12"						# includes PR 35337
-get_pr 35438 "pythran 0.12.1"
-
 # needs review
 get_pr 35584 "networkx 3.1"
+get_pr 35612 "linbox 1.7.0"
+get_pr 35619 "maxima 5.46.0"
+get_pr 35635 "sympy 1.12"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 66a543efd21d..eb63ba98d5e8 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=9.8
-revision=2
+version=10.0.rc3
+revision=1
 build_wrksrc=pkgs/sagemath-standard
 build_style=python3-module
 _bindir=/usr/lib/sagemath/$version/bin
@@ -32,7 +32,7 @@ maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-or-later"
 homepage="http://sagemath.org/"
 distfiles="https://github.com/sagemath/sage/archive/refs/tags/$version.tar.gz"
-checksum=2aff28bd1d18c2d526581f5298acb8336f5b92db5675a7403dec8eaf9a86bc4c
+checksum=2fcc4fc6bd24027688bf8af373783b86e6139773ee53aee81156de8bc61656f0
 
 do_configure() {
 	# git tree needs bootstrapping

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [RFC] sagemath: update to 10.0.rc3.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (18 preceding siblings ...)
  2023-05-13 22:12 ` [PR PATCH] [Updated] " tornaria
@ 2023-05-15 15:04 ` dkwo
  2023-05-15 16:35 ` tornaria
                   ` (19 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: dkwo @ 2023-05-15 15:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 222 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43659#issuecomment-1548040709

Comment:
`maxima and maxima-emacs conflict for`: should we also remove the maxima-emacs pkg?

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [RFC] sagemath: update to 10.0.rc3.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (19 preceding siblings ...)
  2023-05-15 15:04 ` dkwo
@ 2023-05-15 16:35 ` tornaria
  2023-05-15 18:42 ` dkwo
                   ` (18 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: tornaria @ 2023-05-15 16:35 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 660 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43659#issuecomment-1548188321

Comment:
> `maxima and maxima-emacs conflict for`: should we also remove the maxima-emacs pkg?

On the contrary. I removed `maxima-emacs` package thus the conflict (since these files are in the `maxima-emacs` package in the repo and in the `maxima` package in the update).

I think the simplest solution is to *not* remove the `maxima-emacs` package, instead make it into an empty dummy transitional package. Then there shouldn't be file conflicts for the moved files. Then in the next update we can remove `maxima-emacs`.

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [RFC] sagemath: update to 10.0.rc3.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (20 preceding siblings ...)
  2023-05-15 16:35 ` tornaria
@ 2023-05-15 18:42 ` dkwo
  2023-05-15 19:06 ` tornaria
                   ` (17 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: dkwo @ 2023-05-15 18:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 423 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43659#issuecomment-1548371185

Comment:
Hmm, what I meant is adding maxima-emacs to removed-pkgs: could that work?
Other than that, maxima builds fine. And sage as well: on top of https://github.com/void-linux/void-packages/pull/43659#issuecomment-1540098837 , I only have `structure/coerce_actions.pyx # 3 doctest failed`.

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [RFC] sagemath: update to 10.0.rc3.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (21 preceding siblings ...)
  2023-05-15 18:42 ` dkwo
@ 2023-05-15 19:06 ` tornaria
  2023-05-15 21:16 ` dkwo
                   ` (16 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: tornaria @ 2023-05-15 19:06 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 918 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43659#issuecomment-1548413195

Comment:
> Hmm, what I meant is adding maxima-emacs to removed-pkgs: could that work?

I don't know, maybe adding to conflicts, etc... but I think the empty transition pkg should be ok and the easiest solution, also so that we "prune" the old maxima-emacs from the repo (later we just remove and add to removed-pkgs)

> And sage as well: on top of [#43659 (comment)](https://github.com/void-linux/void-packages/pull/43659#issuecomment-1540098837) , I only have `structure/coerce_actions.pyx # 3 doctest failed`.

Can you copy the full output for all the tests that fail? Have you tried running tests with `--long` as well? (`./xbps-src check -K` will run tests in `--long` mode, while `-Q` will run tests in normal mode -- the total cpu time should be about double with --long).

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [RFC] sagemath: update to 10.0.rc3.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (22 preceding siblings ...)
  2023-05-15 19:06 ` tornaria
@ 2023-05-15 21:16 ` dkwo
  2023-05-15 21:50 ` tornaria
                   ` (15 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: dkwo @ 2023-05-15 21:16 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 495 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43659#issuecomment-1548592999

Comment:
With `sage -t --long`, there are only two failures:
[fail1.log](https://github.com/void-linux/void-packages/files/11482001/fail1.log)
[fail2.log](https://github.com/void-linux/void-packages/files/11482005/fail2.log)
while `structure/coerce_actions.pyx` passes all tests 
[fail3.log](https://github.com/void-linux/void-packages/files/11482011/fail3.log)

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [RFC] sagemath: update to 10.0.rc3.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (23 preceding siblings ...)
  2023-05-15 21:16 ` dkwo
@ 2023-05-15 21:50 ` tornaria
  2023-05-16 14:28 ` dkwo
                   ` (14 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: tornaria @ 2023-05-15 21:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2113 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43659#issuecomment-1548642773

Comment:
> With `sage -t --long`, there are only two failures: [fail1.log](https://github.com/void-linux/void-packages/files/11482001/fail1.log) [fail2.log](https://github.com/void-linux/void-packages/files/11482005/fail2.log) while `structure/coerce_actions.pyx` passes all tests [fail3.log](https://github.com/void-linux/void-packages/files/11482011/fail3.log)

Can you try building python3 natively? When built in cross, the configure step gives:
```
checking for broken sem_getvalue... yes
```
which then causes this `NotImplementedError`.

Please have a look at this configure check --- if you get "no" there I expect your natively built python3 will work ok.

If this works then the fix for cross building python3 is adding  `ac_cv_broken_sem_getvalue=no` to `configure_args` (you could try building python3 cross on a x86_64 with this change, then see if the resulting pkg works, then submit a PR for python3 so the pkg in void repos works out of the box). The problem is that this is checked by compiling and running a program which won't work in cross -- but if we know sem_gevalue is ok in all of our arches, we can always force it (otherwise, force it in the arches that are known to work).

----

What about the failures in `structure/coerce_actions.pyx`? Is this passing with `--long` and failing without it? Is it failing only for a particular value of `--random-seed`?

BTW: you can use xbps-src to run checks in selected files and/or with a chosen random seed. Just create a file `sagemath-check` in your `void-packages` root directory. You can add filenames and options for the sage check step. E.g.
```
--random-seed=278209243980132307357977126905193403766
src/sage/parallel/map_reduce.py
src/sage/sets/recursively_enumerated_sets.pyx
src/sage/structure/coerce_actions.pyx
```

Add `--long` if you want, etc. You can use `#` to comment. If the file is "empty" (as in not existent or everything is commented out) then checks run normally.

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [RFC] sagemath: update to 10.0.rc3.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (24 preceding siblings ...)
  2023-05-15 21:50 ` tornaria
@ 2023-05-16 14:28 ` dkwo
  2023-05-16 14:39 ` dkwo
                   ` (13 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: dkwo @ 2023-05-16 14:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 473 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43659#issuecomment-1549787554

Comment:
Rebuilding python3 natively, I see `checking for broken sem_getvalue... no`, and then both tests
```
parallel/map_reduce.py
sets/recursively_enumerated_sets.pyx
```
pass with just `sage -t`. The `structure/coerce_actions.pyx` is also passing both with and without `--long`, maybe it was an issue with that particular random seed?

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [RFC] sagemath: update to 10.0.rc3.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (25 preceding siblings ...)
  2023-05-16 14:28 ` dkwo
@ 2023-05-16 14:39 ` dkwo
  2023-05-18 14:08 ` dkwo
                   ` (12 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: dkwo @ 2023-05-16 14:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 273 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43659#issuecomment-1549808915

Comment:
opened a pr for python3. everything looks good to me :)
i can perhaps run again the full testsuite once the 10 is out.
thanks a lot!

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [RFC] sagemath: update to 10.0.rc3.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (26 preceding siblings ...)
  2023-05-16 14:39 ` dkwo
@ 2023-05-18 14:08 ` dkwo
  2023-05-21 15:28 ` [PR PATCH] [Updated] " tornaria
                   ` (11 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: dkwo @ 2023-05-18 14:08 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 381 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43659#issuecomment-1553116422

Comment:
Do you mind explicitly adding to the sagemath template a line like
`nocross="due to ntl (flintlib), fflas-ffpack, givaro, linbox, cysignals, sympow, maxima"`
so that we keep track of packages blocking cross-compile? All build fine natively.

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] sagemath: update to 10.0.rc3.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (27 preceding siblings ...)
  2023-05-18 14:08 ` dkwo
@ 2023-05-21 15:28 ` tornaria
  2023-05-21 15:32 ` [RFC] sagemath: update to 10.0 tornaria
                   ` (10 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: tornaria @ 2023-05-21 15:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1700 bytes --]

There is an updated pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages sagemath-next
https://github.com/void-linux/void-packages/pull/43659

[RFC] sagemath: update to 10.0.rc3.
<!-- Uncomment relevant sections and delete options which are not applicable -->

This builds on top of #43225 for convenience.

#### Testing the changes
- I tested the changes in this PR: **briefly**

I've been following beta releases and now rc0 includes all of our patches :muscle:

All doctests pass with the version of packages in void except for `python-Babel` which must be updated (as in #43497) and is included  here as part of #43225.

I've switched my system sagemath to this version as everything seems to be working ok. The testsuite is 10-15% faster.

@dkwo: enjoy.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/43659.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-sagemath-next-43659.patch --]
[-- Type: text/x-diff, Size: 183431 bytes --]

From 5c31c0927ffdf7657c134725ed909c9ba85cfb5e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Dec 2021 20:20:09 -0300
Subject: [PATCH 1/5] givaro: update to 4.2.0.

---
 srcpkgs/givaro/patches/197.patch | 28 ++++++++++++++++++++++++++++
 srcpkgs/givaro/template          |  9 ++++-----
 2 files changed, 32 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/givaro/patches/197.patch

diff --git a/srcpkgs/givaro/patches/197.patch b/srcpkgs/givaro/patches/197.patch
new file mode 100644
index 000000000000..bafaff3efbd9
--- /dev/null
+++ b/srcpkgs/givaro/patches/197.patch
@@ -0,0 +1,28 @@
+From ab3d332508c21daff41fb64a8658cdc7cc74fc47 Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
+Date: Thu, 16 Dec 2021 17:12:25 +0100
+Subject: [PATCH] dom_power argument is now an uint64_t to avoid problem with
+ 32bit machine
+
+---
+ src/kernel/system/givpower.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/kernel/system/givpower.h b/src/kernel/system/givpower.h
+index eb784872..5644264d 100644
+--- a/src/kernel/system/givpower.h
++++ b/src/kernel/system/givpower.h
+@@ -71,11 +71,11 @@ namespace Givaro {
+ 
+     //! dom_power
+     template<class D, class TT>
+-    TT& dom_power(TT& res, const TT& n, long l, const D& F)
++    TT& dom_power(TT& res, const TT& n, uint64_t l, const D& F)
+     {
+         if (l == 0) return F.assign(res,F.one) ;
+ 
+-        unsigned long p = (unsigned long) l ;
++        uint64_t p = l;
+         bool is_assg = false ;
+ 
+         TT puiss; F.init(puiss); F.assign(puiss,n) ;
diff --git a/srcpkgs/givaro/template b/srcpkgs/givaro/template
index 9c16de5b1974..52457c02a1ed 100644
--- a/srcpkgs/givaro/template
+++ b/srcpkgs/givaro/template
@@ -1,6 +1,6 @@
 # Template file for 'givaro'
 pkgname=givaro
-version=4.1.1
+version=4.2.0
 revision=1
 build_style=gnu-configure
 makedepends="gmpxx-devel"
@@ -8,16 +8,15 @@ short_desc="C++ library for arithmetic and algebraic computations"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="CECILL-B"
 homepage="https://github.com/linbox-team/givaro"
+changelog="https://github.com/linbox-team/givaro/raw/master/ChangeLog"
 distfiles="https://github.com/linbox-team/givaro/releases/download/v${version}/givaro-${version}.tar.gz"
-checksum=628049899386e91da245aee6cd446350fbca87e94863bc0d815066c08150487f
+checksum=865e228812feca971dfb6e776a7bc7ac959cf63ebd52b4f05492730a46e1f189
 nocross=yes
 
 build_options="native_build"
 
 if [ -z "$build_option_native_build" ]; then
-	configure_args="--enable-sse --enable-sse2
-	  --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42
-	  --disable-avx --disable-avx2 --disable-fma --disable-fma4"
+	configure_args="--without-archnative"
 fi
 
 post_install() {

From 55baa9c6645a08f44b38d7d1d443e65798634883 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Dec 2021 20:20:17 -0300
Subject: [PATCH 2/5] fflas-ffpack: update to 2.5.0.

---
 srcpkgs/fflas-ffpack/patches/357.patch | 35 ++++++++++++++++++++++++++
 srcpkgs/fflas-ffpack/template          | 12 ++++-----
 2 files changed, 40 insertions(+), 7 deletions(-)
 create mode 100644 srcpkgs/fflas-ffpack/patches/357.patch

diff --git a/srcpkgs/fflas-ffpack/patches/357.patch b/srcpkgs/fflas-ffpack/patches/357.patch
new file mode 100644
index 000000000000..99fd34efd93b
--- /dev/null
+++ b/srcpkgs/fflas-ffpack/patches/357.patch
@@ -0,0 +1,35 @@
+From 9b6083c663096e9ca85775b79f1f27c848dbeb98 Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
+Date: Fri, 17 Dec 2021 10:27:02 +0100
+Subject: [PATCH] Fix SimdChooser: on not x86_64 machines its value could be an
+ nonexistant struct
+
+---
+ fflas-ffpack/fflas/fflas_simd.h | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/fflas-ffpack/fflas/fflas_simd.h b/fflas-ffpack/fflas/fflas_simd.h
+index bf5d30211..84ced0fd8 100644
+--- a/fflas-ffpack/fflas/fflas_simd.h
++++ b/fflas-ffpack/fflas/fflas_simd.h
+@@ -384,6 +384,20 @@ struct SimdChooser<T, true, true> // integral number
+ #endif
+ };
+ 
++#ifndef __x86_64__
++template <>
++struct SimdChooser<uint64_t, true, true>
++{
++    using value = NoSimd<uint64_t>;
++};
++
++template <>
++struct SimdChooser<int64_t, true, true>
++{
++    using value = NoSimd<int64_t>;
++};
++#endif
++
+ template <class T> using Simd = typename SimdChooser<T>::value;
+ 
+ // template <class T> struct SimdChooser<T, true> {
diff --git a/srcpkgs/fflas-ffpack/template b/srcpkgs/fflas-ffpack/template
index 557c644c00a4..2aa599703585 100644
--- a/srcpkgs/fflas-ffpack/template
+++ b/srcpkgs/fflas-ffpack/template
@@ -1,6 +1,6 @@
 # Template file for 'fflas-ffpack'
 pkgname=fflas-ffpack
-version=2.4.3
+version=2.5.0
 revision=1
 build_style=gnu-configure
 hostmakedepends="pkg-config"
@@ -10,15 +10,13 @@ short_desc="Finite Field Linear Algebra Subroutines / Package"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="LGPL-2.1-or-later"
 homepage="http://linbox-team.github.io/fflas-ffpack/"
-distfiles="https://github.com/linbox-team/fflas-ffpack/releases/download/${version}/fflas-ffpack-${version}.tar.gz"
-checksum=f372783a17a9899ee9f88d4c9421d80facccb95556146dad7020d07a03791cc9
+changelog="https://github.com/linbox-team/fflas-ffpack/raw/master/ChangeLog"
+distfiles="https://github.com/linbox-team/fflas-ffpack/releases/download/v${version}/fflas-ffpack-${version}.tar.gz"
+checksum=dafb4c0835824d28e4f823748579be6e4c8889c9570c6ce9cce1e186c3ebbb23
 nocross=yes
 
 build_options="native_build"
 
 if [ -z "$build_option_native_build" ]; then
-	configure_args="--enable-sse --enable-sse2
-	  --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42
-	  --disable-avx --disable-avx2 --disable-fma --disable-fma4
-	  --disable-avx512f --disable-avx512dq --disable-avx512vl"
+	configure_args="--without-archnative"
 fi

From ee7a1b0804e274ef5c8bce7417f006e960182577 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Dec 2021 20:20:20 -0300
Subject: [PATCH 3/5] linbox: update to 1.7.0.

---
 srcpkgs/linbox/patches/292.patch              | 24 ++++++++++++
 srcpkgs/linbox/patches/294.patch              | 38 +++++++++++++++++++
 ...8adade10641f1f04f04b589753d928fb5443.patch | 35 -----------------
 .../remove-linboxsage-libs-from-pc.patch      | 23 -----------
 srcpkgs/linbox/template                       | 11 +++---
 5 files changed, 67 insertions(+), 64 deletions(-)
 create mode 100644 srcpkgs/linbox/patches/292.patch
 create mode 100644 srcpkgs/linbox/patches/294.patch
 delete mode 100644 srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch
 delete mode 100644 srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch

diff --git a/srcpkgs/linbox/patches/292.patch b/srcpkgs/linbox/patches/292.patch
new file mode 100644
index 000000000000..d3333cc23d0b
--- /dev/null
+++ b/srcpkgs/linbox/patches/292.patch
@@ -0,0 +1,24 @@
+From 49b9cccd0286980c1c1811c3b03df883ef0164df Mon Sep 17 00:00:00 2001
+From: Doug Torrance <dtorrance@piedmont.edu>
+Date: Tue, 14 Dec 2021 16:22:33 -0500
+Subject: [PATCH] Only register uint128_t as a TypeName when it's available.
+
+Otherwise, test-fft will fail when it isn't.
+---
+ tests/test-fft.C | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/tests/test-fft.C b/tests/test-fft.C
+index d19184c2d..5811ebc5d 100644
+--- a/tests/test-fft.C
++++ b/tests/test-fft.C
+@@ -55,7 +55,9 @@ REGISTER_TYPE_NAME(double);
+ REGISTER_TYPE_NAME(uint16_t);
+ REGISTER_TYPE_NAME(uint32_t);
+ REGISTER_TYPE_NAME(uint64_t);
++#ifdef __FFLASFFPACK_HAVE_INT128
+ REGISTER_TYPE_NAME(uint128_t);
++#endif
+ REGISTER_TYPE_NAME(Modular);
+ REGISTER_TYPE_NAME(ModularExtended);
+ 
diff --git a/srcpkgs/linbox/patches/294.patch b/srcpkgs/linbox/patches/294.patch
new file mode 100644
index 000000000000..7c645f165d39
--- /dev/null
+++ b/srcpkgs/linbox/patches/294.patch
@@ -0,0 +1,38 @@
+From f81a1f4a5e0835b7a0f3bb88a0fcbbaa32174cfa Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
+Date: Wed, 15 Dec 2021 16:00:39 +0100
+Subject: [PATCH] Only register uint128_t as a TypeName when it's available
+
+---
+ benchmarks/benchmark-fft.C                       | 2 ++
+ benchmarks/benchmark-polynomial-matrix-mul-fft.C | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/benchmarks/benchmark-fft.C b/benchmarks/benchmark-fft.C
+index 39b86c9d9..59a8be57c 100644
+--- a/benchmarks/benchmark-fft.C
++++ b/benchmarks/benchmark-fft.C
+@@ -54,7 +54,9 @@ REGISTER_TYPE_NAME(double);
+ REGISTER_TYPE_NAME(uint16_t);
+ REGISTER_TYPE_NAME(uint32_t);
+ REGISTER_TYPE_NAME(uint64_t);
++#ifdef __FFLASFFPACK_HAVE_INT128
+ REGISTER_TYPE_NAME(uint128_t);
++#endif
+ REGISTER_TYPE_NAME(Modular);
+ REGISTER_TYPE_NAME(ModularExtended);
+ 
+diff --git a/benchmarks/benchmark-polynomial-matrix-mul-fft.C b/benchmarks/benchmark-polynomial-matrix-mul-fft.C
+index e9b184bcf..7bf17f33e 100644
+--- a/benchmarks/benchmark-polynomial-matrix-mul-fft.C
++++ b/benchmarks/benchmark-polynomial-matrix-mul-fft.C
+@@ -65,7 +65,9 @@ REGISTER_TYPE_NAME(double);
+ REGISTER_TYPE_NAME(uint16_t);
+ REGISTER_TYPE_NAME(uint32_t);
+ REGISTER_TYPE_NAME(uint64_t);
++#ifdef __FFLASFFPACK_HAVE_INT128
+ REGISTER_TYPE_NAME(uint128_t);
++#endif
+ REGISTER_TYPE_NAME(Modular);
+ REGISTER_TYPE_NAME(ModularExtended);
+ 
diff --git a/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch b/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch
deleted file mode 100644
index 5afa078ec7b8..000000000000
--- a/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 892f8adade10641f1f04f04b589753d928fb5443 Mon Sep 17 00:00:00 2001
-From: Doug Torrance <dtorrance@piedmont.edu>
-Date: Sun, 9 May 2021 12:14:19 -0400
-Subject: [PATCH] Use std::ptrdiff_t for vector iterator difference type
-
-It was previously long (64-bit integers), but this will not be the
-case on 32-bit systems.
-
-Closes: #273
----
- linbox/vector/bit-vector.inl | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/linbox/vector/bit-vector.inl b/linbox/vector/bit-vector.inl
-index 5fa84b421..23a22ba47 100644
---- a/linbox/vector/bit-vector.inl
-+++ b/linbox/vector/bit-vector.inl
-@@ -46,7 +46,7 @@ namespace std
- 		typedef LinBox::BitVector::reference reference;
- 		typedef bool *pointer;
- 		typedef bool value_type;
--		typedef long difference_type;
-+		typedef std::ptrdiff_t difference_type;
- 	};
- 
- 	template <>
-@@ -56,7 +56,7 @@ namespace std
- 		typedef LinBox::BitVector::const_reference reference;
- 		typedef const bool *pointer;
- 		typedef bool value_type;
--		typedef long difference_type;
-+		typedef std::ptrdiff_t difference_type;
- 	};
- }
- 
diff --git a/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch b/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch
deleted file mode 100644
index c93915fb1b06..000000000000
--- a/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Backported from:
-
-From 426eb97ba762c7663884f57ead0909f2aa3cd6a5 Mon Sep 17 00:00:00 2001
-From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
-Date: Thu, 17 Jan 2019 16:32:19 +0100
-Subject: [PATCH] Remove @LINBOXSAGE_LIBS@ from linbox.pc.in
-
----
- linbox.pc.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/linbox.pc.in b/linbox.pc.in
-index 278f127e4..c6b8091eb 100644
---- a/linbox.pc.in
-+++ b/linbox.pc.in
-@@ -9,6 +9,6 @@ Description: Exact Linear Algebra library
- URL: http://github.com/linbox-team/linbox
- Version: @VERSION@
- Requires: fflas-ffpack >= 2.4.0, givaro >= 4.1.0
--Libs: -L${libdir} -llinbox @LINBOXSAGE_LIBS@ @NTL_LIBS@ @MPFR_LIBS@ @FPLLL_LIBS@ @IML_LIBS@ @FLINT_LIBS@ @OCL_LIBS@
-+Libs: -L${libdir} -llinbox @NTL_LIBS@ @MPFR_LIBS@ @FPLLL_LIBS@ @IML_LIBS@ @FLINT_LIBS@ @OCL_LIBS@
- Cflags: @DEFAULT_CFLAGS@ -DDISABLE_COMMENTATOR -I${includedir} @NTL_CFLAGS@ @MPFR_CFLAGS@ @FPLLL_CFLAGS@  @IML_CFLAGS@ @FLINT_CFLAGS@ 
- \-------------------------------------------------------
diff --git a/srcpkgs/linbox/template b/srcpkgs/linbox/template
index 096a15b3390b..e6edacdd0a74 100644
--- a/srcpkgs/linbox/template
+++ b/srcpkgs/linbox/template
@@ -1,7 +1,7 @@
 # Template file for 'linbox'
 pkgname=linbox
-version=1.6.3
-revision=2
+version=1.7.0
+revision=1
 build_style=gnu-configure
 hostmakedepends="pkg-config"
 makedepends="fflas-ffpack"
@@ -9,16 +9,15 @@ short_desc="C++ library for exact, high-performance linear algebra"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="LGPL-2.1-or-later"
 homepage="https://linalg.org"
+changelog="https://github.com/linbox-team/linbox/raw/master/ChangeLog"
 distfiles="https://github.com/linbox-team/linbox/releases/download/v${version}/linbox-${version}.tar.gz"
-checksum=a58a188307b07c57964e844bceb99321d3043a8a4a1fccc082a54928bb9a0057
+checksum=6d2159fd395be0298362dd37f6c696676237bc8e2757341fbc46520e3b466bcc
 nocross=yes
 
 build_options="native_build"
 
 if [ -z "$build_option_native_build" ]; then
-	configure_args="--enable-sse --enable-sse2
-	  --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42
-	  --disable-avx --disable-avx2 --disable-fma --disable-fma4"
+	configure_args="--without-archnative"
 fi
 
 linbox-devel_package() {

From 3607f991dba71883241a28a931a788d13792291e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Fri, 15 Apr 2022 14:25:08 -0300
Subject: [PATCH 4/5] maxima: update to 5.46.0.

Also:
 - disable sbcl on aarch64
 - don't makedepends on emacs (avoid a nocross build dep)
 - move maxima-emacs files to main pkg
 - adopt
---
 ...a43e5234305bd6f1de5909d4ce5d7e1ea864.patch | 24 -------------------
 srcpkgs/maxima/template                       | 20 ++++++++--------
 2 files changed, 10 insertions(+), 34 deletions(-)
 delete mode 100644 srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch

diff --git a/srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch b/srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch
deleted file mode 100644
index e1ac1e5f6086..000000000000
--- a/srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-commit a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864
-Author: Robert Dodier <robert_dodier@users.sourceforge.net>
-Date:   Mon Oct 11 22:40:13 2021 -0700
-
-    Apply patch #80: "Build a FASL library, needed by SageMath"
-    
-    This modifies maxima.system for ECL only.
-
-diff --git a/src/maxima.system b/src/maxima.system
-index d954bc2b9..525fb778e 100644
---- a/src/maxima.system
-+++ b/src/maxima.system
-@@ -75,6 +75,11 @@
- 			     ;; Convert dir/foo.fas to dir/foo.o
- 			     (make-pathname :type "o" :defaults p))
- 			 files)))
-+	(c::build-fasl "binary-ecl/maxima" :lisp-files obj
-+			  :ld-flags
-+			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
-+							      (find-package "MAXIMA")))))
-+			    (if (and x (not (string= x ""))) (list x))))
- 	(c::build-program "binary-ecl/maxima" :lisp-files obj
- 			  :ld-flags
- 			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
diff --git a/srcpkgs/maxima/template b/srcpkgs/maxima/template
index 69e85ec833e8..f67b469e3dda 100644
--- a/srcpkgs/maxima/template
+++ b/srcpkgs/maxima/template
@@ -1,19 +1,21 @@
 # Template file for 'maxima'
 pkgname=maxima
-version=5.45.1
-revision=4
+version=5.46.0
+revision=1
 build_style=gnu-configure
 configure_args="$(vopt_enable clisp) $(vopt_enable sbcl sbcl-exec) $(vopt_enable ecl)"
-hostmakedepends="python3 perl emacs texinfo patchelf"
+hostmakedepends="python3 perl texinfo patchelf $(vopt_if ecl ecl)"
 makedepends="$(vopt_if clisp clisp) $(vopt_if sbcl sbcl) $(vopt_if ecl ecl)"
 depends="$(vopt_if clisp clisp) rlwrap"
 checkdepends="gnuplot"
 short_desc="Computer Algebra System"
-maintainer="Bosco Garcia <jboscogg@gmail.org>"
+maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-only"
 homepage="http://maxima.sourceforge.net"
+changelog="https://sourceforge.net/p/maxima/code/ci/master/tree/changelogs/ChangeLog-${version%.*}.md?format=raw"
 distfiles="${SOURCEFORGE_SITE}/maxima/maxima-${version}.tar.gz"
-checksum=fe9016276970bef214a1a244348558644514d7fdfaa4fc8b9d0e87afcbb4e7dc
+checksum=7390f06b48da65c9033e8b2f629b978b90056454a54022db7de70e2225aa8b07
+nocross=yes
 
 # maxima-sbcl is nopie and should NOT be stripped or it won't work
 nostrip_files=/usr/lib/maxima/$version/binary-sbcl/maxima
@@ -32,7 +34,7 @@ build_options_default="ecl"
 
 # sbcl is only available for these architectures
 case "$XBPS_TARGET_MACHINE" in
-	i686|x86_64*|armv7l|aarch64|ppc64le*)
+	i686|x86_64*|armv7l|ppc64le*)
 		build_options_default+=" sbcl"
 		;;
 esac
@@ -113,11 +115,9 @@ maxima-src_package() {
 }
 
 maxima-emacs_package() {
-	short_desc+=" - Emacs interface"
+	short_desc+=" - transitional dummy package"
 	depends="${sourcepkg}-${version}_${revision} virtual?emacs"
-	pkg_install() {
-		vmove usr/share/emacs
-	}
+	build_style=meta
 }
 
 xmaxima_package() {

From 3d85c246620d3451da0088fc00adbf9b1c6fac60 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Feb 2023 22:53:33 -0300
Subject: [PATCH 5/5] sagemath: update to 10.0.

Also:
 - support networkx 3.1 (sagemath#35584)
 - support linbox 1.7.0 (sagemath#35612)
 - support maxima 5.46.0 (sagemath#35619)
 - support sympy 1.12 (sagemath#35635)
---
 srcpkgs/sagemath/files/sage_conf.py           |    1 -
 srcpkgs/sagemath/files/timings2.json          |  405 ++---
 ...-support_singular_4.3.1.p3-5e5737a0c.patch |  205 ---
 .../34980-avoid_factoring_in_is_prime.patch   |   49 -
 .../patches/34994-fix_tests_numpy_1.24.patch  |   58 -
 .../34995-support_tachyon_0.99.2.patch        |   57 -
 ...34997-fix_edge_case_of_integer_check.patch |   36 -
 .../35058-skip_unstable_tests_klyachko.patch  |   22 -
 .../35068-fix_tests_giac_1.9.0.35.patch       |   62 -
 .../patches/35094-support_gap_4.12.patch      | 1303 -----------------
 .../35127-fix_very_slow_test_stream.py.patch  |   15 -
 .../patches/35177-matplotlib_3.7.patch        |   95 --
 .../patches/35195-workaround_ecl_race.patch   |   56 -
 .../patches/35204-fix_sage-cleaner.patch      |   28 -
 .../sagemath/patches/35250-nauty_2.8.6.patch  |   35 -
 .../sagemath/patches/35423-ipython_8.12.patch |   51 -
 .../patches/35438-pythran_0.12.1.patch        |   41 -
 .../sagemath/patches/35584-networkx_3.1.patch |   35 +-
 .../sagemath/patches/35612-linbox_1.7.0.patch |   64 +
 .../patches/35619-maxima_5.46.0.patch         |  578 ++++++++
 .../sagemath/patches/35635-sympy_1.12.patch   |   54 +
 srcpkgs/sagemath/patches/get_patches          |   46 +-
 srcpkgs/sagemath/template                     |    7 +-
 23 files changed, 834 insertions(+), 2469 deletions(-)
 delete mode 100644 srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
 delete mode 100644 srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
 delete mode 100644 srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
 delete mode 100644 srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
 delete mode 100644 srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
 delete mode 100644 srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
 delete mode 100644 srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
 delete mode 100644 srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
 delete mode 100644 srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
 delete mode 100644 srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
 delete mode 100644 srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
 delete mode 100644 srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
 delete mode 100644 srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
 delete mode 100644 srcpkgs/sagemath/patches/35423-ipython_8.12.patch
 delete mode 100644 srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
 create mode 100644 srcpkgs/sagemath/patches/35612-linbox_1.7.0.patch
 create mode 100644 srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch
 create mode 100644 srcpkgs/sagemath/patches/35635-sympy_1.12.patch

diff --git a/srcpkgs/sagemath/files/sage_conf.py b/srcpkgs/sagemath/files/sage_conf.py
index 00de40f1ee4f..bc5388de8956 100644
--- a/srcpkgs/sagemath/files/sage_conf.py
+++ b/srcpkgs/sagemath/files/sage_conf.py
@@ -1,4 +1,3 @@
 # configuration for sage on void linux
 SAGE_SHARE = "/usr/share/sagemath"
 GAP_SHARE_DIR = "/usr/share/gap"
-GAP_LIB_DIR = "/usr/lib/gap"
diff --git a/srcpkgs/sagemath/files/timings2.json b/srcpkgs/sagemath/files/timings2.json
index bb3098680502..b2b3fe818a20 100644
--- a/srcpkgs/sagemath/files/timings2.json
+++ b/srcpkgs/sagemath/files/timings2.json
@@ -1,281 +1,152 @@
 {
-  "doc.ca.intro.index": {"walltime": 8},
-  "doc.en.constructions.calculus": {"walltime": 64},
-  "doc.en.constructions.plotting": {"walltime": 32},
-  "doc.en.prep.Advanced-2DPlotting": {"walltime": 16},
-  "doc.en.prep.Calculus": {"walltime": 8},
-  "doc.en.prep.Symbolics-and-Basic-Plotting": {"walltime": 8},
-  "doc.en.thematic_tutorials.explicit_methods_in_number_theory.birds_other": {"walltime": 8},
-  "doc.en.thematic_tutorials.explicit_methods_in_number_theory.elliptic_curves": {"walltime": 8},
-  "doc.en.thematic_tutorials.geometry.polyhedra_tutorial": {"walltime": 16},
-  "doc.en.thematic_tutorials.sandpile": {"walltime": 16},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_advanced": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_cartesian": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_change": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_curvilinear": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_plane": {"walltime": 16},
-  "doc.ja.tutorial.tour_plotting": {"walltime": 8},
-  "sage.algebras.cluster_algebra": {"walltime": 8},
   "sage.algebras.commutative_dga": {"walltime": 16},
-  "sage.algebras.hecke_algebras.ariki_koike_algebra": {"walltime": 8},
-  "sage.algebras.iwahori_hecke_algebra": {"walltime": 8},
-  "sage.algebras.lie_algebras.classical_lie_algebra": {"walltime": 128},
-  "sage.algebras.lie_algebras.nilpotent_lie_algebra": {"walltime": 16},
-  "sage.algebras.quantum_clifford": {"walltime": 16},
-  "sage.algebras.quantum_groups.fock_space": {"walltime": 8},
-  "sage.algebras.quatalg.quaternion_algebra": {"walltime": 8},
-  "sage.algebras.steenrod.steenrod_algebra": {"walltime": 64},
-  "sage.algebras.steenrod.steenrod_algebra_bases": {"walltime": 8},
-  "sage.algebras.yangian": {"walltime": 8},
-  "sage.arith.misc": {"walltime": 32},
+  "sage.algebras.fusion_rings.f_matrix": {"walltime": 16},
+  "sage.algebras.fusion_rings.fusion_ring": {"walltime": 16},
+  "sage.algebras.hecke_algebras.cubic_hecke_algebra": {"walltime": 8},
+  "sage.algebras.lie_conformal_algebras.n2_lie_conformal_algebra": {"walltime": 8},
+  "sage.algebras.quantum_clifford": {"walltime": 8},
+  "sage.algebras.steenrod.steenrod_algebra": {"walltime": 8},
   "sage.calculus.calculus": {"walltime": 16},
   "sage.calculus.desolvers": {"walltime": 8},
-  "sage.calculus.functional": {"walltime": 8},
-  "sage.calculus.riemann": {"walltime": 64},
-  "sage.calculus.tests": {"walltime": 16},
-  "sage.calculus.transforms.dwt": {"walltime": 16},
+  "sage.calculus.riemann": {"walltime": 8},
   "sage.calculus.transforms.fft": {"walltime": 8},
   "sage.categories.coxeter_groups": {"walltime": 8},
-  "sage.categories.finite_monoids": {"walltime": 16},
-  "sage.categories.lie_conformal_algebras": {"walltime": 8},
+  "sage.categories.finite_monoids": {"walltime": 8},
   "sage.categories.loop_crystals": {"walltime": 8},
-  "sage.categories.pushout": {"walltime": 8},
-  "sage.categories.super_hopf_algebras_with_basis": {"walltime": 32},
-  "sage.categories.super_lie_conformal_algebras": {"walltime": 8},
-  "sage.coding.ag_code": {"walltime": 64},
-  "sage.coding.ag_code_decoders": {"walltime": 128},
-  "sage.coding.binary_code": {"walltime": 8},
-  "sage.coding.linear_code": {"walltime": 16},
-  "sage.combinat.backtrack": {"walltime": 32},
-  "sage.combinat.chas.wqsym": {"walltime": 32},
-  "sage.combinat.cluster_algebra_quiver.cluster_seed": {"walltime": 64},
-  "sage.combinat.cluster_algebra_quiver.quiver": {"walltime": 128},
-  "sage.combinat.crystals.affine_factorization": {"walltime": 16},
-  "sage.combinat.crystals.alcove_path": {"walltime": 32},
-  "sage.combinat.crystals.highest_weight_crystals": {"walltime": 8},
-  "sage.combinat.crystals.kirillov_reshetikhin": {"walltime": 16},
-  "sage.combinat.crystals.letters": {"walltime": 8},
-  "sage.combinat.crystals.littelmann_path": {"walltime": 16},
-  "sage.combinat.crystals.mv_polytopes": {"walltime": 16},
-  "sage.combinat.crystals.pbw_crystal": {"walltime": 16},
-  "sage.combinat.crystals.star_crystal": {"walltime": 8},
-  "sage.combinat.designs.bibd": {"walltime": 8},
-  "sage.combinat.designs.database": {"walltime": 16},
+  "sage.coding.ag_code": {"walltime": 32},
+  "sage.coding.ag_code_decoders": {"walltime": 32},
+  "sage.coding.linear_code": {"walltime": 32},
+  "sage.combinat.designs.database": {"walltime": 8},
   "sage.combinat.designs.difference_family": {"walltime": 8},
-  "sage.combinat.designs.gen_quadrangles_with_spread": {"walltime": 128},
-  "sage.combinat.designs.orthogonal_arrays_build_recursive": {"walltime": 16},
-  "sage.combinat.designs.orthogonal_arrays_find_recursive": {"walltime": 8},
-  "sage.combinat.diagram_algebras": {"walltime": 64},
-  "sage.combinat.fqsym": {"walltime": 32},
-  "sage.combinat.free_prelie_algebra": {"walltime": 8},
-  "sage.combinat.fully_commutative_elements": {"walltime": 8},
-  "sage.combinat.grossman_larson_algebras": {"walltime": 8},
-  "sage.combinat.interval_posets": {"walltime": 8},
+  "sage.combinat.designs.orthogonal_arrays_build_recursive": {"walltime": 8},
   "sage.combinat.k_regular_sequence": {"walltime": 8},
   "sage.combinat.k_tableau": {"walltime": 16},
   "sage.combinat.matrices.hadamard_matrix": {"walltime": 8},
   "sage.combinat.multiset_partition_into_sets_ordered": {"walltime": 8},
-  "sage.combinat.ncsf_qsym.ncsf": {"walltime": 16},
-  "sage.combinat.ncsf_qsym.qsym": {"walltime": 16},
-  "sage.combinat.partition": {"walltime": 16},
-  "sage.combinat.partition_kleshchev": {"walltime": 16},
+  "sage.combinat.ncsf_qsym.ncsf": {"walltime": 8},
+  "sage.combinat.ncsf_qsym.qsym": {"walltime": 8},
+  "sage.combinat.partition": {"walltime": 8},
   "sage.combinat.partition_tuple": {"walltime": 8},
-  "sage.combinat.posets.moebius_algebra": {"walltime": 16},
+  "sage.combinat.permutation": {"walltime": 8},
   "sage.combinat.posets.posets": {"walltime": 8},
-  "sage.combinat.rigged_configurations.kr_tableaux": {"walltime": 32},
-  "sage.combinat.rigged_configurations.rigged_configurations": {"walltime": 16},
-  "sage.combinat.rigged_configurations.tensor_product_kr_tableaux": {"walltime": 16},
+  "sage.combinat.rigged_configurations.kr_tableaux": {"walltime": 8},
   "sage.combinat.root_system.associahedron": {"walltime": 8},
-  "sage.combinat.root_system.branching_rules": {"walltime": 8},
-  "sage.combinat.root_system.fusion_ring": {"walltime": 8},
-  "sage.combinat.root_system.integrable_representations": {"walltime": 16},
-  "sage.combinat.root_system.non_symmetric_macdonald_polynomials": {"walltime": 16},
-  "sage.combinat.root_system.pieri_factors": {"walltime": 8},
-  "sage.combinat.root_system.plot": {"walltime": 32},
-  "sage.combinat.root_system.root_lattice_realization_algebras": {"walltime": 16},
-  "sage.combinat.root_system.root_lattice_realizations": {"walltime": 16},
-  "sage.combinat.root_system.root_system": {"walltime": 8},
-  "sage.combinat.root_system.weyl_group": {"walltime": 8},
-  "sage.combinat.rsk": {"walltime": 32},
-  "sage.combinat.sf.classical": {"walltime": 16},
-  "sage.combinat.sf.jack": {"walltime": 16},
-  "sage.combinat.sf.k_dual": {"walltime": 16},
-  "sage.combinat.sf.llt": {"walltime": 16},
-  "sage.combinat.sf.macdonald": {"walltime": 64},
-  "sage.combinat.sf.new_kschur": {"walltime": 8},
-  "sage.combinat.sf.sfa": {"walltime": 32},
-  "sage.combinat.shifted_primed_tableau": {"walltime": 16},
+  "sage.combinat.root_system.non_symmetric_macdonald_polynomials": {"walltime": 8},
+  "sage.combinat.root_system.plot": {"walltime": 16},
+  "sage.combinat.root_system.root_lattice_realizations": {"walltime": 8},
+  "sage.combinat.rsk": {"walltime": 8},
+  "sage.combinat.sf.k_dual": {"walltime": 8},
+  "sage.combinat.sf.sf": {"walltime": 8},
+  "sage.combinat.sf.sfa": {"walltime": 8},
+  "sage.combinat.shifted_primed_tableau": {"walltime": 8},
   "sage.combinat.skew_tableau": {"walltime": 8},
-  "sage.combinat.symmetric_group_algebra": {"walltime": 16},
-  "sage.combinat.tableau": {"walltime": 32},
-  "sage.combinat.tableau_tuple": {"walltime": 32},
-  "sage.combinat.tiling": {"walltime": 16},
-  "sage.combinat.tutorial": {"walltime": 16},
-  "sage.combinat.words.paths": {"walltime": 64},
-  "sage.crypto.block_cipher.des": {"walltime": 16},
-  "sage.crypto.mq.sr": {"walltime": 64},
-  "sage.crypto.sbox": {"walltime": 16},
+  "sage.combinat.species.generating_series": {"walltime": 8},
+  "sage.combinat.tableau": {"walltime": 8},
+  "sage.combinat.tableau_tuple": {"walltime": 8},
+  "sage.combinat.tiling": {"walltime": 8},
+  "sage.combinat.tutorial": {"walltime": 8},
   "sage.crypto.sboxes": {"walltime": 8},
   "sage.doctest.forker": {"walltime": 16},
-  "sage.doctest.sources": {"walltime": 64},
-  "sage.doctest.test": {"walltime": 128},
-  "sage.dynamics.arithmetic_dynamics.projective_ds": {"walltime": 64},
-  "sage.dynamics.arithmetic_dynamics.wehlerK3": {"walltime": 8},
-  "sage.dynamics.cellular_automata.glca": {"walltime": 8},
+  "sage.dynamics.arithmetic_dynamics.projective_ds": {"walltime": 32},
   "sage.dynamics.cellular_automata.solitons": {"walltime": 8},
-  "sage.dynamics.complex_dynamics.mandel_julia": {"walltime": 16},
   "sage.functions.bessel": {"walltime": 16},
-  "sage.functions.exp_integral": {"walltime": 8},
   "sage.functions.hypergeometric": {"walltime": 8},
+  "sage.functions.orthogonal_polys": {"walltime": 8},
   "sage.functions.other": {"walltime": 16},
   "sage.functions.piecewise": {"walltime": 8},
-  "sage.games.quantumino": {"walltime": 8},
-  "sage.geometry.cone": {"walltime": 32},
-  "sage.geometry.fan": {"walltime": 8},
   "sage.geometry.hyperbolic_space.hyperbolic_geodesic": {"walltime": 8},
-  "sage.geometry.hyperplane_arrangement.arrangement": {"walltime": 16},
-  "sage.geometry.hyperplane_arrangement.library": {"walltime": 8},
+  "sage.geometry.hyperplane_arrangement.arrangement": {"walltime": 8},
   "sage.geometry.hyperplane_arrangement.plot": {"walltime": 8},
-  "sage.geometry.lattice_polytope": {"walltime": 16},
-  "sage.geometry.polyhedral_complex": {"walltime": 8},
-  "sage.geometry.polyhedron.base": {"walltime": 32},
-  "sage.geometry.polyhedron.library": {"walltime": 32},
-  "sage.geometry.polyhedron.plot": {"walltime": 8},
+  "sage.geometry.polyhedron.base": {"walltime": 8},
+  "sage.geometry.polyhedron.base5": {"walltime": 8},
+  "sage.geometry.polyhedron.base6": {"walltime": 16},
+  "sage.geometry.polyhedron.library": {"walltime": 16},
   "sage.geometry.riemannian_manifolds.parametrized_surface3d": {"walltime": 16},
-  "sage.geometry.triangulation.base": {"walltime": 32},
-  "sage.geometry.triangulation.point_configuration": {"walltime": 16},
-  "sage.graphs.chrompoly": {"walltime": 8},
-  "sage.graphs.connectivity": {"walltime": 16},
-  "sage.graphs.generators.basic": {"walltime": 16},
-  "sage.graphs.generators.classical_geometries": {"walltime": 32},
-  "sage.graphs.generators.distance_regular": {"walltime": 256},
-  "sage.graphs.generators.families": {"walltime": 32},
-  "sage.graphs.generators.smallgraphs": {"walltime": 16},
-  "sage.graphs.generic_graph": {"walltime": 32},
-  "sage.graphs.genus": {"walltime": 16},
+  "sage.graphs.connectivity": {"walltime": 8},
+  "sage.graphs.generators.classical_geometries": {"walltime": 8},
+  "sage.graphs.generators.distance_regular": {"walltime": 32},
+  "sage.graphs.generators.smallgraphs": {"walltime": 8},
+  "sage.graphs.generic_graph": {"walltime": 16},
   "sage.graphs.graph": {"walltime": 16},
-  "sage.graphs.graph_generators": {"walltime": 8},
   "sage.graphs.graph_list": {"walltime": 8},
   "sage.graphs.graph_plot": {"walltime": 8},
-  "sage.graphs.strongly_regular_db": {"walltime": 16},
-  "sage.groups.cubic_braid": {"walltime": 16},
-  "sage.groups.fqf_orthogonal": {"walltime": 16},
-  "sage.groups.libgap_mixin": {"walltime": 8},
-  "sage.groups.libgap_morphism": {"walltime": 8},
-  "sage.groups.lie_gps.nilpotent_lie_group": {"walltime": 16},
-  "sage.groups.matrix_gps.finitely_generated": {"walltime": 8},
-  "sage.groups.matrix_gps.heisenberg": {"walltime": 32},
-  "sage.groups.matrix_gps.linear": {"walltime": 8},
-  "sage.groups.perm_gps.cubegroup": {"walltime": 16},
-  "sage.groups.perm_gps.partn_ref.refinement_graphs": {"walltime": 8},
+  "sage.graphs.strongly_regular_db": {"walltime": 8},
+  "sage.groups.cactus_group": {"walltime": 8},
+  "sage.groups.cubic_braid": {"walltime": 8},
+  "sage.groups.lie_gps.nilpotent_lie_group": {"walltime": 8},
+  "sage.groups.matrix_gps.finitely_generated_gap": {"walltime": 8},
   "sage.groups.perm_gps.permgroup": {"walltime": 8},
   "sage.groups.perm_gps.permgroup_named": {"walltime": 8},
-  "sage.homology.hochschild_complex": {"walltime": 8},
   "sage.homology.homology_vector_space_with_basis": {"walltime": 8},
-  "sage.interacts.test_jupyter": {"walltime": 16},
-  "sage.interfaces.ecm": {"walltime": 8},
-  "sage.interfaces.expect": {"walltime": 8},
-  "sage.interfaces.gap": {"walltime": 16},
-  "sage.interfaces.maxima": {"walltime": 8},
-  "sage.interfaces.maxima_abstract": {"walltime": 64},
-  "sage.interfaces.psage": {"walltime": 8},
-  "sage.interfaces.sage0": {"walltime": 8},
-  "sage.lfunctions.zero_sums": {"walltime": 8},
-  "sage.libs.eclib.interface": {"walltime": 16},
+  "sage.interfaces.gap": {"walltime": 8},
+  "sage.interfaces.gap_workspace": {"walltime": 8},
+  "sage.interfaces.sage0": {"walltime": 16},
+  "sage.libs.eclib.interface": {"walltime": 32},
   "sage.libs.eclib.mwrank": {"walltime": 16},
-  "sage.libs.gap.test_long": {"walltime": 32},
-  "sage.libs.giac": {"walltime": 32},
   "sage.manifolds.catalog": {"walltime": 8},
-  "sage.manifolds.chart": {"walltime": 32},
+  "sage.manifolds.chart": {"walltime": 16},
   "sage.manifolds.chart_func": {"walltime": 8},
   "sage.manifolds.continuous_map": {"walltime": 8},
-  "sage.manifolds.differentiable.affine_connection": {"walltime": 128},
+  "sage.manifolds.differentiable.affine_connection": {"walltime": 32},
   "sage.manifolds.differentiable.automorphismfield": {"walltime": 32},
-  "sage.manifolds.differentiable.automorphismfield_group": {"walltime": 8},
   "sage.manifolds.differentiable.bundle_connection": {"walltime": 8},
-  "sage.manifolds.differentiable.characteristic_cohomology_class": {"walltime": 64},
+  "sage.manifolds.differentiable.characteristic_cohomology_class": {"walltime": 8},
   "sage.manifolds.differentiable.curve": {"walltime": 16},
-  "sage.manifolds.differentiable.degenerate": {"walltime": 32},
-  "sage.manifolds.differentiable.degenerate_submanifold": {"walltime": 16},
-  "sage.manifolds.differentiable.diff_form": {"walltime": 64},
+  "sage.manifolds.differentiable.degenerate": {"walltime": 16},
+  "sage.manifolds.differentiable.degenerate_submanifold": {"walltime": 8},
+  "sage.manifolds.differentiable.diff_form": {"walltime": 32},
   "sage.manifolds.differentiable.diff_map": {"walltime": 8},
   "sage.manifolds.differentiable.examples.euclidean": {"walltime": 32},
   "sage.manifolds.differentiable.examples.sphere": {"walltime": 32},
   "sage.manifolds.differentiable.integrated_curve": {"walltime": 32},
-  "sage.manifolds.differentiable.levi_civita_connection": {"walltime": 32},
-  "sage.manifolds.differentiable.manifold": {"walltime": 16},
-  "sage.manifolds.differentiable.manifold_homset": {"walltime": 16},
+  "sage.manifolds.differentiable.levi_civita_connection": {"walltime": 16},
+  "sage.manifolds.differentiable.manifold": {"walltime": 8},
+  "sage.manifolds.differentiable.manifold_homset": {"walltime": 8},
   "sage.manifolds.differentiable.metric": {"walltime": 64},
   "sage.manifolds.differentiable.mixed_form": {"walltime": 16},
-  "sage.manifolds.differentiable.mixed_form_algebra": {"walltime": 8},
   "sage.manifolds.differentiable.multivectorfield": {"walltime": 64},
-  "sage.manifolds.differentiable.pseudo_riemannian": {"walltime": 16},
-  "sage.manifolds.differentiable.pseudo_riemannian_submanifold": {"walltime": 128},
-  "sage.manifolds.differentiable.scalarfield": {"walltime": 16},
+  "sage.manifolds.differentiable.pseudo_riemannian": {"walltime": 8},
+  "sage.manifolds.differentiable.pseudo_riemannian_submanifold": {"walltime": 32},
+  "sage.manifolds.differentiable.scalarfield": {"walltime": 8},
   "sage.manifolds.differentiable.scalarfield_algebra": {"walltime": 8},
-  "sage.manifolds.differentiable.tangent_vector": {"walltime": 16},
+  "sage.manifolds.differentiable.tangent_vector": {"walltime": 8},
   "sage.manifolds.differentiable.tensorfield": {"walltime": 128},
   "sage.manifolds.differentiable.tensorfield_paral": {"walltime": 16},
-  "sage.manifolds.differentiable.vector_bundle": {"walltime": 16},
-  "sage.manifolds.differentiable.vectorfield": {"walltime": 64},
-  "sage.manifolds.differentiable.vectorframe": {"walltime": 8},
+  "sage.manifolds.differentiable.vectorfield": {"walltime": 16},
   "sage.manifolds.point": {"walltime": 16},
   "sage.manifolds.scalarfield": {"walltime": 16},
-  "sage.manifolds.scalarfield_algebra": {"walltime": 8},
-  "sage.manifolds.section": {"walltime": 32},
-  "sage.manifolds.trivialization": {"walltime": 8},
-  "sage.manifolds.vector_bundle": {"walltime": 8},
-  "sage.matrix.benchmark": {"walltime": 8},
+  "sage.manifolds.section": {"walltime": 16},
   "sage.matrix.matrix2": {"walltime": 16},
-  "sage.matrix.matrix_integer_dense": {"walltime": 16},
-  "sage.matrix.matrix_integer_dense_hnf": {"walltime": 32},
-  "sage.matrix.matrix_mod2_dense": {"walltime": 8},
   "sage.matrix.matrix_rational_dense": {"walltime": 8},
   "sage.matrix.special": {"walltime": 8},
-  "sage.matroids.catalog": {"walltime": 64},
   "sage.misc.cachefunc": {"walltime": 16},
-  "sage.misc.cython": {"walltime": 8},
   "sage.misc.functional": {"walltime": 8},
   "sage.misc.randstate": {"walltime": 16},
-  "sage.misc.sagedoc": {"walltime": 64},
-  "sage.misc.sageinspect": {"walltime": 32},
-  "sage.modular.abvar.abvar": {"walltime": 16},
+  "sage.misc.sagedoc": {"walltime": 16},
+  "sage.misc.sageinspect": {"walltime": 16},
+  "sage.misc.trace": {"walltime": 8},
+  "sage.modular.abvar.abvar": {"walltime": 8},
   "sage.modular.abvar.homspace": {"walltime": 8},
-  "sage.modular.abvar.lseries": {"walltime": 8},
-  "sage.modular.arithgroup.arithgroup_perm": {"walltime": 8},
-  "sage.modular.arithgroup.tests": {"walltime": 8},
-  "sage.modular.btquotients.pautomorphicform": {"walltime": 32},
-  "sage.modular.hypergeometric_motive": {"walltime": 16},
-  "sage.modular.local_comp.local_comp": {"walltime": 32},
-  "sage.modular.local_comp.type_space": {"walltime": 16},
-  "sage.modular.modform.ambient_R": {"walltime": 16},
-  "sage.modular.modform.constructor": {"walltime": 8},
-  "sage.modular.modform.cuspidal_submodule": {"walltime": 16},
-  "sage.modular.modform.element": {"walltime": 64},
-  "sage.modular.modform.ring": {"walltime": 64},
-  "sage.modular.modform.space": {"walltime": 8},
+  "sage.modular.btquotients.btquotient": {"walltime": 8},
+  "sage.modular.btquotients.pautomorphicform": {"walltime": 16},
+  "sage.modular.hecke.submodule": {"walltime": 8},
+  "sage.modular.hypergeometric_motive": {"walltime": 8},
+  "sage.modular.local_comp.local_comp": {"walltime": 16},
+  "sage.modular.local_comp.type_space": {"walltime": 8},
+  "sage.modular.modform.element": {"walltime": 32},
   "sage.modular.modform_hecketriangle.abstract_space": {"walltime": 16},
   "sage.modular.modform_hecketriangle.graded_ring_element": {"walltime": 16},
   "sage.modular.modform_hecketriangle.hecke_triangle_group_element": {"walltime": 32},
   "sage.modular.modform_hecketriangle.readme": {"walltime": 16},
-  "sage.modular.modform_hecketriangle.space": {"walltime": 8},
   "sage.modular.modsym.ambient": {"walltime": 16},
   "sage.modular.modsym.space": {"walltime": 8},
-  "sage.modular.pollack_stevens.modsym": {"walltime": 64},
-  "sage.modular.pollack_stevens.padic_lseries": {"walltime": 32},
-  "sage.modules.finite_submodule_iter": {"walltime": 16},
-  "sage.modules.free_module": {"walltime": 16},
-  "sage.modules.free_module_element": {"walltime": 8},
-  "sage.modules.free_module_integer": {"walltime": 32},
-  "sage.modules.free_quadratic_module_integer_symmetric": {"walltime": 8},
-  "sage.modules.torsion_quadratic_module": {"walltime": 16},
+  "sage.modular.overconvergent.genus0": {"walltime": 8},
+  "sage.modular.pollack_stevens.modsym": {"walltime": 8},
+  "sage.modules.fp_graded.morphism": {"walltime": 8},
+  "sage.modules.free_module": {"walltime": 8},
   "sage.parallel.map_reduce": {"walltime": 8},
-  "sage.plot.animate": {"walltime": 16},
-  "sage.plot.arrow": {"walltime": 8},
-  "sage.plot.circle": {"walltime": 8},
-  "sage.plot.complex_plot": {"walltime": 8},
+  "sage.plot.complex_plot": {"walltime": 16},
   "sage.plot.contour_plot": {"walltime": 32},
-  "sage.plot.density_plot": {"walltime": 8},
   "sage.plot.graphics": {"walltime": 32},
   "sage.plot.line": {"walltime": 8},
   "sage.plot.matrix_plot": {"walltime": 16},
@@ -283,115 +154,53 @@
   "sage.plot.plot": {"walltime": 64},
   "sage.plot.plot3d.base": {"walltime": 8},
   "sage.plot.plot3d.implicit_plot3d": {"walltime": 16},
-  "sage.plot.plot3d.implicit_surface": {"walltime": 8},
-  "sage.plot.plot3d.parametric_plot3d": {"walltime": 8},
+  "sage.plot.plot3d.parametric_plot3d": {"walltime": 16},
   "sage.plot.plot3d.parametric_surface": {"walltime": 8},
   "sage.plot.plot3d.plot3d": {"walltime": 16},
-  "sage.plot.plot3d.tachyon": {"walltime": 8},
-  "sage.plot.plot3d.transform": {"walltime": 32},
   "sage.plot.point": {"walltime": 8},
   "sage.plot.polygon": {"walltime": 8},
   "sage.plot.streamline_plot": {"walltime": 8},
-  "sage.quadratic_forms.genera.genus": {"walltime": 16},
-  "sage.quadratic_forms.quadratic_form__automorphisms": {"walltime": 8},
-  "sage.quadratic_forms.quadratic_form__local_representation_conditions": {"walltime": 64},
-  "sage.quadratic_forms.quadratic_form__neighbors": {"walltime": 8},
-  "sage.quadratic_forms.quadratic_form__siegel_product": {"walltime": 8},
   "sage.repl.ipython_extension": {"walltime": 8},
-  "sage.rings.asymptotic.asymptotic_expansion_generators": {"walltime": 64},
+  "sage.rings.asymptotic.asymptotic_expansion_generators": {"walltime": 16},
   "sage.rings.asymptotic.asymptotic_ring": {"walltime": 8},
-  "sage.rings.asymptotic.asymptotics_multivariate_generating_functions": {"walltime": 32},
-  "sage.rings.asymptotic.term_monoid": {"walltime": 8},
-  "sage.rings.continued_fraction": {"walltime": 8},
+  "sage.rings.asymptotic.asymptotics_multivariate_generating_functions": {"walltime": 8},
   "sage.rings.finite_rings.finite_field_base": {"walltime": 8},
-  "sage.rings.function_field.function_field": {"walltime": 128},
-  "sage.rings.function_field.function_field_valuation": {"walltime": 64},
+  "sage.rings.function_field.function_field": {"walltime": 8},
   "sage.rings.function_field.ideal": {"walltime": 8},
-  "sage.rings.function_field.place": {"walltime": 8},
-  "sage.rings.integer": {"walltime": 64},
-  "sage.rings.invariants.invariant_theory": {"walltime": 8},
-  "sage.rings.number_field.bdd_height": {"walltime": 8},
-  "sage.rings.number_field.number_field": {"walltime": 64},
-  "sage.rings.number_field.number_field_element": {"walltime": 16},
-  "sage.rings.number_field.splitting_field": {"walltime": 8},
-  "sage.rings.number_field.totallyreal": {"walltime": 16},
-  "sage.rings.number_field.totallyreal_rel": {"walltime": 8},
-  "sage.rings.padics.padic_base_leaves": {"walltime": 64},
-  "sage.rings.padics.padic_extension_leaves": {"walltime": 64},
-  "sage.rings.padics.padic_generic_element": {"walltime": 16},
-  "sage.rings.padics.padic_lattice_element": {"walltime": 32},
-  "sage.rings.padics.relative_extension_leaves": {"walltime": 32},
+  "sage.rings.lazy_series": {"walltime": 8},
+  "sage.rings.lazy_series_ring": {"walltime": 32},
+  "sage.rings.number_field.number_field": {"walltime": 32},
+  "sage.rings.number_field.number_field_element": {"walltime": 8},
+  "sage.rings.padics.padic_base_leaves": {"walltime": 8},
+  "sage.rings.padics.padic_generic_element": {"walltime": 8},
   "sage.rings.polynomial.multi_polynomial_ideal": {"walltime": 8},
-  "sage.rings.polynomial.multi_polynomial_sequence": {"walltime": 8},
-  "sage.rings.polynomial.ore_function_element": {"walltime": 8},
   "sage.rings.polynomial.polynomial_element": {"walltime": 16},
-  "sage.rings.polynomial.polynomial_rational_flint": {"walltime": 8},
   "sage.rings.qqbar": {"walltime": 16},
-  "sage.rings.tests": {"walltime": 16},
-  "sage.rings.valuation.augmented_valuation": {"walltime": 32},
-  "sage.rings.valuation.mapped_valuation": {"walltime": 64},
-  "sage.rings.valuation.valuation": {"walltime": 8},
-  "sage.sandpiles.sandpile": {"walltime": 16},
+  "sage.sandpiles.sandpile": {"walltime": 8},
   "sage.schemes.curves.affine_curve": {"walltime": 16},
   "sage.schemes.curves.closed_point": {"walltime": 8},
   "sage.schemes.curves.projective_curve": {"walltime": 32},
-  "sage.schemes.cyclic_covers.cycliccover_finite_field": {"walltime": 64},
   "sage.schemes.elliptic_curves.BSD": {"walltime": 8},
   "sage.schemes.elliptic_curves.Qcurves": {"walltime": 8},
-  "sage.schemes.elliptic_curves.constructor": {"walltime": 32},
-  "sage.schemes.elliptic_curves.ell_curve_isogeny": {"walltime": 16},
-  "sage.schemes.elliptic_curves.ell_egros": {"walltime": 32},
-  "sage.schemes.elliptic_curves.ell_finite_field": {"walltime": 8},
+  "sage.schemes.elliptic_curves.ell_curve_isogeny": {"walltime": 8},
   "sage.schemes.elliptic_curves.ell_generic": {"walltime": 8},
-  "sage.schemes.elliptic_curves.ell_modular_symbols": {"walltime": 16},
-  "sage.schemes.elliptic_curves.ell_number_field": {"walltime": 128},
+  "sage.schemes.elliptic_curves.ell_modular_symbols": {"walltime": 8},
   "sage.schemes.elliptic_curves.ell_point": {"walltime": 8},
-  "sage.schemes.elliptic_curves.ell_rational_field": {"walltime": 128},
-  "sage.schemes.elliptic_curves.gal_reps_number_field": {"walltime": 32},
-  "sage.schemes.elliptic_curves.gp_simon": {"walltime": 16},
-  "sage.schemes.elliptic_curves.heegner": {"walltime": 32},
-  "sage.schemes.elliptic_curves.height": {"walltime": 64},
-  "sage.schemes.elliptic_curves.isogeny_class": {"walltime": 32},
-  "sage.schemes.elliptic_curves.isogeny_small_degree": {"walltime": 64},
-  "sage.schemes.elliptic_curves.kraus": {"walltime": 16},
+  "sage.schemes.elliptic_curves.ell_rational_field": {"walltime": 32},
+  "sage.schemes.elliptic_curves.height": {"walltime": 8},
+  "sage.schemes.elliptic_curves.isogeny_small_degree": {"walltime": 16},
   "sage.schemes.elliptic_curves.mod_sym_num": {"walltime": 8},
   "sage.schemes.elliptic_curves.padic_lseries": {"walltime": 8},
-  "sage.schemes.elliptic_curves.padics": {"walltime": 16},
-  "sage.schemes.elliptic_curves.saturation": {"walltime": 16},
-  "sage.schemes.elliptic_curves.sha_tate": {"walltime": 32},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_finite_field": {"walltime": 64},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_generic": {"walltime": 8},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_padic_field": {"walltime": 32},
-  "sage.schemes.hyperelliptic_curves.monsky_washnitzer": {"walltime": 8},
-  "sage.schemes.projective.projective_rational_point": {"walltime": 8},
-  "sage.schemes.riemann_surfaces.riemann_surface": {"walltime": 64},
+  "sage.schemes.elliptic_curves.padics": {"walltime": 8},
+  "sage.schemes.elliptic_curves.sha_tate": {"walltime": 16},
+  "sage.schemes.hyperelliptic_curves.hyperelliptic_padic_field": {"walltime": 16},
+  "sage.schemes.riemann_surfaces.riemann_surface": {"walltime": 32},
   "sage.schemes.toric.chow_group": {"walltime": 8},
-  "sage.schemes.toric.sheaf.klyachko": {"walltime": 8},
-  "sage.stats.distributions.discrete_gaussian_integer": {"walltime": 8},
-  "sage.stats.time_series": {"walltime": 8},
-  "sage.structure.coerce_dict": {"walltime": 32},
   "sage.structure.element": {"walltime": 16},
-  "sage.structure.sage_object": {"walltime": 8},
   "sage.symbolic.expression": {"walltime": 32},
-  "sage.symbolic.integration.integral": {"walltime": 32},
-  "sage.symbolic.random_tests": {"walltime": 32},
+  "sage.symbolic.integration.integral": {"walltime": 16},
   "sage.symbolic.relation": {"walltime": 8},
-  "sage.tests.book_schilling_zabrocki_kschur_primer": {"walltime": 32},
-  "sage.tests.book_stein_ent": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.combinat_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.float_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.graphique_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.graphtheory_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.integration_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.mpoly_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.nonlinear_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.recequadiff_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.graphique_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.numbertheory_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.polynomes_doctest": {"walltime": 16},
-  "sage.tests.cmdline": {"walltime": 64},
-  "sage.tests.gosper-sum": {"walltime": 16},
-  "sage.tests.parigp": {"walltime": 8},
-  "sage.topology.simplicial_complex": {"walltime": 8},
-  "sage.topology.simplicial_complex_examples": {"walltime": 16}
+  "sage.tests.book_schilling_zabrocki_kschur_primer": {"walltime": 16},
+  "sage.tests.book_stein_ent": {"walltime": 8},
+  "sage.topology.simplicial_complex": {"walltime": 16}
 }
diff --git a/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch b/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
deleted file mode 100644
index f2f825e4fb10..000000000000
--- a/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
+++ /dev/null
@@ -1,205 +0,0 @@
-diff --git a/build/pkgs/singular/checksums.ini b/build/pkgs/singular/checksums.ini
-index 2e33a405d36..313463d2fea 100644
---- a/build/pkgs/singular/checksums.ini
-+++ b/build/pkgs/singular/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=singular-VERSION.tar.gz
--sha1=6c2b622d3681e2de3d58d30c654d43d3e32b720c
--md5=abb1e37c794472e7760655358ab66054
--cksum=17455733
-+sha1=28bb3ee97ef48d04dfa96de182fd93eebe08426c
-+md5=fc0a4f5720dadba45a52ee94324ce00c
-+cksum=1573851737
- upstream_url=ftp://jim.mathematik.uni-kl.de/pub/Math/Singular/SOURCES/4-3-1/singular-VERSION.tar.gz
-diff --git a/build/pkgs/singular/package-version.txt b/build/pkgs/singular/package-version.txt
-index 11300c77e7d..66e2bede53a 100644
---- a/build/pkgs/singular/package-version.txt
-+++ b/build/pkgs/singular/package-version.txt
-@@ -1 +1 @@
--4.3.1p1
-+4.3.1p3
-diff --git a/src/sage/libs/singular/decl.pxd b/src/sage/libs/singular/decl.pxd
-index 8e3ac314b67..747a6b1e2fb 100644
---- a/src/sage/libs/singular/decl.pxd
-+++ b/src/sage/libs/singular/decl.pxd
-@@ -574,7 +574,7 @@ cdef extern from "singular/Singular/libsingular.h":
- 
-     # gets a component out of a polynomial vector
- 
--    poly *pTakeOutComp1(poly **, int)
-+    poly *pTakeOutComp(poly **, int)
- 
-     # deep copy p
- 
-diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx
-index d8ea7b07f3c..3a1271cd59f 100644
---- a/src/sage/libs/singular/singular.pyx
-+++ b/src/sage/libs/singular/singular.pyx
-@@ -1726,20 +1726,21 @@ cdef int overflow_check(unsigned long e, ring *_ring) except -1:
- 
-     Whether an overflow occurs or not partially depends
-     on the number of variables in the ring. See trac ticket
--    :trac:`11856`. With Singular 4, it is by default optimized
--    for at least 4 variables on 64-bit and 2 variables on 32-bit,
--    which in both cases makes a maximal default exponent of
--    2^16-1.
-+    :trac:`11856`.
- 
-     EXAMPLES::
- 
-         sage: P.<x,y> = QQ[]
--        sage: y^(2^16-1)
--        y^65535
--        sage: y^2^16
-+        sage: y^(2^30)
-+        Traceback (most recent call last):             # 32-bit
-+        ...                                            # 32-bit
-+        OverflowError: exponent overflow (1073741824)  # 32-bit
-+        y^1073741824  # 64-bit
-+        sage: y^2^32
-         Traceback (most recent call last):
-         ...
--        OverflowError: exponent overflow (65536)
-+        OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+        OverflowError: exponent overflow (4294967296)  # 64-bit
-     """
-     if unlikely(e > _ring.bitmask):
-         raise OverflowError("exponent overflow (%d)"%(e))
-diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py
-index 7dc058a22f0..71494eddbc0 100644
---- a/src/sage/rings/polynomial/multi_polynomial_ideal.py
-+++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py
-@@ -60,7 +60,7 @@
- Note that the result of a computation is not necessarily reduced::
- 
-     sage: (a+b)^17
--    256*a*b^16 + 256*b^17
-+    a*b^16 + b^17
-     sage: S(17) == 0
-     True
- 
-diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-index 4dad016b33f..9bf67dd1425 100644
---- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-+++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-@@ -193,7 +193,7 @@ from sage.libs.singular.decl cimport (
-     p_IsUnit, p_IsOne, p_Series, p_Head, idInit, fast_map_common_subexp, id_Delete,
-     p_IsHomogeneous, p_Homogen, p_Totaldegree,pLDeg1_Totaldegree, singclap_pdivide, singclap_factorize,
-     idLift, IDELEMS, On, Off, SW_USE_CHINREM_GCD, SW_USE_EZGCD,
--    p_LmIsConstant, pTakeOutComp1, singclap_gcd, pp_Mult_qq, p_GetMaxExp,
-+    p_LmIsConstant, pTakeOutComp, singclap_gcd, pp_Mult_qq, p_GetMaxExp,
-     pLength, kNF, p_Neg, p_Minus_mm_Mult_qq, p_Plus_mm_Mult_qq,
-     pDiff, singclap_resultant, p_Normalize,
-     prCopyR, prCopyR_NoSort)
-@@ -1587,7 +1587,8 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_base):
-             9/4
- 
-             sage: P.monomial_quotient(x,y) # Note the wrong result
--            x*y^65535*z^65535
-+            x*y^65535*z^65535      # 32-bit
-+            x*y^1048575*z^1048575  # 64-bit
- 
-             sage: P.monomial_quotient(x,P(1))
-             x
-@@ -2247,10 +2248,11 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             9/4*x^2 - 1/4*y^2 - y - 1
- 
-             sage: P.<x,y> = PolynomialRing(QQ,order='lex')
--            sage: (x^2^15) * x^2^15
-+            sage: (x^2^32) * x^2^32
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (...)
-+            OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+            OverflowError: exponent overflow (...)  # 64-bit
-         """
-         # all currently implemented rings are commutative
-         cdef poly *_p
-@@ -2371,10 +2373,11 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             ValueError: not a 2nd power
- 
-             sage: P.<x,y> = PolynomialRing(QQ,order='lex')
--            sage: (x+y^2^15)^10
-+            sage: (x+y^2^32)^10
-             Traceback (most recent call last):
-             ....
--            OverflowError: exponent overflow (...)
-+            OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+            OverflowError: exponent overflow (...)  # 64-bit
- 
-         Test fractional powers (:trac:`22329`)::
- 
-@@ -3461,7 +3464,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             x^10000
-             no overflow
- 
--            sage: n = 1000
-+            sage: n = 100000
-             sage: try:
-             ....:     f = x^n
-             ....:     f.subs(x = x^n)
-@@ -4567,7 +4570,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
-         l = []
-         for i from 0 <= i < IDELEMS(res):
-             for j from 1 <= j <= IDELEMS(_I):
--                l.append( new_MP(parent, pTakeOutComp1(&res.m[i], j)) )
-+                l.append( new_MP(parent, pTakeOutComp(&res.m[i], 1)) )
- 
-         id_Delete(&fI, r)
-         id_Delete(&_I, r)
-@@ -4635,7 +4638,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
- 
-             sage: f = 3*x
-             sage: f.reduce([2*x,y])
--            3*x
-+            x
- 
-         The reduction is not canonical when ``I`` is not a Groebner
-         basis::
-diff --git a/src/sage/rings/polynomial/plural.pyx b/src/sage/rings/polynomial/plural.pyx
-index 1c9f35e56ba..587511c3888 100644
---- a/src/sage/rings/polynomial/plural.pyx
-+++ b/src/sage/rings/polynomial/plural.pyx
-@@ -1619,10 +1619,10 @@ cdef class NCPolynomial_plural(RingElement):
-             sage: P = A.g_algebra(relations={y*x:-x*y + z},  order='lex')
-             sage: P.inject_variables()
-             Defining x, z, y
--            sage: (x^2^15) * x^2^15
-+            sage: (x^2^31) * x^2^31
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (65536)
-+            OverflowError: exponent overflow (2147483648)
-         """
-         # all currently implemented rings are commutative
-         cdef poly *_p
-@@ -1689,10 +1689,10 @@ cdef class NCPolynomial_plural(RingElement):
-             sage: P = A.g_algebra(relations={y*x:-x*y + z},  order='lex')
-             sage: P.inject_variables()
-             Defining x, z, y
--            sage: (x+y^2^15)^10
-+            sage: (x+y^2^31)^10
-             Traceback (most recent call last):
-             ....
--            OverflowError: exponent overflow (327680)
-+            OverflowError: exponent overflow (2147483648)
-         """
-         if type(exp) is not Integer:
-             try:
-diff --git a/src/sage/structure/element.pyx b/src/sage/structure/element.pyx
-index b5d83ef71b6..5c45b3fb528 100644
---- a/src/sage/structure/element.pyx
-+++ b/src/sage/structure/element.pyx
-@@ -2705,10 +2705,10 @@ cdef class RingElement(ModuleElement):
-         with Singular 4::
- 
-             sage: K.<x,y> = ZZ[]
--            sage: (x^12345)^54321
-+            sage: (x^123456)^654321
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (670592745)
-+            OverflowError: exponent overflow (...)
-         """
-         return arith_generic_power(self, n)
- 
diff --git a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch b/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
deleted file mode 100644
index ee0f0e656b28..000000000000
--- a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py
-index d5f7157217f..8ca1f958039 100644
---- a/src/sage/rings/number_field/number_field_ideal.py
-+++ b/src/sage/rings/number_field/number_field_ideal.py
-@@ -996,16 +996,38 @@ def is_prime(self):
-             False
-             sage: K.ideal(17).is_prime()  # ramified
-             False
-+
-+        TESTS:
-+
-+        Check that we do not factor the norm of the ideal, this used
-+        to take half an hour, see :trac:`33360`::
-+
-+            sage: K.<a,b,c> = NumberField([x^2-2,x^2-3,x^2-5])
-+            sage: t = (((-2611940*c + 1925290/7653)*b - 1537130/7653*c
-+            ....:       + 10130950)*a + (1343014/7653*c - 8349770)*b
-+            ....:       + 6477058*c - 2801449990/4002519)
-+            sage: t.is_prime()
-+            False
-         """
-         try:
-             return self._pari_prime is not None
-         except AttributeError:
--            F = self.factor()  # factorization with caching
--            if len(F) != 1 or F[0][1] != 1:
--                self._pari_prime = None
--            else:
--                self._pari_prime = F[0][0]._pari_prime
--            return self._pari_prime is not None
-+            pass
-+
-+        K = self.number_field().pari_nf()
-+        I = self.pari_hnf()
-+
-+        candidate = K.idealismaximal(I) or None
-+
-+        # PARI uses probabilistic primality testing inside idealismaximal().
-+        if get_flag(None, 'arithmetic'):
-+            # proof required, check using isprime()
-+            if candidate and not candidate[0].isprime():
-+                candidate = None
-+
-+        self._pari_prime = candidate
-+
-+        return self._pari_prime is not None
- 
-     def pari_prime(self):
-         r"""
diff --git a/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch b/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
deleted file mode 100644
index 91f06fd4d173..000000000000
--- a/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-diff --git a/src/sage/misc/persist.pyx b/src/sage/misc/persist.pyx
-index 3ac5f1cc2b0..cb1f327c199 100644
---- a/src/sage/misc/persist.pyx
-+++ b/src/sage/misc/persist.pyx
-@@ -157,7 +157,7 @@ def load(*filename, compress=True, verbose=True, **kwargs):
-         ....:     _ = f.write(code)
-         sage: load(t)
-         sage: hello
--        <fortran object>
-+        <fortran ...>
-     """
-     import sage.repl.load
-     if len(filename) != 1:
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index 6f0aeab87ae..b77c69b2f77 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -461,6 +461,8 @@ def complex_to_rgb(z_values, contoured=False, tiled=False,
-             rgb[i, j, 2] = b
- 
-     sig_off()
-+    nan_indices = np.isnan(rgb).any(-1)     # Mask for undefined points
-+    rgb[nan_indices] = 1                    # Make nan_indices white
-     return rgb
- 
- 
-diff --git a/src/sage/plot/histogram.py b/src/sage/plot/histogram.py
-index 3bc2b76b58e..388c2d1391d 100644
---- a/src/sage/plot/histogram.py
-+++ b/src/sage/plot/histogram.py
-@@ -87,13 +87,8 @@ def get_minmax_data(self):
- 
-         TESTS::
- 
--            sage: h = histogram([10,3,5], normed=True)[0]
--            doctest:warning...:
--            DeprecationWarning: the 'normed' option is deprecated. Use 'density' instead.
--            See https://trac.sagemath.org/25260 for details.
-+            sage: h = histogram([10,3,5], density=True)[0]
-             sage: h.get_minmax_data()
--            doctest:warning ...
--            ...VisibleDeprecationWarning: Passing `normed=True` on non-uniform bins has always been broken, and computes neither the probability density function nor the probability mass function. The result is only correct if the bins are uniform, when density=True will produce the same result anyway. The argument will be removed in a future version of numpy.
-             {'xmax': 10.0, 'xmin': 3.0, 'ymax': 0.476190476190..., 'ymin': 0}
-         """
-         import numpy
-diff --git a/src/sage/repl/ipython_extension.py b/src/sage/repl/ipython_extension.py
-index 798671aab42..cad6a47ca8b 100644
---- a/src/sage/repl/ipython_extension.py
-+++ b/src/sage/repl/ipython_extension.py
-@@ -405,7 +405,7 @@ def fortran(self, line, cell):
-             ....: C END FILE FIB1.F
-             ....: ''')
-             sage: fib
--            <fortran object>
-+            <fortran ...>
-             sage: from numpy import array
-             sage: a = array(range(10), dtype=float)
-             sage: fib(a, 10)
diff --git a/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch b/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
deleted file mode 100644
index 2769e87f6a4b..000000000000
--- a/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-diff --git a/src/sage/interfaces/tachyon.py b/src/sage/interfaces/tachyon.py
-index 23671e50892..ce1d50f71bc 100644
---- a/src/sage/interfaces/tachyon.py
-+++ b/src/sage/interfaces/tachyon.py
-@@ -683,12 +683,14 @@
- #*****************************************************************************
- 
- import os
-+import re
- 
- from sage.cpython.string import bytes_to_str
- from sage.misc.pager import pager
- from sage.misc.superseded import deprecation
- from sage.misc.temporary_file import tmp_filename
- from sage.structure.sage_object import SageObject
-+from sage.misc.cachefunc import cached_method
- 
- 
- class TachyonRT(SageObject):
-@@ -799,6 +801,11 @@ def __call__(self, model, outfile='sage.png', verbose=1, extra_opts=''):
-             Parser failed due to an input file syntax error.
-             Aborting render.
-         """
-+        if self.version() >= '0.99.2':
-+            # this keyword was changed in 0.99.2
-+            model = model.replace(
-+                    "              focallength ",
-+                    "              focaldist ")
-         modelfile = tmp_filename(ext='.dat')
-         with open(modelfile, 'w') as file:
-             file.write(model)
-@@ -851,6 +858,25 @@ def usage(self, use_pager=True):
-         else:
-             print(r)
- 
-+    @cached_method
-+    def version(self):
-+        """
-+        Returns the version of the Tachyon raytracer being used.
-+
-+        TESTS::
-+
-+            sage: tachyon_rt.version()  # random
-+            0.98.9
-+            sage: tachyon_rt.version() >= '0.98.9'
-+            True
-+        """
-+        with os.popen('tachyon') as f:
-+            r = f.readline()
-+        res = re.search(r"Version ([\d.]*)", r)
-+        # debian patches tachyon so it won't report the version
-+        # we hardcode '0.99' since that's indeed the version they ship
-+        return res[1] if res else '0.99'
-+
-     def help(self, use_pager=True):
-         """
-         Deprecated: type 'sage.interfaces.tachyon?' for help
diff --git a/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch b/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
deleted file mode 100644
index 11eb20d4f735..000000000000
--- a/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff --git a/src/sage/arith/long.pxd b/src/sage/arith/long.pxd
-index 1c9a53387a0..d96b98f247c 100644
---- a/src/sage/arith/long.pxd
-+++ b/src/sage/arith/long.pxd
-@@ -270,6 +270,17 @@ cdef inline bint integer_check_long_py(x, long* value, int* err):
-         sage: L += [-x for x in L] + [0, long_min()]
-         sage: for v in L:
-         ....:     assert check_long_py(int(v)) == v
-+        sage: check_long_py(int(2^60))
-+        1152921504606846976                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^61))
-+        2305843009213693952                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^62))
-+        4611686018427387904                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^63))
-+        'Overflow (...)'
-         sage: check_long_py(int(2^100))
-         'Overflow (...)'
-         sage: check_long_py(int(long_max() + 1))
-@@ -309,7 +320,12 @@ cdef inline bint integer_check_long_py(x, long* value, int* err):
- 
-     cdef long lead
-     cdef long lead_2_overflow = (<long>1) << (BITS_IN_LONG - PyLong_SHIFT)
--    cdef long lead_3_overflow = (<long>1) << (BITS_IN_LONG - 2 * PyLong_SHIFT)
-+    cdef long lead_3_overflow
-+    if BITS_IN_LONG < 2 * PyLong_SHIFT:
-+        # in this case 3 digit is always overflow
-+        lead_3_overflow = 0
-+    else:
-+        lead_3_overflow = (<long>1) << (BITS_IN_LONG - 2 * PyLong_SHIFT)
-     if size == 0:
-         value[0] = 0
-         err[0] = 0
diff --git a/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch b/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
deleted file mode 100644
index c4d7d5c779d1..000000000000
--- a/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/src/sage/schemes/toric/sheaf/klyachko.py b/src/sage/schemes/toric/sheaf/klyachko.py
-index b1304a16913..77fae4b7545 100644
---- a/src/sage/schemes/toric/sheaf/klyachko.py
-+++ b/src/sage/schemes/toric/sheaf/klyachko.py
-@@ -26,7 +26,7 @@
-     (0, 0, 18, 16, 1)
-     sage: Gtilde = G_sum.random_deformation()
-     sage: V = Gtilde.wedge(2) * K                     # long time
--    sage: V.cohomology(dim=True, weight=(0,0,0,0))    # long time
-+    sage: V.cohomology(dim=True, weight=(0,0,0,0))    # long time  # random failure (see #32773)
-     (0, 0, 3, 0, 0)
- 
- REFERENCES:
-@@ -948,7 +948,7 @@ def random_deformation(self, epsilon=None):
-            sage: V.cohomology(dim=True, weight=(0,))
-            (1, 0)
-            sage: Vtilde = V.random_deformation()
--           sage: Vtilde.cohomology(dim=True, weight=(0,))
-+           sage: Vtilde.cohomology(dim=True, weight=(0,))  # random failure (see #32773)
-            (1, 0)
-         """
-         filt = self._filt.random_deformation(epsilon)
diff --git a/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch b/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
deleted file mode 100644
index d9a9835c696b..000000000000
--- a/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 9ac7840134054155545e24fa3e66402d42b91c0f Mon Sep 17 00:00:00 2001
-From: Antonio Rojas <arojas@archlinux.org>
-Date: Fri, 20 Jan 2023 21:36:27 +0100
-Subject: [PATCH] Fix tests with giac 1.9.0.35
-
----
- src/sage/libs/giac/giac.pyx   |  3 +--
- src/sage/symbolic/relation.py | 15 +++++----------
- 2 files changed, 6 insertions(+), 12 deletions(-)
-
-diff --git a/src/sage/libs/giac/giac.pyx b/src/sage/libs/giac/giac.pyx
-index 4e451dba5e7..ccad5169836 100644
---- a/src/sage/libs/giac/giac.pyx
-+++ b/src/sage/libs/giac/giac.pyx
-@@ -374,8 +374,7 @@ def _giac(s):
- 
-         sage: x = libgiac('x')
-         sage: (1+2*sin(3*x)).solve(x).simplify()
--        Warning, argument is not an equation, solving 1+2*sin(3*x)=0
--        list[-pi/18,7*pi/18]
-+        ...list[-pi/18,7*pi/18]
- 
-         sage: libgiac.solve('sin(3*x)>2*sin(x)',x)
-         Traceback (most recent call last):
-diff --git a/src/sage/symbolic/relation.py b/src/sage/symbolic/relation.py
-index e9dbc0fea30..b8896a94be9 100644
---- a/src/sage/symbolic/relation.py
-+++ b/src/sage/symbolic/relation.py
-@@ -935,8 +935,7 @@ def solve(f, *args, **kwds):
- 
-         sage: f = (sin(x) - 8*cos(x)*sin(x))*(sin(x)^2 + cos(x)) - (2*cos(x)*sin(x) - sin(x))*(-2*sin(x)^2 + 2*cos(x)^2 - cos(x))
-         sage: solve(f, x, algorithm='giac')
--        ...
--        [-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-+        ...[-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
- 
-         sage: x, y = SR.var('x,y')
-         sage: solve([x+y-4,x*y-3],[x,y],algorithm='giac')
-@@ -1440,19 +1439,15 @@ def _giac_solver(f, x, solution_dict=False):
-     EXAMPLES::
- 
-         sage: solve([(2/3)^x-2], [x], algorithm='giac')
--        ...
--        [[-log(2)/(log(3) - log(2))]]
-+        ...[[-log(2)/(log(3) - log(2))]]
-         sage: solve([(2/3)^x-2], [x], algorithm='giac', solution_dict=True)
--        ...
--        [{x: -log(2)/(log(3) - log(2))}]
-+        ...[{x: -log(2)/(log(3) - log(2))}]
- 
-         sage: f = (sin(x) - 8*cos(x)*sin(x))*(sin(x)^2 + cos(x)) - (2*cos(x)*sin(x) - sin(x))*(-2*sin(x)^2 + 2*cos(x)^2 - cos(x))
-         sage: solve(f, x, algorithm='giac')
--        ...
--        [-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-+        ...[-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-         sage: solve(f, x, algorithm='giac', solution_dict=True)
--        ...
--        [{x: -2*arctan(sqrt(2))}, {x: 0}, {x: 2*arctan(sqrt(2))}, {x: pi}]
-+        ...[{x: -2*arctan(sqrt(2))}, {x: 0}, {x: 2*arctan(sqrt(2))}, {x: pi}]
- 
-         sage: x, y = SR.var('x,y')
-         sage: solve([x+y-7,x*y-10],[x,y],algorithm='giac')
diff --git a/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch b/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
deleted file mode 100644
index 499e0c71e256..000000000000
--- a/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
+++ /dev/null
@@ -1,1303 +0,0 @@
-diff --git a/build/pkgs/gap/checksums.ini b/build/pkgs/gap/checksums.ini
-index 066e943308a..b0ea8ba8818 100644
---- a/build/pkgs/gap/checksums.ini
-+++ b/build/pkgs/gap/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=gap-VERSION.tar.gz
--sha1=4ecdd281b8f430282fb9b12690b06e0a26abde10
--md5=85dc9e459d5b6c66fcad9f468afd3e3e
--cksum=1351843158
-+sha1=a6e36f3f874a2c46f51561402634497eab705cca
-+md5=c5cd9f272f2703d7a3649ad7193b2d90
-+cksum=2760477284
- upstream_url=https://github.com/gap-system/gap/releases/download/vVERSION/gap-VERSION.tar.gz
-diff --git a/build/pkgs/gap/package-version.txt b/build/pkgs/gap/package-version.txt
-index d782fca8f64..f1cd7de1de5 100644
---- a/build/pkgs/gap/package-version.txt
-+++ b/build/pkgs/gap/package-version.txt
-@@ -1 +1 @@
--4.11.1
-+4.12.2
-diff --git a/build/pkgs/gap/spkg-check.in b/build/pkgs/gap/spkg-check.in
-index d9791d33293..d2fccda6e04 100644
---- a/build/pkgs/gap/spkg-check.in
-+++ b/build/pkgs/gap/spkg-check.in
-@@ -3,6 +3,13 @@ cd src
- # #28728: Fix test failure in tst/testinstall/strings.tst
- export LC_CTYPE=en_US.UTF-8
- 
-+# #34391: in GAP 4.12 some packages need GAP package io
-+#         to let tests run, otherwise this hangs. Thus we install io here.
-+cd pkg/io
-+./configure --with-gaproot=../..
-+make
-+cd ../..
-+
- make testinstall
- if [[ $? -ne 0 ]]; then
-     exit 1
-diff --git a/build/pkgs/gap/spkg-install.in b/build/pkgs/gap/spkg-install.in
-index 2ceadf99db4..e2c8b4dca54 100644
---- a/build/pkgs/gap/spkg-install.in
-+++ b/build/pkgs/gap/spkg-install.in
-@@ -8,8 +8,7 @@ export CFLAGS=$CFLAGS_NON_NATIVE
- export CXXFLAGS=$CXXFLAGS_NON_NATIVE
- 
- GAP_BUILD_ROOT="$(pwd)"
--GAP_ROOT="$SAGE_LOCAL/share/gap"
--DESTDIR_GAP_ROOT="$SAGE_DESTDIR$GAP_ROOT"
-+GAP_ROOT="$SAGE_LOCAL/lib/gap"
- 
- # Enable debug info if requested.
- # Note that -g3 allows you to use preprocessor macros in gdb which are widely used
-@@ -17,37 +16,17 @@ if [ "$SAGE_DEBUG" = yes ] ; then
-     export CFLAGS="-O0 -g3 -DDEBUG_MASTERPOINTERS -DDEBUG_GLOBAL_BAGS -DDEBUG_FUNCTIONS_BAGS $CFLAGS"
- fi
- 
--sdh_configure $SAGE_CONFIGURE_GMP
--sdh_make -j1
-+# LDFLAGS hack below needed by Semigroups package
-+sdh_configure $SAGE_CONFIGURE_GMP LDFLAGS="-pthread" --prefix=$SAGE_LOCAL
-+sdh_make
- 
--# GAP's "make install" is work in progress; we use bits and pieces of it
--# but we install many things manually.
--sdh_make install-headers install-libgap
--
--# Install config.h, which is not currently handled by `make install-headers`
--sdh_install gen/config.h "$SAGE_LOCAL/include/gap"
--
--# Now install the gap executable as "gap-bin"; it will be called normally
--# through our wrapper script that sets the appropriate GAP_ROOT
--SAGE_BIN="$SAGE_LOCAL/bin"
--mkdir -p "$SAGE_DESTDIR$SAGE_BIN" || sdh_die "Failed to create the directory $SAGE_BIN"
--
--./libtool --mode=install install gap "$SAGE_DESTDIR$SAGE_BIN/gap-bin" || \
--    sdh_die "Failed to install gap-bin to $SAGE_BIN"
--
--./libtool --mode=install install gac "$SAGE_DESTDIR$SAGE_BIN/gac" || \
--    sdh_die "Failed to install gac to $SAGE_BIN"
--
--# Now copy additional files GAP needs to run (and a few optional bits) into
--# GAP_ROOT; we don't need everything from the source tree
--sdh_install bin doc gen grp lib src tst sysinfo.gap "$GAP_ROOT"
--
--# GAP's copy of libtool is also used by the toolchain for build GAP packages
--# (i.e. by gac)
--sdh_install libtool "$GAP_ROOT"
-+sdh_make_install
-+# sdh_make install-headers install-libgap
-+# The 'packagemanager' package expects this https://github.com/gap-packages/PackageManager/issues/105
-+mkdir -p "$SAGE_LOCAL/lib/gap/bin"
- 
- # Install only the minimal packages GAP needs to run
--sdh_install pkg/GAPDoc-* pkg/primgrp-* pkg/SmallGrp-* pkg/transgrp "$GAP_ROOT"/pkg
-+sdh_install pkg/gapdoc pkg/primgrp pkg/smallgrp pkg/transgrp "$GAP_ROOT"/pkg
- 
- # Install additional packages that are not strictly required, but that are
- # typically "expected" to be loaded: These are the default packages that are
-@@ -58,50 +37,25 @@ sdh_install pkg/GAPDoc-* pkg/primgrp-* pkg/SmallGrp-* pkg/transgrp "$GAP_ROOT"/p
- # Also include atlasrep which is a dependency of tomlib
- sdh_install \
-     pkg/atlasrep \
--    pkg/autpgrp-* \
--    pkg/alnuth-* \
--    pkg/crisp-* \
--    pkg/ctbllib-* \
--    pkg/FactInt-* \
-+    pkg/autodoc \
-+    pkg/autpgrp \
-+    pkg/alnuth \
-+    pkg/crisp \
-+    pkg/ctbllib \
-+    pkg/factint \
-     pkg/fga \
--    pkg/irredsol-* \
--    pkg/laguna-* \
--    pkg/PackageManager-* \
--    pkg/polenta-* \
--    pkg/polycyclic-* \
--    pkg/resclasses-* \
--    pkg/sophus-* \
--    pkg/tomlib-* \
-+    pkg/irredsol \
-+    pkg/laguna \
-+    pkg/packagemanager \
-+    pkg/polenta \
-+    pkg/polycyclic \
-+    pkg/radiroot \
-+    pkg/resclasses \
-+    pkg/sophus \
-+    pkg/tomlib \
-+    pkg/utils \
-     "$GAP_ROOT"/pkg
- 
--# Install the GAP startup script; ensure it is executable
--sdh_install -T ../gap "$SAGE_BIN/gap"
--chmod +x "$SAGE_DESTDIR$SAGE_BIN/gap"
--
--# Create symlinks under $GAP_ROOT for these executables, as they are expected
--# (especially when building kernel packages) to exist
--ln -sf "../../bin/gap-bin" "$DESTDIR_GAP_ROOT/gap"
--ln -sf "../../bin/gac" "$DESTDIR_GAP_ROOT/gac"
--
--# Fix the $GAP_ROOT/bin/<arch>/src symlink to be relative (otherwise it links
--# to the actual path of the sources GAP was compiled from)
--for srclink in "$DESTDIR_GAP_ROOT"/bin/*/src; do
--    rm -f "$srclink"
--    ln -s "../../src" "$srclink"
--done
--
--# Additional fixups for some files after they have been copied into their
--# destination directory.  gac and sysinfo.gap are generated files that contain
--# in them hard-coded references to the GAP build directory, which will soon
--# be going away.  This breaks the build toolchain for some compiled GAP
--# packages.  We need to replace these paths with the final GAP_ROOT path.  The
--# below will work so long as neither of these paths contain '|', and if they do
--# then god help you.  https://trac.sagemath.org/ticket/27218
--sed -i -e "s|$GAP_BUILD_ROOT|$GAP_ROOT|g" \
--    "$SAGE_DESTDIR$SAGE_BIN/gac" "$DESTDIR_GAP_ROOT/sysinfo.gap" \
--    "$DESTDIR_GAP_ROOT/bin/gap.sh" "$DESTDIR_GAP_ROOT/doc/make_doc" || \
--    sdh_die "Failed to fix up hard-coded paths in GAP build tools."
--
- # TODO: This seems unnecessary--we are already installing all of doc/ to
- # GAP_ROOT, which is necessary for some functionality in GAP to work.  Do
- # we need this?  Maybe doc/gap could just be a symlink to gap/doc??
-diff --git a/build/pkgs/gap/spkg-legacy-uninstall b/build/pkgs/gap/spkg-legacy-uninstall
-index d17eb939eb7..a8e5c59e1fb 100755
---- a/build/pkgs/gap/spkg-legacy-uninstall
-+++ b/build/pkgs/gap/spkg-legacy-uninstall
-@@ -4,6 +4,8 @@ rm -rf "$SAGE_LOCAL/gap/gap-4."*
- rm -rf "$SAGE_SHARE/gap"
- rm -f "$SAGE_LOCAL/gap/latest"
- rm -f "$SAGE_LOCAL/bin/gap"
-+rm -f "$SAGE_LOCAL/bin/gac"
- 
--# Remove old libgap headers
-+# Remove old libgap headers and library
- rm -rf "$SAGE_LOCAL/include/gap"
-+rm -rf "$SAGE_LOCAL/lib/gap"
-diff --git a/build/pkgs/gap/spkg-prerm.in b/build/pkgs/gap/spkg-prerm.in
-deleted file mode 100644
-index 661d92621fa..00000000000
---- a/build/pkgs/gap/spkg-prerm.in
-+++ /dev/null
-@@ -1,6 +0,0 @@
--# These generated files are placed in directory provided by the SPKG, so
--# delete the generated files first so that their parent directories can be
--# removed during installation
--GAP_ROOT="$SAGE_LOCAL/share/gap"
--rm -f "$GAP_ROOT/pkg/atlasrep/datagens/"*.*
--rm -f "$GAP_ROOT/pkg/atlasrep/dataword/"*.*
-diff --git a/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch b/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch
-deleted file mode 100644
-index e45fe7d9c6f..00000000000
---- a/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch
-+++ /dev/null
-@@ -1,150 +0,0 @@
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c b/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--index 3bbdc45..7df699f 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--@@ -8,9 +8,8 @@ extern short sp[],**mat[],*psp[],**imcos[],**cpco[],lorb[],
-- short *cst,**cpst,***cdpst,**svptr,*cp,*rel;
-- short *spst,**pspst,**pptr,**cpptr,npt,nb,nph,nph2,npg,npg2,
--       rno,orno,coh_index,*invg;
---FILE  *ip,*op;
-- 
---void seeknln (void) { while (getc(ip)!='\n'); }
--+void seeknln (FILE *ip) { while (getc(ip)!='\n'); }
-- 
-- /* This program differs from most other permutation programs in that perms are
--    all stored in the single array sp. Schreier vectors are stored in the short
--@@ -23,13 +22,14 @@ void seeknln (void) { while (getc(ip)!='\n'); }
-- int 
-- crprog1 (void)
-- { short *pc,*qc,ex,neg; int x;
--+  FILE  *ip,*op;
--   short i,j,k,l,m,n,cl,rl,*p,ocl,im,pt,pt1,pn,ipt;
--   if ((ip=fopen(inf2,"r"))== 0)
--   { fprintf(stderr,"Cannot open %s.\n",inf2); return(-1);}
--   fscanf(ip,"%hd%hd%hd%hd",&npt,&nph,&nb,&k);
--   if (nb>=mb) {fprintf(stderr,"nb too big. Increase MB.\n"); return(-1);}
--   if (k<=2) {fprintf(stderr,"inf2 has illegal format.\n"); return(-1); }
---  seeknln(); seeknln();
--+  seeknln(ip); seeknln(ip);
--   for (i=1;i<=nb;i++) fscanf(ip,"%hd",lorb+i);
--   pptr=psp-1; pspst=psp+nph; svptr=cpsp-1;  cpst=cpsp+nb;
--   invg=sp; nph2=2*nph; spst=sp+nph2;
--@@ -37,7 +37,7 @@ crprog1 (void)
--   { pptr[i]=spst+(i-1)*npt-1; p=pptr[i];
--     for (j=1;j<=npt;j++) {fscanf(ip,"%hd",&k); p[k]=j; }
--     invg[2*i-2]=2*i-1; invg[2*i-1]=2*i-2;
---    seeknln();
--+    seeknln(ip);
--   }
--   spst+=(npt*nph);
--   for (i=1;i<=nb;i++)
--@@ -75,7 +75,7 @@ crprog1 (void)
--   strcpy(inf1,inf0); strcat(inf1,".rel");
--   if ((ip=fopen(inf1,"r"))==0)
--   { fprintf(stderr,"Cannot open %s.\n",inf1); return(-1);}
---  fscanf(ip,"%hd%hd",&k,&rno); seeknln();
--+  fscanf(ip,"%hd%hd",&k,&rno); seeknln(ip);
--   op=fopen(outft,"w");
-- /* Now we have read everything in, and the computation can start */
--   orno=0;
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--index a7396b2..658496f 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--@@ -20,8 +20,6 @@ short  mexp=MEXP,mcl=MCL,no,rel[RSP],wt[MEXP],exp,*rpf,*rpb,
-- extern short  prime,dim,*spv,**spm,mspace[],*vec[],**mat[],cp[],pinv[],opmats,
--         mm,mv;
-- extern int msp;
---FILE *ip,*op;
---
-- 
-- int 
-- calcmats (void)
--@@ -59,7 +57,7 @@ calcmats (void)
--   }
--   for (i=1;i<=exp;i++) trans(mat[i+exp],mat[i]);
--   if (opmats)
---  { op=fopen(outf,"w");
--+  { FILE *op=fopen(outf,"w");
--     fprintf(op,"%4d%4d%4d\n",prime,dim,exp);
--     for (i=1;i<=exp;i++) printmat(mat[i]); 
--     fclose(op);
--@@ -71,6 +69,7 @@ int
-- rdmats (void)
-- /* reads matrices of generators of P */
-- { short i; int quot;
--+  FILE *ip;
--   ip=fopen(inf4,"r");
--   if (ip==0)
--   { fprintf(stderr,"Cannot open %s\n ",inf4); return(-1); }
--@@ -90,12 +89,12 @@ rdmats (void)
--   fclose(ip);
--   return(0);
-- }
---FILE *ip;
-- 
-- int 
-- ingp (int inp)
-- /* Read in output of respcrun -s */
-- { short i,j,k,l,m,*orpf,**pcp;
--+  FILE *ip;
--   ip=fopen(inf3,"r");
--   if (ip==0) { fprintf(stderr,"Cannot open %s\n",inf3); return(-1); }
--   fscanf(ip,"%hd%hd%hd%hd%hd%hd",&prime,&exp,&i,&no,&j,&m);
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--index 0896551..6841bc8 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--@@ -9,7 +9,6 @@ extern short  intexp,mexp,mng,wksp,
--        spugen[],*tlintg[];
-- extern int ptrsp,rsp;
-- short  fac;
---FILE *ip,*op;
-- 
-- int 
-- ingp (void)
--@@ -18,6 +17,7 @@ ingp (void)
--    of nqrun, and tails are also read in.
-- */
-- { short i,j,k,l,m,x,y,no,*orpf,*orpb,**pcp;  char tails;
--+  FILE *ip;
--   if ((ip=fopen(inf1,"r"))==0)
--   { fprintf(stderr,"Cannot open %s.\n",inf1); return(-1); }
--   fscanf(ip,"%hd%hd%hd%hd%hd%hd",&prime,&exp,&nng,&no,&class,&m);
--@@ -89,6 +89,7 @@ int
-- outgp (void)
-- /* The PCP is output, together with tails */
-- { short i,k,l,**pcp,*b,*e,*c;
--+  FILE *op;
--   op=fopen(outf,"w");
--   fprintf(op,"%4d%4d%4d%4d%4d%4d\n",prime,exp,nng,exp,class,1);
--   for (i=1;i<=exp;i++) fprintf(op,"%4d",wt[i]); fprintf(op,"\n");
--@@ -379,7 +380,7 @@ restart:
--     nng--; mnng--; enexpnt--;
--     if (nng==0)
--     { if (gap)
---      { op=fopen(outfm,"w"); fprintf(op,"COHOMOLO.Multiplier:=[];\n");
--+      { FILE *op=fopen(outfm,"w"); fprintf(op,"COHOMOLO.Multiplier:=[];\n");
--         fclose(op);
--         printf("All new generators eliminated. Multiplier is trivial.\n");
--       }
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--index 01cf914..0144883 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--@@ -9,7 +9,6 @@ extern short  intexp,mng,mexp,wksp,
--        spugen[],*intg[],*imintg[],*tlintg[];
-- extern int ptrsp,rsp;
-- short  *wf,*wc; char norm;
---FILE *ip,*op;
-- 
-- /* The data structures for this program and for nqrun are similar.
--    d1 and d2 contain definitions of generators. (Def. comes from commutator
--@@ -35,6 +34,7 @@ nqmprog (void)
-- { short i,j,k,l,m,d,*gi,*gj,*ti,*tj,cl,def,*ps,*pf,**dp,*nrpb,*p,*orpf,*orpb,
--         nb,np,k1,*rno,*covrel,**pgen,tdef,sgn;
--   char nt;
--+  FILE *ip,*op;
--   if (ingp() == -1) {fprintf(stderr,"Input error.\n"); return(-1); }
--   eexpnt=expnt+exp; enexpnt=nexpnt+nng;
-- 
-diff --git a/build/pkgs/gap_packages/patches/guava_leon_includes.patch b/build/pkgs/gap_packages/patches/guava_leon_includes.patch
-deleted file mode 100644
-index cdcd19cc3e8..00000000000
---- a/build/pkgs/gap_packages/patches/guava_leon_includes.patch
-+++ /dev/null
-@@ -1,13 +0,0 @@
----- a/pkg/guava-3.15/src/leon/src/generate.c	Sat Feb 29 09:02:10 2020
----- b/pkg/guava-3.15/src/leon/src/generate.c	Thu Sep 24 13:58:36 2020
--***************
--*** 115,120 ****
----- 115,122 ----
--  #include "groupio.h"
--  #include "enum.h"
--  #include "storage.h"
--+ #include "chbase.h"
--+ #include "inform.h"
--  
--  #ifdef ALT_TIME_HEADER
--  #include "cputime.h"
-diff --git a/build/pkgs/gap_packages/spkg-install.in b/build/pkgs/gap_packages/spkg-install.in
-index 168e6b11532..6dff182a48f 100644
---- a/build/pkgs/gap_packages/spkg-install.in
-+++ b/build/pkgs/gap_packages/spkg-install.in
-@@ -1,4 +1,4 @@
--GAP_ROOT="$SAGE_LOCAL/share/gap"
-+GAP_ROOT="$SAGE_LOCAL/lib/gap"
- PKG_DIR="$GAP_ROOT/pkg"
- 
- PKG_SRC_DIR="$(pwd)/src/pkg"
-@@ -11,33 +11,31 @@ cd "$PKG_SRC_DIR"
- #    (GAP 4.8.6 still had it, but this is gone in 4.10)
- 
- sdh_install \
--    aclib-* \
--    AutoDoc-* \
--    corelg-* \
--    crime-* \
-+    aclib \
-+    corelg \
-+    crime \
-     cryst \
-     crystcat \
--    design-* \
-+    design \
-     gbnp \
--    genss-* \
--    hap-* \
--    hapcryst-* \
--    hecke-* \
--    images-* \
--    liealgdb-* \
--    liepring-* \
--    liering-* \
--    loops-* \
--    MapClass-* \
--    polymaking-* \
--    qpa-* \
--    quagroup-* \
--    radiroot-* \
--    repsn-* \
--    sla-* \
--    sonata-* \
--    Toric-* \
--    utils-* \
-+    genss \
-+    hap \
-+    hapcryst \
-+    hecke \
-+    images \
-+    liealgdb \
-+    liepring \
-+    liering \
-+    loops \
-+    mapclass \
-+    polymaking \
-+    qpa \
-+    quagroup \
-+    repsn \
-+    singular \
-+    sla \
-+    sonata \
-+    toric \
-     "$PKG_DIR"
- 
- install_compiled_pkg()
-@@ -45,27 +43,23 @@ install_compiled_pkg()
-     local pkg="$1"
-     # Install the bin/ dir (where compiled modules should end up)
-     # under <prefix>/lib/gap; we then symlink to it later
--    sdh_install bin "$SAGE_LOCAL/lib/gap/pkg/$pkg"
-+    sdh_install * "$SAGE_LOCAL/lib/gap/pkg/$pkg"
- 
-+    # TODO:
-     # Clean up any build artificts before installing the rest of the package
-     # Also remove configure/Makefiles
-     # Note: None, if any of the packages really have a proper install target
--    make clean  # Works for some packages but not all
--    rm -rf bin/
--    rm -rf configure configure.* config.* autogen.sh *.m4 Makefile* m4/
-+    #make clean  # Works for some packages but not all
-+    #rm -rf bin/
-+    #rm -rf configure configure.* config.* autogen.sh *.m4 Makefile* m4/
- 
--    # Create the bin/ symlink
--    ln -s "$SAGE_LOCAL/lib/gap/pkg/$pkg/bin" bin
--
--    # Install the rest of the package files
--    sdh_install * "$PKG_DIR/$pkg"
- }
- 
- # Build and install compiled packages:
- #
- # These packages have an old ./configure that take the GAP_ROOT as a positional
- # argument
--for pkg in cohomolo-* crypting-* grape-* guava-* orb-* datastructures-*
-+for pkg in cohomolo crypting grape guava orb datastructures
- do
-     echo "Building GAP package $pkg"
-     CFLAGS="$CFLAGS -Wno-implicit-function-declaration"
-@@ -91,7 +85,7 @@ pararr=( " " " " "--with-external-planarity" "--with-external-libsemigroups" )
- ##############################################################################
- 
- parind=0
--for pkg in nq-* io-* digraphs-* semigroups-*
-+for pkg in nq io digraphs semigroups
- do
-     echo "Building GAP package $pkg"
-     cd "$PKG_SRC_DIR/$pkg"
-diff --git a/build/pkgs/libsemigroups/checksums.ini b/build/pkgs/libsemigroups/checksums.ini
-index 62c4268515f..4e13a36cb35 100644
---- a/build/pkgs/libsemigroups/checksums.ini
-+++ b/build/pkgs/libsemigroups/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=libsemigroups-VERSION.tar.gz
--sha1=2b16c095cc5ffd3f77a71dfbf48cce188e054c03
--md5=7082cadcf7a195ccb93175cd72b6db95
--cksum=1501022358
-+sha1=86375824b47ce4b0e23570122e873f67136d0c0a
-+md5=ff79ad5fbc8bfeb64d48faaf24106b98
-+cksum=2845045455
- upstream_url=https://github.com/libsemigroups/libsemigroups/releases/download/vVERSION/libsemigroups-VERSION.tar.gz
-diff --git a/build/pkgs/libsemigroups/package-version.txt b/build/pkgs/libsemigroups/package-version.txt
-index 9084fa2f716..f90b1afc082 100644
---- a/build/pkgs/libsemigroups/package-version.txt
-+++ b/build/pkgs/libsemigroups/package-version.txt
-@@ -1 +1 @@
--1.1.0
-+2.3.2
-diff --git a/build/pkgs/libsemigroups/spkg-install.in b/build/pkgs/libsemigroups/spkg-install.in
-index 2aaf0e99043..128b54d2f99 100644
---- a/build/pkgs/libsemigroups/spkg-install.in
-+++ b/build/pkgs/libsemigroups/spkg-install.in
-@@ -1,4 +1,4 @@
- cd src
--sdh_configure
-+sdh_configure --disable-eigen
- sdh_make
- sdh_make_install
-diff --git a/build/pkgs/singular/spkg-configure.m4 b/build/pkgs/singular/spkg-configure.m4
-index d4d145defe3..6a85631f624 100644
---- a/build/pkgs/singular/spkg-configure.m4
-+++ b/build/pkgs/singular/spkg-configure.m4
-@@ -9,52 +9,7 @@ SAGE_SPKG_CONFIGURE([singular], [
-        AC_MSG_CHECKING([that Singular's help is working])
-        AS_IF([test x`printf "system(\"--browser\", \"builtin\"); \n help;" | Singular 2>&1 | grep "error occurred"` = x], [
-         AC_MSG_RESULT(yes)
--        dnl We have Singular. Now determine the shared library path on
--        dnl platforms on which sage.libs.singular needs to reload the library with RTLD_GLOBAL.
--        AS_CASE([$host_os],
--          [cygwin*], [dnl Nothing to do
--                     ],
--                     [dnl Use pkg-config to get singular's libdir while we're at it. As a
--                      dnl moral compromise for using pkg-config, this ultimately allows us
--                      dnl to pass an absolute path to dlopen(), which is the only approach
--                      dnl that POSIX guarantees will work.
--                      PKG_CHECK_VAR([SINGULAR_LIB_DIR], [Singular], [libdir])
--                      dnl The acl_shlibext variable is set in the top-level configure.ac.
--                      AC_LANG_PUSH(C)
--                      ORIG_LIBS="${LIBS}"
--                      LIBS="${LIBS} -ldl"
--                      AC_MSG_CHECKING([if we can dlopen($LIBSINGULAR_PATH)])
--                      LIBSINGULAR_PATH="${SINGULAR_LIB_DIR}/libSingular.${acl_shlibext}"
--
--                      dnl if we can dlopen() it, substitute the name for sage_conf;
--                      dnl otherwise, fall back to using the SPKG.
--                      AC_RUN_IFELSE(
--                        [AC_LANG_PROGRAM(
--                          [[#include <dlfcn.h>]],
--                          [[void* h = dlopen("${LIBSINGULAR_PATH}", RTLD_LAZY | RTLD_GLOBAL);
--                            if (h == 0) { return 1; } else { return dlclose(h); }]]
--                        )], [
--                          AC_MSG_RESULT(yes)
--                        ], [
--                          dnl try Debian-specific name
--                          LIBSINGULAR_PATH="${SINGULAR_LIB_DIR}/libsingular-Singular.${acl_shlibext}"
--                          AC_RUN_IFELSE(
--                           [AC_LANG_PROGRAM(
--                             [[#include <dlfcn.h>]],
--                             [[void* h = dlopen("${LIBSINGULAR_PATH}", RTLD_LAZY | RTLD_GLOBAL);
--                               if (h == 0) { return 1; } else { return dlclose(h); }]]
--                           )], [
--                             AC_MSG_RESULT(yes)
--                           ], [
--                            AC_MSG_RESULT(no)
--                            sage_spkg_install_singular=yes
--                          ], [AC_MSG_RESULT(yes)])
--                        ], [AC_MSG_RESULT(yes)])
--
--                      AC_LANG_POP()
--                      LIBS="${ORIG_LIBS}"
--                     ]
--       )], [
-+       ], [
-        AC_MSG_RESULT(no)
-        sage_spkg_install_singular=yes
-        ]
-@@ -64,20 +19,4 @@ SAGE_SPKG_CONFIGURE([singular], [
-       ])
-     ])
-   ])
--],[],[],[
--  dnl Post-check phase
--  dnl We make the sage_conf substitutions here, because the "default"
--  dnl substitution needs to be made even if we skipped the system-Singular
--  dnl checks themselves.
--  AS_IF([test "x${sage_spkg_install_singular}" = "xyes"], [
--    AS_CASE([$host_os],
--      [cygwin*], [dnl Nothing to do
--                 ],
--                 [dnl Set shared library path, needed for reloading the library with RTLD_GLOBAL
--                  LIBSINGULAR_PATH="\$SAGE_LOCAL/lib/libSingular.${acl_shlibext}"
--                 ]
--    )
--  ])
--
--  AC_SUBST(LIBSINGULAR_PATH, "${LIBSINGULAR_PATH}")
- ])
-diff --git a/pkgs/sage-conf/_sage_conf/_conf.py.in b/pkgs/sage-conf/_sage_conf/_conf.py.in
-index 6cd28f558a8..d66bdb3d264 100644
---- a/pkgs/sage-conf/_sage_conf/_conf.py.in
-+++ b/pkgs/sage-conf/_sage_conf/_conf.py.in
-@@ -55,9 +55,6 @@ THREEJS_DIR = SAGE_LOCAL + "/share/threejs-sage"
- OPENMP_CFLAGS = "@OPENMP_CFLAGS@"
- OPENMP_CXXFLAGS = "@OPENMP_CXXFLAGS@"
- 
--# The full absolute path to the main Singular library.
--LIBSINGULAR_PATH = "@LIBSINGULAR_PATH@".replace('$SAGE_LOCAL', SAGE_LOCAL)
--
- # Installation location of wheels. This is determined at configuration time
- # and does not depend on the installation location of sage-conf.
- SAGE_SPKG_WHEELS = "@SAGE_VENV@".replace('${SAGE_LOCAL}', SAGE_LOCAL) + "/var/lib/sage/wheels"
-diff --git a/src/doc/en/thematic_tutorials/lie/weyl_groups.rst b/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-index c917338e444..182e74aad20 100644
---- a/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-+++ b/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-@@ -139,12 +139,12 @@ string, which you can print::
-     X.1      1  1  1  1  1  1  1  1  1  1  1  1  1
-     X.2      1 -1  1  1 -1  1  1 -1 -1 -1  1  1  1
-     X.3      2  .  2 -1  .  2  2  .  .  . -1  2  2
--    X.4      3 -1 -1  .  1 -1  3 -1  1 -1  . -1  3
--    X.5      3 -1 -1  .  1  3 -1 -1 -1  1  . -1  3
--    X.6      3  1 -1  . -1 -1  3  1 -1  1  . -1  3
--    X.7      3  1 -1  . -1  3 -1  1  1 -1  . -1  3
--    X.8      3 -1  3  . -1 -1 -1 -1  1  1  . -1  3
--    X.9      3  1  3  .  1 -1 -1  1 -1 -1  . -1  3
-+    X.4      3 -1 -1  .  1  3 -1 -1 -1  1  . -1  3
-+    X.5      3  1 -1  . -1  3 -1  1  1 -1  . -1  3
-+    X.6      3 -1  3  . -1 -1 -1 -1  1  1  . -1  3
-+    X.7      3 -1 -1  .  1 -1  3 -1  1 -1  . -1  3
-+    X.8      3  1  3  .  1 -1 -1  1 -1 -1  . -1  3
-+    X.9      3  1 -1  . -1 -1  3  1 -1  1  . -1  3
-     X.10     4 -2  . -1  .  .  .  2  .  .  1  . -4
-     X.11     4  2  . -1  .  .  . -2  .  .  1  . -4
-     X.12     6  . -2  .  . -2 -2  .  .  .  .  2  6
-diff --git a/src/sage/coding/codecan/autgroup_can_label.pyx b/src/sage/coding/codecan/autgroup_can_label.pyx
-index de5db985e0b..c83b9264e44 100644
---- a/src/sage/coding/codecan/autgroup_can_label.pyx
-+++ b/src/sage/coding/codecan/autgroup_can_label.pyx
-@@ -76,7 +76,7 @@ columns do share the same coloring::
-     ((1,),
-      (2,),
-      (3, 5, 4),
--     (6, 19, 16, 9, 21, 10, 8, 15, 14, 11, 20, 13, 12, 7, 17, 18))
-+     (6, 19, 16, 21, 9, 10, 15, 8, 20, 11, 14, 13, 7, 12, 18, 17))
- 
- We can also restrict the group action to linear isometries::
- 
-diff --git a/src/sage/coding/linear_code.py b/src/sage/coding/linear_code.py
-index a3ac3ca1547..bfb9f8696e8 100644
---- a/src/sage/coding/linear_code.py
-+++ b/src/sage/coding/linear_code.py
-@@ -465,27 +465,27 @@ def automorphism_group_gens(self, equivalence="semilinear"):
-             0
-             sage: C = codes.HammingCode(GF(4, 'z'), 3)
-             sage: C.automorphism_group_gens()
--            ([((1, 1, 1, 1, 1, z + 1, z, z + 1, z, z, z, 1, 1, z + 1, z + 1, z, z + 1, z, z + 1, z + 1, z + 1); (1,14,6,7,4,10,11,19)(2,8,16,13,3,17,21,15)(9,12,18,20), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((1, 1, 1, z, z + 1, 1, 1, 1, 1, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z); (1,13,14,20)(2,21,8,18,7,16,19,15)(3,10,5,12,17,9,6,4), Ring endomorphism of Finite Field in z of size 2^2
-+                Defn: z |--> z + 1),
-+              ((z, 1, z, z, z, z + 1, z, z, z, z, z, z, z + 1, z, z, z, z, z + 1, z, z, z); (1,11,5,12,3,19)(2,8)(6,18,13)(7,17,15)(9,10,14,16,20,21), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z + 1),
--              ((z + 1, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z + 1, 1, z, z + 1, z + 1, z); (1,18,6,19,2,9,17,10,13,14,21,11,4,5,12)(3,20,7,16,8), Ring endomorphism of Finite Field in z of size 2^2
--                Defn: z |--> z),
-               ((z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z); (), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-              362880)
-             sage: C.automorphism_group_gens(equivalence="linear")
--            ([((z + 1, 1, z + 1, z + 1, z + 1, z, 1, z, 1, 1, 1, 1, z + 1, z + 1, z + 1, z, z, 1, z, z, z); (1,15,2,8,16,18,3)(4,9,12,13,20,10,11)(5,21,14,6,7,19,17), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((z, 1, z + 1, z + 1, 1, z + 1, z, 1, z + 1, z + 1, 1, z, 1, z + 1, z, 1, z, 1, z + 1, 1, 1); (1,12,11,10,6,8,9,20,13,21,5,14,3,16,17,19,7,4,2,15,18), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((z + 1, z + 1, z + 1, z + 1, z + 1, 1, z, 1, z, z, z, 1, z, 1, 1, 1, z + 1, z + 1, z + 1, 1, z); (1,15,21,8,9)(2,18,5,3,11,16,7,10,19,13,12,4,17,6,20), Ring endomorphism of Finite Field in z of size 2^2
-+              ((z + 1, z + 1, z + 1, z, 1, 1, z, z, 1, z + 1, z, 1, 1, z, 1, z + 1, z, z + 1, z + 1, 1, z); (1,3,18,2,17,6,19)(4,15,13,20,7,14,16)(5,11,8,21,12,9,10), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
-               ((z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1); (), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-              181440)
-             sage: C.automorphism_group_gens(equivalence="permutational")
--            ([((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,19)(3,17)(4,21)(5,20)(7,14)(9,12)(10,16)(11,15), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,11)(3,10)(4,9)(5,7)(12,21)(14,20)(15,19)(16,17), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,11)(3,10)(4,9)(5,7)(12,21)(14,20)(15,19)(16,17), Ring endomorphism of Finite Field in z of size 2^2
-+              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (2,18)(3,19)(4,10)(5,16)(8,13)(9,14)(11,21)(15,20), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,17)(2,8)(3,14)(4,10)(7,12)(9,19)(13,18)(15,20), Ring endomorphism of Finite Field in z of size 2^2
-+              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,19)(3,17)(4,21)(5,20)(7,14)(9,12)(10,16)(11,15), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
-               ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (2,13)(3,14)(4,20)(5,11)(8,18)(9,19)(10,15)(16,21), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-@@ -691,10 +691,10 @@ def _canonize(self, equivalence):
-             sage: C_iso == aut_group_can_label.get_canonical_form()
-             True
-             sage: aut_group_can_label.get_autom_gens()
--            [((1, 1, 1, 1, 1, z + 1, z, z + 1, z, z, z, 1, 1, z + 1, z + 1, z, z + 1, z, z + 1, z + 1, z + 1); (1,14,6,7,4,10,11,19)(2,8,16,13,3,17,21,15)(9,12,18,20), Ring endomorphism of Finite Field in z of size 2^2
-+            [((1, 1, 1, z, z + 1, 1, 1, 1, 1, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z); (1,13,14,20)(2,21,8,18,7,16,19,15)(3,10,5,12,17,9,6,4), Ring endomorphism of Finite Field in z of size 2^2
-+               Defn: z |--> z + 1),
-+             ((z, 1, z, z, z, z + 1, z, z, z, z, z, z, z + 1, z, z, z, z, z + 1, z, z, z); (1,11,5,12,3,19)(2,8)(6,18,13)(7,17,15)(9,10,14,16,20,21), Ring endomorphism of Finite Field in z of size 2^2
-                Defn: z |--> z + 1),
--             ((z + 1, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z + 1, 1, z, z + 1, z + 1, z); (1,18,6,19,2,9,17,10,13,14,21,11,4,5,12)(3,20,7,16,8), Ring endomorphism of Finite Field in z of size 2^2
--               Defn: z |--> z),
-              ((z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z); (), Ring endomorphism of Finite Field in z of size 2^2
-                Defn: z |--> z)]
-         """
-diff --git a/src/sage/combinat/posets/posets.py b/src/sage/combinat/posets/posets.py
-index 2836d59d960..8c882d5ac3b 100644
---- a/src/sage/combinat/posets/posets.py
-+++ b/src/sage/combinat/posets/posets.py
-@@ -8813,7 +8813,7 @@ def _libgap_(self):
-             sage: libgap(P)  # optional - gap_packages
-             <A poset on 5 points>
-             sage: A = libgap(GF(2)).PosetAlgebra(P); A  # optional - gap_packages
--            <GF(2)[<quiver with 5 vertices and 5 arrows>]/<two-sided ideal in <GF(2)[<quiver with 5 vertices and 5 arrows>]>, (1 generators)>>
-+            <GF(2)[<quiver with 5 vertices and 5 arrows>]/<two-sided ideal in <GF(2)[<quiver with 5 vertices and 5 arrows>]>, (1 generator)>>
-             sage: A.Dimension()  # optional - gap_packages
-             13
-         """
-diff --git a/src/sage/combinat/root_system/hecke_algebra_representation.py b/src/sage/combinat/root_system/hecke_algebra_representation.py
-index 6b756bafc30..8ac99319bec 100644
---- a/src/sage/combinat/root_system/hecke_algebra_representation.py
-+++ b/src/sage/combinat/root_system/hecke_algebra_representation.py
-@@ -357,7 +357,7 @@ def Tw(self, word, signs=None, scalar=None):
-             sage: q1, q2 = K.gens()
-             sage: KW = W.algebra(K)
-             sage: x = KW.an_element(); x
--            123 + 3*32 + 2*3 + e
-+            123 + 3*2312 + 2*31 + e
- 
-             sage: T = KW.demazure_lusztig_operators(q1,q2)
-             sage: T12 = T.Tw( (1,2) )
-diff --git a/src/sage/combinat/symmetric_group_algebra.py b/src/sage/combinat/symmetric_group_algebra.py
-index b8a0bebab44..9bccba124c8 100644
---- a/src/sage/combinat/symmetric_group_algebra.py
-+++ b/src/sage/combinat/symmetric_group_algebra.py
-@@ -101,7 +101,7 @@ def SymmetricGroupAlgebra(R, W, category=None):
-         sage: SGA.group()
-         Weyl Group of type ['A', 3] (as a matrix group acting on the ambient space)
-         sage: SGA.an_element()
--        s1*s2*s3 + 3*s3*s2 + 2*s3 + 1
-+        s1*s2*s3 + 3*s2*s3*s1*s2 + 2*s3*s1 + 1
- 
-     The preferred way to construct the symmetric group algebra is to
-     go through the usual ``algebra`` method::
-diff --git a/src/sage/env.py b/src/sage/env.py
-index 911f34b1bc6..5f7aca8599c 100644
---- a/src/sage/env.py
-+++ b/src/sage/env.py
-@@ -197,7 +197,8 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- GRAPHS_DATA_DIR = var("GRAPHS_DATA_DIR", join(SAGE_SHARE, "graphs"))
- ELLCURVE_DATA_DIR = var("ELLCURVE_DATA_DIR", join(SAGE_SHARE, "ellcurves"))
- POLYTOPE_DATA_DIR = var("POLYTOPE_DATA_DIR", join(SAGE_SHARE, "reflexive_polytopes"))
--GAP_ROOT_DIR = var("GAP_ROOT_DIR", join(SAGE_SHARE, "gap"))
-+GAP_LIB_DIR = var("GAP_LIB_DIR", join(SAGE_LOCAL, "lib", "gap"))
-+GAP_SHARE_DIR = var("GAP_SHARE_DIR", join(SAGE_SHARE, "gap"))
- THEBE_DIR = var("THEBE_DIR", join(SAGE_SHARE, "thebe"))
- COMBINATORIAL_DESIGN_DATA_DIR = var("COMBINATORIAL_DESIGN_DATA_DIR", join(SAGE_SHARE, "combinatorial_designs"))
- CREMONA_MINI_DATA_DIR = var("CREMONA_MINI_DATA_DIR", join(SAGE_SHARE, "cremona"))
-@@ -229,12 +230,6 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- LIE_INFO_DIR = var("LIE_INFO_DIR", join(SAGE_LOCAL, "lib", "LiE"))
- SINGULAR_BIN = var("SINGULAR_BIN") or "Singular"
- 
--# The path to libSingular, to be passed to dlopen(). This will
--# typically be set to an absolute path in sage_conf, but the relative
--# fallback path here works on systems where dlopen() searches the
--# system's library locations.
--LIBSINGULAR_PATH = var("LIBSINGULAR_PATH", "libSingular.so")
--
- # OpenMP
- OPENMP_CFLAGS = var("OPENMP_CFLAGS", "")
- OPENMP_CXXFLAGS = var("OPENMP_CXXFLAGS", "")
-@@ -255,81 +250,6 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- SAGE_GAP_COMMAND = var('SAGE_GAP_COMMAND', _gap_cmd)
- 
- 
--def _get_shared_lib_path(*libnames: str) -> Optional[str]:
--    """
--    Return the full path to a shared library file installed in
--    ``$SAGE_LOCAL/lib`` or the directories associated with the
--    Python sysconfig.
--
--    This can also be passed more than one library name (e.g. for cases where
--    some library may have multiple names depending on the platform) in which
--    case the first one found is returned.
--
--    This supports most *NIX variants (in which ``lib<libname>.so`` is found
--    under ``$SAGE_LOCAL/lib``), macOS (same, but with the ``.dylib``
--    extension), and Cygwin (under ``$SAGE_LOCAL/bin/cyg<libname>.dll``,
--    or ``$SAGE_LOCAL/bin/cyg<libname>-*.dll`` for versioned DLLs).
--
--    For distributions like Debian that use a multiarch layout, we also try the
--    multiarch lib paths (i.e. ``/usr/lib/<arch>/``).
--
--    This returns ``None`` if no matching library file could be found.
--
--    EXAMPLES::
--
--        sage: from sage.env import _get_shared_lib_path
--        sage: "gap" in _get_shared_lib_path("gap")
--        True
--        sage: _get_shared_lib_path("an_absurd_lib") is None
--        True
--
--    """
--
--    for libname in libnames:
--        search_directories: List[Path] = []
--        patterns: List[str] = []
--        if sys.platform == 'cygwin':
--            # Later down we take the first matching DLL found, so search
--            # SAGE_LOCAL first so that it takes precedence
--            if SAGE_LOCAL:
--                search_directories.append(Path(SAGE_LOCAL) / 'bin')
--            search_directories.append(Path(sysconfig.get_config_var('BINDIR')))
--            # Note: The following is not very robust, since if there are multible
--            # versions for the same library this just selects one more or less
--            # at arbitrary. However, practically speaking, on Cygwin, there
--            # will only ever be one version
--            patterns = [f'cyg{libname}.dll', f'cyg{libname}-*.dll']
--        else:
--            if sys.platform == 'darwin':
--                ext = 'dylib'
--            else:
--                ext = 'so'
--
--            if SAGE_LOCAL:
--                search_directories.append(Path(SAGE_LOCAL) / 'lib')
--            libdir = sysconfig.get_config_var('LIBDIR')
--            if libdir is not None:
--                libdir = Path(libdir)
--                search_directories.append(libdir)
--
--                multiarchlib = sysconfig.get_config_var('MULTIARCH')
--                if multiarchlib is not None:
--                    search_directories.append(libdir / multiarchlib),
--
--            patterns = [f'lib{libname}.{ext}']
--
--        for directory in search_directories:
--            for pattern in patterns:
--                path = next(directory.glob(pattern), None)
--                if path is not None:
--                    return str(path.resolve())
--
--    # Just return None if no files were found
--    return None
--
--# locate libgap shared object
--GAP_SO = var("GAP_SO", _get_shared_lib_path("gap", ""))
--
- # post process
- if DOT_SAGE is not None and ' ' in DOT_SAGE:
-     if UNAME[:6] == 'CYGWIN':
-diff --git a/src/sage/groups/abelian_gps/abelian_group_gap.py b/src/sage/groups/abelian_gps/abelian_group_gap.py
-index a4b047113c5..86090b43535 100644
---- a/src/sage/groups/abelian_gps/abelian_group_gap.py
-+++ b/src/sage/groups/abelian_gps/abelian_group_gap.py
-@@ -338,7 +338,7 @@ def _element_constructor_(self, x, check=True):
-         if isinstance(x, AbelianGroupElement_gap):
-             try:
-                 if x in self._cover:
--                    x = self.gap().NaturalHomomorphism().Image(x.gap())
-+                    x = self._cover.gap().NaturalHomomorphismByNormalSubgroup(self._relations).Image(x.gap())
-                 else:
-                     x = x.gap()
-             except AttributeError:
-@@ -1043,7 +1043,7 @@ def natural_homomorphism(self):
-             From: Abelian group with gap, generator orders (4,)
-             To:   Quotient abelian group with generator orders (2,)
-         """
--        phi = self.gap().NaturalHomomorphism()
-+        phi = self._cover.gap().NaturalHomomorphismByNormalSubgroup(self._relations)
-         Hom = self._cover.Hom(self)
-         return Hom(phi)
- 
-diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py
-index 8d6e443683c..1beb01af87f 100644
---- a/src/sage/groups/finitely_presented.py
-+++ b/src/sage/groups/finitely_presented.py
-@@ -596,9 +596,9 @@ def gap(self):
-             sage: k = G.rewriting_system()
-             sage: k.gap()
-             Knuth Bendix Rewriting System for Monoid( [ a, A, b, B ] ) with rules
--            [ [ a^2, <identity ...> ], [ a*A, <identity ...> ],
--              [ A*a, <identity ...> ], [ b^2, <identity ...> ],
--              [ b*B, <identity ...> ], [ B*b, <identity ...> ] ]
-+            [ [ a*A, <identity ...> ], [ A*a, <identity ...> ],
-+              [ b*B, <identity ...> ], [ B*b, <identity ...> ],
-+              [ a^2, <identity ...> ], [ b^2, <identity ...> ] ]
-         """
-         return self._gap
- 
-diff --git a/src/sage/groups/fqf_orthogonal.py b/src/sage/groups/fqf_orthogonal.py
-index 7fc4dbe7548..e5eccd45942 100644
---- a/src/sage/groups/fqf_orthogonal.py
-+++ b/src/sage/groups/fqf_orthogonal.py
-@@ -143,7 +143,7 @@ class FqfOrthogonalGroup(AbelianGroupAutomorphismGroup_subgroup):
-         [2/3   0   0]
-         [  0 2/3   0]
-         [  0   0 4/3]
--        generated by 2 elements
-+        generated by 3 elements
-         sage: q = matrix.diagonal(QQ, [3/2, 1/4, 1/4])
-         sage: T = TorsionQuadraticForm(q)
-         sage: T.orthogonal_group().order()
-diff --git a/src/sage/groups/libgap_wrapper.pyx b/src/sage/groups/libgap_wrapper.pyx
-index d25121aa792..dc81b71635b 100644
---- a/src/sage/groups/libgap_wrapper.pyx
-+++ b/src/sage/groups/libgap_wrapper.pyx
-@@ -25,7 +25,7 @@ Note how we call the constructor of both superclasses to initialize
- its output via LibGAP::
- 
-     sage: FooGroup()
--    <pc group of size 3 with 1 generators>
-+    <pc group of size 3 with 1 generator>
-     sage: type(FooGroup().gap())
-     <class 'sage.libs.gap.element.GapElement'>
- 
-@@ -106,7 +106,7 @@ class ParentLibGAP(SageObject):
-         ....:         ParentLibGAP.__init__(self, lg)
-         ....:         Group.__init__(self)
-         sage: FooGroup()
--        <pc group of size 3 with 1 generators>
-+        <pc group of size 3 with 1 generator>
-     """
- 
-     def __init__(self, libgap_parent, ambient=None):
-@@ -461,7 +461,7 @@ cdef class ElementLibGAP(MultiplicativeGroupElement):
-         ....:         ParentLibGAP.__init__(self, lg)
-         ....:         Group.__init__(self)
-         sage: FooGroup()
--        <pc group of size 3 with 1 generators>
-+        <pc group of size 3 with 1 generator>
-         sage: FooGroup().gens()
-         (f1,)
-     """
-diff --git a/src/sage/groups/matrix_gps/finitely_generated.py b/src/sage/groups/matrix_gps/finitely_generated.py
-index a6d3dc02513..63956ad5f10 100644
---- a/src/sage/groups/matrix_gps/finitely_generated.py
-+++ b/src/sage/groups/matrix_gps/finitely_generated.py
-@@ -563,9 +563,6 @@ def as_permutation_group(self, algorithm=None, seed=None):
-             21499084800
-             sage: P = G.as_permutation_group()
-             sage: Psmaller = G.as_permutation_group(algorithm="smaller", seed=6)
--            sage: P == Psmaller  # see the note below
--            True
--            sage: Psmaller = G.as_permutation_group(algorithm="smaller")
-             sage: P == Psmaller
-             False
-             sage: P.cardinality()
-diff --git a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-index f2ccca042ac..47d6862333c 100644
---- a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-+++ b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-@@ -427,7 +427,7 @@ cdef class LabelledBranching:
-             sage: from sage.groups.perm_gps.partn_ref2.refinement_generic import LabelledBranching
-             sage: L = LabelledBranching(3)
-             sage: L.small_generating_set()
--            []
-+            [()]
-             sage: L.add_gen(libgap.eval('(1,2,3)'))
-             sage: L.small_generating_set()
-             [(1,2,3)]
-diff --git a/src/sage/groups/perm_gps/permgroup.py b/src/sage/groups/perm_gps/permgroup.py
-index ebdf7c4c6eb..fb14008c8e0 100644
---- a/src/sage/groups/perm_gps/permgroup.py
-+++ b/src/sage/groups/perm_gps/permgroup.py
-@@ -926,7 +926,7 @@ def _coerce_map_from_(self, G):
-            sage: f = PG._coerce_map_from_(MG)
-            sage: mg = MG.an_element()
-            sage: p = f(mg); p
--           (2,33,32,23,31,55)(3,49,38,44,40,28)(4,17,59,62,58,46)(5,21,47,20,43,8)(6,53,50)(7,37,12,57,14,29)(9,41,56,34,64,10)(11,25,19)(13,61,26,51,22,15)(16,45,36)(18,27,35,48,52,54)(24,63,42)(30,39,60)
-+           (1,2,6,19,35,33)(3,9,26,14,31,23)(4,13,5)(7,22,17)(8,24,12)(10,16,32,27,20,28)(11,30,18)(15,25,36,34,29,21)
-            sage: PG(p._gap_()) == p
-            True
- 
-@@ -972,12 +972,12 @@ def _coerce_map_from_(self, G):
-             sage: P = G.as_permutation_group(algorithm='smaller', seed=5)
-             sage: P1 = G.as_permutation_group()
-             sage: P == P1
--            False
-+            True
-             sage: g1, g2, g3 = G.gens()
-             sage: P(g1*g2)
--            (1,3,7,12)(2,4,8,10)(5,11)(6,9)
-+            (1,4,13,11)(2,5,14,18)(3,15,8,16)(6,7)(9,20,19,12)(10,17)
-             sage: P1(g1*g2)
--            (2,29,25,68)(3,57,13,54)(4,11,72,37)(5,39,60,23)(6,64,75,63)(7,21,50,73)(8,46,38,32)(9,74,35,18)(10,44,49,48)(12,16,34,71)(14,79,27,40)(15,26)(17,62,59,76)(19,78,70,65)(20,22,58,51)(24,33,36,43)(28,81,80,52)(30,53,56,69)(31,61)(41,42,67,55)(45,77)(47,66)
-+            (1,4,13,11)(2,5,14,18)(3,15,8,16)(6,7)(9,20,19,12)(10,17)
- 
-         Another check for :trac:`5583`::
- 
-@@ -1302,7 +1302,7 @@ def gens_small(self):
-             sage: G.gens_small() # random
-             [('b','c'), ('a','c','b')] ## (on 64-bit Linux)
-             [('a','b'), ('a','c','b')] ## (on Solaris)
--            sage: len(G.gens_small()) == 2
-+            sage: len(G.gens_small()) == 2 # random
-             True
-         """
-         gens = self._libgap_().SmallGeneratingSet()
-@@ -4370,17 +4370,23 @@ def is_transitive(self, domain=None):
- 
-         ::
- 
--            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)]]) #S_5 on [1..5]
--            sage: G.is_transitive([1,4,5])
-+            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)],[(6,7)]])
-+            sage: G.is_transitive([1,2,3,4,5])
-             True
--            sage: G.is_transitive([2..6])
-+            sage: G.is_transitive([1..7])
-             False
-             sage: G.is_transitive(G.non_fixed_points())
--            True
-+            False
-             sage: H = PermutationGroup([[(1,2,3)],[(4,5,6)]])
-             sage: H.is_transitive(H.non_fixed_points())
-             False
- 
-+        If `G` does not act on the domain, it always returns ``False``::
-+
-+            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)]]) #S_5 on [1..5]
-+            sage: G.is_transitive([1,4,5])
-+            False
-+
-         Note that this differs from the definition in GAP, where
-         ``IsTransitive`` returns whether the group is transitive on the
-         set of points moved by the group.
-@@ -4436,12 +4442,16 @@ def is_primitive(self, domain=None):
-             sage: G = PermutationGroup([[(1,2,3,4)],[(2,4)]])
-             sage: G.is_primitive([1..4])
-             False
--            sage: G.is_primitive([1,2,3])
--            True
-             sage: G = PermutationGroup([[(3,4,5,6)],[(3,4)]]) #S_4 on [3..6]
-             sage: G.is_primitive(G.non_fixed_points())
-             True
- 
-+        If `G` does not act on the domain, it always returns ``False``::
-+
-+            sage: G = PermutationGroup([[(1,2,3,4)],[(2,4)]])
-+            sage: G.is_primitive([1,2,3])
-+            False
-+
-         """
-         #If the domain is not a subset of self.domain(), then the
-         #action isn't primitive.
-diff --git a/src/sage/interfaces/gap.py b/src/sage/interfaces/gap.py
-index 7ae1792e9de..ecaa9fd2341 100644
---- a/src/sage/interfaces/gap.py
-+++ b/src/sage/interfaces/gap.py
-@@ -1512,6 +1512,8 @@ def gap_reset_workspace(max_workspace_size=None, verbose=False):
-     """
-     # Create new workspace with filename WORKSPACE
-     g = Gap(use_workspace_cache=False, max_workspace_size=None)
-+    g.eval('ColorPrompt(false)')
-+    g.eval('SetUserPreference("UseColorPrompt", false)')
-     g.eval('SetUserPreference("HistoryMaxLines", 30)')
-     from sage.tests.gap_packages import all_installed_packages
-     for pkg in all_installed_packages(gap=g):
-diff --git a/src/sage/interfaces/gap_workspace.py b/src/sage/interfaces/gap_workspace.py
-index 33a87dd5076..03b40be6856 100644
---- a/src/sage/interfaces/gap_workspace.py
-+++ b/src/sage/interfaces/gap_workspace.py
-@@ -16,7 +16,8 @@
- import os
- import time
- import hashlib
--from sage.env import DOT_SAGE, GAP_SO
-+import subprocess
-+from sage.env import DOT_SAGE, HOSTNAME, GAP_LIB_DIR, GAP_SHARE_DIR
- 
- 
- def gap_workspace_file(system="gap", name="workspace", dir=None):
-@@ -59,11 +60,13 @@ def gap_workspace_file(system="gap", name="workspace", dir=None):
-     if dir is None:
-         dir = os.path.join(DOT_SAGE, 'gap')
- 
--    if GAP_SO:
--        h = hashlib.sha1(GAP_SO.encode('utf-8')).hexdigest()
--    else:
--        h = 'unknown'
--    return os.path.join(dir, '%s-%s-%s' % (system, name, h))
-+    data = f'{GAP_LIB_DIR}:{GAP_SHARE_DIR}'
-+    for path in GAP_LIB_DIR, GAP_SHARE_DIR:
-+        sysinfo = os.path.join(path, "sysinfo.gap")
-+        if os.path.exists(sysinfo):
-+            data += subprocess.getoutput(f'. "{sysinfo}" && echo ":$GAP_VERSION:$GAParch"')
-+    h = hashlib.sha1(data.encode('utf-8')).hexdigest()
-+    return os.path.join(dir, f'{system}-{name}-{HOSTNAME}-{h}')
- 
- 
- def prepare_workspace_dir(dir=None):
-diff --git a/src/sage/libs/gap/element.pyx b/src/sage/libs/gap/element.pyx
-index c555ea0333c..e3db3934baf 100644
---- a/src/sage/libs/gap/element.pyx
-+++ b/src/sage/libs/gap/element.pyx
-@@ -130,6 +130,7 @@ cdef char *capture_stdout(Obj func, Obj obj):
-     """
-     cdef Obj s, stream, output_text_string
-     cdef UInt res
-+    cdef TypOutputFile output
-     # The only way to get a string representation of an object that is truly
-     # consistent with how it would be represented at the GAP REPL is to call
-     # ViewObj on it.  Unfortunately, ViewObj *prints* to the output stream,
-@@ -145,12 +146,12 @@ cdef char *capture_stdout(Obj func, Obj obj):
-         output_text_string = GAP_ValueGlobalVariable("OutputTextString")
-         stream = CALL_2ARGS(output_text_string, s, GAP_True)
- 
--        if not OpenOutputStream(stream):
-+        if not OpenOutputStream(&output, stream):
-             raise GAPError("failed to open output capture stream for "
-                            "representing GAP object")
- 
-         CALL_1ARGS(func, obj)
--        CloseOutput()
-+        CloseOutput(&output)
-         return CSTR_STRING(s)
-     finally:
-         GAP_Leave()
-diff --git a/src/sage/libs/gap/gap_includes.pxd b/src/sage/libs/gap/gap_includes.pxd
-index 6d22e32540b..6111d18a5c7 100644
---- a/src/sage/libs/gap/gap_includes.pxd
-+++ b/src/sage/libs/gap/gap_includes.pxd
-@@ -76,8 +76,10 @@ cdef extern from "gap/intobj.h" nogil:
- 
- 
- cdef extern from "gap/io.h" nogil:
--    UInt OpenOutputStream(Obj stream)
--    UInt CloseOutput()
-+    ctypedef struct TypOutputFile:
-+        pass
-+    UInt OpenOutputStream(TypOutputFile* output, Obj stream)
-+    UInt CloseOutput(TypOutputFile* output)
- 
- 
- cdef extern from "gap/libgap-api.h" nogil:
-diff --git a/src/sage/libs/gap/libgap.pyx b/src/sage/libs/gap/libgap.pyx
-index b1a64e57939..6a36613aa8c 100644
---- a/src/sage/libs/gap/libgap.pyx
-+++ b/src/sage/libs/gap/libgap.pyx
-@@ -695,7 +695,7 @@ class Gap(Parent):
-             sage: libgap.List
-             <Gap function "List">
-             sage: libgap.GlobalRandomSource
--            <RandomSource in IsGlobalRandomSource>
-+            <RandomSource in IsGAPRandomSource>
-         """
-         if name in dir(self.__class__):
-             return getattr(self.__class__, name)
-diff --git a/src/sage/libs/gap/saved_workspace.py b/src/sage/libs/gap/saved_workspace.py
-index ad5adec36d0..7636707f557 100644
---- a/src/sage/libs/gap/saved_workspace.py
-+++ b/src/sage/libs/gap/saved_workspace.py
-@@ -8,7 +8,7 @@
- 
- import os
- import glob
--from sage.env import GAP_ROOT_DIR
-+from sage.env import GAP_LIB_DIR
- from sage.interfaces.gap_workspace import gap_workspace_file
- 
- 
-@@ -31,7 +31,7 @@ def timestamp():
-     """
-     libgap_dir = os.path.dirname(__file__)
-     libgap_files = glob.glob(os.path.join(libgap_dir, '*'))
--    gap_packages = glob.glob(os.path.join(GAP_ROOT_DIR, 'pkg', '*'))
-+    gap_packages = glob.glob(os.path.join(GAP_LIB_DIR, 'pkg', '*'))
-     files = libgap_files + gap_packages
-     if len(files) == 0:
-         print('Unable to find LibGAP files.')
-diff --git a/src/sage/libs/gap/util.pyx b/src/sage/libs/gap/util.pyx
-index 344ab88c42a..eaa659d64c7 100644
---- a/src/sage/libs/gap/util.pyx
-+++ b/src/sage/libs/gap/util.pyx
-@@ -13,7 +13,7 @@ Utility functions for GAP
- #*****************************************************************************
- 
- from libc.signal cimport signal, SIGCHLD, SIG_DFL
--from posix.dlfcn cimport dlopen, dlclose, RTLD_NOW, RTLD_GLOBAL
-+from posix.dlfcn cimport dlopen, dlclose, dlerror, RTLD_LAZY, RTLD_GLOBAL
- 
- from cpython.exc cimport PyErr_Fetch, PyErr_Restore
- from cpython.object cimport Py_LT, Py_LE, Py_EQ, Py_NE, Py_GT, Py_GE
-@@ -164,33 +164,6 @@ cdef void gasman_callback() with gil:
- ### Initialization of GAP ##################################################
- ############################################################################
- 
--def gap_root():
--    """
--    Find the location of the GAP root install which is stored in the gap
--    startup script.
--
--    EXAMPLES::
--
--        sage: from sage.libs.gap.util import gap_root
--        sage: gap_root()   # random output
--        '/home/vbraun/opt/sage-5.3.rc0/local/gap/latest'
--    """
--    if os.path.exists(sage.env.GAP_ROOT_DIR):
--        return sage.env.GAP_ROOT_DIR
--
--    # Attempt to figure out the appropriate GAP_ROOT by reading the
--    # local/bin/gap shell script; this is an ugly hack that exists for
--    # historical reasons; the best approach to setting where Sage looks for
--    # the appropriate GAP_ROOT is to set the GAP_ROOT_DIR variable
--    SAGE_LOCAL = sage.env.SAGE_LOCAL
--    with open(os.path.join(SAGE_LOCAL, 'bin', 'gap')) as f:
--        gap_sh = f.read().splitlines()
--    gapdir = next(x for x in gap_sh if x.strip().startswith('GAP_ROOT'))
--    gapdir = gapdir.split('"')[1]
--    gapdir = gapdir.replace('$SAGE_LOCAL', SAGE_LOCAL)
--    return gapdir
--
--
- # To ensure that we call initialize_libgap only once.
- cdef bint _gap_is_initialized = False
- 
-@@ -232,12 +205,12 @@ cdef initialize():
-     # this isn't portable
- 
-     cdef void* handle
--    libgapname = str_to_bytes(sage.env.GAP_SO)
--    handle = dlopen(libgapname, RTLD_NOW | RTLD_GLOBAL)
-+    # reload the current module to force reload of libgap (see #33446)
-+    lib = str_to_bytes(__loader__.path, FS_ENCODING, "surrogateescape")
-+    handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY)
-     if handle is NULL:
--        raise RuntimeError(
--                "Could not dlopen() libgap even though it should already "
--                "be loaded!")
-+        err = dlerror()
-+        raise RuntimeError(f"Could not reload gap library with RTLD_GLOBAL ({err})")
-     dlclose(handle)
- 
-     # Define argv variable, which we will pass in to
-@@ -245,7 +218,7 @@ cdef initialize():
-     cdef char* argv[16]
-     argv[0] = "sage"
-     argv[1] = "-l"
--    s = str_to_bytes(gap_root(), FS_ENCODING, "surrogateescape")
-+    s = str_to_bytes(sage.env.GAP_LIB_DIR + ";" + sage.env.GAP_SHARE_DIR, FS_ENCODING, "surrogateescape")
-     argv[2] = s
- 
-     argv[3] = "-m"
-@@ -362,15 +335,9 @@ cdef Obj gap_eval(str gap_string) except? NULL:
-         GAPError: Error, Variable: 'Complex' must have a value
-         Syntax error: ; expected in stream:1
-         Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^
-+                ^^^^^
-         Error, Variable: 'with' must have a value
--        Syntax error: ; expected in stream:1
--        Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^^^^^^^^^
-         Error, Variable: 'bits' must have a value
--        Syntax error: ; expected in stream:1
--        Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-         Error, Variable: 'precision' must have a value
- 
-     Test that on a subsequent attempt we get the same message (no garbage was
-diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx
-index d8ea7b07f3c..4beb1774df9 100644
---- a/src/sage/libs/singular/singular.pyx
-+++ b/src/sage/libs/singular/singular.pyx
-@@ -1705,14 +1705,7 @@ cdef object si2sa_intvec(intvec *v):
- cdef extern from *: # hack to get at cython macro
-     int unlikely(int)
- 
--cdef extern from "dlfcn.h":
--    void *dlopen(char *, long)
--    char *dlerror()
--    void dlclose(void *handle)
--
--cdef extern from "dlfcn.h":
--    cdef long RTLD_LAZY
--    cdef long RTLD_GLOBAL
-+from posix.dlfcn cimport dlopen, dlclose, dlerror, RTLD_LAZY, RTLD_GLOBAL
- 
- cdef int overflow_check(unsigned long e, ring *_ring) except -1:
-     """
-@@ -1762,8 +1755,6 @@ cdef init_libsingular():
- 
-     cdef void *handle = NULL
- 
--    from sage.env import LIBSINGULAR_PATH
--    lib = str_to_bytes(LIBSINGULAR_PATH, FS_ENCODING, "surrogateescape")
- 
-     # This is a workaround for https://github.com/Singular/Singular/issues/1113
-     # and can be removed once that fix makes it into release of Singular that
-@@ -1780,10 +1771,12 @@ cdef init_libsingular():
- 
-     import platform
-     if not platform.system().startswith("CYGWIN"):
-+        # reload the current module to force reload of libSingular (see #33446)
-+        lib = str_to_bytes(__loader__.path, FS_ENCODING, "surrogateescape")
-         handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY)
-         if not handle:
-             err = dlerror()
--            raise ImportError(f"cannot load Singular library from {LIBSINGULAR_PATH} ({err})")
-+            raise RuntimeError(f"Could not reload Singular library with RTLD_GLOBAL ({err})")
- 
-     # load SINGULAR
-     siInit(lib)
-diff --git a/src/sage/tests/gap_packages.py b/src/sage/tests/gap_packages.py
-index 2e4518ca226..c302b169b8a 100644
---- a/src/sage/tests/gap_packages.py
-+++ b/src/sage/tests/gap_packages.py
-@@ -103,7 +103,7 @@ def all_installed_packages(ignore_dot_gap=False, gap=None):
- 
-         sage: from sage.tests.gap_packages import all_installed_packages
-         sage: all_installed_packages()
--        (...'GAPDoc'...)
-+        (...'gapdoc'...)
-         sage: all_installed_packages(ignore_dot_gap=True) == all_installed_packages(gap=gap, ignore_dot_gap=True)
-         True
-     """
diff --git a/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch b/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
deleted file mode 100644
index d331a6573e1c..000000000000
--- a/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/src/sage/data_structures/stream.py b/src/sage/data_structures/stream.py
-index f8f6dc6a186..002e925f02f 100644
---- a/src/sage/data_structures/stream.py
-+++ b/src/sage/data_structures/stream.py
-@@ -2090,8 +2090,8 @@ def compute_product(self, n, la):
-             sage: f = Stream_exact([1]) # irrelevant for this test
-             sage: g = Stream_function(lambda n: s[n], True, 0)
-             sage: h = Stream_plethysm(f, g, True, p)
--            sage: B = p[2, 2, 1](sum(s[i] for i in range(7)))
--            sage: all(h.compute_product(k, Partition([2, 2, 1])) == B.restrict_degree(k) for k in range(7))
-+            sage: B = p[2, 2, 1](sum(p(s[i]) for i in range(7)))  # long time
-+            sage: all(h.compute_product(k, Partition([2, 2, 1])) == B.restrict_degree(k) for k in range(7))  # long time
-             True
-         """
-         # This is the approximate order of the result
diff --git a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch b/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
deleted file mode 100644
index 007f3324cfe4..000000000000
--- a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index b77c69b2f77..0586a96ae55 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -563,7 +563,7 @@ def complex_to_cmap_rgb(z_values, cmap='turbo', contoured=False, tiled=False,
-     import matplotlib as mpl
- 
-     if isinstance(cmap, str):
--        cmap = mpl.cm.get_cmap(cmap)
-+        cmap = mpl.colormaps[cmap]
- 
-     if contour_base is None:
-         if contour_type == "linear":
-@@ -1206,11 +1206,11 @@ def complex_plot(f, x_range, y_range, contoured=False, tiled=False, cmap=None,
-                 domain = np.linspace(0, 1, 256)
-                 shifted_domain = np.roll(domain, 128)
-                 default_cmap = mpl.colors.LinearSegmentedColormap.from_list(
--                    "sage_default", mpl.cm.get_cmap('hsv')(shifted_domain)
-+                    "sage_default", mpl.colormaps['hsv'](shifted_domain)
-                 )
-                 cmap = default_cmap
-             else:
--                cmap = mpl.cm.get_cmap(cmap)
-+                cmap = mpl.colormaps[cmap]
-         rgbs = complex_to_cmap_rgb(
-             z_values, cmap=cmap, contoured=contoured, tiled=tiled,
-             contour_type=contour_type, contour_base=contour_base,
-diff --git a/src/sage/plot/contour_plot.py b/src/sage/plot/contour_plot.py
-index c0cab456686..4accb309580 100644
---- a/src/sage/plot/contour_plot.py
-+++ b/src/sage/plot/contour_plot.py
-@@ -848,9 +848,7 @@ def f(x,y): return cos(x) + sin(y)
- 
-         sage: contour_plot(lambda x,y: 0, (-1,1), (-1,1),
-         ....:              contours=[0], fill=False, cmap=['blue'])
--        ...
--        UserWarning: No contour levels were found within the data range.
--        Graphics object consisting of 1 graphics primitive
-+        ...Graphics object consisting of 1 graphics primitive
- 
-     .. PLOT::
- 
-@@ -874,8 +872,7 @@ def f(x,y): return cos(x) + sin(y)
-     Check that :trac:`18074` is fixed::
- 
-         sage: contour_plot(0, (0,1), (0,1))
--        ... UserWarning: No contour levels were found within the data range.
--        Graphics object consisting of 1 graphics primitive
-+        ...Graphics object consisting of 1 graphics primitive
- 
-     Domain points in :trac:`11648` with complex output are now skipped::
- 
-diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
-index 64ea1a7e10f..cdc99ced263 100644
---- a/src/sage/plot/graphics.py
-+++ b/src/sage/plot/graphics.py
-@@ -2341,7 +2341,7 @@ def _matplotlib_tick_formatter(self, subplot, base=(10, 10),
-             sage: subplot = Figure().add_subplot(111)
-             sage: p._objects[0]._render_on_subplot(subplot)
-             sage: p._matplotlib_tick_formatter(subplot, **d)
--            (<AxesSubplot:...>,
-+            (<Axes...>,
-             <matplotlib.ticker.MaxNLocator object at ...>,
-             <matplotlib.ticker.MaxNLocator object at ...>,
-             <matplotlib.ticker.ScalarFormatter object at ...>,
-diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
-index 99c817f03a6..ae85183dc93 100644
---- a/src/sage/plot/multigraphics.py
-+++ b/src/sage/plot/multigraphics.py
-@@ -1207,7 +1207,7 @@ def _add_subplot(self, figure, index, **options):
-             sage: fig = Figure()
-             sage: ax1 = G._add_subplot(fig, 0)
-             sage: type(ax1)
--            <class 'matplotlib.axes._subplots.AxesSubplot'>
-+            <class 'matplotlib.axes...'>
-             sage: ax2 = G._add_subplot(fig, 1)
-             sage: fig.get_axes() == [ax1, ax2]
-             True
-diff --git a/src/sage/plot/plot3d/plot_field3d.py b/src/sage/plot/plot3d/plot_field3d.py
-index bdf39391d3e..fe10e27f58f 100644
---- a/src/sage/plot/plot3d/plot_field3d.py
-+++ b/src/sage/plot/plot3d/plot_field3d.py
-@@ -126,9 +126,9 @@ def plot_vector_field3d(functions, xrange, yrange, zrange,
-     vectors = [vector((ff(*point), gg(*point), hh(*point))) for point in points]
- 
-     try:
--        from matplotlib.cm import get_cmap
--        cm = get_cmap(colors)
--    except (TypeError, ValueError):
-+        import matplotlib as mpl
-+        cm = mpl.colormaps[colors]
-+    except (TypeError, KeyError):
-         cm = None
-     if cm is None:
-         if isinstance(colors, (list, tuple)):
diff --git a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch b/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
deleted file mode 100644
index 1e0a708e8068..000000000000
--- a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py
-index c9ca5e30939..9459cb70334 100644
---- a/src/sage/interfaces/maxima_lib.py
-+++ b/src/sage/interfaces/maxima_lib.py
-@@ -77,6 +77,26 @@
-     sage: bar == foo
-     True
- 
-+TESTS:
-+
-+Check our workaround for a race in ecl works, see :trac:`26968`.
-+We use a temporary `MAXIMA_USERDIR` so it's empty; we place it
-+in `DOT_SAGE` since we expect it to have more latency than `/tmp`.
-+
-+    sage: import tempfile, subprocess
-+    sage: tmpdir = tempfile.TemporaryDirectory(dir=DOT_SAGE)
-+    sage: _ = subprocess.run(['sage', '-c',  # long time
-+    ....: f'''
-+    ....: import os
-+    ....: os.environ["MAXIMA_USERDIR"] = "{tmpdir.name}"
-+    ....: if not os.fork():
-+    ....:     import sage.interfaces.maxima_lib
-+    ....: else:
-+    ....:     import sage.interfaces.maxima_lib
-+    ....:     os.wait()
-+    ....: '''])
-+    sage: tmpdir.cleanup()
-+
- """
- 
- # ****************************************************************************
-@@ -116,7 +136,23 @@
- ecl_eval("(setq $nolabels t))")
- ecl_eval("(defvar *MAXIMA-LANG-SUBDIR* NIL)")
- ecl_eval("(set-locale-subdir)")
--ecl_eval("(set-pathnames)")
-+
-+try:
-+    ecl_eval("(set-pathnames)")
-+except RuntimeError:
-+    # Recover from :trac:`26968` by creating `*maxima-objdir*` here.
-+    # This cannot be done before calling `(set-pathnames)` since
-+    # `*maxima-objdir*` is computed there.
-+    # We use python `os.makedirs()` which is immune to the race.
-+    # Using `(ensure-directories-exist ...)` in lisp would be
-+    # subject to the same race condition and since `*maxima-objdir*`
-+    # has multiple components this is quite plausible to happen.
-+    maxima_objdir = ecl_eval("*maxima-objdir*").python()[1:-1]
-+    import os
-+    os.makedirs(maxima_objdir, exist_ok=True)
-+    # Call `(set-pathnames)` again to complete its job.
-+    ecl_eval("(set-pathnames)")
-+
- ecl_eval("(defun add-lineinfo (x) x)")
- ecl_eval('(defun principal nil (cond ($noprincipal (diverg)) ((not pcprntd) (merror "Divergent Integral"))))')
- ecl_eval("(remprop 'mfactorial 'grind)")  # don't use ! for factorials (#11539)
diff --git a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch b/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
deleted file mode 100644
index fc3e40da2a88..000000000000
--- a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff --git a/src/bin/sage-cleaner b/src/bin/sage-cleaner
-index e2e578eec60..dc7d8f0482e 100755
---- a/src/bin/sage-cleaner
-+++ b/src/bin/sage-cleaner
-@@ -99,6 +99,15 @@ def cleanup():
- 
-     return len(pid_list)
- 
-+def cleanup_cruft():
-+    """ remove directories leftover from improper shutdown """
-+    tmp_dirs = os.listdir(SAGE_TMP_ROOT)
-+    for dir_entry in tmp_dirs:
-+        baddir = os.path.join(SAGE_TMP_ROOT, dir_entry)
-+        if os.path.isdir(baddir):
-+            logger.warning('Removing old directory %s from SAGE_TMP_ROOT', baddir)
-+            rm_rf(baddir)
-+
- def kill_spawned_jobs(jobfile, parent_pid):
-     logger.info("Killing %s's spawned jobs", parent_pid)
-     killed_them_all = True
-@@ -193,6 +202,7 @@ if __name__ == '__main__':
-     setup_daemon()
-     fix_old_mistakes()
-     logger.info("Starting sage-cleaner with PID %s", os.getpid())
-+    cleanup_cruft()
- 
-     if len(sys.argv) > 1:
-         wait = int(sys.argv[1])
diff --git a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch b/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
deleted file mode 100644
index ea210e20ae52..000000000000
--- a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py
-index ec6a5c19e60..9dd7bc1cb1e 100644
---- a/src/sage/graphs/generators/families.py
-+++ b/src/sage/graphs/generators/families.py
-@@ -3660,7 +3660,7 @@ def nauty_gentreeg(options="", debug=False):
- 
-         sage: gen = graphs.nauty_gentreeg("4", debug=True)
-         sage: print(next(gen))
--        >A ...gentreeg Z=2:3 D=3 n=4
-+        >A ...gentreeg ...
-         sage: gen = graphs.nauty_gentreeg("4 -q", debug=True)
-         sage: next(gen)
-         ''
-@@ -3687,7 +3687,7 @@ def nauty_gentreeg(options="", debug=False):
-         sage: list(graphs.nauty_gentreeg("3 -x", debug=True))
-         ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n [res/mod] ...
-         sage: list(graphs.nauty_gentreeg("3", debug=True))
--        ['>A ...gentreeg Z=2:2 D=2 n=3\n', Graph on 3 vertices]
-+        ['>A ...gentreeg ...\n', Graph on 3 vertices]
-     """
-     import shlex
-     from sage.features.nauty import NautyExecutable
-diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py
-index df88bbe2713..1a8016976c2 100644
---- a/src/sage/graphs/graph_generators.py
-+++ b/src/sage/graphs/graph_generators.py
-@@ -966,7 +966,7 @@ def nauty_geng(self, options="", debug=False):
-             ...
-             ValueError: wrong format of parameter option
-             sage: list(graphs.nauty_geng("-c3", debug=True))
--            ['>E Usage: ...geng [-cCmtfbd#D#] [-uygsnh] [-lvq] ...
-+            ['>E Usage: ...geng ...\n']
-             sage: list(graphs.nauty_geng("-c 3", debug=True))
-             ['>A ...geng -cd1D2 n=3 e=2-3\n', Graph on 3 vertices, Graph on 3 vertices]
-         """
diff --git a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch b/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
deleted file mode 100644
index 46bda084e48e..000000000000
--- a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-diff --git a/src/sage/repl/inputhook.py b/src/sage/repl/inputhook.py
-index da5df0268c0..7f7894f6dcf 100644
---- a/src/sage/repl/inputhook.py
-+++ b/src/sage/repl/inputhook.py
-@@ -17,6 +17,8 @@
- 
- import select
- import errno
-+import contextlib
-+import io
- 
- from IPython import get_ipython
- from IPython.terminal.pt_inputhooks import register
-@@ -47,15 +49,27 @@ def install():
-     """
-     Install the Sage input hook
- 
--    EXAMPLES::
-+    EXAMPLES:
-+
-+    Make sure ipython is running so we really test this function::
-+
-+        sage: from sage.repl.interpreter import get_test_shell
-+        sage: get_test_shell()
-+        <sage.repl.interpreter.SageTestShell object at ...>
-+
-+    Run the function twice, to check it is idempotent (see :trac:`35235`)::
- 
-         sage: from sage.repl.inputhook import install
-         sage: install()
-+        sage: install()
-     """
-     ip = get_ipython()
-     if not ip:
-         return   # Not running in ipython, e.g. doctests
--    ip.enable_gui('sage')
-+    if ip._inputhook != sage_inputhook:
-+        # silence `ip.enable_gui()` useless output
-+        with contextlib.redirect_stdout(io.StringIO()):
-+            ip.enable_gui('sage')
- 
- 
- def uninstall():
-@@ -71,4 +85,6 @@ def uninstall():
-     if not ip:
-         return
-     if ip._inputhook == sage_inputhook:
--        ip.enable_gui(None)
-+        # silence `ip.enable_gui()` useless output
-+        with contextlib.redirect_stdout(io.StringIO()):
-+            ip.enable_gui(None)
diff --git a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch b/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
deleted file mode 100644
index 2cdc674d4f9e..000000000000
--- a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 532fbbaf71bb41c73920b584108eb2a09d6deeb1 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
-Date: Tue, 4 Apr 2023 12:56:57 -0300
-Subject: [PATCH] Ignore deprecation warnings triggered by pythran 0.12.1
-
-These happen with python 3.11, setuptools 67.6.1, numpy 1.24.2.
-When pythran 0.12.1 is installed, I get 24 doctest failures due to
-deprecation warnings; they are all gone with this commit.
-
-[backported from 839a6e928c264a9863bd42860c78ae95a6d9f3e0]
----
- src/sage/all.py | 12 ++++++++++--
- 1 file changed, 10 insertions(+), 2 deletions(-)
-
-diff --git a/src/sage/all.py b/src/sage/all.py
-index 93588df1b93..ee775aad0e9 100644
---- a/src/sage/all.py
-+++ b/src/sage/all.py
-@@ -96,9 +96,17 @@ warnings.filterwarnings('ignore', category=DeprecationWarning,
- warnings.filterwarnings('ignore', category=DeprecationWarning,
-     module='(.*[.]_vendor[.])?packaging')
- 
--# Ignore numpy warnings triggered by pythran
-+# Ignore a few warnings triggered by pythran 0.12.1
- warnings.filterwarnings('ignore', category=DeprecationWarning,
--                        module='pythran')
-+    message='\n\n  `numpy.distutils` is deprecated since NumPy 1.23.0',
-+    module='pythran.dist')
-+warnings.filterwarnings('ignore', category=DeprecationWarning,
-+    message='pkg_resources is deprecated as an API|'
-+            'Deprecated call to `pkg_resources.declare_namespace(.*)`',
-+    module='pkg_resources')
-+warnings.filterwarnings('ignore', category=DeprecationWarning,
-+    message='msvccompiler is deprecated and slated to be removed',
-+    module='distutils.msvccompiler')
- 
- warnings.filterwarnings('ignore', category=DeprecationWarning,
-                         message='The distutils(.sysconfig module| package) is deprecated',
--- 
-2.40.0
-
diff --git a/srcpkgs/sagemath/patches/35584-networkx_3.1.patch b/srcpkgs/sagemath/patches/35584-networkx_3.1.patch
index 66eedecff7c6..9331258986d3 100644
--- a/srcpkgs/sagemath/patches/35584-networkx_3.1.patch
+++ b/srcpkgs/sagemath/patches/35584-networkx_3.1.patch
@@ -1,8 +1,8 @@
 diff --git a/src/sage/graphs/graph.py b/src/sage/graphs/graph.py
-index c2e42bcbd3..b6a10efbf4 100644
+index c2e42bcbd38..0d13f071dc4 100644
 --- a/src/sage/graphs/graph.py
 +++ b/src/sage/graphs/graph.py
-@@ -6786,13 +6786,21 @@ def cliques_number_of(self, vertices=None, cliques=None):
+@@ -6786,13 +6786,26 @@ def cliques_number_of(self, vertices=None, cliques=None):
              {(0, 0): 2, (0, 1): 3, (0, 2): 2, (1, 0): 2, (1, 1): 3, (1, 2): 2}
              sage: F.cliques_number_of(vertices=[(0, 1), (1, 2)])
              {(0, 1): 3, (1, 2): 2}
@@ -18,15 +18,20 @@ index c2e42bcbd3..b6a10efbf4 100644
 +        if cliques is None:
 +            cliques = self.cliques_maximal()
 +
-+        if vertices in self: # single vertex
++        if vertices in self:  # single vertex
 +            return sum(1 for c in cliques if vertices in c)
-+        else:
-+            return { v : sum(1 for c in cliques if v in c)
-+                     for v in vertices or self }
++
++        from collections import Counter
++        count = Counter()
++
++        for c in cliques:
++            count.update(c)
++
++        return {v : count[v] for v in vertices or self}
  
      @doc_index("Clique-related methods")
      def cliques_get_max_clique_graph(self):
-@@ -7493,17 +7501,32 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
+@@ -7493,17 +7506,32 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
  
              sage: C = Graph('DJ{')
              sage: C.cliques_containing_vertex()
@@ -62,7 +67,7 @@ index c2e42bcbd3..b6a10efbf4 100644
  
          Since each clique of a 2 dimensional grid corresponds to an edge, the
          number of cliques in which a vertex is involved equals its degree::
-@@ -7518,8 +7541,14 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
+@@ -7518,8 +7546,20 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
              sage: sorted(sorted(x for x in L) for L in d[(0, 1)])
              [[(0, 0), (0, 1)], [(0, 1), (0, 2)], [(0, 1), (1, 1)]]
          """
@@ -71,11 +76,17 @@ index c2e42bcbd3..b6a10efbf4 100644
 +        if cliques is None:
 +            cliques = self.cliques_maximal()
 +
-+        if vertices in self: # single vertex
++        if vertices in self:  # single vertex
 +            return [c for c in cliques if vertices in c]
-+        else:
-+            return { v : [c for c in cliques if v in c]
-+                     for v in vertices or self }
++
++        from collections import defaultdict
++        d = defaultdict(list)
++
++        for c in cliques:
++            for v in c:
++                d[v].append(c)
++
++        return {v : d[v] for v in vertices or self}
  
      @doc_index("Clique-related methods")
      def clique_complex(self):
diff --git a/srcpkgs/sagemath/patches/35612-linbox_1.7.0.patch b/srcpkgs/sagemath/patches/35612-linbox_1.7.0.patch
new file mode 100644
index 000000000000..58dddf34a69d
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35612-linbox_1.7.0.patch
@@ -0,0 +1,64 @@
+diff --git a/src/sage/libs/linbox/conversion.pxd b/src/sage/libs/linbox/conversion.pxd
+index 7794c9edc39..1753277b1f1 100644
+--- a/src/sage/libs/linbox/conversion.pxd
++++ b/src/sage/libs/linbox/conversion.pxd
+@@ -177,9 +177,8 @@ cdef inline Vector_integer_dense new_sage_vector_integer_dense(P, DenseVector_in
+     - v -- linbox vector
+     """
+     cdef Vector_integer_dense res = P()
+-    cdef cppvector[Integer] * vec = &v.refRep()
+     cdef size_t i
+     for i in range(<size_t> res._degree):
+-        mpz_set(res._entries[i], vec[0][i].get_mpz_const())
++        mpz_set(res._entries[i], v.getEntry(i).get_mpz_const())
+ 
+     return res
+diff --git a/src/sage/libs/linbox/linbox.pxd b/src/sage/libs/linbox/linbox.pxd
+index 9112d151f8b..bfeda4b6042 100644
+--- a/src/sage/libs/linbox/linbox.pxd
++++ b/src/sage/libs/linbox/linbox.pxd
+@@ -32,7 +32,6 @@ cdef extern from "linbox/matrix/dense-matrix.h":
+         ctypedef Modular_double Field
+         ctypedef double Element
+         DenseMatrix_Modular_double(Field F, size_t m, size_t n)
+-        DenseMatrix_Modular_double(Field F, Element*, size_t m, size_t n)
+         void setEntry(size_t i, size_t j, Element& a)
+         Element &getEntry(size_t i, size_t j)
+ 
+@@ -42,7 +41,6 @@ cdef extern from "linbox/matrix/dense-matrix.h":
+         ctypedef Modular_float Field
+         ctypedef float Element
+         DenseMatrix_Modular_float(Field F, size_t m, size_t n)
+-        DenseMatrix_Modular_float(Field F, Element*, size_t m, size_t n)
+         void setEntry(size_t i, size_t j, Element& a)
+         Element &getEntry(size_t i, size_t j)
+ 
+@@ -101,7 +99,6 @@ cdef extern from "linbox/vector/vector.h":
+         DenseVector_integer (Field &F)
+         DenseVector_integer (Field &F, long& m)
+         DenseVector_integer (Field &F, cppvector[Integer]&)
+-        cppvector[Element]& refRep()
+         size_t size()
+         void resize(size_t)
+         void resize(size_t n, const Element&)
+diff --git a/src/sage/matrix/matrix_modn_dense_template.pxi b/src/sage/matrix/matrix_modn_dense_template.pxi
+index abf29badce6..68b869ce314 100644
+--- a/src/sage/matrix/matrix_modn_dense_template.pxi
++++ b/src/sage/matrix/matrix_modn_dense_template.pxi
+@@ -221,9 +221,14 @@ cdef inline linbox_echelonize_efd(celement modulus, celement* entries, Py_ssize_
+         return 0,[]
+ 
+     cdef ModField *F = new ModField(<long>modulus)
+-    cdef DenseMatrix *A = new DenseMatrix(F[0], <ModField.Element*>entries,<Py_ssize_t>nrows, <Py_ssize_t>ncols)
+-    cdef Py_ssize_t r = reducedRowEchelonize(A[0])
++    cdef DenseMatrix *A = new DenseMatrix(F[0], nrows, ncols)
++
+     cdef Py_ssize_t i,j
++    for i in range(nrows):
++        for j in range(ncols):
++            A.setEntry(i, j, entries[i*ncols+j])
++
++    cdef Py_ssize_t r = reducedRowEchelonize(A[0])
+     for i in range(nrows):
+         for j in range(ncols):
+             entries[i*ncols+j] = <celement>A.getEntry(i,j)
diff --git a/srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch b/srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch
new file mode 100644
index 000000000000..9f00fb17271c
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch
@@ -0,0 +1,578 @@
+diff --git a/build/pkgs/ecl/dependencies b/build/pkgs/ecl/dependencies
+index cda6316bf5a..51a953403e9 100644
+--- a/build/pkgs/ecl/dependencies
++++ b/build/pkgs/ecl/dependencies
+@@ -1,4 +1,4 @@
+-$(MP_LIBRARY) readline gc libffi
++$(MP_LIBRARY) readline gc libffi info
+ 
+ ----------
+ All lines of this file are ignored except the first.
+diff --git a/build/pkgs/ecl/spkg-configure.m4 b/build/pkgs/ecl/spkg-configure.m4
+index ae1e0ac5e1a..7dbcfa6377b 100644
+--- a/build/pkgs/ecl/spkg-configure.m4
++++ b/build/pkgs/ecl/spkg-configure.m4
+@@ -35,10 +35,7 @@ SAGE_SPKG_CONFIGURE([ecl], [
+     AC_SUBST(SAGE_ECL_CONFIG, [$ECL_CONFIG])
+   fi
+ 
+-  # Maxima cannot yet be provided by the system, so we always use
++  # Kenzo cannot yet be provided by the system, so we always use
+   # the SAGE_LOCAL path for now.
+-  AC_SUBST(SAGE_MAXIMA_FAS, ['${prefix}'/lib/ecl/maxima.fas])
+-
+-  # Likewise for the optional Kenzo SPKG
+   AC_SUBST(SAGE_KENZO_FAS, ['${prefix}'/lib/ecl/kenzo.fas])
+ ])
+diff --git a/build/pkgs/ecl/spkg-install.in b/build/pkgs/ecl/spkg-install.in
+index ee1667aec16..72083337942 100644
+--- a/build/pkgs/ecl/spkg-install.in
++++ b/build/pkgs/ecl/spkg-install.in
+@@ -31,18 +31,6 @@ cp "$SAGE_ROOT"/config/config.* src
+ 
+ if [ x"$SAGE_SPKG_INSTALL_DOCS" != xyes ] ; then
+     ECL_CONFIGURE="$ECL_CONFIGURE --enable-manual=no"
+-else
+-    # ECL 2020 needs modern makeinfo
+-    command -v texi2any >/dev/null 2>&1
+-    if [ $? -ne 0 ]; then # texi2any not found -> makeinfo too old, if present
+-        ECL_CONFIGURE="$ECL_CONFIGURE --enable-manual=no"
+-    else
+-        if makeinfo -c foo 2>&1 | grep -q invalid; then
+-            # makeinfo found but does not support all options that ecl
+-            # likes to use
+-            ECL_CONFIGURE="$ECL_CONFIGURE --enable-manual=no"
+-        fi
+-    fi
+ fi
+ 
+ sdh_configure $SAGE_CONFIGURE_GMP \
+diff --git a/build/pkgs/giac/spkg-configure.m4 b/build/pkgs/giac/spkg-configure.m4
+index 5859e35f12e..b677184b7be 100644
+--- a/build/pkgs/giac/spkg-configure.m4
++++ b/build/pkgs/giac/spkg-configure.m4
+@@ -5,7 +5,7 @@ SAGE_SPKG_CONFIGURE([giac], [
+        m4_pushdef([GIAC_MAX_VERSION], [1.9.999])
+        AC_CACHE_CHECK([for giac >= ]GIAC_MIN_VERSION[, <= ]GIAC_MAX_VERSION, [ac_cv_path_GIAC], [
+          AC_PATH_PROGS_FEATURE_CHECK([GIAC], [giac], [
+-            giac_version=$($ac_path_GIAC --version 2> /dev/null | tail -1)
++            giac_version=$($ac_path_GIAC --version 2> /dev/null | tail -n -1)
+             AS_IF([test -n "$giac_version"], [
+                 AX_COMPARE_VERSION([$giac_version], [ge], GIAC_MIN_VERSION, [
+                     AX_COMPARE_VERSION([$giac_version], [le], GIAC_MAX_VERSION, [
+diff --git a/build/pkgs/info/spkg-configure.m4 b/build/pkgs/info/spkg-configure.m4
+index 0980a4b8ef8..85fe1ea4731 100644
+--- a/build/pkgs/info/spkg-configure.m4
++++ b/build/pkgs/info/spkg-configure.m4
+@@ -1,4 +1,14 @@
+ SAGE_SPKG_CONFIGURE([info], [
+   AC_PATH_PROG(INFO, info)
+-  AS_IF([test -z "${INFO}"], [sage_spkg_install_info=yes])
++  AS_IF([test -z "${INFO}"], [sage_spkg_install_info=yes
++    ], [
++     dnl very old makeinfo are not texi2any, newer are symlinks to texi2any
++     AC_PATH_PROG(TEXI2ANY, texi2any)
++     AS_IF([test -z "${TEXI2ANY}"], [sage_spkg_install_info=yes
++       ], [
++        AS_IF([makeinfo -c foo 2>&1 | grep -q invalid], [
++         dnl makeinfo found, but too old, and  does not support all options that ecl likes to use
++         sage_spkg_install_info=yes])
++       ])
++    ])
+ ])
+diff --git a/build/pkgs/info/spkg-install.in b/build/pkgs/info/spkg-install.in
+index 8086e4b2ec8..3ea8c053669 100644
+--- a/build/pkgs/info/spkg-install.in
++++ b/build/pkgs/info/spkg-install.in
+@@ -1,2 +1,2 @@
+-cd src/info
++cd src
+ sdh_make_install
+diff --git a/build/pkgs/info/type b/build/pkgs/info/type
+index 134d9bc32d5..a6a7b9cd726 100644
+--- a/build/pkgs/info/type
++++ b/build/pkgs/info/type
+@@ -1 +1 @@
+-optional
++standard
+diff --git a/build/pkgs/maxima/checksums.ini b/build/pkgs/maxima/checksums.ini
+index a804c7b831f..0f594389fe6 100644
+--- a/build/pkgs/maxima/checksums.ini
++++ b/build/pkgs/maxima/checksums.ini
+@@ -1,5 +1,5 @@
+ tarball=maxima-VERSION.tar.gz
+-sha1=ed15d5285794413ba94412079eca3d0fa55a47bf
+-md5=9b9ae1dace55b1386739dabaa9122e60
+-cksum=1765409766
++sha1=1010594e6d6082bbd8efaac1b7756ec1721a4ed5
++md5=3c01f1daa6936e11d8713fef7751d3fe
++cksum=2420393096
+ upstream_url=https://sourceforge.net/projects/maxima/files/Maxima-source/VERSION-source/maxima-VERSION.tar.gz/download
+diff --git a/build/pkgs/maxima/distros/arch.txt b/build/pkgs/maxima/distros/arch.txt
+index 6400290f44d..6ac052fa62b 100644
+--- a/build/pkgs/maxima/distros/arch.txt
++++ b/build/pkgs/maxima/distros/arch.txt
+@@ -1 +1 @@
+-maxima-ecl
++maxima-fas
+diff --git a/build/pkgs/maxima/distros/cygwin.txt b/build/pkgs/maxima/distros/cygwin.txt
+new file mode 100644
+index 00000000000..f5fe3fdc6cb
+--- /dev/null
++++ b/build/pkgs/maxima/distros/cygwin.txt
+@@ -0,0 +1 @@
++maxima
+diff --git a/build/pkgs/maxima/distros/freebsd.txt b/build/pkgs/maxima/distros/freebsd.txt
+new file mode 100644
+index 00000000000..766a71b5074
+--- /dev/null
++++ b/build/pkgs/maxima/distros/freebsd.txt
+@@ -0,0 +1 @@
++math/maxima
+diff --git a/build/pkgs/maxima/distros/gentoo.txt b/build/pkgs/maxima/distros/gentoo.txt
+new file mode 100644
+index 00000000000..85fb33f1610
+--- /dev/null
++++ b/build/pkgs/maxima/distros/gentoo.txt
+@@ -0,0 +1,2 @@
++sci-mathematics/maxima[ecls]
++
+diff --git a/build/pkgs/maxima/package-version.txt b/build/pkgs/maxima/package-version.txt
+index 83476624dc0..5681375f3be 100644
+--- a/build/pkgs/maxima/package-version.txt
++++ b/build/pkgs/maxima/package-version.txt
+@@ -1 +1 @@
+-5.45.0.p0
++5.46.0
+diff --git a/build/pkgs/maxima/patches/matrixexp.patch b/build/pkgs/maxima/patches/matrixexp.patch
+deleted file mode 100644
+index 5c8527c33bf..00000000000
+--- a/build/pkgs/maxima/patches/matrixexp.patch
++++ /dev/null
+@@ -1,15 +0,0 @@
+-diff --git a/share/linearalgebra/matrixexp.lisp b/share/linearalgebra/matrixexp.lisp
+-index 218bf35..f2fd468 100644
+---- a/share/linearalgebra/matrixexp.lisp
+-+++ b/share/linearalgebra/matrixexp.lisp
+-@@ -138,8 +138,8 @@
+- 	   (print `(ratvars = ,$ratvars gcd = '$gcd algebraic = ,$algebraic))
+- 	   (print `(ratfac = ,$ratfac))
+- 	   (merror "Unable to find the spectrum")))
+--   
+--    (setq res ($fullratsimp (ncpower (sub (mult z ($ident n)) mat) -1) z))
+-+
+-+    (setq res ($fullratsimp ($invert_by_lu (sub (mult z ($ident n)) mat) '$crering) z))
+-     (setq m (length sp))
+-     (dotimes (i m)
+-       (setq zi (nth i sp))
+diff --git a/build/pkgs/maxima/patches/maxima.system.patch b/build/pkgs/maxima/patches/maxima.system.patch
+deleted file mode 100644
+index 74db62e7f9f..00000000000
+--- a/build/pkgs/maxima/patches/maxima.system.patch
++++ /dev/null
+@@ -1,25 +0,0 @@
+-diff --git a/src/maxima.system b/src/maxima.system
+-index 76f2452..cf25f51 100644
+---- a/src/maxima.system
+-+++ b/src/maxima.system
+-@@ -1,5 +1,8 @@
+- ;;; -*- Lisp -*-
+- 
+-+(require :cmp)
+-+(setf c::*compile-in-constants* t)
+-+
+- (in-package :cl-user)
+- 
+- (pushnew :cl *features*)
+-@@ -75,6 +78,11 @@
+- 			     ;; Convert dir/foo.fas to dir/foo.o
+- 			     (make-pathname :type "o" :defaults p))
+- 			 files)))
+-+	(c::build-fasl "binary-ecl/maxima" :lisp-files obj
+-+			  :ld-flags
+-+			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
+-+							      (find-package "MAXIMA")))))
+-+			    (if (and x (not (string= x ""))) (list x))))
+- 	(c::build-program "binary-ecl/maxima" :lisp-files obj
+- 			  :ld-flags
+- 			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
+diff --git a/build/pkgs/maxima/spkg-configure.m4 b/build/pkgs/maxima/spkg-configure.m4
+new file mode 100644
+index 00000000000..dc54525320e
+--- /dev/null
++++ b/build/pkgs/maxima/spkg-configure.m4
+@@ -0,0 +1,46 @@
++SAGE_SPKG_CONFIGURE([maxima], [
++  m4_pushdef([SAGE_MAXIMA_MINVER],["5.45.0"])dnl this version and higher allowed
++  SAGE_SPKG_DEPCHECK([ecl], [
++    dnl First check for the "maxima" executable in the user's PATH, because
++    dnl we still use pexpect to communicate with it in a few places.
++    AC_CACHE_CHECK([for Maxima >= $SAGE_MAXIMA_MINVER], [ac_cv_path_MAXIMA], [
++        AC_PATH_PROGS_FEATURE_CHECK([MAXIMA], [maxima], [
++            maxima_version=`$ac_path_MAXIMA --version 2>&1 | tail -n -1\
++                | $SED -n -e 's/Maxima *\([[0-9]]*\.[[0-9]]*\.[[0-9]]*\)/\1/p'`
++            AS_IF([test -n "$maxima_version"], [
++                AX_COMPARE_VERSION([$maxima_version], [ge], [SAGE_MAXIMA_MINVER], [
++                    ac_cv_path_MAXIMA="$ac_path_MAXIMA"
++                    ac_path_MAXIMA_found=:
++                ])
++            ])
++        ])
++    ])
++    SAGE_MAXIMA="$ac_cv_path_MAXIMA"
++    AS_IF([test -z "${SAGE_MAXIMA}"], [
++      sage_spkg_install_maxima=yes
++    ],[
++      dnl If we have the executable, check also for the ECL library.
++      AC_MSG_CHECKING([if ECL can "require" the maxima module])
++      AS_IF([ecl --eval "(require 'maxima)" --eval "(quit)" \
++               >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD], [
++        AC_MSG_RESULT(yes)
++      ], [
++        AC_MSG_RESULT(no)
++        sage_spkg_install_maxima=yes
++      ])
++    ])
++  ])
++  m4_popdef([SAGE_MAXIMA_MINVER])
++],[],[],[
++  # post-check
++  AS_IF([test x$sage_spkg_install_maxima = xyes], [
++    dnl Leaving this variable empty will tell sagelib to load
++    dnl the maxima library (within ECL) by name instead of by
++    dnl absolute path.
++    SAGE_MAXIMA='${prefix}'/bin/maxima
++    SAGE_MAXIMA_FAS='${prefix}'/lib/ecl/maxima.fas
++  ])
++
++  AC_SUBST(SAGE_MAXIMA, "${SAGE_MAXIMA}")
++  AC_SUBST(SAGE_MAXIMA_FAS, "${SAGE_MAXIMA_FAS}")
++])
+diff --git a/build/pkgs/maxima/spkg-install.in b/build/pkgs/maxima/spkg-install.in
+index 3ae6382f9ba..cdb6fbf2069 100644
+--- a/build/pkgs/maxima/spkg-install.in
++++ b/build/pkgs/maxima/spkg-install.in
+@@ -28,28 +28,6 @@ echo
+ echo "Now configuring Maxima..."
+ sdh_configure --enable-ecl git_found=false
+ 
+-# Note the following is regression in maxima build system
+-# see https://sourceforge.net/p/maxima/bugs/3278/
+-# and https://sourceforge.net/p/maxima/bugs/2878/
+-# For the previous time it was fixed.
+-#---------------------------------------------------------------
+-# Touching html and info file to avoid to regenerate them.
+-# This must be done after configuration since the timestamp need
+-# to be later than include-maxima.texi which is generated at
+-# configuration time
+-for i in doc/info/*.html ; do
+-    touch "${i}"
+-done
+-touch doc/info/maxima.info*
+-# Maxima 5.44.0 build_html.sh is not compatible with makeinfo 4.8
+-# (which is /usr/bin/makeinfo on macOS).  #30063
+-# Do not build the HTML docs unless the user asks for it,
+-# in which case it is their problem to install a better
+-# makeinfo version.
+-if [[ "$SAGE_SPKG_INSTALL_DOCS" != yes ]] ; then
+-touch doc/info/maxima_toc.html interfaces/xmaxima/doc/xmaxima.html
+-fi
+-
+ #---------------------------------------------------------------
+ 
+ sdh_make
+diff --git a/build/pkgs/tox/spkg-configure.m4 b/build/pkgs/tox/spkg-configure.m4
+index 7d8ade4c14b..3de0b9b710d 100644
+--- a/build/pkgs/tox/spkg-configure.m4
++++ b/build/pkgs/tox/spkg-configure.m4
+@@ -5,7 +5,7 @@ SAGE_SPKG_CONFIGURE([tox], [
+        m4_pushdef([TOX4_MIN_VERSION], [4.0.15])
+        AC_CACHE_CHECK([for tox 3 >= ]TOX3_MIN_VERSION[ or tox 4 >= ]TOX4_MIN_VERSION, [ac_cv_path_TOX], [
+          AC_PATH_PROGS_FEATURE_CHECK([TOX], [tox], [
+-            tox_version=$($ac_path_TOX --version 2> /dev/null | tail -1)
++            tox_version=$($ac_path_TOX --version 2> /dev/null | tail -n -1)
+             AS_IF([test -n "$tox_version"], [
+                 AX_COMPARE_VERSION([$tox_version], [lt], [4], [
+                     AX_COMPARE_VERSION([$tox_version], [ge], TOX3_MIN_VERSION, [
+diff --git a/pkgs/sage-conf/_sage_conf/_conf.py.in b/pkgs/sage-conf/_sage_conf/_conf.py.in
+index d66bdb3d264..f2e197b45ed 100644
+--- a/pkgs/sage-conf/_sage_conf/_conf.py.in
++++ b/pkgs/sage-conf/_sage_conf/_conf.py.in
+@@ -9,9 +9,11 @@ VERSION = "@PACKAGE_VERSION@"
+ SAGE_LOCAL = "@prefix@"
+ SAGE_ROOT = "@SAGE_ROOT@"
+ 
+-MAXIMA = "@prefix@/bin/maxima"
++# The path to the standalone maxima executable.
++MAXIMA = "@SAGE_MAXIMA@".replace('${prefix}', SAGE_LOCAL)
+ 
+-# Delete this line if your ECL can load maxima without further prodding.
++# Set this to the empty string if your ECL can load maxima without
++# further prodding.
+ MAXIMA_FAS = "@SAGE_MAXIMA_FAS@".replace('${prefix}', SAGE_LOCAL)
+ 
+ # Delete this line if your ECL can load Kenzo without further prodding.
+diff --git a/src/bin/sage-env b/src/bin/sage-env
+index a7da60df28f..13b54fa7e92 100644
+--- a/src/bin/sage-env
++++ b/src/bin/sage-env
+@@ -440,9 +440,6 @@ if [ -d "$DOT_SAGE" ] ; then
+     fi
+ fi
+ 
+-if [ -n "$SAGE_LOCAL" ]; then
+-    export MAXIMA_PREFIX="$SAGE_LOCAL"
+-fi
+ export MAXIMA_USERDIR="$DOT_SAGE/maxima"
+ 
+ if [ -n "$SAGE_LOCAL" ]; then
+diff --git a/src/sage/calculus/calculus.py b/src/sage/calculus/calculus.py
+index dae380180ac..ccb8219062b 100644
+--- a/src/sage/calculus/calculus.py
++++ b/src/sage/calculus/calculus.py
+@@ -136,10 +136,11 @@
+     [          1/2*(e^(2*sqrt(x)) + 1)*e^(x - sqrt(x)) 1/2*(x*e^(2*sqrt(x)) - x)*sqrt(x)*e^(x - sqrt(x))]
+     [  1/2*(e^(2*sqrt(x)) - 1)*e^(x - sqrt(x))/x^(3/2)           1/2*(e^(2*sqrt(x)) + 1)*e^(x - sqrt(x))]
+ 
+-And complex exponentiation works now::
++Complex exponentiation works, but may require a patched version of
++maxima (:trac:`32898`) for now::
+ 
+     sage: M = i*matrix([[pi]])
+-    sage: e^M
++    sage: e^M  # not tested, requires patched maxima
+     [-1]
+     sage: M = i*matrix([[pi,0],[0,2*pi]])
+     sage: e^M
+@@ -1186,8 +1187,18 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
+         e
+         sage: f.limit(x=5)
+         7776/3125
+-        sage: f.limit(x=1.2)
++
++    Domain to real, a regression in 5.46.0, see https://sf.net/p/maxima/bugs/4138 ::
++
++        sage: maxima_calculus.eval("domain:real")
++        ...
++        sage: f.limit(x=1.2).n()
+         2.06961575467...
++        sage: maxima_calculus.eval("domain:complex");
++        ...
++
++    Otherwise, it works ::
++
+         sage: f.limit(x=I, taylor=True)
+         (-I + 1)^I
+         sage: f(x=1.2)
+@@ -1203,7 +1214,7 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
+ 
+         sage: var('a')
+         a
+-        sage: limit(x^a,x=0)
++        sage: limit(x^a,x=0)  # random - maxima 5.46.0 does not need extra assumption
+         Traceback (most recent call last):
+         ...
+         ValueError: Computation failed since Maxima requested additional
+@@ -1215,7 +1226,7 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
+     With this example, Maxima is looking for a LOT of information::
+ 
+         sage: assume(a>0)
+-        sage: limit(x^a,x=0)
++        sage: limit(x^a,x=0)  # random - maxima 5.46.0 does not need extra assumption
+         Traceback (most recent call last):
+         ...
+         ValueError: Computation failed since Maxima requested additional
+@@ -1224,7 +1235,7 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
+          more details)
+         Is a an integer?
+         sage: assume(a,'integer')
+-        sage: limit(x^a, x=0)
++        sage: limit(x^a, x=0)  # random - maxima 5.46.0 does not need extra assumption
+         Traceback (most recent call last):
+         ...
+         ValueError: Computation failed since Maxima requested additional
+@@ -2251,10 +2262,10 @@ def symbolic_expression_from_maxima_string(x, equals_sub=False, maxima=maxima):
+         True
+         sage: sefms("x # 3") == SR(x != 3)
+         True
+-        sage: solve([x != 5], x)
+-        [[x - 5 != 0]]
++        sage: solve([x != 5], x) in [[[x - 5 != 0]], [[x < 5], [5 < x]]]
++        True
+         sage: solve([2*x==3, x != 5], x)
+-        [[x == (3/2), (-7/2) != 0]]
++        [[x == (3/2)...
+ 
+     Make sure that we don't accidentally pick up variables in the maxima namespace (:trac:`8734`)::
+ 
+diff --git a/src/sage/functions/exp_integral.py b/src/sage/functions/exp_integral.py
+index e6c888c64b6..fb0e2235e2b 100644
+--- a/src/sage/functions/exp_integral.py
++++ b/src/sage/functions/exp_integral.py
+@@ -601,8 +601,8 @@ class Function_log_integral_offset(BuiltinFunction):
+         1/log(x)
+         sage: f.integrate(x)
+         -x*log_integral(2) + x*log_integral(x) - Ei(2*log(x))
+-        sage: Li(x).integrate(x,2.0,4.5)
+-        -2.5*log_integral(2) + 5.799321147411334
++        sage: Li(x).integrate(x,2.0,4.5).n()
++        3.18641169711760
+         sage: N(f.integrate(x,2.0,3.0))   # abs tol 1e-15
+         0.601621785860587
+ 
+diff --git a/src/sage/interfaces/expect.py b/src/sage/interfaces/expect.py
+index 68ae715e4c3..84adf0341b5 100644
+--- a/src/sage/interfaces/expect.py
++++ b/src/sage/interfaces/expect.py
+@@ -620,7 +620,7 @@ def quit(self, verbose=False):
+ 
+             sage: a = maxima('y')
+             sage: maxima.quit(verbose=True)
+-            Exiting Maxima with PID ... running .../bin/maxima...
++            Exiting Maxima with PID ... running ...maxima...
+             sage: a._check_valid()
+             Traceback (most recent call last):
+             ...
+diff --git a/src/sage/interfaces/maxima.py b/src/sage/interfaces/maxima.py
+index 27b1e98a6ac..4829560f98b 100644
+--- a/src/sage/interfaces/maxima.py
++++ b/src/sage/interfaces/maxima.py
+@@ -622,11 +622,6 @@ def _start(self):
+             sage: m.is_running()
+             True
+ 
+-        Test that we can use more than 256MB RAM (see :trac:`6772`)::
+-
+-            sage: a = maxima(10)^(10^5)
+-            sage: b = a^600              # long time -- about 10-15 seconds
+-
+         """
+         Expect._start(self)
+         self._sendline(r":lisp (defun tex-derivative (x l r) (tex (if $derivabbrev (tex-dabbrev x) (tex-d x '\\partial)) l r lop rop ))")
+@@ -634,9 +629,6 @@ def _start(self):
+         # Don't use ! for factorials (#11539)
+         self._sendline(":lisp (remprop 'mfactorial 'grind)")
+ 
+-        # Remove limit on the max heapsize (since otherwise it defaults
+-        # to 256MB with ECL).
+-        self._sendline(":lisp (ext:set-limit 'ext:heap-size 0)")
+         self._eval_line('0;')
+ 
+         # set random seed
+diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py
+index c263ac65f02..bba8504aa92 100644
+--- a/src/sage/interfaces/maxima_lib.py
++++ b/src/sage/interfaces/maxima_lib.py
+@@ -934,8 +934,15 @@ def sr_limit(self, expr, v, a, dir=None):
+             e
+             sage: limit(f,x = 5)
+             7776/3125
+-            sage: limit(f,x = 1.2)
++
++        Domain to real, a regression in 5.46.0, see https://sf.net/p/maxima/bugs/4138 ::
++
++            sage: maxima_calculus.eval("domain:real")
++            ...
++            sage: limit(f,x = 1.2).n()
+             2.06961575467...
++            sage: maxima_calculus.eval("domain:complex");
++            ...
+             sage: var('a')
+             a
+             sage: limit(x^a,x=0)
+@@ -947,7 +954,7 @@ def sr_limit(self, expr, v, a, dir=None):
+             for more details)
+             Is a positive, negative or zero?
+             sage: assume(a>0)
+-            sage: limit(x^a,x=0)
++            sage: limit(x^a,x=0)  # random - not needed for maxima 5.46.0
+             Traceback (most recent call last):
+             ...
+             ValueError: Computation failed ...
+diff --git a/src/sage/matrix/matrix2.pyx b/src/sage/matrix/matrix2.pyx
+index e2e6449dfa9..15914b0be3e 100644
+--- a/src/sage/matrix/matrix2.pyx
++++ b/src/sage/matrix/matrix2.pyx
+@@ -15425,9 +15425,10 @@ cdef class Matrix(Matrix1):
+ 
+         TESTS:
+ 
+-        Check that sparse matrices are handled correctly (:trac:`28935`)::
++        Sparse matrices are handled correctly (:trac:`28935`), but may
++        require a patched version of maxima (:trac:`32898`) for now::
+ 
+-            sage: matrix.diagonal([0], sparse=True).exp()
++            sage: matrix.diagonal([0], sparse=True).exp()  # not tested, requires patched maxima
+             [1]
+             sage: matrix.zero(CBF, 2, sparse=True).exp()
+             [1.000000000000000                 0]
+diff --git a/src/sage/matrix/matrix_symbolic_dense.pyx b/src/sage/matrix/matrix_symbolic_dense.pyx
+index 19ca5c85cb2..58a25e002f6 100644
+--- a/src/sage/matrix/matrix_symbolic_dense.pyx
++++ b/src/sage/matrix/matrix_symbolic_dense.pyx
+@@ -402,7 +402,8 @@ cdef class Matrix_symbolic_dense(Matrix_generic_dense):
+             [1/2*(e^(2*x) + 1)*e^(-x) 1/2*(e^(2*x) - 1)*e^(-x)]
+             [1/2*(e^(2*x) - 1)*e^(-x) 1/2*(e^(2*x) + 1)*e^(-x)]
+ 
+-        Exp works on 0x0 and 1x1 matrices::
++        Exponentiation works on 0x0 and 1x1 matrices, but the 1x1 example
++        requires a patched version of maxima (:trac:`32898`) for now::
+ 
+             sage: m = matrix(SR,0,[]); m
+             []
+@@ -410,7 +411,7 @@ cdef class Matrix_symbolic_dense(Matrix_generic_dense):
+             []
+             sage: m = matrix(SR,1,[2]); m
+             [2]
+-            sage: m.exp()
++            sage: m.exp()  # not tested, requires patched maxima
+             [e^2]
+ 
+         Commuting matrices `m, n` have the property that
+@@ -451,7 +452,6 @@ cdef class Matrix_symbolic_dense(Matrix_generic_dense):
+             [                       0 1/2*(e^(2*x) + 1)*e^(-x) 1/2*(e^(2*x) - 1)*e^(-x)                        0]
+             [                       0 1/2*(e^(2*x) - 1)*e^(-x) 1/2*(e^(2*x) + 1)*e^(-x)                        0]
+             [1/2*(e^(2*x) - 1)*e^(-x)                        0                        0 1/2*(e^(2*x) + 1)*e^(-x)]
+-
+         """
+         if not self.is_square():
+             raise ValueError("exp only defined on square matrices")
+diff --git a/src/sage/symbolic/integration/integral.py b/src/sage/symbolic/integration/integral.py
+index c82e9ed73c3..e84ad357ee2 100644
+--- a/src/sage/symbolic/integration/integral.py
++++ b/src/sage/symbolic/integration/integral.py
+@@ -741,14 +741,14 @@ def integrate(expression, v=None, a=None, b=None, algorithm=None, hold=False):
+ 
+         sage: _ = var('x,y')
+         sage: f = log(x^2+y^2)
+-        sage: res = integral(f,x,0.0001414, 1.); res
++        sage: res = integral(f,x,1414/10^7, 1); res
+         Traceback (most recent call last):
+         ...
+-        ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(50015104*y^2-50015103>0)', see `assume?` for more details)
+-        Is 50015104*y^2-50015103 positive, negative or zero?
++        ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help ...
++        Is ... positive, negative or zero?
+         sage: assume(y>1)
+-        sage: res = integral(f,x,0.0001414, 1.); res
+-        2*y*arctan(1.0/y) - 2*y*arctan(0.0001414/y) + 1.0*log(1.0*y^2 + 1.0) - 0.0001414*log(1.0*y^2 + 1.9993959999999997e-08) - 1.9997172
++        sage: res = integral(f,x,1414/10^7, 1); res
++        -2*y*arctan(707/5000000/y) + 2*y*arctan(1/y) + log(y^2 + 1) - 707/5000000*log(y^2 + 499849/25000000000000) - 4999293/2500000
+         sage: nres = numerical_integral(f.subs(y=2), 0.0001414, 1.); nres
+         (1.4638323264144..., 1.6251803529759...e-14)
+         sage: res.subs(y=2).n()
+diff --git a/src/sage/symbolic/relation.py b/src/sage/symbolic/relation.py
+index 94813315181..a72ab547c76 100644
+--- a/src/sage/symbolic/relation.py
++++ b/src/sage/symbolic/relation.py
+@@ -1787,8 +1787,8 @@ def solve_ineq_fourier(ineq, vars=None):
+         sage: y = var('y')
+         sage: solve_ineq_fourier([x+y<9,x-y>4],[x,y])
+         [[y + 4 < x, x < -y + 9, y < (5/2)]]
+-        sage: solve_ineq_fourier([x+y<9,x-y>4],[y,x])
+-        [[y < min(x - 4, -x + 9)]]
++        sage: solve_ineq_fourier([x+y<9,x-y>4],[y,x])[0][0](x=42)
++        y < -33
+ 
+         sage: solve_ineq_fourier([x^2>=0])
+         [[x < +Infinity]]
diff --git a/srcpkgs/sagemath/patches/35635-sympy_1.12.patch b/srcpkgs/sagemath/patches/35635-sympy_1.12.patch
new file mode 100644
index 000000000000..9cfc69c2adb6
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35635-sympy_1.12.patch
@@ -0,0 +1,54 @@
+diff --git a/src/sage/calculus/calculus.py b/src/sage/calculus/calculus.py
+index dae380180ac..ca3c59e63d2 100644
+--- a/src/sage/calculus/calculus.py
++++ b/src/sage/calculus/calculus.py
+@@ -1690,8 +1690,11 @@ def laplace(ex, t, s, algorithm='maxima'):
+ 
+     Testing SymPy::
+ 
+-        sage: laplace(t^n, t, s, algorithm='sympy')
+-        (gamma(n + 1)/(s*s^n), 0, re(n) > -1)
++        sage: F, a, cond = laplace(t^n, t, s, algorithm='sympy')
++        sage: a, cond
++        (0, re(n) > -1)
++        sage: F.simplify()
++        s^(-n - 1)*gamma(n + 1)
+ 
+     Testing Maxima::
+ 
+@@ -1700,17 +1703,19 @@ def laplace(ex, t, s, algorithm='maxima'):
+ 
+     Check that :trac:`24212` is fixed::
+ 
+-        sage: laplace(cos(t^2), t, s, algorithm='sympy')
+-        (-1/2*sqrt(pi)*(sqrt(2)*cos(1/4*s^2)*fresnel_sin(1/2*sqrt(2)*s/sqrt(pi)) -
+-        sqrt(2)*fresnel_cos(1/2*sqrt(2)*s/sqrt(pi))*sin(1/4*s^2) - cos(1/4*pi + 1/4*s^2)),
+-        0, True)
++        sage: F, a, cond = laplace(cos(t^2), t, s, algorithm='sympy')
++        sage: a, cond
++        (0, True)
++        sage: F._sympy_().simplify()
++        sqrt(pi)*(sqrt(2)*sin(s**2/4)*fresnelc(sqrt(2)*s/(2*sqrt(pi))) -
++        sqrt(2)*cos(s**2/4)*fresnels(sqrt(2)*s/(2*sqrt(pi))) + cos(s**2/4 + pi/4))/2
+ 
+     Testing result from SymPy that Sage doesn't know how to handle::
+ 
+         sage: laplace(cos(-1/t), t, s, algorithm='sympy')
+         Traceback (most recent call last):
+         ...
+-        AttributeError: Unable to convert SymPy result (=meijerg(((), ()), ((-1/2, 0, 1/2), (0,)), s**2/16)/4) into Sage
++        AttributeError: Unable to convert SymPy result (=meijerg(((), ()), ((-1/2, 0, 1/2), (0,)), ...)/4) into Sage
+     """
+     if not isinstance(ex, (Expression, Function)):
+         ex = SR(ex)
+@@ -1817,8 +1822,8 @@ def inverse_laplace(ex, s, t, algorithm='maxima'):
+ 
+     Transform an expression involving a time-shift, via SymPy::
+ 
+-        sage: inverse_laplace(1/s^2*exp(-s), s, t, algorithm='sympy')
+-        -(log(e^(-t)) + 1)*heaviside(t - 1)
++        sage: inverse_laplace(1/s^2*exp(-s), s, t, algorithm='sympy').simplify()
++        (t - 1)*heaviside(t - 1)
+ 
+     The same instance with Giac::
+ 
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 871ae38577fd..d510bb367c7a 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 URL_BASE_PR="https://github.com/sagemath/sage/pull/"
-URL_BASE_COMPARE="https://github.com/sagemath/sage/compare/9.8..."
+URL_BASE_COMPARE="https://github.com/sagemath/sage/compare/10.0.rc0..."
 
 case "$1" in
 	-n)  DO=echo ;;
@@ -15,49 +15,11 @@ get_pr() {
 	$DO wget "$URL_BASE_PR$pr.$ext" -O "$pr-$desc.patch"
 }
 
-get_trac() {
-	ticket=$1
-	desc=$(echo "$2" | sed -e 's/ /_/g')
-	commit=$3
-	$DO wget "$URL_BASE_COMPARE$commit.diff" -O "$ticket-$desc-$commit.patch"
-}
-
 # run from patches dir
 cd $(dirname "$0")
 
-# merged in 10.0.beta0
-get_trac 34851 "support singular 4.3.1.p3" 5e5737a0c
-get_pr 35068 "fix tests giac 1.9.0.35" patch
-
-# merged in 10.0.beta1
-get_pr 35058 "skip unstable tests klyachko"
-
-# merged in 10.0.beta2
-get_pr 34994 "fix tests numpy 1.24"
-get_pr 34997 "fix edge case of integer_check"
-
-# merged in 10.0.beta3
-get_pr 34995 "support tachyon 0.99.2"
-
-# merged in 10.0.beta4
-get_pr 34980 "avoid factoring in is_prime"
-
-# merged in 10.0.beta5
-get_pr 35094 "support gap 4.12"					# includes PR 35093
-
-# merged in 10.0.beta6
-get_pr 35127 "fix very slow test stream.py"
-get_pr 35177 "matplotlib 3.7"
-get_pr 35195 "workaround ecl race"
-get_pr 35204 "fix sage-cleaner"
-
-# merged in 10.0.beta7
-get_pr 35250 "nauty 2.8.6"
-
-# merged in 10.0.beta8
-#get_pr 35337 "ipython 8.11"
-get_pr 35423 "ipython 8.12"						# includes PR 35337
-get_pr 35438 "pythran 0.12.1"
-
 # needs review
 get_pr 35584 "networkx 3.1"
+get_pr 35612 "linbox 1.7.0"
+get_pr 35619 "maxima 5.46.0"
+get_pr 35635 "sympy 1.12"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 66a543efd21d..3678a4c3c7c3 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=9.8
-revision=2
+version=10.0
+revision=1
 build_wrksrc=pkgs/sagemath-standard
 build_style=python3-module
 _bindir=/usr/lib/sagemath/$version/bin
@@ -32,7 +32,8 @@ maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-or-later"
 homepage="http://sagemath.org/"
 distfiles="https://github.com/sagemath/sage/archive/refs/tags/$version.tar.gz"
-checksum=2aff28bd1d18c2d526581f5298acb8336f5b92db5675a7403dec8eaf9a86bc4c
+checksum=2fcc4fc6bd24027688bf8af373783b86e6139773ee53aee81156de8bc61656f0
+nocross="due to ntl (flintlib), fflas-ffpack, givaro, linbox, cysignals, sympow, maxima"
 
 do_configure() {
 	# git tree needs bootstrapping

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [RFC] sagemath: update to 10.0.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (28 preceding siblings ...)
  2023-05-21 15:28 ` [PR PATCH] [Updated] " tornaria
@ 2023-05-21 15:32 ` tornaria
  2023-05-21 18:18 ` [PR PATCH] [Updated] " tornaria
                   ` (9 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: tornaria @ 2023-05-21 15:32 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 338 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43659#issuecomment-1556208415

Comment:
10.0 is released.

Before merging, I want to have a look at https://github.com/sagemath/sage/pull/35658 (support sphinx 7). Presumably it won't affect us since we don't build the documentation.

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] sagemath: update to 10.0.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (29 preceding siblings ...)
  2023-05-21 15:32 ` [RFC] sagemath: update to 10.0 tornaria
@ 2023-05-21 18:18 ` tornaria
  2023-05-21 22:37 ` tornaria
                   ` (8 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: tornaria @ 2023-05-21 18:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1696 bytes --]

There is an updated pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages sagemath-next
https://github.com/void-linux/void-packages/pull/43659

[RFC] sagemath: update to 10.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

This builds on top of #43225 for convenience.

#### Testing the changes
- I tested the changes in this PR: **briefly**

I've been following beta releases and now rc0 includes all of our patches :muscle:

All doctests pass with the version of packages in void except for `python-Babel` which must be updated (as in #43497) and is included  here as part of #43225.

I've switched my system sagemath to this version as everything seems to be working ok. The testsuite is 10-15% faster.

@dkwo: enjoy.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/43659.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-sagemath-next-43659.patch --]
[-- Type: text/x-diff, Size: 191233 bytes --]

From f1093e3bda16f481310d6db14fbcb1bdd1f9149c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Dec 2021 20:20:09 -0300
Subject: [PATCH 1/5] givaro: update to 4.2.0.

---
 srcpkgs/givaro/patches/197.patch | 28 ++++++++++++++++++++++++++++
 srcpkgs/givaro/template          |  9 ++++-----
 2 files changed, 32 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/givaro/patches/197.patch

diff --git a/srcpkgs/givaro/patches/197.patch b/srcpkgs/givaro/patches/197.patch
new file mode 100644
index 000000000000..bafaff3efbd9
--- /dev/null
+++ b/srcpkgs/givaro/patches/197.patch
@@ -0,0 +1,28 @@
+From ab3d332508c21daff41fb64a8658cdc7cc74fc47 Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
+Date: Thu, 16 Dec 2021 17:12:25 +0100
+Subject: [PATCH] dom_power argument is now an uint64_t to avoid problem with
+ 32bit machine
+
+---
+ src/kernel/system/givpower.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/kernel/system/givpower.h b/src/kernel/system/givpower.h
+index eb784872..5644264d 100644
+--- a/src/kernel/system/givpower.h
++++ b/src/kernel/system/givpower.h
+@@ -71,11 +71,11 @@ namespace Givaro {
+ 
+     //! dom_power
+     template<class D, class TT>
+-    TT& dom_power(TT& res, const TT& n, long l, const D& F)
++    TT& dom_power(TT& res, const TT& n, uint64_t l, const D& F)
+     {
+         if (l == 0) return F.assign(res,F.one) ;
+ 
+-        unsigned long p = (unsigned long) l ;
++        uint64_t p = l;
+         bool is_assg = false ;
+ 
+         TT puiss; F.init(puiss); F.assign(puiss,n) ;
diff --git a/srcpkgs/givaro/template b/srcpkgs/givaro/template
index 9c16de5b1974..52457c02a1ed 100644
--- a/srcpkgs/givaro/template
+++ b/srcpkgs/givaro/template
@@ -1,6 +1,6 @@
 # Template file for 'givaro'
 pkgname=givaro
-version=4.1.1
+version=4.2.0
 revision=1
 build_style=gnu-configure
 makedepends="gmpxx-devel"
@@ -8,16 +8,15 @@ short_desc="C++ library for arithmetic and algebraic computations"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="CECILL-B"
 homepage="https://github.com/linbox-team/givaro"
+changelog="https://github.com/linbox-team/givaro/raw/master/ChangeLog"
 distfiles="https://github.com/linbox-team/givaro/releases/download/v${version}/givaro-${version}.tar.gz"
-checksum=628049899386e91da245aee6cd446350fbca87e94863bc0d815066c08150487f
+checksum=865e228812feca971dfb6e776a7bc7ac959cf63ebd52b4f05492730a46e1f189
 nocross=yes
 
 build_options="native_build"
 
 if [ -z "$build_option_native_build" ]; then
-	configure_args="--enable-sse --enable-sse2
-	  --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42
-	  --disable-avx --disable-avx2 --disable-fma --disable-fma4"
+	configure_args="--without-archnative"
 fi
 
 post_install() {

From 7e656abf21dd10d2f32fd611331ab2a663e0afae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Dec 2021 20:20:17 -0300
Subject: [PATCH 2/5] fflas-ffpack: update to 2.5.0.

---
 srcpkgs/fflas-ffpack/patches/357.patch | 35 ++++++++++++++++++++++++++
 srcpkgs/fflas-ffpack/template          | 12 ++++-----
 2 files changed, 40 insertions(+), 7 deletions(-)
 create mode 100644 srcpkgs/fflas-ffpack/patches/357.patch

diff --git a/srcpkgs/fflas-ffpack/patches/357.patch b/srcpkgs/fflas-ffpack/patches/357.patch
new file mode 100644
index 000000000000..99fd34efd93b
--- /dev/null
+++ b/srcpkgs/fflas-ffpack/patches/357.patch
@@ -0,0 +1,35 @@
+From 9b6083c663096e9ca85775b79f1f27c848dbeb98 Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
+Date: Fri, 17 Dec 2021 10:27:02 +0100
+Subject: [PATCH] Fix SimdChooser: on not x86_64 machines its value could be an
+ nonexistant struct
+
+---
+ fflas-ffpack/fflas/fflas_simd.h | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/fflas-ffpack/fflas/fflas_simd.h b/fflas-ffpack/fflas/fflas_simd.h
+index bf5d30211..84ced0fd8 100644
+--- a/fflas-ffpack/fflas/fflas_simd.h
++++ b/fflas-ffpack/fflas/fflas_simd.h
+@@ -384,6 +384,20 @@ struct SimdChooser<T, true, true> // integral number
+ #endif
+ };
+ 
++#ifndef __x86_64__
++template <>
++struct SimdChooser<uint64_t, true, true>
++{
++    using value = NoSimd<uint64_t>;
++};
++
++template <>
++struct SimdChooser<int64_t, true, true>
++{
++    using value = NoSimd<int64_t>;
++};
++#endif
++
+ template <class T> using Simd = typename SimdChooser<T>::value;
+ 
+ // template <class T> struct SimdChooser<T, true> {
diff --git a/srcpkgs/fflas-ffpack/template b/srcpkgs/fflas-ffpack/template
index 557c644c00a4..2aa599703585 100644
--- a/srcpkgs/fflas-ffpack/template
+++ b/srcpkgs/fflas-ffpack/template
@@ -1,6 +1,6 @@
 # Template file for 'fflas-ffpack'
 pkgname=fflas-ffpack
-version=2.4.3
+version=2.5.0
 revision=1
 build_style=gnu-configure
 hostmakedepends="pkg-config"
@@ -10,15 +10,13 @@ short_desc="Finite Field Linear Algebra Subroutines / Package"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="LGPL-2.1-or-later"
 homepage="http://linbox-team.github.io/fflas-ffpack/"
-distfiles="https://github.com/linbox-team/fflas-ffpack/releases/download/${version}/fflas-ffpack-${version}.tar.gz"
-checksum=f372783a17a9899ee9f88d4c9421d80facccb95556146dad7020d07a03791cc9
+changelog="https://github.com/linbox-team/fflas-ffpack/raw/master/ChangeLog"
+distfiles="https://github.com/linbox-team/fflas-ffpack/releases/download/v${version}/fflas-ffpack-${version}.tar.gz"
+checksum=dafb4c0835824d28e4f823748579be6e4c8889c9570c6ce9cce1e186c3ebbb23
 nocross=yes
 
 build_options="native_build"
 
 if [ -z "$build_option_native_build" ]; then
-	configure_args="--enable-sse --enable-sse2
-	  --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42
-	  --disable-avx --disable-avx2 --disable-fma --disable-fma4
-	  --disable-avx512f --disable-avx512dq --disable-avx512vl"
+	configure_args="--without-archnative"
 fi

From 6abb23e5b351856e89445b095f1a1dbaf1607aab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Dec 2021 20:20:20 -0300
Subject: [PATCH 3/5] linbox: update to 1.7.0.

---
 srcpkgs/linbox/patches/292.patch              | 24 ++++++++++++
 srcpkgs/linbox/patches/294.patch              | 38 +++++++++++++++++++
 ...8adade10641f1f04f04b589753d928fb5443.patch | 35 -----------------
 .../remove-linboxsage-libs-from-pc.patch      | 23 -----------
 srcpkgs/linbox/template                       | 11 +++---
 5 files changed, 67 insertions(+), 64 deletions(-)
 create mode 100644 srcpkgs/linbox/patches/292.patch
 create mode 100644 srcpkgs/linbox/patches/294.patch
 delete mode 100644 srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch
 delete mode 100644 srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch

diff --git a/srcpkgs/linbox/patches/292.patch b/srcpkgs/linbox/patches/292.patch
new file mode 100644
index 000000000000..d3333cc23d0b
--- /dev/null
+++ b/srcpkgs/linbox/patches/292.patch
@@ -0,0 +1,24 @@
+From 49b9cccd0286980c1c1811c3b03df883ef0164df Mon Sep 17 00:00:00 2001
+From: Doug Torrance <dtorrance@piedmont.edu>
+Date: Tue, 14 Dec 2021 16:22:33 -0500
+Subject: [PATCH] Only register uint128_t as a TypeName when it's available.
+
+Otherwise, test-fft will fail when it isn't.
+---
+ tests/test-fft.C | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/tests/test-fft.C b/tests/test-fft.C
+index d19184c2d..5811ebc5d 100644
+--- a/tests/test-fft.C
++++ b/tests/test-fft.C
+@@ -55,7 +55,9 @@ REGISTER_TYPE_NAME(double);
+ REGISTER_TYPE_NAME(uint16_t);
+ REGISTER_TYPE_NAME(uint32_t);
+ REGISTER_TYPE_NAME(uint64_t);
++#ifdef __FFLASFFPACK_HAVE_INT128
+ REGISTER_TYPE_NAME(uint128_t);
++#endif
+ REGISTER_TYPE_NAME(Modular);
+ REGISTER_TYPE_NAME(ModularExtended);
+ 
diff --git a/srcpkgs/linbox/patches/294.patch b/srcpkgs/linbox/patches/294.patch
new file mode 100644
index 000000000000..7c645f165d39
--- /dev/null
+++ b/srcpkgs/linbox/patches/294.patch
@@ -0,0 +1,38 @@
+From f81a1f4a5e0835b7a0f3bb88a0fcbbaa32174cfa Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
+Date: Wed, 15 Dec 2021 16:00:39 +0100
+Subject: [PATCH] Only register uint128_t as a TypeName when it's available
+
+---
+ benchmarks/benchmark-fft.C                       | 2 ++
+ benchmarks/benchmark-polynomial-matrix-mul-fft.C | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/benchmarks/benchmark-fft.C b/benchmarks/benchmark-fft.C
+index 39b86c9d9..59a8be57c 100644
+--- a/benchmarks/benchmark-fft.C
++++ b/benchmarks/benchmark-fft.C
+@@ -54,7 +54,9 @@ REGISTER_TYPE_NAME(double);
+ REGISTER_TYPE_NAME(uint16_t);
+ REGISTER_TYPE_NAME(uint32_t);
+ REGISTER_TYPE_NAME(uint64_t);
++#ifdef __FFLASFFPACK_HAVE_INT128
+ REGISTER_TYPE_NAME(uint128_t);
++#endif
+ REGISTER_TYPE_NAME(Modular);
+ REGISTER_TYPE_NAME(ModularExtended);
+ 
+diff --git a/benchmarks/benchmark-polynomial-matrix-mul-fft.C b/benchmarks/benchmark-polynomial-matrix-mul-fft.C
+index e9b184bcf..7bf17f33e 100644
+--- a/benchmarks/benchmark-polynomial-matrix-mul-fft.C
++++ b/benchmarks/benchmark-polynomial-matrix-mul-fft.C
+@@ -65,7 +65,9 @@ REGISTER_TYPE_NAME(double);
+ REGISTER_TYPE_NAME(uint16_t);
+ REGISTER_TYPE_NAME(uint32_t);
+ REGISTER_TYPE_NAME(uint64_t);
++#ifdef __FFLASFFPACK_HAVE_INT128
+ REGISTER_TYPE_NAME(uint128_t);
++#endif
+ REGISTER_TYPE_NAME(Modular);
+ REGISTER_TYPE_NAME(ModularExtended);
+ 
diff --git a/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch b/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch
deleted file mode 100644
index 5afa078ec7b8..000000000000
--- a/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 892f8adade10641f1f04f04b589753d928fb5443 Mon Sep 17 00:00:00 2001
-From: Doug Torrance <dtorrance@piedmont.edu>
-Date: Sun, 9 May 2021 12:14:19 -0400
-Subject: [PATCH] Use std::ptrdiff_t for vector iterator difference type
-
-It was previously long (64-bit integers), but this will not be the
-case on 32-bit systems.
-
-Closes: #273
----
- linbox/vector/bit-vector.inl | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/linbox/vector/bit-vector.inl b/linbox/vector/bit-vector.inl
-index 5fa84b421..23a22ba47 100644
---- a/linbox/vector/bit-vector.inl
-+++ b/linbox/vector/bit-vector.inl
-@@ -46,7 +46,7 @@ namespace std
- 		typedef LinBox::BitVector::reference reference;
- 		typedef bool *pointer;
- 		typedef bool value_type;
--		typedef long difference_type;
-+		typedef std::ptrdiff_t difference_type;
- 	};
- 
- 	template <>
-@@ -56,7 +56,7 @@ namespace std
- 		typedef LinBox::BitVector::const_reference reference;
- 		typedef const bool *pointer;
- 		typedef bool value_type;
--		typedef long difference_type;
-+		typedef std::ptrdiff_t difference_type;
- 	};
- }
- 
diff --git a/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch b/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch
deleted file mode 100644
index c93915fb1b06..000000000000
--- a/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Backported from:
-
-From 426eb97ba762c7663884f57ead0909f2aa3cd6a5 Mon Sep 17 00:00:00 2001
-From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
-Date: Thu, 17 Jan 2019 16:32:19 +0100
-Subject: [PATCH] Remove @LINBOXSAGE_LIBS@ from linbox.pc.in
-
----
- linbox.pc.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/linbox.pc.in b/linbox.pc.in
-index 278f127e4..c6b8091eb 100644
---- a/linbox.pc.in
-+++ b/linbox.pc.in
-@@ -9,6 +9,6 @@ Description: Exact Linear Algebra library
- URL: http://github.com/linbox-team/linbox
- Version: @VERSION@
- Requires: fflas-ffpack >= 2.4.0, givaro >= 4.1.0
--Libs: -L${libdir} -llinbox @LINBOXSAGE_LIBS@ @NTL_LIBS@ @MPFR_LIBS@ @FPLLL_LIBS@ @IML_LIBS@ @FLINT_LIBS@ @OCL_LIBS@
-+Libs: -L${libdir} -llinbox @NTL_LIBS@ @MPFR_LIBS@ @FPLLL_LIBS@ @IML_LIBS@ @FLINT_LIBS@ @OCL_LIBS@
- Cflags: @DEFAULT_CFLAGS@ -DDISABLE_COMMENTATOR -I${includedir} @NTL_CFLAGS@ @MPFR_CFLAGS@ @FPLLL_CFLAGS@  @IML_CFLAGS@ @FLINT_CFLAGS@ 
- \-------------------------------------------------------
diff --git a/srcpkgs/linbox/template b/srcpkgs/linbox/template
index 096a15b3390b..e6edacdd0a74 100644
--- a/srcpkgs/linbox/template
+++ b/srcpkgs/linbox/template
@@ -1,7 +1,7 @@
 # Template file for 'linbox'
 pkgname=linbox
-version=1.6.3
-revision=2
+version=1.7.0
+revision=1
 build_style=gnu-configure
 hostmakedepends="pkg-config"
 makedepends="fflas-ffpack"
@@ -9,16 +9,15 @@ short_desc="C++ library for exact, high-performance linear algebra"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="LGPL-2.1-or-later"
 homepage="https://linalg.org"
+changelog="https://github.com/linbox-team/linbox/raw/master/ChangeLog"
 distfiles="https://github.com/linbox-team/linbox/releases/download/v${version}/linbox-${version}.tar.gz"
-checksum=a58a188307b07c57964e844bceb99321d3043a8a4a1fccc082a54928bb9a0057
+checksum=6d2159fd395be0298362dd37f6c696676237bc8e2757341fbc46520e3b466bcc
 nocross=yes
 
 build_options="native_build"
 
 if [ -z "$build_option_native_build" ]; then
-	configure_args="--enable-sse --enable-sse2
-	  --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42
-	  --disable-avx --disable-avx2 --disable-fma --disable-fma4"
+	configure_args="--without-archnative"
 fi
 
 linbox-devel_package() {

From 22d170acce42efc84386ee462f28fba20faf9dc3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Fri, 15 Apr 2022 14:25:08 -0300
Subject: [PATCH 4/5] maxima: update to 5.46.0.

Also:
 - disable sbcl on aarch64
 - don't makedepends on emacs (avoid a nocross build dep)
 - move maxima-emacs files to main pkg
 - adopt
---
 ...a43e5234305bd6f1de5909d4ce5d7e1ea864.patch | 24 -------------------
 srcpkgs/maxima/template                       | 20 ++++++++--------
 2 files changed, 10 insertions(+), 34 deletions(-)
 delete mode 100644 srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch

diff --git a/srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch b/srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch
deleted file mode 100644
index e1ac1e5f6086..000000000000
--- a/srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-commit a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864
-Author: Robert Dodier <robert_dodier@users.sourceforge.net>
-Date:   Mon Oct 11 22:40:13 2021 -0700
-
-    Apply patch #80: "Build a FASL library, needed by SageMath"
-    
-    This modifies maxima.system for ECL only.
-
-diff --git a/src/maxima.system b/src/maxima.system
-index d954bc2b9..525fb778e 100644
---- a/src/maxima.system
-+++ b/src/maxima.system
-@@ -75,6 +75,11 @@
- 			     ;; Convert dir/foo.fas to dir/foo.o
- 			     (make-pathname :type "o" :defaults p))
- 			 files)))
-+	(c::build-fasl "binary-ecl/maxima" :lisp-files obj
-+			  :ld-flags
-+			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
-+							      (find-package "MAXIMA")))))
-+			    (if (and x (not (string= x ""))) (list x))))
- 	(c::build-program "binary-ecl/maxima" :lisp-files obj
- 			  :ld-flags
- 			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
diff --git a/srcpkgs/maxima/template b/srcpkgs/maxima/template
index 69e85ec833e8..f67b469e3dda 100644
--- a/srcpkgs/maxima/template
+++ b/srcpkgs/maxima/template
@@ -1,19 +1,21 @@
 # Template file for 'maxima'
 pkgname=maxima
-version=5.45.1
-revision=4
+version=5.46.0
+revision=1
 build_style=gnu-configure
 configure_args="$(vopt_enable clisp) $(vopt_enable sbcl sbcl-exec) $(vopt_enable ecl)"
-hostmakedepends="python3 perl emacs texinfo patchelf"
+hostmakedepends="python3 perl texinfo patchelf $(vopt_if ecl ecl)"
 makedepends="$(vopt_if clisp clisp) $(vopt_if sbcl sbcl) $(vopt_if ecl ecl)"
 depends="$(vopt_if clisp clisp) rlwrap"
 checkdepends="gnuplot"
 short_desc="Computer Algebra System"
-maintainer="Bosco Garcia <jboscogg@gmail.org>"
+maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-only"
 homepage="http://maxima.sourceforge.net"
+changelog="https://sourceforge.net/p/maxima/code/ci/master/tree/changelogs/ChangeLog-${version%.*}.md?format=raw"
 distfiles="${SOURCEFORGE_SITE}/maxima/maxima-${version}.tar.gz"
-checksum=fe9016276970bef214a1a244348558644514d7fdfaa4fc8b9d0e87afcbb4e7dc
+checksum=7390f06b48da65c9033e8b2f629b978b90056454a54022db7de70e2225aa8b07
+nocross=yes
 
 # maxima-sbcl is nopie and should NOT be stripped or it won't work
 nostrip_files=/usr/lib/maxima/$version/binary-sbcl/maxima
@@ -32,7 +34,7 @@ build_options_default="ecl"
 
 # sbcl is only available for these architectures
 case "$XBPS_TARGET_MACHINE" in
-	i686|x86_64*|armv7l|aarch64|ppc64le*)
+	i686|x86_64*|armv7l|ppc64le*)
 		build_options_default+=" sbcl"
 		;;
 esac
@@ -113,11 +115,9 @@ maxima-src_package() {
 }
 
 maxima-emacs_package() {
-	short_desc+=" - Emacs interface"
+	short_desc+=" - transitional dummy package"
 	depends="${sourcepkg}-${version}_${revision} virtual?emacs"
-	pkg_install() {
-		vmove usr/share/emacs
-	}
+	build_style=meta
 }
 
 xmaxima_package() {

From c8e48d241bc0072440786238950dfe501a869bde Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Feb 2023 22:53:33 -0300
Subject: [PATCH 5/5] sagemath: update to 10.0.

Also:
 - support networkx 3.1 (sagemath#35584)
 - support linbox 1.7.0 (sagemath#35612)
 - support maxima 5.46.0 (sagemath#35619)
 - support sympy 1.12 (sagemath#35635)
 - support sphinx 7 (sagemath#35658)
---
 srcpkgs/sagemath/files/sage_conf.py           |    1 -
 srcpkgs/sagemath/files/timings2.json          |  405 ++---
 ...-support_singular_4.3.1.p3-5e5737a0c.patch |  205 ---
 .../34980-avoid_factoring_in_is_prime.patch   |   49 -
 .../patches/34994-fix_tests_numpy_1.24.patch  |   58 -
 .../34995-support_tachyon_0.99.2.patch        |   57 -
 ...34997-fix_edge_case_of_integer_check.patch |   36 -
 .../35058-skip_unstable_tests_klyachko.patch  |   22 -
 .../35068-fix_tests_giac_1.9.0.35.patch       |   62 -
 .../patches/35094-support_gap_4.12.patch      | 1303 -----------------
 .../35127-fix_very_slow_test_stream.py.patch  |   15 -
 .../patches/35177-matplotlib_3.7.patch        |   95 --
 .../patches/35195-workaround_ecl_race.patch   |   56 -
 .../patches/35204-fix_sage-cleaner.patch      |   28 -
 .../sagemath/patches/35250-nauty_2.8.6.patch  |   35 -
 .../sagemath/patches/35423-ipython_8.12.patch |   51 -
 .../patches/35438-pythran_0.12.1.patch        |   41 -
 .../sagemath/patches/35584-networkx_3.1.patch |   35 +-
 .../sagemath/patches/35612-linbox_1.7.0.patch |   64 +
 .../patches/35619-maxima_5.46.0.patch         |  569 +++++++
 .../sagemath/patches/35635-sympy_1.12.patch   |   54 +
 srcpkgs/sagemath/patches/35658-sphinx_7.patch |  141 ++
 srcpkgs/sagemath/patches/get_patches          |   49 +-
 srcpkgs/sagemath/template                     |    7 +-
 24 files changed, 969 insertions(+), 2469 deletions(-)
 delete mode 100644 srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
 delete mode 100644 srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
 delete mode 100644 srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
 delete mode 100644 srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
 delete mode 100644 srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
 delete mode 100644 srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
 delete mode 100644 srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
 delete mode 100644 srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
 delete mode 100644 srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
 delete mode 100644 srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
 delete mode 100644 srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
 delete mode 100644 srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
 delete mode 100644 srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
 delete mode 100644 srcpkgs/sagemath/patches/35423-ipython_8.12.patch
 delete mode 100644 srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
 create mode 100644 srcpkgs/sagemath/patches/35612-linbox_1.7.0.patch
 create mode 100644 srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch
 create mode 100644 srcpkgs/sagemath/patches/35635-sympy_1.12.patch
 create mode 100644 srcpkgs/sagemath/patches/35658-sphinx_7.patch

diff --git a/srcpkgs/sagemath/files/sage_conf.py b/srcpkgs/sagemath/files/sage_conf.py
index 00de40f1ee4f..bc5388de8956 100644
--- a/srcpkgs/sagemath/files/sage_conf.py
+++ b/srcpkgs/sagemath/files/sage_conf.py
@@ -1,4 +1,3 @@
 # configuration for sage on void linux
 SAGE_SHARE = "/usr/share/sagemath"
 GAP_SHARE_DIR = "/usr/share/gap"
-GAP_LIB_DIR = "/usr/lib/gap"
diff --git a/srcpkgs/sagemath/files/timings2.json b/srcpkgs/sagemath/files/timings2.json
index bb3098680502..b2b3fe818a20 100644
--- a/srcpkgs/sagemath/files/timings2.json
+++ b/srcpkgs/sagemath/files/timings2.json
@@ -1,281 +1,152 @@
 {
-  "doc.ca.intro.index": {"walltime": 8},
-  "doc.en.constructions.calculus": {"walltime": 64},
-  "doc.en.constructions.plotting": {"walltime": 32},
-  "doc.en.prep.Advanced-2DPlotting": {"walltime": 16},
-  "doc.en.prep.Calculus": {"walltime": 8},
-  "doc.en.prep.Symbolics-and-Basic-Plotting": {"walltime": 8},
-  "doc.en.thematic_tutorials.explicit_methods_in_number_theory.birds_other": {"walltime": 8},
-  "doc.en.thematic_tutorials.explicit_methods_in_number_theory.elliptic_curves": {"walltime": 8},
-  "doc.en.thematic_tutorials.geometry.polyhedra_tutorial": {"walltime": 16},
-  "doc.en.thematic_tutorials.sandpile": {"walltime": 16},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_advanced": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_cartesian": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_change": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_curvilinear": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_plane": {"walltime": 16},
-  "doc.ja.tutorial.tour_plotting": {"walltime": 8},
-  "sage.algebras.cluster_algebra": {"walltime": 8},
   "sage.algebras.commutative_dga": {"walltime": 16},
-  "sage.algebras.hecke_algebras.ariki_koike_algebra": {"walltime": 8},
-  "sage.algebras.iwahori_hecke_algebra": {"walltime": 8},
-  "sage.algebras.lie_algebras.classical_lie_algebra": {"walltime": 128},
-  "sage.algebras.lie_algebras.nilpotent_lie_algebra": {"walltime": 16},
-  "sage.algebras.quantum_clifford": {"walltime": 16},
-  "sage.algebras.quantum_groups.fock_space": {"walltime": 8},
-  "sage.algebras.quatalg.quaternion_algebra": {"walltime": 8},
-  "sage.algebras.steenrod.steenrod_algebra": {"walltime": 64},
-  "sage.algebras.steenrod.steenrod_algebra_bases": {"walltime": 8},
-  "sage.algebras.yangian": {"walltime": 8},
-  "sage.arith.misc": {"walltime": 32},
+  "sage.algebras.fusion_rings.f_matrix": {"walltime": 16},
+  "sage.algebras.fusion_rings.fusion_ring": {"walltime": 16},
+  "sage.algebras.hecke_algebras.cubic_hecke_algebra": {"walltime": 8},
+  "sage.algebras.lie_conformal_algebras.n2_lie_conformal_algebra": {"walltime": 8},
+  "sage.algebras.quantum_clifford": {"walltime": 8},
+  "sage.algebras.steenrod.steenrod_algebra": {"walltime": 8},
   "sage.calculus.calculus": {"walltime": 16},
   "sage.calculus.desolvers": {"walltime": 8},
-  "sage.calculus.functional": {"walltime": 8},
-  "sage.calculus.riemann": {"walltime": 64},
-  "sage.calculus.tests": {"walltime": 16},
-  "sage.calculus.transforms.dwt": {"walltime": 16},
+  "sage.calculus.riemann": {"walltime": 8},
   "sage.calculus.transforms.fft": {"walltime": 8},
   "sage.categories.coxeter_groups": {"walltime": 8},
-  "sage.categories.finite_monoids": {"walltime": 16},
-  "sage.categories.lie_conformal_algebras": {"walltime": 8},
+  "sage.categories.finite_monoids": {"walltime": 8},
   "sage.categories.loop_crystals": {"walltime": 8},
-  "sage.categories.pushout": {"walltime": 8},
-  "sage.categories.super_hopf_algebras_with_basis": {"walltime": 32},
-  "sage.categories.super_lie_conformal_algebras": {"walltime": 8},
-  "sage.coding.ag_code": {"walltime": 64},
-  "sage.coding.ag_code_decoders": {"walltime": 128},
-  "sage.coding.binary_code": {"walltime": 8},
-  "sage.coding.linear_code": {"walltime": 16},
-  "sage.combinat.backtrack": {"walltime": 32},
-  "sage.combinat.chas.wqsym": {"walltime": 32},
-  "sage.combinat.cluster_algebra_quiver.cluster_seed": {"walltime": 64},
-  "sage.combinat.cluster_algebra_quiver.quiver": {"walltime": 128},
-  "sage.combinat.crystals.affine_factorization": {"walltime": 16},
-  "sage.combinat.crystals.alcove_path": {"walltime": 32},
-  "sage.combinat.crystals.highest_weight_crystals": {"walltime": 8},
-  "sage.combinat.crystals.kirillov_reshetikhin": {"walltime": 16},
-  "sage.combinat.crystals.letters": {"walltime": 8},
-  "sage.combinat.crystals.littelmann_path": {"walltime": 16},
-  "sage.combinat.crystals.mv_polytopes": {"walltime": 16},
-  "sage.combinat.crystals.pbw_crystal": {"walltime": 16},
-  "sage.combinat.crystals.star_crystal": {"walltime": 8},
-  "sage.combinat.designs.bibd": {"walltime": 8},
-  "sage.combinat.designs.database": {"walltime": 16},
+  "sage.coding.ag_code": {"walltime": 32},
+  "sage.coding.ag_code_decoders": {"walltime": 32},
+  "sage.coding.linear_code": {"walltime": 32},
+  "sage.combinat.designs.database": {"walltime": 8},
   "sage.combinat.designs.difference_family": {"walltime": 8},
-  "sage.combinat.designs.gen_quadrangles_with_spread": {"walltime": 128},
-  "sage.combinat.designs.orthogonal_arrays_build_recursive": {"walltime": 16},
-  "sage.combinat.designs.orthogonal_arrays_find_recursive": {"walltime": 8},
-  "sage.combinat.diagram_algebras": {"walltime": 64},
-  "sage.combinat.fqsym": {"walltime": 32},
-  "sage.combinat.free_prelie_algebra": {"walltime": 8},
-  "sage.combinat.fully_commutative_elements": {"walltime": 8},
-  "sage.combinat.grossman_larson_algebras": {"walltime": 8},
-  "sage.combinat.interval_posets": {"walltime": 8},
+  "sage.combinat.designs.orthogonal_arrays_build_recursive": {"walltime": 8},
   "sage.combinat.k_regular_sequence": {"walltime": 8},
   "sage.combinat.k_tableau": {"walltime": 16},
   "sage.combinat.matrices.hadamard_matrix": {"walltime": 8},
   "sage.combinat.multiset_partition_into_sets_ordered": {"walltime": 8},
-  "sage.combinat.ncsf_qsym.ncsf": {"walltime": 16},
-  "sage.combinat.ncsf_qsym.qsym": {"walltime": 16},
-  "sage.combinat.partition": {"walltime": 16},
-  "sage.combinat.partition_kleshchev": {"walltime": 16},
+  "sage.combinat.ncsf_qsym.ncsf": {"walltime": 8},
+  "sage.combinat.ncsf_qsym.qsym": {"walltime": 8},
+  "sage.combinat.partition": {"walltime": 8},
   "sage.combinat.partition_tuple": {"walltime": 8},
-  "sage.combinat.posets.moebius_algebra": {"walltime": 16},
+  "sage.combinat.permutation": {"walltime": 8},
   "sage.combinat.posets.posets": {"walltime": 8},
-  "sage.combinat.rigged_configurations.kr_tableaux": {"walltime": 32},
-  "sage.combinat.rigged_configurations.rigged_configurations": {"walltime": 16},
-  "sage.combinat.rigged_configurations.tensor_product_kr_tableaux": {"walltime": 16},
+  "sage.combinat.rigged_configurations.kr_tableaux": {"walltime": 8},
   "sage.combinat.root_system.associahedron": {"walltime": 8},
-  "sage.combinat.root_system.branching_rules": {"walltime": 8},
-  "sage.combinat.root_system.fusion_ring": {"walltime": 8},
-  "sage.combinat.root_system.integrable_representations": {"walltime": 16},
-  "sage.combinat.root_system.non_symmetric_macdonald_polynomials": {"walltime": 16},
-  "sage.combinat.root_system.pieri_factors": {"walltime": 8},
-  "sage.combinat.root_system.plot": {"walltime": 32},
-  "sage.combinat.root_system.root_lattice_realization_algebras": {"walltime": 16},
-  "sage.combinat.root_system.root_lattice_realizations": {"walltime": 16},
-  "sage.combinat.root_system.root_system": {"walltime": 8},
-  "sage.combinat.root_system.weyl_group": {"walltime": 8},
-  "sage.combinat.rsk": {"walltime": 32},
-  "sage.combinat.sf.classical": {"walltime": 16},
-  "sage.combinat.sf.jack": {"walltime": 16},
-  "sage.combinat.sf.k_dual": {"walltime": 16},
-  "sage.combinat.sf.llt": {"walltime": 16},
-  "sage.combinat.sf.macdonald": {"walltime": 64},
-  "sage.combinat.sf.new_kschur": {"walltime": 8},
-  "sage.combinat.sf.sfa": {"walltime": 32},
-  "sage.combinat.shifted_primed_tableau": {"walltime": 16},
+  "sage.combinat.root_system.non_symmetric_macdonald_polynomials": {"walltime": 8},
+  "sage.combinat.root_system.plot": {"walltime": 16},
+  "sage.combinat.root_system.root_lattice_realizations": {"walltime": 8},
+  "sage.combinat.rsk": {"walltime": 8},
+  "sage.combinat.sf.k_dual": {"walltime": 8},
+  "sage.combinat.sf.sf": {"walltime": 8},
+  "sage.combinat.sf.sfa": {"walltime": 8},
+  "sage.combinat.shifted_primed_tableau": {"walltime": 8},
   "sage.combinat.skew_tableau": {"walltime": 8},
-  "sage.combinat.symmetric_group_algebra": {"walltime": 16},
-  "sage.combinat.tableau": {"walltime": 32},
-  "sage.combinat.tableau_tuple": {"walltime": 32},
-  "sage.combinat.tiling": {"walltime": 16},
-  "sage.combinat.tutorial": {"walltime": 16},
-  "sage.combinat.words.paths": {"walltime": 64},
-  "sage.crypto.block_cipher.des": {"walltime": 16},
-  "sage.crypto.mq.sr": {"walltime": 64},
-  "sage.crypto.sbox": {"walltime": 16},
+  "sage.combinat.species.generating_series": {"walltime": 8},
+  "sage.combinat.tableau": {"walltime": 8},
+  "sage.combinat.tableau_tuple": {"walltime": 8},
+  "sage.combinat.tiling": {"walltime": 8},
+  "sage.combinat.tutorial": {"walltime": 8},
   "sage.crypto.sboxes": {"walltime": 8},
   "sage.doctest.forker": {"walltime": 16},
-  "sage.doctest.sources": {"walltime": 64},
-  "sage.doctest.test": {"walltime": 128},
-  "sage.dynamics.arithmetic_dynamics.projective_ds": {"walltime": 64},
-  "sage.dynamics.arithmetic_dynamics.wehlerK3": {"walltime": 8},
-  "sage.dynamics.cellular_automata.glca": {"walltime": 8},
+  "sage.dynamics.arithmetic_dynamics.projective_ds": {"walltime": 32},
   "sage.dynamics.cellular_automata.solitons": {"walltime": 8},
-  "sage.dynamics.complex_dynamics.mandel_julia": {"walltime": 16},
   "sage.functions.bessel": {"walltime": 16},
-  "sage.functions.exp_integral": {"walltime": 8},
   "sage.functions.hypergeometric": {"walltime": 8},
+  "sage.functions.orthogonal_polys": {"walltime": 8},
   "sage.functions.other": {"walltime": 16},
   "sage.functions.piecewise": {"walltime": 8},
-  "sage.games.quantumino": {"walltime": 8},
-  "sage.geometry.cone": {"walltime": 32},
-  "sage.geometry.fan": {"walltime": 8},
   "sage.geometry.hyperbolic_space.hyperbolic_geodesic": {"walltime": 8},
-  "sage.geometry.hyperplane_arrangement.arrangement": {"walltime": 16},
-  "sage.geometry.hyperplane_arrangement.library": {"walltime": 8},
+  "sage.geometry.hyperplane_arrangement.arrangement": {"walltime": 8},
   "sage.geometry.hyperplane_arrangement.plot": {"walltime": 8},
-  "sage.geometry.lattice_polytope": {"walltime": 16},
-  "sage.geometry.polyhedral_complex": {"walltime": 8},
-  "sage.geometry.polyhedron.base": {"walltime": 32},
-  "sage.geometry.polyhedron.library": {"walltime": 32},
-  "sage.geometry.polyhedron.plot": {"walltime": 8},
+  "sage.geometry.polyhedron.base": {"walltime": 8},
+  "sage.geometry.polyhedron.base5": {"walltime": 8},
+  "sage.geometry.polyhedron.base6": {"walltime": 16},
+  "sage.geometry.polyhedron.library": {"walltime": 16},
   "sage.geometry.riemannian_manifolds.parametrized_surface3d": {"walltime": 16},
-  "sage.geometry.triangulation.base": {"walltime": 32},
-  "sage.geometry.triangulation.point_configuration": {"walltime": 16},
-  "sage.graphs.chrompoly": {"walltime": 8},
-  "sage.graphs.connectivity": {"walltime": 16},
-  "sage.graphs.generators.basic": {"walltime": 16},
-  "sage.graphs.generators.classical_geometries": {"walltime": 32},
-  "sage.graphs.generators.distance_regular": {"walltime": 256},
-  "sage.graphs.generators.families": {"walltime": 32},
-  "sage.graphs.generators.smallgraphs": {"walltime": 16},
-  "sage.graphs.generic_graph": {"walltime": 32},
-  "sage.graphs.genus": {"walltime": 16},
+  "sage.graphs.connectivity": {"walltime": 8},
+  "sage.graphs.generators.classical_geometries": {"walltime": 8},
+  "sage.graphs.generators.distance_regular": {"walltime": 32},
+  "sage.graphs.generators.smallgraphs": {"walltime": 8},
+  "sage.graphs.generic_graph": {"walltime": 16},
   "sage.graphs.graph": {"walltime": 16},
-  "sage.graphs.graph_generators": {"walltime": 8},
   "sage.graphs.graph_list": {"walltime": 8},
   "sage.graphs.graph_plot": {"walltime": 8},
-  "sage.graphs.strongly_regular_db": {"walltime": 16},
-  "sage.groups.cubic_braid": {"walltime": 16},
-  "sage.groups.fqf_orthogonal": {"walltime": 16},
-  "sage.groups.libgap_mixin": {"walltime": 8},
-  "sage.groups.libgap_morphism": {"walltime": 8},
-  "sage.groups.lie_gps.nilpotent_lie_group": {"walltime": 16},
-  "sage.groups.matrix_gps.finitely_generated": {"walltime": 8},
-  "sage.groups.matrix_gps.heisenberg": {"walltime": 32},
-  "sage.groups.matrix_gps.linear": {"walltime": 8},
-  "sage.groups.perm_gps.cubegroup": {"walltime": 16},
-  "sage.groups.perm_gps.partn_ref.refinement_graphs": {"walltime": 8},
+  "sage.graphs.strongly_regular_db": {"walltime": 8},
+  "sage.groups.cactus_group": {"walltime": 8},
+  "sage.groups.cubic_braid": {"walltime": 8},
+  "sage.groups.lie_gps.nilpotent_lie_group": {"walltime": 8},
+  "sage.groups.matrix_gps.finitely_generated_gap": {"walltime": 8},
   "sage.groups.perm_gps.permgroup": {"walltime": 8},
   "sage.groups.perm_gps.permgroup_named": {"walltime": 8},
-  "sage.homology.hochschild_complex": {"walltime": 8},
   "sage.homology.homology_vector_space_with_basis": {"walltime": 8},
-  "sage.interacts.test_jupyter": {"walltime": 16},
-  "sage.interfaces.ecm": {"walltime": 8},
-  "sage.interfaces.expect": {"walltime": 8},
-  "sage.interfaces.gap": {"walltime": 16},
-  "sage.interfaces.maxima": {"walltime": 8},
-  "sage.interfaces.maxima_abstract": {"walltime": 64},
-  "sage.interfaces.psage": {"walltime": 8},
-  "sage.interfaces.sage0": {"walltime": 8},
-  "sage.lfunctions.zero_sums": {"walltime": 8},
-  "sage.libs.eclib.interface": {"walltime": 16},
+  "sage.interfaces.gap": {"walltime": 8},
+  "sage.interfaces.gap_workspace": {"walltime": 8},
+  "sage.interfaces.sage0": {"walltime": 16},
+  "sage.libs.eclib.interface": {"walltime": 32},
   "sage.libs.eclib.mwrank": {"walltime": 16},
-  "sage.libs.gap.test_long": {"walltime": 32},
-  "sage.libs.giac": {"walltime": 32},
   "sage.manifolds.catalog": {"walltime": 8},
-  "sage.manifolds.chart": {"walltime": 32},
+  "sage.manifolds.chart": {"walltime": 16},
   "sage.manifolds.chart_func": {"walltime": 8},
   "sage.manifolds.continuous_map": {"walltime": 8},
-  "sage.manifolds.differentiable.affine_connection": {"walltime": 128},
+  "sage.manifolds.differentiable.affine_connection": {"walltime": 32},
   "sage.manifolds.differentiable.automorphismfield": {"walltime": 32},
-  "sage.manifolds.differentiable.automorphismfield_group": {"walltime": 8},
   "sage.manifolds.differentiable.bundle_connection": {"walltime": 8},
-  "sage.manifolds.differentiable.characteristic_cohomology_class": {"walltime": 64},
+  "sage.manifolds.differentiable.characteristic_cohomology_class": {"walltime": 8},
   "sage.manifolds.differentiable.curve": {"walltime": 16},
-  "sage.manifolds.differentiable.degenerate": {"walltime": 32},
-  "sage.manifolds.differentiable.degenerate_submanifold": {"walltime": 16},
-  "sage.manifolds.differentiable.diff_form": {"walltime": 64},
+  "sage.manifolds.differentiable.degenerate": {"walltime": 16},
+  "sage.manifolds.differentiable.degenerate_submanifold": {"walltime": 8},
+  "sage.manifolds.differentiable.diff_form": {"walltime": 32},
   "sage.manifolds.differentiable.diff_map": {"walltime": 8},
   "sage.manifolds.differentiable.examples.euclidean": {"walltime": 32},
   "sage.manifolds.differentiable.examples.sphere": {"walltime": 32},
   "sage.manifolds.differentiable.integrated_curve": {"walltime": 32},
-  "sage.manifolds.differentiable.levi_civita_connection": {"walltime": 32},
-  "sage.manifolds.differentiable.manifold": {"walltime": 16},
-  "sage.manifolds.differentiable.manifold_homset": {"walltime": 16},
+  "sage.manifolds.differentiable.levi_civita_connection": {"walltime": 16},
+  "sage.manifolds.differentiable.manifold": {"walltime": 8},
+  "sage.manifolds.differentiable.manifold_homset": {"walltime": 8},
   "sage.manifolds.differentiable.metric": {"walltime": 64},
   "sage.manifolds.differentiable.mixed_form": {"walltime": 16},
-  "sage.manifolds.differentiable.mixed_form_algebra": {"walltime": 8},
   "sage.manifolds.differentiable.multivectorfield": {"walltime": 64},
-  "sage.manifolds.differentiable.pseudo_riemannian": {"walltime": 16},
-  "sage.manifolds.differentiable.pseudo_riemannian_submanifold": {"walltime": 128},
-  "sage.manifolds.differentiable.scalarfield": {"walltime": 16},
+  "sage.manifolds.differentiable.pseudo_riemannian": {"walltime": 8},
+  "sage.manifolds.differentiable.pseudo_riemannian_submanifold": {"walltime": 32},
+  "sage.manifolds.differentiable.scalarfield": {"walltime": 8},
   "sage.manifolds.differentiable.scalarfield_algebra": {"walltime": 8},
-  "sage.manifolds.differentiable.tangent_vector": {"walltime": 16},
+  "sage.manifolds.differentiable.tangent_vector": {"walltime": 8},
   "sage.manifolds.differentiable.tensorfield": {"walltime": 128},
   "sage.manifolds.differentiable.tensorfield_paral": {"walltime": 16},
-  "sage.manifolds.differentiable.vector_bundle": {"walltime": 16},
-  "sage.manifolds.differentiable.vectorfield": {"walltime": 64},
-  "sage.manifolds.differentiable.vectorframe": {"walltime": 8},
+  "sage.manifolds.differentiable.vectorfield": {"walltime": 16},
   "sage.manifolds.point": {"walltime": 16},
   "sage.manifolds.scalarfield": {"walltime": 16},
-  "sage.manifolds.scalarfield_algebra": {"walltime": 8},
-  "sage.manifolds.section": {"walltime": 32},
-  "sage.manifolds.trivialization": {"walltime": 8},
-  "sage.manifolds.vector_bundle": {"walltime": 8},
-  "sage.matrix.benchmark": {"walltime": 8},
+  "sage.manifolds.section": {"walltime": 16},
   "sage.matrix.matrix2": {"walltime": 16},
-  "sage.matrix.matrix_integer_dense": {"walltime": 16},
-  "sage.matrix.matrix_integer_dense_hnf": {"walltime": 32},
-  "sage.matrix.matrix_mod2_dense": {"walltime": 8},
   "sage.matrix.matrix_rational_dense": {"walltime": 8},
   "sage.matrix.special": {"walltime": 8},
-  "sage.matroids.catalog": {"walltime": 64},
   "sage.misc.cachefunc": {"walltime": 16},
-  "sage.misc.cython": {"walltime": 8},
   "sage.misc.functional": {"walltime": 8},
   "sage.misc.randstate": {"walltime": 16},
-  "sage.misc.sagedoc": {"walltime": 64},
-  "sage.misc.sageinspect": {"walltime": 32},
-  "sage.modular.abvar.abvar": {"walltime": 16},
+  "sage.misc.sagedoc": {"walltime": 16},
+  "sage.misc.sageinspect": {"walltime": 16},
+  "sage.misc.trace": {"walltime": 8},
+  "sage.modular.abvar.abvar": {"walltime": 8},
   "sage.modular.abvar.homspace": {"walltime": 8},
-  "sage.modular.abvar.lseries": {"walltime": 8},
-  "sage.modular.arithgroup.arithgroup_perm": {"walltime": 8},
-  "sage.modular.arithgroup.tests": {"walltime": 8},
-  "sage.modular.btquotients.pautomorphicform": {"walltime": 32},
-  "sage.modular.hypergeometric_motive": {"walltime": 16},
-  "sage.modular.local_comp.local_comp": {"walltime": 32},
-  "sage.modular.local_comp.type_space": {"walltime": 16},
-  "sage.modular.modform.ambient_R": {"walltime": 16},
-  "sage.modular.modform.constructor": {"walltime": 8},
-  "sage.modular.modform.cuspidal_submodule": {"walltime": 16},
-  "sage.modular.modform.element": {"walltime": 64},
-  "sage.modular.modform.ring": {"walltime": 64},
-  "sage.modular.modform.space": {"walltime": 8},
+  "sage.modular.btquotients.btquotient": {"walltime": 8},
+  "sage.modular.btquotients.pautomorphicform": {"walltime": 16},
+  "sage.modular.hecke.submodule": {"walltime": 8},
+  "sage.modular.hypergeometric_motive": {"walltime": 8},
+  "sage.modular.local_comp.local_comp": {"walltime": 16},
+  "sage.modular.local_comp.type_space": {"walltime": 8},
+  "sage.modular.modform.element": {"walltime": 32},
   "sage.modular.modform_hecketriangle.abstract_space": {"walltime": 16},
   "sage.modular.modform_hecketriangle.graded_ring_element": {"walltime": 16},
   "sage.modular.modform_hecketriangle.hecke_triangle_group_element": {"walltime": 32},
   "sage.modular.modform_hecketriangle.readme": {"walltime": 16},
-  "sage.modular.modform_hecketriangle.space": {"walltime": 8},
   "sage.modular.modsym.ambient": {"walltime": 16},
   "sage.modular.modsym.space": {"walltime": 8},
-  "sage.modular.pollack_stevens.modsym": {"walltime": 64},
-  "sage.modular.pollack_stevens.padic_lseries": {"walltime": 32},
-  "sage.modules.finite_submodule_iter": {"walltime": 16},
-  "sage.modules.free_module": {"walltime": 16},
-  "sage.modules.free_module_element": {"walltime": 8},
-  "sage.modules.free_module_integer": {"walltime": 32},
-  "sage.modules.free_quadratic_module_integer_symmetric": {"walltime": 8},
-  "sage.modules.torsion_quadratic_module": {"walltime": 16},
+  "sage.modular.overconvergent.genus0": {"walltime": 8},
+  "sage.modular.pollack_stevens.modsym": {"walltime": 8},
+  "sage.modules.fp_graded.morphism": {"walltime": 8},
+  "sage.modules.free_module": {"walltime": 8},
   "sage.parallel.map_reduce": {"walltime": 8},
-  "sage.plot.animate": {"walltime": 16},
-  "sage.plot.arrow": {"walltime": 8},
-  "sage.plot.circle": {"walltime": 8},
-  "sage.plot.complex_plot": {"walltime": 8},
+  "sage.plot.complex_plot": {"walltime": 16},
   "sage.plot.contour_plot": {"walltime": 32},
-  "sage.plot.density_plot": {"walltime": 8},
   "sage.plot.graphics": {"walltime": 32},
   "sage.plot.line": {"walltime": 8},
   "sage.plot.matrix_plot": {"walltime": 16},
@@ -283,115 +154,53 @@
   "sage.plot.plot": {"walltime": 64},
   "sage.plot.plot3d.base": {"walltime": 8},
   "sage.plot.plot3d.implicit_plot3d": {"walltime": 16},
-  "sage.plot.plot3d.implicit_surface": {"walltime": 8},
-  "sage.plot.plot3d.parametric_plot3d": {"walltime": 8},
+  "sage.plot.plot3d.parametric_plot3d": {"walltime": 16},
   "sage.plot.plot3d.parametric_surface": {"walltime": 8},
   "sage.plot.plot3d.plot3d": {"walltime": 16},
-  "sage.plot.plot3d.tachyon": {"walltime": 8},
-  "sage.plot.plot3d.transform": {"walltime": 32},
   "sage.plot.point": {"walltime": 8},
   "sage.plot.polygon": {"walltime": 8},
   "sage.plot.streamline_plot": {"walltime": 8},
-  "sage.quadratic_forms.genera.genus": {"walltime": 16},
-  "sage.quadratic_forms.quadratic_form__automorphisms": {"walltime": 8},
-  "sage.quadratic_forms.quadratic_form__local_representation_conditions": {"walltime": 64},
-  "sage.quadratic_forms.quadratic_form__neighbors": {"walltime": 8},
-  "sage.quadratic_forms.quadratic_form__siegel_product": {"walltime": 8},
   "sage.repl.ipython_extension": {"walltime": 8},
-  "sage.rings.asymptotic.asymptotic_expansion_generators": {"walltime": 64},
+  "sage.rings.asymptotic.asymptotic_expansion_generators": {"walltime": 16},
   "sage.rings.asymptotic.asymptotic_ring": {"walltime": 8},
-  "sage.rings.asymptotic.asymptotics_multivariate_generating_functions": {"walltime": 32},
-  "sage.rings.asymptotic.term_monoid": {"walltime": 8},
-  "sage.rings.continued_fraction": {"walltime": 8},
+  "sage.rings.asymptotic.asymptotics_multivariate_generating_functions": {"walltime": 8},
   "sage.rings.finite_rings.finite_field_base": {"walltime": 8},
-  "sage.rings.function_field.function_field": {"walltime": 128},
-  "sage.rings.function_field.function_field_valuation": {"walltime": 64},
+  "sage.rings.function_field.function_field": {"walltime": 8},
   "sage.rings.function_field.ideal": {"walltime": 8},
-  "sage.rings.function_field.place": {"walltime": 8},
-  "sage.rings.integer": {"walltime": 64},
-  "sage.rings.invariants.invariant_theory": {"walltime": 8},
-  "sage.rings.number_field.bdd_height": {"walltime": 8},
-  "sage.rings.number_field.number_field": {"walltime": 64},
-  "sage.rings.number_field.number_field_element": {"walltime": 16},
-  "sage.rings.number_field.splitting_field": {"walltime": 8},
-  "sage.rings.number_field.totallyreal": {"walltime": 16},
-  "sage.rings.number_field.totallyreal_rel": {"walltime": 8},
-  "sage.rings.padics.padic_base_leaves": {"walltime": 64},
-  "sage.rings.padics.padic_extension_leaves": {"walltime": 64},
-  "sage.rings.padics.padic_generic_element": {"walltime": 16},
-  "sage.rings.padics.padic_lattice_element": {"walltime": 32},
-  "sage.rings.padics.relative_extension_leaves": {"walltime": 32},
+  "sage.rings.lazy_series": {"walltime": 8},
+  "sage.rings.lazy_series_ring": {"walltime": 32},
+  "sage.rings.number_field.number_field": {"walltime": 32},
+  "sage.rings.number_field.number_field_element": {"walltime": 8},
+  "sage.rings.padics.padic_base_leaves": {"walltime": 8},
+  "sage.rings.padics.padic_generic_element": {"walltime": 8},
   "sage.rings.polynomial.multi_polynomial_ideal": {"walltime": 8},
-  "sage.rings.polynomial.multi_polynomial_sequence": {"walltime": 8},
-  "sage.rings.polynomial.ore_function_element": {"walltime": 8},
   "sage.rings.polynomial.polynomial_element": {"walltime": 16},
-  "sage.rings.polynomial.polynomial_rational_flint": {"walltime": 8},
   "sage.rings.qqbar": {"walltime": 16},
-  "sage.rings.tests": {"walltime": 16},
-  "sage.rings.valuation.augmented_valuation": {"walltime": 32},
-  "sage.rings.valuation.mapped_valuation": {"walltime": 64},
-  "sage.rings.valuation.valuation": {"walltime": 8},
-  "sage.sandpiles.sandpile": {"walltime": 16},
+  "sage.sandpiles.sandpile": {"walltime": 8},
   "sage.schemes.curves.affine_curve": {"walltime": 16},
   "sage.schemes.curves.closed_point": {"walltime": 8},
   "sage.schemes.curves.projective_curve": {"walltime": 32},
-  "sage.schemes.cyclic_covers.cycliccover_finite_field": {"walltime": 64},
   "sage.schemes.elliptic_curves.BSD": {"walltime": 8},
   "sage.schemes.elliptic_curves.Qcurves": {"walltime": 8},
-  "sage.schemes.elliptic_curves.constructor": {"walltime": 32},
-  "sage.schemes.elliptic_curves.ell_curve_isogeny": {"walltime": 16},
-  "sage.schemes.elliptic_curves.ell_egros": {"walltime": 32},
-  "sage.schemes.elliptic_curves.ell_finite_field": {"walltime": 8},
+  "sage.schemes.elliptic_curves.ell_curve_isogeny": {"walltime": 8},
   "sage.schemes.elliptic_curves.ell_generic": {"walltime": 8},
-  "sage.schemes.elliptic_curves.ell_modular_symbols": {"walltime": 16},
-  "sage.schemes.elliptic_curves.ell_number_field": {"walltime": 128},
+  "sage.schemes.elliptic_curves.ell_modular_symbols": {"walltime": 8},
   "sage.schemes.elliptic_curves.ell_point": {"walltime": 8},
-  "sage.schemes.elliptic_curves.ell_rational_field": {"walltime": 128},
-  "sage.schemes.elliptic_curves.gal_reps_number_field": {"walltime": 32},
-  "sage.schemes.elliptic_curves.gp_simon": {"walltime": 16},
-  "sage.schemes.elliptic_curves.heegner": {"walltime": 32},
-  "sage.schemes.elliptic_curves.height": {"walltime": 64},
-  "sage.schemes.elliptic_curves.isogeny_class": {"walltime": 32},
-  "sage.schemes.elliptic_curves.isogeny_small_degree": {"walltime": 64},
-  "sage.schemes.elliptic_curves.kraus": {"walltime": 16},
+  "sage.schemes.elliptic_curves.ell_rational_field": {"walltime": 32},
+  "sage.schemes.elliptic_curves.height": {"walltime": 8},
+  "sage.schemes.elliptic_curves.isogeny_small_degree": {"walltime": 16},
   "sage.schemes.elliptic_curves.mod_sym_num": {"walltime": 8},
   "sage.schemes.elliptic_curves.padic_lseries": {"walltime": 8},
-  "sage.schemes.elliptic_curves.padics": {"walltime": 16},
-  "sage.schemes.elliptic_curves.saturation": {"walltime": 16},
-  "sage.schemes.elliptic_curves.sha_tate": {"walltime": 32},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_finite_field": {"walltime": 64},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_generic": {"walltime": 8},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_padic_field": {"walltime": 32},
-  "sage.schemes.hyperelliptic_curves.monsky_washnitzer": {"walltime": 8},
-  "sage.schemes.projective.projective_rational_point": {"walltime": 8},
-  "sage.schemes.riemann_surfaces.riemann_surface": {"walltime": 64},
+  "sage.schemes.elliptic_curves.padics": {"walltime": 8},
+  "sage.schemes.elliptic_curves.sha_tate": {"walltime": 16},
+  "sage.schemes.hyperelliptic_curves.hyperelliptic_padic_field": {"walltime": 16},
+  "sage.schemes.riemann_surfaces.riemann_surface": {"walltime": 32},
   "sage.schemes.toric.chow_group": {"walltime": 8},
-  "sage.schemes.toric.sheaf.klyachko": {"walltime": 8},
-  "sage.stats.distributions.discrete_gaussian_integer": {"walltime": 8},
-  "sage.stats.time_series": {"walltime": 8},
-  "sage.structure.coerce_dict": {"walltime": 32},
   "sage.structure.element": {"walltime": 16},
-  "sage.structure.sage_object": {"walltime": 8},
   "sage.symbolic.expression": {"walltime": 32},
-  "sage.symbolic.integration.integral": {"walltime": 32},
-  "sage.symbolic.random_tests": {"walltime": 32},
+  "sage.symbolic.integration.integral": {"walltime": 16},
   "sage.symbolic.relation": {"walltime": 8},
-  "sage.tests.book_schilling_zabrocki_kschur_primer": {"walltime": 32},
-  "sage.tests.book_stein_ent": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.combinat_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.float_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.graphique_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.graphtheory_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.integration_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.mpoly_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.nonlinear_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.recequadiff_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.graphique_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.numbertheory_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.polynomes_doctest": {"walltime": 16},
-  "sage.tests.cmdline": {"walltime": 64},
-  "sage.tests.gosper-sum": {"walltime": 16},
-  "sage.tests.parigp": {"walltime": 8},
-  "sage.topology.simplicial_complex": {"walltime": 8},
-  "sage.topology.simplicial_complex_examples": {"walltime": 16}
+  "sage.tests.book_schilling_zabrocki_kschur_primer": {"walltime": 16},
+  "sage.tests.book_stein_ent": {"walltime": 8},
+  "sage.topology.simplicial_complex": {"walltime": 16}
 }
diff --git a/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch b/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
deleted file mode 100644
index f2f825e4fb10..000000000000
--- a/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
+++ /dev/null
@@ -1,205 +0,0 @@
-diff --git a/build/pkgs/singular/checksums.ini b/build/pkgs/singular/checksums.ini
-index 2e33a405d36..313463d2fea 100644
---- a/build/pkgs/singular/checksums.ini
-+++ b/build/pkgs/singular/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=singular-VERSION.tar.gz
--sha1=6c2b622d3681e2de3d58d30c654d43d3e32b720c
--md5=abb1e37c794472e7760655358ab66054
--cksum=17455733
-+sha1=28bb3ee97ef48d04dfa96de182fd93eebe08426c
-+md5=fc0a4f5720dadba45a52ee94324ce00c
-+cksum=1573851737
- upstream_url=ftp://jim.mathematik.uni-kl.de/pub/Math/Singular/SOURCES/4-3-1/singular-VERSION.tar.gz
-diff --git a/build/pkgs/singular/package-version.txt b/build/pkgs/singular/package-version.txt
-index 11300c77e7d..66e2bede53a 100644
---- a/build/pkgs/singular/package-version.txt
-+++ b/build/pkgs/singular/package-version.txt
-@@ -1 +1 @@
--4.3.1p1
-+4.3.1p3
-diff --git a/src/sage/libs/singular/decl.pxd b/src/sage/libs/singular/decl.pxd
-index 8e3ac314b67..747a6b1e2fb 100644
---- a/src/sage/libs/singular/decl.pxd
-+++ b/src/sage/libs/singular/decl.pxd
-@@ -574,7 +574,7 @@ cdef extern from "singular/Singular/libsingular.h":
- 
-     # gets a component out of a polynomial vector
- 
--    poly *pTakeOutComp1(poly **, int)
-+    poly *pTakeOutComp(poly **, int)
- 
-     # deep copy p
- 
-diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx
-index d8ea7b07f3c..3a1271cd59f 100644
---- a/src/sage/libs/singular/singular.pyx
-+++ b/src/sage/libs/singular/singular.pyx
-@@ -1726,20 +1726,21 @@ cdef int overflow_check(unsigned long e, ring *_ring) except -1:
- 
-     Whether an overflow occurs or not partially depends
-     on the number of variables in the ring. See trac ticket
--    :trac:`11856`. With Singular 4, it is by default optimized
--    for at least 4 variables on 64-bit and 2 variables on 32-bit,
--    which in both cases makes a maximal default exponent of
--    2^16-1.
-+    :trac:`11856`.
- 
-     EXAMPLES::
- 
-         sage: P.<x,y> = QQ[]
--        sage: y^(2^16-1)
--        y^65535
--        sage: y^2^16
-+        sage: y^(2^30)
-+        Traceback (most recent call last):             # 32-bit
-+        ...                                            # 32-bit
-+        OverflowError: exponent overflow (1073741824)  # 32-bit
-+        y^1073741824  # 64-bit
-+        sage: y^2^32
-         Traceback (most recent call last):
-         ...
--        OverflowError: exponent overflow (65536)
-+        OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+        OverflowError: exponent overflow (4294967296)  # 64-bit
-     """
-     if unlikely(e > _ring.bitmask):
-         raise OverflowError("exponent overflow (%d)"%(e))
-diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py
-index 7dc058a22f0..71494eddbc0 100644
---- a/src/sage/rings/polynomial/multi_polynomial_ideal.py
-+++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py
-@@ -60,7 +60,7 @@
- Note that the result of a computation is not necessarily reduced::
- 
-     sage: (a+b)^17
--    256*a*b^16 + 256*b^17
-+    a*b^16 + b^17
-     sage: S(17) == 0
-     True
- 
-diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-index 4dad016b33f..9bf67dd1425 100644
---- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-+++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-@@ -193,7 +193,7 @@ from sage.libs.singular.decl cimport (
-     p_IsUnit, p_IsOne, p_Series, p_Head, idInit, fast_map_common_subexp, id_Delete,
-     p_IsHomogeneous, p_Homogen, p_Totaldegree,pLDeg1_Totaldegree, singclap_pdivide, singclap_factorize,
-     idLift, IDELEMS, On, Off, SW_USE_CHINREM_GCD, SW_USE_EZGCD,
--    p_LmIsConstant, pTakeOutComp1, singclap_gcd, pp_Mult_qq, p_GetMaxExp,
-+    p_LmIsConstant, pTakeOutComp, singclap_gcd, pp_Mult_qq, p_GetMaxExp,
-     pLength, kNF, p_Neg, p_Minus_mm_Mult_qq, p_Plus_mm_Mult_qq,
-     pDiff, singclap_resultant, p_Normalize,
-     prCopyR, prCopyR_NoSort)
-@@ -1587,7 +1587,8 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_base):
-             9/4
- 
-             sage: P.monomial_quotient(x,y) # Note the wrong result
--            x*y^65535*z^65535
-+            x*y^65535*z^65535      # 32-bit
-+            x*y^1048575*z^1048575  # 64-bit
- 
-             sage: P.monomial_quotient(x,P(1))
-             x
-@@ -2247,10 +2248,11 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             9/4*x^2 - 1/4*y^2 - y - 1
- 
-             sage: P.<x,y> = PolynomialRing(QQ,order='lex')
--            sage: (x^2^15) * x^2^15
-+            sage: (x^2^32) * x^2^32
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (...)
-+            OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+            OverflowError: exponent overflow (...)  # 64-bit
-         """
-         # all currently implemented rings are commutative
-         cdef poly *_p
-@@ -2371,10 +2373,11 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             ValueError: not a 2nd power
- 
-             sage: P.<x,y> = PolynomialRing(QQ,order='lex')
--            sage: (x+y^2^15)^10
-+            sage: (x+y^2^32)^10
-             Traceback (most recent call last):
-             ....
--            OverflowError: exponent overflow (...)
-+            OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+            OverflowError: exponent overflow (...)  # 64-bit
- 
-         Test fractional powers (:trac:`22329`)::
- 
-@@ -3461,7 +3464,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             x^10000
-             no overflow
- 
--            sage: n = 1000
-+            sage: n = 100000
-             sage: try:
-             ....:     f = x^n
-             ....:     f.subs(x = x^n)
-@@ -4567,7 +4570,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
-         l = []
-         for i from 0 <= i < IDELEMS(res):
-             for j from 1 <= j <= IDELEMS(_I):
--                l.append( new_MP(parent, pTakeOutComp1(&res.m[i], j)) )
-+                l.append( new_MP(parent, pTakeOutComp(&res.m[i], 1)) )
- 
-         id_Delete(&fI, r)
-         id_Delete(&_I, r)
-@@ -4635,7 +4638,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
- 
-             sage: f = 3*x
-             sage: f.reduce([2*x,y])
--            3*x
-+            x
- 
-         The reduction is not canonical when ``I`` is not a Groebner
-         basis::
-diff --git a/src/sage/rings/polynomial/plural.pyx b/src/sage/rings/polynomial/plural.pyx
-index 1c9f35e56ba..587511c3888 100644
---- a/src/sage/rings/polynomial/plural.pyx
-+++ b/src/sage/rings/polynomial/plural.pyx
-@@ -1619,10 +1619,10 @@ cdef class NCPolynomial_plural(RingElement):
-             sage: P = A.g_algebra(relations={y*x:-x*y + z},  order='lex')
-             sage: P.inject_variables()
-             Defining x, z, y
--            sage: (x^2^15) * x^2^15
-+            sage: (x^2^31) * x^2^31
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (65536)
-+            OverflowError: exponent overflow (2147483648)
-         """
-         # all currently implemented rings are commutative
-         cdef poly *_p
-@@ -1689,10 +1689,10 @@ cdef class NCPolynomial_plural(RingElement):
-             sage: P = A.g_algebra(relations={y*x:-x*y + z},  order='lex')
-             sage: P.inject_variables()
-             Defining x, z, y
--            sage: (x+y^2^15)^10
-+            sage: (x+y^2^31)^10
-             Traceback (most recent call last):
-             ....
--            OverflowError: exponent overflow (327680)
-+            OverflowError: exponent overflow (2147483648)
-         """
-         if type(exp) is not Integer:
-             try:
-diff --git a/src/sage/structure/element.pyx b/src/sage/structure/element.pyx
-index b5d83ef71b6..5c45b3fb528 100644
---- a/src/sage/structure/element.pyx
-+++ b/src/sage/structure/element.pyx
-@@ -2705,10 +2705,10 @@ cdef class RingElement(ModuleElement):
-         with Singular 4::
- 
-             sage: K.<x,y> = ZZ[]
--            sage: (x^12345)^54321
-+            sage: (x^123456)^654321
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (670592745)
-+            OverflowError: exponent overflow (...)
-         """
-         return arith_generic_power(self, n)
- 
diff --git a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch b/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
deleted file mode 100644
index ee0f0e656b28..000000000000
--- a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py
-index d5f7157217f..8ca1f958039 100644
---- a/src/sage/rings/number_field/number_field_ideal.py
-+++ b/src/sage/rings/number_field/number_field_ideal.py
-@@ -996,16 +996,38 @@ def is_prime(self):
-             False
-             sage: K.ideal(17).is_prime()  # ramified
-             False
-+
-+        TESTS:
-+
-+        Check that we do not factor the norm of the ideal, this used
-+        to take half an hour, see :trac:`33360`::
-+
-+            sage: K.<a,b,c> = NumberField([x^2-2,x^2-3,x^2-5])
-+            sage: t = (((-2611940*c + 1925290/7653)*b - 1537130/7653*c
-+            ....:       + 10130950)*a + (1343014/7653*c - 8349770)*b
-+            ....:       + 6477058*c - 2801449990/4002519)
-+            sage: t.is_prime()
-+            False
-         """
-         try:
-             return self._pari_prime is not None
-         except AttributeError:
--            F = self.factor()  # factorization with caching
--            if len(F) != 1 or F[0][1] != 1:
--                self._pari_prime = None
--            else:
--                self._pari_prime = F[0][0]._pari_prime
--            return self._pari_prime is not None
-+            pass
-+
-+        K = self.number_field().pari_nf()
-+        I = self.pari_hnf()
-+
-+        candidate = K.idealismaximal(I) or None
-+
-+        # PARI uses probabilistic primality testing inside idealismaximal().
-+        if get_flag(None, 'arithmetic'):
-+            # proof required, check using isprime()
-+            if candidate and not candidate[0].isprime():
-+                candidate = None
-+
-+        self._pari_prime = candidate
-+
-+        return self._pari_prime is not None
- 
-     def pari_prime(self):
-         r"""
diff --git a/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch b/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
deleted file mode 100644
index 91f06fd4d173..000000000000
--- a/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-diff --git a/src/sage/misc/persist.pyx b/src/sage/misc/persist.pyx
-index 3ac5f1cc2b0..cb1f327c199 100644
---- a/src/sage/misc/persist.pyx
-+++ b/src/sage/misc/persist.pyx
-@@ -157,7 +157,7 @@ def load(*filename, compress=True, verbose=True, **kwargs):
-         ....:     _ = f.write(code)
-         sage: load(t)
-         sage: hello
--        <fortran object>
-+        <fortran ...>
-     """
-     import sage.repl.load
-     if len(filename) != 1:
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index 6f0aeab87ae..b77c69b2f77 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -461,6 +461,8 @@ def complex_to_rgb(z_values, contoured=False, tiled=False,
-             rgb[i, j, 2] = b
- 
-     sig_off()
-+    nan_indices = np.isnan(rgb).any(-1)     # Mask for undefined points
-+    rgb[nan_indices] = 1                    # Make nan_indices white
-     return rgb
- 
- 
-diff --git a/src/sage/plot/histogram.py b/src/sage/plot/histogram.py
-index 3bc2b76b58e..388c2d1391d 100644
---- a/src/sage/plot/histogram.py
-+++ b/src/sage/plot/histogram.py
-@@ -87,13 +87,8 @@ def get_minmax_data(self):
- 
-         TESTS::
- 
--            sage: h = histogram([10,3,5], normed=True)[0]
--            doctest:warning...:
--            DeprecationWarning: the 'normed' option is deprecated. Use 'density' instead.
--            See https://trac.sagemath.org/25260 for details.
-+            sage: h = histogram([10,3,5], density=True)[0]
-             sage: h.get_minmax_data()
--            doctest:warning ...
--            ...VisibleDeprecationWarning: Passing `normed=True` on non-uniform bins has always been broken, and computes neither the probability density function nor the probability mass function. The result is only correct if the bins are uniform, when density=True will produce the same result anyway. The argument will be removed in a future version of numpy.
-             {'xmax': 10.0, 'xmin': 3.0, 'ymax': 0.476190476190..., 'ymin': 0}
-         """
-         import numpy
-diff --git a/src/sage/repl/ipython_extension.py b/src/sage/repl/ipython_extension.py
-index 798671aab42..cad6a47ca8b 100644
---- a/src/sage/repl/ipython_extension.py
-+++ b/src/sage/repl/ipython_extension.py
-@@ -405,7 +405,7 @@ def fortran(self, line, cell):
-             ....: C END FILE FIB1.F
-             ....: ''')
-             sage: fib
--            <fortran object>
-+            <fortran ...>
-             sage: from numpy import array
-             sage: a = array(range(10), dtype=float)
-             sage: fib(a, 10)
diff --git a/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch b/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
deleted file mode 100644
index 2769e87f6a4b..000000000000
--- a/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-diff --git a/src/sage/interfaces/tachyon.py b/src/sage/interfaces/tachyon.py
-index 23671e50892..ce1d50f71bc 100644
---- a/src/sage/interfaces/tachyon.py
-+++ b/src/sage/interfaces/tachyon.py
-@@ -683,12 +683,14 @@
- #*****************************************************************************
- 
- import os
-+import re
- 
- from sage.cpython.string import bytes_to_str
- from sage.misc.pager import pager
- from sage.misc.superseded import deprecation
- from sage.misc.temporary_file import tmp_filename
- from sage.structure.sage_object import SageObject
-+from sage.misc.cachefunc import cached_method
- 
- 
- class TachyonRT(SageObject):
-@@ -799,6 +801,11 @@ def __call__(self, model, outfile='sage.png', verbose=1, extra_opts=''):
-             Parser failed due to an input file syntax error.
-             Aborting render.
-         """
-+        if self.version() >= '0.99.2':
-+            # this keyword was changed in 0.99.2
-+            model = model.replace(
-+                    "              focallength ",
-+                    "              focaldist ")
-         modelfile = tmp_filename(ext='.dat')
-         with open(modelfile, 'w') as file:
-             file.write(model)
-@@ -851,6 +858,25 @@ def usage(self, use_pager=True):
-         else:
-             print(r)
- 
-+    @cached_method
-+    def version(self):
-+        """
-+        Returns the version of the Tachyon raytracer being used.
-+
-+        TESTS::
-+
-+            sage: tachyon_rt.version()  # random
-+            0.98.9
-+            sage: tachyon_rt.version() >= '0.98.9'
-+            True
-+        """
-+        with os.popen('tachyon') as f:
-+            r = f.readline()
-+        res = re.search(r"Version ([\d.]*)", r)
-+        # debian patches tachyon so it won't report the version
-+        # we hardcode '0.99' since that's indeed the version they ship
-+        return res[1] if res else '0.99'
-+
-     def help(self, use_pager=True):
-         """
-         Deprecated: type 'sage.interfaces.tachyon?' for help
diff --git a/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch b/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
deleted file mode 100644
index 11eb20d4f735..000000000000
--- a/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff --git a/src/sage/arith/long.pxd b/src/sage/arith/long.pxd
-index 1c9a53387a0..d96b98f247c 100644
---- a/src/sage/arith/long.pxd
-+++ b/src/sage/arith/long.pxd
-@@ -270,6 +270,17 @@ cdef inline bint integer_check_long_py(x, long* value, int* err):
-         sage: L += [-x for x in L] + [0, long_min()]
-         sage: for v in L:
-         ....:     assert check_long_py(int(v)) == v
-+        sage: check_long_py(int(2^60))
-+        1152921504606846976                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^61))
-+        2305843009213693952                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^62))
-+        4611686018427387904                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^63))
-+        'Overflow (...)'
-         sage: check_long_py(int(2^100))
-         'Overflow (...)'
-         sage: check_long_py(int(long_max() + 1))
-@@ -309,7 +320,12 @@ cdef inline bint integer_check_long_py(x, long* value, int* err):
- 
-     cdef long lead
-     cdef long lead_2_overflow = (<long>1) << (BITS_IN_LONG - PyLong_SHIFT)
--    cdef long lead_3_overflow = (<long>1) << (BITS_IN_LONG - 2 * PyLong_SHIFT)
-+    cdef long lead_3_overflow
-+    if BITS_IN_LONG < 2 * PyLong_SHIFT:
-+        # in this case 3 digit is always overflow
-+        lead_3_overflow = 0
-+    else:
-+        lead_3_overflow = (<long>1) << (BITS_IN_LONG - 2 * PyLong_SHIFT)
-     if size == 0:
-         value[0] = 0
-         err[0] = 0
diff --git a/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch b/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
deleted file mode 100644
index c4d7d5c779d1..000000000000
--- a/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/src/sage/schemes/toric/sheaf/klyachko.py b/src/sage/schemes/toric/sheaf/klyachko.py
-index b1304a16913..77fae4b7545 100644
---- a/src/sage/schemes/toric/sheaf/klyachko.py
-+++ b/src/sage/schemes/toric/sheaf/klyachko.py
-@@ -26,7 +26,7 @@
-     (0, 0, 18, 16, 1)
-     sage: Gtilde = G_sum.random_deformation()
-     sage: V = Gtilde.wedge(2) * K                     # long time
--    sage: V.cohomology(dim=True, weight=(0,0,0,0))    # long time
-+    sage: V.cohomology(dim=True, weight=(0,0,0,0))    # long time  # random failure (see #32773)
-     (0, 0, 3, 0, 0)
- 
- REFERENCES:
-@@ -948,7 +948,7 @@ def random_deformation(self, epsilon=None):
-            sage: V.cohomology(dim=True, weight=(0,))
-            (1, 0)
-            sage: Vtilde = V.random_deformation()
--           sage: Vtilde.cohomology(dim=True, weight=(0,))
-+           sage: Vtilde.cohomology(dim=True, weight=(0,))  # random failure (see #32773)
-            (1, 0)
-         """
-         filt = self._filt.random_deformation(epsilon)
diff --git a/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch b/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
deleted file mode 100644
index d9a9835c696b..000000000000
--- a/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 9ac7840134054155545e24fa3e66402d42b91c0f Mon Sep 17 00:00:00 2001
-From: Antonio Rojas <arojas@archlinux.org>
-Date: Fri, 20 Jan 2023 21:36:27 +0100
-Subject: [PATCH] Fix tests with giac 1.9.0.35
-
----
- src/sage/libs/giac/giac.pyx   |  3 +--
- src/sage/symbolic/relation.py | 15 +++++----------
- 2 files changed, 6 insertions(+), 12 deletions(-)
-
-diff --git a/src/sage/libs/giac/giac.pyx b/src/sage/libs/giac/giac.pyx
-index 4e451dba5e7..ccad5169836 100644
---- a/src/sage/libs/giac/giac.pyx
-+++ b/src/sage/libs/giac/giac.pyx
-@@ -374,8 +374,7 @@ def _giac(s):
- 
-         sage: x = libgiac('x')
-         sage: (1+2*sin(3*x)).solve(x).simplify()
--        Warning, argument is not an equation, solving 1+2*sin(3*x)=0
--        list[-pi/18,7*pi/18]
-+        ...list[-pi/18,7*pi/18]
- 
-         sage: libgiac.solve('sin(3*x)>2*sin(x)',x)
-         Traceback (most recent call last):
-diff --git a/src/sage/symbolic/relation.py b/src/sage/symbolic/relation.py
-index e9dbc0fea30..b8896a94be9 100644
---- a/src/sage/symbolic/relation.py
-+++ b/src/sage/symbolic/relation.py
-@@ -935,8 +935,7 @@ def solve(f, *args, **kwds):
- 
-         sage: f = (sin(x) - 8*cos(x)*sin(x))*(sin(x)^2 + cos(x)) - (2*cos(x)*sin(x) - sin(x))*(-2*sin(x)^2 + 2*cos(x)^2 - cos(x))
-         sage: solve(f, x, algorithm='giac')
--        ...
--        [-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-+        ...[-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
- 
-         sage: x, y = SR.var('x,y')
-         sage: solve([x+y-4,x*y-3],[x,y],algorithm='giac')
-@@ -1440,19 +1439,15 @@ def _giac_solver(f, x, solution_dict=False):
-     EXAMPLES::
- 
-         sage: solve([(2/3)^x-2], [x], algorithm='giac')
--        ...
--        [[-log(2)/(log(3) - log(2))]]
-+        ...[[-log(2)/(log(3) - log(2))]]
-         sage: solve([(2/3)^x-2], [x], algorithm='giac', solution_dict=True)
--        ...
--        [{x: -log(2)/(log(3) - log(2))}]
-+        ...[{x: -log(2)/(log(3) - log(2))}]
- 
-         sage: f = (sin(x) - 8*cos(x)*sin(x))*(sin(x)^2 + cos(x)) - (2*cos(x)*sin(x) - sin(x))*(-2*sin(x)^2 + 2*cos(x)^2 - cos(x))
-         sage: solve(f, x, algorithm='giac')
--        ...
--        [-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-+        ...[-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-         sage: solve(f, x, algorithm='giac', solution_dict=True)
--        ...
--        [{x: -2*arctan(sqrt(2))}, {x: 0}, {x: 2*arctan(sqrt(2))}, {x: pi}]
-+        ...[{x: -2*arctan(sqrt(2))}, {x: 0}, {x: 2*arctan(sqrt(2))}, {x: pi}]
- 
-         sage: x, y = SR.var('x,y')
-         sage: solve([x+y-7,x*y-10],[x,y],algorithm='giac')
diff --git a/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch b/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
deleted file mode 100644
index 499e0c71e256..000000000000
--- a/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
+++ /dev/null
@@ -1,1303 +0,0 @@
-diff --git a/build/pkgs/gap/checksums.ini b/build/pkgs/gap/checksums.ini
-index 066e943308a..b0ea8ba8818 100644
---- a/build/pkgs/gap/checksums.ini
-+++ b/build/pkgs/gap/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=gap-VERSION.tar.gz
--sha1=4ecdd281b8f430282fb9b12690b06e0a26abde10
--md5=85dc9e459d5b6c66fcad9f468afd3e3e
--cksum=1351843158
-+sha1=a6e36f3f874a2c46f51561402634497eab705cca
-+md5=c5cd9f272f2703d7a3649ad7193b2d90
-+cksum=2760477284
- upstream_url=https://github.com/gap-system/gap/releases/download/vVERSION/gap-VERSION.tar.gz
-diff --git a/build/pkgs/gap/package-version.txt b/build/pkgs/gap/package-version.txt
-index d782fca8f64..f1cd7de1de5 100644
---- a/build/pkgs/gap/package-version.txt
-+++ b/build/pkgs/gap/package-version.txt
-@@ -1 +1 @@
--4.11.1
-+4.12.2
-diff --git a/build/pkgs/gap/spkg-check.in b/build/pkgs/gap/spkg-check.in
-index d9791d33293..d2fccda6e04 100644
---- a/build/pkgs/gap/spkg-check.in
-+++ b/build/pkgs/gap/spkg-check.in
-@@ -3,6 +3,13 @@ cd src
- # #28728: Fix test failure in tst/testinstall/strings.tst
- export LC_CTYPE=en_US.UTF-8
- 
-+# #34391: in GAP 4.12 some packages need GAP package io
-+#         to let tests run, otherwise this hangs. Thus we install io here.
-+cd pkg/io
-+./configure --with-gaproot=../..
-+make
-+cd ../..
-+
- make testinstall
- if [[ $? -ne 0 ]]; then
-     exit 1
-diff --git a/build/pkgs/gap/spkg-install.in b/build/pkgs/gap/spkg-install.in
-index 2ceadf99db4..e2c8b4dca54 100644
---- a/build/pkgs/gap/spkg-install.in
-+++ b/build/pkgs/gap/spkg-install.in
-@@ -8,8 +8,7 @@ export CFLAGS=$CFLAGS_NON_NATIVE
- export CXXFLAGS=$CXXFLAGS_NON_NATIVE
- 
- GAP_BUILD_ROOT="$(pwd)"
--GAP_ROOT="$SAGE_LOCAL/share/gap"
--DESTDIR_GAP_ROOT="$SAGE_DESTDIR$GAP_ROOT"
-+GAP_ROOT="$SAGE_LOCAL/lib/gap"
- 
- # Enable debug info if requested.
- # Note that -g3 allows you to use preprocessor macros in gdb which are widely used
-@@ -17,37 +16,17 @@ if [ "$SAGE_DEBUG" = yes ] ; then
-     export CFLAGS="-O0 -g3 -DDEBUG_MASTERPOINTERS -DDEBUG_GLOBAL_BAGS -DDEBUG_FUNCTIONS_BAGS $CFLAGS"
- fi
- 
--sdh_configure $SAGE_CONFIGURE_GMP
--sdh_make -j1
-+# LDFLAGS hack below needed by Semigroups package
-+sdh_configure $SAGE_CONFIGURE_GMP LDFLAGS="-pthread" --prefix=$SAGE_LOCAL
-+sdh_make
- 
--# GAP's "make install" is work in progress; we use bits and pieces of it
--# but we install many things manually.
--sdh_make install-headers install-libgap
--
--# Install config.h, which is not currently handled by `make install-headers`
--sdh_install gen/config.h "$SAGE_LOCAL/include/gap"
--
--# Now install the gap executable as "gap-bin"; it will be called normally
--# through our wrapper script that sets the appropriate GAP_ROOT
--SAGE_BIN="$SAGE_LOCAL/bin"
--mkdir -p "$SAGE_DESTDIR$SAGE_BIN" || sdh_die "Failed to create the directory $SAGE_BIN"
--
--./libtool --mode=install install gap "$SAGE_DESTDIR$SAGE_BIN/gap-bin" || \
--    sdh_die "Failed to install gap-bin to $SAGE_BIN"
--
--./libtool --mode=install install gac "$SAGE_DESTDIR$SAGE_BIN/gac" || \
--    sdh_die "Failed to install gac to $SAGE_BIN"
--
--# Now copy additional files GAP needs to run (and a few optional bits) into
--# GAP_ROOT; we don't need everything from the source tree
--sdh_install bin doc gen grp lib src tst sysinfo.gap "$GAP_ROOT"
--
--# GAP's copy of libtool is also used by the toolchain for build GAP packages
--# (i.e. by gac)
--sdh_install libtool "$GAP_ROOT"
-+sdh_make_install
-+# sdh_make install-headers install-libgap
-+# The 'packagemanager' package expects this https://github.com/gap-packages/PackageManager/issues/105
-+mkdir -p "$SAGE_LOCAL/lib/gap/bin"
- 
- # Install only the minimal packages GAP needs to run
--sdh_install pkg/GAPDoc-* pkg/primgrp-* pkg/SmallGrp-* pkg/transgrp "$GAP_ROOT"/pkg
-+sdh_install pkg/gapdoc pkg/primgrp pkg/smallgrp pkg/transgrp "$GAP_ROOT"/pkg
- 
- # Install additional packages that are not strictly required, but that are
- # typically "expected" to be loaded: These are the default packages that are
-@@ -58,50 +37,25 @@ sdh_install pkg/GAPDoc-* pkg/primgrp-* pkg/SmallGrp-* pkg/transgrp "$GAP_ROOT"/p
- # Also include atlasrep which is a dependency of tomlib
- sdh_install \
-     pkg/atlasrep \
--    pkg/autpgrp-* \
--    pkg/alnuth-* \
--    pkg/crisp-* \
--    pkg/ctbllib-* \
--    pkg/FactInt-* \
-+    pkg/autodoc \
-+    pkg/autpgrp \
-+    pkg/alnuth \
-+    pkg/crisp \
-+    pkg/ctbllib \
-+    pkg/factint \
-     pkg/fga \
--    pkg/irredsol-* \
--    pkg/laguna-* \
--    pkg/PackageManager-* \
--    pkg/polenta-* \
--    pkg/polycyclic-* \
--    pkg/resclasses-* \
--    pkg/sophus-* \
--    pkg/tomlib-* \
-+    pkg/irredsol \
-+    pkg/laguna \
-+    pkg/packagemanager \
-+    pkg/polenta \
-+    pkg/polycyclic \
-+    pkg/radiroot \
-+    pkg/resclasses \
-+    pkg/sophus \
-+    pkg/tomlib \
-+    pkg/utils \
-     "$GAP_ROOT"/pkg
- 
--# Install the GAP startup script; ensure it is executable
--sdh_install -T ../gap "$SAGE_BIN/gap"
--chmod +x "$SAGE_DESTDIR$SAGE_BIN/gap"
--
--# Create symlinks under $GAP_ROOT for these executables, as they are expected
--# (especially when building kernel packages) to exist
--ln -sf "../../bin/gap-bin" "$DESTDIR_GAP_ROOT/gap"
--ln -sf "../../bin/gac" "$DESTDIR_GAP_ROOT/gac"
--
--# Fix the $GAP_ROOT/bin/<arch>/src symlink to be relative (otherwise it links
--# to the actual path of the sources GAP was compiled from)
--for srclink in "$DESTDIR_GAP_ROOT"/bin/*/src; do
--    rm -f "$srclink"
--    ln -s "../../src" "$srclink"
--done
--
--# Additional fixups for some files after they have been copied into their
--# destination directory.  gac and sysinfo.gap are generated files that contain
--# in them hard-coded references to the GAP build directory, which will soon
--# be going away.  This breaks the build toolchain for some compiled GAP
--# packages.  We need to replace these paths with the final GAP_ROOT path.  The
--# below will work so long as neither of these paths contain '|', and if they do
--# then god help you.  https://trac.sagemath.org/ticket/27218
--sed -i -e "s|$GAP_BUILD_ROOT|$GAP_ROOT|g" \
--    "$SAGE_DESTDIR$SAGE_BIN/gac" "$DESTDIR_GAP_ROOT/sysinfo.gap" \
--    "$DESTDIR_GAP_ROOT/bin/gap.sh" "$DESTDIR_GAP_ROOT/doc/make_doc" || \
--    sdh_die "Failed to fix up hard-coded paths in GAP build tools."
--
- # TODO: This seems unnecessary--we are already installing all of doc/ to
- # GAP_ROOT, which is necessary for some functionality in GAP to work.  Do
- # we need this?  Maybe doc/gap could just be a symlink to gap/doc??
-diff --git a/build/pkgs/gap/spkg-legacy-uninstall b/build/pkgs/gap/spkg-legacy-uninstall
-index d17eb939eb7..a8e5c59e1fb 100755
---- a/build/pkgs/gap/spkg-legacy-uninstall
-+++ b/build/pkgs/gap/spkg-legacy-uninstall
-@@ -4,6 +4,8 @@ rm -rf "$SAGE_LOCAL/gap/gap-4."*
- rm -rf "$SAGE_SHARE/gap"
- rm -f "$SAGE_LOCAL/gap/latest"
- rm -f "$SAGE_LOCAL/bin/gap"
-+rm -f "$SAGE_LOCAL/bin/gac"
- 
--# Remove old libgap headers
-+# Remove old libgap headers and library
- rm -rf "$SAGE_LOCAL/include/gap"
-+rm -rf "$SAGE_LOCAL/lib/gap"
-diff --git a/build/pkgs/gap/spkg-prerm.in b/build/pkgs/gap/spkg-prerm.in
-deleted file mode 100644
-index 661d92621fa..00000000000
---- a/build/pkgs/gap/spkg-prerm.in
-+++ /dev/null
-@@ -1,6 +0,0 @@
--# These generated files are placed in directory provided by the SPKG, so
--# delete the generated files first so that their parent directories can be
--# removed during installation
--GAP_ROOT="$SAGE_LOCAL/share/gap"
--rm -f "$GAP_ROOT/pkg/atlasrep/datagens/"*.*
--rm -f "$GAP_ROOT/pkg/atlasrep/dataword/"*.*
-diff --git a/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch b/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch
-deleted file mode 100644
-index e45fe7d9c6f..00000000000
---- a/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch
-+++ /dev/null
-@@ -1,150 +0,0 @@
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c b/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--index 3bbdc45..7df699f 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--@@ -8,9 +8,8 @@ extern short sp[],**mat[],*psp[],**imcos[],**cpco[],lorb[],
-- short *cst,**cpst,***cdpst,**svptr,*cp,*rel;
-- short *spst,**pspst,**pptr,**cpptr,npt,nb,nph,nph2,npg,npg2,
--       rno,orno,coh_index,*invg;
---FILE  *ip,*op;
-- 
---void seeknln (void) { while (getc(ip)!='\n'); }
--+void seeknln (FILE *ip) { while (getc(ip)!='\n'); }
-- 
-- /* This program differs from most other permutation programs in that perms are
--    all stored in the single array sp. Schreier vectors are stored in the short
--@@ -23,13 +22,14 @@ void seeknln (void) { while (getc(ip)!='\n'); }
-- int 
-- crprog1 (void)
-- { short *pc,*qc,ex,neg; int x;
--+  FILE  *ip,*op;
--   short i,j,k,l,m,n,cl,rl,*p,ocl,im,pt,pt1,pn,ipt;
--   if ((ip=fopen(inf2,"r"))== 0)
--   { fprintf(stderr,"Cannot open %s.\n",inf2); return(-1);}
--   fscanf(ip,"%hd%hd%hd%hd",&npt,&nph,&nb,&k);
--   if (nb>=mb) {fprintf(stderr,"nb too big. Increase MB.\n"); return(-1);}
--   if (k<=2) {fprintf(stderr,"inf2 has illegal format.\n"); return(-1); }
---  seeknln(); seeknln();
--+  seeknln(ip); seeknln(ip);
--   for (i=1;i<=nb;i++) fscanf(ip,"%hd",lorb+i);
--   pptr=psp-1; pspst=psp+nph; svptr=cpsp-1;  cpst=cpsp+nb;
--   invg=sp; nph2=2*nph; spst=sp+nph2;
--@@ -37,7 +37,7 @@ crprog1 (void)
--   { pptr[i]=spst+(i-1)*npt-1; p=pptr[i];
--     for (j=1;j<=npt;j++) {fscanf(ip,"%hd",&k); p[k]=j; }
--     invg[2*i-2]=2*i-1; invg[2*i-1]=2*i-2;
---    seeknln();
--+    seeknln(ip);
--   }
--   spst+=(npt*nph);
--   for (i=1;i<=nb;i++)
--@@ -75,7 +75,7 @@ crprog1 (void)
--   strcpy(inf1,inf0); strcat(inf1,".rel");
--   if ((ip=fopen(inf1,"r"))==0)
--   { fprintf(stderr,"Cannot open %s.\n",inf1); return(-1);}
---  fscanf(ip,"%hd%hd",&k,&rno); seeknln();
--+  fscanf(ip,"%hd%hd",&k,&rno); seeknln(ip);
--   op=fopen(outft,"w");
-- /* Now we have read everything in, and the computation can start */
--   orno=0;
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--index a7396b2..658496f 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--@@ -20,8 +20,6 @@ short  mexp=MEXP,mcl=MCL,no,rel[RSP],wt[MEXP],exp,*rpf,*rpb,
-- extern short  prime,dim,*spv,**spm,mspace[],*vec[],**mat[],cp[],pinv[],opmats,
--         mm,mv;
-- extern int msp;
---FILE *ip,*op;
---
-- 
-- int 
-- calcmats (void)
--@@ -59,7 +57,7 @@ calcmats (void)
--   }
--   for (i=1;i<=exp;i++) trans(mat[i+exp],mat[i]);
--   if (opmats)
---  { op=fopen(outf,"w");
--+  { FILE *op=fopen(outf,"w");
--     fprintf(op,"%4d%4d%4d\n",prime,dim,exp);
--     for (i=1;i<=exp;i++) printmat(mat[i]); 
--     fclose(op);
--@@ -71,6 +69,7 @@ int
-- rdmats (void)
-- /* reads matrices of generators of P */
-- { short i; int quot;
--+  FILE *ip;
--   ip=fopen(inf4,"r");
--   if (ip==0)
--   { fprintf(stderr,"Cannot open %s\n ",inf4); return(-1); }
--@@ -90,12 +89,12 @@ rdmats (void)
--   fclose(ip);
--   return(0);
-- }
---FILE *ip;
-- 
-- int 
-- ingp (int inp)
-- /* Read in output of respcrun -s */
-- { short i,j,k,l,m,*orpf,**pcp;
--+  FILE *ip;
--   ip=fopen(inf3,"r");
--   if (ip==0) { fprintf(stderr,"Cannot open %s\n",inf3); return(-1); }
--   fscanf(ip,"%hd%hd%hd%hd%hd%hd",&prime,&exp,&i,&no,&j,&m);
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--index 0896551..6841bc8 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--@@ -9,7 +9,6 @@ extern short  intexp,mexp,mng,wksp,
--        spugen[],*tlintg[];
-- extern int ptrsp,rsp;
-- short  fac;
---FILE *ip,*op;
-- 
-- int 
-- ingp (void)
--@@ -18,6 +17,7 @@ ingp (void)
--    of nqrun, and tails are also read in.
-- */
-- { short i,j,k,l,m,x,y,no,*orpf,*orpb,**pcp;  char tails;
--+  FILE *ip;
--   if ((ip=fopen(inf1,"r"))==0)
--   { fprintf(stderr,"Cannot open %s.\n",inf1); return(-1); }
--   fscanf(ip,"%hd%hd%hd%hd%hd%hd",&prime,&exp,&nng,&no,&class,&m);
--@@ -89,6 +89,7 @@ int
-- outgp (void)
-- /* The PCP is output, together with tails */
-- { short i,k,l,**pcp,*b,*e,*c;
--+  FILE *op;
--   op=fopen(outf,"w");
--   fprintf(op,"%4d%4d%4d%4d%4d%4d\n",prime,exp,nng,exp,class,1);
--   for (i=1;i<=exp;i++) fprintf(op,"%4d",wt[i]); fprintf(op,"\n");
--@@ -379,7 +380,7 @@ restart:
--     nng--; mnng--; enexpnt--;
--     if (nng==0)
--     { if (gap)
---      { op=fopen(outfm,"w"); fprintf(op,"COHOMOLO.Multiplier:=[];\n");
--+      { FILE *op=fopen(outfm,"w"); fprintf(op,"COHOMOLO.Multiplier:=[];\n");
--         fclose(op);
--         printf("All new generators eliminated. Multiplier is trivial.\n");
--       }
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--index 01cf914..0144883 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--@@ -9,7 +9,6 @@ extern short  intexp,mng,mexp,wksp,
--        spugen[],*intg[],*imintg[],*tlintg[];
-- extern int ptrsp,rsp;
-- short  *wf,*wc; char norm;
---FILE *ip,*op;
-- 
-- /* The data structures for this program and for nqrun are similar.
--    d1 and d2 contain definitions of generators. (Def. comes from commutator
--@@ -35,6 +34,7 @@ nqmprog (void)
-- { short i,j,k,l,m,d,*gi,*gj,*ti,*tj,cl,def,*ps,*pf,**dp,*nrpb,*p,*orpf,*orpb,
--         nb,np,k1,*rno,*covrel,**pgen,tdef,sgn;
--   char nt;
--+  FILE *ip,*op;
--   if (ingp() == -1) {fprintf(stderr,"Input error.\n"); return(-1); }
--   eexpnt=expnt+exp; enexpnt=nexpnt+nng;
-- 
-diff --git a/build/pkgs/gap_packages/patches/guava_leon_includes.patch b/build/pkgs/gap_packages/patches/guava_leon_includes.patch
-deleted file mode 100644
-index cdcd19cc3e8..00000000000
---- a/build/pkgs/gap_packages/patches/guava_leon_includes.patch
-+++ /dev/null
-@@ -1,13 +0,0 @@
----- a/pkg/guava-3.15/src/leon/src/generate.c	Sat Feb 29 09:02:10 2020
----- b/pkg/guava-3.15/src/leon/src/generate.c	Thu Sep 24 13:58:36 2020
--***************
--*** 115,120 ****
----- 115,122 ----
--  #include "groupio.h"
--  #include "enum.h"
--  #include "storage.h"
--+ #include "chbase.h"
--+ #include "inform.h"
--  
--  #ifdef ALT_TIME_HEADER
--  #include "cputime.h"
-diff --git a/build/pkgs/gap_packages/spkg-install.in b/build/pkgs/gap_packages/spkg-install.in
-index 168e6b11532..6dff182a48f 100644
---- a/build/pkgs/gap_packages/spkg-install.in
-+++ b/build/pkgs/gap_packages/spkg-install.in
-@@ -1,4 +1,4 @@
--GAP_ROOT="$SAGE_LOCAL/share/gap"
-+GAP_ROOT="$SAGE_LOCAL/lib/gap"
- PKG_DIR="$GAP_ROOT/pkg"
- 
- PKG_SRC_DIR="$(pwd)/src/pkg"
-@@ -11,33 +11,31 @@ cd "$PKG_SRC_DIR"
- #    (GAP 4.8.6 still had it, but this is gone in 4.10)
- 
- sdh_install \
--    aclib-* \
--    AutoDoc-* \
--    corelg-* \
--    crime-* \
-+    aclib \
-+    corelg \
-+    crime \
-     cryst \
-     crystcat \
--    design-* \
-+    design \
-     gbnp \
--    genss-* \
--    hap-* \
--    hapcryst-* \
--    hecke-* \
--    images-* \
--    liealgdb-* \
--    liepring-* \
--    liering-* \
--    loops-* \
--    MapClass-* \
--    polymaking-* \
--    qpa-* \
--    quagroup-* \
--    radiroot-* \
--    repsn-* \
--    sla-* \
--    sonata-* \
--    Toric-* \
--    utils-* \
-+    genss \
-+    hap \
-+    hapcryst \
-+    hecke \
-+    images \
-+    liealgdb \
-+    liepring \
-+    liering \
-+    loops \
-+    mapclass \
-+    polymaking \
-+    qpa \
-+    quagroup \
-+    repsn \
-+    singular \
-+    sla \
-+    sonata \
-+    toric \
-     "$PKG_DIR"
- 
- install_compiled_pkg()
-@@ -45,27 +43,23 @@ install_compiled_pkg()
-     local pkg="$1"
-     # Install the bin/ dir (where compiled modules should end up)
-     # under <prefix>/lib/gap; we then symlink to it later
--    sdh_install bin "$SAGE_LOCAL/lib/gap/pkg/$pkg"
-+    sdh_install * "$SAGE_LOCAL/lib/gap/pkg/$pkg"
- 
-+    # TODO:
-     # Clean up any build artificts before installing the rest of the package
-     # Also remove configure/Makefiles
-     # Note: None, if any of the packages really have a proper install target
--    make clean  # Works for some packages but not all
--    rm -rf bin/
--    rm -rf configure configure.* config.* autogen.sh *.m4 Makefile* m4/
-+    #make clean  # Works for some packages but not all
-+    #rm -rf bin/
-+    #rm -rf configure configure.* config.* autogen.sh *.m4 Makefile* m4/
- 
--    # Create the bin/ symlink
--    ln -s "$SAGE_LOCAL/lib/gap/pkg/$pkg/bin" bin
--
--    # Install the rest of the package files
--    sdh_install * "$PKG_DIR/$pkg"
- }
- 
- # Build and install compiled packages:
- #
- # These packages have an old ./configure that take the GAP_ROOT as a positional
- # argument
--for pkg in cohomolo-* crypting-* grape-* guava-* orb-* datastructures-*
-+for pkg in cohomolo crypting grape guava orb datastructures
- do
-     echo "Building GAP package $pkg"
-     CFLAGS="$CFLAGS -Wno-implicit-function-declaration"
-@@ -91,7 +85,7 @@ pararr=( " " " " "--with-external-planarity" "--with-external-libsemigroups" )
- ##############################################################################
- 
- parind=0
--for pkg in nq-* io-* digraphs-* semigroups-*
-+for pkg in nq io digraphs semigroups
- do
-     echo "Building GAP package $pkg"
-     cd "$PKG_SRC_DIR/$pkg"
-diff --git a/build/pkgs/libsemigroups/checksums.ini b/build/pkgs/libsemigroups/checksums.ini
-index 62c4268515f..4e13a36cb35 100644
---- a/build/pkgs/libsemigroups/checksums.ini
-+++ b/build/pkgs/libsemigroups/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=libsemigroups-VERSION.tar.gz
--sha1=2b16c095cc5ffd3f77a71dfbf48cce188e054c03
--md5=7082cadcf7a195ccb93175cd72b6db95
--cksum=1501022358
-+sha1=86375824b47ce4b0e23570122e873f67136d0c0a
-+md5=ff79ad5fbc8bfeb64d48faaf24106b98
-+cksum=2845045455
- upstream_url=https://github.com/libsemigroups/libsemigroups/releases/download/vVERSION/libsemigroups-VERSION.tar.gz
-diff --git a/build/pkgs/libsemigroups/package-version.txt b/build/pkgs/libsemigroups/package-version.txt
-index 9084fa2f716..f90b1afc082 100644
---- a/build/pkgs/libsemigroups/package-version.txt
-+++ b/build/pkgs/libsemigroups/package-version.txt
-@@ -1 +1 @@
--1.1.0
-+2.3.2
-diff --git a/build/pkgs/libsemigroups/spkg-install.in b/build/pkgs/libsemigroups/spkg-install.in
-index 2aaf0e99043..128b54d2f99 100644
---- a/build/pkgs/libsemigroups/spkg-install.in
-+++ b/build/pkgs/libsemigroups/spkg-install.in
-@@ -1,4 +1,4 @@
- cd src
--sdh_configure
-+sdh_configure --disable-eigen
- sdh_make
- sdh_make_install
-diff --git a/build/pkgs/singular/spkg-configure.m4 b/build/pkgs/singular/spkg-configure.m4
-index d4d145defe3..6a85631f624 100644
---- a/build/pkgs/singular/spkg-configure.m4
-+++ b/build/pkgs/singular/spkg-configure.m4
-@@ -9,52 +9,7 @@ SAGE_SPKG_CONFIGURE([singular], [
-        AC_MSG_CHECKING([that Singular's help is working])
-        AS_IF([test x`printf "system(\"--browser\", \"builtin\"); \n help;" | Singular 2>&1 | grep "error occurred"` = x], [
-         AC_MSG_RESULT(yes)
--        dnl We have Singular. Now determine the shared library path on
--        dnl platforms on which sage.libs.singular needs to reload the library with RTLD_GLOBAL.
--        AS_CASE([$host_os],
--          [cygwin*], [dnl Nothing to do
--                     ],
--                     [dnl Use pkg-config to get singular's libdir while we're at it. As a
--                      dnl moral compromise for using pkg-config, this ultimately allows us
--                      dnl to pass an absolute path to dlopen(), which is the only approach
--                      dnl that POSIX guarantees will work.
--                      PKG_CHECK_VAR([SINGULAR_LIB_DIR], [Singular], [libdir])
--                      dnl The acl_shlibext variable is set in the top-level configure.ac.
--                      AC_LANG_PUSH(C)
--                      ORIG_LIBS="${LIBS}"
--                      LIBS="${LIBS} -ldl"
--                      AC_MSG_CHECKING([if we can dlopen($LIBSINGULAR_PATH)])
--                      LIBSINGULAR_PATH="${SINGULAR_LIB_DIR}/libSingular.${acl_shlibext}"
--
--                      dnl if we can dlopen() it, substitute the name for sage_conf;
--                      dnl otherwise, fall back to using the SPKG.
--                      AC_RUN_IFELSE(
--                        [AC_LANG_PROGRAM(
--                          [[#include <dlfcn.h>]],
--                          [[void* h = dlopen("${LIBSINGULAR_PATH}", RTLD_LAZY | RTLD_GLOBAL);
--                            if (h == 0) { return 1; } else { return dlclose(h); }]]
--                        )], [
--                          AC_MSG_RESULT(yes)
--                        ], [
--                          dnl try Debian-specific name
--                          LIBSINGULAR_PATH="${SINGULAR_LIB_DIR}/libsingular-Singular.${acl_shlibext}"
--                          AC_RUN_IFELSE(
--                           [AC_LANG_PROGRAM(
--                             [[#include <dlfcn.h>]],
--                             [[void* h = dlopen("${LIBSINGULAR_PATH}", RTLD_LAZY | RTLD_GLOBAL);
--                               if (h == 0) { return 1; } else { return dlclose(h); }]]
--                           )], [
--                             AC_MSG_RESULT(yes)
--                           ], [
--                            AC_MSG_RESULT(no)
--                            sage_spkg_install_singular=yes
--                          ], [AC_MSG_RESULT(yes)])
--                        ], [AC_MSG_RESULT(yes)])
--
--                      AC_LANG_POP()
--                      LIBS="${ORIG_LIBS}"
--                     ]
--       )], [
-+       ], [
-        AC_MSG_RESULT(no)
-        sage_spkg_install_singular=yes
-        ]
-@@ -64,20 +19,4 @@ SAGE_SPKG_CONFIGURE([singular], [
-       ])
-     ])
-   ])
--],[],[],[
--  dnl Post-check phase
--  dnl We make the sage_conf substitutions here, because the "default"
--  dnl substitution needs to be made even if we skipped the system-Singular
--  dnl checks themselves.
--  AS_IF([test "x${sage_spkg_install_singular}" = "xyes"], [
--    AS_CASE([$host_os],
--      [cygwin*], [dnl Nothing to do
--                 ],
--                 [dnl Set shared library path, needed for reloading the library with RTLD_GLOBAL
--                  LIBSINGULAR_PATH="\$SAGE_LOCAL/lib/libSingular.${acl_shlibext}"
--                 ]
--    )
--  ])
--
--  AC_SUBST(LIBSINGULAR_PATH, "${LIBSINGULAR_PATH}")
- ])
-diff --git a/pkgs/sage-conf/_sage_conf/_conf.py.in b/pkgs/sage-conf/_sage_conf/_conf.py.in
-index 6cd28f558a8..d66bdb3d264 100644
---- a/pkgs/sage-conf/_sage_conf/_conf.py.in
-+++ b/pkgs/sage-conf/_sage_conf/_conf.py.in
-@@ -55,9 +55,6 @@ THREEJS_DIR = SAGE_LOCAL + "/share/threejs-sage"
- OPENMP_CFLAGS = "@OPENMP_CFLAGS@"
- OPENMP_CXXFLAGS = "@OPENMP_CXXFLAGS@"
- 
--# The full absolute path to the main Singular library.
--LIBSINGULAR_PATH = "@LIBSINGULAR_PATH@".replace('$SAGE_LOCAL', SAGE_LOCAL)
--
- # Installation location of wheels. This is determined at configuration time
- # and does not depend on the installation location of sage-conf.
- SAGE_SPKG_WHEELS = "@SAGE_VENV@".replace('${SAGE_LOCAL}', SAGE_LOCAL) + "/var/lib/sage/wheels"
-diff --git a/src/doc/en/thematic_tutorials/lie/weyl_groups.rst b/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-index c917338e444..182e74aad20 100644
---- a/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-+++ b/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-@@ -139,12 +139,12 @@ string, which you can print::
-     X.1      1  1  1  1  1  1  1  1  1  1  1  1  1
-     X.2      1 -1  1  1 -1  1  1 -1 -1 -1  1  1  1
-     X.3      2  .  2 -1  .  2  2  .  .  . -1  2  2
--    X.4      3 -1 -1  .  1 -1  3 -1  1 -1  . -1  3
--    X.5      3 -1 -1  .  1  3 -1 -1 -1  1  . -1  3
--    X.6      3  1 -1  . -1 -1  3  1 -1  1  . -1  3
--    X.7      3  1 -1  . -1  3 -1  1  1 -1  . -1  3
--    X.8      3 -1  3  . -1 -1 -1 -1  1  1  . -1  3
--    X.9      3  1  3  .  1 -1 -1  1 -1 -1  . -1  3
-+    X.4      3 -1 -1  .  1  3 -1 -1 -1  1  . -1  3
-+    X.5      3  1 -1  . -1  3 -1  1  1 -1  . -1  3
-+    X.6      3 -1  3  . -1 -1 -1 -1  1  1  . -1  3
-+    X.7      3 -1 -1  .  1 -1  3 -1  1 -1  . -1  3
-+    X.8      3  1  3  .  1 -1 -1  1 -1 -1  . -1  3
-+    X.9      3  1 -1  . -1 -1  3  1 -1  1  . -1  3
-     X.10     4 -2  . -1  .  .  .  2  .  .  1  . -4
-     X.11     4  2  . -1  .  .  . -2  .  .  1  . -4
-     X.12     6  . -2  .  . -2 -2  .  .  .  .  2  6
-diff --git a/src/sage/coding/codecan/autgroup_can_label.pyx b/src/sage/coding/codecan/autgroup_can_label.pyx
-index de5db985e0b..c83b9264e44 100644
---- a/src/sage/coding/codecan/autgroup_can_label.pyx
-+++ b/src/sage/coding/codecan/autgroup_can_label.pyx
-@@ -76,7 +76,7 @@ columns do share the same coloring::
-     ((1,),
-      (2,),
-      (3, 5, 4),
--     (6, 19, 16, 9, 21, 10, 8, 15, 14, 11, 20, 13, 12, 7, 17, 18))
-+     (6, 19, 16, 21, 9, 10, 15, 8, 20, 11, 14, 13, 7, 12, 18, 17))
- 
- We can also restrict the group action to linear isometries::
- 
-diff --git a/src/sage/coding/linear_code.py b/src/sage/coding/linear_code.py
-index a3ac3ca1547..bfb9f8696e8 100644
---- a/src/sage/coding/linear_code.py
-+++ b/src/sage/coding/linear_code.py
-@@ -465,27 +465,27 @@ def automorphism_group_gens(self, equivalence="semilinear"):
-             0
-             sage: C = codes.HammingCode(GF(4, 'z'), 3)
-             sage: C.automorphism_group_gens()
--            ([((1, 1, 1, 1, 1, z + 1, z, z + 1, z, z, z, 1, 1, z + 1, z + 1, z, z + 1, z, z + 1, z + 1, z + 1); (1,14,6,7,4,10,11,19)(2,8,16,13,3,17,21,15)(9,12,18,20), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((1, 1, 1, z, z + 1, 1, 1, 1, 1, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z); (1,13,14,20)(2,21,8,18,7,16,19,15)(3,10,5,12,17,9,6,4), Ring endomorphism of Finite Field in z of size 2^2
-+                Defn: z |--> z + 1),
-+              ((z, 1, z, z, z, z + 1, z, z, z, z, z, z, z + 1, z, z, z, z, z + 1, z, z, z); (1,11,5,12,3,19)(2,8)(6,18,13)(7,17,15)(9,10,14,16,20,21), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z + 1),
--              ((z + 1, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z + 1, 1, z, z + 1, z + 1, z); (1,18,6,19,2,9,17,10,13,14,21,11,4,5,12)(3,20,7,16,8), Ring endomorphism of Finite Field in z of size 2^2
--                Defn: z |--> z),
-               ((z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z); (), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-              362880)
-             sage: C.automorphism_group_gens(equivalence="linear")
--            ([((z + 1, 1, z + 1, z + 1, z + 1, z, 1, z, 1, 1, 1, 1, z + 1, z + 1, z + 1, z, z, 1, z, z, z); (1,15,2,8,16,18,3)(4,9,12,13,20,10,11)(5,21,14,6,7,19,17), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((z, 1, z + 1, z + 1, 1, z + 1, z, 1, z + 1, z + 1, 1, z, 1, z + 1, z, 1, z, 1, z + 1, 1, 1); (1,12,11,10,6,8,9,20,13,21,5,14,3,16,17,19,7,4,2,15,18), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((z + 1, z + 1, z + 1, z + 1, z + 1, 1, z, 1, z, z, z, 1, z, 1, 1, 1, z + 1, z + 1, z + 1, 1, z); (1,15,21,8,9)(2,18,5,3,11,16,7,10,19,13,12,4,17,6,20), Ring endomorphism of Finite Field in z of size 2^2
-+              ((z + 1, z + 1, z + 1, z, 1, 1, z, z, 1, z + 1, z, 1, 1, z, 1, z + 1, z, z + 1, z + 1, 1, z); (1,3,18,2,17,6,19)(4,15,13,20,7,14,16)(5,11,8,21,12,9,10), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
-               ((z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1); (), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-              181440)
-             sage: C.automorphism_group_gens(equivalence="permutational")
--            ([((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,19)(3,17)(4,21)(5,20)(7,14)(9,12)(10,16)(11,15), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,11)(3,10)(4,9)(5,7)(12,21)(14,20)(15,19)(16,17), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,11)(3,10)(4,9)(5,7)(12,21)(14,20)(15,19)(16,17), Ring endomorphism of Finite Field in z of size 2^2
-+              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (2,18)(3,19)(4,10)(5,16)(8,13)(9,14)(11,21)(15,20), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,17)(2,8)(3,14)(4,10)(7,12)(9,19)(13,18)(15,20), Ring endomorphism of Finite Field in z of size 2^2
-+              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,19)(3,17)(4,21)(5,20)(7,14)(9,12)(10,16)(11,15), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
-               ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (2,13)(3,14)(4,20)(5,11)(8,18)(9,19)(10,15)(16,21), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-@@ -691,10 +691,10 @@ def _canonize(self, equivalence):
-             sage: C_iso == aut_group_can_label.get_canonical_form()
-             True
-             sage: aut_group_can_label.get_autom_gens()
--            [((1, 1, 1, 1, 1, z + 1, z, z + 1, z, z, z, 1, 1, z + 1, z + 1, z, z + 1, z, z + 1, z + 1, z + 1); (1,14,6,7,4,10,11,19)(2,8,16,13,3,17,21,15)(9,12,18,20), Ring endomorphism of Finite Field in z of size 2^2
-+            [((1, 1, 1, z, z + 1, 1, 1, 1, 1, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z); (1,13,14,20)(2,21,8,18,7,16,19,15)(3,10,5,12,17,9,6,4), Ring endomorphism of Finite Field in z of size 2^2
-+               Defn: z |--> z + 1),
-+             ((z, 1, z, z, z, z + 1, z, z, z, z, z, z, z + 1, z, z, z, z, z + 1, z, z, z); (1,11,5,12,3,19)(2,8)(6,18,13)(7,17,15)(9,10,14,16,20,21), Ring endomorphism of Finite Field in z of size 2^2
-                Defn: z |--> z + 1),
--             ((z + 1, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z + 1, 1, z, z + 1, z + 1, z); (1,18,6,19,2,9,17,10,13,14,21,11,4,5,12)(3,20,7,16,8), Ring endomorphism of Finite Field in z of size 2^2
--               Defn: z |--> z),
-              ((z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z); (), Ring endomorphism of Finite Field in z of size 2^2
-                Defn: z |--> z)]
-         """
-diff --git a/src/sage/combinat/posets/posets.py b/src/sage/combinat/posets/posets.py
-index 2836d59d960..8c882d5ac3b 100644
---- a/src/sage/combinat/posets/posets.py
-+++ b/src/sage/combinat/posets/posets.py
-@@ -8813,7 +8813,7 @@ def _libgap_(self):
-             sage: libgap(P)  # optional - gap_packages
-             <A poset on 5 points>
-             sage: A = libgap(GF(2)).PosetAlgebra(P); A  # optional - gap_packages
--            <GF(2)[<quiver with 5 vertices and 5 arrows>]/<two-sided ideal in <GF(2)[<quiver with 5 vertices and 5 arrows>]>, (1 generators)>>
-+            <GF(2)[<quiver with 5 vertices and 5 arrows>]/<two-sided ideal in <GF(2)[<quiver with 5 vertices and 5 arrows>]>, (1 generator)>>
-             sage: A.Dimension()  # optional - gap_packages
-             13
-         """
-diff --git a/src/sage/combinat/root_system/hecke_algebra_representation.py b/src/sage/combinat/root_system/hecke_algebra_representation.py
-index 6b756bafc30..8ac99319bec 100644
---- a/src/sage/combinat/root_system/hecke_algebra_representation.py
-+++ b/src/sage/combinat/root_system/hecke_algebra_representation.py
-@@ -357,7 +357,7 @@ def Tw(self, word, signs=None, scalar=None):
-             sage: q1, q2 = K.gens()
-             sage: KW = W.algebra(K)
-             sage: x = KW.an_element(); x
--            123 + 3*32 + 2*3 + e
-+            123 + 3*2312 + 2*31 + e
- 
-             sage: T = KW.demazure_lusztig_operators(q1,q2)
-             sage: T12 = T.Tw( (1,2) )
-diff --git a/src/sage/combinat/symmetric_group_algebra.py b/src/sage/combinat/symmetric_group_algebra.py
-index b8a0bebab44..9bccba124c8 100644
---- a/src/sage/combinat/symmetric_group_algebra.py
-+++ b/src/sage/combinat/symmetric_group_algebra.py
-@@ -101,7 +101,7 @@ def SymmetricGroupAlgebra(R, W, category=None):
-         sage: SGA.group()
-         Weyl Group of type ['A', 3] (as a matrix group acting on the ambient space)
-         sage: SGA.an_element()
--        s1*s2*s3 + 3*s3*s2 + 2*s3 + 1
-+        s1*s2*s3 + 3*s2*s3*s1*s2 + 2*s3*s1 + 1
- 
-     The preferred way to construct the symmetric group algebra is to
-     go through the usual ``algebra`` method::
-diff --git a/src/sage/env.py b/src/sage/env.py
-index 911f34b1bc6..5f7aca8599c 100644
---- a/src/sage/env.py
-+++ b/src/sage/env.py
-@@ -197,7 +197,8 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- GRAPHS_DATA_DIR = var("GRAPHS_DATA_DIR", join(SAGE_SHARE, "graphs"))
- ELLCURVE_DATA_DIR = var("ELLCURVE_DATA_DIR", join(SAGE_SHARE, "ellcurves"))
- POLYTOPE_DATA_DIR = var("POLYTOPE_DATA_DIR", join(SAGE_SHARE, "reflexive_polytopes"))
--GAP_ROOT_DIR = var("GAP_ROOT_DIR", join(SAGE_SHARE, "gap"))
-+GAP_LIB_DIR = var("GAP_LIB_DIR", join(SAGE_LOCAL, "lib", "gap"))
-+GAP_SHARE_DIR = var("GAP_SHARE_DIR", join(SAGE_SHARE, "gap"))
- THEBE_DIR = var("THEBE_DIR", join(SAGE_SHARE, "thebe"))
- COMBINATORIAL_DESIGN_DATA_DIR = var("COMBINATORIAL_DESIGN_DATA_DIR", join(SAGE_SHARE, "combinatorial_designs"))
- CREMONA_MINI_DATA_DIR = var("CREMONA_MINI_DATA_DIR", join(SAGE_SHARE, "cremona"))
-@@ -229,12 +230,6 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- LIE_INFO_DIR = var("LIE_INFO_DIR", join(SAGE_LOCAL, "lib", "LiE"))
- SINGULAR_BIN = var("SINGULAR_BIN") or "Singular"
- 
--# The path to libSingular, to be passed to dlopen(). This will
--# typically be set to an absolute path in sage_conf, but the relative
--# fallback path here works on systems where dlopen() searches the
--# system's library locations.
--LIBSINGULAR_PATH = var("LIBSINGULAR_PATH", "libSingular.so")
--
- # OpenMP
- OPENMP_CFLAGS = var("OPENMP_CFLAGS", "")
- OPENMP_CXXFLAGS = var("OPENMP_CXXFLAGS", "")
-@@ -255,81 +250,6 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- SAGE_GAP_COMMAND = var('SAGE_GAP_COMMAND', _gap_cmd)
- 
- 
--def _get_shared_lib_path(*libnames: str) -> Optional[str]:
--    """
--    Return the full path to a shared library file installed in
--    ``$SAGE_LOCAL/lib`` or the directories associated with the
--    Python sysconfig.
--
--    This can also be passed more than one library name (e.g. for cases where
--    some library may have multiple names depending on the platform) in which
--    case the first one found is returned.
--
--    This supports most *NIX variants (in which ``lib<libname>.so`` is found
--    under ``$SAGE_LOCAL/lib``), macOS (same, but with the ``.dylib``
--    extension), and Cygwin (under ``$SAGE_LOCAL/bin/cyg<libname>.dll``,
--    or ``$SAGE_LOCAL/bin/cyg<libname>-*.dll`` for versioned DLLs).
--
--    For distributions like Debian that use a multiarch layout, we also try the
--    multiarch lib paths (i.e. ``/usr/lib/<arch>/``).
--
--    This returns ``None`` if no matching library file could be found.
--
--    EXAMPLES::
--
--        sage: from sage.env import _get_shared_lib_path
--        sage: "gap" in _get_shared_lib_path("gap")
--        True
--        sage: _get_shared_lib_path("an_absurd_lib") is None
--        True
--
--    """
--
--    for libname in libnames:
--        search_directories: List[Path] = []
--        patterns: List[str] = []
--        if sys.platform == 'cygwin':
--            # Later down we take the first matching DLL found, so search
--            # SAGE_LOCAL first so that it takes precedence
--            if SAGE_LOCAL:
--                search_directories.append(Path(SAGE_LOCAL) / 'bin')
--            search_directories.append(Path(sysconfig.get_config_var('BINDIR')))
--            # Note: The following is not very robust, since if there are multible
--            # versions for the same library this just selects one more or less
--            # at arbitrary. However, practically speaking, on Cygwin, there
--            # will only ever be one version
--            patterns = [f'cyg{libname}.dll', f'cyg{libname}-*.dll']
--        else:
--            if sys.platform == 'darwin':
--                ext = 'dylib'
--            else:
--                ext = 'so'
--
--            if SAGE_LOCAL:
--                search_directories.append(Path(SAGE_LOCAL) / 'lib')
--            libdir = sysconfig.get_config_var('LIBDIR')
--            if libdir is not None:
--                libdir = Path(libdir)
--                search_directories.append(libdir)
--
--                multiarchlib = sysconfig.get_config_var('MULTIARCH')
--                if multiarchlib is not None:
--                    search_directories.append(libdir / multiarchlib),
--
--            patterns = [f'lib{libname}.{ext}']
--
--        for directory in search_directories:
--            for pattern in patterns:
--                path = next(directory.glob(pattern), None)
--                if path is not None:
--                    return str(path.resolve())
--
--    # Just return None if no files were found
--    return None
--
--# locate libgap shared object
--GAP_SO = var("GAP_SO", _get_shared_lib_path("gap", ""))
--
- # post process
- if DOT_SAGE is not None and ' ' in DOT_SAGE:
-     if UNAME[:6] == 'CYGWIN':
-diff --git a/src/sage/groups/abelian_gps/abelian_group_gap.py b/src/sage/groups/abelian_gps/abelian_group_gap.py
-index a4b047113c5..86090b43535 100644
---- a/src/sage/groups/abelian_gps/abelian_group_gap.py
-+++ b/src/sage/groups/abelian_gps/abelian_group_gap.py
-@@ -338,7 +338,7 @@ def _element_constructor_(self, x, check=True):
-         if isinstance(x, AbelianGroupElement_gap):
-             try:
-                 if x in self._cover:
--                    x = self.gap().NaturalHomomorphism().Image(x.gap())
-+                    x = self._cover.gap().NaturalHomomorphismByNormalSubgroup(self._relations).Image(x.gap())
-                 else:
-                     x = x.gap()
-             except AttributeError:
-@@ -1043,7 +1043,7 @@ def natural_homomorphism(self):
-             From: Abelian group with gap, generator orders (4,)
-             To:   Quotient abelian group with generator orders (2,)
-         """
--        phi = self.gap().NaturalHomomorphism()
-+        phi = self._cover.gap().NaturalHomomorphismByNormalSubgroup(self._relations)
-         Hom = self._cover.Hom(self)
-         return Hom(phi)
- 
-diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py
-index 8d6e443683c..1beb01af87f 100644
---- a/src/sage/groups/finitely_presented.py
-+++ b/src/sage/groups/finitely_presented.py
-@@ -596,9 +596,9 @@ def gap(self):
-             sage: k = G.rewriting_system()
-             sage: k.gap()
-             Knuth Bendix Rewriting System for Monoid( [ a, A, b, B ] ) with rules
--            [ [ a^2, <identity ...> ], [ a*A, <identity ...> ],
--              [ A*a, <identity ...> ], [ b^2, <identity ...> ],
--              [ b*B, <identity ...> ], [ B*b, <identity ...> ] ]
-+            [ [ a*A, <identity ...> ], [ A*a, <identity ...> ],
-+              [ b*B, <identity ...> ], [ B*b, <identity ...> ],
-+              [ a^2, <identity ...> ], [ b^2, <identity ...> ] ]
-         """
-         return self._gap
- 
-diff --git a/src/sage/groups/fqf_orthogonal.py b/src/sage/groups/fqf_orthogonal.py
-index 7fc4dbe7548..e5eccd45942 100644
---- a/src/sage/groups/fqf_orthogonal.py
-+++ b/src/sage/groups/fqf_orthogonal.py
-@@ -143,7 +143,7 @@ class FqfOrthogonalGroup(AbelianGroupAutomorphismGroup_subgroup):
-         [2/3   0   0]
-         [  0 2/3   0]
-         [  0   0 4/3]
--        generated by 2 elements
-+        generated by 3 elements
-         sage: q = matrix.diagonal(QQ, [3/2, 1/4, 1/4])
-         sage: T = TorsionQuadraticForm(q)
-         sage: T.orthogonal_group().order()
-diff --git a/src/sage/groups/libgap_wrapper.pyx b/src/sage/groups/libgap_wrapper.pyx
-index d25121aa792..dc81b71635b 100644
---- a/src/sage/groups/libgap_wrapper.pyx
-+++ b/src/sage/groups/libgap_wrapper.pyx
-@@ -25,7 +25,7 @@ Note how we call the constructor of both superclasses to initialize
- its output via LibGAP::
- 
-     sage: FooGroup()
--    <pc group of size 3 with 1 generators>
-+    <pc group of size 3 with 1 generator>
-     sage: type(FooGroup().gap())
-     <class 'sage.libs.gap.element.GapElement'>
- 
-@@ -106,7 +106,7 @@ class ParentLibGAP(SageObject):
-         ....:         ParentLibGAP.__init__(self, lg)
-         ....:         Group.__init__(self)
-         sage: FooGroup()
--        <pc group of size 3 with 1 generators>
-+        <pc group of size 3 with 1 generator>
-     """
- 
-     def __init__(self, libgap_parent, ambient=None):
-@@ -461,7 +461,7 @@ cdef class ElementLibGAP(MultiplicativeGroupElement):
-         ....:         ParentLibGAP.__init__(self, lg)
-         ....:         Group.__init__(self)
-         sage: FooGroup()
--        <pc group of size 3 with 1 generators>
-+        <pc group of size 3 with 1 generator>
-         sage: FooGroup().gens()
-         (f1,)
-     """
-diff --git a/src/sage/groups/matrix_gps/finitely_generated.py b/src/sage/groups/matrix_gps/finitely_generated.py
-index a6d3dc02513..63956ad5f10 100644
---- a/src/sage/groups/matrix_gps/finitely_generated.py
-+++ b/src/sage/groups/matrix_gps/finitely_generated.py
-@@ -563,9 +563,6 @@ def as_permutation_group(self, algorithm=None, seed=None):
-             21499084800
-             sage: P = G.as_permutation_group()
-             sage: Psmaller = G.as_permutation_group(algorithm="smaller", seed=6)
--            sage: P == Psmaller  # see the note below
--            True
--            sage: Psmaller = G.as_permutation_group(algorithm="smaller")
-             sage: P == Psmaller
-             False
-             sage: P.cardinality()
-diff --git a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-index f2ccca042ac..47d6862333c 100644
---- a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-+++ b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-@@ -427,7 +427,7 @@ cdef class LabelledBranching:
-             sage: from sage.groups.perm_gps.partn_ref2.refinement_generic import LabelledBranching
-             sage: L = LabelledBranching(3)
-             sage: L.small_generating_set()
--            []
-+            [()]
-             sage: L.add_gen(libgap.eval('(1,2,3)'))
-             sage: L.small_generating_set()
-             [(1,2,3)]
-diff --git a/src/sage/groups/perm_gps/permgroup.py b/src/sage/groups/perm_gps/permgroup.py
-index ebdf7c4c6eb..fb14008c8e0 100644
---- a/src/sage/groups/perm_gps/permgroup.py
-+++ b/src/sage/groups/perm_gps/permgroup.py
-@@ -926,7 +926,7 @@ def _coerce_map_from_(self, G):
-            sage: f = PG._coerce_map_from_(MG)
-            sage: mg = MG.an_element()
-            sage: p = f(mg); p
--           (2,33,32,23,31,55)(3,49,38,44,40,28)(4,17,59,62,58,46)(5,21,47,20,43,8)(6,53,50)(7,37,12,57,14,29)(9,41,56,34,64,10)(11,25,19)(13,61,26,51,22,15)(16,45,36)(18,27,35,48,52,54)(24,63,42)(30,39,60)
-+           (1,2,6,19,35,33)(3,9,26,14,31,23)(4,13,5)(7,22,17)(8,24,12)(10,16,32,27,20,28)(11,30,18)(15,25,36,34,29,21)
-            sage: PG(p._gap_()) == p
-            True
- 
-@@ -972,12 +972,12 @@ def _coerce_map_from_(self, G):
-             sage: P = G.as_permutation_group(algorithm='smaller', seed=5)
-             sage: P1 = G.as_permutation_group()
-             sage: P == P1
--            False
-+            True
-             sage: g1, g2, g3 = G.gens()
-             sage: P(g1*g2)
--            (1,3,7,12)(2,4,8,10)(5,11)(6,9)
-+            (1,4,13,11)(2,5,14,18)(3,15,8,16)(6,7)(9,20,19,12)(10,17)
-             sage: P1(g1*g2)
--            (2,29,25,68)(3,57,13,54)(4,11,72,37)(5,39,60,23)(6,64,75,63)(7,21,50,73)(8,46,38,32)(9,74,35,18)(10,44,49,48)(12,16,34,71)(14,79,27,40)(15,26)(17,62,59,76)(19,78,70,65)(20,22,58,51)(24,33,36,43)(28,81,80,52)(30,53,56,69)(31,61)(41,42,67,55)(45,77)(47,66)
-+            (1,4,13,11)(2,5,14,18)(3,15,8,16)(6,7)(9,20,19,12)(10,17)
- 
-         Another check for :trac:`5583`::
- 
-@@ -1302,7 +1302,7 @@ def gens_small(self):
-             sage: G.gens_small() # random
-             [('b','c'), ('a','c','b')] ## (on 64-bit Linux)
-             [('a','b'), ('a','c','b')] ## (on Solaris)
--            sage: len(G.gens_small()) == 2
-+            sage: len(G.gens_small()) == 2 # random
-             True
-         """
-         gens = self._libgap_().SmallGeneratingSet()
-@@ -4370,17 +4370,23 @@ def is_transitive(self, domain=None):
- 
-         ::
- 
--            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)]]) #S_5 on [1..5]
--            sage: G.is_transitive([1,4,5])
-+            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)],[(6,7)]])
-+            sage: G.is_transitive([1,2,3,4,5])
-             True
--            sage: G.is_transitive([2..6])
-+            sage: G.is_transitive([1..7])
-             False
-             sage: G.is_transitive(G.non_fixed_points())
--            True
-+            False
-             sage: H = PermutationGroup([[(1,2,3)],[(4,5,6)]])
-             sage: H.is_transitive(H.non_fixed_points())
-             False
- 
-+        If `G` does not act on the domain, it always returns ``False``::
-+
-+            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)]]) #S_5 on [1..5]
-+            sage: G.is_transitive([1,4,5])
-+            False
-+
-         Note that this differs from the definition in GAP, where
-         ``IsTransitive`` returns whether the group is transitive on the
-         set of points moved by the group.
-@@ -4436,12 +4442,16 @@ def is_primitive(self, domain=None):
-             sage: G = PermutationGroup([[(1,2,3,4)],[(2,4)]])
-             sage: G.is_primitive([1..4])
-             False
--            sage: G.is_primitive([1,2,3])
--            True
-             sage: G = PermutationGroup([[(3,4,5,6)],[(3,4)]]) #S_4 on [3..6]
-             sage: G.is_primitive(G.non_fixed_points())
-             True
- 
-+        If `G` does not act on the domain, it always returns ``False``::
-+
-+            sage: G = PermutationGroup([[(1,2,3,4)],[(2,4)]])
-+            sage: G.is_primitive([1,2,3])
-+            False
-+
-         """
-         #If the domain is not a subset of self.domain(), then the
-         #action isn't primitive.
-diff --git a/src/sage/interfaces/gap.py b/src/sage/interfaces/gap.py
-index 7ae1792e9de..ecaa9fd2341 100644
---- a/src/sage/interfaces/gap.py
-+++ b/src/sage/interfaces/gap.py
-@@ -1512,6 +1512,8 @@ def gap_reset_workspace(max_workspace_size=None, verbose=False):
-     """
-     # Create new workspace with filename WORKSPACE
-     g = Gap(use_workspace_cache=False, max_workspace_size=None)
-+    g.eval('ColorPrompt(false)')
-+    g.eval('SetUserPreference("UseColorPrompt", false)')
-     g.eval('SetUserPreference("HistoryMaxLines", 30)')
-     from sage.tests.gap_packages import all_installed_packages
-     for pkg in all_installed_packages(gap=g):
-diff --git a/src/sage/interfaces/gap_workspace.py b/src/sage/interfaces/gap_workspace.py
-index 33a87dd5076..03b40be6856 100644
---- a/src/sage/interfaces/gap_workspace.py
-+++ b/src/sage/interfaces/gap_workspace.py
-@@ -16,7 +16,8 @@
- import os
- import time
- import hashlib
--from sage.env import DOT_SAGE, GAP_SO
-+import subprocess
-+from sage.env import DOT_SAGE, HOSTNAME, GAP_LIB_DIR, GAP_SHARE_DIR
- 
- 
- def gap_workspace_file(system="gap", name="workspace", dir=None):
-@@ -59,11 +60,13 @@ def gap_workspace_file(system="gap", name="workspace", dir=None):
-     if dir is None:
-         dir = os.path.join(DOT_SAGE, 'gap')
- 
--    if GAP_SO:
--        h = hashlib.sha1(GAP_SO.encode('utf-8')).hexdigest()
--    else:
--        h = 'unknown'
--    return os.path.join(dir, '%s-%s-%s' % (system, name, h))
-+    data = f'{GAP_LIB_DIR}:{GAP_SHARE_DIR}'
-+    for path in GAP_LIB_DIR, GAP_SHARE_DIR:
-+        sysinfo = os.path.join(path, "sysinfo.gap")
-+        if os.path.exists(sysinfo):
-+            data += subprocess.getoutput(f'. "{sysinfo}" && echo ":$GAP_VERSION:$GAParch"')
-+    h = hashlib.sha1(data.encode('utf-8')).hexdigest()
-+    return os.path.join(dir, f'{system}-{name}-{HOSTNAME}-{h}')
- 
- 
- def prepare_workspace_dir(dir=None):
-diff --git a/src/sage/libs/gap/element.pyx b/src/sage/libs/gap/element.pyx
-index c555ea0333c..e3db3934baf 100644
---- a/src/sage/libs/gap/element.pyx
-+++ b/src/sage/libs/gap/element.pyx
-@@ -130,6 +130,7 @@ cdef char *capture_stdout(Obj func, Obj obj):
-     """
-     cdef Obj s, stream, output_text_string
-     cdef UInt res
-+    cdef TypOutputFile output
-     # The only way to get a string representation of an object that is truly
-     # consistent with how it would be represented at the GAP REPL is to call
-     # ViewObj on it.  Unfortunately, ViewObj *prints* to the output stream,
-@@ -145,12 +146,12 @@ cdef char *capture_stdout(Obj func, Obj obj):
-         output_text_string = GAP_ValueGlobalVariable("OutputTextString")
-         stream = CALL_2ARGS(output_text_string, s, GAP_True)
- 
--        if not OpenOutputStream(stream):
-+        if not OpenOutputStream(&output, stream):
-             raise GAPError("failed to open output capture stream for "
-                            "representing GAP object")
- 
-         CALL_1ARGS(func, obj)
--        CloseOutput()
-+        CloseOutput(&output)
-         return CSTR_STRING(s)
-     finally:
-         GAP_Leave()
-diff --git a/src/sage/libs/gap/gap_includes.pxd b/src/sage/libs/gap/gap_includes.pxd
-index 6d22e32540b..6111d18a5c7 100644
---- a/src/sage/libs/gap/gap_includes.pxd
-+++ b/src/sage/libs/gap/gap_includes.pxd
-@@ -76,8 +76,10 @@ cdef extern from "gap/intobj.h" nogil:
- 
- 
- cdef extern from "gap/io.h" nogil:
--    UInt OpenOutputStream(Obj stream)
--    UInt CloseOutput()
-+    ctypedef struct TypOutputFile:
-+        pass
-+    UInt OpenOutputStream(TypOutputFile* output, Obj stream)
-+    UInt CloseOutput(TypOutputFile* output)
- 
- 
- cdef extern from "gap/libgap-api.h" nogil:
-diff --git a/src/sage/libs/gap/libgap.pyx b/src/sage/libs/gap/libgap.pyx
-index b1a64e57939..6a36613aa8c 100644
---- a/src/sage/libs/gap/libgap.pyx
-+++ b/src/sage/libs/gap/libgap.pyx
-@@ -695,7 +695,7 @@ class Gap(Parent):
-             sage: libgap.List
-             <Gap function "List">
-             sage: libgap.GlobalRandomSource
--            <RandomSource in IsGlobalRandomSource>
-+            <RandomSource in IsGAPRandomSource>
-         """
-         if name in dir(self.__class__):
-             return getattr(self.__class__, name)
-diff --git a/src/sage/libs/gap/saved_workspace.py b/src/sage/libs/gap/saved_workspace.py
-index ad5adec36d0..7636707f557 100644
---- a/src/sage/libs/gap/saved_workspace.py
-+++ b/src/sage/libs/gap/saved_workspace.py
-@@ -8,7 +8,7 @@
- 
- import os
- import glob
--from sage.env import GAP_ROOT_DIR
-+from sage.env import GAP_LIB_DIR
- from sage.interfaces.gap_workspace import gap_workspace_file
- 
- 
-@@ -31,7 +31,7 @@ def timestamp():
-     """
-     libgap_dir = os.path.dirname(__file__)
-     libgap_files = glob.glob(os.path.join(libgap_dir, '*'))
--    gap_packages = glob.glob(os.path.join(GAP_ROOT_DIR, 'pkg', '*'))
-+    gap_packages = glob.glob(os.path.join(GAP_LIB_DIR, 'pkg', '*'))
-     files = libgap_files + gap_packages
-     if len(files) == 0:
-         print('Unable to find LibGAP files.')
-diff --git a/src/sage/libs/gap/util.pyx b/src/sage/libs/gap/util.pyx
-index 344ab88c42a..eaa659d64c7 100644
---- a/src/sage/libs/gap/util.pyx
-+++ b/src/sage/libs/gap/util.pyx
-@@ -13,7 +13,7 @@ Utility functions for GAP
- #*****************************************************************************
- 
- from libc.signal cimport signal, SIGCHLD, SIG_DFL
--from posix.dlfcn cimport dlopen, dlclose, RTLD_NOW, RTLD_GLOBAL
-+from posix.dlfcn cimport dlopen, dlclose, dlerror, RTLD_LAZY, RTLD_GLOBAL
- 
- from cpython.exc cimport PyErr_Fetch, PyErr_Restore
- from cpython.object cimport Py_LT, Py_LE, Py_EQ, Py_NE, Py_GT, Py_GE
-@@ -164,33 +164,6 @@ cdef void gasman_callback() with gil:
- ### Initialization of GAP ##################################################
- ############################################################################
- 
--def gap_root():
--    """
--    Find the location of the GAP root install which is stored in the gap
--    startup script.
--
--    EXAMPLES::
--
--        sage: from sage.libs.gap.util import gap_root
--        sage: gap_root()   # random output
--        '/home/vbraun/opt/sage-5.3.rc0/local/gap/latest'
--    """
--    if os.path.exists(sage.env.GAP_ROOT_DIR):
--        return sage.env.GAP_ROOT_DIR
--
--    # Attempt to figure out the appropriate GAP_ROOT by reading the
--    # local/bin/gap shell script; this is an ugly hack that exists for
--    # historical reasons; the best approach to setting where Sage looks for
--    # the appropriate GAP_ROOT is to set the GAP_ROOT_DIR variable
--    SAGE_LOCAL = sage.env.SAGE_LOCAL
--    with open(os.path.join(SAGE_LOCAL, 'bin', 'gap')) as f:
--        gap_sh = f.read().splitlines()
--    gapdir = next(x for x in gap_sh if x.strip().startswith('GAP_ROOT'))
--    gapdir = gapdir.split('"')[1]
--    gapdir = gapdir.replace('$SAGE_LOCAL', SAGE_LOCAL)
--    return gapdir
--
--
- # To ensure that we call initialize_libgap only once.
- cdef bint _gap_is_initialized = False
- 
-@@ -232,12 +205,12 @@ cdef initialize():
-     # this isn't portable
- 
-     cdef void* handle
--    libgapname = str_to_bytes(sage.env.GAP_SO)
--    handle = dlopen(libgapname, RTLD_NOW | RTLD_GLOBAL)
-+    # reload the current module to force reload of libgap (see #33446)
-+    lib = str_to_bytes(__loader__.path, FS_ENCODING, "surrogateescape")
-+    handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY)
-     if handle is NULL:
--        raise RuntimeError(
--                "Could not dlopen() libgap even though it should already "
--                "be loaded!")
-+        err = dlerror()
-+        raise RuntimeError(f"Could not reload gap library with RTLD_GLOBAL ({err})")
-     dlclose(handle)
- 
-     # Define argv variable, which we will pass in to
-@@ -245,7 +218,7 @@ cdef initialize():
-     cdef char* argv[16]
-     argv[0] = "sage"
-     argv[1] = "-l"
--    s = str_to_bytes(gap_root(), FS_ENCODING, "surrogateescape")
-+    s = str_to_bytes(sage.env.GAP_LIB_DIR + ";" + sage.env.GAP_SHARE_DIR, FS_ENCODING, "surrogateescape")
-     argv[2] = s
- 
-     argv[3] = "-m"
-@@ -362,15 +335,9 @@ cdef Obj gap_eval(str gap_string) except? NULL:
-         GAPError: Error, Variable: 'Complex' must have a value
-         Syntax error: ; expected in stream:1
-         Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^
-+                ^^^^^
-         Error, Variable: 'with' must have a value
--        Syntax error: ; expected in stream:1
--        Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^^^^^^^^^
-         Error, Variable: 'bits' must have a value
--        Syntax error: ; expected in stream:1
--        Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-         Error, Variable: 'precision' must have a value
- 
-     Test that on a subsequent attempt we get the same message (no garbage was
-diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx
-index d8ea7b07f3c..4beb1774df9 100644
---- a/src/sage/libs/singular/singular.pyx
-+++ b/src/sage/libs/singular/singular.pyx
-@@ -1705,14 +1705,7 @@ cdef object si2sa_intvec(intvec *v):
- cdef extern from *: # hack to get at cython macro
-     int unlikely(int)
- 
--cdef extern from "dlfcn.h":
--    void *dlopen(char *, long)
--    char *dlerror()
--    void dlclose(void *handle)
--
--cdef extern from "dlfcn.h":
--    cdef long RTLD_LAZY
--    cdef long RTLD_GLOBAL
-+from posix.dlfcn cimport dlopen, dlclose, dlerror, RTLD_LAZY, RTLD_GLOBAL
- 
- cdef int overflow_check(unsigned long e, ring *_ring) except -1:
-     """
-@@ -1762,8 +1755,6 @@ cdef init_libsingular():
- 
-     cdef void *handle = NULL
- 
--    from sage.env import LIBSINGULAR_PATH
--    lib = str_to_bytes(LIBSINGULAR_PATH, FS_ENCODING, "surrogateescape")
- 
-     # This is a workaround for https://github.com/Singular/Singular/issues/1113
-     # and can be removed once that fix makes it into release of Singular that
-@@ -1780,10 +1771,12 @@ cdef init_libsingular():
- 
-     import platform
-     if not platform.system().startswith("CYGWIN"):
-+        # reload the current module to force reload of libSingular (see #33446)
-+        lib = str_to_bytes(__loader__.path, FS_ENCODING, "surrogateescape")
-         handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY)
-         if not handle:
-             err = dlerror()
--            raise ImportError(f"cannot load Singular library from {LIBSINGULAR_PATH} ({err})")
-+            raise RuntimeError(f"Could not reload Singular library with RTLD_GLOBAL ({err})")
- 
-     # load SINGULAR
-     siInit(lib)
-diff --git a/src/sage/tests/gap_packages.py b/src/sage/tests/gap_packages.py
-index 2e4518ca226..c302b169b8a 100644
---- a/src/sage/tests/gap_packages.py
-+++ b/src/sage/tests/gap_packages.py
-@@ -103,7 +103,7 @@ def all_installed_packages(ignore_dot_gap=False, gap=None):
- 
-         sage: from sage.tests.gap_packages import all_installed_packages
-         sage: all_installed_packages()
--        (...'GAPDoc'...)
-+        (...'gapdoc'...)
-         sage: all_installed_packages(ignore_dot_gap=True) == all_installed_packages(gap=gap, ignore_dot_gap=True)
-         True
-     """
diff --git a/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch b/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
deleted file mode 100644
index d331a6573e1c..000000000000
--- a/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/src/sage/data_structures/stream.py b/src/sage/data_structures/stream.py
-index f8f6dc6a186..002e925f02f 100644
---- a/src/sage/data_structures/stream.py
-+++ b/src/sage/data_structures/stream.py
-@@ -2090,8 +2090,8 @@ def compute_product(self, n, la):
-             sage: f = Stream_exact([1]) # irrelevant for this test
-             sage: g = Stream_function(lambda n: s[n], True, 0)
-             sage: h = Stream_plethysm(f, g, True, p)
--            sage: B = p[2, 2, 1](sum(s[i] for i in range(7)))
--            sage: all(h.compute_product(k, Partition([2, 2, 1])) == B.restrict_degree(k) for k in range(7))
-+            sage: B = p[2, 2, 1](sum(p(s[i]) for i in range(7)))  # long time
-+            sage: all(h.compute_product(k, Partition([2, 2, 1])) == B.restrict_degree(k) for k in range(7))  # long time
-             True
-         """
-         # This is the approximate order of the result
diff --git a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch b/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
deleted file mode 100644
index 007f3324cfe4..000000000000
--- a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index b77c69b2f77..0586a96ae55 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -563,7 +563,7 @@ def complex_to_cmap_rgb(z_values, cmap='turbo', contoured=False, tiled=False,
-     import matplotlib as mpl
- 
-     if isinstance(cmap, str):
--        cmap = mpl.cm.get_cmap(cmap)
-+        cmap = mpl.colormaps[cmap]
- 
-     if contour_base is None:
-         if contour_type == "linear":
-@@ -1206,11 +1206,11 @@ def complex_plot(f, x_range, y_range, contoured=False, tiled=False, cmap=None,
-                 domain = np.linspace(0, 1, 256)
-                 shifted_domain = np.roll(domain, 128)
-                 default_cmap = mpl.colors.LinearSegmentedColormap.from_list(
--                    "sage_default", mpl.cm.get_cmap('hsv')(shifted_domain)
-+                    "sage_default", mpl.colormaps['hsv'](shifted_domain)
-                 )
-                 cmap = default_cmap
-             else:
--                cmap = mpl.cm.get_cmap(cmap)
-+                cmap = mpl.colormaps[cmap]
-         rgbs = complex_to_cmap_rgb(
-             z_values, cmap=cmap, contoured=contoured, tiled=tiled,
-             contour_type=contour_type, contour_base=contour_base,
-diff --git a/src/sage/plot/contour_plot.py b/src/sage/plot/contour_plot.py
-index c0cab456686..4accb309580 100644
---- a/src/sage/plot/contour_plot.py
-+++ b/src/sage/plot/contour_plot.py
-@@ -848,9 +848,7 @@ def f(x,y): return cos(x) + sin(y)
- 
-         sage: contour_plot(lambda x,y: 0, (-1,1), (-1,1),
-         ....:              contours=[0], fill=False, cmap=['blue'])
--        ...
--        UserWarning: No contour levels were found within the data range.
--        Graphics object consisting of 1 graphics primitive
-+        ...Graphics object consisting of 1 graphics primitive
- 
-     .. PLOT::
- 
-@@ -874,8 +872,7 @@ def f(x,y): return cos(x) + sin(y)
-     Check that :trac:`18074` is fixed::
- 
-         sage: contour_plot(0, (0,1), (0,1))
--        ... UserWarning: No contour levels were found within the data range.
--        Graphics object consisting of 1 graphics primitive
-+        ...Graphics object consisting of 1 graphics primitive
- 
-     Domain points in :trac:`11648` with complex output are now skipped::
- 
-diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
-index 64ea1a7e10f..cdc99ced263 100644
---- a/src/sage/plot/graphics.py
-+++ b/src/sage/plot/graphics.py
-@@ -2341,7 +2341,7 @@ def _matplotlib_tick_formatter(self, subplot, base=(10, 10),
-             sage: subplot = Figure().add_subplot(111)
-             sage: p._objects[0]._render_on_subplot(subplot)
-             sage: p._matplotlib_tick_formatter(subplot, **d)
--            (<AxesSubplot:...>,
-+            (<Axes...>,
-             <matplotlib.ticker.MaxNLocator object at ...>,
-             <matplotlib.ticker.MaxNLocator object at ...>,
-             <matplotlib.ticker.ScalarFormatter object at ...>,
-diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
-index 99c817f03a6..ae85183dc93 100644
---- a/src/sage/plot/multigraphics.py
-+++ b/src/sage/plot/multigraphics.py
-@@ -1207,7 +1207,7 @@ def _add_subplot(self, figure, index, **options):
-             sage: fig = Figure()
-             sage: ax1 = G._add_subplot(fig, 0)
-             sage: type(ax1)
--            <class 'matplotlib.axes._subplots.AxesSubplot'>
-+            <class 'matplotlib.axes...'>
-             sage: ax2 = G._add_subplot(fig, 1)
-             sage: fig.get_axes() == [ax1, ax2]
-             True
-diff --git a/src/sage/plot/plot3d/plot_field3d.py b/src/sage/plot/plot3d/plot_field3d.py
-index bdf39391d3e..fe10e27f58f 100644
---- a/src/sage/plot/plot3d/plot_field3d.py
-+++ b/src/sage/plot/plot3d/plot_field3d.py
-@@ -126,9 +126,9 @@ def plot_vector_field3d(functions, xrange, yrange, zrange,
-     vectors = [vector((ff(*point), gg(*point), hh(*point))) for point in points]
- 
-     try:
--        from matplotlib.cm import get_cmap
--        cm = get_cmap(colors)
--    except (TypeError, ValueError):
-+        import matplotlib as mpl
-+        cm = mpl.colormaps[colors]
-+    except (TypeError, KeyError):
-         cm = None
-     if cm is None:
-         if isinstance(colors, (list, tuple)):
diff --git a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch b/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
deleted file mode 100644
index 1e0a708e8068..000000000000
--- a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py
-index c9ca5e30939..9459cb70334 100644
---- a/src/sage/interfaces/maxima_lib.py
-+++ b/src/sage/interfaces/maxima_lib.py
-@@ -77,6 +77,26 @@
-     sage: bar == foo
-     True
- 
-+TESTS:
-+
-+Check our workaround for a race in ecl works, see :trac:`26968`.
-+We use a temporary `MAXIMA_USERDIR` so it's empty; we place it
-+in `DOT_SAGE` since we expect it to have more latency than `/tmp`.
-+
-+    sage: import tempfile, subprocess
-+    sage: tmpdir = tempfile.TemporaryDirectory(dir=DOT_SAGE)
-+    sage: _ = subprocess.run(['sage', '-c',  # long time
-+    ....: f'''
-+    ....: import os
-+    ....: os.environ["MAXIMA_USERDIR"] = "{tmpdir.name}"
-+    ....: if not os.fork():
-+    ....:     import sage.interfaces.maxima_lib
-+    ....: else:
-+    ....:     import sage.interfaces.maxima_lib
-+    ....:     os.wait()
-+    ....: '''])
-+    sage: tmpdir.cleanup()
-+
- """
- 
- # ****************************************************************************
-@@ -116,7 +136,23 @@
- ecl_eval("(setq $nolabels t))")
- ecl_eval("(defvar *MAXIMA-LANG-SUBDIR* NIL)")
- ecl_eval("(set-locale-subdir)")
--ecl_eval("(set-pathnames)")
-+
-+try:
-+    ecl_eval("(set-pathnames)")
-+except RuntimeError:
-+    # Recover from :trac:`26968` by creating `*maxima-objdir*` here.
-+    # This cannot be done before calling `(set-pathnames)` since
-+    # `*maxima-objdir*` is computed there.
-+    # We use python `os.makedirs()` which is immune to the race.
-+    # Using `(ensure-directories-exist ...)` in lisp would be
-+    # subject to the same race condition and since `*maxima-objdir*`
-+    # has multiple components this is quite plausible to happen.
-+    maxima_objdir = ecl_eval("*maxima-objdir*").python()[1:-1]
-+    import os
-+    os.makedirs(maxima_objdir, exist_ok=True)
-+    # Call `(set-pathnames)` again to complete its job.
-+    ecl_eval("(set-pathnames)")
-+
- ecl_eval("(defun add-lineinfo (x) x)")
- ecl_eval('(defun principal nil (cond ($noprincipal (diverg)) ((not pcprntd) (merror "Divergent Integral"))))')
- ecl_eval("(remprop 'mfactorial 'grind)")  # don't use ! for factorials (#11539)
diff --git a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch b/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
deleted file mode 100644
index fc3e40da2a88..000000000000
--- a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff --git a/src/bin/sage-cleaner b/src/bin/sage-cleaner
-index e2e578eec60..dc7d8f0482e 100755
---- a/src/bin/sage-cleaner
-+++ b/src/bin/sage-cleaner
-@@ -99,6 +99,15 @@ def cleanup():
- 
-     return len(pid_list)
- 
-+def cleanup_cruft():
-+    """ remove directories leftover from improper shutdown """
-+    tmp_dirs = os.listdir(SAGE_TMP_ROOT)
-+    for dir_entry in tmp_dirs:
-+        baddir = os.path.join(SAGE_TMP_ROOT, dir_entry)
-+        if os.path.isdir(baddir):
-+            logger.warning('Removing old directory %s from SAGE_TMP_ROOT', baddir)
-+            rm_rf(baddir)
-+
- def kill_spawned_jobs(jobfile, parent_pid):
-     logger.info("Killing %s's spawned jobs", parent_pid)
-     killed_them_all = True
-@@ -193,6 +202,7 @@ if __name__ == '__main__':
-     setup_daemon()
-     fix_old_mistakes()
-     logger.info("Starting sage-cleaner with PID %s", os.getpid())
-+    cleanup_cruft()
- 
-     if len(sys.argv) > 1:
-         wait = int(sys.argv[1])
diff --git a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch b/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
deleted file mode 100644
index ea210e20ae52..000000000000
--- a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py
-index ec6a5c19e60..9dd7bc1cb1e 100644
---- a/src/sage/graphs/generators/families.py
-+++ b/src/sage/graphs/generators/families.py
-@@ -3660,7 +3660,7 @@ def nauty_gentreeg(options="", debug=False):
- 
-         sage: gen = graphs.nauty_gentreeg("4", debug=True)
-         sage: print(next(gen))
--        >A ...gentreeg Z=2:3 D=3 n=4
-+        >A ...gentreeg ...
-         sage: gen = graphs.nauty_gentreeg("4 -q", debug=True)
-         sage: next(gen)
-         ''
-@@ -3687,7 +3687,7 @@ def nauty_gentreeg(options="", debug=False):
-         sage: list(graphs.nauty_gentreeg("3 -x", debug=True))
-         ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n [res/mod] ...
-         sage: list(graphs.nauty_gentreeg("3", debug=True))
--        ['>A ...gentreeg Z=2:2 D=2 n=3\n', Graph on 3 vertices]
-+        ['>A ...gentreeg ...\n', Graph on 3 vertices]
-     """
-     import shlex
-     from sage.features.nauty import NautyExecutable
-diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py
-index df88bbe2713..1a8016976c2 100644
---- a/src/sage/graphs/graph_generators.py
-+++ b/src/sage/graphs/graph_generators.py
-@@ -966,7 +966,7 @@ def nauty_geng(self, options="", debug=False):
-             ...
-             ValueError: wrong format of parameter option
-             sage: list(graphs.nauty_geng("-c3", debug=True))
--            ['>E Usage: ...geng [-cCmtfbd#D#] [-uygsnh] [-lvq] ...
-+            ['>E Usage: ...geng ...\n']
-             sage: list(graphs.nauty_geng("-c 3", debug=True))
-             ['>A ...geng -cd1D2 n=3 e=2-3\n', Graph on 3 vertices, Graph on 3 vertices]
-         """
diff --git a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch b/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
deleted file mode 100644
index 46bda084e48e..000000000000
--- a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-diff --git a/src/sage/repl/inputhook.py b/src/sage/repl/inputhook.py
-index da5df0268c0..7f7894f6dcf 100644
---- a/src/sage/repl/inputhook.py
-+++ b/src/sage/repl/inputhook.py
-@@ -17,6 +17,8 @@
- 
- import select
- import errno
-+import contextlib
-+import io
- 
- from IPython import get_ipython
- from IPython.terminal.pt_inputhooks import register
-@@ -47,15 +49,27 @@ def install():
-     """
-     Install the Sage input hook
- 
--    EXAMPLES::
-+    EXAMPLES:
-+
-+    Make sure ipython is running so we really test this function::
-+
-+        sage: from sage.repl.interpreter import get_test_shell
-+        sage: get_test_shell()
-+        <sage.repl.interpreter.SageTestShell object at ...>
-+
-+    Run the function twice, to check it is idempotent (see :trac:`35235`)::
- 
-         sage: from sage.repl.inputhook import install
-         sage: install()
-+        sage: install()
-     """
-     ip = get_ipython()
-     if not ip:
-         return   # Not running in ipython, e.g. doctests
--    ip.enable_gui('sage')
-+    if ip._inputhook != sage_inputhook:
-+        # silence `ip.enable_gui()` useless output
-+        with contextlib.redirect_stdout(io.StringIO()):
-+            ip.enable_gui('sage')
- 
- 
- def uninstall():
-@@ -71,4 +85,6 @@ def uninstall():
-     if not ip:
-         return
-     if ip._inputhook == sage_inputhook:
--        ip.enable_gui(None)
-+        # silence `ip.enable_gui()` useless output
-+        with contextlib.redirect_stdout(io.StringIO()):
-+            ip.enable_gui(None)
diff --git a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch b/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
deleted file mode 100644
index 2cdc674d4f9e..000000000000
--- a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 532fbbaf71bb41c73920b584108eb2a09d6deeb1 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
-Date: Tue, 4 Apr 2023 12:56:57 -0300
-Subject: [PATCH] Ignore deprecation warnings triggered by pythran 0.12.1
-
-These happen with python 3.11, setuptools 67.6.1, numpy 1.24.2.
-When pythran 0.12.1 is installed, I get 24 doctest failures due to
-deprecation warnings; they are all gone with this commit.
-
-[backported from 839a6e928c264a9863bd42860c78ae95a6d9f3e0]
----
- src/sage/all.py | 12 ++++++++++--
- 1 file changed, 10 insertions(+), 2 deletions(-)
-
-diff --git a/src/sage/all.py b/src/sage/all.py
-index 93588df1b93..ee775aad0e9 100644
---- a/src/sage/all.py
-+++ b/src/sage/all.py
-@@ -96,9 +96,17 @@ warnings.filterwarnings('ignore', category=DeprecationWarning,
- warnings.filterwarnings('ignore', category=DeprecationWarning,
-     module='(.*[.]_vendor[.])?packaging')
- 
--# Ignore numpy warnings triggered by pythran
-+# Ignore a few warnings triggered by pythran 0.12.1
- warnings.filterwarnings('ignore', category=DeprecationWarning,
--                        module='pythran')
-+    message='\n\n  `numpy.distutils` is deprecated since NumPy 1.23.0',
-+    module='pythran.dist')
-+warnings.filterwarnings('ignore', category=DeprecationWarning,
-+    message='pkg_resources is deprecated as an API|'
-+            'Deprecated call to `pkg_resources.declare_namespace(.*)`',
-+    module='pkg_resources')
-+warnings.filterwarnings('ignore', category=DeprecationWarning,
-+    message='msvccompiler is deprecated and slated to be removed',
-+    module='distutils.msvccompiler')
- 
- warnings.filterwarnings('ignore', category=DeprecationWarning,
-                         message='The distutils(.sysconfig module| package) is deprecated',
--- 
-2.40.0
-
diff --git a/srcpkgs/sagemath/patches/35584-networkx_3.1.patch b/srcpkgs/sagemath/patches/35584-networkx_3.1.patch
index 66eedecff7c6..9331258986d3 100644
--- a/srcpkgs/sagemath/patches/35584-networkx_3.1.patch
+++ b/srcpkgs/sagemath/patches/35584-networkx_3.1.patch
@@ -1,8 +1,8 @@
 diff --git a/src/sage/graphs/graph.py b/src/sage/graphs/graph.py
-index c2e42bcbd3..b6a10efbf4 100644
+index c2e42bcbd38..0d13f071dc4 100644
 --- a/src/sage/graphs/graph.py
 +++ b/src/sage/graphs/graph.py
-@@ -6786,13 +6786,21 @@ def cliques_number_of(self, vertices=None, cliques=None):
+@@ -6786,13 +6786,26 @@ def cliques_number_of(self, vertices=None, cliques=None):
              {(0, 0): 2, (0, 1): 3, (0, 2): 2, (1, 0): 2, (1, 1): 3, (1, 2): 2}
              sage: F.cliques_number_of(vertices=[(0, 1), (1, 2)])
              {(0, 1): 3, (1, 2): 2}
@@ -18,15 +18,20 @@ index c2e42bcbd3..b6a10efbf4 100644
 +        if cliques is None:
 +            cliques = self.cliques_maximal()
 +
-+        if vertices in self: # single vertex
++        if vertices in self:  # single vertex
 +            return sum(1 for c in cliques if vertices in c)
-+        else:
-+            return { v : sum(1 for c in cliques if v in c)
-+                     for v in vertices or self }
++
++        from collections import Counter
++        count = Counter()
++
++        for c in cliques:
++            count.update(c)
++
++        return {v : count[v] for v in vertices or self}
  
      @doc_index("Clique-related methods")
      def cliques_get_max_clique_graph(self):
-@@ -7493,17 +7501,32 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
+@@ -7493,17 +7506,32 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
  
              sage: C = Graph('DJ{')
              sage: C.cliques_containing_vertex()
@@ -62,7 +67,7 @@ index c2e42bcbd3..b6a10efbf4 100644
  
          Since each clique of a 2 dimensional grid corresponds to an edge, the
          number of cliques in which a vertex is involved equals its degree::
-@@ -7518,8 +7541,14 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
+@@ -7518,8 +7546,20 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
              sage: sorted(sorted(x for x in L) for L in d[(0, 1)])
              [[(0, 0), (0, 1)], [(0, 1), (0, 2)], [(0, 1), (1, 1)]]
          """
@@ -71,11 +76,17 @@ index c2e42bcbd3..b6a10efbf4 100644
 +        if cliques is None:
 +            cliques = self.cliques_maximal()
 +
-+        if vertices in self: # single vertex
++        if vertices in self:  # single vertex
 +            return [c for c in cliques if vertices in c]
-+        else:
-+            return { v : [c for c in cliques if v in c]
-+                     for v in vertices or self }
++
++        from collections import defaultdict
++        d = defaultdict(list)
++
++        for c in cliques:
++            for v in c:
++                d[v].append(c)
++
++        return {v : d[v] for v in vertices or self}
  
      @doc_index("Clique-related methods")
      def clique_complex(self):
diff --git a/srcpkgs/sagemath/patches/35612-linbox_1.7.0.patch b/srcpkgs/sagemath/patches/35612-linbox_1.7.0.patch
new file mode 100644
index 000000000000..58dddf34a69d
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35612-linbox_1.7.0.patch
@@ -0,0 +1,64 @@
+diff --git a/src/sage/libs/linbox/conversion.pxd b/src/sage/libs/linbox/conversion.pxd
+index 7794c9edc39..1753277b1f1 100644
+--- a/src/sage/libs/linbox/conversion.pxd
++++ b/src/sage/libs/linbox/conversion.pxd
+@@ -177,9 +177,8 @@ cdef inline Vector_integer_dense new_sage_vector_integer_dense(P, DenseVector_in
+     - v -- linbox vector
+     """
+     cdef Vector_integer_dense res = P()
+-    cdef cppvector[Integer] * vec = &v.refRep()
+     cdef size_t i
+     for i in range(<size_t> res._degree):
+-        mpz_set(res._entries[i], vec[0][i].get_mpz_const())
++        mpz_set(res._entries[i], v.getEntry(i).get_mpz_const())
+ 
+     return res
+diff --git a/src/sage/libs/linbox/linbox.pxd b/src/sage/libs/linbox/linbox.pxd
+index 9112d151f8b..bfeda4b6042 100644
+--- a/src/sage/libs/linbox/linbox.pxd
++++ b/src/sage/libs/linbox/linbox.pxd
+@@ -32,7 +32,6 @@ cdef extern from "linbox/matrix/dense-matrix.h":
+         ctypedef Modular_double Field
+         ctypedef double Element
+         DenseMatrix_Modular_double(Field F, size_t m, size_t n)
+-        DenseMatrix_Modular_double(Field F, Element*, size_t m, size_t n)
+         void setEntry(size_t i, size_t j, Element& a)
+         Element &getEntry(size_t i, size_t j)
+ 
+@@ -42,7 +41,6 @@ cdef extern from "linbox/matrix/dense-matrix.h":
+         ctypedef Modular_float Field
+         ctypedef float Element
+         DenseMatrix_Modular_float(Field F, size_t m, size_t n)
+-        DenseMatrix_Modular_float(Field F, Element*, size_t m, size_t n)
+         void setEntry(size_t i, size_t j, Element& a)
+         Element &getEntry(size_t i, size_t j)
+ 
+@@ -101,7 +99,6 @@ cdef extern from "linbox/vector/vector.h":
+         DenseVector_integer (Field &F)
+         DenseVector_integer (Field &F, long& m)
+         DenseVector_integer (Field &F, cppvector[Integer]&)
+-        cppvector[Element]& refRep()
+         size_t size()
+         void resize(size_t)
+         void resize(size_t n, const Element&)
+diff --git a/src/sage/matrix/matrix_modn_dense_template.pxi b/src/sage/matrix/matrix_modn_dense_template.pxi
+index abf29badce6..68b869ce314 100644
+--- a/src/sage/matrix/matrix_modn_dense_template.pxi
++++ b/src/sage/matrix/matrix_modn_dense_template.pxi
+@@ -221,9 +221,14 @@ cdef inline linbox_echelonize_efd(celement modulus, celement* entries, Py_ssize_
+         return 0,[]
+ 
+     cdef ModField *F = new ModField(<long>modulus)
+-    cdef DenseMatrix *A = new DenseMatrix(F[0], <ModField.Element*>entries,<Py_ssize_t>nrows, <Py_ssize_t>ncols)
+-    cdef Py_ssize_t r = reducedRowEchelonize(A[0])
++    cdef DenseMatrix *A = new DenseMatrix(F[0], nrows, ncols)
++
+     cdef Py_ssize_t i,j
++    for i in range(nrows):
++        for j in range(ncols):
++            A.setEntry(i, j, entries[i*ncols+j])
++
++    cdef Py_ssize_t r = reducedRowEchelonize(A[0])
+     for i in range(nrows):
+         for j in range(ncols):
+             entries[i*ncols+j] = <celement>A.getEntry(i,j)
diff --git a/srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch b/srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch
new file mode 100644
index 000000000000..0220b4300c30
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch
@@ -0,0 +1,569 @@
+diff --git a/build/pkgs/ecl/dependencies b/build/pkgs/ecl/dependencies
+index cda6316bf5a..51a953403e9 100644
+--- a/build/pkgs/ecl/dependencies
++++ b/build/pkgs/ecl/dependencies
+@@ -1,4 +1,4 @@
+-$(MP_LIBRARY) readline gc libffi
++$(MP_LIBRARY) readline gc libffi info
+ 
+ ----------
+ All lines of this file are ignored except the first.
+diff --git a/build/pkgs/ecl/spkg-configure.m4 b/build/pkgs/ecl/spkg-configure.m4
+index ae1e0ac5e1a..7dbcfa6377b 100644
+--- a/build/pkgs/ecl/spkg-configure.m4
++++ b/build/pkgs/ecl/spkg-configure.m4
+@@ -35,10 +35,7 @@ SAGE_SPKG_CONFIGURE([ecl], [
+     AC_SUBST(SAGE_ECL_CONFIG, [$ECL_CONFIG])
+   fi
+ 
+-  # Maxima cannot yet be provided by the system, so we always use
++  # Kenzo cannot yet be provided by the system, so we always use
+   # the SAGE_LOCAL path for now.
+-  AC_SUBST(SAGE_MAXIMA_FAS, ['${prefix}'/lib/ecl/maxima.fas])
+-
+-  # Likewise for the optional Kenzo SPKG
+   AC_SUBST(SAGE_KENZO_FAS, ['${prefix}'/lib/ecl/kenzo.fas])
+ ])
+diff --git a/build/pkgs/ecl/spkg-install.in b/build/pkgs/ecl/spkg-install.in
+index ee1667aec16..72083337942 100644
+--- a/build/pkgs/ecl/spkg-install.in
++++ b/build/pkgs/ecl/spkg-install.in
+@@ -31,18 +31,6 @@ cp "$SAGE_ROOT"/config/config.* src
+ 
+ if [ x"$SAGE_SPKG_INSTALL_DOCS" != xyes ] ; then
+     ECL_CONFIGURE="$ECL_CONFIGURE --enable-manual=no"
+-else
+-    # ECL 2020 needs modern makeinfo
+-    command -v texi2any >/dev/null 2>&1
+-    if [ $? -ne 0 ]; then # texi2any not found -> makeinfo too old, if present
+-        ECL_CONFIGURE="$ECL_CONFIGURE --enable-manual=no"
+-    else
+-        if makeinfo -c foo 2>&1 | grep -q invalid; then
+-            # makeinfo found but does not support all options that ecl
+-            # likes to use
+-            ECL_CONFIGURE="$ECL_CONFIGURE --enable-manual=no"
+-        fi
+-    fi
+ fi
+ 
+ sdh_configure $SAGE_CONFIGURE_GMP \
+diff --git a/build/pkgs/giac/spkg-configure.m4 b/build/pkgs/giac/spkg-configure.m4
+index 5859e35f12e..b677184b7be 100644
+--- a/build/pkgs/giac/spkg-configure.m4
++++ b/build/pkgs/giac/spkg-configure.m4
+@@ -5,7 +5,7 @@ SAGE_SPKG_CONFIGURE([giac], [
+        m4_pushdef([GIAC_MAX_VERSION], [1.9.999])
+        AC_CACHE_CHECK([for giac >= ]GIAC_MIN_VERSION[, <= ]GIAC_MAX_VERSION, [ac_cv_path_GIAC], [
+          AC_PATH_PROGS_FEATURE_CHECK([GIAC], [giac], [
+-            giac_version=$($ac_path_GIAC --version 2> /dev/null | tail -1)
++            giac_version=$($ac_path_GIAC --version 2> /dev/null | tail -n -1)
+             AS_IF([test -n "$giac_version"], [
+                 AX_COMPARE_VERSION([$giac_version], [ge], GIAC_MIN_VERSION, [
+                     AX_COMPARE_VERSION([$giac_version], [le], GIAC_MAX_VERSION, [
+diff --git a/build/pkgs/info/spkg-configure.m4 b/build/pkgs/info/spkg-configure.m4
+index 0980a4b8ef8..85fe1ea4731 100644
+--- a/build/pkgs/info/spkg-configure.m4
++++ b/build/pkgs/info/spkg-configure.m4
+@@ -1,4 +1,14 @@
+ SAGE_SPKG_CONFIGURE([info], [
+   AC_PATH_PROG(INFO, info)
+-  AS_IF([test -z "${INFO}"], [sage_spkg_install_info=yes])
++  AS_IF([test -z "${INFO}"], [sage_spkg_install_info=yes
++    ], [
++     dnl very old makeinfo are not texi2any, newer are symlinks to texi2any
++     AC_PATH_PROG(TEXI2ANY, texi2any)
++     AS_IF([test -z "${TEXI2ANY}"], [sage_spkg_install_info=yes
++       ], [
++        AS_IF([makeinfo -c foo 2>&1 | grep -q invalid], [
++         dnl makeinfo found, but too old, and  does not support all options that ecl likes to use
++         sage_spkg_install_info=yes])
++       ])
++    ])
+ ])
+diff --git a/build/pkgs/info/spkg-install.in b/build/pkgs/info/spkg-install.in
+index 8086e4b2ec8..3ea8c053669 100644
+--- a/build/pkgs/info/spkg-install.in
++++ b/build/pkgs/info/spkg-install.in
+@@ -1,2 +1,2 @@
+-cd src/info
++cd src
+ sdh_make_install
+diff --git a/build/pkgs/info/type b/build/pkgs/info/type
+index 134d9bc32d5..a6a7b9cd726 100644
+--- a/build/pkgs/info/type
++++ b/build/pkgs/info/type
+@@ -1 +1 @@
+-optional
++standard
+diff --git a/build/pkgs/maxima/checksums.ini b/build/pkgs/maxima/checksums.ini
+index a804c7b831f..0f594389fe6 100644
+--- a/build/pkgs/maxima/checksums.ini
++++ b/build/pkgs/maxima/checksums.ini
+@@ -1,5 +1,5 @@
+ tarball=maxima-VERSION.tar.gz
+-sha1=ed15d5285794413ba94412079eca3d0fa55a47bf
+-md5=9b9ae1dace55b1386739dabaa9122e60
+-cksum=1765409766
++sha1=1010594e6d6082bbd8efaac1b7756ec1721a4ed5
++md5=3c01f1daa6936e11d8713fef7751d3fe
++cksum=2420393096
+ upstream_url=https://sourceforge.net/projects/maxima/files/Maxima-source/VERSION-source/maxima-VERSION.tar.gz/download
+diff --git a/build/pkgs/maxima/distros/arch.txt b/build/pkgs/maxima/distros/arch.txt
+index 6400290f44d..6ac052fa62b 100644
+--- a/build/pkgs/maxima/distros/arch.txt
++++ b/build/pkgs/maxima/distros/arch.txt
+@@ -1 +1 @@
+-maxima-ecl
++maxima-fas
+diff --git a/build/pkgs/maxima/distros/cygwin.txt b/build/pkgs/maxima/distros/cygwin.txt
+new file mode 100644
+index 00000000000..f5fe3fdc6cb
+--- /dev/null
++++ b/build/pkgs/maxima/distros/cygwin.txt
+@@ -0,0 +1 @@
++maxima
+diff --git a/build/pkgs/maxima/distros/freebsd.txt b/build/pkgs/maxima/distros/freebsd.txt
+new file mode 100644
+index 00000000000..766a71b5074
+--- /dev/null
++++ b/build/pkgs/maxima/distros/freebsd.txt
+@@ -0,0 +1 @@
++math/maxima
+diff --git a/build/pkgs/maxima/distros/gentoo.txt b/build/pkgs/maxima/distros/gentoo.txt
+new file mode 100644
+index 00000000000..85fb33f1610
+--- /dev/null
++++ b/build/pkgs/maxima/distros/gentoo.txt
+@@ -0,0 +1,2 @@
++sci-mathematics/maxima[ecls]
++
+diff --git a/build/pkgs/maxima/package-version.txt b/build/pkgs/maxima/package-version.txt
+index 83476624dc0..5681375f3be 100644
+--- a/build/pkgs/maxima/package-version.txt
++++ b/build/pkgs/maxima/package-version.txt
+@@ -1 +1 @@
+-5.45.0.p0
++5.46.0
+diff --git a/build/pkgs/maxima/patches/matrixexp.patch b/build/pkgs/maxima/patches/matrixexp.patch
+deleted file mode 100644
+index 5c8527c33bf..00000000000
+--- a/build/pkgs/maxima/patches/matrixexp.patch
++++ /dev/null
+@@ -1,15 +0,0 @@
+-diff --git a/share/linearalgebra/matrixexp.lisp b/share/linearalgebra/matrixexp.lisp
+-index 218bf35..f2fd468 100644
+---- a/share/linearalgebra/matrixexp.lisp
+-+++ b/share/linearalgebra/matrixexp.lisp
+-@@ -138,8 +138,8 @@
+- 	   (print `(ratvars = ,$ratvars gcd = '$gcd algebraic = ,$algebraic))
+- 	   (print `(ratfac = ,$ratfac))
+- 	   (merror "Unable to find the spectrum")))
+--   
+--    (setq res ($fullratsimp (ncpower (sub (mult z ($ident n)) mat) -1) z))
+-+
+-+    (setq res ($fullratsimp ($invert_by_lu (sub (mult z ($ident n)) mat) '$crering) z))
+-     (setq m (length sp))
+-     (dotimes (i m)
+-       (setq zi (nth i sp))
+diff --git a/build/pkgs/maxima/patches/maxima.system.patch b/build/pkgs/maxima/patches/maxima.system.patch
+deleted file mode 100644
+index 74db62e7f9f..00000000000
+--- a/build/pkgs/maxima/patches/maxima.system.patch
++++ /dev/null
+@@ -1,25 +0,0 @@
+-diff --git a/src/maxima.system b/src/maxima.system
+-index 76f2452..cf25f51 100644
+---- a/src/maxima.system
+-+++ b/src/maxima.system
+-@@ -1,5 +1,8 @@
+- ;;; -*- Lisp -*-
+- 
+-+(require :cmp)
+-+(setf c::*compile-in-constants* t)
+-+
+- (in-package :cl-user)
+- 
+- (pushnew :cl *features*)
+-@@ -75,6 +78,11 @@
+- 			     ;; Convert dir/foo.fas to dir/foo.o
+- 			     (make-pathname :type "o" :defaults p))
+- 			 files)))
+-+	(c::build-fasl "binary-ecl/maxima" :lisp-files obj
+-+			  :ld-flags
+-+			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
+-+							      (find-package "MAXIMA")))))
+-+			    (if (and x (not (string= x ""))) (list x))))
+- 	(c::build-program "binary-ecl/maxima" :lisp-files obj
+- 			  :ld-flags
+- 			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
+diff --git a/build/pkgs/maxima/spkg-configure.m4 b/build/pkgs/maxima/spkg-configure.m4
+new file mode 100644
+index 00000000000..dc54525320e
+--- /dev/null
++++ b/build/pkgs/maxima/spkg-configure.m4
+@@ -0,0 +1,46 @@
++SAGE_SPKG_CONFIGURE([maxima], [
++  m4_pushdef([SAGE_MAXIMA_MINVER],["5.45.0"])dnl this version and higher allowed
++  SAGE_SPKG_DEPCHECK([ecl], [
++    dnl First check for the "maxima" executable in the user's PATH, because
++    dnl we still use pexpect to communicate with it in a few places.
++    AC_CACHE_CHECK([for Maxima >= $SAGE_MAXIMA_MINVER], [ac_cv_path_MAXIMA], [
++        AC_PATH_PROGS_FEATURE_CHECK([MAXIMA], [maxima], [
++            maxima_version=`$ac_path_MAXIMA --version 2>&1 | tail -n -1\
++                | $SED -n -e 's/Maxima *\([[0-9]]*\.[[0-9]]*\.[[0-9]]*\)/\1/p'`
++            AS_IF([test -n "$maxima_version"], [
++                AX_COMPARE_VERSION([$maxima_version], [ge], [SAGE_MAXIMA_MINVER], [
++                    ac_cv_path_MAXIMA="$ac_path_MAXIMA"
++                    ac_path_MAXIMA_found=:
++                ])
++            ])
++        ])
++    ])
++    SAGE_MAXIMA="$ac_cv_path_MAXIMA"
++    AS_IF([test -z "${SAGE_MAXIMA}"], [
++      sage_spkg_install_maxima=yes
++    ],[
++      dnl If we have the executable, check also for the ECL library.
++      AC_MSG_CHECKING([if ECL can "require" the maxima module])
++      AS_IF([ecl --eval "(require 'maxima)" --eval "(quit)" \
++               >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD], [
++        AC_MSG_RESULT(yes)
++      ], [
++        AC_MSG_RESULT(no)
++        sage_spkg_install_maxima=yes
++      ])
++    ])
++  ])
++  m4_popdef([SAGE_MAXIMA_MINVER])
++],[],[],[
++  # post-check
++  AS_IF([test x$sage_spkg_install_maxima = xyes], [
++    dnl Leaving this variable empty will tell sagelib to load
++    dnl the maxima library (within ECL) by name instead of by
++    dnl absolute path.
++    SAGE_MAXIMA='${prefix}'/bin/maxima
++    SAGE_MAXIMA_FAS='${prefix}'/lib/ecl/maxima.fas
++  ])
++
++  AC_SUBST(SAGE_MAXIMA, "${SAGE_MAXIMA}")
++  AC_SUBST(SAGE_MAXIMA_FAS, "${SAGE_MAXIMA_FAS}")
++])
+diff --git a/build/pkgs/maxima/spkg-install.in b/build/pkgs/maxima/spkg-install.in
+index 3ae6382f9ba..cdb6fbf2069 100644
+--- a/build/pkgs/maxima/spkg-install.in
++++ b/build/pkgs/maxima/spkg-install.in
+@@ -28,28 +28,6 @@ echo
+ echo "Now configuring Maxima..."
+ sdh_configure --enable-ecl git_found=false
+ 
+-# Note the following is regression in maxima build system
+-# see https://sourceforge.net/p/maxima/bugs/3278/
+-# and https://sourceforge.net/p/maxima/bugs/2878/
+-# For the previous time it was fixed.
+-#---------------------------------------------------------------
+-# Touching html and info file to avoid to regenerate them.
+-# This must be done after configuration since the timestamp need
+-# to be later than include-maxima.texi which is generated at
+-# configuration time
+-for i in doc/info/*.html ; do
+-    touch "${i}"
+-done
+-touch doc/info/maxima.info*
+-# Maxima 5.44.0 build_html.sh is not compatible with makeinfo 4.8
+-# (which is /usr/bin/makeinfo on macOS).  #30063
+-# Do not build the HTML docs unless the user asks for it,
+-# in which case it is their problem to install a better
+-# makeinfo version.
+-if [[ "$SAGE_SPKG_INSTALL_DOCS" != yes ]] ; then
+-touch doc/info/maxima_toc.html interfaces/xmaxima/doc/xmaxima.html
+-fi
+-
+ #---------------------------------------------------------------
+ 
+ sdh_make
+diff --git a/build/pkgs/tox/spkg-configure.m4 b/build/pkgs/tox/spkg-configure.m4
+index 7d8ade4c14b..3de0b9b710d 100644
+--- a/build/pkgs/tox/spkg-configure.m4
++++ b/build/pkgs/tox/spkg-configure.m4
+@@ -5,7 +5,7 @@ SAGE_SPKG_CONFIGURE([tox], [
+        m4_pushdef([TOX4_MIN_VERSION], [4.0.15])
+        AC_CACHE_CHECK([for tox 3 >= ]TOX3_MIN_VERSION[ or tox 4 >= ]TOX4_MIN_VERSION, [ac_cv_path_TOX], [
+          AC_PATH_PROGS_FEATURE_CHECK([TOX], [tox], [
+-            tox_version=$($ac_path_TOX --version 2> /dev/null | tail -1)
++            tox_version=$($ac_path_TOX --version 2> /dev/null | tail -n -1)
+             AS_IF([test -n "$tox_version"], [
+                 AX_COMPARE_VERSION([$tox_version], [lt], [4], [
+                     AX_COMPARE_VERSION([$tox_version], [ge], TOX3_MIN_VERSION, [
+diff --git a/pkgs/sage-conf/_sage_conf/_conf.py.in b/pkgs/sage-conf/_sage_conf/_conf.py.in
+index d66bdb3d264..f2e197b45ed 100644
+--- a/pkgs/sage-conf/_sage_conf/_conf.py.in
++++ b/pkgs/sage-conf/_sage_conf/_conf.py.in
+@@ -9,9 +9,11 @@ VERSION = "@PACKAGE_VERSION@"
+ SAGE_LOCAL = "@prefix@"
+ SAGE_ROOT = "@SAGE_ROOT@"
+ 
+-MAXIMA = "@prefix@/bin/maxima"
++# The path to the standalone maxima executable.
++MAXIMA = "@SAGE_MAXIMA@".replace('${prefix}', SAGE_LOCAL)
+ 
+-# Delete this line if your ECL can load maxima without further prodding.
++# Set this to the empty string if your ECL can load maxima without
++# further prodding.
+ MAXIMA_FAS = "@SAGE_MAXIMA_FAS@".replace('${prefix}', SAGE_LOCAL)
+ 
+ # Delete this line if your ECL can load Kenzo without further prodding.
+diff --git a/src/bin/sage-env b/src/bin/sage-env
+index a7da60df28f..13b54fa7e92 100644
+--- a/src/bin/sage-env
++++ b/src/bin/sage-env
+@@ -440,9 +440,6 @@ if [ -d "$DOT_SAGE" ] ; then
+     fi
+ fi
+ 
+-if [ -n "$SAGE_LOCAL" ]; then
+-    export MAXIMA_PREFIX="$SAGE_LOCAL"
+-fi
+ export MAXIMA_USERDIR="$DOT_SAGE/maxima"
+ 
+ if [ -n "$SAGE_LOCAL" ]; then
+diff --git a/src/sage/calculus/calculus.py b/src/sage/calculus/calculus.py
+index dae380180ac..ee8f632e94c 100644
+--- a/src/sage/calculus/calculus.py
++++ b/src/sage/calculus/calculus.py
+@@ -136,10 +136,11 @@
+     [          1/2*(e^(2*sqrt(x)) + 1)*e^(x - sqrt(x)) 1/2*(x*e^(2*sqrt(x)) - x)*sqrt(x)*e^(x - sqrt(x))]
+     [  1/2*(e^(2*sqrt(x)) - 1)*e^(x - sqrt(x))/x^(3/2)           1/2*(e^(2*sqrt(x)) + 1)*e^(x - sqrt(x))]
+ 
+-And complex exponentiation works now::
++Complex exponentiation works, but may require a patched version of
++maxima (:trac:`32898`) for now::
+ 
+     sage: M = i*matrix([[pi]])
+-    sage: e^M
++    sage: e^M  # not tested, requires patched maxima
+     [-1]
+     sage: M = i*matrix([[pi,0],[0,2*pi]])
+     sage: e^M
+@@ -1186,8 +1187,18 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
+         e
+         sage: f.limit(x=5)
+         7776/3125
+-        sage: f.limit(x=1.2)
++
++    Domain to real, a regression in 5.46.0, see https://sf.net/p/maxima/bugs/4138 ::
++
++        sage: maxima_calculus.eval("domain:real")
++        ...
++        sage: f.limit(x=1.2).n()
+         2.06961575467...
++        sage: maxima_calculus.eval("domain:complex");
++        ...
++
++    Otherwise, it works ::
++
+         sage: f.limit(x=I, taylor=True)
+         (-I + 1)^I
+         sage: f(x=1.2)
+@@ -1215,7 +1226,7 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
+     With this example, Maxima is looking for a LOT of information::
+ 
+         sage: assume(a>0)
+-        sage: limit(x^a,x=0)
++        sage: limit(x^a,x=0)  # random - maxima 5.46.0 does not need extra assumption
+         Traceback (most recent call last):
+         ...
+         ValueError: Computation failed since Maxima requested additional
+@@ -1224,7 +1235,7 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
+          more details)
+         Is a an integer?
+         sage: assume(a,'integer')
+-        sage: limit(x^a, x=0)
++        sage: limit(x^a, x=0)  # random - maxima 5.46.0 does not need extra assumption
+         Traceback (most recent call last):
+         ...
+         ValueError: Computation failed since Maxima requested additional
+@@ -2251,10 +2262,10 @@ def symbolic_expression_from_maxima_string(x, equals_sub=False, maxima=maxima):
+         True
+         sage: sefms("x # 3") == SR(x != 3)
+         True
+-        sage: solve([x != 5], x)
+-        [[x - 5 != 0]]
++        sage: solve([x != 5], x) in [[[x - 5 != 0]], [[x < 5], [5 < x]]]
++        True
+         sage: solve([2*x==3, x != 5], x)
+-        [[x == (3/2), (-7/2) != 0]]
++        [[x == (3/2)...
+ 
+     Make sure that we don't accidentally pick up variables in the maxima namespace (:trac:`8734`)::
+ 
+diff --git a/src/sage/functions/exp_integral.py b/src/sage/functions/exp_integral.py
+index e6c888c64b6..f314e525145 100644
+--- a/src/sage/functions/exp_integral.py
++++ b/src/sage/functions/exp_integral.py
+@@ -601,8 +601,8 @@ class Function_log_integral_offset(BuiltinFunction):
+         1/log(x)
+         sage: f.integrate(x)
+         -x*log_integral(2) + x*log_integral(x) - Ei(2*log(x))
+-        sage: Li(x).integrate(x,2.0,4.5)
+-        -2.5*log_integral(2) + 5.799321147411334
++        sage: Li(x).integrate(x,2.0,4.5).n(digits=10)
++        3.186411697
+         sage: N(f.integrate(x,2.0,3.0))   # abs tol 1e-15
+         0.601621785860587
+ 
+diff --git a/src/sage/interfaces/expect.py b/src/sage/interfaces/expect.py
+index 68ae715e4c3..84adf0341b5 100644
+--- a/src/sage/interfaces/expect.py
++++ b/src/sage/interfaces/expect.py
+@@ -620,7 +620,7 @@ def quit(self, verbose=False):
+ 
+             sage: a = maxima('y')
+             sage: maxima.quit(verbose=True)
+-            Exiting Maxima with PID ... running .../bin/maxima...
++            Exiting Maxima with PID ... running ...maxima...
+             sage: a._check_valid()
+             Traceback (most recent call last):
+             ...
+diff --git a/src/sage/interfaces/maxima.py b/src/sage/interfaces/maxima.py
+index 27b1e98a6ac..4829560f98b 100644
+--- a/src/sage/interfaces/maxima.py
++++ b/src/sage/interfaces/maxima.py
+@@ -622,11 +622,6 @@ def _start(self):
+             sage: m.is_running()
+             True
+ 
+-        Test that we can use more than 256MB RAM (see :trac:`6772`)::
+-
+-            sage: a = maxima(10)^(10^5)
+-            sage: b = a^600              # long time -- about 10-15 seconds
+-
+         """
+         Expect._start(self)
+         self._sendline(r":lisp (defun tex-derivative (x l r) (tex (if $derivabbrev (tex-dabbrev x) (tex-d x '\\partial)) l r lop rop ))")
+@@ -634,9 +629,6 @@ def _start(self):
+         # Don't use ! for factorials (#11539)
+         self._sendline(":lisp (remprop 'mfactorial 'grind)")
+ 
+-        # Remove limit on the max heapsize (since otherwise it defaults
+-        # to 256MB with ECL).
+-        self._sendline(":lisp (ext:set-limit 'ext:heap-size 0)")
+         self._eval_line('0;')
+ 
+         # set random seed
+diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py
+index c263ac65f02..bba8504aa92 100644
+--- a/src/sage/interfaces/maxima_lib.py
++++ b/src/sage/interfaces/maxima_lib.py
+@@ -934,8 +934,15 @@ def sr_limit(self, expr, v, a, dir=None):
+             e
+             sage: limit(f,x = 5)
+             7776/3125
+-            sage: limit(f,x = 1.2)
++
++        Domain to real, a regression in 5.46.0, see https://sf.net/p/maxima/bugs/4138 ::
++
++            sage: maxima_calculus.eval("domain:real")
++            ...
++            sage: limit(f,x = 1.2).n()
+             2.06961575467...
++            sage: maxima_calculus.eval("domain:complex");
++            ...
+             sage: var('a')
+             a
+             sage: limit(x^a,x=0)
+@@ -947,7 +954,7 @@ def sr_limit(self, expr, v, a, dir=None):
+             for more details)
+             Is a positive, negative or zero?
+             sage: assume(a>0)
+-            sage: limit(x^a,x=0)
++            sage: limit(x^a,x=0)  # random - not needed for maxima 5.46.0
+             Traceback (most recent call last):
+             ...
+             ValueError: Computation failed ...
+diff --git a/src/sage/matrix/matrix2.pyx b/src/sage/matrix/matrix2.pyx
+index e2e6449dfa9..15914b0be3e 100644
+--- a/src/sage/matrix/matrix2.pyx
++++ b/src/sage/matrix/matrix2.pyx
+@@ -15425,9 +15425,10 @@ cdef class Matrix(Matrix1):
+ 
+         TESTS:
+ 
+-        Check that sparse matrices are handled correctly (:trac:`28935`)::
++        Sparse matrices are handled correctly (:trac:`28935`), but may
++        require a patched version of maxima (:trac:`32898`) for now::
+ 
+-            sage: matrix.diagonal([0], sparse=True).exp()
++            sage: matrix.diagonal([0], sparse=True).exp()  # not tested, requires patched maxima
+             [1]
+             sage: matrix.zero(CBF, 2, sparse=True).exp()
+             [1.000000000000000                 0]
+diff --git a/src/sage/matrix/matrix_symbolic_dense.pyx b/src/sage/matrix/matrix_symbolic_dense.pyx
+index 19ca5c85cb2..58a25e002f6 100644
+--- a/src/sage/matrix/matrix_symbolic_dense.pyx
++++ b/src/sage/matrix/matrix_symbolic_dense.pyx
+@@ -402,7 +402,8 @@ cdef class Matrix_symbolic_dense(Matrix_generic_dense):
+             [1/2*(e^(2*x) + 1)*e^(-x) 1/2*(e^(2*x) - 1)*e^(-x)]
+             [1/2*(e^(2*x) - 1)*e^(-x) 1/2*(e^(2*x) + 1)*e^(-x)]
+ 
+-        Exp works on 0x0 and 1x1 matrices::
++        Exponentiation works on 0x0 and 1x1 matrices, but the 1x1 example
++        requires a patched version of maxima (:trac:`32898`) for now::
+ 
+             sage: m = matrix(SR,0,[]); m
+             []
+@@ -410,7 +411,7 @@ cdef class Matrix_symbolic_dense(Matrix_generic_dense):
+             []
+             sage: m = matrix(SR,1,[2]); m
+             [2]
+-            sage: m.exp()
++            sage: m.exp()  # not tested, requires patched maxima
+             [e^2]
+ 
+         Commuting matrices `m, n` have the property that
+@@ -451,7 +452,6 @@ cdef class Matrix_symbolic_dense(Matrix_generic_dense):
+             [                       0 1/2*(e^(2*x) + 1)*e^(-x) 1/2*(e^(2*x) - 1)*e^(-x)                        0]
+             [                       0 1/2*(e^(2*x) - 1)*e^(-x) 1/2*(e^(2*x) + 1)*e^(-x)                        0]
+             [1/2*(e^(2*x) - 1)*e^(-x)                        0                        0 1/2*(e^(2*x) + 1)*e^(-x)]
+-
+         """
+         if not self.is_square():
+             raise ValueError("exp only defined on square matrices")
+diff --git a/src/sage/symbolic/integration/integral.py b/src/sage/symbolic/integration/integral.py
+index c82e9ed73c3..e84ad357ee2 100644
+--- a/src/sage/symbolic/integration/integral.py
++++ b/src/sage/symbolic/integration/integral.py
+@@ -741,14 +741,14 @@ def integrate(expression, v=None, a=None, b=None, algorithm=None, hold=False):
+ 
+         sage: _ = var('x,y')
+         sage: f = log(x^2+y^2)
+-        sage: res = integral(f,x,0.0001414, 1.); res
++        sage: res = integral(f,x,1414/10^7, 1); res
+         Traceback (most recent call last):
+         ...
+-        ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(50015104*y^2-50015103>0)', see `assume?` for more details)
+-        Is 50015104*y^2-50015103 positive, negative or zero?
++        ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help ...
++        Is ... positive, negative or zero?
+         sage: assume(y>1)
+-        sage: res = integral(f,x,0.0001414, 1.); res
+-        2*y*arctan(1.0/y) - 2*y*arctan(0.0001414/y) + 1.0*log(1.0*y^2 + 1.0) - 0.0001414*log(1.0*y^2 + 1.9993959999999997e-08) - 1.9997172
++        sage: res = integral(f,x,1414/10^7, 1); res
++        -2*y*arctan(707/5000000/y) + 2*y*arctan(1/y) + log(y^2 + 1) - 707/5000000*log(y^2 + 499849/25000000000000) - 4999293/2500000
+         sage: nres = numerical_integral(f.subs(y=2), 0.0001414, 1.); nres
+         (1.4638323264144..., 1.6251803529759...e-14)
+         sage: res.subs(y=2).n()
+diff --git a/src/sage/symbolic/relation.py b/src/sage/symbolic/relation.py
+index 94813315181..a72ab547c76 100644
+--- a/src/sage/symbolic/relation.py
++++ b/src/sage/symbolic/relation.py
+@@ -1787,8 +1787,8 @@ def solve_ineq_fourier(ineq, vars=None):
+         sage: y = var('y')
+         sage: solve_ineq_fourier([x+y<9,x-y>4],[x,y])
+         [[y + 4 < x, x < -y + 9, y < (5/2)]]
+-        sage: solve_ineq_fourier([x+y<9,x-y>4],[y,x])
+-        [[y < min(x - 4, -x + 9)]]
++        sage: solve_ineq_fourier([x+y<9,x-y>4],[y,x])[0][0](x=42)
++        y < -33
+ 
+         sage: solve_ineq_fourier([x^2>=0])
+         [[x < +Infinity]]
diff --git a/srcpkgs/sagemath/patches/35635-sympy_1.12.patch b/srcpkgs/sagemath/patches/35635-sympy_1.12.patch
new file mode 100644
index 000000000000..9cfc69c2adb6
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35635-sympy_1.12.patch
@@ -0,0 +1,54 @@
+diff --git a/src/sage/calculus/calculus.py b/src/sage/calculus/calculus.py
+index dae380180ac..ca3c59e63d2 100644
+--- a/src/sage/calculus/calculus.py
++++ b/src/sage/calculus/calculus.py
+@@ -1690,8 +1690,11 @@ def laplace(ex, t, s, algorithm='maxima'):
+ 
+     Testing SymPy::
+ 
+-        sage: laplace(t^n, t, s, algorithm='sympy')
+-        (gamma(n + 1)/(s*s^n), 0, re(n) > -1)
++        sage: F, a, cond = laplace(t^n, t, s, algorithm='sympy')
++        sage: a, cond
++        (0, re(n) > -1)
++        sage: F.simplify()
++        s^(-n - 1)*gamma(n + 1)
+ 
+     Testing Maxima::
+ 
+@@ -1700,17 +1703,19 @@ def laplace(ex, t, s, algorithm='maxima'):
+ 
+     Check that :trac:`24212` is fixed::
+ 
+-        sage: laplace(cos(t^2), t, s, algorithm='sympy')
+-        (-1/2*sqrt(pi)*(sqrt(2)*cos(1/4*s^2)*fresnel_sin(1/2*sqrt(2)*s/sqrt(pi)) -
+-        sqrt(2)*fresnel_cos(1/2*sqrt(2)*s/sqrt(pi))*sin(1/4*s^2) - cos(1/4*pi + 1/4*s^2)),
+-        0, True)
++        sage: F, a, cond = laplace(cos(t^2), t, s, algorithm='sympy')
++        sage: a, cond
++        (0, True)
++        sage: F._sympy_().simplify()
++        sqrt(pi)*(sqrt(2)*sin(s**2/4)*fresnelc(sqrt(2)*s/(2*sqrt(pi))) -
++        sqrt(2)*cos(s**2/4)*fresnels(sqrt(2)*s/(2*sqrt(pi))) + cos(s**2/4 + pi/4))/2
+ 
+     Testing result from SymPy that Sage doesn't know how to handle::
+ 
+         sage: laplace(cos(-1/t), t, s, algorithm='sympy')
+         Traceback (most recent call last):
+         ...
+-        AttributeError: Unable to convert SymPy result (=meijerg(((), ()), ((-1/2, 0, 1/2), (0,)), s**2/16)/4) into Sage
++        AttributeError: Unable to convert SymPy result (=meijerg(((), ()), ((-1/2, 0, 1/2), (0,)), ...)/4) into Sage
+     """
+     if not isinstance(ex, (Expression, Function)):
+         ex = SR(ex)
+@@ -1817,8 +1822,8 @@ def inverse_laplace(ex, s, t, algorithm='maxima'):
+ 
+     Transform an expression involving a time-shift, via SymPy::
+ 
+-        sage: inverse_laplace(1/s^2*exp(-s), s, t, algorithm='sympy')
+-        -(log(e^(-t)) + 1)*heaviside(t - 1)
++        sage: inverse_laplace(1/s^2*exp(-s), s, t, algorithm='sympy').simplify()
++        (t - 1)*heaviside(t - 1)
+ 
+     The same instance with Giac::
+ 
diff --git a/srcpkgs/sagemath/patches/35658-sphinx_7.patch b/srcpkgs/sagemath/patches/35658-sphinx_7.patch
new file mode 100644
index 000000000000..8593974bcc29
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35658-sphinx_7.patch
@@ -0,0 +1,141 @@
+diff --git a/src/sage_docbuild/conf.py b/src/sage_docbuild/conf.py
+index 740a37cf86f..e2355012f00 100644
+--- a/src/sage_docbuild/conf.py
++++ b/src/sage_docbuild/conf.py
+@@ -248,7 +248,7 @@ def set_intersphinx_mappings(app, config):
+         if os.path.isdir(os.path.join(invpath, directory)):
+             src = os.path.join(refpath, directory)
+             dst = os.path.join(invpath, directory, 'objects.inv')
+-            app.config.intersphinx_mapping[src] = dst
++            app.config.intersphinx_mapping[directory] = (src, dst)
+ 
+     intersphinx.normalize_intersphinx_mapping(app, config)
+ 
+diff --git a/src/sage_docbuild/ext/sage_autodoc.py b/src/sage_docbuild/ext/sage_autodoc.py
+index 14e272d992d..a6253d508fd 100644
+--- a/src/sage_docbuild/ext/sage_autodoc.py
++++ b/src/sage_docbuild/ext/sage_autodoc.py
+@@ -44,7 +44,6 @@
+ import sphinx
+ from sphinx.application import Sphinx
+ from sphinx.config import ENUM, Config
+-from sphinx.deprecation import RemovedInSphinx60Warning
+ from sphinx.environment import BuildEnvironment
+ from sphinx.ext.autodoc.importer import (get_class_members, get_object_members, import_module,
+                                          import_object)
+@@ -56,8 +55,11 @@
+ from sphinx.util.inspect import (evaluate_signature, getdoc, object_description, safe_getattr,
+                                  stringify_signature)
+ from sphinx.util.typing import OptionSpec, get_type_hints, restify
+-from sphinx.util.typing import stringify as stringify_typehint
+-
++try:
++    from sphinx.util.typing import stringify_annotation
++except ImportError:
++    from sphinx.util.typing import stringify as stringify_annotation
++    
+ # ------------------------------------------------------------------
+ from sage.misc.sageinspect import (sage_getdoc_original,
+                                    sage_getargspec, isclassinstance,
+@@ -645,34 +647,6 @@ def add_content(self, more_content: Optional[StringList]) -> None:
+             for line, src in zip(more_content.data, more_content.items):
+                 self.add_line(line, src[0], src[1])
+ 
+-    def get_object_members(self, want_all: bool) -> Tuple[bool, ObjectMembers]:
+-        """Return ``(members_check_module, members)`` where ``members`` is a
+-        list of ``(membername, member)`` pairs of the members of *self.object*.
+-
+-        If *want_all* is True, return all members.  Else, only return those
+-        members given by *self.options.members* (which may also be None).
+-        """
+-        warnings.warn('The implementation of Documenter.get_object_members() will be '
+-                      'removed from Sphinx-6.0.', RemovedInSphinx60Warning)
+-        members = get_object_members(self.object, self.objpath, self.get_attr, self.analyzer)
+-        if not want_all:
+-            if not self.options.members:
+-                return False, []  # type: ignore
+-            # specific members given
+-            selected = []
+-            for name in self.options.members:
+-                if name in members:
+-                    selected.append((name, members[name].value))
+-                else:
+-                    logger.warning(__('missing attribute %s in object %s') %
+-                                   (name, self.fullname), type='autodoc')
+-            return False, selected
+-        elif self.options.inherited_members:
+-            return False, [(m.name, m.value) for m in members.values()]
+-        else:
+-            return False, [(m.name, m.value) for m in members.values()
+-                           if m.directly_defined]
+-
+     def filter_members(self, members: ObjectMembers, want_all: bool
+                        ) -> List[Tuple[str, Any, bool]]:
+         """Filter the given member list.
+@@ -2050,9 +2024,9 @@ def update_content(self, more_content: StringList) -> None:
+             attrs = [repr(self.object.__name__)]
+             for constraint in self.object.__constraints__:
+                 if self.config.autodoc_typehints_format == "short":
+-                    attrs.append(stringify_typehint(constraint, "smart"))
++                    attrs.append(stringify_annotation(constraint, "smart"))
+                 else:
+-                    attrs.append(stringify_typehint(constraint))
++                    attrs.append(stringify_annotation(constraint))
+             if self.object.__bound__:
+                 if self.config.autodoc_typehints_format == "short":
+                     bound = restify(self.object.__bound__, "smart")
+@@ -2175,10 +2149,10 @@ def add_directive_header(self, sig: str) -> None:
+                                              self.config.autodoc_type_aliases)
+                 if self.objpath[-1] in annotations:
+                     if self.config.autodoc_typehints_format == "short":
+-                        objrepr = stringify_typehint(annotations.get(self.objpath[-1]),
++                        objrepr = stringify_annotation(annotations.get(self.objpath[-1]),
+                                                      "smart")
+                     else:
+-                        objrepr = stringify_typehint(annotations.get(self.objpath[-1]))
++                        objrepr = stringify_annotation(annotations.get(self.objpath[-1]))
+                     self.add_line('   :type: ' + objrepr, sourcename)
+ 
+             try:
+@@ -2494,16 +2468,6 @@ def get_doc(self) -> Optional[List[List[str]]]:
+         else:
+             return super().get_doc()  # type: ignore
+ 
+-    @property
+-    def _datadescriptor(self) -> bool:
+-        warnings.warn('AttributeDocumenter._datadescriptor() is deprecated.',
+-                      RemovedInSphinx60Warning)
+-        if self.object is SLOTSATTR:
+-            return True
+-        else:
+-            return False
+-
+-
+ class RuntimeInstanceAttributeMixin(DataDocumenterMixinBase):
+     """
+     Mixin for AttributeDocumenter to provide the feature for supporting runtime
+@@ -2756,10 +2720,10 @@ def add_directive_header(self, sig: str) -> None:
+                                              self.config.autodoc_type_aliases)
+                 if self.objpath[-1] in annotations:
+                     if self.config.autodoc_typehints_format == "short":
+-                        objrepr = stringify_typehint(annotations.get(self.objpath[-1]),
++                        objrepr = stringify_annotation(annotations.get(self.objpath[-1]),
+                                                      "smart")
+                     else:
+-                        objrepr = stringify_typehint(annotations.get(self.objpath[-1]))
++                        objrepr = stringify_annotation(annotations.get(self.objpath[-1]))
+                     self.add_line('   :type: ' + objrepr, sourcename)
+ 
+             try:
+@@ -2884,9 +2848,9 @@ def add_directive_header(self, sig: str) -> None:
+                                               type_aliases=self.config.autodoc_type_aliases)
+                 if signature.return_annotation is not Parameter.empty:
+                     if self.config.autodoc_typehints_format == "short":
+-                        objrepr = stringify_typehint(signature.return_annotation, "smart")
++                        objrepr = stringify_annotation(signature.return_annotation, "smart")
+                     else:
+-                        objrepr = stringify_typehint(signature.return_annotation)
++                        objrepr = stringify_annotation(signature.return_annotation)
+                     self.add_line('   :type: ' + objrepr, sourcename)
+             except TypeError as exc:
+                 logger.warning(__("Failed to get a function signature for %s: %s"),
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 871ae38577fd..fb13c7a9ac66 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 URL_BASE_PR="https://github.com/sagemath/sage/pull/"
-URL_BASE_COMPARE="https://github.com/sagemath/sage/compare/9.8..."
+URL_BASE_COMPARE="https://github.com/sagemath/sage/compare/10.0..."
 
 case "$1" in
 	-n)  DO=echo ;;
@@ -15,49 +15,14 @@ get_pr() {
 	$DO wget "$URL_BASE_PR$pr.$ext" -O "$pr-$desc.patch"
 }
 
-get_trac() {
-	ticket=$1
-	desc=$(echo "$2" | sed -e 's/ /_/g')
-	commit=$3
-	$DO wget "$URL_BASE_COMPARE$commit.diff" -O "$ticket-$desc-$commit.patch"
-}
-
 # run from patches dir
 cd $(dirname "$0")
 
-# merged in 10.0.beta0
-get_trac 34851 "support singular 4.3.1.p3" 5e5737a0c
-get_pr 35068 "fix tests giac 1.9.0.35" patch
-
-# merged in 10.0.beta1
-get_pr 35058 "skip unstable tests klyachko"
-
-# merged in 10.0.beta2
-get_pr 34994 "fix tests numpy 1.24"
-get_pr 34997 "fix edge case of integer_check"
-
-# merged in 10.0.beta3
-get_pr 34995 "support tachyon 0.99.2"
-
-# merged in 10.0.beta4
-get_pr 34980 "avoid factoring in is_prime"
-
-# merged in 10.0.beta5
-get_pr 35094 "support gap 4.12"					# includes PR 35093
-
-# merged in 10.0.beta6
-get_pr 35127 "fix very slow test stream.py"
-get_pr 35177 "matplotlib 3.7"
-get_pr 35195 "workaround ecl race"
-get_pr 35204 "fix sage-cleaner"
-
-# merged in 10.0.beta7
-get_pr 35250 "nauty 2.8.6"
-
-# merged in 10.0.beta8
-#get_pr 35337 "ipython 8.11"
-get_pr 35423 "ipython 8.12"						# includes PR 35337
-get_pr 35438 "pythran 0.12.1"
+# positive review
+get_pr 35584 "networkx 3.1"
+get_pr 35612 "linbox 1.7.0"
+get_pr 35635 "sympy 1.12"
 
 # needs review
-get_pr 35584 "networkx 3.1"
+get_pr 35619 "maxima 5.46.0"
+get_pr 35658 "sphinx 7"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 66a543efd21d..b8f892f4d19a 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=9.8
-revision=2
+version=10.0
+revision=1
 build_wrksrc=pkgs/sagemath-standard
 build_style=python3-module
 _bindir=/usr/lib/sagemath/$version/bin
@@ -32,7 +32,8 @@ maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-or-later"
 homepage="http://sagemath.org/"
 distfiles="https://github.com/sagemath/sage/archive/refs/tags/$version.tar.gz"
-checksum=2aff28bd1d18c2d526581f5298acb8336f5b92db5675a7403dec8eaf9a86bc4c
+checksum=60858efd0d1f2526486740962bf72c99f9141a56caf8395f3291fded276faf55
+nocross="due to ntl (flintlib), fflas-ffpack, givaro, linbox, cysignals, sympow, maxima"
 
 do_configure() {
 	# git tree needs bootstrapping

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] sagemath: update to 10.0.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (30 preceding siblings ...)
  2023-05-21 18:18 ` [PR PATCH] [Updated] " tornaria
@ 2023-05-21 22:37 ` tornaria
  2023-05-21 22:39 ` tornaria
                   ` (7 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: tornaria @ 2023-05-21 22:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1696 bytes --]

There is an updated pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages sagemath-next
https://github.com/void-linux/void-packages/pull/43659

[RFC] sagemath: update to 10.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

This builds on top of #43225 for convenience.

#### Testing the changes
- I tested the changes in this PR: **briefly**

I've been following beta releases and now rc0 includes all of our patches :muscle:

All doctests pass with the version of packages in void except for `python-Babel` which must be updated (as in #43497) and is included  here as part of #43225.

I've switched my system sagemath to this version as everything seems to be working ok. The testsuite is 10-15% faster.

@dkwo: enjoy.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/43659.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-sagemath-next-43659.patch --]
[-- Type: text/x-diff, Size: 183196 bytes --]

From f1093e3bda16f481310d6db14fbcb1bdd1f9149c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Dec 2021 20:20:09 -0300
Subject: [PATCH 1/5] givaro: update to 4.2.0.

---
 srcpkgs/givaro/patches/197.patch | 28 ++++++++++++++++++++++++++++
 srcpkgs/givaro/template          |  9 ++++-----
 2 files changed, 32 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/givaro/patches/197.patch

diff --git a/srcpkgs/givaro/patches/197.patch b/srcpkgs/givaro/patches/197.patch
new file mode 100644
index 000000000000..bafaff3efbd9
--- /dev/null
+++ b/srcpkgs/givaro/patches/197.patch
@@ -0,0 +1,28 @@
+From ab3d332508c21daff41fb64a8658cdc7cc74fc47 Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
+Date: Thu, 16 Dec 2021 17:12:25 +0100
+Subject: [PATCH] dom_power argument is now an uint64_t to avoid problem with
+ 32bit machine
+
+---
+ src/kernel/system/givpower.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/kernel/system/givpower.h b/src/kernel/system/givpower.h
+index eb784872..5644264d 100644
+--- a/src/kernel/system/givpower.h
++++ b/src/kernel/system/givpower.h
+@@ -71,11 +71,11 @@ namespace Givaro {
+ 
+     //! dom_power
+     template<class D, class TT>
+-    TT& dom_power(TT& res, const TT& n, long l, const D& F)
++    TT& dom_power(TT& res, const TT& n, uint64_t l, const D& F)
+     {
+         if (l == 0) return F.assign(res,F.one) ;
+ 
+-        unsigned long p = (unsigned long) l ;
++        uint64_t p = l;
+         bool is_assg = false ;
+ 
+         TT puiss; F.init(puiss); F.assign(puiss,n) ;
diff --git a/srcpkgs/givaro/template b/srcpkgs/givaro/template
index 9c16de5b1974..52457c02a1ed 100644
--- a/srcpkgs/givaro/template
+++ b/srcpkgs/givaro/template
@@ -1,6 +1,6 @@
 # Template file for 'givaro'
 pkgname=givaro
-version=4.1.1
+version=4.2.0
 revision=1
 build_style=gnu-configure
 makedepends="gmpxx-devel"
@@ -8,16 +8,15 @@ short_desc="C++ library for arithmetic and algebraic computations"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="CECILL-B"
 homepage="https://github.com/linbox-team/givaro"
+changelog="https://github.com/linbox-team/givaro/raw/master/ChangeLog"
 distfiles="https://github.com/linbox-team/givaro/releases/download/v${version}/givaro-${version}.tar.gz"
-checksum=628049899386e91da245aee6cd446350fbca87e94863bc0d815066c08150487f
+checksum=865e228812feca971dfb6e776a7bc7ac959cf63ebd52b4f05492730a46e1f189
 nocross=yes
 
 build_options="native_build"
 
 if [ -z "$build_option_native_build" ]; then
-	configure_args="--enable-sse --enable-sse2
-	  --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42
-	  --disable-avx --disable-avx2 --disable-fma --disable-fma4"
+	configure_args="--without-archnative"
 fi
 
 post_install() {

From 7e656abf21dd10d2f32fd611331ab2a663e0afae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Dec 2021 20:20:17 -0300
Subject: [PATCH 2/5] fflas-ffpack: update to 2.5.0.

---
 srcpkgs/fflas-ffpack/patches/357.patch | 35 ++++++++++++++++++++++++++
 srcpkgs/fflas-ffpack/template          | 12 ++++-----
 2 files changed, 40 insertions(+), 7 deletions(-)
 create mode 100644 srcpkgs/fflas-ffpack/patches/357.patch

diff --git a/srcpkgs/fflas-ffpack/patches/357.patch b/srcpkgs/fflas-ffpack/patches/357.patch
new file mode 100644
index 000000000000..99fd34efd93b
--- /dev/null
+++ b/srcpkgs/fflas-ffpack/patches/357.patch
@@ -0,0 +1,35 @@
+From 9b6083c663096e9ca85775b79f1f27c848dbeb98 Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
+Date: Fri, 17 Dec 2021 10:27:02 +0100
+Subject: [PATCH] Fix SimdChooser: on not x86_64 machines its value could be an
+ nonexistant struct
+
+---
+ fflas-ffpack/fflas/fflas_simd.h | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/fflas-ffpack/fflas/fflas_simd.h b/fflas-ffpack/fflas/fflas_simd.h
+index bf5d30211..84ced0fd8 100644
+--- a/fflas-ffpack/fflas/fflas_simd.h
++++ b/fflas-ffpack/fflas/fflas_simd.h
+@@ -384,6 +384,20 @@ struct SimdChooser<T, true, true> // integral number
+ #endif
+ };
+ 
++#ifndef __x86_64__
++template <>
++struct SimdChooser<uint64_t, true, true>
++{
++    using value = NoSimd<uint64_t>;
++};
++
++template <>
++struct SimdChooser<int64_t, true, true>
++{
++    using value = NoSimd<int64_t>;
++};
++#endif
++
+ template <class T> using Simd = typename SimdChooser<T>::value;
+ 
+ // template <class T> struct SimdChooser<T, true> {
diff --git a/srcpkgs/fflas-ffpack/template b/srcpkgs/fflas-ffpack/template
index 557c644c00a4..2aa599703585 100644
--- a/srcpkgs/fflas-ffpack/template
+++ b/srcpkgs/fflas-ffpack/template
@@ -1,6 +1,6 @@
 # Template file for 'fflas-ffpack'
 pkgname=fflas-ffpack
-version=2.4.3
+version=2.5.0
 revision=1
 build_style=gnu-configure
 hostmakedepends="pkg-config"
@@ -10,15 +10,13 @@ short_desc="Finite Field Linear Algebra Subroutines / Package"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="LGPL-2.1-or-later"
 homepage="http://linbox-team.github.io/fflas-ffpack/"
-distfiles="https://github.com/linbox-team/fflas-ffpack/releases/download/${version}/fflas-ffpack-${version}.tar.gz"
-checksum=f372783a17a9899ee9f88d4c9421d80facccb95556146dad7020d07a03791cc9
+changelog="https://github.com/linbox-team/fflas-ffpack/raw/master/ChangeLog"
+distfiles="https://github.com/linbox-team/fflas-ffpack/releases/download/v${version}/fflas-ffpack-${version}.tar.gz"
+checksum=dafb4c0835824d28e4f823748579be6e4c8889c9570c6ce9cce1e186c3ebbb23
 nocross=yes
 
 build_options="native_build"
 
 if [ -z "$build_option_native_build" ]; then
-	configure_args="--enable-sse --enable-sse2
-	  --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42
-	  --disable-avx --disable-avx2 --disable-fma --disable-fma4
-	  --disable-avx512f --disable-avx512dq --disable-avx512vl"
+	configure_args="--without-archnative"
 fi

From 6abb23e5b351856e89445b095f1a1dbaf1607aab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Dec 2021 20:20:20 -0300
Subject: [PATCH 3/5] linbox: update to 1.7.0.

---
 srcpkgs/linbox/patches/292.patch              | 24 ++++++++++++
 srcpkgs/linbox/patches/294.patch              | 38 +++++++++++++++++++
 ...8adade10641f1f04f04b589753d928fb5443.patch | 35 -----------------
 .../remove-linboxsage-libs-from-pc.patch      | 23 -----------
 srcpkgs/linbox/template                       | 11 +++---
 5 files changed, 67 insertions(+), 64 deletions(-)
 create mode 100644 srcpkgs/linbox/patches/292.patch
 create mode 100644 srcpkgs/linbox/patches/294.patch
 delete mode 100644 srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch
 delete mode 100644 srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch

diff --git a/srcpkgs/linbox/patches/292.patch b/srcpkgs/linbox/patches/292.patch
new file mode 100644
index 000000000000..d3333cc23d0b
--- /dev/null
+++ b/srcpkgs/linbox/patches/292.patch
@@ -0,0 +1,24 @@
+From 49b9cccd0286980c1c1811c3b03df883ef0164df Mon Sep 17 00:00:00 2001
+From: Doug Torrance <dtorrance@piedmont.edu>
+Date: Tue, 14 Dec 2021 16:22:33 -0500
+Subject: [PATCH] Only register uint128_t as a TypeName when it's available.
+
+Otherwise, test-fft will fail when it isn't.
+---
+ tests/test-fft.C | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/tests/test-fft.C b/tests/test-fft.C
+index d19184c2d..5811ebc5d 100644
+--- a/tests/test-fft.C
++++ b/tests/test-fft.C
+@@ -55,7 +55,9 @@ REGISTER_TYPE_NAME(double);
+ REGISTER_TYPE_NAME(uint16_t);
+ REGISTER_TYPE_NAME(uint32_t);
+ REGISTER_TYPE_NAME(uint64_t);
++#ifdef __FFLASFFPACK_HAVE_INT128
+ REGISTER_TYPE_NAME(uint128_t);
++#endif
+ REGISTER_TYPE_NAME(Modular);
+ REGISTER_TYPE_NAME(ModularExtended);
+ 
diff --git a/srcpkgs/linbox/patches/294.patch b/srcpkgs/linbox/patches/294.patch
new file mode 100644
index 000000000000..7c645f165d39
--- /dev/null
+++ b/srcpkgs/linbox/patches/294.patch
@@ -0,0 +1,38 @@
+From f81a1f4a5e0835b7a0f3bb88a0fcbbaa32174cfa Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
+Date: Wed, 15 Dec 2021 16:00:39 +0100
+Subject: [PATCH] Only register uint128_t as a TypeName when it's available
+
+---
+ benchmarks/benchmark-fft.C                       | 2 ++
+ benchmarks/benchmark-polynomial-matrix-mul-fft.C | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/benchmarks/benchmark-fft.C b/benchmarks/benchmark-fft.C
+index 39b86c9d9..59a8be57c 100644
+--- a/benchmarks/benchmark-fft.C
++++ b/benchmarks/benchmark-fft.C
+@@ -54,7 +54,9 @@ REGISTER_TYPE_NAME(double);
+ REGISTER_TYPE_NAME(uint16_t);
+ REGISTER_TYPE_NAME(uint32_t);
+ REGISTER_TYPE_NAME(uint64_t);
++#ifdef __FFLASFFPACK_HAVE_INT128
+ REGISTER_TYPE_NAME(uint128_t);
++#endif
+ REGISTER_TYPE_NAME(Modular);
+ REGISTER_TYPE_NAME(ModularExtended);
+ 
+diff --git a/benchmarks/benchmark-polynomial-matrix-mul-fft.C b/benchmarks/benchmark-polynomial-matrix-mul-fft.C
+index e9b184bcf..7bf17f33e 100644
+--- a/benchmarks/benchmark-polynomial-matrix-mul-fft.C
++++ b/benchmarks/benchmark-polynomial-matrix-mul-fft.C
+@@ -65,7 +65,9 @@ REGISTER_TYPE_NAME(double);
+ REGISTER_TYPE_NAME(uint16_t);
+ REGISTER_TYPE_NAME(uint32_t);
+ REGISTER_TYPE_NAME(uint64_t);
++#ifdef __FFLASFFPACK_HAVE_INT128
+ REGISTER_TYPE_NAME(uint128_t);
++#endif
+ REGISTER_TYPE_NAME(Modular);
+ REGISTER_TYPE_NAME(ModularExtended);
+ 
diff --git a/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch b/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch
deleted file mode 100644
index 5afa078ec7b8..000000000000
--- a/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 892f8adade10641f1f04f04b589753d928fb5443 Mon Sep 17 00:00:00 2001
-From: Doug Torrance <dtorrance@piedmont.edu>
-Date: Sun, 9 May 2021 12:14:19 -0400
-Subject: [PATCH] Use std::ptrdiff_t for vector iterator difference type
-
-It was previously long (64-bit integers), but this will not be the
-case on 32-bit systems.
-
-Closes: #273
----
- linbox/vector/bit-vector.inl | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/linbox/vector/bit-vector.inl b/linbox/vector/bit-vector.inl
-index 5fa84b421..23a22ba47 100644
---- a/linbox/vector/bit-vector.inl
-+++ b/linbox/vector/bit-vector.inl
-@@ -46,7 +46,7 @@ namespace std
- 		typedef LinBox::BitVector::reference reference;
- 		typedef bool *pointer;
- 		typedef bool value_type;
--		typedef long difference_type;
-+		typedef std::ptrdiff_t difference_type;
- 	};
- 
- 	template <>
-@@ -56,7 +56,7 @@ namespace std
- 		typedef LinBox::BitVector::const_reference reference;
- 		typedef const bool *pointer;
- 		typedef bool value_type;
--		typedef long difference_type;
-+		typedef std::ptrdiff_t difference_type;
- 	};
- }
- 
diff --git a/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch b/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch
deleted file mode 100644
index c93915fb1b06..000000000000
--- a/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Backported from:
-
-From 426eb97ba762c7663884f57ead0909f2aa3cd6a5 Mon Sep 17 00:00:00 2001
-From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
-Date: Thu, 17 Jan 2019 16:32:19 +0100
-Subject: [PATCH] Remove @LINBOXSAGE_LIBS@ from linbox.pc.in
-
----
- linbox.pc.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/linbox.pc.in b/linbox.pc.in
-index 278f127e4..c6b8091eb 100644
---- a/linbox.pc.in
-+++ b/linbox.pc.in
-@@ -9,6 +9,6 @@ Description: Exact Linear Algebra library
- URL: http://github.com/linbox-team/linbox
- Version: @VERSION@
- Requires: fflas-ffpack >= 2.4.0, givaro >= 4.1.0
--Libs: -L${libdir} -llinbox @LINBOXSAGE_LIBS@ @NTL_LIBS@ @MPFR_LIBS@ @FPLLL_LIBS@ @IML_LIBS@ @FLINT_LIBS@ @OCL_LIBS@
-+Libs: -L${libdir} -llinbox @NTL_LIBS@ @MPFR_LIBS@ @FPLLL_LIBS@ @IML_LIBS@ @FLINT_LIBS@ @OCL_LIBS@
- Cflags: @DEFAULT_CFLAGS@ -DDISABLE_COMMENTATOR -I${includedir} @NTL_CFLAGS@ @MPFR_CFLAGS@ @FPLLL_CFLAGS@  @IML_CFLAGS@ @FLINT_CFLAGS@ 
- \-------------------------------------------------------
diff --git a/srcpkgs/linbox/template b/srcpkgs/linbox/template
index 096a15b3390b..e6edacdd0a74 100644
--- a/srcpkgs/linbox/template
+++ b/srcpkgs/linbox/template
@@ -1,7 +1,7 @@
 # Template file for 'linbox'
 pkgname=linbox
-version=1.6.3
-revision=2
+version=1.7.0
+revision=1
 build_style=gnu-configure
 hostmakedepends="pkg-config"
 makedepends="fflas-ffpack"
@@ -9,16 +9,15 @@ short_desc="C++ library for exact, high-performance linear algebra"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="LGPL-2.1-or-later"
 homepage="https://linalg.org"
+changelog="https://github.com/linbox-team/linbox/raw/master/ChangeLog"
 distfiles="https://github.com/linbox-team/linbox/releases/download/v${version}/linbox-${version}.tar.gz"
-checksum=a58a188307b07c57964e844bceb99321d3043a8a4a1fccc082a54928bb9a0057
+checksum=6d2159fd395be0298362dd37f6c696676237bc8e2757341fbc46520e3b466bcc
 nocross=yes
 
 build_options="native_build"
 
 if [ -z "$build_option_native_build" ]; then
-	configure_args="--enable-sse --enable-sse2
-	  --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42
-	  --disable-avx --disable-avx2 --disable-fma --disable-fma4"
+	configure_args="--without-archnative"
 fi
 
 linbox-devel_package() {

From 4141aa1981dfc4ce5507e53cd8981e6e4efbeda6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Fri, 15 Apr 2022 14:25:08 -0300
Subject: [PATCH 4/5] maxima: update to 5.46.0, adopt.

Also:
 - disable sbcl on aarch64
 - don't makedepends on emacs (avoid a nocross build dep)
 - move maxima-emacs files to main pkg
---
 ...a43e5234305bd6f1de5909d4ce5d7e1ea864.patch | 24 -------------------
 srcpkgs/maxima/template                       | 20 ++++++++--------
 2 files changed, 10 insertions(+), 34 deletions(-)
 delete mode 100644 srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch

diff --git a/srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch b/srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch
deleted file mode 100644
index e1ac1e5f6086..000000000000
--- a/srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-commit a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864
-Author: Robert Dodier <robert_dodier@users.sourceforge.net>
-Date:   Mon Oct 11 22:40:13 2021 -0700
-
-    Apply patch #80: "Build a FASL library, needed by SageMath"
-    
-    This modifies maxima.system for ECL only.
-
-diff --git a/src/maxima.system b/src/maxima.system
-index d954bc2b9..525fb778e 100644
---- a/src/maxima.system
-+++ b/src/maxima.system
-@@ -75,6 +75,11 @@
- 			     ;; Convert dir/foo.fas to dir/foo.o
- 			     (make-pathname :type "o" :defaults p))
- 			 files)))
-+	(c::build-fasl "binary-ecl/maxima" :lisp-files obj
-+			  :ld-flags
-+			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
-+							      (find-package "MAXIMA")))))
-+			    (if (and x (not (string= x ""))) (list x))))
- 	(c::build-program "binary-ecl/maxima" :lisp-files obj
- 			  :ld-flags
- 			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
diff --git a/srcpkgs/maxima/template b/srcpkgs/maxima/template
index 69e85ec833e8..f67b469e3dda 100644
--- a/srcpkgs/maxima/template
+++ b/srcpkgs/maxima/template
@@ -1,19 +1,21 @@
 # Template file for 'maxima'
 pkgname=maxima
-version=5.45.1
-revision=4
+version=5.46.0
+revision=1
 build_style=gnu-configure
 configure_args="$(vopt_enable clisp) $(vopt_enable sbcl sbcl-exec) $(vopt_enable ecl)"
-hostmakedepends="python3 perl emacs texinfo patchelf"
+hostmakedepends="python3 perl texinfo patchelf $(vopt_if ecl ecl)"
 makedepends="$(vopt_if clisp clisp) $(vopt_if sbcl sbcl) $(vopt_if ecl ecl)"
 depends="$(vopt_if clisp clisp) rlwrap"
 checkdepends="gnuplot"
 short_desc="Computer Algebra System"
-maintainer="Bosco Garcia <jboscogg@gmail.org>"
+maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-only"
 homepage="http://maxima.sourceforge.net"
+changelog="https://sourceforge.net/p/maxima/code/ci/master/tree/changelogs/ChangeLog-${version%.*}.md?format=raw"
 distfiles="${SOURCEFORGE_SITE}/maxima/maxima-${version}.tar.gz"
-checksum=fe9016276970bef214a1a244348558644514d7fdfaa4fc8b9d0e87afcbb4e7dc
+checksum=7390f06b48da65c9033e8b2f629b978b90056454a54022db7de70e2225aa8b07
+nocross=yes
 
 # maxima-sbcl is nopie and should NOT be stripped or it won't work
 nostrip_files=/usr/lib/maxima/$version/binary-sbcl/maxima
@@ -32,7 +34,7 @@ build_options_default="ecl"
 
 # sbcl is only available for these architectures
 case "$XBPS_TARGET_MACHINE" in
-	i686|x86_64*|armv7l|aarch64|ppc64le*)
+	i686|x86_64*|armv7l|ppc64le*)
 		build_options_default+=" sbcl"
 		;;
 esac
@@ -113,11 +115,9 @@ maxima-src_package() {
 }
 
 maxima-emacs_package() {
-	short_desc+=" - Emacs interface"
+	short_desc+=" - transitional dummy package"
 	depends="${sourcepkg}-${version}_${revision} virtual?emacs"
-	pkg_install() {
-		vmove usr/share/emacs
-	}
+	build_style=meta
 }
 
 xmaxima_package() {

From 47836b0d0f5b059bee79b32cdd78773a0443e0d0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Feb 2023 22:53:33 -0300
Subject: [PATCH 5/5] sagemath: update to 10.0.

Also:
 - support networkx 3.1 (sagemath#35584)
 - support linbox 1.7.0 (sagemath#35612)
 - support maxima 5.46.0 (sagemath#35619)
 - support sympy 1.12 (sagemath#35635)
---
 srcpkgs/sagemath/files/sage_conf.py           |    1 -
 srcpkgs/sagemath/files/timings2.json          |  405 ++---
 ...-support_singular_4.3.1.p3-5e5737a0c.patch |  205 ---
 .../34980-avoid_factoring_in_is_prime.patch   |   49 -
 .../patches/34994-fix_tests_numpy_1.24.patch  |   58 -
 .../34995-support_tachyon_0.99.2.patch        |   57 -
 ...34997-fix_edge_case_of_integer_check.patch |   36 -
 .../35058-skip_unstable_tests_klyachko.patch  |   22 -
 .../35068-fix_tests_giac_1.9.0.35.patch       |   62 -
 .../patches/35094-support_gap_4.12.patch      | 1303 -----------------
 .../35127-fix_very_slow_test_stream.py.patch  |   15 -
 .../patches/35177-matplotlib_3.7.patch        |   95 --
 .../patches/35195-workaround_ecl_race.patch   |   56 -
 .../patches/35204-fix_sage-cleaner.patch      |   28 -
 .../sagemath/patches/35250-nauty_2.8.6.patch  |   35 -
 .../sagemath/patches/35423-ipython_8.12.patch |   51 -
 .../patches/35438-pythran_0.12.1.patch        |   41 -
 .../sagemath/patches/35584-networkx_3.1.patch |   35 +-
 .../sagemath/patches/35612-linbox_1.7.0.patch |   64 +
 .../patches/35619-maxima_5.46.0.patch         |  569 +++++++
 .../sagemath/patches/35635-sympy_1.12.patch   |   54 +
 srcpkgs/sagemath/patches/get_patches          |   48 +-
 srcpkgs/sagemath/template                     |    8 +-
 23 files changed, 828 insertions(+), 2469 deletions(-)
 delete mode 100644 srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
 delete mode 100644 srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
 delete mode 100644 srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
 delete mode 100644 srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
 delete mode 100644 srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
 delete mode 100644 srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
 delete mode 100644 srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
 delete mode 100644 srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
 delete mode 100644 srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
 delete mode 100644 srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
 delete mode 100644 srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
 delete mode 100644 srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
 delete mode 100644 srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
 delete mode 100644 srcpkgs/sagemath/patches/35423-ipython_8.12.patch
 delete mode 100644 srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
 create mode 100644 srcpkgs/sagemath/patches/35612-linbox_1.7.0.patch
 create mode 100644 srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch
 create mode 100644 srcpkgs/sagemath/patches/35635-sympy_1.12.patch

diff --git a/srcpkgs/sagemath/files/sage_conf.py b/srcpkgs/sagemath/files/sage_conf.py
index 00de40f1ee4f..bc5388de8956 100644
--- a/srcpkgs/sagemath/files/sage_conf.py
+++ b/srcpkgs/sagemath/files/sage_conf.py
@@ -1,4 +1,3 @@
 # configuration for sage on void linux
 SAGE_SHARE = "/usr/share/sagemath"
 GAP_SHARE_DIR = "/usr/share/gap"
-GAP_LIB_DIR = "/usr/lib/gap"
diff --git a/srcpkgs/sagemath/files/timings2.json b/srcpkgs/sagemath/files/timings2.json
index bb3098680502..b2b3fe818a20 100644
--- a/srcpkgs/sagemath/files/timings2.json
+++ b/srcpkgs/sagemath/files/timings2.json
@@ -1,281 +1,152 @@
 {
-  "doc.ca.intro.index": {"walltime": 8},
-  "doc.en.constructions.calculus": {"walltime": 64},
-  "doc.en.constructions.plotting": {"walltime": 32},
-  "doc.en.prep.Advanced-2DPlotting": {"walltime": 16},
-  "doc.en.prep.Calculus": {"walltime": 8},
-  "doc.en.prep.Symbolics-and-Basic-Plotting": {"walltime": 8},
-  "doc.en.thematic_tutorials.explicit_methods_in_number_theory.birds_other": {"walltime": 8},
-  "doc.en.thematic_tutorials.explicit_methods_in_number_theory.elliptic_curves": {"walltime": 8},
-  "doc.en.thematic_tutorials.geometry.polyhedra_tutorial": {"walltime": 16},
-  "doc.en.thematic_tutorials.sandpile": {"walltime": 16},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_advanced": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_cartesian": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_change": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_curvilinear": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_plane": {"walltime": 16},
-  "doc.ja.tutorial.tour_plotting": {"walltime": 8},
-  "sage.algebras.cluster_algebra": {"walltime": 8},
   "sage.algebras.commutative_dga": {"walltime": 16},
-  "sage.algebras.hecke_algebras.ariki_koike_algebra": {"walltime": 8},
-  "sage.algebras.iwahori_hecke_algebra": {"walltime": 8},
-  "sage.algebras.lie_algebras.classical_lie_algebra": {"walltime": 128},
-  "sage.algebras.lie_algebras.nilpotent_lie_algebra": {"walltime": 16},
-  "sage.algebras.quantum_clifford": {"walltime": 16},
-  "sage.algebras.quantum_groups.fock_space": {"walltime": 8},
-  "sage.algebras.quatalg.quaternion_algebra": {"walltime": 8},
-  "sage.algebras.steenrod.steenrod_algebra": {"walltime": 64},
-  "sage.algebras.steenrod.steenrod_algebra_bases": {"walltime": 8},
-  "sage.algebras.yangian": {"walltime": 8},
-  "sage.arith.misc": {"walltime": 32},
+  "sage.algebras.fusion_rings.f_matrix": {"walltime": 16},
+  "sage.algebras.fusion_rings.fusion_ring": {"walltime": 16},
+  "sage.algebras.hecke_algebras.cubic_hecke_algebra": {"walltime": 8},
+  "sage.algebras.lie_conformal_algebras.n2_lie_conformal_algebra": {"walltime": 8},
+  "sage.algebras.quantum_clifford": {"walltime": 8},
+  "sage.algebras.steenrod.steenrod_algebra": {"walltime": 8},
   "sage.calculus.calculus": {"walltime": 16},
   "sage.calculus.desolvers": {"walltime": 8},
-  "sage.calculus.functional": {"walltime": 8},
-  "sage.calculus.riemann": {"walltime": 64},
-  "sage.calculus.tests": {"walltime": 16},
-  "sage.calculus.transforms.dwt": {"walltime": 16},
+  "sage.calculus.riemann": {"walltime": 8},
   "sage.calculus.transforms.fft": {"walltime": 8},
   "sage.categories.coxeter_groups": {"walltime": 8},
-  "sage.categories.finite_monoids": {"walltime": 16},
-  "sage.categories.lie_conformal_algebras": {"walltime": 8},
+  "sage.categories.finite_monoids": {"walltime": 8},
   "sage.categories.loop_crystals": {"walltime": 8},
-  "sage.categories.pushout": {"walltime": 8},
-  "sage.categories.super_hopf_algebras_with_basis": {"walltime": 32},
-  "sage.categories.super_lie_conformal_algebras": {"walltime": 8},
-  "sage.coding.ag_code": {"walltime": 64},
-  "sage.coding.ag_code_decoders": {"walltime": 128},
-  "sage.coding.binary_code": {"walltime": 8},
-  "sage.coding.linear_code": {"walltime": 16},
-  "sage.combinat.backtrack": {"walltime": 32},
-  "sage.combinat.chas.wqsym": {"walltime": 32},
-  "sage.combinat.cluster_algebra_quiver.cluster_seed": {"walltime": 64},
-  "sage.combinat.cluster_algebra_quiver.quiver": {"walltime": 128},
-  "sage.combinat.crystals.affine_factorization": {"walltime": 16},
-  "sage.combinat.crystals.alcove_path": {"walltime": 32},
-  "sage.combinat.crystals.highest_weight_crystals": {"walltime": 8},
-  "sage.combinat.crystals.kirillov_reshetikhin": {"walltime": 16},
-  "sage.combinat.crystals.letters": {"walltime": 8},
-  "sage.combinat.crystals.littelmann_path": {"walltime": 16},
-  "sage.combinat.crystals.mv_polytopes": {"walltime": 16},
-  "sage.combinat.crystals.pbw_crystal": {"walltime": 16},
-  "sage.combinat.crystals.star_crystal": {"walltime": 8},
-  "sage.combinat.designs.bibd": {"walltime": 8},
-  "sage.combinat.designs.database": {"walltime": 16},
+  "sage.coding.ag_code": {"walltime": 32},
+  "sage.coding.ag_code_decoders": {"walltime": 32},
+  "sage.coding.linear_code": {"walltime": 32},
+  "sage.combinat.designs.database": {"walltime": 8},
   "sage.combinat.designs.difference_family": {"walltime": 8},
-  "sage.combinat.designs.gen_quadrangles_with_spread": {"walltime": 128},
-  "sage.combinat.designs.orthogonal_arrays_build_recursive": {"walltime": 16},
-  "sage.combinat.designs.orthogonal_arrays_find_recursive": {"walltime": 8},
-  "sage.combinat.diagram_algebras": {"walltime": 64},
-  "sage.combinat.fqsym": {"walltime": 32},
-  "sage.combinat.free_prelie_algebra": {"walltime": 8},
-  "sage.combinat.fully_commutative_elements": {"walltime": 8},
-  "sage.combinat.grossman_larson_algebras": {"walltime": 8},
-  "sage.combinat.interval_posets": {"walltime": 8},
+  "sage.combinat.designs.orthogonal_arrays_build_recursive": {"walltime": 8},
   "sage.combinat.k_regular_sequence": {"walltime": 8},
   "sage.combinat.k_tableau": {"walltime": 16},
   "sage.combinat.matrices.hadamard_matrix": {"walltime": 8},
   "sage.combinat.multiset_partition_into_sets_ordered": {"walltime": 8},
-  "sage.combinat.ncsf_qsym.ncsf": {"walltime": 16},
-  "sage.combinat.ncsf_qsym.qsym": {"walltime": 16},
-  "sage.combinat.partition": {"walltime": 16},
-  "sage.combinat.partition_kleshchev": {"walltime": 16},
+  "sage.combinat.ncsf_qsym.ncsf": {"walltime": 8},
+  "sage.combinat.ncsf_qsym.qsym": {"walltime": 8},
+  "sage.combinat.partition": {"walltime": 8},
   "sage.combinat.partition_tuple": {"walltime": 8},
-  "sage.combinat.posets.moebius_algebra": {"walltime": 16},
+  "sage.combinat.permutation": {"walltime": 8},
   "sage.combinat.posets.posets": {"walltime": 8},
-  "sage.combinat.rigged_configurations.kr_tableaux": {"walltime": 32},
-  "sage.combinat.rigged_configurations.rigged_configurations": {"walltime": 16},
-  "sage.combinat.rigged_configurations.tensor_product_kr_tableaux": {"walltime": 16},
+  "sage.combinat.rigged_configurations.kr_tableaux": {"walltime": 8},
   "sage.combinat.root_system.associahedron": {"walltime": 8},
-  "sage.combinat.root_system.branching_rules": {"walltime": 8},
-  "sage.combinat.root_system.fusion_ring": {"walltime": 8},
-  "sage.combinat.root_system.integrable_representations": {"walltime": 16},
-  "sage.combinat.root_system.non_symmetric_macdonald_polynomials": {"walltime": 16},
-  "sage.combinat.root_system.pieri_factors": {"walltime": 8},
-  "sage.combinat.root_system.plot": {"walltime": 32},
-  "sage.combinat.root_system.root_lattice_realization_algebras": {"walltime": 16},
-  "sage.combinat.root_system.root_lattice_realizations": {"walltime": 16},
-  "sage.combinat.root_system.root_system": {"walltime": 8},
-  "sage.combinat.root_system.weyl_group": {"walltime": 8},
-  "sage.combinat.rsk": {"walltime": 32},
-  "sage.combinat.sf.classical": {"walltime": 16},
-  "sage.combinat.sf.jack": {"walltime": 16},
-  "sage.combinat.sf.k_dual": {"walltime": 16},
-  "sage.combinat.sf.llt": {"walltime": 16},
-  "sage.combinat.sf.macdonald": {"walltime": 64},
-  "sage.combinat.sf.new_kschur": {"walltime": 8},
-  "sage.combinat.sf.sfa": {"walltime": 32},
-  "sage.combinat.shifted_primed_tableau": {"walltime": 16},
+  "sage.combinat.root_system.non_symmetric_macdonald_polynomials": {"walltime": 8},
+  "sage.combinat.root_system.plot": {"walltime": 16},
+  "sage.combinat.root_system.root_lattice_realizations": {"walltime": 8},
+  "sage.combinat.rsk": {"walltime": 8},
+  "sage.combinat.sf.k_dual": {"walltime": 8},
+  "sage.combinat.sf.sf": {"walltime": 8},
+  "sage.combinat.sf.sfa": {"walltime": 8},
+  "sage.combinat.shifted_primed_tableau": {"walltime": 8},
   "sage.combinat.skew_tableau": {"walltime": 8},
-  "sage.combinat.symmetric_group_algebra": {"walltime": 16},
-  "sage.combinat.tableau": {"walltime": 32},
-  "sage.combinat.tableau_tuple": {"walltime": 32},
-  "sage.combinat.tiling": {"walltime": 16},
-  "sage.combinat.tutorial": {"walltime": 16},
-  "sage.combinat.words.paths": {"walltime": 64},
-  "sage.crypto.block_cipher.des": {"walltime": 16},
-  "sage.crypto.mq.sr": {"walltime": 64},
-  "sage.crypto.sbox": {"walltime": 16},
+  "sage.combinat.species.generating_series": {"walltime": 8},
+  "sage.combinat.tableau": {"walltime": 8},
+  "sage.combinat.tableau_tuple": {"walltime": 8},
+  "sage.combinat.tiling": {"walltime": 8},
+  "sage.combinat.tutorial": {"walltime": 8},
   "sage.crypto.sboxes": {"walltime": 8},
   "sage.doctest.forker": {"walltime": 16},
-  "sage.doctest.sources": {"walltime": 64},
-  "sage.doctest.test": {"walltime": 128},
-  "sage.dynamics.arithmetic_dynamics.projective_ds": {"walltime": 64},
-  "sage.dynamics.arithmetic_dynamics.wehlerK3": {"walltime": 8},
-  "sage.dynamics.cellular_automata.glca": {"walltime": 8},
+  "sage.dynamics.arithmetic_dynamics.projective_ds": {"walltime": 32},
   "sage.dynamics.cellular_automata.solitons": {"walltime": 8},
-  "sage.dynamics.complex_dynamics.mandel_julia": {"walltime": 16},
   "sage.functions.bessel": {"walltime": 16},
-  "sage.functions.exp_integral": {"walltime": 8},
   "sage.functions.hypergeometric": {"walltime": 8},
+  "sage.functions.orthogonal_polys": {"walltime": 8},
   "sage.functions.other": {"walltime": 16},
   "sage.functions.piecewise": {"walltime": 8},
-  "sage.games.quantumino": {"walltime": 8},
-  "sage.geometry.cone": {"walltime": 32},
-  "sage.geometry.fan": {"walltime": 8},
   "sage.geometry.hyperbolic_space.hyperbolic_geodesic": {"walltime": 8},
-  "sage.geometry.hyperplane_arrangement.arrangement": {"walltime": 16},
-  "sage.geometry.hyperplane_arrangement.library": {"walltime": 8},
+  "sage.geometry.hyperplane_arrangement.arrangement": {"walltime": 8},
   "sage.geometry.hyperplane_arrangement.plot": {"walltime": 8},
-  "sage.geometry.lattice_polytope": {"walltime": 16},
-  "sage.geometry.polyhedral_complex": {"walltime": 8},
-  "sage.geometry.polyhedron.base": {"walltime": 32},
-  "sage.geometry.polyhedron.library": {"walltime": 32},
-  "sage.geometry.polyhedron.plot": {"walltime": 8},
+  "sage.geometry.polyhedron.base": {"walltime": 8},
+  "sage.geometry.polyhedron.base5": {"walltime": 8},
+  "sage.geometry.polyhedron.base6": {"walltime": 16},
+  "sage.geometry.polyhedron.library": {"walltime": 16},
   "sage.geometry.riemannian_manifolds.parametrized_surface3d": {"walltime": 16},
-  "sage.geometry.triangulation.base": {"walltime": 32},
-  "sage.geometry.triangulation.point_configuration": {"walltime": 16},
-  "sage.graphs.chrompoly": {"walltime": 8},
-  "sage.graphs.connectivity": {"walltime": 16},
-  "sage.graphs.generators.basic": {"walltime": 16},
-  "sage.graphs.generators.classical_geometries": {"walltime": 32},
-  "sage.graphs.generators.distance_regular": {"walltime": 256},
-  "sage.graphs.generators.families": {"walltime": 32},
-  "sage.graphs.generators.smallgraphs": {"walltime": 16},
-  "sage.graphs.generic_graph": {"walltime": 32},
-  "sage.graphs.genus": {"walltime": 16},
+  "sage.graphs.connectivity": {"walltime": 8},
+  "sage.graphs.generators.classical_geometries": {"walltime": 8},
+  "sage.graphs.generators.distance_regular": {"walltime": 32},
+  "sage.graphs.generators.smallgraphs": {"walltime": 8},
+  "sage.graphs.generic_graph": {"walltime": 16},
   "sage.graphs.graph": {"walltime": 16},
-  "sage.graphs.graph_generators": {"walltime": 8},
   "sage.graphs.graph_list": {"walltime": 8},
   "sage.graphs.graph_plot": {"walltime": 8},
-  "sage.graphs.strongly_regular_db": {"walltime": 16},
-  "sage.groups.cubic_braid": {"walltime": 16},
-  "sage.groups.fqf_orthogonal": {"walltime": 16},
-  "sage.groups.libgap_mixin": {"walltime": 8},
-  "sage.groups.libgap_morphism": {"walltime": 8},
-  "sage.groups.lie_gps.nilpotent_lie_group": {"walltime": 16},
-  "sage.groups.matrix_gps.finitely_generated": {"walltime": 8},
-  "sage.groups.matrix_gps.heisenberg": {"walltime": 32},
-  "sage.groups.matrix_gps.linear": {"walltime": 8},
-  "sage.groups.perm_gps.cubegroup": {"walltime": 16},
-  "sage.groups.perm_gps.partn_ref.refinement_graphs": {"walltime": 8},
+  "sage.graphs.strongly_regular_db": {"walltime": 8},
+  "sage.groups.cactus_group": {"walltime": 8},
+  "sage.groups.cubic_braid": {"walltime": 8},
+  "sage.groups.lie_gps.nilpotent_lie_group": {"walltime": 8},
+  "sage.groups.matrix_gps.finitely_generated_gap": {"walltime": 8},
   "sage.groups.perm_gps.permgroup": {"walltime": 8},
   "sage.groups.perm_gps.permgroup_named": {"walltime": 8},
-  "sage.homology.hochschild_complex": {"walltime": 8},
   "sage.homology.homology_vector_space_with_basis": {"walltime": 8},
-  "sage.interacts.test_jupyter": {"walltime": 16},
-  "sage.interfaces.ecm": {"walltime": 8},
-  "sage.interfaces.expect": {"walltime": 8},
-  "sage.interfaces.gap": {"walltime": 16},
-  "sage.interfaces.maxima": {"walltime": 8},
-  "sage.interfaces.maxima_abstract": {"walltime": 64},
-  "sage.interfaces.psage": {"walltime": 8},
-  "sage.interfaces.sage0": {"walltime": 8},
-  "sage.lfunctions.zero_sums": {"walltime": 8},
-  "sage.libs.eclib.interface": {"walltime": 16},
+  "sage.interfaces.gap": {"walltime": 8},
+  "sage.interfaces.gap_workspace": {"walltime": 8},
+  "sage.interfaces.sage0": {"walltime": 16},
+  "sage.libs.eclib.interface": {"walltime": 32},
   "sage.libs.eclib.mwrank": {"walltime": 16},
-  "sage.libs.gap.test_long": {"walltime": 32},
-  "sage.libs.giac": {"walltime": 32},
   "sage.manifolds.catalog": {"walltime": 8},
-  "sage.manifolds.chart": {"walltime": 32},
+  "sage.manifolds.chart": {"walltime": 16},
   "sage.manifolds.chart_func": {"walltime": 8},
   "sage.manifolds.continuous_map": {"walltime": 8},
-  "sage.manifolds.differentiable.affine_connection": {"walltime": 128},
+  "sage.manifolds.differentiable.affine_connection": {"walltime": 32},
   "sage.manifolds.differentiable.automorphismfield": {"walltime": 32},
-  "sage.manifolds.differentiable.automorphismfield_group": {"walltime": 8},
   "sage.manifolds.differentiable.bundle_connection": {"walltime": 8},
-  "sage.manifolds.differentiable.characteristic_cohomology_class": {"walltime": 64},
+  "sage.manifolds.differentiable.characteristic_cohomology_class": {"walltime": 8},
   "sage.manifolds.differentiable.curve": {"walltime": 16},
-  "sage.manifolds.differentiable.degenerate": {"walltime": 32},
-  "sage.manifolds.differentiable.degenerate_submanifold": {"walltime": 16},
-  "sage.manifolds.differentiable.diff_form": {"walltime": 64},
+  "sage.manifolds.differentiable.degenerate": {"walltime": 16},
+  "sage.manifolds.differentiable.degenerate_submanifold": {"walltime": 8},
+  "sage.manifolds.differentiable.diff_form": {"walltime": 32},
   "sage.manifolds.differentiable.diff_map": {"walltime": 8},
   "sage.manifolds.differentiable.examples.euclidean": {"walltime": 32},
   "sage.manifolds.differentiable.examples.sphere": {"walltime": 32},
   "sage.manifolds.differentiable.integrated_curve": {"walltime": 32},
-  "sage.manifolds.differentiable.levi_civita_connection": {"walltime": 32},
-  "sage.manifolds.differentiable.manifold": {"walltime": 16},
-  "sage.manifolds.differentiable.manifold_homset": {"walltime": 16},
+  "sage.manifolds.differentiable.levi_civita_connection": {"walltime": 16},
+  "sage.manifolds.differentiable.manifold": {"walltime": 8},
+  "sage.manifolds.differentiable.manifold_homset": {"walltime": 8},
   "sage.manifolds.differentiable.metric": {"walltime": 64},
   "sage.manifolds.differentiable.mixed_form": {"walltime": 16},
-  "sage.manifolds.differentiable.mixed_form_algebra": {"walltime": 8},
   "sage.manifolds.differentiable.multivectorfield": {"walltime": 64},
-  "sage.manifolds.differentiable.pseudo_riemannian": {"walltime": 16},
-  "sage.manifolds.differentiable.pseudo_riemannian_submanifold": {"walltime": 128},
-  "sage.manifolds.differentiable.scalarfield": {"walltime": 16},
+  "sage.manifolds.differentiable.pseudo_riemannian": {"walltime": 8},
+  "sage.manifolds.differentiable.pseudo_riemannian_submanifold": {"walltime": 32},
+  "sage.manifolds.differentiable.scalarfield": {"walltime": 8},
   "sage.manifolds.differentiable.scalarfield_algebra": {"walltime": 8},
-  "sage.manifolds.differentiable.tangent_vector": {"walltime": 16},
+  "sage.manifolds.differentiable.tangent_vector": {"walltime": 8},
   "sage.manifolds.differentiable.tensorfield": {"walltime": 128},
   "sage.manifolds.differentiable.tensorfield_paral": {"walltime": 16},
-  "sage.manifolds.differentiable.vector_bundle": {"walltime": 16},
-  "sage.manifolds.differentiable.vectorfield": {"walltime": 64},
-  "sage.manifolds.differentiable.vectorframe": {"walltime": 8},
+  "sage.manifolds.differentiable.vectorfield": {"walltime": 16},
   "sage.manifolds.point": {"walltime": 16},
   "sage.manifolds.scalarfield": {"walltime": 16},
-  "sage.manifolds.scalarfield_algebra": {"walltime": 8},
-  "sage.manifolds.section": {"walltime": 32},
-  "sage.manifolds.trivialization": {"walltime": 8},
-  "sage.manifolds.vector_bundle": {"walltime": 8},
-  "sage.matrix.benchmark": {"walltime": 8},
+  "sage.manifolds.section": {"walltime": 16},
   "sage.matrix.matrix2": {"walltime": 16},
-  "sage.matrix.matrix_integer_dense": {"walltime": 16},
-  "sage.matrix.matrix_integer_dense_hnf": {"walltime": 32},
-  "sage.matrix.matrix_mod2_dense": {"walltime": 8},
   "sage.matrix.matrix_rational_dense": {"walltime": 8},
   "sage.matrix.special": {"walltime": 8},
-  "sage.matroids.catalog": {"walltime": 64},
   "sage.misc.cachefunc": {"walltime": 16},
-  "sage.misc.cython": {"walltime": 8},
   "sage.misc.functional": {"walltime": 8},
   "sage.misc.randstate": {"walltime": 16},
-  "sage.misc.sagedoc": {"walltime": 64},
-  "sage.misc.sageinspect": {"walltime": 32},
-  "sage.modular.abvar.abvar": {"walltime": 16},
+  "sage.misc.sagedoc": {"walltime": 16},
+  "sage.misc.sageinspect": {"walltime": 16},
+  "sage.misc.trace": {"walltime": 8},
+  "sage.modular.abvar.abvar": {"walltime": 8},
   "sage.modular.abvar.homspace": {"walltime": 8},
-  "sage.modular.abvar.lseries": {"walltime": 8},
-  "sage.modular.arithgroup.arithgroup_perm": {"walltime": 8},
-  "sage.modular.arithgroup.tests": {"walltime": 8},
-  "sage.modular.btquotients.pautomorphicform": {"walltime": 32},
-  "sage.modular.hypergeometric_motive": {"walltime": 16},
-  "sage.modular.local_comp.local_comp": {"walltime": 32},
-  "sage.modular.local_comp.type_space": {"walltime": 16},
-  "sage.modular.modform.ambient_R": {"walltime": 16},
-  "sage.modular.modform.constructor": {"walltime": 8},
-  "sage.modular.modform.cuspidal_submodule": {"walltime": 16},
-  "sage.modular.modform.element": {"walltime": 64},
-  "sage.modular.modform.ring": {"walltime": 64},
-  "sage.modular.modform.space": {"walltime": 8},
+  "sage.modular.btquotients.btquotient": {"walltime": 8},
+  "sage.modular.btquotients.pautomorphicform": {"walltime": 16},
+  "sage.modular.hecke.submodule": {"walltime": 8},
+  "sage.modular.hypergeometric_motive": {"walltime": 8},
+  "sage.modular.local_comp.local_comp": {"walltime": 16},
+  "sage.modular.local_comp.type_space": {"walltime": 8},
+  "sage.modular.modform.element": {"walltime": 32},
   "sage.modular.modform_hecketriangle.abstract_space": {"walltime": 16},
   "sage.modular.modform_hecketriangle.graded_ring_element": {"walltime": 16},
   "sage.modular.modform_hecketriangle.hecke_triangle_group_element": {"walltime": 32},
   "sage.modular.modform_hecketriangle.readme": {"walltime": 16},
-  "sage.modular.modform_hecketriangle.space": {"walltime": 8},
   "sage.modular.modsym.ambient": {"walltime": 16},
   "sage.modular.modsym.space": {"walltime": 8},
-  "sage.modular.pollack_stevens.modsym": {"walltime": 64},
-  "sage.modular.pollack_stevens.padic_lseries": {"walltime": 32},
-  "sage.modules.finite_submodule_iter": {"walltime": 16},
-  "sage.modules.free_module": {"walltime": 16},
-  "sage.modules.free_module_element": {"walltime": 8},
-  "sage.modules.free_module_integer": {"walltime": 32},
-  "sage.modules.free_quadratic_module_integer_symmetric": {"walltime": 8},
-  "sage.modules.torsion_quadratic_module": {"walltime": 16},
+  "sage.modular.overconvergent.genus0": {"walltime": 8},
+  "sage.modular.pollack_stevens.modsym": {"walltime": 8},
+  "sage.modules.fp_graded.morphism": {"walltime": 8},
+  "sage.modules.free_module": {"walltime": 8},
   "sage.parallel.map_reduce": {"walltime": 8},
-  "sage.plot.animate": {"walltime": 16},
-  "sage.plot.arrow": {"walltime": 8},
-  "sage.plot.circle": {"walltime": 8},
-  "sage.plot.complex_plot": {"walltime": 8},
+  "sage.plot.complex_plot": {"walltime": 16},
   "sage.plot.contour_plot": {"walltime": 32},
-  "sage.plot.density_plot": {"walltime": 8},
   "sage.plot.graphics": {"walltime": 32},
   "sage.plot.line": {"walltime": 8},
   "sage.plot.matrix_plot": {"walltime": 16},
@@ -283,115 +154,53 @@
   "sage.plot.plot": {"walltime": 64},
   "sage.plot.plot3d.base": {"walltime": 8},
   "sage.plot.plot3d.implicit_plot3d": {"walltime": 16},
-  "sage.plot.plot3d.implicit_surface": {"walltime": 8},
-  "sage.plot.plot3d.parametric_plot3d": {"walltime": 8},
+  "sage.plot.plot3d.parametric_plot3d": {"walltime": 16},
   "sage.plot.plot3d.parametric_surface": {"walltime": 8},
   "sage.plot.plot3d.plot3d": {"walltime": 16},
-  "sage.plot.plot3d.tachyon": {"walltime": 8},
-  "sage.plot.plot3d.transform": {"walltime": 32},
   "sage.plot.point": {"walltime": 8},
   "sage.plot.polygon": {"walltime": 8},
   "sage.plot.streamline_plot": {"walltime": 8},
-  "sage.quadratic_forms.genera.genus": {"walltime": 16},
-  "sage.quadratic_forms.quadratic_form__automorphisms": {"walltime": 8},
-  "sage.quadratic_forms.quadratic_form__local_representation_conditions": {"walltime": 64},
-  "sage.quadratic_forms.quadratic_form__neighbors": {"walltime": 8},
-  "sage.quadratic_forms.quadratic_form__siegel_product": {"walltime": 8},
   "sage.repl.ipython_extension": {"walltime": 8},
-  "sage.rings.asymptotic.asymptotic_expansion_generators": {"walltime": 64},
+  "sage.rings.asymptotic.asymptotic_expansion_generators": {"walltime": 16},
   "sage.rings.asymptotic.asymptotic_ring": {"walltime": 8},
-  "sage.rings.asymptotic.asymptotics_multivariate_generating_functions": {"walltime": 32},
-  "sage.rings.asymptotic.term_monoid": {"walltime": 8},
-  "sage.rings.continued_fraction": {"walltime": 8},
+  "sage.rings.asymptotic.asymptotics_multivariate_generating_functions": {"walltime": 8},
   "sage.rings.finite_rings.finite_field_base": {"walltime": 8},
-  "sage.rings.function_field.function_field": {"walltime": 128},
-  "sage.rings.function_field.function_field_valuation": {"walltime": 64},
+  "sage.rings.function_field.function_field": {"walltime": 8},
   "sage.rings.function_field.ideal": {"walltime": 8},
-  "sage.rings.function_field.place": {"walltime": 8},
-  "sage.rings.integer": {"walltime": 64},
-  "sage.rings.invariants.invariant_theory": {"walltime": 8},
-  "sage.rings.number_field.bdd_height": {"walltime": 8},
-  "sage.rings.number_field.number_field": {"walltime": 64},
-  "sage.rings.number_field.number_field_element": {"walltime": 16},
-  "sage.rings.number_field.splitting_field": {"walltime": 8},
-  "sage.rings.number_field.totallyreal": {"walltime": 16},
-  "sage.rings.number_field.totallyreal_rel": {"walltime": 8},
-  "sage.rings.padics.padic_base_leaves": {"walltime": 64},
-  "sage.rings.padics.padic_extension_leaves": {"walltime": 64},
-  "sage.rings.padics.padic_generic_element": {"walltime": 16},
-  "sage.rings.padics.padic_lattice_element": {"walltime": 32},
-  "sage.rings.padics.relative_extension_leaves": {"walltime": 32},
+  "sage.rings.lazy_series": {"walltime": 8},
+  "sage.rings.lazy_series_ring": {"walltime": 32},
+  "sage.rings.number_field.number_field": {"walltime": 32},
+  "sage.rings.number_field.number_field_element": {"walltime": 8},
+  "sage.rings.padics.padic_base_leaves": {"walltime": 8},
+  "sage.rings.padics.padic_generic_element": {"walltime": 8},
   "sage.rings.polynomial.multi_polynomial_ideal": {"walltime": 8},
-  "sage.rings.polynomial.multi_polynomial_sequence": {"walltime": 8},
-  "sage.rings.polynomial.ore_function_element": {"walltime": 8},
   "sage.rings.polynomial.polynomial_element": {"walltime": 16},
-  "sage.rings.polynomial.polynomial_rational_flint": {"walltime": 8},
   "sage.rings.qqbar": {"walltime": 16},
-  "sage.rings.tests": {"walltime": 16},
-  "sage.rings.valuation.augmented_valuation": {"walltime": 32},
-  "sage.rings.valuation.mapped_valuation": {"walltime": 64},
-  "sage.rings.valuation.valuation": {"walltime": 8},
-  "sage.sandpiles.sandpile": {"walltime": 16},
+  "sage.sandpiles.sandpile": {"walltime": 8},
   "sage.schemes.curves.affine_curve": {"walltime": 16},
   "sage.schemes.curves.closed_point": {"walltime": 8},
   "sage.schemes.curves.projective_curve": {"walltime": 32},
-  "sage.schemes.cyclic_covers.cycliccover_finite_field": {"walltime": 64},
   "sage.schemes.elliptic_curves.BSD": {"walltime": 8},
   "sage.schemes.elliptic_curves.Qcurves": {"walltime": 8},
-  "sage.schemes.elliptic_curves.constructor": {"walltime": 32},
-  "sage.schemes.elliptic_curves.ell_curve_isogeny": {"walltime": 16},
-  "sage.schemes.elliptic_curves.ell_egros": {"walltime": 32},
-  "sage.schemes.elliptic_curves.ell_finite_field": {"walltime": 8},
+  "sage.schemes.elliptic_curves.ell_curve_isogeny": {"walltime": 8},
   "sage.schemes.elliptic_curves.ell_generic": {"walltime": 8},
-  "sage.schemes.elliptic_curves.ell_modular_symbols": {"walltime": 16},
-  "sage.schemes.elliptic_curves.ell_number_field": {"walltime": 128},
+  "sage.schemes.elliptic_curves.ell_modular_symbols": {"walltime": 8},
   "sage.schemes.elliptic_curves.ell_point": {"walltime": 8},
-  "sage.schemes.elliptic_curves.ell_rational_field": {"walltime": 128},
-  "sage.schemes.elliptic_curves.gal_reps_number_field": {"walltime": 32},
-  "sage.schemes.elliptic_curves.gp_simon": {"walltime": 16},
-  "sage.schemes.elliptic_curves.heegner": {"walltime": 32},
-  "sage.schemes.elliptic_curves.height": {"walltime": 64},
-  "sage.schemes.elliptic_curves.isogeny_class": {"walltime": 32},
-  "sage.schemes.elliptic_curves.isogeny_small_degree": {"walltime": 64},
-  "sage.schemes.elliptic_curves.kraus": {"walltime": 16},
+  "sage.schemes.elliptic_curves.ell_rational_field": {"walltime": 32},
+  "sage.schemes.elliptic_curves.height": {"walltime": 8},
+  "sage.schemes.elliptic_curves.isogeny_small_degree": {"walltime": 16},
   "sage.schemes.elliptic_curves.mod_sym_num": {"walltime": 8},
   "sage.schemes.elliptic_curves.padic_lseries": {"walltime": 8},
-  "sage.schemes.elliptic_curves.padics": {"walltime": 16},
-  "sage.schemes.elliptic_curves.saturation": {"walltime": 16},
-  "sage.schemes.elliptic_curves.sha_tate": {"walltime": 32},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_finite_field": {"walltime": 64},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_generic": {"walltime": 8},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_padic_field": {"walltime": 32},
-  "sage.schemes.hyperelliptic_curves.monsky_washnitzer": {"walltime": 8},
-  "sage.schemes.projective.projective_rational_point": {"walltime": 8},
-  "sage.schemes.riemann_surfaces.riemann_surface": {"walltime": 64},
+  "sage.schemes.elliptic_curves.padics": {"walltime": 8},
+  "sage.schemes.elliptic_curves.sha_tate": {"walltime": 16},
+  "sage.schemes.hyperelliptic_curves.hyperelliptic_padic_field": {"walltime": 16},
+  "sage.schemes.riemann_surfaces.riemann_surface": {"walltime": 32},
   "sage.schemes.toric.chow_group": {"walltime": 8},
-  "sage.schemes.toric.sheaf.klyachko": {"walltime": 8},
-  "sage.stats.distributions.discrete_gaussian_integer": {"walltime": 8},
-  "sage.stats.time_series": {"walltime": 8},
-  "sage.structure.coerce_dict": {"walltime": 32},
   "sage.structure.element": {"walltime": 16},
-  "sage.structure.sage_object": {"walltime": 8},
   "sage.symbolic.expression": {"walltime": 32},
-  "sage.symbolic.integration.integral": {"walltime": 32},
-  "sage.symbolic.random_tests": {"walltime": 32},
+  "sage.symbolic.integration.integral": {"walltime": 16},
   "sage.symbolic.relation": {"walltime": 8},
-  "sage.tests.book_schilling_zabrocki_kschur_primer": {"walltime": 32},
-  "sage.tests.book_stein_ent": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.combinat_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.float_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.graphique_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.graphtheory_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.integration_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.mpoly_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.nonlinear_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.recequadiff_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.graphique_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.numbertheory_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.polynomes_doctest": {"walltime": 16},
-  "sage.tests.cmdline": {"walltime": 64},
-  "sage.tests.gosper-sum": {"walltime": 16},
-  "sage.tests.parigp": {"walltime": 8},
-  "sage.topology.simplicial_complex": {"walltime": 8},
-  "sage.topology.simplicial_complex_examples": {"walltime": 16}
+  "sage.tests.book_schilling_zabrocki_kschur_primer": {"walltime": 16},
+  "sage.tests.book_stein_ent": {"walltime": 8},
+  "sage.topology.simplicial_complex": {"walltime": 16}
 }
diff --git a/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch b/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
deleted file mode 100644
index f2f825e4fb10..000000000000
--- a/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
+++ /dev/null
@@ -1,205 +0,0 @@
-diff --git a/build/pkgs/singular/checksums.ini b/build/pkgs/singular/checksums.ini
-index 2e33a405d36..313463d2fea 100644
---- a/build/pkgs/singular/checksums.ini
-+++ b/build/pkgs/singular/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=singular-VERSION.tar.gz
--sha1=6c2b622d3681e2de3d58d30c654d43d3e32b720c
--md5=abb1e37c794472e7760655358ab66054
--cksum=17455733
-+sha1=28bb3ee97ef48d04dfa96de182fd93eebe08426c
-+md5=fc0a4f5720dadba45a52ee94324ce00c
-+cksum=1573851737
- upstream_url=ftp://jim.mathematik.uni-kl.de/pub/Math/Singular/SOURCES/4-3-1/singular-VERSION.tar.gz
-diff --git a/build/pkgs/singular/package-version.txt b/build/pkgs/singular/package-version.txt
-index 11300c77e7d..66e2bede53a 100644
---- a/build/pkgs/singular/package-version.txt
-+++ b/build/pkgs/singular/package-version.txt
-@@ -1 +1 @@
--4.3.1p1
-+4.3.1p3
-diff --git a/src/sage/libs/singular/decl.pxd b/src/sage/libs/singular/decl.pxd
-index 8e3ac314b67..747a6b1e2fb 100644
---- a/src/sage/libs/singular/decl.pxd
-+++ b/src/sage/libs/singular/decl.pxd
-@@ -574,7 +574,7 @@ cdef extern from "singular/Singular/libsingular.h":
- 
-     # gets a component out of a polynomial vector
- 
--    poly *pTakeOutComp1(poly **, int)
-+    poly *pTakeOutComp(poly **, int)
- 
-     # deep copy p
- 
-diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx
-index d8ea7b07f3c..3a1271cd59f 100644
---- a/src/sage/libs/singular/singular.pyx
-+++ b/src/sage/libs/singular/singular.pyx
-@@ -1726,20 +1726,21 @@ cdef int overflow_check(unsigned long e, ring *_ring) except -1:
- 
-     Whether an overflow occurs or not partially depends
-     on the number of variables in the ring. See trac ticket
--    :trac:`11856`. With Singular 4, it is by default optimized
--    for at least 4 variables on 64-bit and 2 variables on 32-bit,
--    which in both cases makes a maximal default exponent of
--    2^16-1.
-+    :trac:`11856`.
- 
-     EXAMPLES::
- 
-         sage: P.<x,y> = QQ[]
--        sage: y^(2^16-1)
--        y^65535
--        sage: y^2^16
-+        sage: y^(2^30)
-+        Traceback (most recent call last):             # 32-bit
-+        ...                                            # 32-bit
-+        OverflowError: exponent overflow (1073741824)  # 32-bit
-+        y^1073741824  # 64-bit
-+        sage: y^2^32
-         Traceback (most recent call last):
-         ...
--        OverflowError: exponent overflow (65536)
-+        OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+        OverflowError: exponent overflow (4294967296)  # 64-bit
-     """
-     if unlikely(e > _ring.bitmask):
-         raise OverflowError("exponent overflow (%d)"%(e))
-diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py
-index 7dc058a22f0..71494eddbc0 100644
---- a/src/sage/rings/polynomial/multi_polynomial_ideal.py
-+++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py
-@@ -60,7 +60,7 @@
- Note that the result of a computation is not necessarily reduced::
- 
-     sage: (a+b)^17
--    256*a*b^16 + 256*b^17
-+    a*b^16 + b^17
-     sage: S(17) == 0
-     True
- 
-diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-index 4dad016b33f..9bf67dd1425 100644
---- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-+++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-@@ -193,7 +193,7 @@ from sage.libs.singular.decl cimport (
-     p_IsUnit, p_IsOne, p_Series, p_Head, idInit, fast_map_common_subexp, id_Delete,
-     p_IsHomogeneous, p_Homogen, p_Totaldegree,pLDeg1_Totaldegree, singclap_pdivide, singclap_factorize,
-     idLift, IDELEMS, On, Off, SW_USE_CHINREM_GCD, SW_USE_EZGCD,
--    p_LmIsConstant, pTakeOutComp1, singclap_gcd, pp_Mult_qq, p_GetMaxExp,
-+    p_LmIsConstant, pTakeOutComp, singclap_gcd, pp_Mult_qq, p_GetMaxExp,
-     pLength, kNF, p_Neg, p_Minus_mm_Mult_qq, p_Plus_mm_Mult_qq,
-     pDiff, singclap_resultant, p_Normalize,
-     prCopyR, prCopyR_NoSort)
-@@ -1587,7 +1587,8 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_base):
-             9/4
- 
-             sage: P.monomial_quotient(x,y) # Note the wrong result
--            x*y^65535*z^65535
-+            x*y^65535*z^65535      # 32-bit
-+            x*y^1048575*z^1048575  # 64-bit
- 
-             sage: P.monomial_quotient(x,P(1))
-             x
-@@ -2247,10 +2248,11 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             9/4*x^2 - 1/4*y^2 - y - 1
- 
-             sage: P.<x,y> = PolynomialRing(QQ,order='lex')
--            sage: (x^2^15) * x^2^15
-+            sage: (x^2^32) * x^2^32
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (...)
-+            OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+            OverflowError: exponent overflow (...)  # 64-bit
-         """
-         # all currently implemented rings are commutative
-         cdef poly *_p
-@@ -2371,10 +2373,11 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             ValueError: not a 2nd power
- 
-             sage: P.<x,y> = PolynomialRing(QQ,order='lex')
--            sage: (x+y^2^15)^10
-+            sage: (x+y^2^32)^10
-             Traceback (most recent call last):
-             ....
--            OverflowError: exponent overflow (...)
-+            OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+            OverflowError: exponent overflow (...)  # 64-bit
- 
-         Test fractional powers (:trac:`22329`)::
- 
-@@ -3461,7 +3464,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             x^10000
-             no overflow
- 
--            sage: n = 1000
-+            sage: n = 100000
-             sage: try:
-             ....:     f = x^n
-             ....:     f.subs(x = x^n)
-@@ -4567,7 +4570,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
-         l = []
-         for i from 0 <= i < IDELEMS(res):
-             for j from 1 <= j <= IDELEMS(_I):
--                l.append( new_MP(parent, pTakeOutComp1(&res.m[i], j)) )
-+                l.append( new_MP(parent, pTakeOutComp(&res.m[i], 1)) )
- 
-         id_Delete(&fI, r)
-         id_Delete(&_I, r)
-@@ -4635,7 +4638,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
- 
-             sage: f = 3*x
-             sage: f.reduce([2*x,y])
--            3*x
-+            x
- 
-         The reduction is not canonical when ``I`` is not a Groebner
-         basis::
-diff --git a/src/sage/rings/polynomial/plural.pyx b/src/sage/rings/polynomial/plural.pyx
-index 1c9f35e56ba..587511c3888 100644
---- a/src/sage/rings/polynomial/plural.pyx
-+++ b/src/sage/rings/polynomial/plural.pyx
-@@ -1619,10 +1619,10 @@ cdef class NCPolynomial_plural(RingElement):
-             sage: P = A.g_algebra(relations={y*x:-x*y + z},  order='lex')
-             sage: P.inject_variables()
-             Defining x, z, y
--            sage: (x^2^15) * x^2^15
-+            sage: (x^2^31) * x^2^31
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (65536)
-+            OverflowError: exponent overflow (2147483648)
-         """
-         # all currently implemented rings are commutative
-         cdef poly *_p
-@@ -1689,10 +1689,10 @@ cdef class NCPolynomial_plural(RingElement):
-             sage: P = A.g_algebra(relations={y*x:-x*y + z},  order='lex')
-             sage: P.inject_variables()
-             Defining x, z, y
--            sage: (x+y^2^15)^10
-+            sage: (x+y^2^31)^10
-             Traceback (most recent call last):
-             ....
--            OverflowError: exponent overflow (327680)
-+            OverflowError: exponent overflow (2147483648)
-         """
-         if type(exp) is not Integer:
-             try:
-diff --git a/src/sage/structure/element.pyx b/src/sage/structure/element.pyx
-index b5d83ef71b6..5c45b3fb528 100644
---- a/src/sage/structure/element.pyx
-+++ b/src/sage/structure/element.pyx
-@@ -2705,10 +2705,10 @@ cdef class RingElement(ModuleElement):
-         with Singular 4::
- 
-             sage: K.<x,y> = ZZ[]
--            sage: (x^12345)^54321
-+            sage: (x^123456)^654321
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (670592745)
-+            OverflowError: exponent overflow (...)
-         """
-         return arith_generic_power(self, n)
- 
diff --git a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch b/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
deleted file mode 100644
index ee0f0e656b28..000000000000
--- a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py
-index d5f7157217f..8ca1f958039 100644
---- a/src/sage/rings/number_field/number_field_ideal.py
-+++ b/src/sage/rings/number_field/number_field_ideal.py
-@@ -996,16 +996,38 @@ def is_prime(self):
-             False
-             sage: K.ideal(17).is_prime()  # ramified
-             False
-+
-+        TESTS:
-+
-+        Check that we do not factor the norm of the ideal, this used
-+        to take half an hour, see :trac:`33360`::
-+
-+            sage: K.<a,b,c> = NumberField([x^2-2,x^2-3,x^2-5])
-+            sage: t = (((-2611940*c + 1925290/7653)*b - 1537130/7653*c
-+            ....:       + 10130950)*a + (1343014/7653*c - 8349770)*b
-+            ....:       + 6477058*c - 2801449990/4002519)
-+            sage: t.is_prime()
-+            False
-         """
-         try:
-             return self._pari_prime is not None
-         except AttributeError:
--            F = self.factor()  # factorization with caching
--            if len(F) != 1 or F[0][1] != 1:
--                self._pari_prime = None
--            else:
--                self._pari_prime = F[0][0]._pari_prime
--            return self._pari_prime is not None
-+            pass
-+
-+        K = self.number_field().pari_nf()
-+        I = self.pari_hnf()
-+
-+        candidate = K.idealismaximal(I) or None
-+
-+        # PARI uses probabilistic primality testing inside idealismaximal().
-+        if get_flag(None, 'arithmetic'):
-+            # proof required, check using isprime()
-+            if candidate and not candidate[0].isprime():
-+                candidate = None
-+
-+        self._pari_prime = candidate
-+
-+        return self._pari_prime is not None
- 
-     def pari_prime(self):
-         r"""
diff --git a/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch b/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
deleted file mode 100644
index 91f06fd4d173..000000000000
--- a/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-diff --git a/src/sage/misc/persist.pyx b/src/sage/misc/persist.pyx
-index 3ac5f1cc2b0..cb1f327c199 100644
---- a/src/sage/misc/persist.pyx
-+++ b/src/sage/misc/persist.pyx
-@@ -157,7 +157,7 @@ def load(*filename, compress=True, verbose=True, **kwargs):
-         ....:     _ = f.write(code)
-         sage: load(t)
-         sage: hello
--        <fortran object>
-+        <fortran ...>
-     """
-     import sage.repl.load
-     if len(filename) != 1:
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index 6f0aeab87ae..b77c69b2f77 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -461,6 +461,8 @@ def complex_to_rgb(z_values, contoured=False, tiled=False,
-             rgb[i, j, 2] = b
- 
-     sig_off()
-+    nan_indices = np.isnan(rgb).any(-1)     # Mask for undefined points
-+    rgb[nan_indices] = 1                    # Make nan_indices white
-     return rgb
- 
- 
-diff --git a/src/sage/plot/histogram.py b/src/sage/plot/histogram.py
-index 3bc2b76b58e..388c2d1391d 100644
---- a/src/sage/plot/histogram.py
-+++ b/src/sage/plot/histogram.py
-@@ -87,13 +87,8 @@ def get_minmax_data(self):
- 
-         TESTS::
- 
--            sage: h = histogram([10,3,5], normed=True)[0]
--            doctest:warning...:
--            DeprecationWarning: the 'normed' option is deprecated. Use 'density' instead.
--            See https://trac.sagemath.org/25260 for details.
-+            sage: h = histogram([10,3,5], density=True)[0]
-             sage: h.get_minmax_data()
--            doctest:warning ...
--            ...VisibleDeprecationWarning: Passing `normed=True` on non-uniform bins has always been broken, and computes neither the probability density function nor the probability mass function. The result is only correct if the bins are uniform, when density=True will produce the same result anyway. The argument will be removed in a future version of numpy.
-             {'xmax': 10.0, 'xmin': 3.0, 'ymax': 0.476190476190..., 'ymin': 0}
-         """
-         import numpy
-diff --git a/src/sage/repl/ipython_extension.py b/src/sage/repl/ipython_extension.py
-index 798671aab42..cad6a47ca8b 100644
---- a/src/sage/repl/ipython_extension.py
-+++ b/src/sage/repl/ipython_extension.py
-@@ -405,7 +405,7 @@ def fortran(self, line, cell):
-             ....: C END FILE FIB1.F
-             ....: ''')
-             sage: fib
--            <fortran object>
-+            <fortran ...>
-             sage: from numpy import array
-             sage: a = array(range(10), dtype=float)
-             sage: fib(a, 10)
diff --git a/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch b/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
deleted file mode 100644
index 2769e87f6a4b..000000000000
--- a/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-diff --git a/src/sage/interfaces/tachyon.py b/src/sage/interfaces/tachyon.py
-index 23671e50892..ce1d50f71bc 100644
---- a/src/sage/interfaces/tachyon.py
-+++ b/src/sage/interfaces/tachyon.py
-@@ -683,12 +683,14 @@
- #*****************************************************************************
- 
- import os
-+import re
- 
- from sage.cpython.string import bytes_to_str
- from sage.misc.pager import pager
- from sage.misc.superseded import deprecation
- from sage.misc.temporary_file import tmp_filename
- from sage.structure.sage_object import SageObject
-+from sage.misc.cachefunc import cached_method
- 
- 
- class TachyonRT(SageObject):
-@@ -799,6 +801,11 @@ def __call__(self, model, outfile='sage.png', verbose=1, extra_opts=''):
-             Parser failed due to an input file syntax error.
-             Aborting render.
-         """
-+        if self.version() >= '0.99.2':
-+            # this keyword was changed in 0.99.2
-+            model = model.replace(
-+                    "              focallength ",
-+                    "              focaldist ")
-         modelfile = tmp_filename(ext='.dat')
-         with open(modelfile, 'w') as file:
-             file.write(model)
-@@ -851,6 +858,25 @@ def usage(self, use_pager=True):
-         else:
-             print(r)
- 
-+    @cached_method
-+    def version(self):
-+        """
-+        Returns the version of the Tachyon raytracer being used.
-+
-+        TESTS::
-+
-+            sage: tachyon_rt.version()  # random
-+            0.98.9
-+            sage: tachyon_rt.version() >= '0.98.9'
-+            True
-+        """
-+        with os.popen('tachyon') as f:
-+            r = f.readline()
-+        res = re.search(r"Version ([\d.]*)", r)
-+        # debian patches tachyon so it won't report the version
-+        # we hardcode '0.99' since that's indeed the version they ship
-+        return res[1] if res else '0.99'
-+
-     def help(self, use_pager=True):
-         """
-         Deprecated: type 'sage.interfaces.tachyon?' for help
diff --git a/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch b/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
deleted file mode 100644
index 11eb20d4f735..000000000000
--- a/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff --git a/src/sage/arith/long.pxd b/src/sage/arith/long.pxd
-index 1c9a53387a0..d96b98f247c 100644
---- a/src/sage/arith/long.pxd
-+++ b/src/sage/arith/long.pxd
-@@ -270,6 +270,17 @@ cdef inline bint integer_check_long_py(x, long* value, int* err):
-         sage: L += [-x for x in L] + [0, long_min()]
-         sage: for v in L:
-         ....:     assert check_long_py(int(v)) == v
-+        sage: check_long_py(int(2^60))
-+        1152921504606846976                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^61))
-+        2305843009213693952                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^62))
-+        4611686018427387904                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^63))
-+        'Overflow (...)'
-         sage: check_long_py(int(2^100))
-         'Overflow (...)'
-         sage: check_long_py(int(long_max() + 1))
-@@ -309,7 +320,12 @@ cdef inline bint integer_check_long_py(x, long* value, int* err):
- 
-     cdef long lead
-     cdef long lead_2_overflow = (<long>1) << (BITS_IN_LONG - PyLong_SHIFT)
--    cdef long lead_3_overflow = (<long>1) << (BITS_IN_LONG - 2 * PyLong_SHIFT)
-+    cdef long lead_3_overflow
-+    if BITS_IN_LONG < 2 * PyLong_SHIFT:
-+        # in this case 3 digit is always overflow
-+        lead_3_overflow = 0
-+    else:
-+        lead_3_overflow = (<long>1) << (BITS_IN_LONG - 2 * PyLong_SHIFT)
-     if size == 0:
-         value[0] = 0
-         err[0] = 0
diff --git a/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch b/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
deleted file mode 100644
index c4d7d5c779d1..000000000000
--- a/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/src/sage/schemes/toric/sheaf/klyachko.py b/src/sage/schemes/toric/sheaf/klyachko.py
-index b1304a16913..77fae4b7545 100644
---- a/src/sage/schemes/toric/sheaf/klyachko.py
-+++ b/src/sage/schemes/toric/sheaf/klyachko.py
-@@ -26,7 +26,7 @@
-     (0, 0, 18, 16, 1)
-     sage: Gtilde = G_sum.random_deformation()
-     sage: V = Gtilde.wedge(2) * K                     # long time
--    sage: V.cohomology(dim=True, weight=(0,0,0,0))    # long time
-+    sage: V.cohomology(dim=True, weight=(0,0,0,0))    # long time  # random failure (see #32773)
-     (0, 0, 3, 0, 0)
- 
- REFERENCES:
-@@ -948,7 +948,7 @@ def random_deformation(self, epsilon=None):
-            sage: V.cohomology(dim=True, weight=(0,))
-            (1, 0)
-            sage: Vtilde = V.random_deformation()
--           sage: Vtilde.cohomology(dim=True, weight=(0,))
-+           sage: Vtilde.cohomology(dim=True, weight=(0,))  # random failure (see #32773)
-            (1, 0)
-         """
-         filt = self._filt.random_deformation(epsilon)
diff --git a/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch b/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
deleted file mode 100644
index d9a9835c696b..000000000000
--- a/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 9ac7840134054155545e24fa3e66402d42b91c0f Mon Sep 17 00:00:00 2001
-From: Antonio Rojas <arojas@archlinux.org>
-Date: Fri, 20 Jan 2023 21:36:27 +0100
-Subject: [PATCH] Fix tests with giac 1.9.0.35
-
----
- src/sage/libs/giac/giac.pyx   |  3 +--
- src/sage/symbolic/relation.py | 15 +++++----------
- 2 files changed, 6 insertions(+), 12 deletions(-)
-
-diff --git a/src/sage/libs/giac/giac.pyx b/src/sage/libs/giac/giac.pyx
-index 4e451dba5e7..ccad5169836 100644
---- a/src/sage/libs/giac/giac.pyx
-+++ b/src/sage/libs/giac/giac.pyx
-@@ -374,8 +374,7 @@ def _giac(s):
- 
-         sage: x = libgiac('x')
-         sage: (1+2*sin(3*x)).solve(x).simplify()
--        Warning, argument is not an equation, solving 1+2*sin(3*x)=0
--        list[-pi/18,7*pi/18]
-+        ...list[-pi/18,7*pi/18]
- 
-         sage: libgiac.solve('sin(3*x)>2*sin(x)',x)
-         Traceback (most recent call last):
-diff --git a/src/sage/symbolic/relation.py b/src/sage/symbolic/relation.py
-index e9dbc0fea30..b8896a94be9 100644
---- a/src/sage/symbolic/relation.py
-+++ b/src/sage/symbolic/relation.py
-@@ -935,8 +935,7 @@ def solve(f, *args, **kwds):
- 
-         sage: f = (sin(x) - 8*cos(x)*sin(x))*(sin(x)^2 + cos(x)) - (2*cos(x)*sin(x) - sin(x))*(-2*sin(x)^2 + 2*cos(x)^2 - cos(x))
-         sage: solve(f, x, algorithm='giac')
--        ...
--        [-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-+        ...[-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
- 
-         sage: x, y = SR.var('x,y')
-         sage: solve([x+y-4,x*y-3],[x,y],algorithm='giac')
-@@ -1440,19 +1439,15 @@ def _giac_solver(f, x, solution_dict=False):
-     EXAMPLES::
- 
-         sage: solve([(2/3)^x-2], [x], algorithm='giac')
--        ...
--        [[-log(2)/(log(3) - log(2))]]
-+        ...[[-log(2)/(log(3) - log(2))]]
-         sage: solve([(2/3)^x-2], [x], algorithm='giac', solution_dict=True)
--        ...
--        [{x: -log(2)/(log(3) - log(2))}]
-+        ...[{x: -log(2)/(log(3) - log(2))}]
- 
-         sage: f = (sin(x) - 8*cos(x)*sin(x))*(sin(x)^2 + cos(x)) - (2*cos(x)*sin(x) - sin(x))*(-2*sin(x)^2 + 2*cos(x)^2 - cos(x))
-         sage: solve(f, x, algorithm='giac')
--        ...
--        [-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-+        ...[-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-         sage: solve(f, x, algorithm='giac', solution_dict=True)
--        ...
--        [{x: -2*arctan(sqrt(2))}, {x: 0}, {x: 2*arctan(sqrt(2))}, {x: pi}]
-+        ...[{x: -2*arctan(sqrt(2))}, {x: 0}, {x: 2*arctan(sqrt(2))}, {x: pi}]
- 
-         sage: x, y = SR.var('x,y')
-         sage: solve([x+y-7,x*y-10],[x,y],algorithm='giac')
diff --git a/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch b/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
deleted file mode 100644
index 499e0c71e256..000000000000
--- a/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
+++ /dev/null
@@ -1,1303 +0,0 @@
-diff --git a/build/pkgs/gap/checksums.ini b/build/pkgs/gap/checksums.ini
-index 066e943308a..b0ea8ba8818 100644
---- a/build/pkgs/gap/checksums.ini
-+++ b/build/pkgs/gap/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=gap-VERSION.tar.gz
--sha1=4ecdd281b8f430282fb9b12690b06e0a26abde10
--md5=85dc9e459d5b6c66fcad9f468afd3e3e
--cksum=1351843158
-+sha1=a6e36f3f874a2c46f51561402634497eab705cca
-+md5=c5cd9f272f2703d7a3649ad7193b2d90
-+cksum=2760477284
- upstream_url=https://github.com/gap-system/gap/releases/download/vVERSION/gap-VERSION.tar.gz
-diff --git a/build/pkgs/gap/package-version.txt b/build/pkgs/gap/package-version.txt
-index d782fca8f64..f1cd7de1de5 100644
---- a/build/pkgs/gap/package-version.txt
-+++ b/build/pkgs/gap/package-version.txt
-@@ -1 +1 @@
--4.11.1
-+4.12.2
-diff --git a/build/pkgs/gap/spkg-check.in b/build/pkgs/gap/spkg-check.in
-index d9791d33293..d2fccda6e04 100644
---- a/build/pkgs/gap/spkg-check.in
-+++ b/build/pkgs/gap/spkg-check.in
-@@ -3,6 +3,13 @@ cd src
- # #28728: Fix test failure in tst/testinstall/strings.tst
- export LC_CTYPE=en_US.UTF-8
- 
-+# #34391: in GAP 4.12 some packages need GAP package io
-+#         to let tests run, otherwise this hangs. Thus we install io here.
-+cd pkg/io
-+./configure --with-gaproot=../..
-+make
-+cd ../..
-+
- make testinstall
- if [[ $? -ne 0 ]]; then
-     exit 1
-diff --git a/build/pkgs/gap/spkg-install.in b/build/pkgs/gap/spkg-install.in
-index 2ceadf99db4..e2c8b4dca54 100644
---- a/build/pkgs/gap/spkg-install.in
-+++ b/build/pkgs/gap/spkg-install.in
-@@ -8,8 +8,7 @@ export CFLAGS=$CFLAGS_NON_NATIVE
- export CXXFLAGS=$CXXFLAGS_NON_NATIVE
- 
- GAP_BUILD_ROOT="$(pwd)"
--GAP_ROOT="$SAGE_LOCAL/share/gap"
--DESTDIR_GAP_ROOT="$SAGE_DESTDIR$GAP_ROOT"
-+GAP_ROOT="$SAGE_LOCAL/lib/gap"
- 
- # Enable debug info if requested.
- # Note that -g3 allows you to use preprocessor macros in gdb which are widely used
-@@ -17,37 +16,17 @@ if [ "$SAGE_DEBUG" = yes ] ; then
-     export CFLAGS="-O0 -g3 -DDEBUG_MASTERPOINTERS -DDEBUG_GLOBAL_BAGS -DDEBUG_FUNCTIONS_BAGS $CFLAGS"
- fi
- 
--sdh_configure $SAGE_CONFIGURE_GMP
--sdh_make -j1
-+# LDFLAGS hack below needed by Semigroups package
-+sdh_configure $SAGE_CONFIGURE_GMP LDFLAGS="-pthread" --prefix=$SAGE_LOCAL
-+sdh_make
- 
--# GAP's "make install" is work in progress; we use bits and pieces of it
--# but we install many things manually.
--sdh_make install-headers install-libgap
--
--# Install config.h, which is not currently handled by `make install-headers`
--sdh_install gen/config.h "$SAGE_LOCAL/include/gap"
--
--# Now install the gap executable as "gap-bin"; it will be called normally
--# through our wrapper script that sets the appropriate GAP_ROOT
--SAGE_BIN="$SAGE_LOCAL/bin"
--mkdir -p "$SAGE_DESTDIR$SAGE_BIN" || sdh_die "Failed to create the directory $SAGE_BIN"
--
--./libtool --mode=install install gap "$SAGE_DESTDIR$SAGE_BIN/gap-bin" || \
--    sdh_die "Failed to install gap-bin to $SAGE_BIN"
--
--./libtool --mode=install install gac "$SAGE_DESTDIR$SAGE_BIN/gac" || \
--    sdh_die "Failed to install gac to $SAGE_BIN"
--
--# Now copy additional files GAP needs to run (and a few optional bits) into
--# GAP_ROOT; we don't need everything from the source tree
--sdh_install bin doc gen grp lib src tst sysinfo.gap "$GAP_ROOT"
--
--# GAP's copy of libtool is also used by the toolchain for build GAP packages
--# (i.e. by gac)
--sdh_install libtool "$GAP_ROOT"
-+sdh_make_install
-+# sdh_make install-headers install-libgap
-+# The 'packagemanager' package expects this https://github.com/gap-packages/PackageManager/issues/105
-+mkdir -p "$SAGE_LOCAL/lib/gap/bin"
- 
- # Install only the minimal packages GAP needs to run
--sdh_install pkg/GAPDoc-* pkg/primgrp-* pkg/SmallGrp-* pkg/transgrp "$GAP_ROOT"/pkg
-+sdh_install pkg/gapdoc pkg/primgrp pkg/smallgrp pkg/transgrp "$GAP_ROOT"/pkg
- 
- # Install additional packages that are not strictly required, but that are
- # typically "expected" to be loaded: These are the default packages that are
-@@ -58,50 +37,25 @@ sdh_install pkg/GAPDoc-* pkg/primgrp-* pkg/SmallGrp-* pkg/transgrp "$GAP_ROOT"/p
- # Also include atlasrep which is a dependency of tomlib
- sdh_install \
-     pkg/atlasrep \
--    pkg/autpgrp-* \
--    pkg/alnuth-* \
--    pkg/crisp-* \
--    pkg/ctbllib-* \
--    pkg/FactInt-* \
-+    pkg/autodoc \
-+    pkg/autpgrp \
-+    pkg/alnuth \
-+    pkg/crisp \
-+    pkg/ctbllib \
-+    pkg/factint \
-     pkg/fga \
--    pkg/irredsol-* \
--    pkg/laguna-* \
--    pkg/PackageManager-* \
--    pkg/polenta-* \
--    pkg/polycyclic-* \
--    pkg/resclasses-* \
--    pkg/sophus-* \
--    pkg/tomlib-* \
-+    pkg/irredsol \
-+    pkg/laguna \
-+    pkg/packagemanager \
-+    pkg/polenta \
-+    pkg/polycyclic \
-+    pkg/radiroot \
-+    pkg/resclasses \
-+    pkg/sophus \
-+    pkg/tomlib \
-+    pkg/utils \
-     "$GAP_ROOT"/pkg
- 
--# Install the GAP startup script; ensure it is executable
--sdh_install -T ../gap "$SAGE_BIN/gap"
--chmod +x "$SAGE_DESTDIR$SAGE_BIN/gap"
--
--# Create symlinks under $GAP_ROOT for these executables, as they are expected
--# (especially when building kernel packages) to exist
--ln -sf "../../bin/gap-bin" "$DESTDIR_GAP_ROOT/gap"
--ln -sf "../../bin/gac" "$DESTDIR_GAP_ROOT/gac"
--
--# Fix the $GAP_ROOT/bin/<arch>/src symlink to be relative (otherwise it links
--# to the actual path of the sources GAP was compiled from)
--for srclink in "$DESTDIR_GAP_ROOT"/bin/*/src; do
--    rm -f "$srclink"
--    ln -s "../../src" "$srclink"
--done
--
--# Additional fixups for some files after they have been copied into their
--# destination directory.  gac and sysinfo.gap are generated files that contain
--# in them hard-coded references to the GAP build directory, which will soon
--# be going away.  This breaks the build toolchain for some compiled GAP
--# packages.  We need to replace these paths with the final GAP_ROOT path.  The
--# below will work so long as neither of these paths contain '|', and if they do
--# then god help you.  https://trac.sagemath.org/ticket/27218
--sed -i -e "s|$GAP_BUILD_ROOT|$GAP_ROOT|g" \
--    "$SAGE_DESTDIR$SAGE_BIN/gac" "$DESTDIR_GAP_ROOT/sysinfo.gap" \
--    "$DESTDIR_GAP_ROOT/bin/gap.sh" "$DESTDIR_GAP_ROOT/doc/make_doc" || \
--    sdh_die "Failed to fix up hard-coded paths in GAP build tools."
--
- # TODO: This seems unnecessary--we are already installing all of doc/ to
- # GAP_ROOT, which is necessary for some functionality in GAP to work.  Do
- # we need this?  Maybe doc/gap could just be a symlink to gap/doc??
-diff --git a/build/pkgs/gap/spkg-legacy-uninstall b/build/pkgs/gap/spkg-legacy-uninstall
-index d17eb939eb7..a8e5c59e1fb 100755
---- a/build/pkgs/gap/spkg-legacy-uninstall
-+++ b/build/pkgs/gap/spkg-legacy-uninstall
-@@ -4,6 +4,8 @@ rm -rf "$SAGE_LOCAL/gap/gap-4."*
- rm -rf "$SAGE_SHARE/gap"
- rm -f "$SAGE_LOCAL/gap/latest"
- rm -f "$SAGE_LOCAL/bin/gap"
-+rm -f "$SAGE_LOCAL/bin/gac"
- 
--# Remove old libgap headers
-+# Remove old libgap headers and library
- rm -rf "$SAGE_LOCAL/include/gap"
-+rm -rf "$SAGE_LOCAL/lib/gap"
-diff --git a/build/pkgs/gap/spkg-prerm.in b/build/pkgs/gap/spkg-prerm.in
-deleted file mode 100644
-index 661d92621fa..00000000000
---- a/build/pkgs/gap/spkg-prerm.in
-+++ /dev/null
-@@ -1,6 +0,0 @@
--# These generated files are placed in directory provided by the SPKG, so
--# delete the generated files first so that their parent directories can be
--# removed during installation
--GAP_ROOT="$SAGE_LOCAL/share/gap"
--rm -f "$GAP_ROOT/pkg/atlasrep/datagens/"*.*
--rm -f "$GAP_ROOT/pkg/atlasrep/dataword/"*.*
-diff --git a/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch b/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch
-deleted file mode 100644
-index e45fe7d9c6f..00000000000
---- a/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch
-+++ /dev/null
-@@ -1,150 +0,0 @@
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c b/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--index 3bbdc45..7df699f 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--@@ -8,9 +8,8 @@ extern short sp[],**mat[],*psp[],**imcos[],**cpco[],lorb[],
-- short *cst,**cpst,***cdpst,**svptr,*cp,*rel;
-- short *spst,**pspst,**pptr,**cpptr,npt,nb,nph,nph2,npg,npg2,
--       rno,orno,coh_index,*invg;
---FILE  *ip,*op;
-- 
---void seeknln (void) { while (getc(ip)!='\n'); }
--+void seeknln (FILE *ip) { while (getc(ip)!='\n'); }
-- 
-- /* This program differs from most other permutation programs in that perms are
--    all stored in the single array sp. Schreier vectors are stored in the short
--@@ -23,13 +22,14 @@ void seeknln (void) { while (getc(ip)!='\n'); }
-- int 
-- crprog1 (void)
-- { short *pc,*qc,ex,neg; int x;
--+  FILE  *ip,*op;
--   short i,j,k,l,m,n,cl,rl,*p,ocl,im,pt,pt1,pn,ipt;
--   if ((ip=fopen(inf2,"r"))== 0)
--   { fprintf(stderr,"Cannot open %s.\n",inf2); return(-1);}
--   fscanf(ip,"%hd%hd%hd%hd",&npt,&nph,&nb,&k);
--   if (nb>=mb) {fprintf(stderr,"nb too big. Increase MB.\n"); return(-1);}
--   if (k<=2) {fprintf(stderr,"inf2 has illegal format.\n"); return(-1); }
---  seeknln(); seeknln();
--+  seeknln(ip); seeknln(ip);
--   for (i=1;i<=nb;i++) fscanf(ip,"%hd",lorb+i);
--   pptr=psp-1; pspst=psp+nph; svptr=cpsp-1;  cpst=cpsp+nb;
--   invg=sp; nph2=2*nph; spst=sp+nph2;
--@@ -37,7 +37,7 @@ crprog1 (void)
--   { pptr[i]=spst+(i-1)*npt-1; p=pptr[i];
--     for (j=1;j<=npt;j++) {fscanf(ip,"%hd",&k); p[k]=j; }
--     invg[2*i-2]=2*i-1; invg[2*i-1]=2*i-2;
---    seeknln();
--+    seeknln(ip);
--   }
--   spst+=(npt*nph);
--   for (i=1;i<=nb;i++)
--@@ -75,7 +75,7 @@ crprog1 (void)
--   strcpy(inf1,inf0); strcat(inf1,".rel");
--   if ((ip=fopen(inf1,"r"))==0)
--   { fprintf(stderr,"Cannot open %s.\n",inf1); return(-1);}
---  fscanf(ip,"%hd%hd",&k,&rno); seeknln();
--+  fscanf(ip,"%hd%hd",&k,&rno); seeknln(ip);
--   op=fopen(outft,"w");
-- /* Now we have read everything in, and the computation can start */
--   orno=0;
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--index a7396b2..658496f 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--@@ -20,8 +20,6 @@ short  mexp=MEXP,mcl=MCL,no,rel[RSP],wt[MEXP],exp,*rpf,*rpb,
-- extern short  prime,dim,*spv,**spm,mspace[],*vec[],**mat[],cp[],pinv[],opmats,
--         mm,mv;
-- extern int msp;
---FILE *ip,*op;
---
-- 
-- int 
-- calcmats (void)
--@@ -59,7 +57,7 @@ calcmats (void)
--   }
--   for (i=1;i<=exp;i++) trans(mat[i+exp],mat[i]);
--   if (opmats)
---  { op=fopen(outf,"w");
--+  { FILE *op=fopen(outf,"w");
--     fprintf(op,"%4d%4d%4d\n",prime,dim,exp);
--     for (i=1;i<=exp;i++) printmat(mat[i]); 
--     fclose(op);
--@@ -71,6 +69,7 @@ int
-- rdmats (void)
-- /* reads matrices of generators of P */
-- { short i; int quot;
--+  FILE *ip;
--   ip=fopen(inf4,"r");
--   if (ip==0)
--   { fprintf(stderr,"Cannot open %s\n ",inf4); return(-1); }
--@@ -90,12 +89,12 @@ rdmats (void)
--   fclose(ip);
--   return(0);
-- }
---FILE *ip;
-- 
-- int 
-- ingp (int inp)
-- /* Read in output of respcrun -s */
-- { short i,j,k,l,m,*orpf,**pcp;
--+  FILE *ip;
--   ip=fopen(inf3,"r");
--   if (ip==0) { fprintf(stderr,"Cannot open %s\n",inf3); return(-1); }
--   fscanf(ip,"%hd%hd%hd%hd%hd%hd",&prime,&exp,&i,&no,&j,&m);
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--index 0896551..6841bc8 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--@@ -9,7 +9,6 @@ extern short  intexp,mexp,mng,wksp,
--        spugen[],*tlintg[];
-- extern int ptrsp,rsp;
-- short  fac;
---FILE *ip,*op;
-- 
-- int 
-- ingp (void)
--@@ -18,6 +17,7 @@ ingp (void)
--    of nqrun, and tails are also read in.
-- */
-- { short i,j,k,l,m,x,y,no,*orpf,*orpb,**pcp;  char tails;
--+  FILE *ip;
--   if ((ip=fopen(inf1,"r"))==0)
--   { fprintf(stderr,"Cannot open %s.\n",inf1); return(-1); }
--   fscanf(ip,"%hd%hd%hd%hd%hd%hd",&prime,&exp,&nng,&no,&class,&m);
--@@ -89,6 +89,7 @@ int
-- outgp (void)
-- /* The PCP is output, together with tails */
-- { short i,k,l,**pcp,*b,*e,*c;
--+  FILE *op;
--   op=fopen(outf,"w");
--   fprintf(op,"%4d%4d%4d%4d%4d%4d\n",prime,exp,nng,exp,class,1);
--   for (i=1;i<=exp;i++) fprintf(op,"%4d",wt[i]); fprintf(op,"\n");
--@@ -379,7 +380,7 @@ restart:
--     nng--; mnng--; enexpnt--;
--     if (nng==0)
--     { if (gap)
---      { op=fopen(outfm,"w"); fprintf(op,"COHOMOLO.Multiplier:=[];\n");
--+      { FILE *op=fopen(outfm,"w"); fprintf(op,"COHOMOLO.Multiplier:=[];\n");
--         fclose(op);
--         printf("All new generators eliminated. Multiplier is trivial.\n");
--       }
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--index 01cf914..0144883 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--@@ -9,7 +9,6 @@ extern short  intexp,mng,mexp,wksp,
--        spugen[],*intg[],*imintg[],*tlintg[];
-- extern int ptrsp,rsp;
-- short  *wf,*wc; char norm;
---FILE *ip,*op;
-- 
-- /* The data structures for this program and for nqrun are similar.
--    d1 and d2 contain definitions of generators. (Def. comes from commutator
--@@ -35,6 +34,7 @@ nqmprog (void)
-- { short i,j,k,l,m,d,*gi,*gj,*ti,*tj,cl,def,*ps,*pf,**dp,*nrpb,*p,*orpf,*orpb,
--         nb,np,k1,*rno,*covrel,**pgen,tdef,sgn;
--   char nt;
--+  FILE *ip,*op;
--   if (ingp() == -1) {fprintf(stderr,"Input error.\n"); return(-1); }
--   eexpnt=expnt+exp; enexpnt=nexpnt+nng;
-- 
-diff --git a/build/pkgs/gap_packages/patches/guava_leon_includes.patch b/build/pkgs/gap_packages/patches/guava_leon_includes.patch
-deleted file mode 100644
-index cdcd19cc3e8..00000000000
---- a/build/pkgs/gap_packages/patches/guava_leon_includes.patch
-+++ /dev/null
-@@ -1,13 +0,0 @@
----- a/pkg/guava-3.15/src/leon/src/generate.c	Sat Feb 29 09:02:10 2020
----- b/pkg/guava-3.15/src/leon/src/generate.c	Thu Sep 24 13:58:36 2020
--***************
--*** 115,120 ****
----- 115,122 ----
--  #include "groupio.h"
--  #include "enum.h"
--  #include "storage.h"
--+ #include "chbase.h"
--+ #include "inform.h"
--  
--  #ifdef ALT_TIME_HEADER
--  #include "cputime.h"
-diff --git a/build/pkgs/gap_packages/spkg-install.in b/build/pkgs/gap_packages/spkg-install.in
-index 168e6b11532..6dff182a48f 100644
---- a/build/pkgs/gap_packages/spkg-install.in
-+++ b/build/pkgs/gap_packages/spkg-install.in
-@@ -1,4 +1,4 @@
--GAP_ROOT="$SAGE_LOCAL/share/gap"
-+GAP_ROOT="$SAGE_LOCAL/lib/gap"
- PKG_DIR="$GAP_ROOT/pkg"
- 
- PKG_SRC_DIR="$(pwd)/src/pkg"
-@@ -11,33 +11,31 @@ cd "$PKG_SRC_DIR"
- #    (GAP 4.8.6 still had it, but this is gone in 4.10)
- 
- sdh_install \
--    aclib-* \
--    AutoDoc-* \
--    corelg-* \
--    crime-* \
-+    aclib \
-+    corelg \
-+    crime \
-     cryst \
-     crystcat \
--    design-* \
-+    design \
-     gbnp \
--    genss-* \
--    hap-* \
--    hapcryst-* \
--    hecke-* \
--    images-* \
--    liealgdb-* \
--    liepring-* \
--    liering-* \
--    loops-* \
--    MapClass-* \
--    polymaking-* \
--    qpa-* \
--    quagroup-* \
--    radiroot-* \
--    repsn-* \
--    sla-* \
--    sonata-* \
--    Toric-* \
--    utils-* \
-+    genss \
-+    hap \
-+    hapcryst \
-+    hecke \
-+    images \
-+    liealgdb \
-+    liepring \
-+    liering \
-+    loops \
-+    mapclass \
-+    polymaking \
-+    qpa \
-+    quagroup \
-+    repsn \
-+    singular \
-+    sla \
-+    sonata \
-+    toric \
-     "$PKG_DIR"
- 
- install_compiled_pkg()
-@@ -45,27 +43,23 @@ install_compiled_pkg()
-     local pkg="$1"
-     # Install the bin/ dir (where compiled modules should end up)
-     # under <prefix>/lib/gap; we then symlink to it later
--    sdh_install bin "$SAGE_LOCAL/lib/gap/pkg/$pkg"
-+    sdh_install * "$SAGE_LOCAL/lib/gap/pkg/$pkg"
- 
-+    # TODO:
-     # Clean up any build artificts before installing the rest of the package
-     # Also remove configure/Makefiles
-     # Note: None, if any of the packages really have a proper install target
--    make clean  # Works for some packages but not all
--    rm -rf bin/
--    rm -rf configure configure.* config.* autogen.sh *.m4 Makefile* m4/
-+    #make clean  # Works for some packages but not all
-+    #rm -rf bin/
-+    #rm -rf configure configure.* config.* autogen.sh *.m4 Makefile* m4/
- 
--    # Create the bin/ symlink
--    ln -s "$SAGE_LOCAL/lib/gap/pkg/$pkg/bin" bin
--
--    # Install the rest of the package files
--    sdh_install * "$PKG_DIR/$pkg"
- }
- 
- # Build and install compiled packages:
- #
- # These packages have an old ./configure that take the GAP_ROOT as a positional
- # argument
--for pkg in cohomolo-* crypting-* grape-* guava-* orb-* datastructures-*
-+for pkg in cohomolo crypting grape guava orb datastructures
- do
-     echo "Building GAP package $pkg"
-     CFLAGS="$CFLAGS -Wno-implicit-function-declaration"
-@@ -91,7 +85,7 @@ pararr=( " " " " "--with-external-planarity" "--with-external-libsemigroups" )
- ##############################################################################
- 
- parind=0
--for pkg in nq-* io-* digraphs-* semigroups-*
-+for pkg in nq io digraphs semigroups
- do
-     echo "Building GAP package $pkg"
-     cd "$PKG_SRC_DIR/$pkg"
-diff --git a/build/pkgs/libsemigroups/checksums.ini b/build/pkgs/libsemigroups/checksums.ini
-index 62c4268515f..4e13a36cb35 100644
---- a/build/pkgs/libsemigroups/checksums.ini
-+++ b/build/pkgs/libsemigroups/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=libsemigroups-VERSION.tar.gz
--sha1=2b16c095cc5ffd3f77a71dfbf48cce188e054c03
--md5=7082cadcf7a195ccb93175cd72b6db95
--cksum=1501022358
-+sha1=86375824b47ce4b0e23570122e873f67136d0c0a
-+md5=ff79ad5fbc8bfeb64d48faaf24106b98
-+cksum=2845045455
- upstream_url=https://github.com/libsemigroups/libsemigroups/releases/download/vVERSION/libsemigroups-VERSION.tar.gz
-diff --git a/build/pkgs/libsemigroups/package-version.txt b/build/pkgs/libsemigroups/package-version.txt
-index 9084fa2f716..f90b1afc082 100644
---- a/build/pkgs/libsemigroups/package-version.txt
-+++ b/build/pkgs/libsemigroups/package-version.txt
-@@ -1 +1 @@
--1.1.0
-+2.3.2
-diff --git a/build/pkgs/libsemigroups/spkg-install.in b/build/pkgs/libsemigroups/spkg-install.in
-index 2aaf0e99043..128b54d2f99 100644
---- a/build/pkgs/libsemigroups/spkg-install.in
-+++ b/build/pkgs/libsemigroups/spkg-install.in
-@@ -1,4 +1,4 @@
- cd src
--sdh_configure
-+sdh_configure --disable-eigen
- sdh_make
- sdh_make_install
-diff --git a/build/pkgs/singular/spkg-configure.m4 b/build/pkgs/singular/spkg-configure.m4
-index d4d145defe3..6a85631f624 100644
---- a/build/pkgs/singular/spkg-configure.m4
-+++ b/build/pkgs/singular/spkg-configure.m4
-@@ -9,52 +9,7 @@ SAGE_SPKG_CONFIGURE([singular], [
-        AC_MSG_CHECKING([that Singular's help is working])
-        AS_IF([test x`printf "system(\"--browser\", \"builtin\"); \n help;" | Singular 2>&1 | grep "error occurred"` = x], [
-         AC_MSG_RESULT(yes)
--        dnl We have Singular. Now determine the shared library path on
--        dnl platforms on which sage.libs.singular needs to reload the library with RTLD_GLOBAL.
--        AS_CASE([$host_os],
--          [cygwin*], [dnl Nothing to do
--                     ],
--                     [dnl Use pkg-config to get singular's libdir while we're at it. As a
--                      dnl moral compromise for using pkg-config, this ultimately allows us
--                      dnl to pass an absolute path to dlopen(), which is the only approach
--                      dnl that POSIX guarantees will work.
--                      PKG_CHECK_VAR([SINGULAR_LIB_DIR], [Singular], [libdir])
--                      dnl The acl_shlibext variable is set in the top-level configure.ac.
--                      AC_LANG_PUSH(C)
--                      ORIG_LIBS="${LIBS}"
--                      LIBS="${LIBS} -ldl"
--                      AC_MSG_CHECKING([if we can dlopen($LIBSINGULAR_PATH)])
--                      LIBSINGULAR_PATH="${SINGULAR_LIB_DIR}/libSingular.${acl_shlibext}"
--
--                      dnl if we can dlopen() it, substitute the name for sage_conf;
--                      dnl otherwise, fall back to using the SPKG.
--                      AC_RUN_IFELSE(
--                        [AC_LANG_PROGRAM(
--                          [[#include <dlfcn.h>]],
--                          [[void* h = dlopen("${LIBSINGULAR_PATH}", RTLD_LAZY | RTLD_GLOBAL);
--                            if (h == 0) { return 1; } else { return dlclose(h); }]]
--                        )], [
--                          AC_MSG_RESULT(yes)
--                        ], [
--                          dnl try Debian-specific name
--                          LIBSINGULAR_PATH="${SINGULAR_LIB_DIR}/libsingular-Singular.${acl_shlibext}"
--                          AC_RUN_IFELSE(
--                           [AC_LANG_PROGRAM(
--                             [[#include <dlfcn.h>]],
--                             [[void* h = dlopen("${LIBSINGULAR_PATH}", RTLD_LAZY | RTLD_GLOBAL);
--                               if (h == 0) { return 1; } else { return dlclose(h); }]]
--                           )], [
--                             AC_MSG_RESULT(yes)
--                           ], [
--                            AC_MSG_RESULT(no)
--                            sage_spkg_install_singular=yes
--                          ], [AC_MSG_RESULT(yes)])
--                        ], [AC_MSG_RESULT(yes)])
--
--                      AC_LANG_POP()
--                      LIBS="${ORIG_LIBS}"
--                     ]
--       )], [
-+       ], [
-        AC_MSG_RESULT(no)
-        sage_spkg_install_singular=yes
-        ]
-@@ -64,20 +19,4 @@ SAGE_SPKG_CONFIGURE([singular], [
-       ])
-     ])
-   ])
--],[],[],[
--  dnl Post-check phase
--  dnl We make the sage_conf substitutions here, because the "default"
--  dnl substitution needs to be made even if we skipped the system-Singular
--  dnl checks themselves.
--  AS_IF([test "x${sage_spkg_install_singular}" = "xyes"], [
--    AS_CASE([$host_os],
--      [cygwin*], [dnl Nothing to do
--                 ],
--                 [dnl Set shared library path, needed for reloading the library with RTLD_GLOBAL
--                  LIBSINGULAR_PATH="\$SAGE_LOCAL/lib/libSingular.${acl_shlibext}"
--                 ]
--    )
--  ])
--
--  AC_SUBST(LIBSINGULAR_PATH, "${LIBSINGULAR_PATH}")
- ])
-diff --git a/pkgs/sage-conf/_sage_conf/_conf.py.in b/pkgs/sage-conf/_sage_conf/_conf.py.in
-index 6cd28f558a8..d66bdb3d264 100644
---- a/pkgs/sage-conf/_sage_conf/_conf.py.in
-+++ b/pkgs/sage-conf/_sage_conf/_conf.py.in
-@@ -55,9 +55,6 @@ THREEJS_DIR = SAGE_LOCAL + "/share/threejs-sage"
- OPENMP_CFLAGS = "@OPENMP_CFLAGS@"
- OPENMP_CXXFLAGS = "@OPENMP_CXXFLAGS@"
- 
--# The full absolute path to the main Singular library.
--LIBSINGULAR_PATH = "@LIBSINGULAR_PATH@".replace('$SAGE_LOCAL', SAGE_LOCAL)
--
- # Installation location of wheels. This is determined at configuration time
- # and does not depend on the installation location of sage-conf.
- SAGE_SPKG_WHEELS = "@SAGE_VENV@".replace('${SAGE_LOCAL}', SAGE_LOCAL) + "/var/lib/sage/wheels"
-diff --git a/src/doc/en/thematic_tutorials/lie/weyl_groups.rst b/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-index c917338e444..182e74aad20 100644
---- a/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-+++ b/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-@@ -139,12 +139,12 @@ string, which you can print::
-     X.1      1  1  1  1  1  1  1  1  1  1  1  1  1
-     X.2      1 -1  1  1 -1  1  1 -1 -1 -1  1  1  1
-     X.3      2  .  2 -1  .  2  2  .  .  . -1  2  2
--    X.4      3 -1 -1  .  1 -1  3 -1  1 -1  . -1  3
--    X.5      3 -1 -1  .  1  3 -1 -1 -1  1  . -1  3
--    X.6      3  1 -1  . -1 -1  3  1 -1  1  . -1  3
--    X.7      3  1 -1  . -1  3 -1  1  1 -1  . -1  3
--    X.8      3 -1  3  . -1 -1 -1 -1  1  1  . -1  3
--    X.9      3  1  3  .  1 -1 -1  1 -1 -1  . -1  3
-+    X.4      3 -1 -1  .  1  3 -1 -1 -1  1  . -1  3
-+    X.5      3  1 -1  . -1  3 -1  1  1 -1  . -1  3
-+    X.6      3 -1  3  . -1 -1 -1 -1  1  1  . -1  3
-+    X.7      3 -1 -1  .  1 -1  3 -1  1 -1  . -1  3
-+    X.8      3  1  3  .  1 -1 -1  1 -1 -1  . -1  3
-+    X.9      3  1 -1  . -1 -1  3  1 -1  1  . -1  3
-     X.10     4 -2  . -1  .  .  .  2  .  .  1  . -4
-     X.11     4  2  . -1  .  .  . -2  .  .  1  . -4
-     X.12     6  . -2  .  . -2 -2  .  .  .  .  2  6
-diff --git a/src/sage/coding/codecan/autgroup_can_label.pyx b/src/sage/coding/codecan/autgroup_can_label.pyx
-index de5db985e0b..c83b9264e44 100644
---- a/src/sage/coding/codecan/autgroup_can_label.pyx
-+++ b/src/sage/coding/codecan/autgroup_can_label.pyx
-@@ -76,7 +76,7 @@ columns do share the same coloring::
-     ((1,),
-      (2,),
-      (3, 5, 4),
--     (6, 19, 16, 9, 21, 10, 8, 15, 14, 11, 20, 13, 12, 7, 17, 18))
-+     (6, 19, 16, 21, 9, 10, 15, 8, 20, 11, 14, 13, 7, 12, 18, 17))
- 
- We can also restrict the group action to linear isometries::
- 
-diff --git a/src/sage/coding/linear_code.py b/src/sage/coding/linear_code.py
-index a3ac3ca1547..bfb9f8696e8 100644
---- a/src/sage/coding/linear_code.py
-+++ b/src/sage/coding/linear_code.py
-@@ -465,27 +465,27 @@ def automorphism_group_gens(self, equivalence="semilinear"):
-             0
-             sage: C = codes.HammingCode(GF(4, 'z'), 3)
-             sage: C.automorphism_group_gens()
--            ([((1, 1, 1, 1, 1, z + 1, z, z + 1, z, z, z, 1, 1, z + 1, z + 1, z, z + 1, z, z + 1, z + 1, z + 1); (1,14,6,7,4,10,11,19)(2,8,16,13,3,17,21,15)(9,12,18,20), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((1, 1, 1, z, z + 1, 1, 1, 1, 1, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z); (1,13,14,20)(2,21,8,18,7,16,19,15)(3,10,5,12,17,9,6,4), Ring endomorphism of Finite Field in z of size 2^2
-+                Defn: z |--> z + 1),
-+              ((z, 1, z, z, z, z + 1, z, z, z, z, z, z, z + 1, z, z, z, z, z + 1, z, z, z); (1,11,5,12,3,19)(2,8)(6,18,13)(7,17,15)(9,10,14,16,20,21), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z + 1),
--              ((z + 1, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z + 1, 1, z, z + 1, z + 1, z); (1,18,6,19,2,9,17,10,13,14,21,11,4,5,12)(3,20,7,16,8), Ring endomorphism of Finite Field in z of size 2^2
--                Defn: z |--> z),
-               ((z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z); (), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-              362880)
-             sage: C.automorphism_group_gens(equivalence="linear")
--            ([((z + 1, 1, z + 1, z + 1, z + 1, z, 1, z, 1, 1, 1, 1, z + 1, z + 1, z + 1, z, z, 1, z, z, z); (1,15,2,8,16,18,3)(4,9,12,13,20,10,11)(5,21,14,6,7,19,17), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((z, 1, z + 1, z + 1, 1, z + 1, z, 1, z + 1, z + 1, 1, z, 1, z + 1, z, 1, z, 1, z + 1, 1, 1); (1,12,11,10,6,8,9,20,13,21,5,14,3,16,17,19,7,4,2,15,18), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((z + 1, z + 1, z + 1, z + 1, z + 1, 1, z, 1, z, z, z, 1, z, 1, 1, 1, z + 1, z + 1, z + 1, 1, z); (1,15,21,8,9)(2,18,5,3,11,16,7,10,19,13,12,4,17,6,20), Ring endomorphism of Finite Field in z of size 2^2
-+              ((z + 1, z + 1, z + 1, z, 1, 1, z, z, 1, z + 1, z, 1, 1, z, 1, z + 1, z, z + 1, z + 1, 1, z); (1,3,18,2,17,6,19)(4,15,13,20,7,14,16)(5,11,8,21,12,9,10), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
-               ((z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1); (), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-              181440)
-             sage: C.automorphism_group_gens(equivalence="permutational")
--            ([((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,19)(3,17)(4,21)(5,20)(7,14)(9,12)(10,16)(11,15), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,11)(3,10)(4,9)(5,7)(12,21)(14,20)(15,19)(16,17), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,11)(3,10)(4,9)(5,7)(12,21)(14,20)(15,19)(16,17), Ring endomorphism of Finite Field in z of size 2^2
-+              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (2,18)(3,19)(4,10)(5,16)(8,13)(9,14)(11,21)(15,20), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,17)(2,8)(3,14)(4,10)(7,12)(9,19)(13,18)(15,20), Ring endomorphism of Finite Field in z of size 2^2
-+              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,19)(3,17)(4,21)(5,20)(7,14)(9,12)(10,16)(11,15), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
-               ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (2,13)(3,14)(4,20)(5,11)(8,18)(9,19)(10,15)(16,21), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-@@ -691,10 +691,10 @@ def _canonize(self, equivalence):
-             sage: C_iso == aut_group_can_label.get_canonical_form()
-             True
-             sage: aut_group_can_label.get_autom_gens()
--            [((1, 1, 1, 1, 1, z + 1, z, z + 1, z, z, z, 1, 1, z + 1, z + 1, z, z + 1, z, z + 1, z + 1, z + 1); (1,14,6,7,4,10,11,19)(2,8,16,13,3,17,21,15)(9,12,18,20), Ring endomorphism of Finite Field in z of size 2^2
-+            [((1, 1, 1, z, z + 1, 1, 1, 1, 1, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z); (1,13,14,20)(2,21,8,18,7,16,19,15)(3,10,5,12,17,9,6,4), Ring endomorphism of Finite Field in z of size 2^2
-+               Defn: z |--> z + 1),
-+             ((z, 1, z, z, z, z + 1, z, z, z, z, z, z, z + 1, z, z, z, z, z + 1, z, z, z); (1,11,5,12,3,19)(2,8)(6,18,13)(7,17,15)(9,10,14,16,20,21), Ring endomorphism of Finite Field in z of size 2^2
-                Defn: z |--> z + 1),
--             ((z + 1, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z + 1, 1, z, z + 1, z + 1, z); (1,18,6,19,2,9,17,10,13,14,21,11,4,5,12)(3,20,7,16,8), Ring endomorphism of Finite Field in z of size 2^2
--               Defn: z |--> z),
-              ((z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z); (), Ring endomorphism of Finite Field in z of size 2^2
-                Defn: z |--> z)]
-         """
-diff --git a/src/sage/combinat/posets/posets.py b/src/sage/combinat/posets/posets.py
-index 2836d59d960..8c882d5ac3b 100644
---- a/src/sage/combinat/posets/posets.py
-+++ b/src/sage/combinat/posets/posets.py
-@@ -8813,7 +8813,7 @@ def _libgap_(self):
-             sage: libgap(P)  # optional - gap_packages
-             <A poset on 5 points>
-             sage: A = libgap(GF(2)).PosetAlgebra(P); A  # optional - gap_packages
--            <GF(2)[<quiver with 5 vertices and 5 arrows>]/<two-sided ideal in <GF(2)[<quiver with 5 vertices and 5 arrows>]>, (1 generators)>>
-+            <GF(2)[<quiver with 5 vertices and 5 arrows>]/<two-sided ideal in <GF(2)[<quiver with 5 vertices and 5 arrows>]>, (1 generator)>>
-             sage: A.Dimension()  # optional - gap_packages
-             13
-         """
-diff --git a/src/sage/combinat/root_system/hecke_algebra_representation.py b/src/sage/combinat/root_system/hecke_algebra_representation.py
-index 6b756bafc30..8ac99319bec 100644
---- a/src/sage/combinat/root_system/hecke_algebra_representation.py
-+++ b/src/sage/combinat/root_system/hecke_algebra_representation.py
-@@ -357,7 +357,7 @@ def Tw(self, word, signs=None, scalar=None):
-             sage: q1, q2 = K.gens()
-             sage: KW = W.algebra(K)
-             sage: x = KW.an_element(); x
--            123 + 3*32 + 2*3 + e
-+            123 + 3*2312 + 2*31 + e
- 
-             sage: T = KW.demazure_lusztig_operators(q1,q2)
-             sage: T12 = T.Tw( (1,2) )
-diff --git a/src/sage/combinat/symmetric_group_algebra.py b/src/sage/combinat/symmetric_group_algebra.py
-index b8a0bebab44..9bccba124c8 100644
---- a/src/sage/combinat/symmetric_group_algebra.py
-+++ b/src/sage/combinat/symmetric_group_algebra.py
-@@ -101,7 +101,7 @@ def SymmetricGroupAlgebra(R, W, category=None):
-         sage: SGA.group()
-         Weyl Group of type ['A', 3] (as a matrix group acting on the ambient space)
-         sage: SGA.an_element()
--        s1*s2*s3 + 3*s3*s2 + 2*s3 + 1
-+        s1*s2*s3 + 3*s2*s3*s1*s2 + 2*s3*s1 + 1
- 
-     The preferred way to construct the symmetric group algebra is to
-     go through the usual ``algebra`` method::
-diff --git a/src/sage/env.py b/src/sage/env.py
-index 911f34b1bc6..5f7aca8599c 100644
---- a/src/sage/env.py
-+++ b/src/sage/env.py
-@@ -197,7 +197,8 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- GRAPHS_DATA_DIR = var("GRAPHS_DATA_DIR", join(SAGE_SHARE, "graphs"))
- ELLCURVE_DATA_DIR = var("ELLCURVE_DATA_DIR", join(SAGE_SHARE, "ellcurves"))
- POLYTOPE_DATA_DIR = var("POLYTOPE_DATA_DIR", join(SAGE_SHARE, "reflexive_polytopes"))
--GAP_ROOT_DIR = var("GAP_ROOT_DIR", join(SAGE_SHARE, "gap"))
-+GAP_LIB_DIR = var("GAP_LIB_DIR", join(SAGE_LOCAL, "lib", "gap"))
-+GAP_SHARE_DIR = var("GAP_SHARE_DIR", join(SAGE_SHARE, "gap"))
- THEBE_DIR = var("THEBE_DIR", join(SAGE_SHARE, "thebe"))
- COMBINATORIAL_DESIGN_DATA_DIR = var("COMBINATORIAL_DESIGN_DATA_DIR", join(SAGE_SHARE, "combinatorial_designs"))
- CREMONA_MINI_DATA_DIR = var("CREMONA_MINI_DATA_DIR", join(SAGE_SHARE, "cremona"))
-@@ -229,12 +230,6 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- LIE_INFO_DIR = var("LIE_INFO_DIR", join(SAGE_LOCAL, "lib", "LiE"))
- SINGULAR_BIN = var("SINGULAR_BIN") or "Singular"
- 
--# The path to libSingular, to be passed to dlopen(). This will
--# typically be set to an absolute path in sage_conf, but the relative
--# fallback path here works on systems where dlopen() searches the
--# system's library locations.
--LIBSINGULAR_PATH = var("LIBSINGULAR_PATH", "libSingular.so")
--
- # OpenMP
- OPENMP_CFLAGS = var("OPENMP_CFLAGS", "")
- OPENMP_CXXFLAGS = var("OPENMP_CXXFLAGS", "")
-@@ -255,81 +250,6 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- SAGE_GAP_COMMAND = var('SAGE_GAP_COMMAND', _gap_cmd)
- 
- 
--def _get_shared_lib_path(*libnames: str) -> Optional[str]:
--    """
--    Return the full path to a shared library file installed in
--    ``$SAGE_LOCAL/lib`` or the directories associated with the
--    Python sysconfig.
--
--    This can also be passed more than one library name (e.g. for cases where
--    some library may have multiple names depending on the platform) in which
--    case the first one found is returned.
--
--    This supports most *NIX variants (in which ``lib<libname>.so`` is found
--    under ``$SAGE_LOCAL/lib``), macOS (same, but with the ``.dylib``
--    extension), and Cygwin (under ``$SAGE_LOCAL/bin/cyg<libname>.dll``,
--    or ``$SAGE_LOCAL/bin/cyg<libname>-*.dll`` for versioned DLLs).
--
--    For distributions like Debian that use a multiarch layout, we also try the
--    multiarch lib paths (i.e. ``/usr/lib/<arch>/``).
--
--    This returns ``None`` if no matching library file could be found.
--
--    EXAMPLES::
--
--        sage: from sage.env import _get_shared_lib_path
--        sage: "gap" in _get_shared_lib_path("gap")
--        True
--        sage: _get_shared_lib_path("an_absurd_lib") is None
--        True
--
--    """
--
--    for libname in libnames:
--        search_directories: List[Path] = []
--        patterns: List[str] = []
--        if sys.platform == 'cygwin':
--            # Later down we take the first matching DLL found, so search
--            # SAGE_LOCAL first so that it takes precedence
--            if SAGE_LOCAL:
--                search_directories.append(Path(SAGE_LOCAL) / 'bin')
--            search_directories.append(Path(sysconfig.get_config_var('BINDIR')))
--            # Note: The following is not very robust, since if there are multible
--            # versions for the same library this just selects one more or less
--            # at arbitrary. However, practically speaking, on Cygwin, there
--            # will only ever be one version
--            patterns = [f'cyg{libname}.dll', f'cyg{libname}-*.dll']
--        else:
--            if sys.platform == 'darwin':
--                ext = 'dylib'
--            else:
--                ext = 'so'
--
--            if SAGE_LOCAL:
--                search_directories.append(Path(SAGE_LOCAL) / 'lib')
--            libdir = sysconfig.get_config_var('LIBDIR')
--            if libdir is not None:
--                libdir = Path(libdir)
--                search_directories.append(libdir)
--
--                multiarchlib = sysconfig.get_config_var('MULTIARCH')
--                if multiarchlib is not None:
--                    search_directories.append(libdir / multiarchlib),
--
--            patterns = [f'lib{libname}.{ext}']
--
--        for directory in search_directories:
--            for pattern in patterns:
--                path = next(directory.glob(pattern), None)
--                if path is not None:
--                    return str(path.resolve())
--
--    # Just return None if no files were found
--    return None
--
--# locate libgap shared object
--GAP_SO = var("GAP_SO", _get_shared_lib_path("gap", ""))
--
- # post process
- if DOT_SAGE is not None and ' ' in DOT_SAGE:
-     if UNAME[:6] == 'CYGWIN':
-diff --git a/src/sage/groups/abelian_gps/abelian_group_gap.py b/src/sage/groups/abelian_gps/abelian_group_gap.py
-index a4b047113c5..86090b43535 100644
---- a/src/sage/groups/abelian_gps/abelian_group_gap.py
-+++ b/src/sage/groups/abelian_gps/abelian_group_gap.py
-@@ -338,7 +338,7 @@ def _element_constructor_(self, x, check=True):
-         if isinstance(x, AbelianGroupElement_gap):
-             try:
-                 if x in self._cover:
--                    x = self.gap().NaturalHomomorphism().Image(x.gap())
-+                    x = self._cover.gap().NaturalHomomorphismByNormalSubgroup(self._relations).Image(x.gap())
-                 else:
-                     x = x.gap()
-             except AttributeError:
-@@ -1043,7 +1043,7 @@ def natural_homomorphism(self):
-             From: Abelian group with gap, generator orders (4,)
-             To:   Quotient abelian group with generator orders (2,)
-         """
--        phi = self.gap().NaturalHomomorphism()
-+        phi = self._cover.gap().NaturalHomomorphismByNormalSubgroup(self._relations)
-         Hom = self._cover.Hom(self)
-         return Hom(phi)
- 
-diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py
-index 8d6e443683c..1beb01af87f 100644
---- a/src/sage/groups/finitely_presented.py
-+++ b/src/sage/groups/finitely_presented.py
-@@ -596,9 +596,9 @@ def gap(self):
-             sage: k = G.rewriting_system()
-             sage: k.gap()
-             Knuth Bendix Rewriting System for Monoid( [ a, A, b, B ] ) with rules
--            [ [ a^2, <identity ...> ], [ a*A, <identity ...> ],
--              [ A*a, <identity ...> ], [ b^2, <identity ...> ],
--              [ b*B, <identity ...> ], [ B*b, <identity ...> ] ]
-+            [ [ a*A, <identity ...> ], [ A*a, <identity ...> ],
-+              [ b*B, <identity ...> ], [ B*b, <identity ...> ],
-+              [ a^2, <identity ...> ], [ b^2, <identity ...> ] ]
-         """
-         return self._gap
- 
-diff --git a/src/sage/groups/fqf_orthogonal.py b/src/sage/groups/fqf_orthogonal.py
-index 7fc4dbe7548..e5eccd45942 100644
---- a/src/sage/groups/fqf_orthogonal.py
-+++ b/src/sage/groups/fqf_orthogonal.py
-@@ -143,7 +143,7 @@ class FqfOrthogonalGroup(AbelianGroupAutomorphismGroup_subgroup):
-         [2/3   0   0]
-         [  0 2/3   0]
-         [  0   0 4/3]
--        generated by 2 elements
-+        generated by 3 elements
-         sage: q = matrix.diagonal(QQ, [3/2, 1/4, 1/4])
-         sage: T = TorsionQuadraticForm(q)
-         sage: T.orthogonal_group().order()
-diff --git a/src/sage/groups/libgap_wrapper.pyx b/src/sage/groups/libgap_wrapper.pyx
-index d25121aa792..dc81b71635b 100644
---- a/src/sage/groups/libgap_wrapper.pyx
-+++ b/src/sage/groups/libgap_wrapper.pyx
-@@ -25,7 +25,7 @@ Note how we call the constructor of both superclasses to initialize
- its output via LibGAP::
- 
-     sage: FooGroup()
--    <pc group of size 3 with 1 generators>
-+    <pc group of size 3 with 1 generator>
-     sage: type(FooGroup().gap())
-     <class 'sage.libs.gap.element.GapElement'>
- 
-@@ -106,7 +106,7 @@ class ParentLibGAP(SageObject):
-         ....:         ParentLibGAP.__init__(self, lg)
-         ....:         Group.__init__(self)
-         sage: FooGroup()
--        <pc group of size 3 with 1 generators>
-+        <pc group of size 3 with 1 generator>
-     """
- 
-     def __init__(self, libgap_parent, ambient=None):
-@@ -461,7 +461,7 @@ cdef class ElementLibGAP(MultiplicativeGroupElement):
-         ....:         ParentLibGAP.__init__(self, lg)
-         ....:         Group.__init__(self)
-         sage: FooGroup()
--        <pc group of size 3 with 1 generators>
-+        <pc group of size 3 with 1 generator>
-         sage: FooGroup().gens()
-         (f1,)
-     """
-diff --git a/src/sage/groups/matrix_gps/finitely_generated.py b/src/sage/groups/matrix_gps/finitely_generated.py
-index a6d3dc02513..63956ad5f10 100644
---- a/src/sage/groups/matrix_gps/finitely_generated.py
-+++ b/src/sage/groups/matrix_gps/finitely_generated.py
-@@ -563,9 +563,6 @@ def as_permutation_group(self, algorithm=None, seed=None):
-             21499084800
-             sage: P = G.as_permutation_group()
-             sage: Psmaller = G.as_permutation_group(algorithm="smaller", seed=6)
--            sage: P == Psmaller  # see the note below
--            True
--            sage: Psmaller = G.as_permutation_group(algorithm="smaller")
-             sage: P == Psmaller
-             False
-             sage: P.cardinality()
-diff --git a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-index f2ccca042ac..47d6862333c 100644
---- a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-+++ b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-@@ -427,7 +427,7 @@ cdef class LabelledBranching:
-             sage: from sage.groups.perm_gps.partn_ref2.refinement_generic import LabelledBranching
-             sage: L = LabelledBranching(3)
-             sage: L.small_generating_set()
--            []
-+            [()]
-             sage: L.add_gen(libgap.eval('(1,2,3)'))
-             sage: L.small_generating_set()
-             [(1,2,3)]
-diff --git a/src/sage/groups/perm_gps/permgroup.py b/src/sage/groups/perm_gps/permgroup.py
-index ebdf7c4c6eb..fb14008c8e0 100644
---- a/src/sage/groups/perm_gps/permgroup.py
-+++ b/src/sage/groups/perm_gps/permgroup.py
-@@ -926,7 +926,7 @@ def _coerce_map_from_(self, G):
-            sage: f = PG._coerce_map_from_(MG)
-            sage: mg = MG.an_element()
-            sage: p = f(mg); p
--           (2,33,32,23,31,55)(3,49,38,44,40,28)(4,17,59,62,58,46)(5,21,47,20,43,8)(6,53,50)(7,37,12,57,14,29)(9,41,56,34,64,10)(11,25,19)(13,61,26,51,22,15)(16,45,36)(18,27,35,48,52,54)(24,63,42)(30,39,60)
-+           (1,2,6,19,35,33)(3,9,26,14,31,23)(4,13,5)(7,22,17)(8,24,12)(10,16,32,27,20,28)(11,30,18)(15,25,36,34,29,21)
-            sage: PG(p._gap_()) == p
-            True
- 
-@@ -972,12 +972,12 @@ def _coerce_map_from_(self, G):
-             sage: P = G.as_permutation_group(algorithm='smaller', seed=5)
-             sage: P1 = G.as_permutation_group()
-             sage: P == P1
--            False
-+            True
-             sage: g1, g2, g3 = G.gens()
-             sage: P(g1*g2)
--            (1,3,7,12)(2,4,8,10)(5,11)(6,9)
-+            (1,4,13,11)(2,5,14,18)(3,15,8,16)(6,7)(9,20,19,12)(10,17)
-             sage: P1(g1*g2)
--            (2,29,25,68)(3,57,13,54)(4,11,72,37)(5,39,60,23)(6,64,75,63)(7,21,50,73)(8,46,38,32)(9,74,35,18)(10,44,49,48)(12,16,34,71)(14,79,27,40)(15,26)(17,62,59,76)(19,78,70,65)(20,22,58,51)(24,33,36,43)(28,81,80,52)(30,53,56,69)(31,61)(41,42,67,55)(45,77)(47,66)
-+            (1,4,13,11)(2,5,14,18)(3,15,8,16)(6,7)(9,20,19,12)(10,17)
- 
-         Another check for :trac:`5583`::
- 
-@@ -1302,7 +1302,7 @@ def gens_small(self):
-             sage: G.gens_small() # random
-             [('b','c'), ('a','c','b')] ## (on 64-bit Linux)
-             [('a','b'), ('a','c','b')] ## (on Solaris)
--            sage: len(G.gens_small()) == 2
-+            sage: len(G.gens_small()) == 2 # random
-             True
-         """
-         gens = self._libgap_().SmallGeneratingSet()
-@@ -4370,17 +4370,23 @@ def is_transitive(self, domain=None):
- 
-         ::
- 
--            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)]]) #S_5 on [1..5]
--            sage: G.is_transitive([1,4,5])
-+            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)],[(6,7)]])
-+            sage: G.is_transitive([1,2,3,4,5])
-             True
--            sage: G.is_transitive([2..6])
-+            sage: G.is_transitive([1..7])
-             False
-             sage: G.is_transitive(G.non_fixed_points())
--            True
-+            False
-             sage: H = PermutationGroup([[(1,2,3)],[(4,5,6)]])
-             sage: H.is_transitive(H.non_fixed_points())
-             False
- 
-+        If `G` does not act on the domain, it always returns ``False``::
-+
-+            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)]]) #S_5 on [1..5]
-+            sage: G.is_transitive([1,4,5])
-+            False
-+
-         Note that this differs from the definition in GAP, where
-         ``IsTransitive`` returns whether the group is transitive on the
-         set of points moved by the group.
-@@ -4436,12 +4442,16 @@ def is_primitive(self, domain=None):
-             sage: G = PermutationGroup([[(1,2,3,4)],[(2,4)]])
-             sage: G.is_primitive([1..4])
-             False
--            sage: G.is_primitive([1,2,3])
--            True
-             sage: G = PermutationGroup([[(3,4,5,6)],[(3,4)]]) #S_4 on [3..6]
-             sage: G.is_primitive(G.non_fixed_points())
-             True
- 
-+        If `G` does not act on the domain, it always returns ``False``::
-+
-+            sage: G = PermutationGroup([[(1,2,3,4)],[(2,4)]])
-+            sage: G.is_primitive([1,2,3])
-+            False
-+
-         """
-         #If the domain is not a subset of self.domain(), then the
-         #action isn't primitive.
-diff --git a/src/sage/interfaces/gap.py b/src/sage/interfaces/gap.py
-index 7ae1792e9de..ecaa9fd2341 100644
---- a/src/sage/interfaces/gap.py
-+++ b/src/sage/interfaces/gap.py
-@@ -1512,6 +1512,8 @@ def gap_reset_workspace(max_workspace_size=None, verbose=False):
-     """
-     # Create new workspace with filename WORKSPACE
-     g = Gap(use_workspace_cache=False, max_workspace_size=None)
-+    g.eval('ColorPrompt(false)')
-+    g.eval('SetUserPreference("UseColorPrompt", false)')
-     g.eval('SetUserPreference("HistoryMaxLines", 30)')
-     from sage.tests.gap_packages import all_installed_packages
-     for pkg in all_installed_packages(gap=g):
-diff --git a/src/sage/interfaces/gap_workspace.py b/src/sage/interfaces/gap_workspace.py
-index 33a87dd5076..03b40be6856 100644
---- a/src/sage/interfaces/gap_workspace.py
-+++ b/src/sage/interfaces/gap_workspace.py
-@@ -16,7 +16,8 @@
- import os
- import time
- import hashlib
--from sage.env import DOT_SAGE, GAP_SO
-+import subprocess
-+from sage.env import DOT_SAGE, HOSTNAME, GAP_LIB_DIR, GAP_SHARE_DIR
- 
- 
- def gap_workspace_file(system="gap", name="workspace", dir=None):
-@@ -59,11 +60,13 @@ def gap_workspace_file(system="gap", name="workspace", dir=None):
-     if dir is None:
-         dir = os.path.join(DOT_SAGE, 'gap')
- 
--    if GAP_SO:
--        h = hashlib.sha1(GAP_SO.encode('utf-8')).hexdigest()
--    else:
--        h = 'unknown'
--    return os.path.join(dir, '%s-%s-%s' % (system, name, h))
-+    data = f'{GAP_LIB_DIR}:{GAP_SHARE_DIR}'
-+    for path in GAP_LIB_DIR, GAP_SHARE_DIR:
-+        sysinfo = os.path.join(path, "sysinfo.gap")
-+        if os.path.exists(sysinfo):
-+            data += subprocess.getoutput(f'. "{sysinfo}" && echo ":$GAP_VERSION:$GAParch"')
-+    h = hashlib.sha1(data.encode('utf-8')).hexdigest()
-+    return os.path.join(dir, f'{system}-{name}-{HOSTNAME}-{h}')
- 
- 
- def prepare_workspace_dir(dir=None):
-diff --git a/src/sage/libs/gap/element.pyx b/src/sage/libs/gap/element.pyx
-index c555ea0333c..e3db3934baf 100644
---- a/src/sage/libs/gap/element.pyx
-+++ b/src/sage/libs/gap/element.pyx
-@@ -130,6 +130,7 @@ cdef char *capture_stdout(Obj func, Obj obj):
-     """
-     cdef Obj s, stream, output_text_string
-     cdef UInt res
-+    cdef TypOutputFile output
-     # The only way to get a string representation of an object that is truly
-     # consistent with how it would be represented at the GAP REPL is to call
-     # ViewObj on it.  Unfortunately, ViewObj *prints* to the output stream,
-@@ -145,12 +146,12 @@ cdef char *capture_stdout(Obj func, Obj obj):
-         output_text_string = GAP_ValueGlobalVariable("OutputTextString")
-         stream = CALL_2ARGS(output_text_string, s, GAP_True)
- 
--        if not OpenOutputStream(stream):
-+        if not OpenOutputStream(&output, stream):
-             raise GAPError("failed to open output capture stream for "
-                            "representing GAP object")
- 
-         CALL_1ARGS(func, obj)
--        CloseOutput()
-+        CloseOutput(&output)
-         return CSTR_STRING(s)
-     finally:
-         GAP_Leave()
-diff --git a/src/sage/libs/gap/gap_includes.pxd b/src/sage/libs/gap/gap_includes.pxd
-index 6d22e32540b..6111d18a5c7 100644
---- a/src/sage/libs/gap/gap_includes.pxd
-+++ b/src/sage/libs/gap/gap_includes.pxd
-@@ -76,8 +76,10 @@ cdef extern from "gap/intobj.h" nogil:
- 
- 
- cdef extern from "gap/io.h" nogil:
--    UInt OpenOutputStream(Obj stream)
--    UInt CloseOutput()
-+    ctypedef struct TypOutputFile:
-+        pass
-+    UInt OpenOutputStream(TypOutputFile* output, Obj stream)
-+    UInt CloseOutput(TypOutputFile* output)
- 
- 
- cdef extern from "gap/libgap-api.h" nogil:
-diff --git a/src/sage/libs/gap/libgap.pyx b/src/sage/libs/gap/libgap.pyx
-index b1a64e57939..6a36613aa8c 100644
---- a/src/sage/libs/gap/libgap.pyx
-+++ b/src/sage/libs/gap/libgap.pyx
-@@ -695,7 +695,7 @@ class Gap(Parent):
-             sage: libgap.List
-             <Gap function "List">
-             sage: libgap.GlobalRandomSource
--            <RandomSource in IsGlobalRandomSource>
-+            <RandomSource in IsGAPRandomSource>
-         """
-         if name in dir(self.__class__):
-             return getattr(self.__class__, name)
-diff --git a/src/sage/libs/gap/saved_workspace.py b/src/sage/libs/gap/saved_workspace.py
-index ad5adec36d0..7636707f557 100644
---- a/src/sage/libs/gap/saved_workspace.py
-+++ b/src/sage/libs/gap/saved_workspace.py
-@@ -8,7 +8,7 @@
- 
- import os
- import glob
--from sage.env import GAP_ROOT_DIR
-+from sage.env import GAP_LIB_DIR
- from sage.interfaces.gap_workspace import gap_workspace_file
- 
- 
-@@ -31,7 +31,7 @@ def timestamp():
-     """
-     libgap_dir = os.path.dirname(__file__)
-     libgap_files = glob.glob(os.path.join(libgap_dir, '*'))
--    gap_packages = glob.glob(os.path.join(GAP_ROOT_DIR, 'pkg', '*'))
-+    gap_packages = glob.glob(os.path.join(GAP_LIB_DIR, 'pkg', '*'))
-     files = libgap_files + gap_packages
-     if len(files) == 0:
-         print('Unable to find LibGAP files.')
-diff --git a/src/sage/libs/gap/util.pyx b/src/sage/libs/gap/util.pyx
-index 344ab88c42a..eaa659d64c7 100644
---- a/src/sage/libs/gap/util.pyx
-+++ b/src/sage/libs/gap/util.pyx
-@@ -13,7 +13,7 @@ Utility functions for GAP
- #*****************************************************************************
- 
- from libc.signal cimport signal, SIGCHLD, SIG_DFL
--from posix.dlfcn cimport dlopen, dlclose, RTLD_NOW, RTLD_GLOBAL
-+from posix.dlfcn cimport dlopen, dlclose, dlerror, RTLD_LAZY, RTLD_GLOBAL
- 
- from cpython.exc cimport PyErr_Fetch, PyErr_Restore
- from cpython.object cimport Py_LT, Py_LE, Py_EQ, Py_NE, Py_GT, Py_GE
-@@ -164,33 +164,6 @@ cdef void gasman_callback() with gil:
- ### Initialization of GAP ##################################################
- ############################################################################
- 
--def gap_root():
--    """
--    Find the location of the GAP root install which is stored in the gap
--    startup script.
--
--    EXAMPLES::
--
--        sage: from sage.libs.gap.util import gap_root
--        sage: gap_root()   # random output
--        '/home/vbraun/opt/sage-5.3.rc0/local/gap/latest'
--    """
--    if os.path.exists(sage.env.GAP_ROOT_DIR):
--        return sage.env.GAP_ROOT_DIR
--
--    # Attempt to figure out the appropriate GAP_ROOT by reading the
--    # local/bin/gap shell script; this is an ugly hack that exists for
--    # historical reasons; the best approach to setting where Sage looks for
--    # the appropriate GAP_ROOT is to set the GAP_ROOT_DIR variable
--    SAGE_LOCAL = sage.env.SAGE_LOCAL
--    with open(os.path.join(SAGE_LOCAL, 'bin', 'gap')) as f:
--        gap_sh = f.read().splitlines()
--    gapdir = next(x for x in gap_sh if x.strip().startswith('GAP_ROOT'))
--    gapdir = gapdir.split('"')[1]
--    gapdir = gapdir.replace('$SAGE_LOCAL', SAGE_LOCAL)
--    return gapdir
--
--
- # To ensure that we call initialize_libgap only once.
- cdef bint _gap_is_initialized = False
- 
-@@ -232,12 +205,12 @@ cdef initialize():
-     # this isn't portable
- 
-     cdef void* handle
--    libgapname = str_to_bytes(sage.env.GAP_SO)
--    handle = dlopen(libgapname, RTLD_NOW | RTLD_GLOBAL)
-+    # reload the current module to force reload of libgap (see #33446)
-+    lib = str_to_bytes(__loader__.path, FS_ENCODING, "surrogateescape")
-+    handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY)
-     if handle is NULL:
--        raise RuntimeError(
--                "Could not dlopen() libgap even though it should already "
--                "be loaded!")
-+        err = dlerror()
-+        raise RuntimeError(f"Could not reload gap library with RTLD_GLOBAL ({err})")
-     dlclose(handle)
- 
-     # Define argv variable, which we will pass in to
-@@ -245,7 +218,7 @@ cdef initialize():
-     cdef char* argv[16]
-     argv[0] = "sage"
-     argv[1] = "-l"
--    s = str_to_bytes(gap_root(), FS_ENCODING, "surrogateescape")
-+    s = str_to_bytes(sage.env.GAP_LIB_DIR + ";" + sage.env.GAP_SHARE_DIR, FS_ENCODING, "surrogateescape")
-     argv[2] = s
- 
-     argv[3] = "-m"
-@@ -362,15 +335,9 @@ cdef Obj gap_eval(str gap_string) except? NULL:
-         GAPError: Error, Variable: 'Complex' must have a value
-         Syntax error: ; expected in stream:1
-         Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^
-+                ^^^^^
-         Error, Variable: 'with' must have a value
--        Syntax error: ; expected in stream:1
--        Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^^^^^^^^^
-         Error, Variable: 'bits' must have a value
--        Syntax error: ; expected in stream:1
--        Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-         Error, Variable: 'precision' must have a value
- 
-     Test that on a subsequent attempt we get the same message (no garbage was
-diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx
-index d8ea7b07f3c..4beb1774df9 100644
---- a/src/sage/libs/singular/singular.pyx
-+++ b/src/sage/libs/singular/singular.pyx
-@@ -1705,14 +1705,7 @@ cdef object si2sa_intvec(intvec *v):
- cdef extern from *: # hack to get at cython macro
-     int unlikely(int)
- 
--cdef extern from "dlfcn.h":
--    void *dlopen(char *, long)
--    char *dlerror()
--    void dlclose(void *handle)
--
--cdef extern from "dlfcn.h":
--    cdef long RTLD_LAZY
--    cdef long RTLD_GLOBAL
-+from posix.dlfcn cimport dlopen, dlclose, dlerror, RTLD_LAZY, RTLD_GLOBAL
- 
- cdef int overflow_check(unsigned long e, ring *_ring) except -1:
-     """
-@@ -1762,8 +1755,6 @@ cdef init_libsingular():
- 
-     cdef void *handle = NULL
- 
--    from sage.env import LIBSINGULAR_PATH
--    lib = str_to_bytes(LIBSINGULAR_PATH, FS_ENCODING, "surrogateescape")
- 
-     # This is a workaround for https://github.com/Singular/Singular/issues/1113
-     # and can be removed once that fix makes it into release of Singular that
-@@ -1780,10 +1771,12 @@ cdef init_libsingular():
- 
-     import platform
-     if not platform.system().startswith("CYGWIN"):
-+        # reload the current module to force reload of libSingular (see #33446)
-+        lib = str_to_bytes(__loader__.path, FS_ENCODING, "surrogateescape")
-         handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY)
-         if not handle:
-             err = dlerror()
--            raise ImportError(f"cannot load Singular library from {LIBSINGULAR_PATH} ({err})")
-+            raise RuntimeError(f"Could not reload Singular library with RTLD_GLOBAL ({err})")
- 
-     # load SINGULAR
-     siInit(lib)
-diff --git a/src/sage/tests/gap_packages.py b/src/sage/tests/gap_packages.py
-index 2e4518ca226..c302b169b8a 100644
---- a/src/sage/tests/gap_packages.py
-+++ b/src/sage/tests/gap_packages.py
-@@ -103,7 +103,7 @@ def all_installed_packages(ignore_dot_gap=False, gap=None):
- 
-         sage: from sage.tests.gap_packages import all_installed_packages
-         sage: all_installed_packages()
--        (...'GAPDoc'...)
-+        (...'gapdoc'...)
-         sage: all_installed_packages(ignore_dot_gap=True) == all_installed_packages(gap=gap, ignore_dot_gap=True)
-         True
-     """
diff --git a/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch b/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
deleted file mode 100644
index d331a6573e1c..000000000000
--- a/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/src/sage/data_structures/stream.py b/src/sage/data_structures/stream.py
-index f8f6dc6a186..002e925f02f 100644
---- a/src/sage/data_structures/stream.py
-+++ b/src/sage/data_structures/stream.py
-@@ -2090,8 +2090,8 @@ def compute_product(self, n, la):
-             sage: f = Stream_exact([1]) # irrelevant for this test
-             sage: g = Stream_function(lambda n: s[n], True, 0)
-             sage: h = Stream_plethysm(f, g, True, p)
--            sage: B = p[2, 2, 1](sum(s[i] for i in range(7)))
--            sage: all(h.compute_product(k, Partition([2, 2, 1])) == B.restrict_degree(k) for k in range(7))
-+            sage: B = p[2, 2, 1](sum(p(s[i]) for i in range(7)))  # long time
-+            sage: all(h.compute_product(k, Partition([2, 2, 1])) == B.restrict_degree(k) for k in range(7))  # long time
-             True
-         """
-         # This is the approximate order of the result
diff --git a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch b/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
deleted file mode 100644
index 007f3324cfe4..000000000000
--- a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index b77c69b2f77..0586a96ae55 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -563,7 +563,7 @@ def complex_to_cmap_rgb(z_values, cmap='turbo', contoured=False, tiled=False,
-     import matplotlib as mpl
- 
-     if isinstance(cmap, str):
--        cmap = mpl.cm.get_cmap(cmap)
-+        cmap = mpl.colormaps[cmap]
- 
-     if contour_base is None:
-         if contour_type == "linear":
-@@ -1206,11 +1206,11 @@ def complex_plot(f, x_range, y_range, contoured=False, tiled=False, cmap=None,
-                 domain = np.linspace(0, 1, 256)
-                 shifted_domain = np.roll(domain, 128)
-                 default_cmap = mpl.colors.LinearSegmentedColormap.from_list(
--                    "sage_default", mpl.cm.get_cmap('hsv')(shifted_domain)
-+                    "sage_default", mpl.colormaps['hsv'](shifted_domain)
-                 )
-                 cmap = default_cmap
-             else:
--                cmap = mpl.cm.get_cmap(cmap)
-+                cmap = mpl.colormaps[cmap]
-         rgbs = complex_to_cmap_rgb(
-             z_values, cmap=cmap, contoured=contoured, tiled=tiled,
-             contour_type=contour_type, contour_base=contour_base,
-diff --git a/src/sage/plot/contour_plot.py b/src/sage/plot/contour_plot.py
-index c0cab456686..4accb309580 100644
---- a/src/sage/plot/contour_plot.py
-+++ b/src/sage/plot/contour_plot.py
-@@ -848,9 +848,7 @@ def f(x,y): return cos(x) + sin(y)
- 
-         sage: contour_plot(lambda x,y: 0, (-1,1), (-1,1),
-         ....:              contours=[0], fill=False, cmap=['blue'])
--        ...
--        UserWarning: No contour levels were found within the data range.
--        Graphics object consisting of 1 graphics primitive
-+        ...Graphics object consisting of 1 graphics primitive
- 
-     .. PLOT::
- 
-@@ -874,8 +872,7 @@ def f(x,y): return cos(x) + sin(y)
-     Check that :trac:`18074` is fixed::
- 
-         sage: contour_plot(0, (0,1), (0,1))
--        ... UserWarning: No contour levels were found within the data range.
--        Graphics object consisting of 1 graphics primitive
-+        ...Graphics object consisting of 1 graphics primitive
- 
-     Domain points in :trac:`11648` with complex output are now skipped::
- 
-diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
-index 64ea1a7e10f..cdc99ced263 100644
---- a/src/sage/plot/graphics.py
-+++ b/src/sage/plot/graphics.py
-@@ -2341,7 +2341,7 @@ def _matplotlib_tick_formatter(self, subplot, base=(10, 10),
-             sage: subplot = Figure().add_subplot(111)
-             sage: p._objects[0]._render_on_subplot(subplot)
-             sage: p._matplotlib_tick_formatter(subplot, **d)
--            (<AxesSubplot:...>,
-+            (<Axes...>,
-             <matplotlib.ticker.MaxNLocator object at ...>,
-             <matplotlib.ticker.MaxNLocator object at ...>,
-             <matplotlib.ticker.ScalarFormatter object at ...>,
-diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
-index 99c817f03a6..ae85183dc93 100644
---- a/src/sage/plot/multigraphics.py
-+++ b/src/sage/plot/multigraphics.py
-@@ -1207,7 +1207,7 @@ def _add_subplot(self, figure, index, **options):
-             sage: fig = Figure()
-             sage: ax1 = G._add_subplot(fig, 0)
-             sage: type(ax1)
--            <class 'matplotlib.axes._subplots.AxesSubplot'>
-+            <class 'matplotlib.axes...'>
-             sage: ax2 = G._add_subplot(fig, 1)
-             sage: fig.get_axes() == [ax1, ax2]
-             True
-diff --git a/src/sage/plot/plot3d/plot_field3d.py b/src/sage/plot/plot3d/plot_field3d.py
-index bdf39391d3e..fe10e27f58f 100644
---- a/src/sage/plot/plot3d/plot_field3d.py
-+++ b/src/sage/plot/plot3d/plot_field3d.py
-@@ -126,9 +126,9 @@ def plot_vector_field3d(functions, xrange, yrange, zrange,
-     vectors = [vector((ff(*point), gg(*point), hh(*point))) for point in points]
- 
-     try:
--        from matplotlib.cm import get_cmap
--        cm = get_cmap(colors)
--    except (TypeError, ValueError):
-+        import matplotlib as mpl
-+        cm = mpl.colormaps[colors]
-+    except (TypeError, KeyError):
-         cm = None
-     if cm is None:
-         if isinstance(colors, (list, tuple)):
diff --git a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch b/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
deleted file mode 100644
index 1e0a708e8068..000000000000
--- a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py
-index c9ca5e30939..9459cb70334 100644
---- a/src/sage/interfaces/maxima_lib.py
-+++ b/src/sage/interfaces/maxima_lib.py
-@@ -77,6 +77,26 @@
-     sage: bar == foo
-     True
- 
-+TESTS:
-+
-+Check our workaround for a race in ecl works, see :trac:`26968`.
-+We use a temporary `MAXIMA_USERDIR` so it's empty; we place it
-+in `DOT_SAGE` since we expect it to have more latency than `/tmp`.
-+
-+    sage: import tempfile, subprocess
-+    sage: tmpdir = tempfile.TemporaryDirectory(dir=DOT_SAGE)
-+    sage: _ = subprocess.run(['sage', '-c',  # long time
-+    ....: f'''
-+    ....: import os
-+    ....: os.environ["MAXIMA_USERDIR"] = "{tmpdir.name}"
-+    ....: if not os.fork():
-+    ....:     import sage.interfaces.maxima_lib
-+    ....: else:
-+    ....:     import sage.interfaces.maxima_lib
-+    ....:     os.wait()
-+    ....: '''])
-+    sage: tmpdir.cleanup()
-+
- """
- 
- # ****************************************************************************
-@@ -116,7 +136,23 @@
- ecl_eval("(setq $nolabels t))")
- ecl_eval("(defvar *MAXIMA-LANG-SUBDIR* NIL)")
- ecl_eval("(set-locale-subdir)")
--ecl_eval("(set-pathnames)")
-+
-+try:
-+    ecl_eval("(set-pathnames)")
-+except RuntimeError:
-+    # Recover from :trac:`26968` by creating `*maxima-objdir*` here.
-+    # This cannot be done before calling `(set-pathnames)` since
-+    # `*maxima-objdir*` is computed there.
-+    # We use python `os.makedirs()` which is immune to the race.
-+    # Using `(ensure-directories-exist ...)` in lisp would be
-+    # subject to the same race condition and since `*maxima-objdir*`
-+    # has multiple components this is quite plausible to happen.
-+    maxima_objdir = ecl_eval("*maxima-objdir*").python()[1:-1]
-+    import os
-+    os.makedirs(maxima_objdir, exist_ok=True)
-+    # Call `(set-pathnames)` again to complete its job.
-+    ecl_eval("(set-pathnames)")
-+
- ecl_eval("(defun add-lineinfo (x) x)")
- ecl_eval('(defun principal nil (cond ($noprincipal (diverg)) ((not pcprntd) (merror "Divergent Integral"))))')
- ecl_eval("(remprop 'mfactorial 'grind)")  # don't use ! for factorials (#11539)
diff --git a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch b/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
deleted file mode 100644
index fc3e40da2a88..000000000000
--- a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff --git a/src/bin/sage-cleaner b/src/bin/sage-cleaner
-index e2e578eec60..dc7d8f0482e 100755
---- a/src/bin/sage-cleaner
-+++ b/src/bin/sage-cleaner
-@@ -99,6 +99,15 @@ def cleanup():
- 
-     return len(pid_list)
- 
-+def cleanup_cruft():
-+    """ remove directories leftover from improper shutdown """
-+    tmp_dirs = os.listdir(SAGE_TMP_ROOT)
-+    for dir_entry in tmp_dirs:
-+        baddir = os.path.join(SAGE_TMP_ROOT, dir_entry)
-+        if os.path.isdir(baddir):
-+            logger.warning('Removing old directory %s from SAGE_TMP_ROOT', baddir)
-+            rm_rf(baddir)
-+
- def kill_spawned_jobs(jobfile, parent_pid):
-     logger.info("Killing %s's spawned jobs", parent_pid)
-     killed_them_all = True
-@@ -193,6 +202,7 @@ if __name__ == '__main__':
-     setup_daemon()
-     fix_old_mistakes()
-     logger.info("Starting sage-cleaner with PID %s", os.getpid())
-+    cleanup_cruft()
- 
-     if len(sys.argv) > 1:
-         wait = int(sys.argv[1])
diff --git a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch b/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
deleted file mode 100644
index ea210e20ae52..000000000000
--- a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py
-index ec6a5c19e60..9dd7bc1cb1e 100644
---- a/src/sage/graphs/generators/families.py
-+++ b/src/sage/graphs/generators/families.py
-@@ -3660,7 +3660,7 @@ def nauty_gentreeg(options="", debug=False):
- 
-         sage: gen = graphs.nauty_gentreeg("4", debug=True)
-         sage: print(next(gen))
--        >A ...gentreeg Z=2:3 D=3 n=4
-+        >A ...gentreeg ...
-         sage: gen = graphs.nauty_gentreeg("4 -q", debug=True)
-         sage: next(gen)
-         ''
-@@ -3687,7 +3687,7 @@ def nauty_gentreeg(options="", debug=False):
-         sage: list(graphs.nauty_gentreeg("3 -x", debug=True))
-         ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n [res/mod] ...
-         sage: list(graphs.nauty_gentreeg("3", debug=True))
--        ['>A ...gentreeg Z=2:2 D=2 n=3\n', Graph on 3 vertices]
-+        ['>A ...gentreeg ...\n', Graph on 3 vertices]
-     """
-     import shlex
-     from sage.features.nauty import NautyExecutable
-diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py
-index df88bbe2713..1a8016976c2 100644
---- a/src/sage/graphs/graph_generators.py
-+++ b/src/sage/graphs/graph_generators.py
-@@ -966,7 +966,7 @@ def nauty_geng(self, options="", debug=False):
-             ...
-             ValueError: wrong format of parameter option
-             sage: list(graphs.nauty_geng("-c3", debug=True))
--            ['>E Usage: ...geng [-cCmtfbd#D#] [-uygsnh] [-lvq] ...
-+            ['>E Usage: ...geng ...\n']
-             sage: list(graphs.nauty_geng("-c 3", debug=True))
-             ['>A ...geng -cd1D2 n=3 e=2-3\n', Graph on 3 vertices, Graph on 3 vertices]
-         """
diff --git a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch b/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
deleted file mode 100644
index 46bda084e48e..000000000000
--- a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-diff --git a/src/sage/repl/inputhook.py b/src/sage/repl/inputhook.py
-index da5df0268c0..7f7894f6dcf 100644
---- a/src/sage/repl/inputhook.py
-+++ b/src/sage/repl/inputhook.py
-@@ -17,6 +17,8 @@
- 
- import select
- import errno
-+import contextlib
-+import io
- 
- from IPython import get_ipython
- from IPython.terminal.pt_inputhooks import register
-@@ -47,15 +49,27 @@ def install():
-     """
-     Install the Sage input hook
- 
--    EXAMPLES::
-+    EXAMPLES:
-+
-+    Make sure ipython is running so we really test this function::
-+
-+        sage: from sage.repl.interpreter import get_test_shell
-+        sage: get_test_shell()
-+        <sage.repl.interpreter.SageTestShell object at ...>
-+
-+    Run the function twice, to check it is idempotent (see :trac:`35235`)::
- 
-         sage: from sage.repl.inputhook import install
-         sage: install()
-+        sage: install()
-     """
-     ip = get_ipython()
-     if not ip:
-         return   # Not running in ipython, e.g. doctests
--    ip.enable_gui('sage')
-+    if ip._inputhook != sage_inputhook:
-+        # silence `ip.enable_gui()` useless output
-+        with contextlib.redirect_stdout(io.StringIO()):
-+            ip.enable_gui('sage')
- 
- 
- def uninstall():
-@@ -71,4 +85,6 @@ def uninstall():
-     if not ip:
-         return
-     if ip._inputhook == sage_inputhook:
--        ip.enable_gui(None)
-+        # silence `ip.enable_gui()` useless output
-+        with contextlib.redirect_stdout(io.StringIO()):
-+            ip.enable_gui(None)
diff --git a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch b/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
deleted file mode 100644
index 2cdc674d4f9e..000000000000
--- a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 532fbbaf71bb41c73920b584108eb2a09d6deeb1 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
-Date: Tue, 4 Apr 2023 12:56:57 -0300
-Subject: [PATCH] Ignore deprecation warnings triggered by pythran 0.12.1
-
-These happen with python 3.11, setuptools 67.6.1, numpy 1.24.2.
-When pythran 0.12.1 is installed, I get 24 doctest failures due to
-deprecation warnings; they are all gone with this commit.
-
-[backported from 839a6e928c264a9863bd42860c78ae95a6d9f3e0]
----
- src/sage/all.py | 12 ++++++++++--
- 1 file changed, 10 insertions(+), 2 deletions(-)
-
-diff --git a/src/sage/all.py b/src/sage/all.py
-index 93588df1b93..ee775aad0e9 100644
---- a/src/sage/all.py
-+++ b/src/sage/all.py
-@@ -96,9 +96,17 @@ warnings.filterwarnings('ignore', category=DeprecationWarning,
- warnings.filterwarnings('ignore', category=DeprecationWarning,
-     module='(.*[.]_vendor[.])?packaging')
- 
--# Ignore numpy warnings triggered by pythran
-+# Ignore a few warnings triggered by pythran 0.12.1
- warnings.filterwarnings('ignore', category=DeprecationWarning,
--                        module='pythran')
-+    message='\n\n  `numpy.distutils` is deprecated since NumPy 1.23.0',
-+    module='pythran.dist')
-+warnings.filterwarnings('ignore', category=DeprecationWarning,
-+    message='pkg_resources is deprecated as an API|'
-+            'Deprecated call to `pkg_resources.declare_namespace(.*)`',
-+    module='pkg_resources')
-+warnings.filterwarnings('ignore', category=DeprecationWarning,
-+    message='msvccompiler is deprecated and slated to be removed',
-+    module='distutils.msvccompiler')
- 
- warnings.filterwarnings('ignore', category=DeprecationWarning,
-                         message='The distutils(.sysconfig module| package) is deprecated',
--- 
-2.40.0
-
diff --git a/srcpkgs/sagemath/patches/35584-networkx_3.1.patch b/srcpkgs/sagemath/patches/35584-networkx_3.1.patch
index 66eedecff7c6..9331258986d3 100644
--- a/srcpkgs/sagemath/patches/35584-networkx_3.1.patch
+++ b/srcpkgs/sagemath/patches/35584-networkx_3.1.patch
@@ -1,8 +1,8 @@
 diff --git a/src/sage/graphs/graph.py b/src/sage/graphs/graph.py
-index c2e42bcbd3..b6a10efbf4 100644
+index c2e42bcbd38..0d13f071dc4 100644
 --- a/src/sage/graphs/graph.py
 +++ b/src/sage/graphs/graph.py
-@@ -6786,13 +6786,21 @@ def cliques_number_of(self, vertices=None, cliques=None):
+@@ -6786,13 +6786,26 @@ def cliques_number_of(self, vertices=None, cliques=None):
              {(0, 0): 2, (0, 1): 3, (0, 2): 2, (1, 0): 2, (1, 1): 3, (1, 2): 2}
              sage: F.cliques_number_of(vertices=[(0, 1), (1, 2)])
              {(0, 1): 3, (1, 2): 2}
@@ -18,15 +18,20 @@ index c2e42bcbd3..b6a10efbf4 100644
 +        if cliques is None:
 +            cliques = self.cliques_maximal()
 +
-+        if vertices in self: # single vertex
++        if vertices in self:  # single vertex
 +            return sum(1 for c in cliques if vertices in c)
-+        else:
-+            return { v : sum(1 for c in cliques if v in c)
-+                     for v in vertices or self }
++
++        from collections import Counter
++        count = Counter()
++
++        for c in cliques:
++            count.update(c)
++
++        return {v : count[v] for v in vertices or self}
  
      @doc_index("Clique-related methods")
      def cliques_get_max_clique_graph(self):
-@@ -7493,17 +7501,32 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
+@@ -7493,17 +7506,32 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
  
              sage: C = Graph('DJ{')
              sage: C.cliques_containing_vertex()
@@ -62,7 +67,7 @@ index c2e42bcbd3..b6a10efbf4 100644
  
          Since each clique of a 2 dimensional grid corresponds to an edge, the
          number of cliques in which a vertex is involved equals its degree::
-@@ -7518,8 +7541,14 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
+@@ -7518,8 +7546,20 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
              sage: sorted(sorted(x for x in L) for L in d[(0, 1)])
              [[(0, 0), (0, 1)], [(0, 1), (0, 2)], [(0, 1), (1, 1)]]
          """
@@ -71,11 +76,17 @@ index c2e42bcbd3..b6a10efbf4 100644
 +        if cliques is None:
 +            cliques = self.cliques_maximal()
 +
-+        if vertices in self: # single vertex
++        if vertices in self:  # single vertex
 +            return [c for c in cliques if vertices in c]
-+        else:
-+            return { v : [c for c in cliques if v in c]
-+                     for v in vertices or self }
++
++        from collections import defaultdict
++        d = defaultdict(list)
++
++        for c in cliques:
++            for v in c:
++                d[v].append(c)
++
++        return {v : d[v] for v in vertices or self}
  
      @doc_index("Clique-related methods")
      def clique_complex(self):
diff --git a/srcpkgs/sagemath/patches/35612-linbox_1.7.0.patch b/srcpkgs/sagemath/patches/35612-linbox_1.7.0.patch
new file mode 100644
index 000000000000..58dddf34a69d
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35612-linbox_1.7.0.patch
@@ -0,0 +1,64 @@
+diff --git a/src/sage/libs/linbox/conversion.pxd b/src/sage/libs/linbox/conversion.pxd
+index 7794c9edc39..1753277b1f1 100644
+--- a/src/sage/libs/linbox/conversion.pxd
++++ b/src/sage/libs/linbox/conversion.pxd
+@@ -177,9 +177,8 @@ cdef inline Vector_integer_dense new_sage_vector_integer_dense(P, DenseVector_in
+     - v -- linbox vector
+     """
+     cdef Vector_integer_dense res = P()
+-    cdef cppvector[Integer] * vec = &v.refRep()
+     cdef size_t i
+     for i in range(<size_t> res._degree):
+-        mpz_set(res._entries[i], vec[0][i].get_mpz_const())
++        mpz_set(res._entries[i], v.getEntry(i).get_mpz_const())
+ 
+     return res
+diff --git a/src/sage/libs/linbox/linbox.pxd b/src/sage/libs/linbox/linbox.pxd
+index 9112d151f8b..bfeda4b6042 100644
+--- a/src/sage/libs/linbox/linbox.pxd
++++ b/src/sage/libs/linbox/linbox.pxd
+@@ -32,7 +32,6 @@ cdef extern from "linbox/matrix/dense-matrix.h":
+         ctypedef Modular_double Field
+         ctypedef double Element
+         DenseMatrix_Modular_double(Field F, size_t m, size_t n)
+-        DenseMatrix_Modular_double(Field F, Element*, size_t m, size_t n)
+         void setEntry(size_t i, size_t j, Element& a)
+         Element &getEntry(size_t i, size_t j)
+ 
+@@ -42,7 +41,6 @@ cdef extern from "linbox/matrix/dense-matrix.h":
+         ctypedef Modular_float Field
+         ctypedef float Element
+         DenseMatrix_Modular_float(Field F, size_t m, size_t n)
+-        DenseMatrix_Modular_float(Field F, Element*, size_t m, size_t n)
+         void setEntry(size_t i, size_t j, Element& a)
+         Element &getEntry(size_t i, size_t j)
+ 
+@@ -101,7 +99,6 @@ cdef extern from "linbox/vector/vector.h":
+         DenseVector_integer (Field &F)
+         DenseVector_integer (Field &F, long& m)
+         DenseVector_integer (Field &F, cppvector[Integer]&)
+-        cppvector[Element]& refRep()
+         size_t size()
+         void resize(size_t)
+         void resize(size_t n, const Element&)
+diff --git a/src/sage/matrix/matrix_modn_dense_template.pxi b/src/sage/matrix/matrix_modn_dense_template.pxi
+index abf29badce6..68b869ce314 100644
+--- a/src/sage/matrix/matrix_modn_dense_template.pxi
++++ b/src/sage/matrix/matrix_modn_dense_template.pxi
+@@ -221,9 +221,14 @@ cdef inline linbox_echelonize_efd(celement modulus, celement* entries, Py_ssize_
+         return 0,[]
+ 
+     cdef ModField *F = new ModField(<long>modulus)
+-    cdef DenseMatrix *A = new DenseMatrix(F[0], <ModField.Element*>entries,<Py_ssize_t>nrows, <Py_ssize_t>ncols)
+-    cdef Py_ssize_t r = reducedRowEchelonize(A[0])
++    cdef DenseMatrix *A = new DenseMatrix(F[0], nrows, ncols)
++
+     cdef Py_ssize_t i,j
++    for i in range(nrows):
++        for j in range(ncols):
++            A.setEntry(i, j, entries[i*ncols+j])
++
++    cdef Py_ssize_t r = reducedRowEchelonize(A[0])
+     for i in range(nrows):
+         for j in range(ncols):
+             entries[i*ncols+j] = <celement>A.getEntry(i,j)
diff --git a/srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch b/srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch
new file mode 100644
index 000000000000..0220b4300c30
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch
@@ -0,0 +1,569 @@
+diff --git a/build/pkgs/ecl/dependencies b/build/pkgs/ecl/dependencies
+index cda6316bf5a..51a953403e9 100644
+--- a/build/pkgs/ecl/dependencies
++++ b/build/pkgs/ecl/dependencies
+@@ -1,4 +1,4 @@
+-$(MP_LIBRARY) readline gc libffi
++$(MP_LIBRARY) readline gc libffi info
+ 
+ ----------
+ All lines of this file are ignored except the first.
+diff --git a/build/pkgs/ecl/spkg-configure.m4 b/build/pkgs/ecl/spkg-configure.m4
+index ae1e0ac5e1a..7dbcfa6377b 100644
+--- a/build/pkgs/ecl/spkg-configure.m4
++++ b/build/pkgs/ecl/spkg-configure.m4
+@@ -35,10 +35,7 @@ SAGE_SPKG_CONFIGURE([ecl], [
+     AC_SUBST(SAGE_ECL_CONFIG, [$ECL_CONFIG])
+   fi
+ 
+-  # Maxima cannot yet be provided by the system, so we always use
++  # Kenzo cannot yet be provided by the system, so we always use
+   # the SAGE_LOCAL path for now.
+-  AC_SUBST(SAGE_MAXIMA_FAS, ['${prefix}'/lib/ecl/maxima.fas])
+-
+-  # Likewise for the optional Kenzo SPKG
+   AC_SUBST(SAGE_KENZO_FAS, ['${prefix}'/lib/ecl/kenzo.fas])
+ ])
+diff --git a/build/pkgs/ecl/spkg-install.in b/build/pkgs/ecl/spkg-install.in
+index ee1667aec16..72083337942 100644
+--- a/build/pkgs/ecl/spkg-install.in
++++ b/build/pkgs/ecl/spkg-install.in
+@@ -31,18 +31,6 @@ cp "$SAGE_ROOT"/config/config.* src
+ 
+ if [ x"$SAGE_SPKG_INSTALL_DOCS" != xyes ] ; then
+     ECL_CONFIGURE="$ECL_CONFIGURE --enable-manual=no"
+-else
+-    # ECL 2020 needs modern makeinfo
+-    command -v texi2any >/dev/null 2>&1
+-    if [ $? -ne 0 ]; then # texi2any not found -> makeinfo too old, if present
+-        ECL_CONFIGURE="$ECL_CONFIGURE --enable-manual=no"
+-    else
+-        if makeinfo -c foo 2>&1 | grep -q invalid; then
+-            # makeinfo found but does not support all options that ecl
+-            # likes to use
+-            ECL_CONFIGURE="$ECL_CONFIGURE --enable-manual=no"
+-        fi
+-    fi
+ fi
+ 
+ sdh_configure $SAGE_CONFIGURE_GMP \
+diff --git a/build/pkgs/giac/spkg-configure.m4 b/build/pkgs/giac/spkg-configure.m4
+index 5859e35f12e..b677184b7be 100644
+--- a/build/pkgs/giac/spkg-configure.m4
++++ b/build/pkgs/giac/spkg-configure.m4
+@@ -5,7 +5,7 @@ SAGE_SPKG_CONFIGURE([giac], [
+        m4_pushdef([GIAC_MAX_VERSION], [1.9.999])
+        AC_CACHE_CHECK([for giac >= ]GIAC_MIN_VERSION[, <= ]GIAC_MAX_VERSION, [ac_cv_path_GIAC], [
+          AC_PATH_PROGS_FEATURE_CHECK([GIAC], [giac], [
+-            giac_version=$($ac_path_GIAC --version 2> /dev/null | tail -1)
++            giac_version=$($ac_path_GIAC --version 2> /dev/null | tail -n -1)
+             AS_IF([test -n "$giac_version"], [
+                 AX_COMPARE_VERSION([$giac_version], [ge], GIAC_MIN_VERSION, [
+                     AX_COMPARE_VERSION([$giac_version], [le], GIAC_MAX_VERSION, [
+diff --git a/build/pkgs/info/spkg-configure.m4 b/build/pkgs/info/spkg-configure.m4
+index 0980a4b8ef8..85fe1ea4731 100644
+--- a/build/pkgs/info/spkg-configure.m4
++++ b/build/pkgs/info/spkg-configure.m4
+@@ -1,4 +1,14 @@
+ SAGE_SPKG_CONFIGURE([info], [
+   AC_PATH_PROG(INFO, info)
+-  AS_IF([test -z "${INFO}"], [sage_spkg_install_info=yes])
++  AS_IF([test -z "${INFO}"], [sage_spkg_install_info=yes
++    ], [
++     dnl very old makeinfo are not texi2any, newer are symlinks to texi2any
++     AC_PATH_PROG(TEXI2ANY, texi2any)
++     AS_IF([test -z "${TEXI2ANY}"], [sage_spkg_install_info=yes
++       ], [
++        AS_IF([makeinfo -c foo 2>&1 | grep -q invalid], [
++         dnl makeinfo found, but too old, and  does not support all options that ecl likes to use
++         sage_spkg_install_info=yes])
++       ])
++    ])
+ ])
+diff --git a/build/pkgs/info/spkg-install.in b/build/pkgs/info/spkg-install.in
+index 8086e4b2ec8..3ea8c053669 100644
+--- a/build/pkgs/info/spkg-install.in
++++ b/build/pkgs/info/spkg-install.in
+@@ -1,2 +1,2 @@
+-cd src/info
++cd src
+ sdh_make_install
+diff --git a/build/pkgs/info/type b/build/pkgs/info/type
+index 134d9bc32d5..a6a7b9cd726 100644
+--- a/build/pkgs/info/type
++++ b/build/pkgs/info/type
+@@ -1 +1 @@
+-optional
++standard
+diff --git a/build/pkgs/maxima/checksums.ini b/build/pkgs/maxima/checksums.ini
+index a804c7b831f..0f594389fe6 100644
+--- a/build/pkgs/maxima/checksums.ini
++++ b/build/pkgs/maxima/checksums.ini
+@@ -1,5 +1,5 @@
+ tarball=maxima-VERSION.tar.gz
+-sha1=ed15d5285794413ba94412079eca3d0fa55a47bf
+-md5=9b9ae1dace55b1386739dabaa9122e60
+-cksum=1765409766
++sha1=1010594e6d6082bbd8efaac1b7756ec1721a4ed5
++md5=3c01f1daa6936e11d8713fef7751d3fe
++cksum=2420393096
+ upstream_url=https://sourceforge.net/projects/maxima/files/Maxima-source/VERSION-source/maxima-VERSION.tar.gz/download
+diff --git a/build/pkgs/maxima/distros/arch.txt b/build/pkgs/maxima/distros/arch.txt
+index 6400290f44d..6ac052fa62b 100644
+--- a/build/pkgs/maxima/distros/arch.txt
++++ b/build/pkgs/maxima/distros/arch.txt
+@@ -1 +1 @@
+-maxima-ecl
++maxima-fas
+diff --git a/build/pkgs/maxima/distros/cygwin.txt b/build/pkgs/maxima/distros/cygwin.txt
+new file mode 100644
+index 00000000000..f5fe3fdc6cb
+--- /dev/null
++++ b/build/pkgs/maxima/distros/cygwin.txt
+@@ -0,0 +1 @@
++maxima
+diff --git a/build/pkgs/maxima/distros/freebsd.txt b/build/pkgs/maxima/distros/freebsd.txt
+new file mode 100644
+index 00000000000..766a71b5074
+--- /dev/null
++++ b/build/pkgs/maxima/distros/freebsd.txt
+@@ -0,0 +1 @@
++math/maxima
+diff --git a/build/pkgs/maxima/distros/gentoo.txt b/build/pkgs/maxima/distros/gentoo.txt
+new file mode 100644
+index 00000000000..85fb33f1610
+--- /dev/null
++++ b/build/pkgs/maxima/distros/gentoo.txt
+@@ -0,0 +1,2 @@
++sci-mathematics/maxima[ecls]
++
+diff --git a/build/pkgs/maxima/package-version.txt b/build/pkgs/maxima/package-version.txt
+index 83476624dc0..5681375f3be 100644
+--- a/build/pkgs/maxima/package-version.txt
++++ b/build/pkgs/maxima/package-version.txt
+@@ -1 +1 @@
+-5.45.0.p0
++5.46.0
+diff --git a/build/pkgs/maxima/patches/matrixexp.patch b/build/pkgs/maxima/patches/matrixexp.patch
+deleted file mode 100644
+index 5c8527c33bf..00000000000
+--- a/build/pkgs/maxima/patches/matrixexp.patch
++++ /dev/null
+@@ -1,15 +0,0 @@
+-diff --git a/share/linearalgebra/matrixexp.lisp b/share/linearalgebra/matrixexp.lisp
+-index 218bf35..f2fd468 100644
+---- a/share/linearalgebra/matrixexp.lisp
+-+++ b/share/linearalgebra/matrixexp.lisp
+-@@ -138,8 +138,8 @@
+- 	   (print `(ratvars = ,$ratvars gcd = '$gcd algebraic = ,$algebraic))
+- 	   (print `(ratfac = ,$ratfac))
+- 	   (merror "Unable to find the spectrum")))
+--   
+--    (setq res ($fullratsimp (ncpower (sub (mult z ($ident n)) mat) -1) z))
+-+
+-+    (setq res ($fullratsimp ($invert_by_lu (sub (mult z ($ident n)) mat) '$crering) z))
+-     (setq m (length sp))
+-     (dotimes (i m)
+-       (setq zi (nth i sp))
+diff --git a/build/pkgs/maxima/patches/maxima.system.patch b/build/pkgs/maxima/patches/maxima.system.patch
+deleted file mode 100644
+index 74db62e7f9f..00000000000
+--- a/build/pkgs/maxima/patches/maxima.system.patch
++++ /dev/null
+@@ -1,25 +0,0 @@
+-diff --git a/src/maxima.system b/src/maxima.system
+-index 76f2452..cf25f51 100644
+---- a/src/maxima.system
+-+++ b/src/maxima.system
+-@@ -1,5 +1,8 @@
+- ;;; -*- Lisp -*-
+- 
+-+(require :cmp)
+-+(setf c::*compile-in-constants* t)
+-+
+- (in-package :cl-user)
+- 
+- (pushnew :cl *features*)
+-@@ -75,6 +78,11 @@
+- 			     ;; Convert dir/foo.fas to dir/foo.o
+- 			     (make-pathname :type "o" :defaults p))
+- 			 files)))
+-+	(c::build-fasl "binary-ecl/maxima" :lisp-files obj
+-+			  :ld-flags
+-+			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
+-+							      (find-package "MAXIMA")))))
+-+			    (if (and x (not (string= x ""))) (list x))))
+- 	(c::build-program "binary-ecl/maxima" :lisp-files obj
+- 			  :ld-flags
+- 			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
+diff --git a/build/pkgs/maxima/spkg-configure.m4 b/build/pkgs/maxima/spkg-configure.m4
+new file mode 100644
+index 00000000000..dc54525320e
+--- /dev/null
++++ b/build/pkgs/maxima/spkg-configure.m4
+@@ -0,0 +1,46 @@
++SAGE_SPKG_CONFIGURE([maxima], [
++  m4_pushdef([SAGE_MAXIMA_MINVER],["5.45.0"])dnl this version and higher allowed
++  SAGE_SPKG_DEPCHECK([ecl], [
++    dnl First check for the "maxima" executable in the user's PATH, because
++    dnl we still use pexpect to communicate with it in a few places.
++    AC_CACHE_CHECK([for Maxima >= $SAGE_MAXIMA_MINVER], [ac_cv_path_MAXIMA], [
++        AC_PATH_PROGS_FEATURE_CHECK([MAXIMA], [maxima], [
++            maxima_version=`$ac_path_MAXIMA --version 2>&1 | tail -n -1\
++                | $SED -n -e 's/Maxima *\([[0-9]]*\.[[0-9]]*\.[[0-9]]*\)/\1/p'`
++            AS_IF([test -n "$maxima_version"], [
++                AX_COMPARE_VERSION([$maxima_version], [ge], [SAGE_MAXIMA_MINVER], [
++                    ac_cv_path_MAXIMA="$ac_path_MAXIMA"
++                    ac_path_MAXIMA_found=:
++                ])
++            ])
++        ])
++    ])
++    SAGE_MAXIMA="$ac_cv_path_MAXIMA"
++    AS_IF([test -z "${SAGE_MAXIMA}"], [
++      sage_spkg_install_maxima=yes
++    ],[
++      dnl If we have the executable, check also for the ECL library.
++      AC_MSG_CHECKING([if ECL can "require" the maxima module])
++      AS_IF([ecl --eval "(require 'maxima)" --eval "(quit)" \
++               >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD], [
++        AC_MSG_RESULT(yes)
++      ], [
++        AC_MSG_RESULT(no)
++        sage_spkg_install_maxima=yes
++      ])
++    ])
++  ])
++  m4_popdef([SAGE_MAXIMA_MINVER])
++],[],[],[
++  # post-check
++  AS_IF([test x$sage_spkg_install_maxima = xyes], [
++    dnl Leaving this variable empty will tell sagelib to load
++    dnl the maxima library (within ECL) by name instead of by
++    dnl absolute path.
++    SAGE_MAXIMA='${prefix}'/bin/maxima
++    SAGE_MAXIMA_FAS='${prefix}'/lib/ecl/maxima.fas
++  ])
++
++  AC_SUBST(SAGE_MAXIMA, "${SAGE_MAXIMA}")
++  AC_SUBST(SAGE_MAXIMA_FAS, "${SAGE_MAXIMA_FAS}")
++])
+diff --git a/build/pkgs/maxima/spkg-install.in b/build/pkgs/maxima/spkg-install.in
+index 3ae6382f9ba..cdb6fbf2069 100644
+--- a/build/pkgs/maxima/spkg-install.in
++++ b/build/pkgs/maxima/spkg-install.in
+@@ -28,28 +28,6 @@ echo
+ echo "Now configuring Maxima..."
+ sdh_configure --enable-ecl git_found=false
+ 
+-# Note the following is regression in maxima build system
+-# see https://sourceforge.net/p/maxima/bugs/3278/
+-# and https://sourceforge.net/p/maxima/bugs/2878/
+-# For the previous time it was fixed.
+-#---------------------------------------------------------------
+-# Touching html and info file to avoid to regenerate them.
+-# This must be done after configuration since the timestamp need
+-# to be later than include-maxima.texi which is generated at
+-# configuration time
+-for i in doc/info/*.html ; do
+-    touch "${i}"
+-done
+-touch doc/info/maxima.info*
+-# Maxima 5.44.0 build_html.sh is not compatible with makeinfo 4.8
+-# (which is /usr/bin/makeinfo on macOS).  #30063
+-# Do not build the HTML docs unless the user asks for it,
+-# in which case it is their problem to install a better
+-# makeinfo version.
+-if [[ "$SAGE_SPKG_INSTALL_DOCS" != yes ]] ; then
+-touch doc/info/maxima_toc.html interfaces/xmaxima/doc/xmaxima.html
+-fi
+-
+ #---------------------------------------------------------------
+ 
+ sdh_make
+diff --git a/build/pkgs/tox/spkg-configure.m4 b/build/pkgs/tox/spkg-configure.m4
+index 7d8ade4c14b..3de0b9b710d 100644
+--- a/build/pkgs/tox/spkg-configure.m4
++++ b/build/pkgs/tox/spkg-configure.m4
+@@ -5,7 +5,7 @@ SAGE_SPKG_CONFIGURE([tox], [
+        m4_pushdef([TOX4_MIN_VERSION], [4.0.15])
+        AC_CACHE_CHECK([for tox 3 >= ]TOX3_MIN_VERSION[ or tox 4 >= ]TOX4_MIN_VERSION, [ac_cv_path_TOX], [
+          AC_PATH_PROGS_FEATURE_CHECK([TOX], [tox], [
+-            tox_version=$($ac_path_TOX --version 2> /dev/null | tail -1)
++            tox_version=$($ac_path_TOX --version 2> /dev/null | tail -n -1)
+             AS_IF([test -n "$tox_version"], [
+                 AX_COMPARE_VERSION([$tox_version], [lt], [4], [
+                     AX_COMPARE_VERSION([$tox_version], [ge], TOX3_MIN_VERSION, [
+diff --git a/pkgs/sage-conf/_sage_conf/_conf.py.in b/pkgs/sage-conf/_sage_conf/_conf.py.in
+index d66bdb3d264..f2e197b45ed 100644
+--- a/pkgs/sage-conf/_sage_conf/_conf.py.in
++++ b/pkgs/sage-conf/_sage_conf/_conf.py.in
+@@ -9,9 +9,11 @@ VERSION = "@PACKAGE_VERSION@"
+ SAGE_LOCAL = "@prefix@"
+ SAGE_ROOT = "@SAGE_ROOT@"
+ 
+-MAXIMA = "@prefix@/bin/maxima"
++# The path to the standalone maxima executable.
++MAXIMA = "@SAGE_MAXIMA@".replace('${prefix}', SAGE_LOCAL)
+ 
+-# Delete this line if your ECL can load maxima without further prodding.
++# Set this to the empty string if your ECL can load maxima without
++# further prodding.
+ MAXIMA_FAS = "@SAGE_MAXIMA_FAS@".replace('${prefix}', SAGE_LOCAL)
+ 
+ # Delete this line if your ECL can load Kenzo without further prodding.
+diff --git a/src/bin/sage-env b/src/bin/sage-env
+index a7da60df28f..13b54fa7e92 100644
+--- a/src/bin/sage-env
++++ b/src/bin/sage-env
+@@ -440,9 +440,6 @@ if [ -d "$DOT_SAGE" ] ; then
+     fi
+ fi
+ 
+-if [ -n "$SAGE_LOCAL" ]; then
+-    export MAXIMA_PREFIX="$SAGE_LOCAL"
+-fi
+ export MAXIMA_USERDIR="$DOT_SAGE/maxima"
+ 
+ if [ -n "$SAGE_LOCAL" ]; then
+diff --git a/src/sage/calculus/calculus.py b/src/sage/calculus/calculus.py
+index dae380180ac..ee8f632e94c 100644
+--- a/src/sage/calculus/calculus.py
++++ b/src/sage/calculus/calculus.py
+@@ -136,10 +136,11 @@
+     [          1/2*(e^(2*sqrt(x)) + 1)*e^(x - sqrt(x)) 1/2*(x*e^(2*sqrt(x)) - x)*sqrt(x)*e^(x - sqrt(x))]
+     [  1/2*(e^(2*sqrt(x)) - 1)*e^(x - sqrt(x))/x^(3/2)           1/2*(e^(2*sqrt(x)) + 1)*e^(x - sqrt(x))]
+ 
+-And complex exponentiation works now::
++Complex exponentiation works, but may require a patched version of
++maxima (:trac:`32898`) for now::
+ 
+     sage: M = i*matrix([[pi]])
+-    sage: e^M
++    sage: e^M  # not tested, requires patched maxima
+     [-1]
+     sage: M = i*matrix([[pi,0],[0,2*pi]])
+     sage: e^M
+@@ -1186,8 +1187,18 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
+         e
+         sage: f.limit(x=5)
+         7776/3125
+-        sage: f.limit(x=1.2)
++
++    Domain to real, a regression in 5.46.0, see https://sf.net/p/maxima/bugs/4138 ::
++
++        sage: maxima_calculus.eval("domain:real")
++        ...
++        sage: f.limit(x=1.2).n()
+         2.06961575467...
++        sage: maxima_calculus.eval("domain:complex");
++        ...
++
++    Otherwise, it works ::
++
+         sage: f.limit(x=I, taylor=True)
+         (-I + 1)^I
+         sage: f(x=1.2)
+@@ -1215,7 +1226,7 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
+     With this example, Maxima is looking for a LOT of information::
+ 
+         sage: assume(a>0)
+-        sage: limit(x^a,x=0)
++        sage: limit(x^a,x=0)  # random - maxima 5.46.0 does not need extra assumption
+         Traceback (most recent call last):
+         ...
+         ValueError: Computation failed since Maxima requested additional
+@@ -1224,7 +1235,7 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
+          more details)
+         Is a an integer?
+         sage: assume(a,'integer')
+-        sage: limit(x^a, x=0)
++        sage: limit(x^a, x=0)  # random - maxima 5.46.0 does not need extra assumption
+         Traceback (most recent call last):
+         ...
+         ValueError: Computation failed since Maxima requested additional
+@@ -2251,10 +2262,10 @@ def symbolic_expression_from_maxima_string(x, equals_sub=False, maxima=maxima):
+         True
+         sage: sefms("x # 3") == SR(x != 3)
+         True
+-        sage: solve([x != 5], x)
+-        [[x - 5 != 0]]
++        sage: solve([x != 5], x) in [[[x - 5 != 0]], [[x < 5], [5 < x]]]
++        True
+         sage: solve([2*x==3, x != 5], x)
+-        [[x == (3/2), (-7/2) != 0]]
++        [[x == (3/2)...
+ 
+     Make sure that we don't accidentally pick up variables in the maxima namespace (:trac:`8734`)::
+ 
+diff --git a/src/sage/functions/exp_integral.py b/src/sage/functions/exp_integral.py
+index e6c888c64b6..f314e525145 100644
+--- a/src/sage/functions/exp_integral.py
++++ b/src/sage/functions/exp_integral.py
+@@ -601,8 +601,8 @@ class Function_log_integral_offset(BuiltinFunction):
+         1/log(x)
+         sage: f.integrate(x)
+         -x*log_integral(2) + x*log_integral(x) - Ei(2*log(x))
+-        sage: Li(x).integrate(x,2.0,4.5)
+-        -2.5*log_integral(2) + 5.799321147411334
++        sage: Li(x).integrate(x,2.0,4.5).n(digits=10)
++        3.186411697
+         sage: N(f.integrate(x,2.0,3.0))   # abs tol 1e-15
+         0.601621785860587
+ 
+diff --git a/src/sage/interfaces/expect.py b/src/sage/interfaces/expect.py
+index 68ae715e4c3..84adf0341b5 100644
+--- a/src/sage/interfaces/expect.py
++++ b/src/sage/interfaces/expect.py
+@@ -620,7 +620,7 @@ def quit(self, verbose=False):
+ 
+             sage: a = maxima('y')
+             sage: maxima.quit(verbose=True)
+-            Exiting Maxima with PID ... running .../bin/maxima...
++            Exiting Maxima with PID ... running ...maxima...
+             sage: a._check_valid()
+             Traceback (most recent call last):
+             ...
+diff --git a/src/sage/interfaces/maxima.py b/src/sage/interfaces/maxima.py
+index 27b1e98a6ac..4829560f98b 100644
+--- a/src/sage/interfaces/maxima.py
++++ b/src/sage/interfaces/maxima.py
+@@ -622,11 +622,6 @@ def _start(self):
+             sage: m.is_running()
+             True
+ 
+-        Test that we can use more than 256MB RAM (see :trac:`6772`)::
+-
+-            sage: a = maxima(10)^(10^5)
+-            sage: b = a^600              # long time -- about 10-15 seconds
+-
+         """
+         Expect._start(self)
+         self._sendline(r":lisp (defun tex-derivative (x l r) (tex (if $derivabbrev (tex-dabbrev x) (tex-d x '\\partial)) l r lop rop ))")
+@@ -634,9 +629,6 @@ def _start(self):
+         # Don't use ! for factorials (#11539)
+         self._sendline(":lisp (remprop 'mfactorial 'grind)")
+ 
+-        # Remove limit on the max heapsize (since otherwise it defaults
+-        # to 256MB with ECL).
+-        self._sendline(":lisp (ext:set-limit 'ext:heap-size 0)")
+         self._eval_line('0;')
+ 
+         # set random seed
+diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py
+index c263ac65f02..bba8504aa92 100644
+--- a/src/sage/interfaces/maxima_lib.py
++++ b/src/sage/interfaces/maxima_lib.py
+@@ -934,8 +934,15 @@ def sr_limit(self, expr, v, a, dir=None):
+             e
+             sage: limit(f,x = 5)
+             7776/3125
+-            sage: limit(f,x = 1.2)
++
++        Domain to real, a regression in 5.46.0, see https://sf.net/p/maxima/bugs/4138 ::
++
++            sage: maxima_calculus.eval("domain:real")
++            ...
++            sage: limit(f,x = 1.2).n()
+             2.06961575467...
++            sage: maxima_calculus.eval("domain:complex");
++            ...
+             sage: var('a')
+             a
+             sage: limit(x^a,x=0)
+@@ -947,7 +954,7 @@ def sr_limit(self, expr, v, a, dir=None):
+             for more details)
+             Is a positive, negative or zero?
+             sage: assume(a>0)
+-            sage: limit(x^a,x=0)
++            sage: limit(x^a,x=0)  # random - not needed for maxima 5.46.0
+             Traceback (most recent call last):
+             ...
+             ValueError: Computation failed ...
+diff --git a/src/sage/matrix/matrix2.pyx b/src/sage/matrix/matrix2.pyx
+index e2e6449dfa9..15914b0be3e 100644
+--- a/src/sage/matrix/matrix2.pyx
++++ b/src/sage/matrix/matrix2.pyx
+@@ -15425,9 +15425,10 @@ cdef class Matrix(Matrix1):
+ 
+         TESTS:
+ 
+-        Check that sparse matrices are handled correctly (:trac:`28935`)::
++        Sparse matrices are handled correctly (:trac:`28935`), but may
++        require a patched version of maxima (:trac:`32898`) for now::
+ 
+-            sage: matrix.diagonal([0], sparse=True).exp()
++            sage: matrix.diagonal([0], sparse=True).exp()  # not tested, requires patched maxima
+             [1]
+             sage: matrix.zero(CBF, 2, sparse=True).exp()
+             [1.000000000000000                 0]
+diff --git a/src/sage/matrix/matrix_symbolic_dense.pyx b/src/sage/matrix/matrix_symbolic_dense.pyx
+index 19ca5c85cb2..58a25e002f6 100644
+--- a/src/sage/matrix/matrix_symbolic_dense.pyx
++++ b/src/sage/matrix/matrix_symbolic_dense.pyx
+@@ -402,7 +402,8 @@ cdef class Matrix_symbolic_dense(Matrix_generic_dense):
+             [1/2*(e^(2*x) + 1)*e^(-x) 1/2*(e^(2*x) - 1)*e^(-x)]
+             [1/2*(e^(2*x) - 1)*e^(-x) 1/2*(e^(2*x) + 1)*e^(-x)]
+ 
+-        Exp works on 0x0 and 1x1 matrices::
++        Exponentiation works on 0x0 and 1x1 matrices, but the 1x1 example
++        requires a patched version of maxima (:trac:`32898`) for now::
+ 
+             sage: m = matrix(SR,0,[]); m
+             []
+@@ -410,7 +411,7 @@ cdef class Matrix_symbolic_dense(Matrix_generic_dense):
+             []
+             sage: m = matrix(SR,1,[2]); m
+             [2]
+-            sage: m.exp()
++            sage: m.exp()  # not tested, requires patched maxima
+             [e^2]
+ 
+         Commuting matrices `m, n` have the property that
+@@ -451,7 +452,6 @@ cdef class Matrix_symbolic_dense(Matrix_generic_dense):
+             [                       0 1/2*(e^(2*x) + 1)*e^(-x) 1/2*(e^(2*x) - 1)*e^(-x)                        0]
+             [                       0 1/2*(e^(2*x) - 1)*e^(-x) 1/2*(e^(2*x) + 1)*e^(-x)                        0]
+             [1/2*(e^(2*x) - 1)*e^(-x)                        0                        0 1/2*(e^(2*x) + 1)*e^(-x)]
+-
+         """
+         if not self.is_square():
+             raise ValueError("exp only defined on square matrices")
+diff --git a/src/sage/symbolic/integration/integral.py b/src/sage/symbolic/integration/integral.py
+index c82e9ed73c3..e84ad357ee2 100644
+--- a/src/sage/symbolic/integration/integral.py
++++ b/src/sage/symbolic/integration/integral.py
+@@ -741,14 +741,14 @@ def integrate(expression, v=None, a=None, b=None, algorithm=None, hold=False):
+ 
+         sage: _ = var('x,y')
+         sage: f = log(x^2+y^2)
+-        sage: res = integral(f,x,0.0001414, 1.); res
++        sage: res = integral(f,x,1414/10^7, 1); res
+         Traceback (most recent call last):
+         ...
+-        ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(50015104*y^2-50015103>0)', see `assume?` for more details)
+-        Is 50015104*y^2-50015103 positive, negative or zero?
++        ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help ...
++        Is ... positive, negative or zero?
+         sage: assume(y>1)
+-        sage: res = integral(f,x,0.0001414, 1.); res
+-        2*y*arctan(1.0/y) - 2*y*arctan(0.0001414/y) + 1.0*log(1.0*y^2 + 1.0) - 0.0001414*log(1.0*y^2 + 1.9993959999999997e-08) - 1.9997172
++        sage: res = integral(f,x,1414/10^7, 1); res
++        -2*y*arctan(707/5000000/y) + 2*y*arctan(1/y) + log(y^2 + 1) - 707/5000000*log(y^2 + 499849/25000000000000) - 4999293/2500000
+         sage: nres = numerical_integral(f.subs(y=2), 0.0001414, 1.); nres
+         (1.4638323264144..., 1.6251803529759...e-14)
+         sage: res.subs(y=2).n()
+diff --git a/src/sage/symbolic/relation.py b/src/sage/symbolic/relation.py
+index 94813315181..a72ab547c76 100644
+--- a/src/sage/symbolic/relation.py
++++ b/src/sage/symbolic/relation.py
+@@ -1787,8 +1787,8 @@ def solve_ineq_fourier(ineq, vars=None):
+         sage: y = var('y')
+         sage: solve_ineq_fourier([x+y<9,x-y>4],[x,y])
+         [[y + 4 < x, x < -y + 9, y < (5/2)]]
+-        sage: solve_ineq_fourier([x+y<9,x-y>4],[y,x])
+-        [[y < min(x - 4, -x + 9)]]
++        sage: solve_ineq_fourier([x+y<9,x-y>4],[y,x])[0][0](x=42)
++        y < -33
+ 
+         sage: solve_ineq_fourier([x^2>=0])
+         [[x < +Infinity]]
diff --git a/srcpkgs/sagemath/patches/35635-sympy_1.12.patch b/srcpkgs/sagemath/patches/35635-sympy_1.12.patch
new file mode 100644
index 000000000000..9cfc69c2adb6
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35635-sympy_1.12.patch
@@ -0,0 +1,54 @@
+diff --git a/src/sage/calculus/calculus.py b/src/sage/calculus/calculus.py
+index dae380180ac..ca3c59e63d2 100644
+--- a/src/sage/calculus/calculus.py
++++ b/src/sage/calculus/calculus.py
+@@ -1690,8 +1690,11 @@ def laplace(ex, t, s, algorithm='maxima'):
+ 
+     Testing SymPy::
+ 
+-        sage: laplace(t^n, t, s, algorithm='sympy')
+-        (gamma(n + 1)/(s*s^n), 0, re(n) > -1)
++        sage: F, a, cond = laplace(t^n, t, s, algorithm='sympy')
++        sage: a, cond
++        (0, re(n) > -1)
++        sage: F.simplify()
++        s^(-n - 1)*gamma(n + 1)
+ 
+     Testing Maxima::
+ 
+@@ -1700,17 +1703,19 @@ def laplace(ex, t, s, algorithm='maxima'):
+ 
+     Check that :trac:`24212` is fixed::
+ 
+-        sage: laplace(cos(t^2), t, s, algorithm='sympy')
+-        (-1/2*sqrt(pi)*(sqrt(2)*cos(1/4*s^2)*fresnel_sin(1/2*sqrt(2)*s/sqrt(pi)) -
+-        sqrt(2)*fresnel_cos(1/2*sqrt(2)*s/sqrt(pi))*sin(1/4*s^2) - cos(1/4*pi + 1/4*s^2)),
+-        0, True)
++        sage: F, a, cond = laplace(cos(t^2), t, s, algorithm='sympy')
++        sage: a, cond
++        (0, True)
++        sage: F._sympy_().simplify()
++        sqrt(pi)*(sqrt(2)*sin(s**2/4)*fresnelc(sqrt(2)*s/(2*sqrt(pi))) -
++        sqrt(2)*cos(s**2/4)*fresnels(sqrt(2)*s/(2*sqrt(pi))) + cos(s**2/4 + pi/4))/2
+ 
+     Testing result from SymPy that Sage doesn't know how to handle::
+ 
+         sage: laplace(cos(-1/t), t, s, algorithm='sympy')
+         Traceback (most recent call last):
+         ...
+-        AttributeError: Unable to convert SymPy result (=meijerg(((), ()), ((-1/2, 0, 1/2), (0,)), s**2/16)/4) into Sage
++        AttributeError: Unable to convert SymPy result (=meijerg(((), ()), ((-1/2, 0, 1/2), (0,)), ...)/4) into Sage
+     """
+     if not isinstance(ex, (Expression, Function)):
+         ex = SR(ex)
+@@ -1817,8 +1822,8 @@ def inverse_laplace(ex, s, t, algorithm='maxima'):
+ 
+     Transform an expression involving a time-shift, via SymPy::
+ 
+-        sage: inverse_laplace(1/s^2*exp(-s), s, t, algorithm='sympy')
+-        -(log(e^(-t)) + 1)*heaviside(t - 1)
++        sage: inverse_laplace(1/s^2*exp(-s), s, t, algorithm='sympy').simplify()
++        (t - 1)*heaviside(t - 1)
+ 
+     The same instance with Giac::
+ 
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 871ae38577fd..049694826d20 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 URL_BASE_PR="https://github.com/sagemath/sage/pull/"
-URL_BASE_COMPARE="https://github.com/sagemath/sage/compare/9.8..."
+URL_BASE_COMPARE="https://github.com/sagemath/sage/compare/10.0..."
 
 case "$1" in
 	-n)  DO=echo ;;
@@ -15,49 +15,13 @@ get_pr() {
 	$DO wget "$URL_BASE_PR$pr.$ext" -O "$pr-$desc.patch"
 }
 
-get_trac() {
-	ticket=$1
-	desc=$(echo "$2" | sed -e 's/ /_/g')
-	commit=$3
-	$DO wget "$URL_BASE_COMPARE$commit.diff" -O "$ticket-$desc-$commit.patch"
-}
-
 # run from patches dir
 cd $(dirname "$0")
 
-# merged in 10.0.beta0
-get_trac 34851 "support singular 4.3.1.p3" 5e5737a0c
-get_pr 35068 "fix tests giac 1.9.0.35" patch
-
-# merged in 10.0.beta1
-get_pr 35058 "skip unstable tests klyachko"
-
-# merged in 10.0.beta2
-get_pr 34994 "fix tests numpy 1.24"
-get_pr 34997 "fix edge case of integer_check"
-
-# merged in 10.0.beta3
-get_pr 34995 "support tachyon 0.99.2"
-
-# merged in 10.0.beta4
-get_pr 34980 "avoid factoring in is_prime"
-
-# merged in 10.0.beta5
-get_pr 35094 "support gap 4.12"					# includes PR 35093
-
-# merged in 10.0.beta6
-get_pr 35127 "fix very slow test stream.py"
-get_pr 35177 "matplotlib 3.7"
-get_pr 35195 "workaround ecl race"
-get_pr 35204 "fix sage-cleaner"
-
-# merged in 10.0.beta7
-get_pr 35250 "nauty 2.8.6"
-
-# merged in 10.0.beta8
-#get_pr 35337 "ipython 8.11"
-get_pr 35423 "ipython 8.12"						# includes PR 35337
-get_pr 35438 "pythran 0.12.1"
+# positive review
+get_pr 35584 "networkx 3.1"
+get_pr 35612 "linbox 1.7.0"
+get_pr 35635 "sympy 1.12"
 
 # needs review
-get_pr 35584 "networkx 3.1"
+get_pr 35619 "maxima 5.46.0"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 66a543efd21d..6fc7c3b2b4a8 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=9.8
-revision=2
+version=10.0
+revision=1
 build_wrksrc=pkgs/sagemath-standard
 build_style=python3-module
 _bindir=/usr/lib/sagemath/$version/bin
@@ -31,8 +31,10 @@ short_desc="Open source mathematics software"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-or-later"
 homepage="http://sagemath.org/"
+changelog="https://github.com/sagemath/sage/releases"
 distfiles="https://github.com/sagemath/sage/archive/refs/tags/$version.tar.gz"
-checksum=2aff28bd1d18c2d526581f5298acb8336f5b92db5675a7403dec8eaf9a86bc4c
+checksum=60858efd0d1f2526486740962bf72c99f9141a56caf8395f3291fded276faf55
+nocross="due to ntl (flintlib), fflas-ffpack, givaro, linbox, cysignals, sympow, maxima"
 
 do_configure() {
 	# git tree needs bootstrapping

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [RFC] sagemath: update to 10.0.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (31 preceding siblings ...)
  2023-05-21 22:37 ` tornaria
@ 2023-05-21 22:39 ` tornaria
  2023-05-21 23:32 ` [PR PATCH] [Updated] " tornaria
                   ` (6 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: tornaria @ 2023-05-21 22:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 315 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43659#issuecomment-1556313404

Comment:
All checks passed.

It turns out that we don't really need https://github.com/sagemath/sage/pull/35658 so I'm removing it.

@dkwo: maybe you want to test it on aarch64.

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] sagemath: update to 10.0.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (32 preceding siblings ...)
  2023-05-21 22:39 ` tornaria
@ 2023-05-21 23:32 ` tornaria
  2023-05-23  1:19 ` dkwo
                   ` (5 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: tornaria @ 2023-05-21 23:32 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1696 bytes --]

There is an updated pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages sagemath-next
https://github.com/void-linux/void-packages/pull/43659

[RFC] sagemath: update to 10.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

This builds on top of #43225 for convenience.

#### Testing the changes
- I tested the changes in this PR: **briefly**

I've been following beta releases and now rc0 includes all of our patches :muscle:

All doctests pass with the version of packages in void except for `python-Babel` which must be updated (as in #43497) and is included  here as part of #43225.

I've switched my system sagemath to this version as everything seems to be working ok. The testsuite is 10-15% faster.

@dkwo: enjoy.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/43659.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-sagemath-next-43659.patch --]
[-- Type: text/x-diff, Size: 183196 bytes --]

From f1093e3bda16f481310d6db14fbcb1bdd1f9149c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Dec 2021 20:20:09 -0300
Subject: [PATCH 1/5] givaro: update to 4.2.0.

---
 srcpkgs/givaro/patches/197.patch | 28 ++++++++++++++++++++++++++++
 srcpkgs/givaro/template          |  9 ++++-----
 2 files changed, 32 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/givaro/patches/197.patch

diff --git a/srcpkgs/givaro/patches/197.patch b/srcpkgs/givaro/patches/197.patch
new file mode 100644
index 000000000000..bafaff3efbd9
--- /dev/null
+++ b/srcpkgs/givaro/patches/197.patch
@@ -0,0 +1,28 @@
+From ab3d332508c21daff41fb64a8658cdc7cc74fc47 Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
+Date: Thu, 16 Dec 2021 17:12:25 +0100
+Subject: [PATCH] dom_power argument is now an uint64_t to avoid problem with
+ 32bit machine
+
+---
+ src/kernel/system/givpower.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/kernel/system/givpower.h b/src/kernel/system/givpower.h
+index eb784872..5644264d 100644
+--- a/src/kernel/system/givpower.h
++++ b/src/kernel/system/givpower.h
+@@ -71,11 +71,11 @@ namespace Givaro {
+ 
+     //! dom_power
+     template<class D, class TT>
+-    TT& dom_power(TT& res, const TT& n, long l, const D& F)
++    TT& dom_power(TT& res, const TT& n, uint64_t l, const D& F)
+     {
+         if (l == 0) return F.assign(res,F.one) ;
+ 
+-        unsigned long p = (unsigned long) l ;
++        uint64_t p = l;
+         bool is_assg = false ;
+ 
+         TT puiss; F.init(puiss); F.assign(puiss,n) ;
diff --git a/srcpkgs/givaro/template b/srcpkgs/givaro/template
index 9c16de5b1974..52457c02a1ed 100644
--- a/srcpkgs/givaro/template
+++ b/srcpkgs/givaro/template
@@ -1,6 +1,6 @@
 # Template file for 'givaro'
 pkgname=givaro
-version=4.1.1
+version=4.2.0
 revision=1
 build_style=gnu-configure
 makedepends="gmpxx-devel"
@@ -8,16 +8,15 @@ short_desc="C++ library for arithmetic and algebraic computations"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="CECILL-B"
 homepage="https://github.com/linbox-team/givaro"
+changelog="https://github.com/linbox-team/givaro/raw/master/ChangeLog"
 distfiles="https://github.com/linbox-team/givaro/releases/download/v${version}/givaro-${version}.tar.gz"
-checksum=628049899386e91da245aee6cd446350fbca87e94863bc0d815066c08150487f
+checksum=865e228812feca971dfb6e776a7bc7ac959cf63ebd52b4f05492730a46e1f189
 nocross=yes
 
 build_options="native_build"
 
 if [ -z "$build_option_native_build" ]; then
-	configure_args="--enable-sse --enable-sse2
-	  --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42
-	  --disable-avx --disable-avx2 --disable-fma --disable-fma4"
+	configure_args="--without-archnative"
 fi
 
 post_install() {

From 7e656abf21dd10d2f32fd611331ab2a663e0afae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Dec 2021 20:20:17 -0300
Subject: [PATCH 2/5] fflas-ffpack: update to 2.5.0.

---
 srcpkgs/fflas-ffpack/patches/357.patch | 35 ++++++++++++++++++++++++++
 srcpkgs/fflas-ffpack/template          | 12 ++++-----
 2 files changed, 40 insertions(+), 7 deletions(-)
 create mode 100644 srcpkgs/fflas-ffpack/patches/357.patch

diff --git a/srcpkgs/fflas-ffpack/patches/357.patch b/srcpkgs/fflas-ffpack/patches/357.patch
new file mode 100644
index 000000000000..99fd34efd93b
--- /dev/null
+++ b/srcpkgs/fflas-ffpack/patches/357.patch
@@ -0,0 +1,35 @@
+From 9b6083c663096e9ca85775b79f1f27c848dbeb98 Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
+Date: Fri, 17 Dec 2021 10:27:02 +0100
+Subject: [PATCH] Fix SimdChooser: on not x86_64 machines its value could be an
+ nonexistant struct
+
+---
+ fflas-ffpack/fflas/fflas_simd.h | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/fflas-ffpack/fflas/fflas_simd.h b/fflas-ffpack/fflas/fflas_simd.h
+index bf5d30211..84ced0fd8 100644
+--- a/fflas-ffpack/fflas/fflas_simd.h
++++ b/fflas-ffpack/fflas/fflas_simd.h
+@@ -384,6 +384,20 @@ struct SimdChooser<T, true, true> // integral number
+ #endif
+ };
+ 
++#ifndef __x86_64__
++template <>
++struct SimdChooser<uint64_t, true, true>
++{
++    using value = NoSimd<uint64_t>;
++};
++
++template <>
++struct SimdChooser<int64_t, true, true>
++{
++    using value = NoSimd<int64_t>;
++};
++#endif
++
+ template <class T> using Simd = typename SimdChooser<T>::value;
+ 
+ // template <class T> struct SimdChooser<T, true> {
diff --git a/srcpkgs/fflas-ffpack/template b/srcpkgs/fflas-ffpack/template
index 557c644c00a4..2aa599703585 100644
--- a/srcpkgs/fflas-ffpack/template
+++ b/srcpkgs/fflas-ffpack/template
@@ -1,6 +1,6 @@
 # Template file for 'fflas-ffpack'
 pkgname=fflas-ffpack
-version=2.4.3
+version=2.5.0
 revision=1
 build_style=gnu-configure
 hostmakedepends="pkg-config"
@@ -10,15 +10,13 @@ short_desc="Finite Field Linear Algebra Subroutines / Package"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="LGPL-2.1-or-later"
 homepage="http://linbox-team.github.io/fflas-ffpack/"
-distfiles="https://github.com/linbox-team/fflas-ffpack/releases/download/${version}/fflas-ffpack-${version}.tar.gz"
-checksum=f372783a17a9899ee9f88d4c9421d80facccb95556146dad7020d07a03791cc9
+changelog="https://github.com/linbox-team/fflas-ffpack/raw/master/ChangeLog"
+distfiles="https://github.com/linbox-team/fflas-ffpack/releases/download/v${version}/fflas-ffpack-${version}.tar.gz"
+checksum=dafb4c0835824d28e4f823748579be6e4c8889c9570c6ce9cce1e186c3ebbb23
 nocross=yes
 
 build_options="native_build"
 
 if [ -z "$build_option_native_build" ]; then
-	configure_args="--enable-sse --enable-sse2
-	  --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42
-	  --disable-avx --disable-avx2 --disable-fma --disable-fma4
-	  --disable-avx512f --disable-avx512dq --disable-avx512vl"
+	configure_args="--without-archnative"
 fi

From 6abb23e5b351856e89445b095f1a1dbaf1607aab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Dec 2021 20:20:20 -0300
Subject: [PATCH 3/5] linbox: update to 1.7.0.

---
 srcpkgs/linbox/patches/292.patch              | 24 ++++++++++++
 srcpkgs/linbox/patches/294.patch              | 38 +++++++++++++++++++
 ...8adade10641f1f04f04b589753d928fb5443.patch | 35 -----------------
 .../remove-linboxsage-libs-from-pc.patch      | 23 -----------
 srcpkgs/linbox/template                       | 11 +++---
 5 files changed, 67 insertions(+), 64 deletions(-)
 create mode 100644 srcpkgs/linbox/patches/292.patch
 create mode 100644 srcpkgs/linbox/patches/294.patch
 delete mode 100644 srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch
 delete mode 100644 srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch

diff --git a/srcpkgs/linbox/patches/292.patch b/srcpkgs/linbox/patches/292.patch
new file mode 100644
index 000000000000..d3333cc23d0b
--- /dev/null
+++ b/srcpkgs/linbox/patches/292.patch
@@ -0,0 +1,24 @@
+From 49b9cccd0286980c1c1811c3b03df883ef0164df Mon Sep 17 00:00:00 2001
+From: Doug Torrance <dtorrance@piedmont.edu>
+Date: Tue, 14 Dec 2021 16:22:33 -0500
+Subject: [PATCH] Only register uint128_t as a TypeName when it's available.
+
+Otherwise, test-fft will fail when it isn't.
+---
+ tests/test-fft.C | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/tests/test-fft.C b/tests/test-fft.C
+index d19184c2d..5811ebc5d 100644
+--- a/tests/test-fft.C
++++ b/tests/test-fft.C
+@@ -55,7 +55,9 @@ REGISTER_TYPE_NAME(double);
+ REGISTER_TYPE_NAME(uint16_t);
+ REGISTER_TYPE_NAME(uint32_t);
+ REGISTER_TYPE_NAME(uint64_t);
++#ifdef __FFLASFFPACK_HAVE_INT128
+ REGISTER_TYPE_NAME(uint128_t);
++#endif
+ REGISTER_TYPE_NAME(Modular);
+ REGISTER_TYPE_NAME(ModularExtended);
+ 
diff --git a/srcpkgs/linbox/patches/294.patch b/srcpkgs/linbox/patches/294.patch
new file mode 100644
index 000000000000..7c645f165d39
--- /dev/null
+++ b/srcpkgs/linbox/patches/294.patch
@@ -0,0 +1,38 @@
+From f81a1f4a5e0835b7a0f3bb88a0fcbbaa32174cfa Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
+Date: Wed, 15 Dec 2021 16:00:39 +0100
+Subject: [PATCH] Only register uint128_t as a TypeName when it's available
+
+---
+ benchmarks/benchmark-fft.C                       | 2 ++
+ benchmarks/benchmark-polynomial-matrix-mul-fft.C | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/benchmarks/benchmark-fft.C b/benchmarks/benchmark-fft.C
+index 39b86c9d9..59a8be57c 100644
+--- a/benchmarks/benchmark-fft.C
++++ b/benchmarks/benchmark-fft.C
+@@ -54,7 +54,9 @@ REGISTER_TYPE_NAME(double);
+ REGISTER_TYPE_NAME(uint16_t);
+ REGISTER_TYPE_NAME(uint32_t);
+ REGISTER_TYPE_NAME(uint64_t);
++#ifdef __FFLASFFPACK_HAVE_INT128
+ REGISTER_TYPE_NAME(uint128_t);
++#endif
+ REGISTER_TYPE_NAME(Modular);
+ REGISTER_TYPE_NAME(ModularExtended);
+ 
+diff --git a/benchmarks/benchmark-polynomial-matrix-mul-fft.C b/benchmarks/benchmark-polynomial-matrix-mul-fft.C
+index e9b184bcf..7bf17f33e 100644
+--- a/benchmarks/benchmark-polynomial-matrix-mul-fft.C
++++ b/benchmarks/benchmark-polynomial-matrix-mul-fft.C
+@@ -65,7 +65,9 @@ REGISTER_TYPE_NAME(double);
+ REGISTER_TYPE_NAME(uint16_t);
+ REGISTER_TYPE_NAME(uint32_t);
+ REGISTER_TYPE_NAME(uint64_t);
++#ifdef __FFLASFFPACK_HAVE_INT128
+ REGISTER_TYPE_NAME(uint128_t);
++#endif
+ REGISTER_TYPE_NAME(Modular);
+ REGISTER_TYPE_NAME(ModularExtended);
+ 
diff --git a/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch b/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch
deleted file mode 100644
index 5afa078ec7b8..000000000000
--- a/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 892f8adade10641f1f04f04b589753d928fb5443 Mon Sep 17 00:00:00 2001
-From: Doug Torrance <dtorrance@piedmont.edu>
-Date: Sun, 9 May 2021 12:14:19 -0400
-Subject: [PATCH] Use std::ptrdiff_t for vector iterator difference type
-
-It was previously long (64-bit integers), but this will not be the
-case on 32-bit systems.
-
-Closes: #273
----
- linbox/vector/bit-vector.inl | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/linbox/vector/bit-vector.inl b/linbox/vector/bit-vector.inl
-index 5fa84b421..23a22ba47 100644
---- a/linbox/vector/bit-vector.inl
-+++ b/linbox/vector/bit-vector.inl
-@@ -46,7 +46,7 @@ namespace std
- 		typedef LinBox::BitVector::reference reference;
- 		typedef bool *pointer;
- 		typedef bool value_type;
--		typedef long difference_type;
-+		typedef std::ptrdiff_t difference_type;
- 	};
- 
- 	template <>
-@@ -56,7 +56,7 @@ namespace std
- 		typedef LinBox::BitVector::const_reference reference;
- 		typedef const bool *pointer;
- 		typedef bool value_type;
--		typedef long difference_type;
-+		typedef std::ptrdiff_t difference_type;
- 	};
- }
- 
diff --git a/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch b/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch
deleted file mode 100644
index c93915fb1b06..000000000000
--- a/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Backported from:
-
-From 426eb97ba762c7663884f57ead0909f2aa3cd6a5 Mon Sep 17 00:00:00 2001
-From: Cyril Bouvier <cyril.bouvier@lirmm.fr>
-Date: Thu, 17 Jan 2019 16:32:19 +0100
-Subject: [PATCH] Remove @LINBOXSAGE_LIBS@ from linbox.pc.in
-
----
- linbox.pc.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/linbox.pc.in b/linbox.pc.in
-index 278f127e4..c6b8091eb 100644
---- a/linbox.pc.in
-+++ b/linbox.pc.in
-@@ -9,6 +9,6 @@ Description: Exact Linear Algebra library
- URL: http://github.com/linbox-team/linbox
- Version: @VERSION@
- Requires: fflas-ffpack >= 2.4.0, givaro >= 4.1.0
--Libs: -L${libdir} -llinbox @LINBOXSAGE_LIBS@ @NTL_LIBS@ @MPFR_LIBS@ @FPLLL_LIBS@ @IML_LIBS@ @FLINT_LIBS@ @OCL_LIBS@
-+Libs: -L${libdir} -llinbox @NTL_LIBS@ @MPFR_LIBS@ @FPLLL_LIBS@ @IML_LIBS@ @FLINT_LIBS@ @OCL_LIBS@
- Cflags: @DEFAULT_CFLAGS@ -DDISABLE_COMMENTATOR -I${includedir} @NTL_CFLAGS@ @MPFR_CFLAGS@ @FPLLL_CFLAGS@  @IML_CFLAGS@ @FLINT_CFLAGS@ 
- \-------------------------------------------------------
diff --git a/srcpkgs/linbox/template b/srcpkgs/linbox/template
index 096a15b3390b..e6edacdd0a74 100644
--- a/srcpkgs/linbox/template
+++ b/srcpkgs/linbox/template
@@ -1,7 +1,7 @@
 # Template file for 'linbox'
 pkgname=linbox
-version=1.6.3
-revision=2
+version=1.7.0
+revision=1
 build_style=gnu-configure
 hostmakedepends="pkg-config"
 makedepends="fflas-ffpack"
@@ -9,16 +9,15 @@ short_desc="C++ library for exact, high-performance linear algebra"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="LGPL-2.1-or-later"
 homepage="https://linalg.org"
+changelog="https://github.com/linbox-team/linbox/raw/master/ChangeLog"
 distfiles="https://github.com/linbox-team/linbox/releases/download/v${version}/linbox-${version}.tar.gz"
-checksum=a58a188307b07c57964e844bceb99321d3043a8a4a1fccc082a54928bb9a0057
+checksum=6d2159fd395be0298362dd37f6c696676237bc8e2757341fbc46520e3b466bcc
 nocross=yes
 
 build_options="native_build"
 
 if [ -z "$build_option_native_build" ]; then
-	configure_args="--enable-sse --enable-sse2
-	  --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42
-	  --disable-avx --disable-avx2 --disable-fma --disable-fma4"
+	configure_args="--without-archnative"
 fi
 
 linbox-devel_package() {

From 4141aa1981dfc4ce5507e53cd8981e6e4efbeda6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Fri, 15 Apr 2022 14:25:08 -0300
Subject: [PATCH 4/5] maxima: update to 5.46.0, adopt.

Also:
 - disable sbcl on aarch64
 - don't makedepends on emacs (avoid a nocross build dep)
 - move maxima-emacs files to main pkg
---
 ...a43e5234305bd6f1de5909d4ce5d7e1ea864.patch | 24 -------------------
 srcpkgs/maxima/template                       | 20 ++++++++--------
 2 files changed, 10 insertions(+), 34 deletions(-)
 delete mode 100644 srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch

diff --git a/srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch b/srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch
deleted file mode 100644
index e1ac1e5f6086..000000000000
--- a/srcpkgs/maxima/patches/a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-commit a0d7a43e5234305bd6f1de5909d4ce5d7e1ea864
-Author: Robert Dodier <robert_dodier@users.sourceforge.net>
-Date:   Mon Oct 11 22:40:13 2021 -0700
-
-    Apply patch #80: "Build a FASL library, needed by SageMath"
-    
-    This modifies maxima.system for ECL only.
-
-diff --git a/src/maxima.system b/src/maxima.system
-index d954bc2b9..525fb778e 100644
---- a/src/maxima.system
-+++ b/src/maxima.system
-@@ -75,6 +75,11 @@
- 			     ;; Convert dir/foo.fas to dir/foo.o
- 			     (make-pathname :type "o" :defaults p))
- 			 files)))
-+	(c::build-fasl "binary-ecl/maxima" :lisp-files obj
-+			  :ld-flags
-+			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
-+							      (find-package "MAXIMA")))))
-+			    (if (and x (not (string= x ""))) (list x))))
- 	(c::build-program "binary-ecl/maxima" :lisp-files obj
- 			  :ld-flags
- 			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
diff --git a/srcpkgs/maxima/template b/srcpkgs/maxima/template
index 69e85ec833e8..f67b469e3dda 100644
--- a/srcpkgs/maxima/template
+++ b/srcpkgs/maxima/template
@@ -1,19 +1,21 @@
 # Template file for 'maxima'
 pkgname=maxima
-version=5.45.1
-revision=4
+version=5.46.0
+revision=1
 build_style=gnu-configure
 configure_args="$(vopt_enable clisp) $(vopt_enable sbcl sbcl-exec) $(vopt_enable ecl)"
-hostmakedepends="python3 perl emacs texinfo patchelf"
+hostmakedepends="python3 perl texinfo patchelf $(vopt_if ecl ecl)"
 makedepends="$(vopt_if clisp clisp) $(vopt_if sbcl sbcl) $(vopt_if ecl ecl)"
 depends="$(vopt_if clisp clisp) rlwrap"
 checkdepends="gnuplot"
 short_desc="Computer Algebra System"
-maintainer="Bosco Garcia <jboscogg@gmail.org>"
+maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-only"
 homepage="http://maxima.sourceforge.net"
+changelog="https://sourceforge.net/p/maxima/code/ci/master/tree/changelogs/ChangeLog-${version%.*}.md?format=raw"
 distfiles="${SOURCEFORGE_SITE}/maxima/maxima-${version}.tar.gz"
-checksum=fe9016276970bef214a1a244348558644514d7fdfaa4fc8b9d0e87afcbb4e7dc
+checksum=7390f06b48da65c9033e8b2f629b978b90056454a54022db7de70e2225aa8b07
+nocross=yes
 
 # maxima-sbcl is nopie and should NOT be stripped or it won't work
 nostrip_files=/usr/lib/maxima/$version/binary-sbcl/maxima
@@ -32,7 +34,7 @@ build_options_default="ecl"
 
 # sbcl is only available for these architectures
 case "$XBPS_TARGET_MACHINE" in
-	i686|x86_64*|armv7l|aarch64|ppc64le*)
+	i686|x86_64*|armv7l|ppc64le*)
 		build_options_default+=" sbcl"
 		;;
 esac
@@ -113,11 +115,9 @@ maxima-src_package() {
 }
 
 maxima-emacs_package() {
-	short_desc+=" - Emacs interface"
+	short_desc+=" - transitional dummy package"
 	depends="${sourcepkg}-${version}_${revision} virtual?emacs"
-	pkg_install() {
-		vmove usr/share/emacs
-	}
+	build_style=meta
 }
 
 xmaxima_package() {

From daf49041d54e084e9216c89b291499c41458bab1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 16 Feb 2023 22:53:33 -0300
Subject: [PATCH 5/5] sagemath: update to 10.0.

Also:
 - support networkx 3.1 (sagemath#35584)
 - support linbox 1.7.0 (sagemath#35612)
 - support maxima 5.46.0 (sagemath#35619)
 - support sympy 1.12 (sagemath#35635)
---
 srcpkgs/sagemath/files/sage_conf.py           |    1 -
 srcpkgs/sagemath/files/timings2.json          |  405 ++---
 ...-support_singular_4.3.1.p3-5e5737a0c.patch |  205 ---
 .../34980-avoid_factoring_in_is_prime.patch   |   49 -
 .../patches/34994-fix_tests_numpy_1.24.patch  |   58 -
 .../34995-support_tachyon_0.99.2.patch        |   57 -
 ...34997-fix_edge_case_of_integer_check.patch |   36 -
 .../35058-skip_unstable_tests_klyachko.patch  |   22 -
 .../35068-fix_tests_giac_1.9.0.35.patch       |   62 -
 .../patches/35094-support_gap_4.12.patch      | 1303 -----------------
 .../35127-fix_very_slow_test_stream.py.patch  |   15 -
 .../patches/35177-matplotlib_3.7.patch        |   95 --
 .../patches/35195-workaround_ecl_race.patch   |   56 -
 .../patches/35204-fix_sage-cleaner.patch      |   28 -
 .../sagemath/patches/35250-nauty_2.8.6.patch  |   35 -
 .../sagemath/patches/35423-ipython_8.12.patch |   51 -
 .../patches/35438-pythran_0.12.1.patch        |   41 -
 .../sagemath/patches/35584-networkx_3.1.patch |   35 +-
 .../sagemath/patches/35612-linbox_1.7.0.patch |   64 +
 .../patches/35619-maxima_5.46.0.patch         |  569 +++++++
 .../sagemath/patches/35635-sympy_1.12.patch   |   54 +
 srcpkgs/sagemath/patches/get_patches          |   48 +-
 srcpkgs/sagemath/template                     |    8 +-
 23 files changed, 828 insertions(+), 2469 deletions(-)
 delete mode 100644 srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
 delete mode 100644 srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
 delete mode 100644 srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
 delete mode 100644 srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
 delete mode 100644 srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
 delete mode 100644 srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
 delete mode 100644 srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
 delete mode 100644 srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
 delete mode 100644 srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
 delete mode 100644 srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
 delete mode 100644 srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
 delete mode 100644 srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
 delete mode 100644 srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
 delete mode 100644 srcpkgs/sagemath/patches/35423-ipython_8.12.patch
 delete mode 100644 srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
 create mode 100644 srcpkgs/sagemath/patches/35612-linbox_1.7.0.patch
 create mode 100644 srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch
 create mode 100644 srcpkgs/sagemath/patches/35635-sympy_1.12.patch

diff --git a/srcpkgs/sagemath/files/sage_conf.py b/srcpkgs/sagemath/files/sage_conf.py
index 00de40f1ee4f..bc5388de8956 100644
--- a/srcpkgs/sagemath/files/sage_conf.py
+++ b/srcpkgs/sagemath/files/sage_conf.py
@@ -1,4 +1,3 @@
 # configuration for sage on void linux
 SAGE_SHARE = "/usr/share/sagemath"
 GAP_SHARE_DIR = "/usr/share/gap"
-GAP_LIB_DIR = "/usr/lib/gap"
diff --git a/srcpkgs/sagemath/files/timings2.json b/srcpkgs/sagemath/files/timings2.json
index bb3098680502..b2b3fe818a20 100644
--- a/srcpkgs/sagemath/files/timings2.json
+++ b/srcpkgs/sagemath/files/timings2.json
@@ -1,281 +1,152 @@
 {
-  "doc.ca.intro.index": {"walltime": 8},
-  "doc.en.constructions.calculus": {"walltime": 64},
-  "doc.en.constructions.plotting": {"walltime": 32},
-  "doc.en.prep.Advanced-2DPlotting": {"walltime": 16},
-  "doc.en.prep.Calculus": {"walltime": 8},
-  "doc.en.prep.Symbolics-and-Basic-Plotting": {"walltime": 8},
-  "doc.en.thematic_tutorials.explicit_methods_in_number_theory.birds_other": {"walltime": 8},
-  "doc.en.thematic_tutorials.explicit_methods_in_number_theory.elliptic_curves": {"walltime": 8},
-  "doc.en.thematic_tutorials.geometry.polyhedra_tutorial": {"walltime": 16},
-  "doc.en.thematic_tutorials.sandpile": {"walltime": 16},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_advanced": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_cartesian": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_change": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_curvilinear": {"walltime": 32},
-  "doc.en.thematic_tutorials.vector_calculus.vector_calc_plane": {"walltime": 16},
-  "doc.ja.tutorial.tour_plotting": {"walltime": 8},
-  "sage.algebras.cluster_algebra": {"walltime": 8},
   "sage.algebras.commutative_dga": {"walltime": 16},
-  "sage.algebras.hecke_algebras.ariki_koike_algebra": {"walltime": 8},
-  "sage.algebras.iwahori_hecke_algebra": {"walltime": 8},
-  "sage.algebras.lie_algebras.classical_lie_algebra": {"walltime": 128},
-  "sage.algebras.lie_algebras.nilpotent_lie_algebra": {"walltime": 16},
-  "sage.algebras.quantum_clifford": {"walltime": 16},
-  "sage.algebras.quantum_groups.fock_space": {"walltime": 8},
-  "sage.algebras.quatalg.quaternion_algebra": {"walltime": 8},
-  "sage.algebras.steenrod.steenrod_algebra": {"walltime": 64},
-  "sage.algebras.steenrod.steenrod_algebra_bases": {"walltime": 8},
-  "sage.algebras.yangian": {"walltime": 8},
-  "sage.arith.misc": {"walltime": 32},
+  "sage.algebras.fusion_rings.f_matrix": {"walltime": 16},
+  "sage.algebras.fusion_rings.fusion_ring": {"walltime": 16},
+  "sage.algebras.hecke_algebras.cubic_hecke_algebra": {"walltime": 8},
+  "sage.algebras.lie_conformal_algebras.n2_lie_conformal_algebra": {"walltime": 8},
+  "sage.algebras.quantum_clifford": {"walltime": 8},
+  "sage.algebras.steenrod.steenrod_algebra": {"walltime": 8},
   "sage.calculus.calculus": {"walltime": 16},
   "sage.calculus.desolvers": {"walltime": 8},
-  "sage.calculus.functional": {"walltime": 8},
-  "sage.calculus.riemann": {"walltime": 64},
-  "sage.calculus.tests": {"walltime": 16},
-  "sage.calculus.transforms.dwt": {"walltime": 16},
+  "sage.calculus.riemann": {"walltime": 8},
   "sage.calculus.transforms.fft": {"walltime": 8},
   "sage.categories.coxeter_groups": {"walltime": 8},
-  "sage.categories.finite_monoids": {"walltime": 16},
-  "sage.categories.lie_conformal_algebras": {"walltime": 8},
+  "sage.categories.finite_monoids": {"walltime": 8},
   "sage.categories.loop_crystals": {"walltime": 8},
-  "sage.categories.pushout": {"walltime": 8},
-  "sage.categories.super_hopf_algebras_with_basis": {"walltime": 32},
-  "sage.categories.super_lie_conformal_algebras": {"walltime": 8},
-  "sage.coding.ag_code": {"walltime": 64},
-  "sage.coding.ag_code_decoders": {"walltime": 128},
-  "sage.coding.binary_code": {"walltime": 8},
-  "sage.coding.linear_code": {"walltime": 16},
-  "sage.combinat.backtrack": {"walltime": 32},
-  "sage.combinat.chas.wqsym": {"walltime": 32},
-  "sage.combinat.cluster_algebra_quiver.cluster_seed": {"walltime": 64},
-  "sage.combinat.cluster_algebra_quiver.quiver": {"walltime": 128},
-  "sage.combinat.crystals.affine_factorization": {"walltime": 16},
-  "sage.combinat.crystals.alcove_path": {"walltime": 32},
-  "sage.combinat.crystals.highest_weight_crystals": {"walltime": 8},
-  "sage.combinat.crystals.kirillov_reshetikhin": {"walltime": 16},
-  "sage.combinat.crystals.letters": {"walltime": 8},
-  "sage.combinat.crystals.littelmann_path": {"walltime": 16},
-  "sage.combinat.crystals.mv_polytopes": {"walltime": 16},
-  "sage.combinat.crystals.pbw_crystal": {"walltime": 16},
-  "sage.combinat.crystals.star_crystal": {"walltime": 8},
-  "sage.combinat.designs.bibd": {"walltime": 8},
-  "sage.combinat.designs.database": {"walltime": 16},
+  "sage.coding.ag_code": {"walltime": 32},
+  "sage.coding.ag_code_decoders": {"walltime": 32},
+  "sage.coding.linear_code": {"walltime": 32},
+  "sage.combinat.designs.database": {"walltime": 8},
   "sage.combinat.designs.difference_family": {"walltime": 8},
-  "sage.combinat.designs.gen_quadrangles_with_spread": {"walltime": 128},
-  "sage.combinat.designs.orthogonal_arrays_build_recursive": {"walltime": 16},
-  "sage.combinat.designs.orthogonal_arrays_find_recursive": {"walltime": 8},
-  "sage.combinat.diagram_algebras": {"walltime": 64},
-  "sage.combinat.fqsym": {"walltime": 32},
-  "sage.combinat.free_prelie_algebra": {"walltime": 8},
-  "sage.combinat.fully_commutative_elements": {"walltime": 8},
-  "sage.combinat.grossman_larson_algebras": {"walltime": 8},
-  "sage.combinat.interval_posets": {"walltime": 8},
+  "sage.combinat.designs.orthogonal_arrays_build_recursive": {"walltime": 8},
   "sage.combinat.k_regular_sequence": {"walltime": 8},
   "sage.combinat.k_tableau": {"walltime": 16},
   "sage.combinat.matrices.hadamard_matrix": {"walltime": 8},
   "sage.combinat.multiset_partition_into_sets_ordered": {"walltime": 8},
-  "sage.combinat.ncsf_qsym.ncsf": {"walltime": 16},
-  "sage.combinat.ncsf_qsym.qsym": {"walltime": 16},
-  "sage.combinat.partition": {"walltime": 16},
-  "sage.combinat.partition_kleshchev": {"walltime": 16},
+  "sage.combinat.ncsf_qsym.ncsf": {"walltime": 8},
+  "sage.combinat.ncsf_qsym.qsym": {"walltime": 8},
+  "sage.combinat.partition": {"walltime": 8},
   "sage.combinat.partition_tuple": {"walltime": 8},
-  "sage.combinat.posets.moebius_algebra": {"walltime": 16},
+  "sage.combinat.permutation": {"walltime": 8},
   "sage.combinat.posets.posets": {"walltime": 8},
-  "sage.combinat.rigged_configurations.kr_tableaux": {"walltime": 32},
-  "sage.combinat.rigged_configurations.rigged_configurations": {"walltime": 16},
-  "sage.combinat.rigged_configurations.tensor_product_kr_tableaux": {"walltime": 16},
+  "sage.combinat.rigged_configurations.kr_tableaux": {"walltime": 8},
   "sage.combinat.root_system.associahedron": {"walltime": 8},
-  "sage.combinat.root_system.branching_rules": {"walltime": 8},
-  "sage.combinat.root_system.fusion_ring": {"walltime": 8},
-  "sage.combinat.root_system.integrable_representations": {"walltime": 16},
-  "sage.combinat.root_system.non_symmetric_macdonald_polynomials": {"walltime": 16},
-  "sage.combinat.root_system.pieri_factors": {"walltime": 8},
-  "sage.combinat.root_system.plot": {"walltime": 32},
-  "sage.combinat.root_system.root_lattice_realization_algebras": {"walltime": 16},
-  "sage.combinat.root_system.root_lattice_realizations": {"walltime": 16},
-  "sage.combinat.root_system.root_system": {"walltime": 8},
-  "sage.combinat.root_system.weyl_group": {"walltime": 8},
-  "sage.combinat.rsk": {"walltime": 32},
-  "sage.combinat.sf.classical": {"walltime": 16},
-  "sage.combinat.sf.jack": {"walltime": 16},
-  "sage.combinat.sf.k_dual": {"walltime": 16},
-  "sage.combinat.sf.llt": {"walltime": 16},
-  "sage.combinat.sf.macdonald": {"walltime": 64},
-  "sage.combinat.sf.new_kschur": {"walltime": 8},
-  "sage.combinat.sf.sfa": {"walltime": 32},
-  "sage.combinat.shifted_primed_tableau": {"walltime": 16},
+  "sage.combinat.root_system.non_symmetric_macdonald_polynomials": {"walltime": 8},
+  "sage.combinat.root_system.plot": {"walltime": 16},
+  "sage.combinat.root_system.root_lattice_realizations": {"walltime": 8},
+  "sage.combinat.rsk": {"walltime": 8},
+  "sage.combinat.sf.k_dual": {"walltime": 8},
+  "sage.combinat.sf.sf": {"walltime": 8},
+  "sage.combinat.sf.sfa": {"walltime": 8},
+  "sage.combinat.shifted_primed_tableau": {"walltime": 8},
   "sage.combinat.skew_tableau": {"walltime": 8},
-  "sage.combinat.symmetric_group_algebra": {"walltime": 16},
-  "sage.combinat.tableau": {"walltime": 32},
-  "sage.combinat.tableau_tuple": {"walltime": 32},
-  "sage.combinat.tiling": {"walltime": 16},
-  "sage.combinat.tutorial": {"walltime": 16},
-  "sage.combinat.words.paths": {"walltime": 64},
-  "sage.crypto.block_cipher.des": {"walltime": 16},
-  "sage.crypto.mq.sr": {"walltime": 64},
-  "sage.crypto.sbox": {"walltime": 16},
+  "sage.combinat.species.generating_series": {"walltime": 8},
+  "sage.combinat.tableau": {"walltime": 8},
+  "sage.combinat.tableau_tuple": {"walltime": 8},
+  "sage.combinat.tiling": {"walltime": 8},
+  "sage.combinat.tutorial": {"walltime": 8},
   "sage.crypto.sboxes": {"walltime": 8},
   "sage.doctest.forker": {"walltime": 16},
-  "sage.doctest.sources": {"walltime": 64},
-  "sage.doctest.test": {"walltime": 128},
-  "sage.dynamics.arithmetic_dynamics.projective_ds": {"walltime": 64},
-  "sage.dynamics.arithmetic_dynamics.wehlerK3": {"walltime": 8},
-  "sage.dynamics.cellular_automata.glca": {"walltime": 8},
+  "sage.dynamics.arithmetic_dynamics.projective_ds": {"walltime": 32},
   "sage.dynamics.cellular_automata.solitons": {"walltime": 8},
-  "sage.dynamics.complex_dynamics.mandel_julia": {"walltime": 16},
   "sage.functions.bessel": {"walltime": 16},
-  "sage.functions.exp_integral": {"walltime": 8},
   "sage.functions.hypergeometric": {"walltime": 8},
+  "sage.functions.orthogonal_polys": {"walltime": 8},
   "sage.functions.other": {"walltime": 16},
   "sage.functions.piecewise": {"walltime": 8},
-  "sage.games.quantumino": {"walltime": 8},
-  "sage.geometry.cone": {"walltime": 32},
-  "sage.geometry.fan": {"walltime": 8},
   "sage.geometry.hyperbolic_space.hyperbolic_geodesic": {"walltime": 8},
-  "sage.geometry.hyperplane_arrangement.arrangement": {"walltime": 16},
-  "sage.geometry.hyperplane_arrangement.library": {"walltime": 8},
+  "sage.geometry.hyperplane_arrangement.arrangement": {"walltime": 8},
   "sage.geometry.hyperplane_arrangement.plot": {"walltime": 8},
-  "sage.geometry.lattice_polytope": {"walltime": 16},
-  "sage.geometry.polyhedral_complex": {"walltime": 8},
-  "sage.geometry.polyhedron.base": {"walltime": 32},
-  "sage.geometry.polyhedron.library": {"walltime": 32},
-  "sage.geometry.polyhedron.plot": {"walltime": 8},
+  "sage.geometry.polyhedron.base": {"walltime": 8},
+  "sage.geometry.polyhedron.base5": {"walltime": 8},
+  "sage.geometry.polyhedron.base6": {"walltime": 16},
+  "sage.geometry.polyhedron.library": {"walltime": 16},
   "sage.geometry.riemannian_manifolds.parametrized_surface3d": {"walltime": 16},
-  "sage.geometry.triangulation.base": {"walltime": 32},
-  "sage.geometry.triangulation.point_configuration": {"walltime": 16},
-  "sage.graphs.chrompoly": {"walltime": 8},
-  "sage.graphs.connectivity": {"walltime": 16},
-  "sage.graphs.generators.basic": {"walltime": 16},
-  "sage.graphs.generators.classical_geometries": {"walltime": 32},
-  "sage.graphs.generators.distance_regular": {"walltime": 256},
-  "sage.graphs.generators.families": {"walltime": 32},
-  "sage.graphs.generators.smallgraphs": {"walltime": 16},
-  "sage.graphs.generic_graph": {"walltime": 32},
-  "sage.graphs.genus": {"walltime": 16},
+  "sage.graphs.connectivity": {"walltime": 8},
+  "sage.graphs.generators.classical_geometries": {"walltime": 8},
+  "sage.graphs.generators.distance_regular": {"walltime": 32},
+  "sage.graphs.generators.smallgraphs": {"walltime": 8},
+  "sage.graphs.generic_graph": {"walltime": 16},
   "sage.graphs.graph": {"walltime": 16},
-  "sage.graphs.graph_generators": {"walltime": 8},
   "sage.graphs.graph_list": {"walltime": 8},
   "sage.graphs.graph_plot": {"walltime": 8},
-  "sage.graphs.strongly_regular_db": {"walltime": 16},
-  "sage.groups.cubic_braid": {"walltime": 16},
-  "sage.groups.fqf_orthogonal": {"walltime": 16},
-  "sage.groups.libgap_mixin": {"walltime": 8},
-  "sage.groups.libgap_morphism": {"walltime": 8},
-  "sage.groups.lie_gps.nilpotent_lie_group": {"walltime": 16},
-  "sage.groups.matrix_gps.finitely_generated": {"walltime": 8},
-  "sage.groups.matrix_gps.heisenberg": {"walltime": 32},
-  "sage.groups.matrix_gps.linear": {"walltime": 8},
-  "sage.groups.perm_gps.cubegroup": {"walltime": 16},
-  "sage.groups.perm_gps.partn_ref.refinement_graphs": {"walltime": 8},
+  "sage.graphs.strongly_regular_db": {"walltime": 8},
+  "sage.groups.cactus_group": {"walltime": 8},
+  "sage.groups.cubic_braid": {"walltime": 8},
+  "sage.groups.lie_gps.nilpotent_lie_group": {"walltime": 8},
+  "sage.groups.matrix_gps.finitely_generated_gap": {"walltime": 8},
   "sage.groups.perm_gps.permgroup": {"walltime": 8},
   "sage.groups.perm_gps.permgroup_named": {"walltime": 8},
-  "sage.homology.hochschild_complex": {"walltime": 8},
   "sage.homology.homology_vector_space_with_basis": {"walltime": 8},
-  "sage.interacts.test_jupyter": {"walltime": 16},
-  "sage.interfaces.ecm": {"walltime": 8},
-  "sage.interfaces.expect": {"walltime": 8},
-  "sage.interfaces.gap": {"walltime": 16},
-  "sage.interfaces.maxima": {"walltime": 8},
-  "sage.interfaces.maxima_abstract": {"walltime": 64},
-  "sage.interfaces.psage": {"walltime": 8},
-  "sage.interfaces.sage0": {"walltime": 8},
-  "sage.lfunctions.zero_sums": {"walltime": 8},
-  "sage.libs.eclib.interface": {"walltime": 16},
+  "sage.interfaces.gap": {"walltime": 8},
+  "sage.interfaces.gap_workspace": {"walltime": 8},
+  "sage.interfaces.sage0": {"walltime": 16},
+  "sage.libs.eclib.interface": {"walltime": 32},
   "sage.libs.eclib.mwrank": {"walltime": 16},
-  "sage.libs.gap.test_long": {"walltime": 32},
-  "sage.libs.giac": {"walltime": 32},
   "sage.manifolds.catalog": {"walltime": 8},
-  "sage.manifolds.chart": {"walltime": 32},
+  "sage.manifolds.chart": {"walltime": 16},
   "sage.manifolds.chart_func": {"walltime": 8},
   "sage.manifolds.continuous_map": {"walltime": 8},
-  "sage.manifolds.differentiable.affine_connection": {"walltime": 128},
+  "sage.manifolds.differentiable.affine_connection": {"walltime": 32},
   "sage.manifolds.differentiable.automorphismfield": {"walltime": 32},
-  "sage.manifolds.differentiable.automorphismfield_group": {"walltime": 8},
   "sage.manifolds.differentiable.bundle_connection": {"walltime": 8},
-  "sage.manifolds.differentiable.characteristic_cohomology_class": {"walltime": 64},
+  "sage.manifolds.differentiable.characteristic_cohomology_class": {"walltime": 8},
   "sage.manifolds.differentiable.curve": {"walltime": 16},
-  "sage.manifolds.differentiable.degenerate": {"walltime": 32},
-  "sage.manifolds.differentiable.degenerate_submanifold": {"walltime": 16},
-  "sage.manifolds.differentiable.diff_form": {"walltime": 64},
+  "sage.manifolds.differentiable.degenerate": {"walltime": 16},
+  "sage.manifolds.differentiable.degenerate_submanifold": {"walltime": 8},
+  "sage.manifolds.differentiable.diff_form": {"walltime": 32},
   "sage.manifolds.differentiable.diff_map": {"walltime": 8},
   "sage.manifolds.differentiable.examples.euclidean": {"walltime": 32},
   "sage.manifolds.differentiable.examples.sphere": {"walltime": 32},
   "sage.manifolds.differentiable.integrated_curve": {"walltime": 32},
-  "sage.manifolds.differentiable.levi_civita_connection": {"walltime": 32},
-  "sage.manifolds.differentiable.manifold": {"walltime": 16},
-  "sage.manifolds.differentiable.manifold_homset": {"walltime": 16},
+  "sage.manifolds.differentiable.levi_civita_connection": {"walltime": 16},
+  "sage.manifolds.differentiable.manifold": {"walltime": 8},
+  "sage.manifolds.differentiable.manifold_homset": {"walltime": 8},
   "sage.manifolds.differentiable.metric": {"walltime": 64},
   "sage.manifolds.differentiable.mixed_form": {"walltime": 16},
-  "sage.manifolds.differentiable.mixed_form_algebra": {"walltime": 8},
   "sage.manifolds.differentiable.multivectorfield": {"walltime": 64},
-  "sage.manifolds.differentiable.pseudo_riemannian": {"walltime": 16},
-  "sage.manifolds.differentiable.pseudo_riemannian_submanifold": {"walltime": 128},
-  "sage.manifolds.differentiable.scalarfield": {"walltime": 16},
+  "sage.manifolds.differentiable.pseudo_riemannian": {"walltime": 8},
+  "sage.manifolds.differentiable.pseudo_riemannian_submanifold": {"walltime": 32},
+  "sage.manifolds.differentiable.scalarfield": {"walltime": 8},
   "sage.manifolds.differentiable.scalarfield_algebra": {"walltime": 8},
-  "sage.manifolds.differentiable.tangent_vector": {"walltime": 16},
+  "sage.manifolds.differentiable.tangent_vector": {"walltime": 8},
   "sage.manifolds.differentiable.tensorfield": {"walltime": 128},
   "sage.manifolds.differentiable.tensorfield_paral": {"walltime": 16},
-  "sage.manifolds.differentiable.vector_bundle": {"walltime": 16},
-  "sage.manifolds.differentiable.vectorfield": {"walltime": 64},
-  "sage.manifolds.differentiable.vectorframe": {"walltime": 8},
+  "sage.manifolds.differentiable.vectorfield": {"walltime": 16},
   "sage.manifolds.point": {"walltime": 16},
   "sage.manifolds.scalarfield": {"walltime": 16},
-  "sage.manifolds.scalarfield_algebra": {"walltime": 8},
-  "sage.manifolds.section": {"walltime": 32},
-  "sage.manifolds.trivialization": {"walltime": 8},
-  "sage.manifolds.vector_bundle": {"walltime": 8},
-  "sage.matrix.benchmark": {"walltime": 8},
+  "sage.manifolds.section": {"walltime": 16},
   "sage.matrix.matrix2": {"walltime": 16},
-  "sage.matrix.matrix_integer_dense": {"walltime": 16},
-  "sage.matrix.matrix_integer_dense_hnf": {"walltime": 32},
-  "sage.matrix.matrix_mod2_dense": {"walltime": 8},
   "sage.matrix.matrix_rational_dense": {"walltime": 8},
   "sage.matrix.special": {"walltime": 8},
-  "sage.matroids.catalog": {"walltime": 64},
   "sage.misc.cachefunc": {"walltime": 16},
-  "sage.misc.cython": {"walltime": 8},
   "sage.misc.functional": {"walltime": 8},
   "sage.misc.randstate": {"walltime": 16},
-  "sage.misc.sagedoc": {"walltime": 64},
-  "sage.misc.sageinspect": {"walltime": 32},
-  "sage.modular.abvar.abvar": {"walltime": 16},
+  "sage.misc.sagedoc": {"walltime": 16},
+  "sage.misc.sageinspect": {"walltime": 16},
+  "sage.misc.trace": {"walltime": 8},
+  "sage.modular.abvar.abvar": {"walltime": 8},
   "sage.modular.abvar.homspace": {"walltime": 8},
-  "sage.modular.abvar.lseries": {"walltime": 8},
-  "sage.modular.arithgroup.arithgroup_perm": {"walltime": 8},
-  "sage.modular.arithgroup.tests": {"walltime": 8},
-  "sage.modular.btquotients.pautomorphicform": {"walltime": 32},
-  "sage.modular.hypergeometric_motive": {"walltime": 16},
-  "sage.modular.local_comp.local_comp": {"walltime": 32},
-  "sage.modular.local_comp.type_space": {"walltime": 16},
-  "sage.modular.modform.ambient_R": {"walltime": 16},
-  "sage.modular.modform.constructor": {"walltime": 8},
-  "sage.modular.modform.cuspidal_submodule": {"walltime": 16},
-  "sage.modular.modform.element": {"walltime": 64},
-  "sage.modular.modform.ring": {"walltime": 64},
-  "sage.modular.modform.space": {"walltime": 8},
+  "sage.modular.btquotients.btquotient": {"walltime": 8},
+  "sage.modular.btquotients.pautomorphicform": {"walltime": 16},
+  "sage.modular.hecke.submodule": {"walltime": 8},
+  "sage.modular.hypergeometric_motive": {"walltime": 8},
+  "sage.modular.local_comp.local_comp": {"walltime": 16},
+  "sage.modular.local_comp.type_space": {"walltime": 8},
+  "sage.modular.modform.element": {"walltime": 32},
   "sage.modular.modform_hecketriangle.abstract_space": {"walltime": 16},
   "sage.modular.modform_hecketriangle.graded_ring_element": {"walltime": 16},
   "sage.modular.modform_hecketriangle.hecke_triangle_group_element": {"walltime": 32},
   "sage.modular.modform_hecketriangle.readme": {"walltime": 16},
-  "sage.modular.modform_hecketriangle.space": {"walltime": 8},
   "sage.modular.modsym.ambient": {"walltime": 16},
   "sage.modular.modsym.space": {"walltime": 8},
-  "sage.modular.pollack_stevens.modsym": {"walltime": 64},
-  "sage.modular.pollack_stevens.padic_lseries": {"walltime": 32},
-  "sage.modules.finite_submodule_iter": {"walltime": 16},
-  "sage.modules.free_module": {"walltime": 16},
-  "sage.modules.free_module_element": {"walltime": 8},
-  "sage.modules.free_module_integer": {"walltime": 32},
-  "sage.modules.free_quadratic_module_integer_symmetric": {"walltime": 8},
-  "sage.modules.torsion_quadratic_module": {"walltime": 16},
+  "sage.modular.overconvergent.genus0": {"walltime": 8},
+  "sage.modular.pollack_stevens.modsym": {"walltime": 8},
+  "sage.modules.fp_graded.morphism": {"walltime": 8},
+  "sage.modules.free_module": {"walltime": 8},
   "sage.parallel.map_reduce": {"walltime": 8},
-  "sage.plot.animate": {"walltime": 16},
-  "sage.plot.arrow": {"walltime": 8},
-  "sage.plot.circle": {"walltime": 8},
-  "sage.plot.complex_plot": {"walltime": 8},
+  "sage.plot.complex_plot": {"walltime": 16},
   "sage.plot.contour_plot": {"walltime": 32},
-  "sage.plot.density_plot": {"walltime": 8},
   "sage.plot.graphics": {"walltime": 32},
   "sage.plot.line": {"walltime": 8},
   "sage.plot.matrix_plot": {"walltime": 16},
@@ -283,115 +154,53 @@
   "sage.plot.plot": {"walltime": 64},
   "sage.plot.plot3d.base": {"walltime": 8},
   "sage.plot.plot3d.implicit_plot3d": {"walltime": 16},
-  "sage.plot.plot3d.implicit_surface": {"walltime": 8},
-  "sage.plot.plot3d.parametric_plot3d": {"walltime": 8},
+  "sage.plot.plot3d.parametric_plot3d": {"walltime": 16},
   "sage.plot.plot3d.parametric_surface": {"walltime": 8},
   "sage.plot.plot3d.plot3d": {"walltime": 16},
-  "sage.plot.plot3d.tachyon": {"walltime": 8},
-  "sage.plot.plot3d.transform": {"walltime": 32},
   "sage.plot.point": {"walltime": 8},
   "sage.plot.polygon": {"walltime": 8},
   "sage.plot.streamline_plot": {"walltime": 8},
-  "sage.quadratic_forms.genera.genus": {"walltime": 16},
-  "sage.quadratic_forms.quadratic_form__automorphisms": {"walltime": 8},
-  "sage.quadratic_forms.quadratic_form__local_representation_conditions": {"walltime": 64},
-  "sage.quadratic_forms.quadratic_form__neighbors": {"walltime": 8},
-  "sage.quadratic_forms.quadratic_form__siegel_product": {"walltime": 8},
   "sage.repl.ipython_extension": {"walltime": 8},
-  "sage.rings.asymptotic.asymptotic_expansion_generators": {"walltime": 64},
+  "sage.rings.asymptotic.asymptotic_expansion_generators": {"walltime": 16},
   "sage.rings.asymptotic.asymptotic_ring": {"walltime": 8},
-  "sage.rings.asymptotic.asymptotics_multivariate_generating_functions": {"walltime": 32},
-  "sage.rings.asymptotic.term_monoid": {"walltime": 8},
-  "sage.rings.continued_fraction": {"walltime": 8},
+  "sage.rings.asymptotic.asymptotics_multivariate_generating_functions": {"walltime": 8},
   "sage.rings.finite_rings.finite_field_base": {"walltime": 8},
-  "sage.rings.function_field.function_field": {"walltime": 128},
-  "sage.rings.function_field.function_field_valuation": {"walltime": 64},
+  "sage.rings.function_field.function_field": {"walltime": 8},
   "sage.rings.function_field.ideal": {"walltime": 8},
-  "sage.rings.function_field.place": {"walltime": 8},
-  "sage.rings.integer": {"walltime": 64},
-  "sage.rings.invariants.invariant_theory": {"walltime": 8},
-  "sage.rings.number_field.bdd_height": {"walltime": 8},
-  "sage.rings.number_field.number_field": {"walltime": 64},
-  "sage.rings.number_field.number_field_element": {"walltime": 16},
-  "sage.rings.number_field.splitting_field": {"walltime": 8},
-  "sage.rings.number_field.totallyreal": {"walltime": 16},
-  "sage.rings.number_field.totallyreal_rel": {"walltime": 8},
-  "sage.rings.padics.padic_base_leaves": {"walltime": 64},
-  "sage.rings.padics.padic_extension_leaves": {"walltime": 64},
-  "sage.rings.padics.padic_generic_element": {"walltime": 16},
-  "sage.rings.padics.padic_lattice_element": {"walltime": 32},
-  "sage.rings.padics.relative_extension_leaves": {"walltime": 32},
+  "sage.rings.lazy_series": {"walltime": 8},
+  "sage.rings.lazy_series_ring": {"walltime": 32},
+  "sage.rings.number_field.number_field": {"walltime": 32},
+  "sage.rings.number_field.number_field_element": {"walltime": 8},
+  "sage.rings.padics.padic_base_leaves": {"walltime": 8},
+  "sage.rings.padics.padic_generic_element": {"walltime": 8},
   "sage.rings.polynomial.multi_polynomial_ideal": {"walltime": 8},
-  "sage.rings.polynomial.multi_polynomial_sequence": {"walltime": 8},
-  "sage.rings.polynomial.ore_function_element": {"walltime": 8},
   "sage.rings.polynomial.polynomial_element": {"walltime": 16},
-  "sage.rings.polynomial.polynomial_rational_flint": {"walltime": 8},
   "sage.rings.qqbar": {"walltime": 16},
-  "sage.rings.tests": {"walltime": 16},
-  "sage.rings.valuation.augmented_valuation": {"walltime": 32},
-  "sage.rings.valuation.mapped_valuation": {"walltime": 64},
-  "sage.rings.valuation.valuation": {"walltime": 8},
-  "sage.sandpiles.sandpile": {"walltime": 16},
+  "sage.sandpiles.sandpile": {"walltime": 8},
   "sage.schemes.curves.affine_curve": {"walltime": 16},
   "sage.schemes.curves.closed_point": {"walltime": 8},
   "sage.schemes.curves.projective_curve": {"walltime": 32},
-  "sage.schemes.cyclic_covers.cycliccover_finite_field": {"walltime": 64},
   "sage.schemes.elliptic_curves.BSD": {"walltime": 8},
   "sage.schemes.elliptic_curves.Qcurves": {"walltime": 8},
-  "sage.schemes.elliptic_curves.constructor": {"walltime": 32},
-  "sage.schemes.elliptic_curves.ell_curve_isogeny": {"walltime": 16},
-  "sage.schemes.elliptic_curves.ell_egros": {"walltime": 32},
-  "sage.schemes.elliptic_curves.ell_finite_field": {"walltime": 8},
+  "sage.schemes.elliptic_curves.ell_curve_isogeny": {"walltime": 8},
   "sage.schemes.elliptic_curves.ell_generic": {"walltime": 8},
-  "sage.schemes.elliptic_curves.ell_modular_symbols": {"walltime": 16},
-  "sage.schemes.elliptic_curves.ell_number_field": {"walltime": 128},
+  "sage.schemes.elliptic_curves.ell_modular_symbols": {"walltime": 8},
   "sage.schemes.elliptic_curves.ell_point": {"walltime": 8},
-  "sage.schemes.elliptic_curves.ell_rational_field": {"walltime": 128},
-  "sage.schemes.elliptic_curves.gal_reps_number_field": {"walltime": 32},
-  "sage.schemes.elliptic_curves.gp_simon": {"walltime": 16},
-  "sage.schemes.elliptic_curves.heegner": {"walltime": 32},
-  "sage.schemes.elliptic_curves.height": {"walltime": 64},
-  "sage.schemes.elliptic_curves.isogeny_class": {"walltime": 32},
-  "sage.schemes.elliptic_curves.isogeny_small_degree": {"walltime": 64},
-  "sage.schemes.elliptic_curves.kraus": {"walltime": 16},
+  "sage.schemes.elliptic_curves.ell_rational_field": {"walltime": 32},
+  "sage.schemes.elliptic_curves.height": {"walltime": 8},
+  "sage.schemes.elliptic_curves.isogeny_small_degree": {"walltime": 16},
   "sage.schemes.elliptic_curves.mod_sym_num": {"walltime": 8},
   "sage.schemes.elliptic_curves.padic_lseries": {"walltime": 8},
-  "sage.schemes.elliptic_curves.padics": {"walltime": 16},
-  "sage.schemes.elliptic_curves.saturation": {"walltime": 16},
-  "sage.schemes.elliptic_curves.sha_tate": {"walltime": 32},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_finite_field": {"walltime": 64},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_generic": {"walltime": 8},
-  "sage.schemes.hyperelliptic_curves.hyperelliptic_padic_field": {"walltime": 32},
-  "sage.schemes.hyperelliptic_curves.monsky_washnitzer": {"walltime": 8},
-  "sage.schemes.projective.projective_rational_point": {"walltime": 8},
-  "sage.schemes.riemann_surfaces.riemann_surface": {"walltime": 64},
+  "sage.schemes.elliptic_curves.padics": {"walltime": 8},
+  "sage.schemes.elliptic_curves.sha_tate": {"walltime": 16},
+  "sage.schemes.hyperelliptic_curves.hyperelliptic_padic_field": {"walltime": 16},
+  "sage.schemes.riemann_surfaces.riemann_surface": {"walltime": 32},
   "sage.schemes.toric.chow_group": {"walltime": 8},
-  "sage.schemes.toric.sheaf.klyachko": {"walltime": 8},
-  "sage.stats.distributions.discrete_gaussian_integer": {"walltime": 8},
-  "sage.stats.time_series": {"walltime": 8},
-  "sage.structure.coerce_dict": {"walltime": 32},
   "sage.structure.element": {"walltime": 16},
-  "sage.structure.sage_object": {"walltime": 8},
   "sage.symbolic.expression": {"walltime": 32},
-  "sage.symbolic.integration.integral": {"walltime": 32},
-  "sage.symbolic.random_tests": {"walltime": 32},
+  "sage.symbolic.integration.integral": {"walltime": 16},
   "sage.symbolic.relation": {"walltime": 8},
-  "sage.tests.book_schilling_zabrocki_kschur_primer": {"walltime": 32},
-  "sage.tests.book_stein_ent": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.combinat_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.float_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.graphique_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.graphtheory_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.integration_doctest": {"walltime": 32},
-  "sage.tests.books.computational-mathematics-with-sagemath.mpoly_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.nonlinear_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.recequadiff_doctest": {"walltime": 8},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.graphique_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.numbertheory_doctest": {"walltime": 16},
-  "sage.tests.books.computational-mathematics-with-sagemath.sol.polynomes_doctest": {"walltime": 16},
-  "sage.tests.cmdline": {"walltime": 64},
-  "sage.tests.gosper-sum": {"walltime": 16},
-  "sage.tests.parigp": {"walltime": 8},
-  "sage.topology.simplicial_complex": {"walltime": 8},
-  "sage.topology.simplicial_complex_examples": {"walltime": 16}
+  "sage.tests.book_schilling_zabrocki_kschur_primer": {"walltime": 16},
+  "sage.tests.book_stein_ent": {"walltime": 8},
+  "sage.topology.simplicial_complex": {"walltime": 16}
 }
diff --git a/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch b/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
deleted file mode 100644
index f2f825e4fb10..000000000000
--- a/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
+++ /dev/null
@@ -1,205 +0,0 @@
-diff --git a/build/pkgs/singular/checksums.ini b/build/pkgs/singular/checksums.ini
-index 2e33a405d36..313463d2fea 100644
---- a/build/pkgs/singular/checksums.ini
-+++ b/build/pkgs/singular/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=singular-VERSION.tar.gz
--sha1=6c2b622d3681e2de3d58d30c654d43d3e32b720c
--md5=abb1e37c794472e7760655358ab66054
--cksum=17455733
-+sha1=28bb3ee97ef48d04dfa96de182fd93eebe08426c
-+md5=fc0a4f5720dadba45a52ee94324ce00c
-+cksum=1573851737
- upstream_url=ftp://jim.mathematik.uni-kl.de/pub/Math/Singular/SOURCES/4-3-1/singular-VERSION.tar.gz
-diff --git a/build/pkgs/singular/package-version.txt b/build/pkgs/singular/package-version.txt
-index 11300c77e7d..66e2bede53a 100644
---- a/build/pkgs/singular/package-version.txt
-+++ b/build/pkgs/singular/package-version.txt
-@@ -1 +1 @@
--4.3.1p1
-+4.3.1p3
-diff --git a/src/sage/libs/singular/decl.pxd b/src/sage/libs/singular/decl.pxd
-index 8e3ac314b67..747a6b1e2fb 100644
---- a/src/sage/libs/singular/decl.pxd
-+++ b/src/sage/libs/singular/decl.pxd
-@@ -574,7 +574,7 @@ cdef extern from "singular/Singular/libsingular.h":
- 
-     # gets a component out of a polynomial vector
- 
--    poly *pTakeOutComp1(poly **, int)
-+    poly *pTakeOutComp(poly **, int)
- 
-     # deep copy p
- 
-diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx
-index d8ea7b07f3c..3a1271cd59f 100644
---- a/src/sage/libs/singular/singular.pyx
-+++ b/src/sage/libs/singular/singular.pyx
-@@ -1726,20 +1726,21 @@ cdef int overflow_check(unsigned long e, ring *_ring) except -1:
- 
-     Whether an overflow occurs or not partially depends
-     on the number of variables in the ring. See trac ticket
--    :trac:`11856`. With Singular 4, it is by default optimized
--    for at least 4 variables on 64-bit and 2 variables on 32-bit,
--    which in both cases makes a maximal default exponent of
--    2^16-1.
-+    :trac:`11856`.
- 
-     EXAMPLES::
- 
-         sage: P.<x,y> = QQ[]
--        sage: y^(2^16-1)
--        y^65535
--        sage: y^2^16
-+        sage: y^(2^30)
-+        Traceback (most recent call last):             # 32-bit
-+        ...                                            # 32-bit
-+        OverflowError: exponent overflow (1073741824)  # 32-bit
-+        y^1073741824  # 64-bit
-+        sage: y^2^32
-         Traceback (most recent call last):
-         ...
--        OverflowError: exponent overflow (65536)
-+        OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+        OverflowError: exponent overflow (4294967296)  # 64-bit
-     """
-     if unlikely(e > _ring.bitmask):
-         raise OverflowError("exponent overflow (%d)"%(e))
-diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py
-index 7dc058a22f0..71494eddbc0 100644
---- a/src/sage/rings/polynomial/multi_polynomial_ideal.py
-+++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py
-@@ -60,7 +60,7 @@
- Note that the result of a computation is not necessarily reduced::
- 
-     sage: (a+b)^17
--    256*a*b^16 + 256*b^17
-+    a*b^16 + b^17
-     sage: S(17) == 0
-     True
- 
-diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-index 4dad016b33f..9bf67dd1425 100644
---- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-+++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-@@ -193,7 +193,7 @@ from sage.libs.singular.decl cimport (
-     p_IsUnit, p_IsOne, p_Series, p_Head, idInit, fast_map_common_subexp, id_Delete,
-     p_IsHomogeneous, p_Homogen, p_Totaldegree,pLDeg1_Totaldegree, singclap_pdivide, singclap_factorize,
-     idLift, IDELEMS, On, Off, SW_USE_CHINREM_GCD, SW_USE_EZGCD,
--    p_LmIsConstant, pTakeOutComp1, singclap_gcd, pp_Mult_qq, p_GetMaxExp,
-+    p_LmIsConstant, pTakeOutComp, singclap_gcd, pp_Mult_qq, p_GetMaxExp,
-     pLength, kNF, p_Neg, p_Minus_mm_Mult_qq, p_Plus_mm_Mult_qq,
-     pDiff, singclap_resultant, p_Normalize,
-     prCopyR, prCopyR_NoSort)
-@@ -1587,7 +1587,8 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_base):
-             9/4
- 
-             sage: P.monomial_quotient(x,y) # Note the wrong result
--            x*y^65535*z^65535
-+            x*y^65535*z^65535      # 32-bit
-+            x*y^1048575*z^1048575  # 64-bit
- 
-             sage: P.monomial_quotient(x,P(1))
-             x
-@@ -2247,10 +2248,11 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             9/4*x^2 - 1/4*y^2 - y - 1
- 
-             sage: P.<x,y> = PolynomialRing(QQ,order='lex')
--            sage: (x^2^15) * x^2^15
-+            sage: (x^2^32) * x^2^32
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (...)
-+            OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+            OverflowError: exponent overflow (...)  # 64-bit
-         """
-         # all currently implemented rings are commutative
-         cdef poly *_p
-@@ -2371,10 +2373,11 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             ValueError: not a 2nd power
- 
-             sage: P.<x,y> = PolynomialRing(QQ,order='lex')
--            sage: (x+y^2^15)^10
-+            sage: (x+y^2^32)^10
-             Traceback (most recent call last):
-             ....
--            OverflowError: exponent overflow (...)
-+            OverflowError: Python int too large to convert to C unsigned long  # 32-bit
-+            OverflowError: exponent overflow (...)  # 64-bit
- 
-         Test fractional powers (:trac:`22329`)::
- 
-@@ -3461,7 +3464,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
-             x^10000
-             no overflow
- 
--            sage: n = 1000
-+            sage: n = 100000
-             sage: try:
-             ....:     f = x^n
-             ....:     f.subs(x = x^n)
-@@ -4567,7 +4570,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
-         l = []
-         for i from 0 <= i < IDELEMS(res):
-             for j from 1 <= j <= IDELEMS(_I):
--                l.append( new_MP(parent, pTakeOutComp1(&res.m[i], j)) )
-+                l.append( new_MP(parent, pTakeOutComp(&res.m[i], 1)) )
- 
-         id_Delete(&fI, r)
-         id_Delete(&_I, r)
-@@ -4635,7 +4638,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
- 
-             sage: f = 3*x
-             sage: f.reduce([2*x,y])
--            3*x
-+            x
- 
-         The reduction is not canonical when ``I`` is not a Groebner
-         basis::
-diff --git a/src/sage/rings/polynomial/plural.pyx b/src/sage/rings/polynomial/plural.pyx
-index 1c9f35e56ba..587511c3888 100644
---- a/src/sage/rings/polynomial/plural.pyx
-+++ b/src/sage/rings/polynomial/plural.pyx
-@@ -1619,10 +1619,10 @@ cdef class NCPolynomial_plural(RingElement):
-             sage: P = A.g_algebra(relations={y*x:-x*y + z},  order='lex')
-             sage: P.inject_variables()
-             Defining x, z, y
--            sage: (x^2^15) * x^2^15
-+            sage: (x^2^31) * x^2^31
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (65536)
-+            OverflowError: exponent overflow (2147483648)
-         """
-         # all currently implemented rings are commutative
-         cdef poly *_p
-@@ -1689,10 +1689,10 @@ cdef class NCPolynomial_plural(RingElement):
-             sage: P = A.g_algebra(relations={y*x:-x*y + z},  order='lex')
-             sage: P.inject_variables()
-             Defining x, z, y
--            sage: (x+y^2^15)^10
-+            sage: (x+y^2^31)^10
-             Traceback (most recent call last):
-             ....
--            OverflowError: exponent overflow (327680)
-+            OverflowError: exponent overflow (2147483648)
-         """
-         if type(exp) is not Integer:
-             try:
-diff --git a/src/sage/structure/element.pyx b/src/sage/structure/element.pyx
-index b5d83ef71b6..5c45b3fb528 100644
---- a/src/sage/structure/element.pyx
-+++ b/src/sage/structure/element.pyx
-@@ -2705,10 +2705,10 @@ cdef class RingElement(ModuleElement):
-         with Singular 4::
- 
-             sage: K.<x,y> = ZZ[]
--            sage: (x^12345)^54321
-+            sage: (x^123456)^654321
-             Traceback (most recent call last):
-             ...
--            OverflowError: exponent overflow (670592745)
-+            OverflowError: exponent overflow (...)
-         """
-         return arith_generic_power(self, n)
- 
diff --git a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch b/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
deleted file mode 100644
index ee0f0e656b28..000000000000
--- a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py
-index d5f7157217f..8ca1f958039 100644
---- a/src/sage/rings/number_field/number_field_ideal.py
-+++ b/src/sage/rings/number_field/number_field_ideal.py
-@@ -996,16 +996,38 @@ def is_prime(self):
-             False
-             sage: K.ideal(17).is_prime()  # ramified
-             False
-+
-+        TESTS:
-+
-+        Check that we do not factor the norm of the ideal, this used
-+        to take half an hour, see :trac:`33360`::
-+
-+            sage: K.<a,b,c> = NumberField([x^2-2,x^2-3,x^2-5])
-+            sage: t = (((-2611940*c + 1925290/7653)*b - 1537130/7653*c
-+            ....:       + 10130950)*a + (1343014/7653*c - 8349770)*b
-+            ....:       + 6477058*c - 2801449990/4002519)
-+            sage: t.is_prime()
-+            False
-         """
-         try:
-             return self._pari_prime is not None
-         except AttributeError:
--            F = self.factor()  # factorization with caching
--            if len(F) != 1 or F[0][1] != 1:
--                self._pari_prime = None
--            else:
--                self._pari_prime = F[0][0]._pari_prime
--            return self._pari_prime is not None
-+            pass
-+
-+        K = self.number_field().pari_nf()
-+        I = self.pari_hnf()
-+
-+        candidate = K.idealismaximal(I) or None
-+
-+        # PARI uses probabilistic primality testing inside idealismaximal().
-+        if get_flag(None, 'arithmetic'):
-+            # proof required, check using isprime()
-+            if candidate and not candidate[0].isprime():
-+                candidate = None
-+
-+        self._pari_prime = candidate
-+
-+        return self._pari_prime is not None
- 
-     def pari_prime(self):
-         r"""
diff --git a/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch b/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
deleted file mode 100644
index 91f06fd4d173..000000000000
--- a/srcpkgs/sagemath/patches/34994-fix_tests_numpy_1.24.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-diff --git a/src/sage/misc/persist.pyx b/src/sage/misc/persist.pyx
-index 3ac5f1cc2b0..cb1f327c199 100644
---- a/src/sage/misc/persist.pyx
-+++ b/src/sage/misc/persist.pyx
-@@ -157,7 +157,7 @@ def load(*filename, compress=True, verbose=True, **kwargs):
-         ....:     _ = f.write(code)
-         sage: load(t)
-         sage: hello
--        <fortran object>
-+        <fortran ...>
-     """
-     import sage.repl.load
-     if len(filename) != 1:
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index 6f0aeab87ae..b77c69b2f77 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -461,6 +461,8 @@ def complex_to_rgb(z_values, contoured=False, tiled=False,
-             rgb[i, j, 2] = b
- 
-     sig_off()
-+    nan_indices = np.isnan(rgb).any(-1)     # Mask for undefined points
-+    rgb[nan_indices] = 1                    # Make nan_indices white
-     return rgb
- 
- 
-diff --git a/src/sage/plot/histogram.py b/src/sage/plot/histogram.py
-index 3bc2b76b58e..388c2d1391d 100644
---- a/src/sage/plot/histogram.py
-+++ b/src/sage/plot/histogram.py
-@@ -87,13 +87,8 @@ def get_minmax_data(self):
- 
-         TESTS::
- 
--            sage: h = histogram([10,3,5], normed=True)[0]
--            doctest:warning...:
--            DeprecationWarning: the 'normed' option is deprecated. Use 'density' instead.
--            See https://trac.sagemath.org/25260 for details.
-+            sage: h = histogram([10,3,5], density=True)[0]
-             sage: h.get_minmax_data()
--            doctest:warning ...
--            ...VisibleDeprecationWarning: Passing `normed=True` on non-uniform bins has always been broken, and computes neither the probability density function nor the probability mass function. The result is only correct if the bins are uniform, when density=True will produce the same result anyway. The argument will be removed in a future version of numpy.
-             {'xmax': 10.0, 'xmin': 3.0, 'ymax': 0.476190476190..., 'ymin': 0}
-         """
-         import numpy
-diff --git a/src/sage/repl/ipython_extension.py b/src/sage/repl/ipython_extension.py
-index 798671aab42..cad6a47ca8b 100644
---- a/src/sage/repl/ipython_extension.py
-+++ b/src/sage/repl/ipython_extension.py
-@@ -405,7 +405,7 @@ def fortran(self, line, cell):
-             ....: C END FILE FIB1.F
-             ....: ''')
-             sage: fib
--            <fortran object>
-+            <fortran ...>
-             sage: from numpy import array
-             sage: a = array(range(10), dtype=float)
-             sage: fib(a, 10)
diff --git a/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch b/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
deleted file mode 100644
index 2769e87f6a4b..000000000000
--- a/srcpkgs/sagemath/patches/34995-support_tachyon_0.99.2.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-diff --git a/src/sage/interfaces/tachyon.py b/src/sage/interfaces/tachyon.py
-index 23671e50892..ce1d50f71bc 100644
---- a/src/sage/interfaces/tachyon.py
-+++ b/src/sage/interfaces/tachyon.py
-@@ -683,12 +683,14 @@
- #*****************************************************************************
- 
- import os
-+import re
- 
- from sage.cpython.string import bytes_to_str
- from sage.misc.pager import pager
- from sage.misc.superseded import deprecation
- from sage.misc.temporary_file import tmp_filename
- from sage.structure.sage_object import SageObject
-+from sage.misc.cachefunc import cached_method
- 
- 
- class TachyonRT(SageObject):
-@@ -799,6 +801,11 @@ def __call__(self, model, outfile='sage.png', verbose=1, extra_opts=''):
-             Parser failed due to an input file syntax error.
-             Aborting render.
-         """
-+        if self.version() >= '0.99.2':
-+            # this keyword was changed in 0.99.2
-+            model = model.replace(
-+                    "              focallength ",
-+                    "              focaldist ")
-         modelfile = tmp_filename(ext='.dat')
-         with open(modelfile, 'w') as file:
-             file.write(model)
-@@ -851,6 +858,25 @@ def usage(self, use_pager=True):
-         else:
-             print(r)
- 
-+    @cached_method
-+    def version(self):
-+        """
-+        Returns the version of the Tachyon raytracer being used.
-+
-+        TESTS::
-+
-+            sage: tachyon_rt.version()  # random
-+            0.98.9
-+            sage: tachyon_rt.version() >= '0.98.9'
-+            True
-+        """
-+        with os.popen('tachyon') as f:
-+            r = f.readline()
-+        res = re.search(r"Version ([\d.]*)", r)
-+        # debian patches tachyon so it won't report the version
-+        # we hardcode '0.99' since that's indeed the version they ship
-+        return res[1] if res else '0.99'
-+
-     def help(self, use_pager=True):
-         """
-         Deprecated: type 'sage.interfaces.tachyon?' for help
diff --git a/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch b/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
deleted file mode 100644
index 11eb20d4f735..000000000000
--- a/srcpkgs/sagemath/patches/34997-fix_edge_case_of_integer_check.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff --git a/src/sage/arith/long.pxd b/src/sage/arith/long.pxd
-index 1c9a53387a0..d96b98f247c 100644
---- a/src/sage/arith/long.pxd
-+++ b/src/sage/arith/long.pxd
-@@ -270,6 +270,17 @@ cdef inline bint integer_check_long_py(x, long* value, int* err):
-         sage: L += [-x for x in L] + [0, long_min()]
-         sage: for v in L:
-         ....:     assert check_long_py(int(v)) == v
-+        sage: check_long_py(int(2^60))
-+        1152921504606846976                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^61))
-+        2305843009213693952                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^62))
-+        4611686018427387904                 # 64-bit
-+        'Overflow (...)'                    # 32-bit
-+        sage: check_long_py(int(2^63))
-+        'Overflow (...)'
-         sage: check_long_py(int(2^100))
-         'Overflow (...)'
-         sage: check_long_py(int(long_max() + 1))
-@@ -309,7 +320,12 @@ cdef inline bint integer_check_long_py(x, long* value, int* err):
- 
-     cdef long lead
-     cdef long lead_2_overflow = (<long>1) << (BITS_IN_LONG - PyLong_SHIFT)
--    cdef long lead_3_overflow = (<long>1) << (BITS_IN_LONG - 2 * PyLong_SHIFT)
-+    cdef long lead_3_overflow
-+    if BITS_IN_LONG < 2 * PyLong_SHIFT:
-+        # in this case 3 digit is always overflow
-+        lead_3_overflow = 0
-+    else:
-+        lead_3_overflow = (<long>1) << (BITS_IN_LONG - 2 * PyLong_SHIFT)
-     if size == 0:
-         value[0] = 0
-         err[0] = 0
diff --git a/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch b/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
deleted file mode 100644
index c4d7d5c779d1..000000000000
--- a/srcpkgs/sagemath/patches/35058-skip_unstable_tests_klyachko.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/src/sage/schemes/toric/sheaf/klyachko.py b/src/sage/schemes/toric/sheaf/klyachko.py
-index b1304a16913..77fae4b7545 100644
---- a/src/sage/schemes/toric/sheaf/klyachko.py
-+++ b/src/sage/schemes/toric/sheaf/klyachko.py
-@@ -26,7 +26,7 @@
-     (0, 0, 18, 16, 1)
-     sage: Gtilde = G_sum.random_deformation()
-     sage: V = Gtilde.wedge(2) * K                     # long time
--    sage: V.cohomology(dim=True, weight=(0,0,0,0))    # long time
-+    sage: V.cohomology(dim=True, weight=(0,0,0,0))    # long time  # random failure (see #32773)
-     (0, 0, 3, 0, 0)
- 
- REFERENCES:
-@@ -948,7 +948,7 @@ def random_deformation(self, epsilon=None):
-            sage: V.cohomology(dim=True, weight=(0,))
-            (1, 0)
-            sage: Vtilde = V.random_deformation()
--           sage: Vtilde.cohomology(dim=True, weight=(0,))
-+           sage: Vtilde.cohomology(dim=True, weight=(0,))  # random failure (see #32773)
-            (1, 0)
-         """
-         filt = self._filt.random_deformation(epsilon)
diff --git a/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch b/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
deleted file mode 100644
index d9a9835c696b..000000000000
--- a/srcpkgs/sagemath/patches/35068-fix_tests_giac_1.9.0.35.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 9ac7840134054155545e24fa3e66402d42b91c0f Mon Sep 17 00:00:00 2001
-From: Antonio Rojas <arojas@archlinux.org>
-Date: Fri, 20 Jan 2023 21:36:27 +0100
-Subject: [PATCH] Fix tests with giac 1.9.0.35
-
----
- src/sage/libs/giac/giac.pyx   |  3 +--
- src/sage/symbolic/relation.py | 15 +++++----------
- 2 files changed, 6 insertions(+), 12 deletions(-)
-
-diff --git a/src/sage/libs/giac/giac.pyx b/src/sage/libs/giac/giac.pyx
-index 4e451dba5e7..ccad5169836 100644
---- a/src/sage/libs/giac/giac.pyx
-+++ b/src/sage/libs/giac/giac.pyx
-@@ -374,8 +374,7 @@ def _giac(s):
- 
-         sage: x = libgiac('x')
-         sage: (1+2*sin(3*x)).solve(x).simplify()
--        Warning, argument is not an equation, solving 1+2*sin(3*x)=0
--        list[-pi/18,7*pi/18]
-+        ...list[-pi/18,7*pi/18]
- 
-         sage: libgiac.solve('sin(3*x)>2*sin(x)',x)
-         Traceback (most recent call last):
-diff --git a/src/sage/symbolic/relation.py b/src/sage/symbolic/relation.py
-index e9dbc0fea30..b8896a94be9 100644
---- a/src/sage/symbolic/relation.py
-+++ b/src/sage/symbolic/relation.py
-@@ -935,8 +935,7 @@ def solve(f, *args, **kwds):
- 
-         sage: f = (sin(x) - 8*cos(x)*sin(x))*(sin(x)^2 + cos(x)) - (2*cos(x)*sin(x) - sin(x))*(-2*sin(x)^2 + 2*cos(x)^2 - cos(x))
-         sage: solve(f, x, algorithm='giac')
--        ...
--        [-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-+        ...[-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
- 
-         sage: x, y = SR.var('x,y')
-         sage: solve([x+y-4,x*y-3],[x,y],algorithm='giac')
-@@ -1440,19 +1439,15 @@ def _giac_solver(f, x, solution_dict=False):
-     EXAMPLES::
- 
-         sage: solve([(2/3)^x-2], [x], algorithm='giac')
--        ...
--        [[-log(2)/(log(3) - log(2))]]
-+        ...[[-log(2)/(log(3) - log(2))]]
-         sage: solve([(2/3)^x-2], [x], algorithm='giac', solution_dict=True)
--        ...
--        [{x: -log(2)/(log(3) - log(2))}]
-+        ...[{x: -log(2)/(log(3) - log(2))}]
- 
-         sage: f = (sin(x) - 8*cos(x)*sin(x))*(sin(x)^2 + cos(x)) - (2*cos(x)*sin(x) - sin(x))*(-2*sin(x)^2 + 2*cos(x)^2 - cos(x))
-         sage: solve(f, x, algorithm='giac')
--        ...
--        [-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-+        ...[-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi]
-         sage: solve(f, x, algorithm='giac', solution_dict=True)
--        ...
--        [{x: -2*arctan(sqrt(2))}, {x: 0}, {x: 2*arctan(sqrt(2))}, {x: pi}]
-+        ...[{x: -2*arctan(sqrt(2))}, {x: 0}, {x: 2*arctan(sqrt(2))}, {x: pi}]
- 
-         sage: x, y = SR.var('x,y')
-         sage: solve([x+y-7,x*y-10],[x,y],algorithm='giac')
diff --git a/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch b/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
deleted file mode 100644
index 499e0c71e256..000000000000
--- a/srcpkgs/sagemath/patches/35094-support_gap_4.12.patch
+++ /dev/null
@@ -1,1303 +0,0 @@
-diff --git a/build/pkgs/gap/checksums.ini b/build/pkgs/gap/checksums.ini
-index 066e943308a..b0ea8ba8818 100644
---- a/build/pkgs/gap/checksums.ini
-+++ b/build/pkgs/gap/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=gap-VERSION.tar.gz
--sha1=4ecdd281b8f430282fb9b12690b06e0a26abde10
--md5=85dc9e459d5b6c66fcad9f468afd3e3e
--cksum=1351843158
-+sha1=a6e36f3f874a2c46f51561402634497eab705cca
-+md5=c5cd9f272f2703d7a3649ad7193b2d90
-+cksum=2760477284
- upstream_url=https://github.com/gap-system/gap/releases/download/vVERSION/gap-VERSION.tar.gz
-diff --git a/build/pkgs/gap/package-version.txt b/build/pkgs/gap/package-version.txt
-index d782fca8f64..f1cd7de1de5 100644
---- a/build/pkgs/gap/package-version.txt
-+++ b/build/pkgs/gap/package-version.txt
-@@ -1 +1 @@
--4.11.1
-+4.12.2
-diff --git a/build/pkgs/gap/spkg-check.in b/build/pkgs/gap/spkg-check.in
-index d9791d33293..d2fccda6e04 100644
---- a/build/pkgs/gap/spkg-check.in
-+++ b/build/pkgs/gap/spkg-check.in
-@@ -3,6 +3,13 @@ cd src
- # #28728: Fix test failure in tst/testinstall/strings.tst
- export LC_CTYPE=en_US.UTF-8
- 
-+# #34391: in GAP 4.12 some packages need GAP package io
-+#         to let tests run, otherwise this hangs. Thus we install io here.
-+cd pkg/io
-+./configure --with-gaproot=../..
-+make
-+cd ../..
-+
- make testinstall
- if [[ $? -ne 0 ]]; then
-     exit 1
-diff --git a/build/pkgs/gap/spkg-install.in b/build/pkgs/gap/spkg-install.in
-index 2ceadf99db4..e2c8b4dca54 100644
---- a/build/pkgs/gap/spkg-install.in
-+++ b/build/pkgs/gap/spkg-install.in
-@@ -8,8 +8,7 @@ export CFLAGS=$CFLAGS_NON_NATIVE
- export CXXFLAGS=$CXXFLAGS_NON_NATIVE
- 
- GAP_BUILD_ROOT="$(pwd)"
--GAP_ROOT="$SAGE_LOCAL/share/gap"
--DESTDIR_GAP_ROOT="$SAGE_DESTDIR$GAP_ROOT"
-+GAP_ROOT="$SAGE_LOCAL/lib/gap"
- 
- # Enable debug info if requested.
- # Note that -g3 allows you to use preprocessor macros in gdb which are widely used
-@@ -17,37 +16,17 @@ if [ "$SAGE_DEBUG" = yes ] ; then
-     export CFLAGS="-O0 -g3 -DDEBUG_MASTERPOINTERS -DDEBUG_GLOBAL_BAGS -DDEBUG_FUNCTIONS_BAGS $CFLAGS"
- fi
- 
--sdh_configure $SAGE_CONFIGURE_GMP
--sdh_make -j1
-+# LDFLAGS hack below needed by Semigroups package
-+sdh_configure $SAGE_CONFIGURE_GMP LDFLAGS="-pthread" --prefix=$SAGE_LOCAL
-+sdh_make
- 
--# GAP's "make install" is work in progress; we use bits and pieces of it
--# but we install many things manually.
--sdh_make install-headers install-libgap
--
--# Install config.h, which is not currently handled by `make install-headers`
--sdh_install gen/config.h "$SAGE_LOCAL/include/gap"
--
--# Now install the gap executable as "gap-bin"; it will be called normally
--# through our wrapper script that sets the appropriate GAP_ROOT
--SAGE_BIN="$SAGE_LOCAL/bin"
--mkdir -p "$SAGE_DESTDIR$SAGE_BIN" || sdh_die "Failed to create the directory $SAGE_BIN"
--
--./libtool --mode=install install gap "$SAGE_DESTDIR$SAGE_BIN/gap-bin" || \
--    sdh_die "Failed to install gap-bin to $SAGE_BIN"
--
--./libtool --mode=install install gac "$SAGE_DESTDIR$SAGE_BIN/gac" || \
--    sdh_die "Failed to install gac to $SAGE_BIN"
--
--# Now copy additional files GAP needs to run (and a few optional bits) into
--# GAP_ROOT; we don't need everything from the source tree
--sdh_install bin doc gen grp lib src tst sysinfo.gap "$GAP_ROOT"
--
--# GAP's copy of libtool is also used by the toolchain for build GAP packages
--# (i.e. by gac)
--sdh_install libtool "$GAP_ROOT"
-+sdh_make_install
-+# sdh_make install-headers install-libgap
-+# The 'packagemanager' package expects this https://github.com/gap-packages/PackageManager/issues/105
-+mkdir -p "$SAGE_LOCAL/lib/gap/bin"
- 
- # Install only the minimal packages GAP needs to run
--sdh_install pkg/GAPDoc-* pkg/primgrp-* pkg/SmallGrp-* pkg/transgrp "$GAP_ROOT"/pkg
-+sdh_install pkg/gapdoc pkg/primgrp pkg/smallgrp pkg/transgrp "$GAP_ROOT"/pkg
- 
- # Install additional packages that are not strictly required, but that are
- # typically "expected" to be loaded: These are the default packages that are
-@@ -58,50 +37,25 @@ sdh_install pkg/GAPDoc-* pkg/primgrp-* pkg/SmallGrp-* pkg/transgrp "$GAP_ROOT"/p
- # Also include atlasrep which is a dependency of tomlib
- sdh_install \
-     pkg/atlasrep \
--    pkg/autpgrp-* \
--    pkg/alnuth-* \
--    pkg/crisp-* \
--    pkg/ctbllib-* \
--    pkg/FactInt-* \
-+    pkg/autodoc \
-+    pkg/autpgrp \
-+    pkg/alnuth \
-+    pkg/crisp \
-+    pkg/ctbllib \
-+    pkg/factint \
-     pkg/fga \
--    pkg/irredsol-* \
--    pkg/laguna-* \
--    pkg/PackageManager-* \
--    pkg/polenta-* \
--    pkg/polycyclic-* \
--    pkg/resclasses-* \
--    pkg/sophus-* \
--    pkg/tomlib-* \
-+    pkg/irredsol \
-+    pkg/laguna \
-+    pkg/packagemanager \
-+    pkg/polenta \
-+    pkg/polycyclic \
-+    pkg/radiroot \
-+    pkg/resclasses \
-+    pkg/sophus \
-+    pkg/tomlib \
-+    pkg/utils \
-     "$GAP_ROOT"/pkg
- 
--# Install the GAP startup script; ensure it is executable
--sdh_install -T ../gap "$SAGE_BIN/gap"
--chmod +x "$SAGE_DESTDIR$SAGE_BIN/gap"
--
--# Create symlinks under $GAP_ROOT for these executables, as they are expected
--# (especially when building kernel packages) to exist
--ln -sf "../../bin/gap-bin" "$DESTDIR_GAP_ROOT/gap"
--ln -sf "../../bin/gac" "$DESTDIR_GAP_ROOT/gac"
--
--# Fix the $GAP_ROOT/bin/<arch>/src symlink to be relative (otherwise it links
--# to the actual path of the sources GAP was compiled from)
--for srclink in "$DESTDIR_GAP_ROOT"/bin/*/src; do
--    rm -f "$srclink"
--    ln -s "../../src" "$srclink"
--done
--
--# Additional fixups for some files after they have been copied into their
--# destination directory.  gac and sysinfo.gap are generated files that contain
--# in them hard-coded references to the GAP build directory, which will soon
--# be going away.  This breaks the build toolchain for some compiled GAP
--# packages.  We need to replace these paths with the final GAP_ROOT path.  The
--# below will work so long as neither of these paths contain '|', and if they do
--# then god help you.  https://trac.sagemath.org/ticket/27218
--sed -i -e "s|$GAP_BUILD_ROOT|$GAP_ROOT|g" \
--    "$SAGE_DESTDIR$SAGE_BIN/gac" "$DESTDIR_GAP_ROOT/sysinfo.gap" \
--    "$DESTDIR_GAP_ROOT/bin/gap.sh" "$DESTDIR_GAP_ROOT/doc/make_doc" || \
--    sdh_die "Failed to fix up hard-coded paths in GAP build tools."
--
- # TODO: This seems unnecessary--we are already installing all of doc/ to
- # GAP_ROOT, which is necessary for some functionality in GAP to work.  Do
- # we need this?  Maybe doc/gap could just be a symlink to gap/doc??
-diff --git a/build/pkgs/gap/spkg-legacy-uninstall b/build/pkgs/gap/spkg-legacy-uninstall
-index d17eb939eb7..a8e5c59e1fb 100755
---- a/build/pkgs/gap/spkg-legacy-uninstall
-+++ b/build/pkgs/gap/spkg-legacy-uninstall
-@@ -4,6 +4,8 @@ rm -rf "$SAGE_LOCAL/gap/gap-4."*
- rm -rf "$SAGE_SHARE/gap"
- rm -f "$SAGE_LOCAL/gap/latest"
- rm -f "$SAGE_LOCAL/bin/gap"
-+rm -f "$SAGE_LOCAL/bin/gac"
- 
--# Remove old libgap headers
-+# Remove old libgap headers and library
- rm -rf "$SAGE_LOCAL/include/gap"
-+rm -rf "$SAGE_LOCAL/lib/gap"
-diff --git a/build/pkgs/gap/spkg-prerm.in b/build/pkgs/gap/spkg-prerm.in
-deleted file mode 100644
-index 661d92621fa..00000000000
---- a/build/pkgs/gap/spkg-prerm.in
-+++ /dev/null
-@@ -1,6 +0,0 @@
--# These generated files are placed in directory provided by the SPKG, so
--# delete the generated files first so that their parent directories can be
--# removed during installation
--GAP_ROOT="$SAGE_LOCAL/share/gap"
--rm -f "$GAP_ROOT/pkg/atlasrep/datagens/"*.*
--rm -f "$GAP_ROOT/pkg/atlasrep/dataword/"*.*
-diff --git a/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch b/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch
-deleted file mode 100644
-index e45fe7d9c6f..00000000000
---- a/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch
-+++ /dev/null
-@@ -1,150 +0,0 @@
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c b/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--index 3bbdc45..7df699f 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c
--@@ -8,9 +8,8 @@ extern short sp[],**mat[],*psp[],**imcos[],**cpco[],lorb[],
-- short *cst,**cpst,***cdpst,**svptr,*cp,*rel;
-- short *spst,**pspst,**pptr,**cpptr,npt,nb,nph,nph2,npg,npg2,
--       rno,orno,coh_index,*invg;
---FILE  *ip,*op;
-- 
---void seeknln (void) { while (getc(ip)!='\n'); }
--+void seeknln (FILE *ip) { while (getc(ip)!='\n'); }
-- 
-- /* This program differs from most other permutation programs in that perms are
--    all stored in the single array sp. Schreier vectors are stored in the short
--@@ -23,13 +22,14 @@ void seeknln (void) { while (getc(ip)!='\n'); }
-- int 
-- crprog1 (void)
-- { short *pc,*qc,ex,neg; int x;
--+  FILE  *ip,*op;
--   short i,j,k,l,m,n,cl,rl,*p,ocl,im,pt,pt1,pn,ipt;
--   if ((ip=fopen(inf2,"r"))== 0)
--   { fprintf(stderr,"Cannot open %s.\n",inf2); return(-1);}
--   fscanf(ip,"%hd%hd%hd%hd",&npt,&nph,&nb,&k);
--   if (nb>=mb) {fprintf(stderr,"nb too big. Increase MB.\n"); return(-1);}
--   if (k<=2) {fprintf(stderr,"inf2 has illegal format.\n"); return(-1); }
---  seeknln(); seeknln();
--+  seeknln(ip); seeknln(ip);
--   for (i=1;i<=nb;i++) fscanf(ip,"%hd",lorb+i);
--   pptr=psp-1; pspst=psp+nph; svptr=cpsp-1;  cpst=cpsp+nb;
--   invg=sp; nph2=2*nph; spst=sp+nph2;
--@@ -37,7 +37,7 @@ crprog1 (void)
--   { pptr[i]=spst+(i-1)*npt-1; p=pptr[i];
--     for (j=1;j<=npt;j++) {fscanf(ip,"%hd",&k); p[k]=j; }
--     invg[2*i-2]=2*i-1; invg[2*i-1]=2*i-2;
---    seeknln();
--+    seeknln(ip);
--   }
--   spst+=(npt*nph);
--   for (i=1;i<=nb;i++)
--@@ -75,7 +75,7 @@ crprog1 (void)
--   strcpy(inf1,inf0); strcat(inf1,".rel");
--   if ((ip=fopen(inf1,"r"))==0)
--   { fprintf(stderr,"Cannot open %s.\n",inf1); return(-1);}
---  fscanf(ip,"%hd%hd",&k,&rno); seeknln();
--+  fscanf(ip,"%hd%hd",&k,&rno); seeknln(ip);
--   op=fopen(outft,"w");
-- /* Now we have read everything in, and the computation can start */
--   orno=0;
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--index a7396b2..658496f 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c
--@@ -20,8 +20,6 @@ short  mexp=MEXP,mcl=MCL,no,rel[RSP],wt[MEXP],exp,*rpf,*rpb,
-- extern short  prime,dim,*spv,**spm,mspace[],*vec[],**mat[],cp[],pinv[],opmats,
--         mm,mv;
-- extern int msp;
---FILE *ip,*op;
---
-- 
-- int 
-- calcmats (void)
--@@ -59,7 +57,7 @@ calcmats (void)
--   }
--   for (i=1;i<=exp;i++) trans(mat[i+exp],mat[i]);
--   if (opmats)
---  { op=fopen(outf,"w");
--+  { FILE *op=fopen(outf,"w");
--     fprintf(op,"%4d%4d%4d\n",prime,dim,exp);
--     for (i=1;i<=exp;i++) printmat(mat[i]); 
--     fclose(op);
--@@ -71,6 +69,7 @@ int
-- rdmats (void)
-- /* reads matrices of generators of P */
-- { short i; int quot;
--+  FILE *ip;
--   ip=fopen(inf4,"r");
--   if (ip==0)
--   { fprintf(stderr,"Cannot open %s\n ",inf4); return(-1); }
--@@ -90,12 +89,12 @@ rdmats (void)
--   fclose(ip);
--   return(0);
-- }
---FILE *ip;
-- 
-- int 
-- ingp (int inp)
-- /* Read in output of respcrun -s */
-- { short i,j,k,l,m,*orpf,**pcp;
--+  FILE *ip;
--   ip=fopen(inf3,"r");
--   if (ip==0) { fprintf(stderr,"Cannot open %s\n",inf3); return(-1); }
--   fscanf(ip,"%hd%hd%hd%hd%hd%hd",&prime,&exp,&i,&no,&j,&m);
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--index 0896551..6841bc8 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c
--@@ -9,7 +9,6 @@ extern short  intexp,mexp,mng,wksp,
--        spugen[],*tlintg[];
-- extern int ptrsp,rsp;
-- short  fac;
---FILE *ip,*op;
-- 
-- int 
-- ingp (void)
--@@ -18,6 +17,7 @@ ingp (void)
--    of nqrun, and tails are also read in.
-- */
-- { short i,j,k,l,m,x,y,no,*orpf,*orpb,**pcp;  char tails;
--+  FILE *ip;
--   if ((ip=fopen(inf1,"r"))==0)
--   { fprintf(stderr,"Cannot open %s.\n",inf1); return(-1); }
--   fscanf(ip,"%hd%hd%hd%hd%hd%hd",&prime,&exp,&nng,&no,&class,&m);
--@@ -89,6 +89,7 @@ int
-- outgp (void)
-- /* The PCP is output, together with tails */
-- { short i,k,l,**pcp,*b,*e,*c;
--+  FILE *op;
--   op=fopen(outf,"w");
--   fprintf(op,"%4d%4d%4d%4d%4d%4d\n",prime,exp,nng,exp,class,1);
--   for (i=1;i<=exp;i++) fprintf(op,"%4d",wt[i]); fprintf(op,"\n");
--@@ -379,7 +380,7 @@ restart:
--     nng--; mnng--; enexpnt--;
--     if (nng==0)
--     { if (gap)
---      { op=fopen(outfm,"w"); fprintf(op,"COHOMOLO.Multiplier:=[];\n");
--+      { FILE *op=fopen(outfm,"w"); fprintf(op,"COHOMOLO.Multiplier:=[];\n");
--         fclose(op);
--         printf("All new generators eliminated. Multiplier is trivial.\n");
--       }
--diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--index 01cf914..0144883 100644
----- a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--+++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c
--@@ -9,7 +9,6 @@ extern short  intexp,mng,mexp,wksp,
--        spugen[],*intg[],*imintg[],*tlintg[];
-- extern int ptrsp,rsp;
-- short  *wf,*wc; char norm;
---FILE *ip,*op;
-- 
-- /* The data structures for this program and for nqrun are similar.
--    d1 and d2 contain definitions of generators. (Def. comes from commutator
--@@ -35,6 +34,7 @@ nqmprog (void)
-- { short i,j,k,l,m,d,*gi,*gj,*ti,*tj,cl,def,*ps,*pf,**dp,*nrpb,*p,*orpf,*orpb,
--         nb,np,k1,*rno,*covrel,**pgen,tdef,sgn;
--   char nt;
--+  FILE *ip,*op;
--   if (ingp() == -1) {fprintf(stderr,"Input error.\n"); return(-1); }
--   eexpnt=expnt+exp; enexpnt=nexpnt+nng;
-- 
-diff --git a/build/pkgs/gap_packages/patches/guava_leon_includes.patch b/build/pkgs/gap_packages/patches/guava_leon_includes.patch
-deleted file mode 100644
-index cdcd19cc3e8..00000000000
---- a/build/pkgs/gap_packages/patches/guava_leon_includes.patch
-+++ /dev/null
-@@ -1,13 +0,0 @@
----- a/pkg/guava-3.15/src/leon/src/generate.c	Sat Feb 29 09:02:10 2020
----- b/pkg/guava-3.15/src/leon/src/generate.c	Thu Sep 24 13:58:36 2020
--***************
--*** 115,120 ****
----- 115,122 ----
--  #include "groupio.h"
--  #include "enum.h"
--  #include "storage.h"
--+ #include "chbase.h"
--+ #include "inform.h"
--  
--  #ifdef ALT_TIME_HEADER
--  #include "cputime.h"
-diff --git a/build/pkgs/gap_packages/spkg-install.in b/build/pkgs/gap_packages/spkg-install.in
-index 168e6b11532..6dff182a48f 100644
---- a/build/pkgs/gap_packages/spkg-install.in
-+++ b/build/pkgs/gap_packages/spkg-install.in
-@@ -1,4 +1,4 @@
--GAP_ROOT="$SAGE_LOCAL/share/gap"
-+GAP_ROOT="$SAGE_LOCAL/lib/gap"
- PKG_DIR="$GAP_ROOT/pkg"
- 
- PKG_SRC_DIR="$(pwd)/src/pkg"
-@@ -11,33 +11,31 @@ cd "$PKG_SRC_DIR"
- #    (GAP 4.8.6 still had it, but this is gone in 4.10)
- 
- sdh_install \
--    aclib-* \
--    AutoDoc-* \
--    corelg-* \
--    crime-* \
-+    aclib \
-+    corelg \
-+    crime \
-     cryst \
-     crystcat \
--    design-* \
-+    design \
-     gbnp \
--    genss-* \
--    hap-* \
--    hapcryst-* \
--    hecke-* \
--    images-* \
--    liealgdb-* \
--    liepring-* \
--    liering-* \
--    loops-* \
--    MapClass-* \
--    polymaking-* \
--    qpa-* \
--    quagroup-* \
--    radiroot-* \
--    repsn-* \
--    sla-* \
--    sonata-* \
--    Toric-* \
--    utils-* \
-+    genss \
-+    hap \
-+    hapcryst \
-+    hecke \
-+    images \
-+    liealgdb \
-+    liepring \
-+    liering \
-+    loops \
-+    mapclass \
-+    polymaking \
-+    qpa \
-+    quagroup \
-+    repsn \
-+    singular \
-+    sla \
-+    sonata \
-+    toric \
-     "$PKG_DIR"
- 
- install_compiled_pkg()
-@@ -45,27 +43,23 @@ install_compiled_pkg()
-     local pkg="$1"
-     # Install the bin/ dir (where compiled modules should end up)
-     # under <prefix>/lib/gap; we then symlink to it later
--    sdh_install bin "$SAGE_LOCAL/lib/gap/pkg/$pkg"
-+    sdh_install * "$SAGE_LOCAL/lib/gap/pkg/$pkg"
- 
-+    # TODO:
-     # Clean up any build artificts before installing the rest of the package
-     # Also remove configure/Makefiles
-     # Note: None, if any of the packages really have a proper install target
--    make clean  # Works for some packages but not all
--    rm -rf bin/
--    rm -rf configure configure.* config.* autogen.sh *.m4 Makefile* m4/
-+    #make clean  # Works for some packages but not all
-+    #rm -rf bin/
-+    #rm -rf configure configure.* config.* autogen.sh *.m4 Makefile* m4/
- 
--    # Create the bin/ symlink
--    ln -s "$SAGE_LOCAL/lib/gap/pkg/$pkg/bin" bin
--
--    # Install the rest of the package files
--    sdh_install * "$PKG_DIR/$pkg"
- }
- 
- # Build and install compiled packages:
- #
- # These packages have an old ./configure that take the GAP_ROOT as a positional
- # argument
--for pkg in cohomolo-* crypting-* grape-* guava-* orb-* datastructures-*
-+for pkg in cohomolo crypting grape guava orb datastructures
- do
-     echo "Building GAP package $pkg"
-     CFLAGS="$CFLAGS -Wno-implicit-function-declaration"
-@@ -91,7 +85,7 @@ pararr=( " " " " "--with-external-planarity" "--with-external-libsemigroups" )
- ##############################################################################
- 
- parind=0
--for pkg in nq-* io-* digraphs-* semigroups-*
-+for pkg in nq io digraphs semigroups
- do
-     echo "Building GAP package $pkg"
-     cd "$PKG_SRC_DIR/$pkg"
-diff --git a/build/pkgs/libsemigroups/checksums.ini b/build/pkgs/libsemigroups/checksums.ini
-index 62c4268515f..4e13a36cb35 100644
---- a/build/pkgs/libsemigroups/checksums.ini
-+++ b/build/pkgs/libsemigroups/checksums.ini
-@@ -1,5 +1,5 @@
- tarball=libsemigroups-VERSION.tar.gz
--sha1=2b16c095cc5ffd3f77a71dfbf48cce188e054c03
--md5=7082cadcf7a195ccb93175cd72b6db95
--cksum=1501022358
-+sha1=86375824b47ce4b0e23570122e873f67136d0c0a
-+md5=ff79ad5fbc8bfeb64d48faaf24106b98
-+cksum=2845045455
- upstream_url=https://github.com/libsemigroups/libsemigroups/releases/download/vVERSION/libsemigroups-VERSION.tar.gz
-diff --git a/build/pkgs/libsemigroups/package-version.txt b/build/pkgs/libsemigroups/package-version.txt
-index 9084fa2f716..f90b1afc082 100644
---- a/build/pkgs/libsemigroups/package-version.txt
-+++ b/build/pkgs/libsemigroups/package-version.txt
-@@ -1 +1 @@
--1.1.0
-+2.3.2
-diff --git a/build/pkgs/libsemigroups/spkg-install.in b/build/pkgs/libsemigroups/spkg-install.in
-index 2aaf0e99043..128b54d2f99 100644
---- a/build/pkgs/libsemigroups/spkg-install.in
-+++ b/build/pkgs/libsemigroups/spkg-install.in
-@@ -1,4 +1,4 @@
- cd src
--sdh_configure
-+sdh_configure --disable-eigen
- sdh_make
- sdh_make_install
-diff --git a/build/pkgs/singular/spkg-configure.m4 b/build/pkgs/singular/spkg-configure.m4
-index d4d145defe3..6a85631f624 100644
---- a/build/pkgs/singular/spkg-configure.m4
-+++ b/build/pkgs/singular/spkg-configure.m4
-@@ -9,52 +9,7 @@ SAGE_SPKG_CONFIGURE([singular], [
-        AC_MSG_CHECKING([that Singular's help is working])
-        AS_IF([test x`printf "system(\"--browser\", \"builtin\"); \n help;" | Singular 2>&1 | grep "error occurred"` = x], [
-         AC_MSG_RESULT(yes)
--        dnl We have Singular. Now determine the shared library path on
--        dnl platforms on which sage.libs.singular needs to reload the library with RTLD_GLOBAL.
--        AS_CASE([$host_os],
--          [cygwin*], [dnl Nothing to do
--                     ],
--                     [dnl Use pkg-config to get singular's libdir while we're at it. As a
--                      dnl moral compromise for using pkg-config, this ultimately allows us
--                      dnl to pass an absolute path to dlopen(), which is the only approach
--                      dnl that POSIX guarantees will work.
--                      PKG_CHECK_VAR([SINGULAR_LIB_DIR], [Singular], [libdir])
--                      dnl The acl_shlibext variable is set in the top-level configure.ac.
--                      AC_LANG_PUSH(C)
--                      ORIG_LIBS="${LIBS}"
--                      LIBS="${LIBS} -ldl"
--                      AC_MSG_CHECKING([if we can dlopen($LIBSINGULAR_PATH)])
--                      LIBSINGULAR_PATH="${SINGULAR_LIB_DIR}/libSingular.${acl_shlibext}"
--
--                      dnl if we can dlopen() it, substitute the name for sage_conf;
--                      dnl otherwise, fall back to using the SPKG.
--                      AC_RUN_IFELSE(
--                        [AC_LANG_PROGRAM(
--                          [[#include <dlfcn.h>]],
--                          [[void* h = dlopen("${LIBSINGULAR_PATH}", RTLD_LAZY | RTLD_GLOBAL);
--                            if (h == 0) { return 1; } else { return dlclose(h); }]]
--                        )], [
--                          AC_MSG_RESULT(yes)
--                        ], [
--                          dnl try Debian-specific name
--                          LIBSINGULAR_PATH="${SINGULAR_LIB_DIR}/libsingular-Singular.${acl_shlibext}"
--                          AC_RUN_IFELSE(
--                           [AC_LANG_PROGRAM(
--                             [[#include <dlfcn.h>]],
--                             [[void* h = dlopen("${LIBSINGULAR_PATH}", RTLD_LAZY | RTLD_GLOBAL);
--                               if (h == 0) { return 1; } else { return dlclose(h); }]]
--                           )], [
--                             AC_MSG_RESULT(yes)
--                           ], [
--                            AC_MSG_RESULT(no)
--                            sage_spkg_install_singular=yes
--                          ], [AC_MSG_RESULT(yes)])
--                        ], [AC_MSG_RESULT(yes)])
--
--                      AC_LANG_POP()
--                      LIBS="${ORIG_LIBS}"
--                     ]
--       )], [
-+       ], [
-        AC_MSG_RESULT(no)
-        sage_spkg_install_singular=yes
-        ]
-@@ -64,20 +19,4 @@ SAGE_SPKG_CONFIGURE([singular], [
-       ])
-     ])
-   ])
--],[],[],[
--  dnl Post-check phase
--  dnl We make the sage_conf substitutions here, because the "default"
--  dnl substitution needs to be made even if we skipped the system-Singular
--  dnl checks themselves.
--  AS_IF([test "x${sage_spkg_install_singular}" = "xyes"], [
--    AS_CASE([$host_os],
--      [cygwin*], [dnl Nothing to do
--                 ],
--                 [dnl Set shared library path, needed for reloading the library with RTLD_GLOBAL
--                  LIBSINGULAR_PATH="\$SAGE_LOCAL/lib/libSingular.${acl_shlibext}"
--                 ]
--    )
--  ])
--
--  AC_SUBST(LIBSINGULAR_PATH, "${LIBSINGULAR_PATH}")
- ])
-diff --git a/pkgs/sage-conf/_sage_conf/_conf.py.in b/pkgs/sage-conf/_sage_conf/_conf.py.in
-index 6cd28f558a8..d66bdb3d264 100644
---- a/pkgs/sage-conf/_sage_conf/_conf.py.in
-+++ b/pkgs/sage-conf/_sage_conf/_conf.py.in
-@@ -55,9 +55,6 @@ THREEJS_DIR = SAGE_LOCAL + "/share/threejs-sage"
- OPENMP_CFLAGS = "@OPENMP_CFLAGS@"
- OPENMP_CXXFLAGS = "@OPENMP_CXXFLAGS@"
- 
--# The full absolute path to the main Singular library.
--LIBSINGULAR_PATH = "@LIBSINGULAR_PATH@".replace('$SAGE_LOCAL', SAGE_LOCAL)
--
- # Installation location of wheels. This is determined at configuration time
- # and does not depend on the installation location of sage-conf.
- SAGE_SPKG_WHEELS = "@SAGE_VENV@".replace('${SAGE_LOCAL}', SAGE_LOCAL) + "/var/lib/sage/wheels"
-diff --git a/src/doc/en/thematic_tutorials/lie/weyl_groups.rst b/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-index c917338e444..182e74aad20 100644
---- a/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-+++ b/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
-@@ -139,12 +139,12 @@ string, which you can print::
-     X.1      1  1  1  1  1  1  1  1  1  1  1  1  1
-     X.2      1 -1  1  1 -1  1  1 -1 -1 -1  1  1  1
-     X.3      2  .  2 -1  .  2  2  .  .  . -1  2  2
--    X.4      3 -1 -1  .  1 -1  3 -1  1 -1  . -1  3
--    X.5      3 -1 -1  .  1  3 -1 -1 -1  1  . -1  3
--    X.6      3  1 -1  . -1 -1  3  1 -1  1  . -1  3
--    X.7      3  1 -1  . -1  3 -1  1  1 -1  . -1  3
--    X.8      3 -1  3  . -1 -1 -1 -1  1  1  . -1  3
--    X.9      3  1  3  .  1 -1 -1  1 -1 -1  . -1  3
-+    X.4      3 -1 -1  .  1  3 -1 -1 -1  1  . -1  3
-+    X.5      3  1 -1  . -1  3 -1  1  1 -1  . -1  3
-+    X.6      3 -1  3  . -1 -1 -1 -1  1  1  . -1  3
-+    X.7      3 -1 -1  .  1 -1  3 -1  1 -1  . -1  3
-+    X.8      3  1  3  .  1 -1 -1  1 -1 -1  . -1  3
-+    X.9      3  1 -1  . -1 -1  3  1 -1  1  . -1  3
-     X.10     4 -2  . -1  .  .  .  2  .  .  1  . -4
-     X.11     4  2  . -1  .  .  . -2  .  .  1  . -4
-     X.12     6  . -2  .  . -2 -2  .  .  .  .  2  6
-diff --git a/src/sage/coding/codecan/autgroup_can_label.pyx b/src/sage/coding/codecan/autgroup_can_label.pyx
-index de5db985e0b..c83b9264e44 100644
---- a/src/sage/coding/codecan/autgroup_can_label.pyx
-+++ b/src/sage/coding/codecan/autgroup_can_label.pyx
-@@ -76,7 +76,7 @@ columns do share the same coloring::
-     ((1,),
-      (2,),
-      (3, 5, 4),
--     (6, 19, 16, 9, 21, 10, 8, 15, 14, 11, 20, 13, 12, 7, 17, 18))
-+     (6, 19, 16, 21, 9, 10, 15, 8, 20, 11, 14, 13, 7, 12, 18, 17))
- 
- We can also restrict the group action to linear isometries::
- 
-diff --git a/src/sage/coding/linear_code.py b/src/sage/coding/linear_code.py
-index a3ac3ca1547..bfb9f8696e8 100644
---- a/src/sage/coding/linear_code.py
-+++ b/src/sage/coding/linear_code.py
-@@ -465,27 +465,27 @@ def automorphism_group_gens(self, equivalence="semilinear"):
-             0
-             sage: C = codes.HammingCode(GF(4, 'z'), 3)
-             sage: C.automorphism_group_gens()
--            ([((1, 1, 1, 1, 1, z + 1, z, z + 1, z, z, z, 1, 1, z + 1, z + 1, z, z + 1, z, z + 1, z + 1, z + 1); (1,14,6,7,4,10,11,19)(2,8,16,13,3,17,21,15)(9,12,18,20), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((1, 1, 1, z, z + 1, 1, 1, 1, 1, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z); (1,13,14,20)(2,21,8,18,7,16,19,15)(3,10,5,12,17,9,6,4), Ring endomorphism of Finite Field in z of size 2^2
-+                Defn: z |--> z + 1),
-+              ((z, 1, z, z, z, z + 1, z, z, z, z, z, z, z + 1, z, z, z, z, z + 1, z, z, z); (1,11,5,12,3,19)(2,8)(6,18,13)(7,17,15)(9,10,14,16,20,21), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z + 1),
--              ((z + 1, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z + 1, 1, z, z + 1, z + 1, z); (1,18,6,19,2,9,17,10,13,14,21,11,4,5,12)(3,20,7,16,8), Ring endomorphism of Finite Field in z of size 2^2
--                Defn: z |--> z),
-               ((z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z); (), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-              362880)
-             sage: C.automorphism_group_gens(equivalence="linear")
--            ([((z + 1, 1, z + 1, z + 1, z + 1, z, 1, z, 1, 1, 1, 1, z + 1, z + 1, z + 1, z, z, 1, z, z, z); (1,15,2,8,16,18,3)(4,9,12,13,20,10,11)(5,21,14,6,7,19,17), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((z, 1, z + 1, z + 1, 1, z + 1, z, 1, z + 1, z + 1, 1, z, 1, z + 1, z, 1, z, 1, z + 1, 1, 1); (1,12,11,10,6,8,9,20,13,21,5,14,3,16,17,19,7,4,2,15,18), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((z + 1, z + 1, z + 1, z + 1, z + 1, 1, z, 1, z, z, z, 1, z, 1, 1, 1, z + 1, z + 1, z + 1, 1, z); (1,15,21,8,9)(2,18,5,3,11,16,7,10,19,13,12,4,17,6,20), Ring endomorphism of Finite Field in z of size 2^2
-+              ((z + 1, z + 1, z + 1, z, 1, 1, z, z, 1, z + 1, z, 1, 1, z, 1, z + 1, z, z + 1, z + 1, 1, z); (1,3,18,2,17,6,19)(4,15,13,20,7,14,16)(5,11,8,21,12,9,10), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
-               ((z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1); (), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-              181440)
-             sage: C.automorphism_group_gens(equivalence="permutational")
--            ([((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,19)(3,17)(4,21)(5,20)(7,14)(9,12)(10,16)(11,15), Ring endomorphism of Finite Field in z of size 2^2
-+            ([((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,11)(3,10)(4,9)(5,7)(12,21)(14,20)(15,19)(16,17), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,11)(3,10)(4,9)(5,7)(12,21)(14,20)(15,19)(16,17), Ring endomorphism of Finite Field in z of size 2^2
-+              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (2,18)(3,19)(4,10)(5,16)(8,13)(9,14)(11,21)(15,20), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
--              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,17)(2,8)(3,14)(4,10)(7,12)(9,19)(13,18)(15,20), Ring endomorphism of Finite Field in z of size 2^2
-+              ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,19)(3,17)(4,21)(5,20)(7,14)(9,12)(10,16)(11,15), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z),
-               ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (2,13)(3,14)(4,20)(5,11)(8,18)(9,19)(10,15)(16,21), Ring endomorphism of Finite Field in z of size 2^2
-                 Defn: z |--> z)],
-@@ -691,10 +691,10 @@ def _canonize(self, equivalence):
-             sage: C_iso == aut_group_can_label.get_canonical_form()
-             True
-             sage: aut_group_can_label.get_autom_gens()
--            [((1, 1, 1, 1, 1, z + 1, z, z + 1, z, z, z, 1, 1, z + 1, z + 1, z, z + 1, z, z + 1, z + 1, z + 1); (1,14,6,7,4,10,11,19)(2,8,16,13,3,17,21,15)(9,12,18,20), Ring endomorphism of Finite Field in z of size 2^2
-+            [((1, 1, 1, z, z + 1, 1, 1, 1, 1, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z); (1,13,14,20)(2,21,8,18,7,16,19,15)(3,10,5,12,17,9,6,4), Ring endomorphism of Finite Field in z of size 2^2
-+               Defn: z |--> z + 1),
-+             ((z, 1, z, z, z, z + 1, z, z, z, z, z, z, z + 1, z, z, z, z, z + 1, z, z, z); (1,11,5,12,3,19)(2,8)(6,18,13)(7,17,15)(9,10,14,16,20,21), Ring endomorphism of Finite Field in z of size 2^2
-                Defn: z |--> z + 1),
--             ((z + 1, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z + 1, 1, z, z + 1, z + 1, z); (1,18,6,19,2,9,17,10,13,14,21,11,4,5,12)(3,20,7,16,8), Ring endomorphism of Finite Field in z of size 2^2
--               Defn: z |--> z),
-              ((z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z); (), Ring endomorphism of Finite Field in z of size 2^2
-                Defn: z |--> z)]
-         """
-diff --git a/src/sage/combinat/posets/posets.py b/src/sage/combinat/posets/posets.py
-index 2836d59d960..8c882d5ac3b 100644
---- a/src/sage/combinat/posets/posets.py
-+++ b/src/sage/combinat/posets/posets.py
-@@ -8813,7 +8813,7 @@ def _libgap_(self):
-             sage: libgap(P)  # optional - gap_packages
-             <A poset on 5 points>
-             sage: A = libgap(GF(2)).PosetAlgebra(P); A  # optional - gap_packages
--            <GF(2)[<quiver with 5 vertices and 5 arrows>]/<two-sided ideal in <GF(2)[<quiver with 5 vertices and 5 arrows>]>, (1 generators)>>
-+            <GF(2)[<quiver with 5 vertices and 5 arrows>]/<two-sided ideal in <GF(2)[<quiver with 5 vertices and 5 arrows>]>, (1 generator)>>
-             sage: A.Dimension()  # optional - gap_packages
-             13
-         """
-diff --git a/src/sage/combinat/root_system/hecke_algebra_representation.py b/src/sage/combinat/root_system/hecke_algebra_representation.py
-index 6b756bafc30..8ac99319bec 100644
---- a/src/sage/combinat/root_system/hecke_algebra_representation.py
-+++ b/src/sage/combinat/root_system/hecke_algebra_representation.py
-@@ -357,7 +357,7 @@ def Tw(self, word, signs=None, scalar=None):
-             sage: q1, q2 = K.gens()
-             sage: KW = W.algebra(K)
-             sage: x = KW.an_element(); x
--            123 + 3*32 + 2*3 + e
-+            123 + 3*2312 + 2*31 + e
- 
-             sage: T = KW.demazure_lusztig_operators(q1,q2)
-             sage: T12 = T.Tw( (1,2) )
-diff --git a/src/sage/combinat/symmetric_group_algebra.py b/src/sage/combinat/symmetric_group_algebra.py
-index b8a0bebab44..9bccba124c8 100644
---- a/src/sage/combinat/symmetric_group_algebra.py
-+++ b/src/sage/combinat/symmetric_group_algebra.py
-@@ -101,7 +101,7 @@ def SymmetricGroupAlgebra(R, W, category=None):
-         sage: SGA.group()
-         Weyl Group of type ['A', 3] (as a matrix group acting on the ambient space)
-         sage: SGA.an_element()
--        s1*s2*s3 + 3*s3*s2 + 2*s3 + 1
-+        s1*s2*s3 + 3*s2*s3*s1*s2 + 2*s3*s1 + 1
- 
-     The preferred way to construct the symmetric group algebra is to
-     go through the usual ``algebra`` method::
-diff --git a/src/sage/env.py b/src/sage/env.py
-index 911f34b1bc6..5f7aca8599c 100644
---- a/src/sage/env.py
-+++ b/src/sage/env.py
-@@ -197,7 +197,8 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- GRAPHS_DATA_DIR = var("GRAPHS_DATA_DIR", join(SAGE_SHARE, "graphs"))
- ELLCURVE_DATA_DIR = var("ELLCURVE_DATA_DIR", join(SAGE_SHARE, "ellcurves"))
- POLYTOPE_DATA_DIR = var("POLYTOPE_DATA_DIR", join(SAGE_SHARE, "reflexive_polytopes"))
--GAP_ROOT_DIR = var("GAP_ROOT_DIR", join(SAGE_SHARE, "gap"))
-+GAP_LIB_DIR = var("GAP_LIB_DIR", join(SAGE_LOCAL, "lib", "gap"))
-+GAP_SHARE_DIR = var("GAP_SHARE_DIR", join(SAGE_SHARE, "gap"))
- THEBE_DIR = var("THEBE_DIR", join(SAGE_SHARE, "thebe"))
- COMBINATORIAL_DESIGN_DATA_DIR = var("COMBINATORIAL_DESIGN_DATA_DIR", join(SAGE_SHARE, "combinatorial_designs"))
- CREMONA_MINI_DATA_DIR = var("CREMONA_MINI_DATA_DIR", join(SAGE_SHARE, "cremona"))
-@@ -229,12 +230,6 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- LIE_INFO_DIR = var("LIE_INFO_DIR", join(SAGE_LOCAL, "lib", "LiE"))
- SINGULAR_BIN = var("SINGULAR_BIN") or "Singular"
- 
--# The path to libSingular, to be passed to dlopen(). This will
--# typically be set to an absolute path in sage_conf, but the relative
--# fallback path here works on systems where dlopen() searches the
--# system's library locations.
--LIBSINGULAR_PATH = var("LIBSINGULAR_PATH", "libSingular.so")
--
- # OpenMP
- OPENMP_CFLAGS = var("OPENMP_CFLAGS", "")
- OPENMP_CXXFLAGS = var("OPENMP_CXXFLAGS", "")
-@@ -255,81 +250,6 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
- SAGE_GAP_COMMAND = var('SAGE_GAP_COMMAND', _gap_cmd)
- 
- 
--def _get_shared_lib_path(*libnames: str) -> Optional[str]:
--    """
--    Return the full path to a shared library file installed in
--    ``$SAGE_LOCAL/lib`` or the directories associated with the
--    Python sysconfig.
--
--    This can also be passed more than one library name (e.g. for cases where
--    some library may have multiple names depending on the platform) in which
--    case the first one found is returned.
--
--    This supports most *NIX variants (in which ``lib<libname>.so`` is found
--    under ``$SAGE_LOCAL/lib``), macOS (same, but with the ``.dylib``
--    extension), and Cygwin (under ``$SAGE_LOCAL/bin/cyg<libname>.dll``,
--    or ``$SAGE_LOCAL/bin/cyg<libname>-*.dll`` for versioned DLLs).
--
--    For distributions like Debian that use a multiarch layout, we also try the
--    multiarch lib paths (i.e. ``/usr/lib/<arch>/``).
--
--    This returns ``None`` if no matching library file could be found.
--
--    EXAMPLES::
--
--        sage: from sage.env import _get_shared_lib_path
--        sage: "gap" in _get_shared_lib_path("gap")
--        True
--        sage: _get_shared_lib_path("an_absurd_lib") is None
--        True
--
--    """
--
--    for libname in libnames:
--        search_directories: List[Path] = []
--        patterns: List[str] = []
--        if sys.platform == 'cygwin':
--            # Later down we take the first matching DLL found, so search
--            # SAGE_LOCAL first so that it takes precedence
--            if SAGE_LOCAL:
--                search_directories.append(Path(SAGE_LOCAL) / 'bin')
--            search_directories.append(Path(sysconfig.get_config_var('BINDIR')))
--            # Note: The following is not very robust, since if there are multible
--            # versions for the same library this just selects one more or less
--            # at arbitrary. However, practically speaking, on Cygwin, there
--            # will only ever be one version
--            patterns = [f'cyg{libname}.dll', f'cyg{libname}-*.dll']
--        else:
--            if sys.platform == 'darwin':
--                ext = 'dylib'
--            else:
--                ext = 'so'
--
--            if SAGE_LOCAL:
--                search_directories.append(Path(SAGE_LOCAL) / 'lib')
--            libdir = sysconfig.get_config_var('LIBDIR')
--            if libdir is not None:
--                libdir = Path(libdir)
--                search_directories.append(libdir)
--
--                multiarchlib = sysconfig.get_config_var('MULTIARCH')
--                if multiarchlib is not None:
--                    search_directories.append(libdir / multiarchlib),
--
--            patterns = [f'lib{libname}.{ext}']
--
--        for directory in search_directories:
--            for pattern in patterns:
--                path = next(directory.glob(pattern), None)
--                if path is not None:
--                    return str(path.resolve())
--
--    # Just return None if no files were found
--    return None
--
--# locate libgap shared object
--GAP_SO = var("GAP_SO", _get_shared_lib_path("gap", ""))
--
- # post process
- if DOT_SAGE is not None and ' ' in DOT_SAGE:
-     if UNAME[:6] == 'CYGWIN':
-diff --git a/src/sage/groups/abelian_gps/abelian_group_gap.py b/src/sage/groups/abelian_gps/abelian_group_gap.py
-index a4b047113c5..86090b43535 100644
---- a/src/sage/groups/abelian_gps/abelian_group_gap.py
-+++ b/src/sage/groups/abelian_gps/abelian_group_gap.py
-@@ -338,7 +338,7 @@ def _element_constructor_(self, x, check=True):
-         if isinstance(x, AbelianGroupElement_gap):
-             try:
-                 if x in self._cover:
--                    x = self.gap().NaturalHomomorphism().Image(x.gap())
-+                    x = self._cover.gap().NaturalHomomorphismByNormalSubgroup(self._relations).Image(x.gap())
-                 else:
-                     x = x.gap()
-             except AttributeError:
-@@ -1043,7 +1043,7 @@ def natural_homomorphism(self):
-             From: Abelian group with gap, generator orders (4,)
-             To:   Quotient abelian group with generator orders (2,)
-         """
--        phi = self.gap().NaturalHomomorphism()
-+        phi = self._cover.gap().NaturalHomomorphismByNormalSubgroup(self._relations)
-         Hom = self._cover.Hom(self)
-         return Hom(phi)
- 
-diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py
-index 8d6e443683c..1beb01af87f 100644
---- a/src/sage/groups/finitely_presented.py
-+++ b/src/sage/groups/finitely_presented.py
-@@ -596,9 +596,9 @@ def gap(self):
-             sage: k = G.rewriting_system()
-             sage: k.gap()
-             Knuth Bendix Rewriting System for Monoid( [ a, A, b, B ] ) with rules
--            [ [ a^2, <identity ...> ], [ a*A, <identity ...> ],
--              [ A*a, <identity ...> ], [ b^2, <identity ...> ],
--              [ b*B, <identity ...> ], [ B*b, <identity ...> ] ]
-+            [ [ a*A, <identity ...> ], [ A*a, <identity ...> ],
-+              [ b*B, <identity ...> ], [ B*b, <identity ...> ],
-+              [ a^2, <identity ...> ], [ b^2, <identity ...> ] ]
-         """
-         return self._gap
- 
-diff --git a/src/sage/groups/fqf_orthogonal.py b/src/sage/groups/fqf_orthogonal.py
-index 7fc4dbe7548..e5eccd45942 100644
---- a/src/sage/groups/fqf_orthogonal.py
-+++ b/src/sage/groups/fqf_orthogonal.py
-@@ -143,7 +143,7 @@ class FqfOrthogonalGroup(AbelianGroupAutomorphismGroup_subgroup):
-         [2/3   0   0]
-         [  0 2/3   0]
-         [  0   0 4/3]
--        generated by 2 elements
-+        generated by 3 elements
-         sage: q = matrix.diagonal(QQ, [3/2, 1/4, 1/4])
-         sage: T = TorsionQuadraticForm(q)
-         sage: T.orthogonal_group().order()
-diff --git a/src/sage/groups/libgap_wrapper.pyx b/src/sage/groups/libgap_wrapper.pyx
-index d25121aa792..dc81b71635b 100644
---- a/src/sage/groups/libgap_wrapper.pyx
-+++ b/src/sage/groups/libgap_wrapper.pyx
-@@ -25,7 +25,7 @@ Note how we call the constructor of both superclasses to initialize
- its output via LibGAP::
- 
-     sage: FooGroup()
--    <pc group of size 3 with 1 generators>
-+    <pc group of size 3 with 1 generator>
-     sage: type(FooGroup().gap())
-     <class 'sage.libs.gap.element.GapElement'>
- 
-@@ -106,7 +106,7 @@ class ParentLibGAP(SageObject):
-         ....:         ParentLibGAP.__init__(self, lg)
-         ....:         Group.__init__(self)
-         sage: FooGroup()
--        <pc group of size 3 with 1 generators>
-+        <pc group of size 3 with 1 generator>
-     """
- 
-     def __init__(self, libgap_parent, ambient=None):
-@@ -461,7 +461,7 @@ cdef class ElementLibGAP(MultiplicativeGroupElement):
-         ....:         ParentLibGAP.__init__(self, lg)
-         ....:         Group.__init__(self)
-         sage: FooGroup()
--        <pc group of size 3 with 1 generators>
-+        <pc group of size 3 with 1 generator>
-         sage: FooGroup().gens()
-         (f1,)
-     """
-diff --git a/src/sage/groups/matrix_gps/finitely_generated.py b/src/sage/groups/matrix_gps/finitely_generated.py
-index a6d3dc02513..63956ad5f10 100644
---- a/src/sage/groups/matrix_gps/finitely_generated.py
-+++ b/src/sage/groups/matrix_gps/finitely_generated.py
-@@ -563,9 +563,6 @@ def as_permutation_group(self, algorithm=None, seed=None):
-             21499084800
-             sage: P = G.as_permutation_group()
-             sage: Psmaller = G.as_permutation_group(algorithm="smaller", seed=6)
--            sage: P == Psmaller  # see the note below
--            True
--            sage: Psmaller = G.as_permutation_group(algorithm="smaller")
-             sage: P == Psmaller
-             False
-             sage: P.cardinality()
-diff --git a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-index f2ccca042ac..47d6862333c 100644
---- a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-+++ b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
-@@ -427,7 +427,7 @@ cdef class LabelledBranching:
-             sage: from sage.groups.perm_gps.partn_ref2.refinement_generic import LabelledBranching
-             sage: L = LabelledBranching(3)
-             sage: L.small_generating_set()
--            []
-+            [()]
-             sage: L.add_gen(libgap.eval('(1,2,3)'))
-             sage: L.small_generating_set()
-             [(1,2,3)]
-diff --git a/src/sage/groups/perm_gps/permgroup.py b/src/sage/groups/perm_gps/permgroup.py
-index ebdf7c4c6eb..fb14008c8e0 100644
---- a/src/sage/groups/perm_gps/permgroup.py
-+++ b/src/sage/groups/perm_gps/permgroup.py
-@@ -926,7 +926,7 @@ def _coerce_map_from_(self, G):
-            sage: f = PG._coerce_map_from_(MG)
-            sage: mg = MG.an_element()
-            sage: p = f(mg); p
--           (2,33,32,23,31,55)(3,49,38,44,40,28)(4,17,59,62,58,46)(5,21,47,20,43,8)(6,53,50)(7,37,12,57,14,29)(9,41,56,34,64,10)(11,25,19)(13,61,26,51,22,15)(16,45,36)(18,27,35,48,52,54)(24,63,42)(30,39,60)
-+           (1,2,6,19,35,33)(3,9,26,14,31,23)(4,13,5)(7,22,17)(8,24,12)(10,16,32,27,20,28)(11,30,18)(15,25,36,34,29,21)
-            sage: PG(p._gap_()) == p
-            True
- 
-@@ -972,12 +972,12 @@ def _coerce_map_from_(self, G):
-             sage: P = G.as_permutation_group(algorithm='smaller', seed=5)
-             sage: P1 = G.as_permutation_group()
-             sage: P == P1
--            False
-+            True
-             sage: g1, g2, g3 = G.gens()
-             sage: P(g1*g2)
--            (1,3,7,12)(2,4,8,10)(5,11)(6,9)
-+            (1,4,13,11)(2,5,14,18)(3,15,8,16)(6,7)(9,20,19,12)(10,17)
-             sage: P1(g1*g2)
--            (2,29,25,68)(3,57,13,54)(4,11,72,37)(5,39,60,23)(6,64,75,63)(7,21,50,73)(8,46,38,32)(9,74,35,18)(10,44,49,48)(12,16,34,71)(14,79,27,40)(15,26)(17,62,59,76)(19,78,70,65)(20,22,58,51)(24,33,36,43)(28,81,80,52)(30,53,56,69)(31,61)(41,42,67,55)(45,77)(47,66)
-+            (1,4,13,11)(2,5,14,18)(3,15,8,16)(6,7)(9,20,19,12)(10,17)
- 
-         Another check for :trac:`5583`::
- 
-@@ -1302,7 +1302,7 @@ def gens_small(self):
-             sage: G.gens_small() # random
-             [('b','c'), ('a','c','b')] ## (on 64-bit Linux)
-             [('a','b'), ('a','c','b')] ## (on Solaris)
--            sage: len(G.gens_small()) == 2
-+            sage: len(G.gens_small()) == 2 # random
-             True
-         """
-         gens = self._libgap_().SmallGeneratingSet()
-@@ -4370,17 +4370,23 @@ def is_transitive(self, domain=None):
- 
-         ::
- 
--            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)]]) #S_5 on [1..5]
--            sage: G.is_transitive([1,4,5])
-+            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)],[(6,7)]])
-+            sage: G.is_transitive([1,2,3,4,5])
-             True
--            sage: G.is_transitive([2..6])
-+            sage: G.is_transitive([1..7])
-             False
-             sage: G.is_transitive(G.non_fixed_points())
--            True
-+            False
-             sage: H = PermutationGroup([[(1,2,3)],[(4,5,6)]])
-             sage: H.is_transitive(H.non_fixed_points())
-             False
- 
-+        If `G` does not act on the domain, it always returns ``False``::
-+
-+            sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)]]) #S_5 on [1..5]
-+            sage: G.is_transitive([1,4,5])
-+            False
-+
-         Note that this differs from the definition in GAP, where
-         ``IsTransitive`` returns whether the group is transitive on the
-         set of points moved by the group.
-@@ -4436,12 +4442,16 @@ def is_primitive(self, domain=None):
-             sage: G = PermutationGroup([[(1,2,3,4)],[(2,4)]])
-             sage: G.is_primitive([1..4])
-             False
--            sage: G.is_primitive([1,2,3])
--            True
-             sage: G = PermutationGroup([[(3,4,5,6)],[(3,4)]]) #S_4 on [3..6]
-             sage: G.is_primitive(G.non_fixed_points())
-             True
- 
-+        If `G` does not act on the domain, it always returns ``False``::
-+
-+            sage: G = PermutationGroup([[(1,2,3,4)],[(2,4)]])
-+            sage: G.is_primitive([1,2,3])
-+            False
-+
-         """
-         #If the domain is not a subset of self.domain(), then the
-         #action isn't primitive.
-diff --git a/src/sage/interfaces/gap.py b/src/sage/interfaces/gap.py
-index 7ae1792e9de..ecaa9fd2341 100644
---- a/src/sage/interfaces/gap.py
-+++ b/src/sage/interfaces/gap.py
-@@ -1512,6 +1512,8 @@ def gap_reset_workspace(max_workspace_size=None, verbose=False):
-     """
-     # Create new workspace with filename WORKSPACE
-     g = Gap(use_workspace_cache=False, max_workspace_size=None)
-+    g.eval('ColorPrompt(false)')
-+    g.eval('SetUserPreference("UseColorPrompt", false)')
-     g.eval('SetUserPreference("HistoryMaxLines", 30)')
-     from sage.tests.gap_packages import all_installed_packages
-     for pkg in all_installed_packages(gap=g):
-diff --git a/src/sage/interfaces/gap_workspace.py b/src/sage/interfaces/gap_workspace.py
-index 33a87dd5076..03b40be6856 100644
---- a/src/sage/interfaces/gap_workspace.py
-+++ b/src/sage/interfaces/gap_workspace.py
-@@ -16,7 +16,8 @@
- import os
- import time
- import hashlib
--from sage.env import DOT_SAGE, GAP_SO
-+import subprocess
-+from sage.env import DOT_SAGE, HOSTNAME, GAP_LIB_DIR, GAP_SHARE_DIR
- 
- 
- def gap_workspace_file(system="gap", name="workspace", dir=None):
-@@ -59,11 +60,13 @@ def gap_workspace_file(system="gap", name="workspace", dir=None):
-     if dir is None:
-         dir = os.path.join(DOT_SAGE, 'gap')
- 
--    if GAP_SO:
--        h = hashlib.sha1(GAP_SO.encode('utf-8')).hexdigest()
--    else:
--        h = 'unknown'
--    return os.path.join(dir, '%s-%s-%s' % (system, name, h))
-+    data = f'{GAP_LIB_DIR}:{GAP_SHARE_DIR}'
-+    for path in GAP_LIB_DIR, GAP_SHARE_DIR:
-+        sysinfo = os.path.join(path, "sysinfo.gap")
-+        if os.path.exists(sysinfo):
-+            data += subprocess.getoutput(f'. "{sysinfo}" && echo ":$GAP_VERSION:$GAParch"')
-+    h = hashlib.sha1(data.encode('utf-8')).hexdigest()
-+    return os.path.join(dir, f'{system}-{name}-{HOSTNAME}-{h}')
- 
- 
- def prepare_workspace_dir(dir=None):
-diff --git a/src/sage/libs/gap/element.pyx b/src/sage/libs/gap/element.pyx
-index c555ea0333c..e3db3934baf 100644
---- a/src/sage/libs/gap/element.pyx
-+++ b/src/sage/libs/gap/element.pyx
-@@ -130,6 +130,7 @@ cdef char *capture_stdout(Obj func, Obj obj):
-     """
-     cdef Obj s, stream, output_text_string
-     cdef UInt res
-+    cdef TypOutputFile output
-     # The only way to get a string representation of an object that is truly
-     # consistent with how it would be represented at the GAP REPL is to call
-     # ViewObj on it.  Unfortunately, ViewObj *prints* to the output stream,
-@@ -145,12 +146,12 @@ cdef char *capture_stdout(Obj func, Obj obj):
-         output_text_string = GAP_ValueGlobalVariable("OutputTextString")
-         stream = CALL_2ARGS(output_text_string, s, GAP_True)
- 
--        if not OpenOutputStream(stream):
-+        if not OpenOutputStream(&output, stream):
-             raise GAPError("failed to open output capture stream for "
-                            "representing GAP object")
- 
-         CALL_1ARGS(func, obj)
--        CloseOutput()
-+        CloseOutput(&output)
-         return CSTR_STRING(s)
-     finally:
-         GAP_Leave()
-diff --git a/src/sage/libs/gap/gap_includes.pxd b/src/sage/libs/gap/gap_includes.pxd
-index 6d22e32540b..6111d18a5c7 100644
---- a/src/sage/libs/gap/gap_includes.pxd
-+++ b/src/sage/libs/gap/gap_includes.pxd
-@@ -76,8 +76,10 @@ cdef extern from "gap/intobj.h" nogil:
- 
- 
- cdef extern from "gap/io.h" nogil:
--    UInt OpenOutputStream(Obj stream)
--    UInt CloseOutput()
-+    ctypedef struct TypOutputFile:
-+        pass
-+    UInt OpenOutputStream(TypOutputFile* output, Obj stream)
-+    UInt CloseOutput(TypOutputFile* output)
- 
- 
- cdef extern from "gap/libgap-api.h" nogil:
-diff --git a/src/sage/libs/gap/libgap.pyx b/src/sage/libs/gap/libgap.pyx
-index b1a64e57939..6a36613aa8c 100644
---- a/src/sage/libs/gap/libgap.pyx
-+++ b/src/sage/libs/gap/libgap.pyx
-@@ -695,7 +695,7 @@ class Gap(Parent):
-             sage: libgap.List
-             <Gap function "List">
-             sage: libgap.GlobalRandomSource
--            <RandomSource in IsGlobalRandomSource>
-+            <RandomSource in IsGAPRandomSource>
-         """
-         if name in dir(self.__class__):
-             return getattr(self.__class__, name)
-diff --git a/src/sage/libs/gap/saved_workspace.py b/src/sage/libs/gap/saved_workspace.py
-index ad5adec36d0..7636707f557 100644
---- a/src/sage/libs/gap/saved_workspace.py
-+++ b/src/sage/libs/gap/saved_workspace.py
-@@ -8,7 +8,7 @@
- 
- import os
- import glob
--from sage.env import GAP_ROOT_DIR
-+from sage.env import GAP_LIB_DIR
- from sage.interfaces.gap_workspace import gap_workspace_file
- 
- 
-@@ -31,7 +31,7 @@ def timestamp():
-     """
-     libgap_dir = os.path.dirname(__file__)
-     libgap_files = glob.glob(os.path.join(libgap_dir, '*'))
--    gap_packages = glob.glob(os.path.join(GAP_ROOT_DIR, 'pkg', '*'))
-+    gap_packages = glob.glob(os.path.join(GAP_LIB_DIR, 'pkg', '*'))
-     files = libgap_files + gap_packages
-     if len(files) == 0:
-         print('Unable to find LibGAP files.')
-diff --git a/src/sage/libs/gap/util.pyx b/src/sage/libs/gap/util.pyx
-index 344ab88c42a..eaa659d64c7 100644
---- a/src/sage/libs/gap/util.pyx
-+++ b/src/sage/libs/gap/util.pyx
-@@ -13,7 +13,7 @@ Utility functions for GAP
- #*****************************************************************************
- 
- from libc.signal cimport signal, SIGCHLD, SIG_DFL
--from posix.dlfcn cimport dlopen, dlclose, RTLD_NOW, RTLD_GLOBAL
-+from posix.dlfcn cimport dlopen, dlclose, dlerror, RTLD_LAZY, RTLD_GLOBAL
- 
- from cpython.exc cimport PyErr_Fetch, PyErr_Restore
- from cpython.object cimport Py_LT, Py_LE, Py_EQ, Py_NE, Py_GT, Py_GE
-@@ -164,33 +164,6 @@ cdef void gasman_callback() with gil:
- ### Initialization of GAP ##################################################
- ############################################################################
- 
--def gap_root():
--    """
--    Find the location of the GAP root install which is stored in the gap
--    startup script.
--
--    EXAMPLES::
--
--        sage: from sage.libs.gap.util import gap_root
--        sage: gap_root()   # random output
--        '/home/vbraun/opt/sage-5.3.rc0/local/gap/latest'
--    """
--    if os.path.exists(sage.env.GAP_ROOT_DIR):
--        return sage.env.GAP_ROOT_DIR
--
--    # Attempt to figure out the appropriate GAP_ROOT by reading the
--    # local/bin/gap shell script; this is an ugly hack that exists for
--    # historical reasons; the best approach to setting where Sage looks for
--    # the appropriate GAP_ROOT is to set the GAP_ROOT_DIR variable
--    SAGE_LOCAL = sage.env.SAGE_LOCAL
--    with open(os.path.join(SAGE_LOCAL, 'bin', 'gap')) as f:
--        gap_sh = f.read().splitlines()
--    gapdir = next(x for x in gap_sh if x.strip().startswith('GAP_ROOT'))
--    gapdir = gapdir.split('"')[1]
--    gapdir = gapdir.replace('$SAGE_LOCAL', SAGE_LOCAL)
--    return gapdir
--
--
- # To ensure that we call initialize_libgap only once.
- cdef bint _gap_is_initialized = False
- 
-@@ -232,12 +205,12 @@ cdef initialize():
-     # this isn't portable
- 
-     cdef void* handle
--    libgapname = str_to_bytes(sage.env.GAP_SO)
--    handle = dlopen(libgapname, RTLD_NOW | RTLD_GLOBAL)
-+    # reload the current module to force reload of libgap (see #33446)
-+    lib = str_to_bytes(__loader__.path, FS_ENCODING, "surrogateescape")
-+    handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY)
-     if handle is NULL:
--        raise RuntimeError(
--                "Could not dlopen() libgap even though it should already "
--                "be loaded!")
-+        err = dlerror()
-+        raise RuntimeError(f"Could not reload gap library with RTLD_GLOBAL ({err})")
-     dlclose(handle)
- 
-     # Define argv variable, which we will pass in to
-@@ -245,7 +218,7 @@ cdef initialize():
-     cdef char* argv[16]
-     argv[0] = "sage"
-     argv[1] = "-l"
--    s = str_to_bytes(gap_root(), FS_ENCODING, "surrogateescape")
-+    s = str_to_bytes(sage.env.GAP_LIB_DIR + ";" + sage.env.GAP_SHARE_DIR, FS_ENCODING, "surrogateescape")
-     argv[2] = s
- 
-     argv[3] = "-m"
-@@ -362,15 +335,9 @@ cdef Obj gap_eval(str gap_string) except? NULL:
-         GAPError: Error, Variable: 'Complex' must have a value
-         Syntax error: ; expected in stream:1
-         Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^
-+                ^^^^^
-         Error, Variable: 'with' must have a value
--        Syntax error: ; expected in stream:1
--        Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^^^^^^^^^
-         Error, Variable: 'bits' must have a value
--        Syntax error: ; expected in stream:1
--        Complex Field with 53 bits of precision;;
--         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-         Error, Variable: 'precision' must have a value
- 
-     Test that on a subsequent attempt we get the same message (no garbage was
-diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx
-index d8ea7b07f3c..4beb1774df9 100644
---- a/src/sage/libs/singular/singular.pyx
-+++ b/src/sage/libs/singular/singular.pyx
-@@ -1705,14 +1705,7 @@ cdef object si2sa_intvec(intvec *v):
- cdef extern from *: # hack to get at cython macro
-     int unlikely(int)
- 
--cdef extern from "dlfcn.h":
--    void *dlopen(char *, long)
--    char *dlerror()
--    void dlclose(void *handle)
--
--cdef extern from "dlfcn.h":
--    cdef long RTLD_LAZY
--    cdef long RTLD_GLOBAL
-+from posix.dlfcn cimport dlopen, dlclose, dlerror, RTLD_LAZY, RTLD_GLOBAL
- 
- cdef int overflow_check(unsigned long e, ring *_ring) except -1:
-     """
-@@ -1762,8 +1755,6 @@ cdef init_libsingular():
- 
-     cdef void *handle = NULL
- 
--    from sage.env import LIBSINGULAR_PATH
--    lib = str_to_bytes(LIBSINGULAR_PATH, FS_ENCODING, "surrogateescape")
- 
-     # This is a workaround for https://github.com/Singular/Singular/issues/1113
-     # and can be removed once that fix makes it into release of Singular that
-@@ -1780,10 +1771,12 @@ cdef init_libsingular():
- 
-     import platform
-     if not platform.system().startswith("CYGWIN"):
-+        # reload the current module to force reload of libSingular (see #33446)
-+        lib = str_to_bytes(__loader__.path, FS_ENCODING, "surrogateescape")
-         handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY)
-         if not handle:
-             err = dlerror()
--            raise ImportError(f"cannot load Singular library from {LIBSINGULAR_PATH} ({err})")
-+            raise RuntimeError(f"Could not reload Singular library with RTLD_GLOBAL ({err})")
- 
-     # load SINGULAR
-     siInit(lib)
-diff --git a/src/sage/tests/gap_packages.py b/src/sage/tests/gap_packages.py
-index 2e4518ca226..c302b169b8a 100644
---- a/src/sage/tests/gap_packages.py
-+++ b/src/sage/tests/gap_packages.py
-@@ -103,7 +103,7 @@ def all_installed_packages(ignore_dot_gap=False, gap=None):
- 
-         sage: from sage.tests.gap_packages import all_installed_packages
-         sage: all_installed_packages()
--        (...'GAPDoc'...)
-+        (...'gapdoc'...)
-         sage: all_installed_packages(ignore_dot_gap=True) == all_installed_packages(gap=gap, ignore_dot_gap=True)
-         True
-     """
diff --git a/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch b/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
deleted file mode 100644
index d331a6573e1c..000000000000
--- a/srcpkgs/sagemath/patches/35127-fix_very_slow_test_stream.py.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/src/sage/data_structures/stream.py b/src/sage/data_structures/stream.py
-index f8f6dc6a186..002e925f02f 100644
---- a/src/sage/data_structures/stream.py
-+++ b/src/sage/data_structures/stream.py
-@@ -2090,8 +2090,8 @@ def compute_product(self, n, la):
-             sage: f = Stream_exact([1]) # irrelevant for this test
-             sage: g = Stream_function(lambda n: s[n], True, 0)
-             sage: h = Stream_plethysm(f, g, True, p)
--            sage: B = p[2, 2, 1](sum(s[i] for i in range(7)))
--            sage: all(h.compute_product(k, Partition([2, 2, 1])) == B.restrict_degree(k) for k in range(7))
-+            sage: B = p[2, 2, 1](sum(p(s[i]) for i in range(7)))  # long time
-+            sage: all(h.compute_product(k, Partition([2, 2, 1])) == B.restrict_degree(k) for k in range(7))  # long time
-             True
-         """
-         # This is the approximate order of the result
diff --git a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch b/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
deleted file mode 100644
index 007f3324cfe4..000000000000
--- a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index b77c69b2f77..0586a96ae55 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -563,7 +563,7 @@ def complex_to_cmap_rgb(z_values, cmap='turbo', contoured=False, tiled=False,
-     import matplotlib as mpl
- 
-     if isinstance(cmap, str):
--        cmap = mpl.cm.get_cmap(cmap)
-+        cmap = mpl.colormaps[cmap]
- 
-     if contour_base is None:
-         if contour_type == "linear":
-@@ -1206,11 +1206,11 @@ def complex_plot(f, x_range, y_range, contoured=False, tiled=False, cmap=None,
-                 domain = np.linspace(0, 1, 256)
-                 shifted_domain = np.roll(domain, 128)
-                 default_cmap = mpl.colors.LinearSegmentedColormap.from_list(
--                    "sage_default", mpl.cm.get_cmap('hsv')(shifted_domain)
-+                    "sage_default", mpl.colormaps['hsv'](shifted_domain)
-                 )
-                 cmap = default_cmap
-             else:
--                cmap = mpl.cm.get_cmap(cmap)
-+                cmap = mpl.colormaps[cmap]
-         rgbs = complex_to_cmap_rgb(
-             z_values, cmap=cmap, contoured=contoured, tiled=tiled,
-             contour_type=contour_type, contour_base=contour_base,
-diff --git a/src/sage/plot/contour_plot.py b/src/sage/plot/contour_plot.py
-index c0cab456686..4accb309580 100644
---- a/src/sage/plot/contour_plot.py
-+++ b/src/sage/plot/contour_plot.py
-@@ -848,9 +848,7 @@ def f(x,y): return cos(x) + sin(y)
- 
-         sage: contour_plot(lambda x,y: 0, (-1,1), (-1,1),
-         ....:              contours=[0], fill=False, cmap=['blue'])
--        ...
--        UserWarning: No contour levels were found within the data range.
--        Graphics object consisting of 1 graphics primitive
-+        ...Graphics object consisting of 1 graphics primitive
- 
-     .. PLOT::
- 
-@@ -874,8 +872,7 @@ def f(x,y): return cos(x) + sin(y)
-     Check that :trac:`18074` is fixed::
- 
-         sage: contour_plot(0, (0,1), (0,1))
--        ... UserWarning: No contour levels were found within the data range.
--        Graphics object consisting of 1 graphics primitive
-+        ...Graphics object consisting of 1 graphics primitive
- 
-     Domain points in :trac:`11648` with complex output are now skipped::
- 
-diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
-index 64ea1a7e10f..cdc99ced263 100644
---- a/src/sage/plot/graphics.py
-+++ b/src/sage/plot/graphics.py
-@@ -2341,7 +2341,7 @@ def _matplotlib_tick_formatter(self, subplot, base=(10, 10),
-             sage: subplot = Figure().add_subplot(111)
-             sage: p._objects[0]._render_on_subplot(subplot)
-             sage: p._matplotlib_tick_formatter(subplot, **d)
--            (<AxesSubplot:...>,
-+            (<Axes...>,
-             <matplotlib.ticker.MaxNLocator object at ...>,
-             <matplotlib.ticker.MaxNLocator object at ...>,
-             <matplotlib.ticker.ScalarFormatter object at ...>,
-diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
-index 99c817f03a6..ae85183dc93 100644
---- a/src/sage/plot/multigraphics.py
-+++ b/src/sage/plot/multigraphics.py
-@@ -1207,7 +1207,7 @@ def _add_subplot(self, figure, index, **options):
-             sage: fig = Figure()
-             sage: ax1 = G._add_subplot(fig, 0)
-             sage: type(ax1)
--            <class 'matplotlib.axes._subplots.AxesSubplot'>
-+            <class 'matplotlib.axes...'>
-             sage: ax2 = G._add_subplot(fig, 1)
-             sage: fig.get_axes() == [ax1, ax2]
-             True
-diff --git a/src/sage/plot/plot3d/plot_field3d.py b/src/sage/plot/plot3d/plot_field3d.py
-index bdf39391d3e..fe10e27f58f 100644
---- a/src/sage/plot/plot3d/plot_field3d.py
-+++ b/src/sage/plot/plot3d/plot_field3d.py
-@@ -126,9 +126,9 @@ def plot_vector_field3d(functions, xrange, yrange, zrange,
-     vectors = [vector((ff(*point), gg(*point), hh(*point))) for point in points]
- 
-     try:
--        from matplotlib.cm import get_cmap
--        cm = get_cmap(colors)
--    except (TypeError, ValueError):
-+        import matplotlib as mpl
-+        cm = mpl.colormaps[colors]
-+    except (TypeError, KeyError):
-         cm = None
-     if cm is None:
-         if isinstance(colors, (list, tuple)):
diff --git a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch b/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
deleted file mode 100644
index 1e0a708e8068..000000000000
--- a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py
-index c9ca5e30939..9459cb70334 100644
---- a/src/sage/interfaces/maxima_lib.py
-+++ b/src/sage/interfaces/maxima_lib.py
-@@ -77,6 +77,26 @@
-     sage: bar == foo
-     True
- 
-+TESTS:
-+
-+Check our workaround for a race in ecl works, see :trac:`26968`.
-+We use a temporary `MAXIMA_USERDIR` so it's empty; we place it
-+in `DOT_SAGE` since we expect it to have more latency than `/tmp`.
-+
-+    sage: import tempfile, subprocess
-+    sage: tmpdir = tempfile.TemporaryDirectory(dir=DOT_SAGE)
-+    sage: _ = subprocess.run(['sage', '-c',  # long time
-+    ....: f'''
-+    ....: import os
-+    ....: os.environ["MAXIMA_USERDIR"] = "{tmpdir.name}"
-+    ....: if not os.fork():
-+    ....:     import sage.interfaces.maxima_lib
-+    ....: else:
-+    ....:     import sage.interfaces.maxima_lib
-+    ....:     os.wait()
-+    ....: '''])
-+    sage: tmpdir.cleanup()
-+
- """
- 
- # ****************************************************************************
-@@ -116,7 +136,23 @@
- ecl_eval("(setq $nolabels t))")
- ecl_eval("(defvar *MAXIMA-LANG-SUBDIR* NIL)")
- ecl_eval("(set-locale-subdir)")
--ecl_eval("(set-pathnames)")
-+
-+try:
-+    ecl_eval("(set-pathnames)")
-+except RuntimeError:
-+    # Recover from :trac:`26968` by creating `*maxima-objdir*` here.
-+    # This cannot be done before calling `(set-pathnames)` since
-+    # `*maxima-objdir*` is computed there.
-+    # We use python `os.makedirs()` which is immune to the race.
-+    # Using `(ensure-directories-exist ...)` in lisp would be
-+    # subject to the same race condition and since `*maxima-objdir*`
-+    # has multiple components this is quite plausible to happen.
-+    maxima_objdir = ecl_eval("*maxima-objdir*").python()[1:-1]
-+    import os
-+    os.makedirs(maxima_objdir, exist_ok=True)
-+    # Call `(set-pathnames)` again to complete its job.
-+    ecl_eval("(set-pathnames)")
-+
- ecl_eval("(defun add-lineinfo (x) x)")
- ecl_eval('(defun principal nil (cond ($noprincipal (diverg)) ((not pcprntd) (merror "Divergent Integral"))))')
- ecl_eval("(remprop 'mfactorial 'grind)")  # don't use ! for factorials (#11539)
diff --git a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch b/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
deleted file mode 100644
index fc3e40da2a88..000000000000
--- a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff --git a/src/bin/sage-cleaner b/src/bin/sage-cleaner
-index e2e578eec60..dc7d8f0482e 100755
---- a/src/bin/sage-cleaner
-+++ b/src/bin/sage-cleaner
-@@ -99,6 +99,15 @@ def cleanup():
- 
-     return len(pid_list)
- 
-+def cleanup_cruft():
-+    """ remove directories leftover from improper shutdown """
-+    tmp_dirs = os.listdir(SAGE_TMP_ROOT)
-+    for dir_entry in tmp_dirs:
-+        baddir = os.path.join(SAGE_TMP_ROOT, dir_entry)
-+        if os.path.isdir(baddir):
-+            logger.warning('Removing old directory %s from SAGE_TMP_ROOT', baddir)
-+            rm_rf(baddir)
-+
- def kill_spawned_jobs(jobfile, parent_pid):
-     logger.info("Killing %s's spawned jobs", parent_pid)
-     killed_them_all = True
-@@ -193,6 +202,7 @@ if __name__ == '__main__':
-     setup_daemon()
-     fix_old_mistakes()
-     logger.info("Starting sage-cleaner with PID %s", os.getpid())
-+    cleanup_cruft()
- 
-     if len(sys.argv) > 1:
-         wait = int(sys.argv[1])
diff --git a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch b/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
deleted file mode 100644
index ea210e20ae52..000000000000
--- a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py
-index ec6a5c19e60..9dd7bc1cb1e 100644
---- a/src/sage/graphs/generators/families.py
-+++ b/src/sage/graphs/generators/families.py
-@@ -3660,7 +3660,7 @@ def nauty_gentreeg(options="", debug=False):
- 
-         sage: gen = graphs.nauty_gentreeg("4", debug=True)
-         sage: print(next(gen))
--        >A ...gentreeg Z=2:3 D=3 n=4
-+        >A ...gentreeg ...
-         sage: gen = graphs.nauty_gentreeg("4 -q", debug=True)
-         sage: next(gen)
-         ''
-@@ -3687,7 +3687,7 @@ def nauty_gentreeg(options="", debug=False):
-         sage: list(graphs.nauty_gentreeg("3 -x", debug=True))
-         ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n [res/mod] ...
-         sage: list(graphs.nauty_gentreeg("3", debug=True))
--        ['>A ...gentreeg Z=2:2 D=2 n=3\n', Graph on 3 vertices]
-+        ['>A ...gentreeg ...\n', Graph on 3 vertices]
-     """
-     import shlex
-     from sage.features.nauty import NautyExecutable
-diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py
-index df88bbe2713..1a8016976c2 100644
---- a/src/sage/graphs/graph_generators.py
-+++ b/src/sage/graphs/graph_generators.py
-@@ -966,7 +966,7 @@ def nauty_geng(self, options="", debug=False):
-             ...
-             ValueError: wrong format of parameter option
-             sage: list(graphs.nauty_geng("-c3", debug=True))
--            ['>E Usage: ...geng [-cCmtfbd#D#] [-uygsnh] [-lvq] ...
-+            ['>E Usage: ...geng ...\n']
-             sage: list(graphs.nauty_geng("-c 3", debug=True))
-             ['>A ...geng -cd1D2 n=3 e=2-3\n', Graph on 3 vertices, Graph on 3 vertices]
-         """
diff --git a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch b/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
deleted file mode 100644
index 46bda084e48e..000000000000
--- a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-diff --git a/src/sage/repl/inputhook.py b/src/sage/repl/inputhook.py
-index da5df0268c0..7f7894f6dcf 100644
---- a/src/sage/repl/inputhook.py
-+++ b/src/sage/repl/inputhook.py
-@@ -17,6 +17,8 @@
- 
- import select
- import errno
-+import contextlib
-+import io
- 
- from IPython import get_ipython
- from IPython.terminal.pt_inputhooks import register
-@@ -47,15 +49,27 @@ def install():
-     """
-     Install the Sage input hook
- 
--    EXAMPLES::
-+    EXAMPLES:
-+
-+    Make sure ipython is running so we really test this function::
-+
-+        sage: from sage.repl.interpreter import get_test_shell
-+        sage: get_test_shell()
-+        <sage.repl.interpreter.SageTestShell object at ...>
-+
-+    Run the function twice, to check it is idempotent (see :trac:`35235`)::
- 
-         sage: from sage.repl.inputhook import install
-         sage: install()
-+        sage: install()
-     """
-     ip = get_ipython()
-     if not ip:
-         return   # Not running in ipython, e.g. doctests
--    ip.enable_gui('sage')
-+    if ip._inputhook != sage_inputhook:
-+        # silence `ip.enable_gui()` useless output
-+        with contextlib.redirect_stdout(io.StringIO()):
-+            ip.enable_gui('sage')
- 
- 
- def uninstall():
-@@ -71,4 +85,6 @@ def uninstall():
-     if not ip:
-         return
-     if ip._inputhook == sage_inputhook:
--        ip.enable_gui(None)
-+        # silence `ip.enable_gui()` useless output
-+        with contextlib.redirect_stdout(io.StringIO()):
-+            ip.enable_gui(None)
diff --git a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch b/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
deleted file mode 100644
index 2cdc674d4f9e..000000000000
--- a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 532fbbaf71bb41c73920b584108eb2a09d6deeb1 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
-Date: Tue, 4 Apr 2023 12:56:57 -0300
-Subject: [PATCH] Ignore deprecation warnings triggered by pythran 0.12.1
-
-These happen with python 3.11, setuptools 67.6.1, numpy 1.24.2.
-When pythran 0.12.1 is installed, I get 24 doctest failures due to
-deprecation warnings; they are all gone with this commit.
-
-[backported from 839a6e928c264a9863bd42860c78ae95a6d9f3e0]
----
- src/sage/all.py | 12 ++++++++++--
- 1 file changed, 10 insertions(+), 2 deletions(-)
-
-diff --git a/src/sage/all.py b/src/sage/all.py
-index 93588df1b93..ee775aad0e9 100644
---- a/src/sage/all.py
-+++ b/src/sage/all.py
-@@ -96,9 +96,17 @@ warnings.filterwarnings('ignore', category=DeprecationWarning,
- warnings.filterwarnings('ignore', category=DeprecationWarning,
-     module='(.*[.]_vendor[.])?packaging')
- 
--# Ignore numpy warnings triggered by pythran
-+# Ignore a few warnings triggered by pythran 0.12.1
- warnings.filterwarnings('ignore', category=DeprecationWarning,
--                        module='pythran')
-+    message='\n\n  `numpy.distutils` is deprecated since NumPy 1.23.0',
-+    module='pythran.dist')
-+warnings.filterwarnings('ignore', category=DeprecationWarning,
-+    message='pkg_resources is deprecated as an API|'
-+            'Deprecated call to `pkg_resources.declare_namespace(.*)`',
-+    module='pkg_resources')
-+warnings.filterwarnings('ignore', category=DeprecationWarning,
-+    message='msvccompiler is deprecated and slated to be removed',
-+    module='distutils.msvccompiler')
- 
- warnings.filterwarnings('ignore', category=DeprecationWarning,
-                         message='The distutils(.sysconfig module| package) is deprecated',
--- 
-2.40.0
-
diff --git a/srcpkgs/sagemath/patches/35584-networkx_3.1.patch b/srcpkgs/sagemath/patches/35584-networkx_3.1.patch
index 66eedecff7c6..9331258986d3 100644
--- a/srcpkgs/sagemath/patches/35584-networkx_3.1.patch
+++ b/srcpkgs/sagemath/patches/35584-networkx_3.1.patch
@@ -1,8 +1,8 @@
 diff --git a/src/sage/graphs/graph.py b/src/sage/graphs/graph.py
-index c2e42bcbd3..b6a10efbf4 100644
+index c2e42bcbd38..0d13f071dc4 100644
 --- a/src/sage/graphs/graph.py
 +++ b/src/sage/graphs/graph.py
-@@ -6786,13 +6786,21 @@ def cliques_number_of(self, vertices=None, cliques=None):
+@@ -6786,13 +6786,26 @@ def cliques_number_of(self, vertices=None, cliques=None):
              {(0, 0): 2, (0, 1): 3, (0, 2): 2, (1, 0): 2, (1, 1): 3, (1, 2): 2}
              sage: F.cliques_number_of(vertices=[(0, 1), (1, 2)])
              {(0, 1): 3, (1, 2): 2}
@@ -18,15 +18,20 @@ index c2e42bcbd3..b6a10efbf4 100644
 +        if cliques is None:
 +            cliques = self.cliques_maximal()
 +
-+        if vertices in self: # single vertex
++        if vertices in self:  # single vertex
 +            return sum(1 for c in cliques if vertices in c)
-+        else:
-+            return { v : sum(1 for c in cliques if v in c)
-+                     for v in vertices or self }
++
++        from collections import Counter
++        count = Counter()
++
++        for c in cliques:
++            count.update(c)
++
++        return {v : count[v] for v in vertices or self}
  
      @doc_index("Clique-related methods")
      def cliques_get_max_clique_graph(self):
-@@ -7493,17 +7501,32 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
+@@ -7493,17 +7506,32 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
  
              sage: C = Graph('DJ{')
              sage: C.cliques_containing_vertex()
@@ -62,7 +67,7 @@ index c2e42bcbd3..b6a10efbf4 100644
  
          Since each clique of a 2 dimensional grid corresponds to an edge, the
          number of cliques in which a vertex is involved equals its degree::
-@@ -7518,8 +7541,14 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
+@@ -7518,8 +7546,20 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
              sage: sorted(sorted(x for x in L) for L in d[(0, 1)])
              [[(0, 0), (0, 1)], [(0, 1), (0, 2)], [(0, 1), (1, 1)]]
          """
@@ -71,11 +76,17 @@ index c2e42bcbd3..b6a10efbf4 100644
 +        if cliques is None:
 +            cliques = self.cliques_maximal()
 +
-+        if vertices in self: # single vertex
++        if vertices in self:  # single vertex
 +            return [c for c in cliques if vertices in c]
-+        else:
-+            return { v : [c for c in cliques if v in c]
-+                     for v in vertices or self }
++
++        from collections import defaultdict
++        d = defaultdict(list)
++
++        for c in cliques:
++            for v in c:
++                d[v].append(c)
++
++        return {v : d[v] for v in vertices or self}
  
      @doc_index("Clique-related methods")
      def clique_complex(self):
diff --git a/srcpkgs/sagemath/patches/35612-linbox_1.7.0.patch b/srcpkgs/sagemath/patches/35612-linbox_1.7.0.patch
new file mode 100644
index 000000000000..58dddf34a69d
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35612-linbox_1.7.0.patch
@@ -0,0 +1,64 @@
+diff --git a/src/sage/libs/linbox/conversion.pxd b/src/sage/libs/linbox/conversion.pxd
+index 7794c9edc39..1753277b1f1 100644
+--- a/src/sage/libs/linbox/conversion.pxd
++++ b/src/sage/libs/linbox/conversion.pxd
+@@ -177,9 +177,8 @@ cdef inline Vector_integer_dense new_sage_vector_integer_dense(P, DenseVector_in
+     - v -- linbox vector
+     """
+     cdef Vector_integer_dense res = P()
+-    cdef cppvector[Integer] * vec = &v.refRep()
+     cdef size_t i
+     for i in range(<size_t> res._degree):
+-        mpz_set(res._entries[i], vec[0][i].get_mpz_const())
++        mpz_set(res._entries[i], v.getEntry(i).get_mpz_const())
+ 
+     return res
+diff --git a/src/sage/libs/linbox/linbox.pxd b/src/sage/libs/linbox/linbox.pxd
+index 9112d151f8b..bfeda4b6042 100644
+--- a/src/sage/libs/linbox/linbox.pxd
++++ b/src/sage/libs/linbox/linbox.pxd
+@@ -32,7 +32,6 @@ cdef extern from "linbox/matrix/dense-matrix.h":
+         ctypedef Modular_double Field
+         ctypedef double Element
+         DenseMatrix_Modular_double(Field F, size_t m, size_t n)
+-        DenseMatrix_Modular_double(Field F, Element*, size_t m, size_t n)
+         void setEntry(size_t i, size_t j, Element& a)
+         Element &getEntry(size_t i, size_t j)
+ 
+@@ -42,7 +41,6 @@ cdef extern from "linbox/matrix/dense-matrix.h":
+         ctypedef Modular_float Field
+         ctypedef float Element
+         DenseMatrix_Modular_float(Field F, size_t m, size_t n)
+-        DenseMatrix_Modular_float(Field F, Element*, size_t m, size_t n)
+         void setEntry(size_t i, size_t j, Element& a)
+         Element &getEntry(size_t i, size_t j)
+ 
+@@ -101,7 +99,6 @@ cdef extern from "linbox/vector/vector.h":
+         DenseVector_integer (Field &F)
+         DenseVector_integer (Field &F, long& m)
+         DenseVector_integer (Field &F, cppvector[Integer]&)
+-        cppvector[Element]& refRep()
+         size_t size()
+         void resize(size_t)
+         void resize(size_t n, const Element&)
+diff --git a/src/sage/matrix/matrix_modn_dense_template.pxi b/src/sage/matrix/matrix_modn_dense_template.pxi
+index abf29badce6..68b869ce314 100644
+--- a/src/sage/matrix/matrix_modn_dense_template.pxi
++++ b/src/sage/matrix/matrix_modn_dense_template.pxi
+@@ -221,9 +221,14 @@ cdef inline linbox_echelonize_efd(celement modulus, celement* entries, Py_ssize_
+         return 0,[]
+ 
+     cdef ModField *F = new ModField(<long>modulus)
+-    cdef DenseMatrix *A = new DenseMatrix(F[0], <ModField.Element*>entries,<Py_ssize_t>nrows, <Py_ssize_t>ncols)
+-    cdef Py_ssize_t r = reducedRowEchelonize(A[0])
++    cdef DenseMatrix *A = new DenseMatrix(F[0], nrows, ncols)
++
+     cdef Py_ssize_t i,j
++    for i in range(nrows):
++        for j in range(ncols):
++            A.setEntry(i, j, entries[i*ncols+j])
++
++    cdef Py_ssize_t r = reducedRowEchelonize(A[0])
+     for i in range(nrows):
+         for j in range(ncols):
+             entries[i*ncols+j] = <celement>A.getEntry(i,j)
diff --git a/srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch b/srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch
new file mode 100644
index 000000000000..0220b4300c30
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35619-maxima_5.46.0.patch
@@ -0,0 +1,569 @@
+diff --git a/build/pkgs/ecl/dependencies b/build/pkgs/ecl/dependencies
+index cda6316bf5a..51a953403e9 100644
+--- a/build/pkgs/ecl/dependencies
++++ b/build/pkgs/ecl/dependencies
+@@ -1,4 +1,4 @@
+-$(MP_LIBRARY) readline gc libffi
++$(MP_LIBRARY) readline gc libffi info
+ 
+ ----------
+ All lines of this file are ignored except the first.
+diff --git a/build/pkgs/ecl/spkg-configure.m4 b/build/pkgs/ecl/spkg-configure.m4
+index ae1e0ac5e1a..7dbcfa6377b 100644
+--- a/build/pkgs/ecl/spkg-configure.m4
++++ b/build/pkgs/ecl/spkg-configure.m4
+@@ -35,10 +35,7 @@ SAGE_SPKG_CONFIGURE([ecl], [
+     AC_SUBST(SAGE_ECL_CONFIG, [$ECL_CONFIG])
+   fi
+ 
+-  # Maxima cannot yet be provided by the system, so we always use
++  # Kenzo cannot yet be provided by the system, so we always use
+   # the SAGE_LOCAL path for now.
+-  AC_SUBST(SAGE_MAXIMA_FAS, ['${prefix}'/lib/ecl/maxima.fas])
+-
+-  # Likewise for the optional Kenzo SPKG
+   AC_SUBST(SAGE_KENZO_FAS, ['${prefix}'/lib/ecl/kenzo.fas])
+ ])
+diff --git a/build/pkgs/ecl/spkg-install.in b/build/pkgs/ecl/spkg-install.in
+index ee1667aec16..72083337942 100644
+--- a/build/pkgs/ecl/spkg-install.in
++++ b/build/pkgs/ecl/spkg-install.in
+@@ -31,18 +31,6 @@ cp "$SAGE_ROOT"/config/config.* src
+ 
+ if [ x"$SAGE_SPKG_INSTALL_DOCS" != xyes ] ; then
+     ECL_CONFIGURE="$ECL_CONFIGURE --enable-manual=no"
+-else
+-    # ECL 2020 needs modern makeinfo
+-    command -v texi2any >/dev/null 2>&1
+-    if [ $? -ne 0 ]; then # texi2any not found -> makeinfo too old, if present
+-        ECL_CONFIGURE="$ECL_CONFIGURE --enable-manual=no"
+-    else
+-        if makeinfo -c foo 2>&1 | grep -q invalid; then
+-            # makeinfo found but does not support all options that ecl
+-            # likes to use
+-            ECL_CONFIGURE="$ECL_CONFIGURE --enable-manual=no"
+-        fi
+-    fi
+ fi
+ 
+ sdh_configure $SAGE_CONFIGURE_GMP \
+diff --git a/build/pkgs/giac/spkg-configure.m4 b/build/pkgs/giac/spkg-configure.m4
+index 5859e35f12e..b677184b7be 100644
+--- a/build/pkgs/giac/spkg-configure.m4
++++ b/build/pkgs/giac/spkg-configure.m4
+@@ -5,7 +5,7 @@ SAGE_SPKG_CONFIGURE([giac], [
+        m4_pushdef([GIAC_MAX_VERSION], [1.9.999])
+        AC_CACHE_CHECK([for giac >= ]GIAC_MIN_VERSION[, <= ]GIAC_MAX_VERSION, [ac_cv_path_GIAC], [
+          AC_PATH_PROGS_FEATURE_CHECK([GIAC], [giac], [
+-            giac_version=$($ac_path_GIAC --version 2> /dev/null | tail -1)
++            giac_version=$($ac_path_GIAC --version 2> /dev/null | tail -n -1)
+             AS_IF([test -n "$giac_version"], [
+                 AX_COMPARE_VERSION([$giac_version], [ge], GIAC_MIN_VERSION, [
+                     AX_COMPARE_VERSION([$giac_version], [le], GIAC_MAX_VERSION, [
+diff --git a/build/pkgs/info/spkg-configure.m4 b/build/pkgs/info/spkg-configure.m4
+index 0980a4b8ef8..85fe1ea4731 100644
+--- a/build/pkgs/info/spkg-configure.m4
++++ b/build/pkgs/info/spkg-configure.m4
+@@ -1,4 +1,14 @@
+ SAGE_SPKG_CONFIGURE([info], [
+   AC_PATH_PROG(INFO, info)
+-  AS_IF([test -z "${INFO}"], [sage_spkg_install_info=yes])
++  AS_IF([test -z "${INFO}"], [sage_spkg_install_info=yes
++    ], [
++     dnl very old makeinfo are not texi2any, newer are symlinks to texi2any
++     AC_PATH_PROG(TEXI2ANY, texi2any)
++     AS_IF([test -z "${TEXI2ANY}"], [sage_spkg_install_info=yes
++       ], [
++        AS_IF([makeinfo -c foo 2>&1 | grep -q invalid], [
++         dnl makeinfo found, but too old, and  does not support all options that ecl likes to use
++         sage_spkg_install_info=yes])
++       ])
++    ])
+ ])
+diff --git a/build/pkgs/info/spkg-install.in b/build/pkgs/info/spkg-install.in
+index 8086e4b2ec8..3ea8c053669 100644
+--- a/build/pkgs/info/spkg-install.in
++++ b/build/pkgs/info/spkg-install.in
+@@ -1,2 +1,2 @@
+-cd src/info
++cd src
+ sdh_make_install
+diff --git a/build/pkgs/info/type b/build/pkgs/info/type
+index 134d9bc32d5..a6a7b9cd726 100644
+--- a/build/pkgs/info/type
++++ b/build/pkgs/info/type
+@@ -1 +1 @@
+-optional
++standard
+diff --git a/build/pkgs/maxima/checksums.ini b/build/pkgs/maxima/checksums.ini
+index a804c7b831f..0f594389fe6 100644
+--- a/build/pkgs/maxima/checksums.ini
++++ b/build/pkgs/maxima/checksums.ini
+@@ -1,5 +1,5 @@
+ tarball=maxima-VERSION.tar.gz
+-sha1=ed15d5285794413ba94412079eca3d0fa55a47bf
+-md5=9b9ae1dace55b1386739dabaa9122e60
+-cksum=1765409766
++sha1=1010594e6d6082bbd8efaac1b7756ec1721a4ed5
++md5=3c01f1daa6936e11d8713fef7751d3fe
++cksum=2420393096
+ upstream_url=https://sourceforge.net/projects/maxima/files/Maxima-source/VERSION-source/maxima-VERSION.tar.gz/download
+diff --git a/build/pkgs/maxima/distros/arch.txt b/build/pkgs/maxima/distros/arch.txt
+index 6400290f44d..6ac052fa62b 100644
+--- a/build/pkgs/maxima/distros/arch.txt
++++ b/build/pkgs/maxima/distros/arch.txt
+@@ -1 +1 @@
+-maxima-ecl
++maxima-fas
+diff --git a/build/pkgs/maxima/distros/cygwin.txt b/build/pkgs/maxima/distros/cygwin.txt
+new file mode 100644
+index 00000000000..f5fe3fdc6cb
+--- /dev/null
++++ b/build/pkgs/maxima/distros/cygwin.txt
+@@ -0,0 +1 @@
++maxima
+diff --git a/build/pkgs/maxima/distros/freebsd.txt b/build/pkgs/maxima/distros/freebsd.txt
+new file mode 100644
+index 00000000000..766a71b5074
+--- /dev/null
++++ b/build/pkgs/maxima/distros/freebsd.txt
+@@ -0,0 +1 @@
++math/maxima
+diff --git a/build/pkgs/maxima/distros/gentoo.txt b/build/pkgs/maxima/distros/gentoo.txt
+new file mode 100644
+index 00000000000..85fb33f1610
+--- /dev/null
++++ b/build/pkgs/maxima/distros/gentoo.txt
+@@ -0,0 +1,2 @@
++sci-mathematics/maxima[ecls]
++
+diff --git a/build/pkgs/maxima/package-version.txt b/build/pkgs/maxima/package-version.txt
+index 83476624dc0..5681375f3be 100644
+--- a/build/pkgs/maxima/package-version.txt
++++ b/build/pkgs/maxima/package-version.txt
+@@ -1 +1 @@
+-5.45.0.p0
++5.46.0
+diff --git a/build/pkgs/maxima/patches/matrixexp.patch b/build/pkgs/maxima/patches/matrixexp.patch
+deleted file mode 100644
+index 5c8527c33bf..00000000000
+--- a/build/pkgs/maxima/patches/matrixexp.patch
++++ /dev/null
+@@ -1,15 +0,0 @@
+-diff --git a/share/linearalgebra/matrixexp.lisp b/share/linearalgebra/matrixexp.lisp
+-index 218bf35..f2fd468 100644
+---- a/share/linearalgebra/matrixexp.lisp
+-+++ b/share/linearalgebra/matrixexp.lisp
+-@@ -138,8 +138,8 @@
+- 	   (print `(ratvars = ,$ratvars gcd = '$gcd algebraic = ,$algebraic))
+- 	   (print `(ratfac = ,$ratfac))
+- 	   (merror "Unable to find the spectrum")))
+--   
+--    (setq res ($fullratsimp (ncpower (sub (mult z ($ident n)) mat) -1) z))
+-+
+-+    (setq res ($fullratsimp ($invert_by_lu (sub (mult z ($ident n)) mat) '$crering) z))
+-     (setq m (length sp))
+-     (dotimes (i m)
+-       (setq zi (nth i sp))
+diff --git a/build/pkgs/maxima/patches/maxima.system.patch b/build/pkgs/maxima/patches/maxima.system.patch
+deleted file mode 100644
+index 74db62e7f9f..00000000000
+--- a/build/pkgs/maxima/patches/maxima.system.patch
++++ /dev/null
+@@ -1,25 +0,0 @@
+-diff --git a/src/maxima.system b/src/maxima.system
+-index 76f2452..cf25f51 100644
+---- a/src/maxima.system
+-+++ b/src/maxima.system
+-@@ -1,5 +1,8 @@
+- ;;; -*- Lisp -*-
+- 
+-+(require :cmp)
+-+(setf c::*compile-in-constants* t)
+-+
+- (in-package :cl-user)
+- 
+- (pushnew :cl *features*)
+-@@ -75,6 +78,11 @@
+- 			     ;; Convert dir/foo.fas to dir/foo.o
+- 			     (make-pathname :type "o" :defaults p))
+- 			 files)))
+-+	(c::build-fasl "binary-ecl/maxima" :lisp-files obj
+-+			  :ld-flags
+-+			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
+-+							      (find-package "MAXIMA")))))
+-+			    (if (and x (not (string= x ""))) (list x))))
+- 	(c::build-program "binary-ecl/maxima" :lisp-files obj
+- 			  :ld-flags
+- 			  (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
+diff --git a/build/pkgs/maxima/spkg-configure.m4 b/build/pkgs/maxima/spkg-configure.m4
+new file mode 100644
+index 00000000000..dc54525320e
+--- /dev/null
++++ b/build/pkgs/maxima/spkg-configure.m4
+@@ -0,0 +1,46 @@
++SAGE_SPKG_CONFIGURE([maxima], [
++  m4_pushdef([SAGE_MAXIMA_MINVER],["5.45.0"])dnl this version and higher allowed
++  SAGE_SPKG_DEPCHECK([ecl], [
++    dnl First check for the "maxima" executable in the user's PATH, because
++    dnl we still use pexpect to communicate with it in a few places.
++    AC_CACHE_CHECK([for Maxima >= $SAGE_MAXIMA_MINVER], [ac_cv_path_MAXIMA], [
++        AC_PATH_PROGS_FEATURE_CHECK([MAXIMA], [maxima], [
++            maxima_version=`$ac_path_MAXIMA --version 2>&1 | tail -n -1\
++                | $SED -n -e 's/Maxima *\([[0-9]]*\.[[0-9]]*\.[[0-9]]*\)/\1/p'`
++            AS_IF([test -n "$maxima_version"], [
++                AX_COMPARE_VERSION([$maxima_version], [ge], [SAGE_MAXIMA_MINVER], [
++                    ac_cv_path_MAXIMA="$ac_path_MAXIMA"
++                    ac_path_MAXIMA_found=:
++                ])
++            ])
++        ])
++    ])
++    SAGE_MAXIMA="$ac_cv_path_MAXIMA"
++    AS_IF([test -z "${SAGE_MAXIMA}"], [
++      sage_spkg_install_maxima=yes
++    ],[
++      dnl If we have the executable, check also for the ECL library.
++      AC_MSG_CHECKING([if ECL can "require" the maxima module])
++      AS_IF([ecl --eval "(require 'maxima)" --eval "(quit)" \
++               >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD], [
++        AC_MSG_RESULT(yes)
++      ], [
++        AC_MSG_RESULT(no)
++        sage_spkg_install_maxima=yes
++      ])
++    ])
++  ])
++  m4_popdef([SAGE_MAXIMA_MINVER])
++],[],[],[
++  # post-check
++  AS_IF([test x$sage_spkg_install_maxima = xyes], [
++    dnl Leaving this variable empty will tell sagelib to load
++    dnl the maxima library (within ECL) by name instead of by
++    dnl absolute path.
++    SAGE_MAXIMA='${prefix}'/bin/maxima
++    SAGE_MAXIMA_FAS='${prefix}'/lib/ecl/maxima.fas
++  ])
++
++  AC_SUBST(SAGE_MAXIMA, "${SAGE_MAXIMA}")
++  AC_SUBST(SAGE_MAXIMA_FAS, "${SAGE_MAXIMA_FAS}")
++])
+diff --git a/build/pkgs/maxima/spkg-install.in b/build/pkgs/maxima/spkg-install.in
+index 3ae6382f9ba..cdb6fbf2069 100644
+--- a/build/pkgs/maxima/spkg-install.in
++++ b/build/pkgs/maxima/spkg-install.in
+@@ -28,28 +28,6 @@ echo
+ echo "Now configuring Maxima..."
+ sdh_configure --enable-ecl git_found=false
+ 
+-# Note the following is regression in maxima build system
+-# see https://sourceforge.net/p/maxima/bugs/3278/
+-# and https://sourceforge.net/p/maxima/bugs/2878/
+-# For the previous time it was fixed.
+-#---------------------------------------------------------------
+-# Touching html and info file to avoid to regenerate them.
+-# This must be done after configuration since the timestamp need
+-# to be later than include-maxima.texi which is generated at
+-# configuration time
+-for i in doc/info/*.html ; do
+-    touch "${i}"
+-done
+-touch doc/info/maxima.info*
+-# Maxima 5.44.0 build_html.sh is not compatible with makeinfo 4.8
+-# (which is /usr/bin/makeinfo on macOS).  #30063
+-# Do not build the HTML docs unless the user asks for it,
+-# in which case it is their problem to install a better
+-# makeinfo version.
+-if [[ "$SAGE_SPKG_INSTALL_DOCS" != yes ]] ; then
+-touch doc/info/maxima_toc.html interfaces/xmaxima/doc/xmaxima.html
+-fi
+-
+ #---------------------------------------------------------------
+ 
+ sdh_make
+diff --git a/build/pkgs/tox/spkg-configure.m4 b/build/pkgs/tox/spkg-configure.m4
+index 7d8ade4c14b..3de0b9b710d 100644
+--- a/build/pkgs/tox/spkg-configure.m4
++++ b/build/pkgs/tox/spkg-configure.m4
+@@ -5,7 +5,7 @@ SAGE_SPKG_CONFIGURE([tox], [
+        m4_pushdef([TOX4_MIN_VERSION], [4.0.15])
+        AC_CACHE_CHECK([for tox 3 >= ]TOX3_MIN_VERSION[ or tox 4 >= ]TOX4_MIN_VERSION, [ac_cv_path_TOX], [
+          AC_PATH_PROGS_FEATURE_CHECK([TOX], [tox], [
+-            tox_version=$($ac_path_TOX --version 2> /dev/null | tail -1)
++            tox_version=$($ac_path_TOX --version 2> /dev/null | tail -n -1)
+             AS_IF([test -n "$tox_version"], [
+                 AX_COMPARE_VERSION([$tox_version], [lt], [4], [
+                     AX_COMPARE_VERSION([$tox_version], [ge], TOX3_MIN_VERSION, [
+diff --git a/pkgs/sage-conf/_sage_conf/_conf.py.in b/pkgs/sage-conf/_sage_conf/_conf.py.in
+index d66bdb3d264..f2e197b45ed 100644
+--- a/pkgs/sage-conf/_sage_conf/_conf.py.in
++++ b/pkgs/sage-conf/_sage_conf/_conf.py.in
+@@ -9,9 +9,11 @@ VERSION = "@PACKAGE_VERSION@"
+ SAGE_LOCAL = "@prefix@"
+ SAGE_ROOT = "@SAGE_ROOT@"
+ 
+-MAXIMA = "@prefix@/bin/maxima"
++# The path to the standalone maxima executable.
++MAXIMA = "@SAGE_MAXIMA@".replace('${prefix}', SAGE_LOCAL)
+ 
+-# Delete this line if your ECL can load maxima without further prodding.
++# Set this to the empty string if your ECL can load maxima without
++# further prodding.
+ MAXIMA_FAS = "@SAGE_MAXIMA_FAS@".replace('${prefix}', SAGE_LOCAL)
+ 
+ # Delete this line if your ECL can load Kenzo without further prodding.
+diff --git a/src/bin/sage-env b/src/bin/sage-env
+index a7da60df28f..13b54fa7e92 100644
+--- a/src/bin/sage-env
++++ b/src/bin/sage-env
+@@ -440,9 +440,6 @@ if [ -d "$DOT_SAGE" ] ; then
+     fi
+ fi
+ 
+-if [ -n "$SAGE_LOCAL" ]; then
+-    export MAXIMA_PREFIX="$SAGE_LOCAL"
+-fi
+ export MAXIMA_USERDIR="$DOT_SAGE/maxima"
+ 
+ if [ -n "$SAGE_LOCAL" ]; then
+diff --git a/src/sage/calculus/calculus.py b/src/sage/calculus/calculus.py
+index dae380180ac..ee8f632e94c 100644
+--- a/src/sage/calculus/calculus.py
++++ b/src/sage/calculus/calculus.py
+@@ -136,10 +136,11 @@
+     [          1/2*(e^(2*sqrt(x)) + 1)*e^(x - sqrt(x)) 1/2*(x*e^(2*sqrt(x)) - x)*sqrt(x)*e^(x - sqrt(x))]
+     [  1/2*(e^(2*sqrt(x)) - 1)*e^(x - sqrt(x))/x^(3/2)           1/2*(e^(2*sqrt(x)) + 1)*e^(x - sqrt(x))]
+ 
+-And complex exponentiation works now::
++Complex exponentiation works, but may require a patched version of
++maxima (:trac:`32898`) for now::
+ 
+     sage: M = i*matrix([[pi]])
+-    sage: e^M
++    sage: e^M  # not tested, requires patched maxima
+     [-1]
+     sage: M = i*matrix([[pi,0],[0,2*pi]])
+     sage: e^M
+@@ -1186,8 +1187,18 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
+         e
+         sage: f.limit(x=5)
+         7776/3125
+-        sage: f.limit(x=1.2)
++
++    Domain to real, a regression in 5.46.0, see https://sf.net/p/maxima/bugs/4138 ::
++
++        sage: maxima_calculus.eval("domain:real")
++        ...
++        sage: f.limit(x=1.2).n()
+         2.06961575467...
++        sage: maxima_calculus.eval("domain:complex");
++        ...
++
++    Otherwise, it works ::
++
+         sage: f.limit(x=I, taylor=True)
+         (-I + 1)^I
+         sage: f(x=1.2)
+@@ -1215,7 +1226,7 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
+     With this example, Maxima is looking for a LOT of information::
+ 
+         sage: assume(a>0)
+-        sage: limit(x^a,x=0)
++        sage: limit(x^a,x=0)  # random - maxima 5.46.0 does not need extra assumption
+         Traceback (most recent call last):
+         ...
+         ValueError: Computation failed since Maxima requested additional
+@@ -1224,7 +1235,7 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
+          more details)
+         Is a an integer?
+         sage: assume(a,'integer')
+-        sage: limit(x^a, x=0)
++        sage: limit(x^a, x=0)  # random - maxima 5.46.0 does not need extra assumption
+         Traceback (most recent call last):
+         ...
+         ValueError: Computation failed since Maxima requested additional
+@@ -2251,10 +2262,10 @@ def symbolic_expression_from_maxima_string(x, equals_sub=False, maxima=maxima):
+         True
+         sage: sefms("x # 3") == SR(x != 3)
+         True
+-        sage: solve([x != 5], x)
+-        [[x - 5 != 0]]
++        sage: solve([x != 5], x) in [[[x - 5 != 0]], [[x < 5], [5 < x]]]
++        True
+         sage: solve([2*x==3, x != 5], x)
+-        [[x == (3/2), (-7/2) != 0]]
++        [[x == (3/2)...
+ 
+     Make sure that we don't accidentally pick up variables in the maxima namespace (:trac:`8734`)::
+ 
+diff --git a/src/sage/functions/exp_integral.py b/src/sage/functions/exp_integral.py
+index e6c888c64b6..f314e525145 100644
+--- a/src/sage/functions/exp_integral.py
++++ b/src/sage/functions/exp_integral.py
+@@ -601,8 +601,8 @@ class Function_log_integral_offset(BuiltinFunction):
+         1/log(x)
+         sage: f.integrate(x)
+         -x*log_integral(2) + x*log_integral(x) - Ei(2*log(x))
+-        sage: Li(x).integrate(x,2.0,4.5)
+-        -2.5*log_integral(2) + 5.799321147411334
++        sage: Li(x).integrate(x,2.0,4.5).n(digits=10)
++        3.186411697
+         sage: N(f.integrate(x,2.0,3.0))   # abs tol 1e-15
+         0.601621785860587
+ 
+diff --git a/src/sage/interfaces/expect.py b/src/sage/interfaces/expect.py
+index 68ae715e4c3..84adf0341b5 100644
+--- a/src/sage/interfaces/expect.py
++++ b/src/sage/interfaces/expect.py
+@@ -620,7 +620,7 @@ def quit(self, verbose=False):
+ 
+             sage: a = maxima('y')
+             sage: maxima.quit(verbose=True)
+-            Exiting Maxima with PID ... running .../bin/maxima...
++            Exiting Maxima with PID ... running ...maxima...
+             sage: a._check_valid()
+             Traceback (most recent call last):
+             ...
+diff --git a/src/sage/interfaces/maxima.py b/src/sage/interfaces/maxima.py
+index 27b1e98a6ac..4829560f98b 100644
+--- a/src/sage/interfaces/maxima.py
++++ b/src/sage/interfaces/maxima.py
+@@ -622,11 +622,6 @@ def _start(self):
+             sage: m.is_running()
+             True
+ 
+-        Test that we can use more than 256MB RAM (see :trac:`6772`)::
+-
+-            sage: a = maxima(10)^(10^5)
+-            sage: b = a^600              # long time -- about 10-15 seconds
+-
+         """
+         Expect._start(self)
+         self._sendline(r":lisp (defun tex-derivative (x l r) (tex (if $derivabbrev (tex-dabbrev x) (tex-d x '\\partial)) l r lop rop ))")
+@@ -634,9 +629,6 @@ def _start(self):
+         # Don't use ! for factorials (#11539)
+         self._sendline(":lisp (remprop 'mfactorial 'grind)")
+ 
+-        # Remove limit on the max heapsize (since otherwise it defaults
+-        # to 256MB with ECL).
+-        self._sendline(":lisp (ext:set-limit 'ext:heap-size 0)")
+         self._eval_line('0;')
+ 
+         # set random seed
+diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py
+index c263ac65f02..bba8504aa92 100644
+--- a/src/sage/interfaces/maxima_lib.py
++++ b/src/sage/interfaces/maxima_lib.py
+@@ -934,8 +934,15 @@ def sr_limit(self, expr, v, a, dir=None):
+             e
+             sage: limit(f,x = 5)
+             7776/3125
+-            sage: limit(f,x = 1.2)
++
++        Domain to real, a regression in 5.46.0, see https://sf.net/p/maxima/bugs/4138 ::
++
++            sage: maxima_calculus.eval("domain:real")
++            ...
++            sage: limit(f,x = 1.2).n()
+             2.06961575467...
++            sage: maxima_calculus.eval("domain:complex");
++            ...
+             sage: var('a')
+             a
+             sage: limit(x^a,x=0)
+@@ -947,7 +954,7 @@ def sr_limit(self, expr, v, a, dir=None):
+             for more details)
+             Is a positive, negative or zero?
+             sage: assume(a>0)
+-            sage: limit(x^a,x=0)
++            sage: limit(x^a,x=0)  # random - not needed for maxima 5.46.0
+             Traceback (most recent call last):
+             ...
+             ValueError: Computation failed ...
+diff --git a/src/sage/matrix/matrix2.pyx b/src/sage/matrix/matrix2.pyx
+index e2e6449dfa9..15914b0be3e 100644
+--- a/src/sage/matrix/matrix2.pyx
++++ b/src/sage/matrix/matrix2.pyx
+@@ -15425,9 +15425,10 @@ cdef class Matrix(Matrix1):
+ 
+         TESTS:
+ 
+-        Check that sparse matrices are handled correctly (:trac:`28935`)::
++        Sparse matrices are handled correctly (:trac:`28935`), but may
++        require a patched version of maxima (:trac:`32898`) for now::
+ 
+-            sage: matrix.diagonal([0], sparse=True).exp()
++            sage: matrix.diagonal([0], sparse=True).exp()  # not tested, requires patched maxima
+             [1]
+             sage: matrix.zero(CBF, 2, sparse=True).exp()
+             [1.000000000000000                 0]
+diff --git a/src/sage/matrix/matrix_symbolic_dense.pyx b/src/sage/matrix/matrix_symbolic_dense.pyx
+index 19ca5c85cb2..58a25e002f6 100644
+--- a/src/sage/matrix/matrix_symbolic_dense.pyx
++++ b/src/sage/matrix/matrix_symbolic_dense.pyx
+@@ -402,7 +402,8 @@ cdef class Matrix_symbolic_dense(Matrix_generic_dense):
+             [1/2*(e^(2*x) + 1)*e^(-x) 1/2*(e^(2*x) - 1)*e^(-x)]
+             [1/2*(e^(2*x) - 1)*e^(-x) 1/2*(e^(2*x) + 1)*e^(-x)]
+ 
+-        Exp works on 0x0 and 1x1 matrices::
++        Exponentiation works on 0x0 and 1x1 matrices, but the 1x1 example
++        requires a patched version of maxima (:trac:`32898`) for now::
+ 
+             sage: m = matrix(SR,0,[]); m
+             []
+@@ -410,7 +411,7 @@ cdef class Matrix_symbolic_dense(Matrix_generic_dense):
+             []
+             sage: m = matrix(SR,1,[2]); m
+             [2]
+-            sage: m.exp()
++            sage: m.exp()  # not tested, requires patched maxima
+             [e^2]
+ 
+         Commuting matrices `m, n` have the property that
+@@ -451,7 +452,6 @@ cdef class Matrix_symbolic_dense(Matrix_generic_dense):
+             [                       0 1/2*(e^(2*x) + 1)*e^(-x) 1/2*(e^(2*x) - 1)*e^(-x)                        0]
+             [                       0 1/2*(e^(2*x) - 1)*e^(-x) 1/2*(e^(2*x) + 1)*e^(-x)                        0]
+             [1/2*(e^(2*x) - 1)*e^(-x)                        0                        0 1/2*(e^(2*x) + 1)*e^(-x)]
+-
+         """
+         if not self.is_square():
+             raise ValueError("exp only defined on square matrices")
+diff --git a/src/sage/symbolic/integration/integral.py b/src/sage/symbolic/integration/integral.py
+index c82e9ed73c3..e84ad357ee2 100644
+--- a/src/sage/symbolic/integration/integral.py
++++ b/src/sage/symbolic/integration/integral.py
+@@ -741,14 +741,14 @@ def integrate(expression, v=None, a=None, b=None, algorithm=None, hold=False):
+ 
+         sage: _ = var('x,y')
+         sage: f = log(x^2+y^2)
+-        sage: res = integral(f,x,0.0001414, 1.); res
++        sage: res = integral(f,x,1414/10^7, 1); res
+         Traceback (most recent call last):
+         ...
+-        ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(50015104*y^2-50015103>0)', see `assume?` for more details)
+-        Is 50015104*y^2-50015103 positive, negative or zero?
++        ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help ...
++        Is ... positive, negative or zero?
+         sage: assume(y>1)
+-        sage: res = integral(f,x,0.0001414, 1.); res
+-        2*y*arctan(1.0/y) - 2*y*arctan(0.0001414/y) + 1.0*log(1.0*y^2 + 1.0) - 0.0001414*log(1.0*y^2 + 1.9993959999999997e-08) - 1.9997172
++        sage: res = integral(f,x,1414/10^7, 1); res
++        -2*y*arctan(707/5000000/y) + 2*y*arctan(1/y) + log(y^2 + 1) - 707/5000000*log(y^2 + 499849/25000000000000) - 4999293/2500000
+         sage: nres = numerical_integral(f.subs(y=2), 0.0001414, 1.); nres
+         (1.4638323264144..., 1.6251803529759...e-14)
+         sage: res.subs(y=2).n()
+diff --git a/src/sage/symbolic/relation.py b/src/sage/symbolic/relation.py
+index 94813315181..a72ab547c76 100644
+--- a/src/sage/symbolic/relation.py
++++ b/src/sage/symbolic/relation.py
+@@ -1787,8 +1787,8 @@ def solve_ineq_fourier(ineq, vars=None):
+         sage: y = var('y')
+         sage: solve_ineq_fourier([x+y<9,x-y>4],[x,y])
+         [[y + 4 < x, x < -y + 9, y < (5/2)]]
+-        sage: solve_ineq_fourier([x+y<9,x-y>4],[y,x])
+-        [[y < min(x - 4, -x + 9)]]
++        sage: solve_ineq_fourier([x+y<9,x-y>4],[y,x])[0][0](x=42)
++        y < -33
+ 
+         sage: solve_ineq_fourier([x^2>=0])
+         [[x < +Infinity]]
diff --git a/srcpkgs/sagemath/patches/35635-sympy_1.12.patch b/srcpkgs/sagemath/patches/35635-sympy_1.12.patch
new file mode 100644
index 000000000000..9cfc69c2adb6
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35635-sympy_1.12.patch
@@ -0,0 +1,54 @@
+diff --git a/src/sage/calculus/calculus.py b/src/sage/calculus/calculus.py
+index dae380180ac..ca3c59e63d2 100644
+--- a/src/sage/calculus/calculus.py
++++ b/src/sage/calculus/calculus.py
+@@ -1690,8 +1690,11 @@ def laplace(ex, t, s, algorithm='maxima'):
+ 
+     Testing SymPy::
+ 
+-        sage: laplace(t^n, t, s, algorithm='sympy')
+-        (gamma(n + 1)/(s*s^n), 0, re(n) > -1)
++        sage: F, a, cond = laplace(t^n, t, s, algorithm='sympy')
++        sage: a, cond
++        (0, re(n) > -1)
++        sage: F.simplify()
++        s^(-n - 1)*gamma(n + 1)
+ 
+     Testing Maxima::
+ 
+@@ -1700,17 +1703,19 @@ def laplace(ex, t, s, algorithm='maxima'):
+ 
+     Check that :trac:`24212` is fixed::
+ 
+-        sage: laplace(cos(t^2), t, s, algorithm='sympy')
+-        (-1/2*sqrt(pi)*(sqrt(2)*cos(1/4*s^2)*fresnel_sin(1/2*sqrt(2)*s/sqrt(pi)) -
+-        sqrt(2)*fresnel_cos(1/2*sqrt(2)*s/sqrt(pi))*sin(1/4*s^2) - cos(1/4*pi + 1/4*s^2)),
+-        0, True)
++        sage: F, a, cond = laplace(cos(t^2), t, s, algorithm='sympy')
++        sage: a, cond
++        (0, True)
++        sage: F._sympy_().simplify()
++        sqrt(pi)*(sqrt(2)*sin(s**2/4)*fresnelc(sqrt(2)*s/(2*sqrt(pi))) -
++        sqrt(2)*cos(s**2/4)*fresnels(sqrt(2)*s/(2*sqrt(pi))) + cos(s**2/4 + pi/4))/2
+ 
+     Testing result from SymPy that Sage doesn't know how to handle::
+ 
+         sage: laplace(cos(-1/t), t, s, algorithm='sympy')
+         Traceback (most recent call last):
+         ...
+-        AttributeError: Unable to convert SymPy result (=meijerg(((), ()), ((-1/2, 0, 1/2), (0,)), s**2/16)/4) into Sage
++        AttributeError: Unable to convert SymPy result (=meijerg(((), ()), ((-1/2, 0, 1/2), (0,)), ...)/4) into Sage
+     """
+     if not isinstance(ex, (Expression, Function)):
+         ex = SR(ex)
+@@ -1817,8 +1822,8 @@ def inverse_laplace(ex, s, t, algorithm='maxima'):
+ 
+     Transform an expression involving a time-shift, via SymPy::
+ 
+-        sage: inverse_laplace(1/s^2*exp(-s), s, t, algorithm='sympy')
+-        -(log(e^(-t)) + 1)*heaviside(t - 1)
++        sage: inverse_laplace(1/s^2*exp(-s), s, t, algorithm='sympy').simplify()
++        (t - 1)*heaviside(t - 1)
+ 
+     The same instance with Giac::
+ 
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 871ae38577fd..049694826d20 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 URL_BASE_PR="https://github.com/sagemath/sage/pull/"
-URL_BASE_COMPARE="https://github.com/sagemath/sage/compare/9.8..."
+URL_BASE_COMPARE="https://github.com/sagemath/sage/compare/10.0..."
 
 case "$1" in
 	-n)  DO=echo ;;
@@ -15,49 +15,13 @@ get_pr() {
 	$DO wget "$URL_BASE_PR$pr.$ext" -O "$pr-$desc.patch"
 }
 
-get_trac() {
-	ticket=$1
-	desc=$(echo "$2" | sed -e 's/ /_/g')
-	commit=$3
-	$DO wget "$URL_BASE_COMPARE$commit.diff" -O "$ticket-$desc-$commit.patch"
-}
-
 # run from patches dir
 cd $(dirname "$0")
 
-# merged in 10.0.beta0
-get_trac 34851 "support singular 4.3.1.p3" 5e5737a0c
-get_pr 35068 "fix tests giac 1.9.0.35" patch
-
-# merged in 10.0.beta1
-get_pr 35058 "skip unstable tests klyachko"
-
-# merged in 10.0.beta2
-get_pr 34994 "fix tests numpy 1.24"
-get_pr 34997 "fix edge case of integer_check"
-
-# merged in 10.0.beta3
-get_pr 34995 "support tachyon 0.99.2"
-
-# merged in 10.0.beta4
-get_pr 34980 "avoid factoring in is_prime"
-
-# merged in 10.0.beta5
-get_pr 35094 "support gap 4.12"					# includes PR 35093
-
-# merged in 10.0.beta6
-get_pr 35127 "fix very slow test stream.py"
-get_pr 35177 "matplotlib 3.7"
-get_pr 35195 "workaround ecl race"
-get_pr 35204 "fix sage-cleaner"
-
-# merged in 10.0.beta7
-get_pr 35250 "nauty 2.8.6"
-
-# merged in 10.0.beta8
-#get_pr 35337 "ipython 8.11"
-get_pr 35423 "ipython 8.12"						# includes PR 35337
-get_pr 35438 "pythran 0.12.1"
+# positive review
+get_pr 35584 "networkx 3.1"
+get_pr 35612 "linbox 1.7.0"
+get_pr 35635 "sympy 1.12"
 
 # needs review
-get_pr 35584 "networkx 3.1"
+get_pr 35619 "maxima 5.46.0"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 66a543efd21d..6fc7c3b2b4a8 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=9.8
-revision=2
+version=10.0
+revision=1
 build_wrksrc=pkgs/sagemath-standard
 build_style=python3-module
 _bindir=/usr/lib/sagemath/$version/bin
@@ -31,8 +31,10 @@ short_desc="Open source mathematics software"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-or-later"
 homepage="http://sagemath.org/"
+changelog="https://github.com/sagemath/sage/releases"
 distfiles="https://github.com/sagemath/sage/archive/refs/tags/$version.tar.gz"
-checksum=2aff28bd1d18c2d526581f5298acb8336f5b92db5675a7403dec8eaf9a86bc4c
+checksum=60858efd0d1f2526486740962bf72c99f9141a56caf8395f3291fded276faf55
+nocross="due to ntl (flintlib), fflas-ffpack, givaro, linbox, cysignals, sympow, maxima"
 
 do_configure() {
 	# git tree needs bootstrapping

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: sagemath: update to 10.0.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (33 preceding siblings ...)
  2023-05-21 23:32 ` [PR PATCH] [Updated] " tornaria
@ 2023-05-23  1:19 ` dkwo
  2023-05-29 18:09 ` tornaria
                   ` (4 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: dkwo @ 2023-05-23  1:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 241 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43659#issuecomment-1558317898

Comment:
Looks great! I expect all tests to pass also on aarch64, but won't be able to confirm until next week.

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: sagemath: update to 10.0.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (34 preceding siblings ...)
  2023-05-23  1:19 ` dkwo
@ 2023-05-29 18:09 ` tornaria
  2023-05-29 18:53 ` dkwo
                   ` (3 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: tornaria @ 2023-05-29 18:09 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 207 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43659#issuecomment-1567399476

Comment:
@dkwo : did you get a chance to test? Shall we merge this as is?

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: sagemath: update to 10.0.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (35 preceding siblings ...)
  2023-05-29 18:09 ` tornaria
@ 2023-05-29 18:53 ` dkwo
  2023-05-30 20:52 ` dkwo
                   ` (2 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: dkwo @ 2023-05-29 18:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 274 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43659#issuecomment-1567425108

Comment:
I will test tomorrow (I forgot that today is a holiday in the US).
I'm fine either way, I can always open a PR if anything comes up :)

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: sagemath: update to 10.0.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (36 preceding siblings ...)
  2023-05-29 18:53 ` dkwo
@ 2023-05-30 20:52 ` dkwo
  2023-05-30 20:52 ` dkwo
  2023-05-31 11:18 ` [PR PATCH] [Merged]: " leahneukirchen
  39 siblings, 0 replies; 41+ messages in thread
From: dkwo @ 2023-05-30 20:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 189 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43659#issuecomment-1569085262

Comment:
all tests are passing out of the box on aarch64 :)

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: sagemath: update to 10.0.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (37 preceding siblings ...)
  2023-05-30 20:52 ` dkwo
@ 2023-05-30 20:52 ` dkwo
  2023-05-31 11:18 ` [PR PATCH] [Merged]: " leahneukirchen
  39 siblings, 0 replies; 41+ messages in thread
From: dkwo @ 2023-05-30 20:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 175 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43659#issuecomment-1569085516

Comment:
@leahneukirchen shall we merge this?

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PR PATCH] [Merged]: sagemath: update to 10.0.
  2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
                   ` (38 preceding siblings ...)
  2023-05-30 20:52 ` dkwo
@ 2023-05-31 11:18 ` leahneukirchen
  39 siblings, 0 replies; 41+ messages in thread
From: leahneukirchen @ 2023-05-31 11:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1526 bytes --]

There's a merged pull request on the void-packages repository

sagemath: update to 10.0.
https://github.com/void-linux/void-packages/pull/43659

Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->

This builds on top of #43225 for convenience.

#### Testing the changes
- I tested the changes in this PR: **briefly**

I've been following beta releases and now rc0 includes all of our patches :muscle:

All doctests pass with the version of packages in void except for `python-Babel` which must be updated (as in #43497) and is included  here as part of #43225.

I've switched my system sagemath to this version as everything seems to be working ok. The testsuite is 10-15% faster.

@dkwo: enjoy.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


^ permalink raw reply	[flat|nested] 41+ messages in thread

end of thread, other threads:[~2023-05-31 11:18 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-28 20:25 [PR PATCH] [RFC] sagemath: update to 10.0.rc0 tornaria
2023-04-28 20:38 ` icp1994
2023-04-28 20:47 ` tornaria
2023-04-28 22:50 ` tornaria
2023-04-29  1:28 ` tornaria
2023-04-29  2:20 ` [PR PATCH] [Updated] " tornaria
2023-05-05  1:46 ` tornaria
2023-05-05  1:51 ` [RFC] sagemath: update to 10.0.rc1 tornaria
2023-05-05 12:28 ` tornaria
2023-05-05 19:16 ` [PR PATCH] [Updated] " tornaria
2023-05-06  1:16 ` tornaria
2023-05-06 14:06 ` dkwo
2023-05-06 14:45 ` tornaria
2023-05-09 13:11 ` dkwo
2023-05-10 12:48 ` [PR PATCH] [Updated] " tornaria
2023-05-10 12:55 ` tornaria
2023-05-13  2:33 ` [PR PATCH] [Updated] [RFC] sagemath: update to 10.0.rc2 tornaria
2023-05-13  3:14 ` [PR PATCH] [Updated] [RFC] sagemath: update to 10.0.rc3 tornaria
2023-05-13 18:12 ` dkwo
2023-05-13 22:12 ` [PR PATCH] [Updated] " tornaria
2023-05-15 15:04 ` dkwo
2023-05-15 16:35 ` tornaria
2023-05-15 18:42 ` dkwo
2023-05-15 19:06 ` tornaria
2023-05-15 21:16 ` dkwo
2023-05-15 21:50 ` tornaria
2023-05-16 14:28 ` dkwo
2023-05-16 14:39 ` dkwo
2023-05-18 14:08 ` dkwo
2023-05-21 15:28 ` [PR PATCH] [Updated] " tornaria
2023-05-21 15:32 ` [RFC] sagemath: update to 10.0 tornaria
2023-05-21 18:18 ` [PR PATCH] [Updated] " tornaria
2023-05-21 22:37 ` tornaria
2023-05-21 22:39 ` tornaria
2023-05-21 23:32 ` [PR PATCH] [Updated] " tornaria
2023-05-23  1:19 ` dkwo
2023-05-29 18:09 ` tornaria
2023-05-29 18:53 ` dkwo
2023-05-30 20:52 ` dkwo
2023-05-30 20:52 ` dkwo
2023-05-31 11:18 ` [PR PATCH] [Merged]: " leahneukirchen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).