Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] sagemath-9.5: package updates and fixes
@ 2022-03-30 13:55 tornaria
  2022-03-30 14:48 ` dkwo
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: tornaria @ 2022-03-30 13:55 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tornaria/void-packages sagemath-update
https://github.com/void-linux/void-packages/pull/36420

sagemath-9.5: package updates and fixes
#### Testing the changes
- I tested the changes in this PR: **YES**

This includes
 - upgrade to lrcalc-2.1 (from #36209)
 - upgrade to sympy-1.10.1 (from #36397)
 - other package upgrades (SuiteSparse, igraph, planarity, cvxopt, gp2c, giac)
 - backported fixes for sagemath-9.5 to accomodate these upgrades, and also ipython and scipy upgrades which are already merged

I want to see if the CI can cope with this. Otherwise I'll just split this in a few separate PR. Except for the upgrade to lrcalc-2.1, which must be coordinated with sage, everything else can be handled separately.

cc: @dkwo

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

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

From 6b05f1ef2c2a208d3f2da3e3cd5df539179ea907 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 28 Feb 2022 12:03:22 -0300
Subject: [PATCH 01/12] lrcalc: update to 2.1.

---
 common/shlibs                         |  2 +-
 srcpkgs/lrcalc/patches/includes.patch | 90 ---------------------------
 srcpkgs/lrcalc/template               |  6 +-
 3 files changed, 4 insertions(+), 94 deletions(-)
 delete mode 100644 srcpkgs/lrcalc/patches/includes.patch

diff --git a/common/shlibs b/common/shlibs
index ccc55a1b3772..21748292c4e9 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4040,7 +4040,7 @@ libarb.so.2 arb-2.20.0_1
 libec.so.8 eclib-20210625_1
 libsymmetrica.so.2 symmetrica-3.0.1_1
 libLfunction.so.1 lcalc-2.0.4_1
-liblrcalc.so.1 lrcalc-1.2_1
+liblrcalc.so.2 lrcalc-2.1_1
 libwayland-client++.so.0 libwaylandpp-0.2.8_1
 libwayland-cursor++.so.0 libwaylandpp-0.2.8_1
 libwayland-egl++.so.0 libwaylandpp-0.2.8_1
diff --git a/srcpkgs/lrcalc/patches/includes.patch b/srcpkgs/lrcalc/patches/includes.patch
deleted file mode 100644
index 707da176a60f..000000000000
--- a/srcpkgs/lrcalc/patches/includes.patch
+++ /dev/null
@@ -1,90 +0,0 @@
-From 4a5e1c8c3c11efdb1cbb4239825a6bf4bf1c52f8 Mon Sep 17 00:00:00 2001
-From: Anders Skovsted Buch <asbuch@math.rutgers.edu>
-Date: Sun, 29 Nov 2015 16:25:56 -0500
-Subject: [PATCH] Patch by Jeroen Demeyer to change include <vector.h> to
- "vector.h", plus similar cases.
-
----
- src/lrcalc.c   | 2 +-
- src/maple.c    | 4 ++--
- src/schublib.h | 2 +-
- src/symfcn.c   | 6 +++---
- src/symfcn.h   | 4 ++--
- 5 files changed, 9 insertions(+), 9 deletions(-)
-
-diff --git a/src/lrcalc.c b/src/lrcalc.c
-index aff3f75..60df49e 100644
---- a/src/lrcalc.c
-+++ b/src/lrcalc.c
-@@ -8,7 +8,7 @@
- #include <stdlib.h>
- extern char *optarg;
- 
--#include <vectarg.h>
-+#include "vectarg.h"
- 
- #include "symfcn.h"
- #include "maple.h"
-diff --git a/src/maple.c b/src/maple.c
-index fdc0768..a5f4d14 100644
---- a/src/maple.c
-+++ b/src/maple.c
-@@ -4,8 +4,8 @@
-  */
- 
- #include <stdio.h>
--#include <vector.h>
--#include <hashtab.h>
-+#include "vector.h"
-+#include "hashtab.h"
- #include "maple.h"
- 
- 
-diff --git a/src/schublib.h b/src/schublib.h
-index a8e8511..864850c 100644
---- a/src/schublib.h
-+++ b/src/schublib.h
-@@ -1,7 +1,7 @@
- #ifndef _SCHUBLIB_H
- #define _SCHUBLIB_H
- 
--#include <hashtab.h>
-+#include "hashtab.h"
- 
- hashtab *trans(vector *w, int vars, hashtab *res);
- hashtab *monk(int i, hashtab *slc, int rank);
-diff --git a/src/symfcn.c b/src/symfcn.c
-index 4ffbe4b..fd5df5d 100644
---- a/src/symfcn.c
-+++ b/src/symfcn.c
-@@ -5,9 +5,9 @@
- 
- #include <stdio.h>
- 
--#include <alloc.h>
--#include <vector.h>
--#include <hashtab.h>
-+#include "alloc.h"
-+#include "vector.h"
-+#include "hashtab.h"
- 
- #include "symfcn.h"
- 
-diff --git a/src/symfcn.h b/src/symfcn.h
-index b8543b1..29bb00d 100644
---- a/src/symfcn.h
-+++ b/src/symfcn.h
-@@ -1,8 +1,8 @@
- #ifndef _SYMFCN_H
- #define _SYMFCN_H
- 
--#include <hashtab.h>
--#include <vector.h>
-+#include "hashtab.h"
-+#include "vector.h"
- 
- int part_itr_sz(vector *part);
- int part_itr_sub(vector *part, vector *outer);
--- 
-2.1.1.1.g1fb337f
-
diff --git a/srcpkgs/lrcalc/template b/srcpkgs/lrcalc/template
index 8b33c3cba6c8..afa889b6d6ad 100644
--- a/srcpkgs/lrcalc/template
+++ b/srcpkgs/lrcalc/template
@@ -1,14 +1,14 @@
 # Template file for 'lrcalc'
 pkgname=lrcalc
-version=1.2
-revision=2
+version=2.1
+revision=1
 build_style=gnu-configure
 short_desc="Littlewood-Richardson Calculator"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-3.0-or-later"
 homepage="https://sites.math.rutgers.edu/~asbuch/lrcalc/"
 distfiles="https://sites.math.rutgers.edu/~asbuch/lrcalc/lrcalc-$version.tar.gz"
-checksum=792dd538a0d19698be2c5b8c138730bbb4820e8a44e03b001ae14bd5f1d7040b
+checksum=996ac00e6ea8321ef09b34478f5379f613933c3254aeba624b6419b8afa5df57
 
 lrcalc-devel_package() {
 	depends="${sourcepkg}>=${version}_${revision} ${makedepends}"

From d347fd5efe3a459bf4cc7bb9fb88db2d5ea3e137 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 28 Feb 2022 14:06:21 -0300
Subject: [PATCH 02/12] New package: python3-lrcalc-2.1

---
 srcpkgs/python3-lrcalc/template | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/python3-lrcalc/template

diff --git a/srcpkgs/python3-lrcalc/template b/srcpkgs/python3-lrcalc/template
new file mode 100644
index 000000000000..9f335dac35dd
--- /dev/null
+++ b/srcpkgs/python3-lrcalc/template
@@ -0,0 +1,14 @@
+# Template file for 'python3-lrcalc'
+pkgname=python3-lrcalc
+version=2.1
+revision=1
+wrksrc=lrcalc-${version}
+build_style=python3-module
+hostmakedepends="python3-setuptools python3-Cython"
+makedepends="python3-devel lrcalc-devel"
+short_desc="Python bindings for the Littlewood-Richardson Calculator library"
+maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
+license="GPL-3.0-or-later"
+homepage="https://math.rutgers.edu/~asbuch/lrcalc"
+distfiles="${PYPI_SITE}/l/lrcalc/lrcalc-${version}.tar.gz"
+checksum=e3a0509aeda487b412b391a52e817ca36b5c063a8305e09fd54d53259dd6aaa9

From b99a86d6d4a3fdf24ba262289f3bad8ac579c40e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 19 Mar 2022 21:55:20 -0300
Subject: [PATCH 03/12] python3-sympy: update to 1.10.1.

Also fix integer_nthroot(2, 10**10) in 32 bit, reported upstream.
---
 .../patches/fix_integer_nthroot.patch         | 26 +++++++++++++++++++
 srcpkgs/python3-sympy/template                |  4 +--
 2 files changed, 28 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/python3-sympy/patches/fix_integer_nthroot.patch

diff --git a/srcpkgs/python3-sympy/patches/fix_integer_nthroot.patch b/srcpkgs/python3-sympy/patches/fix_integer_nthroot.patch
new file mode 100644
index 000000000000..0f4860a6c9e1
--- /dev/null
+++ b/srcpkgs/python3-sympy/patches/fix_integer_nthroot.patch
@@ -0,0 +1,26 @@
+Fix integer_nthroot(2, 10**10) in 32 bit.
+
+See: https://github.com/sympy/sympy/issues/18374#issuecomment-1081196879
+
+diff --git a/sympy/core/power.py b/sympy/core/power.py
+index 59ab7c53a4..ae3ee25c93 100644
+--- a/sympy/core/power.py
++++ b/sympy/core/power.py
+@@ -21,6 +21,8 @@
+
+ from mpmath.libmp import sqrtrem as mpmath_sqrtrem
+
++from ctypes import c_ulong
++ULONG_MAX = c_ulong(-1).value
+
+
+ def isqrt(n):
+@@ -74,7 +76,7 @@ def integer_nthroot(y, n):
+         raise ValueError("y must be nonnegative")
+     if n < 1:
+         raise ValueError("n must be positive")
+-    if HAS_GMPY and n < 2**63:
++    if HAS_GMPY and n <= ULONG_MAX:
+         # Currently it works only for n < 2**63, else it produces TypeError
+         # sympy issue: https://github.com/sympy/sympy/issues/18374
+         # gmpy2 issue: https://github.com/aleaxit/gmpy/issues/257
diff --git a/srcpkgs/python3-sympy/template b/srcpkgs/python3-sympy/template
index 807f0db5f1a2..3bb4df3bffdf 100644
--- a/srcpkgs/python3-sympy/template
+++ b/srcpkgs/python3-sympy/template
@@ -1,6 +1,6 @@
 # Template file for 'python3-sympy'
 pkgname=python3-sympy
-version=1.9
+version=1.10.1
 revision=1
 wrksrc="sympy-${version}"
 build_style=python3-module
@@ -12,7 +12,7 @@ maintainer="Alessio Sergi <al3hex@gmail.com>"
 license="BSD-3-Clause"
 homepage="https://sympy.org/"
 distfiles="${PYPI_SITE}/s/sympy/sympy-${version}.tar.gz"
-checksum=c7a880e229df96759f955d4f3970d4cabce79f60f5b18830c08b90ce77cd5fdc
+checksum=5939eeffdf9e152172601463626c022a2c27e75cf6278de8d401d50c9d58787b
 
 post_install() {
 	vman doc/man/isympy.1

From 890ec8a3f519c02b46be8e6384e7f0307e72106e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 30 Mar 2022 08:57:55 -0300
Subject: [PATCH 04/12] SuiteSparse: update to 5.11.0.

---
 srcpkgs/SuiteSparse/template | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SuiteSparse/template b/srcpkgs/SuiteSparse/template
index ab5c829e3ab7..fa2872aaf646 100644
--- a/srcpkgs/SuiteSparse/template
+++ b/srcpkgs/SuiteSparse/template
@@ -1,7 +1,7 @@
 # Template file for 'SuiteSparse'
 pkgname=SuiteSparse
-version=5.10.1
-revision=2
+version=5.11.0
+revision=1
 # XXX: re-enable TBB=-ltbb -DSPQR_CONFIG=-DHAVE_TBB when updating, if possible
 make_build_args="BLAS=-lblas LAPACK=-llapack"
 hostmakedepends="cmake chrpath"
@@ -10,8 +10,9 @@ short_desc="Suite of sparse matrix software"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="custom:multiple"
 homepage="https://people.engr.tamu.edu/davis/suitesparse.html"
+changelog="https://raw.githubusercontent.com/DrTimothyAldenDavis/SuiteSparse/master/ChangeLog"
 distfiles="https://github.com/DrTimothyAldenDavis/SuiteSparse/archive/refs/tags/v${version}.tar.gz"
-checksum=acb4d1045f48a237e70294b950153e48dce5b5f9ca8190e86c2b8c54ce00a7ee
+checksum=fdd957ed06019465f7de73ce931afaf5d40e96e14ae57d91f60868b8c123c4c8
 
 do_build() {
 	make config library $make_build_args JOBS=$XBPS_MAKEJOBS

From e6fb6dc379ca6a69b90694e191225a935da3f6b8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 30 Mar 2022 09:25:55 -0300
Subject: [PATCH 05/12] igraph: update to 0.9.7.

---
 srcpkgs/igraph/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/igraph/template b/srcpkgs/igraph/template
index f131886aae63..7cac9b5a47df 100644
--- a/srcpkgs/igraph/template
+++ b/srcpkgs/igraph/template
@@ -1,6 +1,6 @@
 # Template file for 'igraph'
 pkgname=igraph
-version=0.9.6
+version=0.9.7
 revision=1
 build_style=cmake
 configure_args="-DIGRAPH_ENABLE_TLS=on -DIGRAPH_ENABLE_LTO=on -DBUILD_SHARED_LIBS=ON"
@@ -12,7 +12,7 @@ license="GPL-2.0-or-later"
 homepage="https://igraph.org/c/"
 changelog="https://raw.githubusercontent.com/igraph/igraph/master/CHANGELOG.md"
 distfiles="https://github.com/igraph/igraph/releases/download/${version}/igraph-${version}.tar.gz"
-checksum=7c299ec54eecfe413758c332a42c4cb71d02d2951b2ac232584d317c5792f387
+checksum=b0a774eb5514acf93902a53d8f7dcdd553bf7130e5fd2e1b18a2927b842ed130
 
 igraph-devel_package() {
 	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"

From 43aa2410630bce4540136d10bc435fb8da410fa7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 22 Jan 2022 16:35:34 -0300
Subject: [PATCH 06/12] lcalc: ignore a version irrelevant for us

---
 srcpkgs/lcalc/update | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 srcpkgs/lcalc/update

diff --git a/srcpkgs/lcalc/update b/srcpkgs/lcalc/update
new file mode 100644
index 000000000000..4cfe261c03b8
--- /dev/null
+++ b/srcpkgs/lcalc/update
@@ -0,0 +1,2 @@
+# this version only adds a fix for cygwin
+ignore=2.0.5

From 5a038a1c31268060ddef6009b4aa3a6e1542082d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 22 Jan 2022 16:35:20 -0300
Subject: [PATCH 07/12] python3-gmpy2: ignore a version irrelevant for us

---
 srcpkgs/python3-gmpy2/update | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/python3-gmpy2/update b/srcpkgs/python3-gmpy2/update
index b5703618d280..0d9a7f7d2018 100644
--- a/srcpkgs/python3-gmpy2/update
+++ b/srcpkgs/python3-gmpy2/update
@@ -1 +1,3 @@
 ignore="*a[1-9] *b[1-9] *rc[1-9]"
+# this version only adds binary wheels for apple silicon
+ignore="$ignore 2.1.2"

From f89ad67fa795675e132b9e9c9939ebc43a025525 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 30 Mar 2022 09:39:35 -0300
Subject: [PATCH 08/12] planarity: update to 3.0.2.0.

---
 srcpkgs/planarity/template | 4 ++--
 srcpkgs/planarity/update   | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/planarity/template b/srcpkgs/planarity/template
index aab5ce4a08fc..fe5d9e08c9f9 100644
--- a/srcpkgs/planarity/template
+++ b/srcpkgs/planarity/template
@@ -1,6 +1,6 @@
 # Template file for 'planarity'
 pkgname=planarity
-version=3.0.1.1
+version=3.0.2.0
 revision=1
 build_style=gnu-configure
 short_desc="Graph algorithms for planar embedding and related algorithms"
@@ -8,7 +8,7 @@ maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="BSD-3-Clause"
 homepage="https://github.com/graph-algorithms/edge-addition-planarity-suite/"
 distfiles="https://github.com/graph-algorithms/edge-addition-planarity-suite/releases/download/Version_${version}/planarity-${version}.tar.gz"
-checksum=50b686fce6e67ba3a4d0634632c16566539a95d7e51afd066f6b1d5ae0eab284
+checksum=b4897df8f323e660197242e0aa273a542a59782cad783d7334111a9ad49b9e08
 
 post_install() {
 	vlicense LICENSE.TXT
diff --git a/srcpkgs/planarity/update b/srcpkgs/planarity/update
index 315139e84f6e..3dffcc02a424 100644
--- a/srcpkgs/planarity/update
+++ b/srcpkgs/planarity/update
@@ -1 +1,2 @@
 site=https://github.com/graph-algorithms/edge-addition-planarity-suite/releases
+ignore=*.WindowsExe

From 47f8816175fdcdaeec1d5dcd8c9a043b23725985 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 30 Mar 2022 09:41:28 -0300
Subject: [PATCH 09/12] gp2c: update to 0.0.12pl1.

---
 srcpkgs/gp2c/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gp2c/template b/srcpkgs/gp2c/template
index da996ed0972d..f82cf95c2d90 100644
--- a/srcpkgs/gp2c/template
+++ b/srcpkgs/gp2c/template
@@ -1,6 +1,6 @@
 # Template file for 'gp2c'
 pkgname=gp2c
-version=0.0.12
+version=0.0.12pl1
 revision=1
 build_style=gnu-configure
 hostmakedepends="perl"
@@ -10,5 +10,6 @@ short_desc="PARI/GP Computer Algebra System - gp2c compiler"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-or-later"
 homepage="http://pari.math.u-bordeaux.fr/"
+changelog="http://pari.math.u-bordeaux.fr/cgi-bin/gitweb.cgi?p=gp2c.git;a=blob_plain;f=ChangeLog;hb=HEAD"
 distfiles="${homepage}pub/pari/GP2C/${pkgname}-${version}.tar.gz"
-checksum=ee9ff63979670408d8c293902ce7ff6a825145f0e7e7c6323764733ef1b9310d
+checksum=79a8c46f7ad3331e4d8ae6af6b496c4742fd73a73b996b3ca7ead61452ca6e8d

From c09998e09159246dcaf66865af4af96152db41ab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 30 Mar 2022 09:41:43 -0300
Subject: [PATCH 10/12] python3-cvxopt: update to 1.3.0.

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

diff --git a/srcpkgs/python3-cvxopt/template b/srcpkgs/python3-cvxopt/template
index 0fb769b294e0..92908af178bd 100644
--- a/srcpkgs/python3-cvxopt/template
+++ b/srcpkgs/python3-cvxopt/template
@@ -1,6 +1,6 @@
 # Template file for 'python3-cvxopt'
 pkgname=python3-cvxopt
-version=1.2.7
+version=1.3.0
 revision=1
 wrksrc="cvxopt-${version}"
 build_style=python3-module
@@ -12,7 +12,7 @@ maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-3.0-or-later"
 homepage="http://cvxopt.org/"
 distfiles="${PYPI_SITE}/c/cvxopt/cvxopt-${version}.tar.gz"
-checksum=3f9db1f4d4e820aaea81d6fc21054c89dc6327c84f935dd5a1eda1af11e1d504
+checksum=00b1b232f9d1f902d578a9d75814b67fa020758d5ae422e28ca8cef6269fa5c6
 
 pre_build() {
 	export CVXOPT_BUILD_GSL=1

From eb0686067656127dff63695025764617b16aaf49 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 30 Mar 2022 09:41:50 -0300
Subject: [PATCH 11/12] giac: update to 1.7.0.53.

---
 srcpkgs/giac/patches/micropy.patch | 18 ++++++++++++++++++
 srcpkgs/giac/template              |  5 +++--
 2 files changed, 21 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/giac/patches/micropy.patch

diff --git a/srcpkgs/giac/patches/micropy.patch b/srcpkgs/giac/patches/micropy.patch
new file mode 100644
index 000000000000..0e417a5a8ecb
--- /dev/null
+++ b/srcpkgs/giac/patches/micropy.patch
@@ -0,0 +1,18 @@
+--- a/src/icas.cc	2021-03-02 04:52:40.000000000 -0300
++++ b/src/icas.cc	2022-03-30 10:00:39.154056068 -0300
+@@ -1810,6 +1810,7 @@
+     cerr << "// Setting tex log" << '\n';
+     show_tex=true;
+   }
++#ifdef HAVE_LIBMICROPYTHON
+   if (getenv("GIAC_MICROPY")){
+     cerr << "Micropython mode\n";
+     python_compat(4 | python_compat(contextptr),contextptr);
+@@ -1821,6 +1822,7 @@
+       return 0;
+     }
+   }
++#endif
+ #ifdef HAVE_LIBREADLINE
+   if (ARGC==1){
+     int taillemax=1000;
diff --git a/srcpkgs/giac/template b/srcpkgs/giac/template
index 2c192c2b858f..fbdadc31dde7 100644
--- a/srcpkgs/giac/template
+++ b/srcpkgs/giac/template
@@ -1,6 +1,6 @@
 # Template file for 'giac'
 pkgname=giac
-version=1.7.0.45
+version=1.7.0.53
 revision=1
 wrksrc="giac-${version%.*}"
 build_style=gnu-configure
@@ -12,8 +12,9 @@ short_desc="Free computer algebra system"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-3.0-or-later"
 homepage="https://www-fourier.ujf-grenoble.fr/~parisse/giac.html"
+changelog="https://www-fourier.ujf-grenoble.fr/~parisse/install_en#new"
 distfiles="https://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/giac_${version%.*}-${version##*.}.tar.gz"
-checksum=028b9e323d81a261a243c0768d5e12f3d76371eff05fd24cf2eb177b445f1da6
+checksum=74e5f98f63147c0197e4ce309601ae745312761be61c1a99c8a6bab4862e4a9f
 
 # need more than 4*65536 stack, see try_parse() in gen.cc line 11812
 LDFLAGS="-Wl,-z,stack-size=2097152"

From 3c08c4d9edb1b93ffd7e2c2ec91660765d4383c8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 28 Feb 2022 14:06:28 -0300
Subject: [PATCH 12/12] sagemath: rebuild for package updates

 - compatibility with lrcalc 2.1 (trac #31355)
 - fix doctests for ipython-8.1 (trac #33170)
 - fix doctests for scipy-1.8 (trac #33336)
 - fix doctests for sympy-1.10 (trac #33398)
 - fix doctests when sphinx is installed (trac #33585)
---
 .../trac-31355-upgrade_lrcalc_to_2.1.patch    | 670 ++++++++++++++++++
 .../trac-33170-fix_doctest_ipython_8.patch    |  40 ++
 .../trac-33170b-fix_doctest_ipython_8.1.patch |  13 +
 .../trac-33336-fix_doctest_scipy_1.8.patch    |  19 +
 ...d9deaeaa6380ab2f0d50276d911233c00a04.patch |  99 +++
 ...ff347454ac7f07e5918470b20e97b8f2357e.patch |  29 +
 ...0a0b14f67f4804e7113c3db41bbcf8a58296.patch |  26 +
 srcpkgs/sagemath/template                     |   6 +-
 8 files changed, 899 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/sagemath/patches/trac-31355-upgrade_lrcalc_to_2.1.patch
 create mode 100644 srcpkgs/sagemath/patches/trac-33170-fix_doctest_ipython_8.patch
 create mode 100644 srcpkgs/sagemath/patches/trac-33170b-fix_doctest_ipython_8.1.patch
 create mode 100644 srcpkgs/sagemath/patches/trac-33336-fix_doctest_scipy_1.8.patch
 create mode 100644 srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-609dd9deaeaa6380ab2f0d50276d911233c00a04.patch
 create mode 100644 srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-c49eff347454ac7f07e5918470b20e97b8f2357e.patch
 create mode 100644 srcpkgs/sagemath/patches/trac-33585-fix_doctest_sphinx_installed-a04a0a0b14f67f4804e7113c3db41bbcf8a58296.patch

diff --git a/srcpkgs/sagemath/patches/trac-31355-upgrade_lrcalc_to_2.1.patch b/srcpkgs/sagemath/patches/trac-31355-upgrade_lrcalc_to_2.1.patch
new file mode 100644
index 000000000000..4bd6f4f4e2dc
--- /dev/null
+++ b/srcpkgs/sagemath/patches/trac-31355-upgrade_lrcalc_to_2.1.patch
@@ -0,0 +1,670 @@
+As produced by `git diff 9.5 9.6.beta3 -- src/sage/libs/lrcalc`
+
+diff --git a/src/sage/libs/lrcalc/lrcalc.pxd b/src/sage/libs/lrcalc/lrcalc.pxd
+deleted file mode 100644
+index 10b88db93f2..00000000000
+--- a/src/sage/libs/lrcalc/lrcalc.pxd
++++ /dev/null
+@@ -1,77 +0,0 @@
+-# distutils: libraries = lrcalc
+-
+-cdef extern from "lrcalc/hashtab.h":
+-    ctypedef struct hashtab:
+-        pass
+-
+-    ctypedef struct hash_itr:
+-        pass
+-
+-    ctypedef unsigned long hashkey_t
+-    ctypedef int (*cmp_t) (void* a, void* b)
+-    ctypedef hashkey_t (*hash_t) (void* a)
+-
+-    hashtab* hash_new(cmp_t cm, hash_t hsh)
+-    void hash_free(hashtab *ht)
+-
+-    void* hash_lookup(hashtab *ht, void *key)
+-    void* hash_insert(hashtab *ht, void *key, void *value)
+-
+-    bint hash_good(hash_itr)
+-    void hash_first(hashtab* s, hash_itr itr)
+-    void hash_next(hash_itr itr)
+-    void* hash_key(hash_itr itr)
+-    void* hash_value(hash_itr itr)
+-    int hash_intvalue(hash_itr itr)
+-
+-cdef extern from "lrcalc/vector.h":
+-    ctypedef struct vector:
+-        size_t length
+-        int* array
+-
+-    vector* v_new(int length)
+-    void v_free(vector* v)
+-    void v_print(vector *v)
+-    int v_length(vector* v)
+-    int v_elem(vector* v, int i)
+-
+-    ctypedef struct vecpair:
+-        vector *first
+-        vector *second
+-
+-    vector* vp_first(vecpair* vp)
+-    vector* vp_second(vecpair* vp)
+-
+-cdef extern from "lrcalc/list.h":
+-    cdef struct _list:
+-        void **array
+-        size_t allocated
+-        size_t length
+-    void l_free(_list *lst)
+-
+-cdef extern from "lrcalc/symfcn.h":
+-    long long lrcoef_c "lrcoef"(vector* outer, vector* inner1, vector* inner2)
+-    hashtab* mult_c "mult"(vector *sh1, vector *sh2, int maxrows)
+-    hashtab* skew_c "skew"(vector *outer, vector *inner, int maxrows)
+-    hashtab* coprod_c "coprod"(vector *part, int all)
+-    void fusion_reduce_c "fusion_reduce"(hashtab* ht, int rows, int cols, int opt_zero)
+-    _list *quantum_reduce_c "quantum_reduce"(hashtab* ht, int rows, int col)
+-
+-    ctypedef struct skewtab:
+-        vector *outer
+-        vector *inner
+-        vector *conts
+-        int maxrows
+-        vector *conjugate
+-        int rows
+-        int cols
+-        int matrix[1]
+-
+-    skewtab *st_new(vector *outer, vector *inner, vector *conts, int maxrows)
+-    int st_next(skewtab *st)
+-    void st_print(skewtab *st)
+-    void st_free(skewtab *st)
+-
+-
+-cdef extern from "lrcalc/schublib.h":
+-    hashtab* mult_schubert_c "mult_schubert"(vector *sh1, vector *sh2, int rank)
+diff --git a/src/sage/libs/lrcalc/lrcalc.pyx b/src/sage/libs/lrcalc/lrcalc.py
+similarity index 60%
+rename from src/sage/libs/lrcalc/lrcalc.pyx
+rename to src/sage/libs/lrcalc/lrcalc.py
+index b591081ec4c..b541bfacd89 100644
+--- a/src/sage/libs/lrcalc/lrcalc.pyx
++++ b/src/sage/libs/lrcalc/lrcalc.py
+@@ -10,7 +10,8 @@ fusion products. All of the above are achieved by counting LR
+ appropriate shape and content by iterating through them.
+ Additionally, ``lrcalc`` handles products of Schubert polynomials.
+ 
+-The web page of ``lrcalc`` is `<http://sites.math.rutgers.edu/~asbuch/lrcalc/>`_.
++The web page of ``lrcalc`` is
++`<http://sites.math.rutgers.edu/~asbuch/lrcalc/>`_.
+ 
+ The following describes the Sage interface to this library.
+ 
+@@ -36,12 +37,13 @@ Schur expansion::
+      [4, 2]: 1}
+ 
+ Same product, but include only partitions with at most 3 rows.  This
+-corresponds to computing in the representation ring of gl(3)::
++corresponds to computing in the representation ring of `\mathfrak{gl}(3)`::
+ 
+     sage: lrcalc.mult([2,1], [2,1], 3)
+     {[2, 2, 2]: 1, [3, 2, 1]: 2, [3, 3]: 1, [4, 1, 1]: 1, [4, 2]: 1}
+ 
+-We can also compute the fusion product, here for sl(3) and level 2::
++We can also compute the fusion product, here for `\mathfrak{sl}(3)`
++and level 2::
+ 
+     sage: lrcalc.mult([3,2,1], [3,2,1], 3,2)
+     {[4, 4, 4]: 1, [5, 4, 3]: 1}
+@@ -77,42 +79,38 @@ Multiply two Schubert polynomials::
+      [6, 2, 1, 4, 3, 5]: 1}
+ 
+ Same product, but include only permutations of 5 elements in the result.
+-This corresponds to computing in the cohomology ring of Fl(5)::
++This corresponds to computing in the cohomology ring of `Fl(5)`::
+ 
+     sage: lrcalc.mult_schubert([4,2,1,3], [1,4,2,5,3], 5)
+     {[4, 5, 1, 3, 2]: 1, [5, 3, 1, 4, 2]: 1, [5, 4, 1, 2, 3]: 1}
+ 
+ List all Littlewood-Richardson tableaux of skew shape `\mu/\nu`; in
+ this example `\mu=[3,2,1]` and `\nu=[2,1]`. Specifying a third entry
+-`maxrows` restricts the alphabet to `\{1,2,\ldots,maxrows\}`::
++`M' = ``maxrows`` restricts the alphabet to `\{1,2,\ldots,M\}`::
+ 
+     sage: list(lrcalc.lrskew([3,2,1],[2,1]))
+     [[[None, None, 1], [None, 1], [1]], [[None, None, 1], [None, 1], [2]],
+     [[None, None, 1], [None, 2], [1]], [[None, None, 1], [None, 2], [3]]]
+ 
+     sage: list(lrcalc.lrskew([3,2,1],[2,1],maxrows=2))
+-    [[[None, None, 1], [None, 1], [1]], [[None, None, 1], [None, 1], [2]], [[None, None, 1], [None, 2], [1]]]
++    [[[None, None, 1], [None, 1], [1]], [[None, None, 1], [None, 1], [2]],
++     [[None, None, 1], [None, 2], [1]]]
+ 
+ .. TODO::
+ 
+-    use this library in the :class:`SymmetricFunctions` code, to
++    Use this library in the :class:`SymmetricFunctions` code, to
+     make it easy to apply it to linear combinations of Schur functions.
+ 
+ .. SEEALSO::
+ 
+     - :func:`lrcoef`
+-
+     - :func:`mult`
+-
+     - :func:`coprod`
+-
+     - :func:`skew`
+-
+     - :func:`lrskew`
+-
+     - :func:`mult_schubert`
+ 
+-.. rubric:: Underlying algorithmic in lrcalc
++.. RUBRIC:: Underlying algorithmic in lrcalc
+ 
+ Here is some additional information regarding the main low-level
+ C-functions in `lrcalc`. Given two partitions ``outer`` and ``inner``
+@@ -187,180 +185,24 @@ AUTHORS:
+ #                  https://www.gnu.org/licenses/
+ # ****************************************************************************
+ 
+-from sage.rings.integer cimport Integer
+-from sage.structure.parent cimport Parent
+ from sage.combinat.partition import _Partitions
+ from sage.combinat.permutation import Permutation
+-from sage.combinat.skew_tableau import SkewTableau
+-
+-
+-cdef vector* iterable_to_vector(it):
+-    """
+-    Return an lrcalc vector (which is a list of integers) from a Python iterable.
+-
+-    TESTS::
+-
+-        sage: from sage.libs.lrcalc.lrcalc import test_iterable_to_vector
+-        sage: x = test_iterable_to_vector(Partition([3,2,1])); x   #indirect doctest
+-        [3, 2, 1]
+-    """
+-    cdef vector* v
+-    cdef list itr = list(it)
+-    cdef int n = len(itr)
+-    cdef int i
+-    v = v_new(n)
+-    for i in range(n):
+-        v.array[i] = int(itr[i])
+-    return v
+-
+-
+-cdef list vector_to_list(vector *v):
+-    """
+-    Converts a lrcalc vector to Python list.
+-
+-    TESTS::
+-
+-        sage: from sage.libs.lrcalc.lrcalc import test_iterable_to_vector
+-        sage: x = test_iterable_to_vector([]); x         #indirect doctest
+-        []
+-    """
+-    cdef int i, n
+-    n = v_length(v)
+-    cdef list result = [None]*n
+-    for i in range(n):
+-        result[i] = Integer(v_elem(v, i))
+-    return result
+-
+-
+-def test_iterable_to_vector(it):
+-    """
+-    A wrapper function for the cdef function ``iterable_to_vector``
+-    and ``vector_to_list``, to test that they are working correctly.
++from sage.combinat.skew_tableau import SemistandardSkewTableaux
++from sage.combinat.skew_partition import SkewPartition
++from sage.rings.integer import Integer
++import lrcalc
+ 
+-    EXAMPLES::
+-
+-        sage: from sage.libs.lrcalc.lrcalc import test_iterable_to_vector
+-        sage: x = test_iterable_to_vector([3,2,1]); x
+-        [3, 2, 1]
+-    """
+-    cdef vector *v = iterable_to_vector(it)
+-    result = vector_to_list(v)
+-    v_free(v)
+-    return result
+-
+-
+-cdef skewtab_to_SkewTableau(skewtab *st):
+-    """
+-    A wrapper function which transforms the data set ``st`` used in
+-    ``lrcalc`` to a ``SkewTableau`` in Sage.
++def _lrcalc_dict_to_sage(result):
++    r"""
++    Translate from lrcalc output format to Sage expected format.
+ 
+     TESTS::
+ 
+-        sage: from sage.libs.lrcalc.lrcalc import test_skewtab_to_SkewTableau
+-        sage: test_skewtab_to_SkewTableau([],[])
+-        []
+-    """
+-    inner = vector_to_list(st.inner)
+-    outer = vector_to_list(st.outer)
+-    return SkewTableau(expr=[[inner[y] for y in range(len(outer))],
+-                             [[st.matrix[x + y * st.cols] + 1
+-                                for x in range(inner[y], outer[y])]
+-                              for y in range(len(outer) - 1, -1, -1)]])
+-
+-
+-def test_skewtab_to_SkewTableau(outer, inner):
+-    """
+-    A wrapper function for the cdef function ``skewtab_to_SkewTableau``
+-    for testing purposes.
+-
+-    It constructs the first LR skew tableau of shape ``outer/inner``
+-    as an ``lrcalc`` ``skewtab``, and converts it to a
+-    :class:`SkewTableau`.
+-
+-    EXAMPLES::
+-
+-        sage: from sage.libs.lrcalc.lrcalc import test_skewtab_to_SkewTableau
+-        sage: test_skewtab_to_SkewTableau([3,2,1],[])
+-        [[1, 1, 1], [2, 2], [3]]
+-        sage: test_skewtab_to_SkewTableau([4,3,2,1],[1,1]).pp()
+-        .  1  1  1
+-        .  2  2
+-        1  3
+-        2
+-    """
+-    cdef vector* o = iterable_to_vector(outer)
+-    cdef vector* i = iterable_to_vector(inner+[0]*(len(outer)-len(inner)))
+-    cdef skewtab* st = st_new(o, i, NULL, 0)
+-    return skewtab_to_SkewTableau(st)
+-
+-
+-cdef dict sf_hashtab_to_dict(hashtab *ht):
+-    """
+-    Return a dictionary representing a Schur function. The keys are
+-    partitions and the values are integers <class 'sage.rings.integer.Integer'>.
+-
+-    EXAMPLES::
+-
+         sage: from sage.libs.lrcalc.lrcalc import mult
+-        sage: sorted(mult([1],[1]).items())        #indirect doctest
+-        [([1, 1], 1), ([2], 1)]
+-        sage: assert isinstance(mult([1],[1]),dict)#indirect doctest
+-    """
+-    cdef hash_itr itr
+-    cdef dict result = {}
+-    cdef list p
+-    hash_first(ht, itr)
+-    while hash_good(itr):
+-        p = vector_to_list(<vector*> hash_key(itr))
+-        result[_Partitions(p)] = Integer(hash_intvalue(itr))
+-        hash_next(itr)
+-    return result
+-
+-
+-cdef dict schubert_hashtab_to_dict(hashtab *ht):
+-    """
+-    Return a dictionary corresponding to a Schubert polynomial whose keys
+-    are permutations and whose values are integers <class 'sage.rings.integer.Integer'>.
+-
+-    EXAMPLES::
+-
+-        sage: from sage.libs.lrcalc.lrcalc import mult_schubert
+-        sage: mult_schubert([3,2,1], [1,2,3])      #indirect doctest
+-        {[3, 2, 1]: 1}
+-    """
+-    cdef hash_itr itr
+-    cdef dict result = {}
+-    hash_first(ht, itr)
+-    while hash_good(itr):
+-        p = vector_to_list(<vector*> hash_key(itr))
+-        result[Permutation(p)] = Integer(hash_intvalue(itr))
+-        hash_next(itr)
+-    return result
+-
+-
+-cdef dict vp_hashtab_to_dict(hashtab *ht):
+-    """
+-    Return a dictionary corresponding to the coproduct of a Schur function whose keys are
+-    pairs of partitions and whose values are integers <class 'sage.rings.integer.Integer'>.
+-
+-    EXAMPLES::
+-
+-        sage: from sage.libs.lrcalc.lrcalc import coprod
+-        sage: coprod([1])      #indirect doctest
+-        {([1], []): 1}
++        sage: mult([2,1],[3,2,1],3) # indirect doctest
++        {[3, 3, 3]: 1, [4, 3, 2]: 2, [4, 4, 1]: 1, [5, 2, 2]: 1, [5, 3, 1]: 1}
+     """
+-    cdef hash_itr itr
+-    cdef vecpair* vp
+-    cdef dict result = {}
+-    hash_first(ht, itr)
+-    while hash_good(itr):
+-        vp = <vecpair*> hash_key(itr)
+-        p1 = _Partitions(vector_to_list(vp_first(vp)))
+-        p2 = _Partitions(vector_to_list(vp_second(vp)))
+-        result[(p1, p2)] = Integer(hash_intvalue(itr))
+-        hash_next(itr)
+-    return result
+-
++    return {_Partitions(la): Integer(k) for la, k in result.items()}
+ 
+ def lrcoef_unsafe(outer, inner1, inner2):
+     r"""
+@@ -371,13 +213,11 @@ def lrcoef_unsafe(outer, inner1, inner2):
+ 
+     INPUT:
+ 
+-    - ``outer`` -- a partition (weakly decreasing list of non-negative integers).
+-
+-    - ``inner1`` -- a partition.
++    - ``outer`` -- a partition (weakly decreasing list of non-negative integers)
++    - ``inner1`` -- a partition
++    - ``inner2`` -- a partition
+ 
+-    - ``inner2`` -- a partition.
+-
+-    .. warning::
++    .. WARNING::
+ 
+        This function does not do any check on its input.  If you want
+        to use a safer version, use :func:`lrcoef`.
+@@ -392,18 +232,7 @@ def lrcoef_unsafe(outer, inner1, inner2):
+         sage: lrcoef_unsafe([2,1,1,1,1], [2,1], [2,1])
+         0
+     """
+-    cdef long long result
+-    cdef vector *o
+-    cdef vector *i1
+-    cdef vector *i2
+-    o = iterable_to_vector(outer)
+-    i1 = iterable_to_vector(inner1)
+-    i2 = iterable_to_vector(inner2)
+-    result = lrcoef_c(o, i1, i2)
+-    v_free(o)
+-    v_free(i1)
+-    v_free(i2)
+-    return Integer(result)
++    return Integer(lrcalc.lrcoef(outer, inner1, inner2))
+ 
+ 
+ def lrcoef(outer, inner1, inner2):
+@@ -415,11 +244,9 @@ def lrcoef(outer, inner1, inner2):
+ 
+     INPUT:
+ 
+-    - ``outer`` -- a partition (weakly decreasing list of non-negative integers).
+-
+-    - ``inner1`` -- a partition.
+-
+-    - ``inner2`` -- a partition.
++    - ``outer`` -- a partition (weakly decreasing list of non-negative integers)
++    - ``inner1`` -- a partition
++    - ``inner2`` -- a partition
+ 
+     .. NOTE::
+ 
+@@ -436,7 +263,6 @@ def lrcoef(outer, inner1, inner2):
+         1
+         sage: lrcoef([2,1,1,1,1], [2,1], [2,1])
+         0
+-
+     """
+     return lrcoef_unsafe(_Partitions(outer), _Partitions(inner1), _Partitions(inner2))
+ 
+@@ -451,13 +277,9 @@ def mult(part1, part2, maxrows=None, level=None, quantum=None):
+     INPUT:
+ 
+     - ``part1`` -- a partition
+-
+     - ``part2`` -- a partition
+-
+     - ``maxrows`` -- (optional) an integer
+-
+     - ``level`` -- (optional) an integer
+-
+     - ``quantum`` -- (optional) an element of a ring
+ 
+     If ``maxrows`` is specified, then only partitions with at most
+@@ -479,7 +301,8 @@ def mult(part1, part2, maxrows=None, level=None, quantum=None):
+         sage: sorted(mult([2],[2]).items())
+         [([2, 2], 1), ([3, 1], 1), ([4], 1)]
+         sage: sorted(mult([2,1],[2,1]).items())
+-        [([2, 2, 1, 1], 1), ([2, 2, 2], 1), ([3, 1, 1, 1], 1), ([3, 2, 1], 2), ([3, 3], 1), ([4, 1, 1], 1), ([4, 2], 1)]
++        [([2, 2, 1, 1], 1), ([2, 2, 2], 1), ([3, 1, 1, 1], 1),
++         ([3, 2, 1], 2), ([3, 3], 1), ([4, 1, 1], 1), ([4, 2], 1)]
+         sage: sorted(mult([2,1],[2,1],maxrows=2).items())
+         [([3, 3], 1), ([4, 2], 1)]
+         sage: mult([2,1],[3,2,1],3)
+@@ -510,44 +333,24 @@ def mult(part1, part2, maxrows=None, level=None, quantum=None):
+     if quantum is not None and (level is None or maxrows is None):
+         raise ValueError('missing parameters maxrows or level')
+ 
+-    cdef vector* v1 = iterable_to_vector(part1)
+-    cdef vector* v2 = iterable_to_vector(part2)
+-    if maxrows is None:
+-        maxrows = 0
+-    cdef hashtab* ht = mult_c(v1, v2, int(maxrows))
+-    cdef hashtab* tab
+-    cdef dict result
+-
+     if quantum is None:
+         if level is not None:
+-            fusion_reduce_c(ht, int(maxrows), int(level), int(0))
+-        result = sf_hashtab_to_dict(ht)
+-        v_free(v1)
+-        v_free(v2)
+-        hash_free(ht)
+-        return result
++            return _lrcalc_dict_to_sage(lrcalc.mult_fusion(part1, part2, maxrows, level))
++        if maxrows is None:
++            maxrows = -1
++        return _lrcalc_dict_to_sage(lrcalc.mult(part1, part2, maxrows))
+ 
+     # Otherwise do quantum multiplication
+-    cdef _list *qlist
+-    cdef dict temp
+-    qlist = quantum_reduce_c(ht, int(maxrows), int(level))
+-    # The above call frees the memory associated with ht
+-    v_free(v1)
+-    v_free(v2)
+-
+-    cdef Parent P = quantum.parent()
+-    result = {}
+-    for i in range(qlist.length):
+-        tab = <hashtab*>(qlist.array[i])
+-        temp = sf_hashtab_to_dict(tab)
+-        for k in temp:
+-            result[k] = result.get(k, P.zero()) + quantum**i * temp[k]
+-        hash_free(tab)
+-    l_free(qlist)
+-    return result
+-
+-
+-def skew(outer, inner, maxrows=0):
++    result = lrcalc.mult_quantum(part1, part2, maxrows, level, degrees=True)
++    P = quantum.parent()
++    output = {}
++    for i,k in result.items():
++        la = _Partitions(i[0])
++        output[la] = output.get(la, P.zero()) + k * quantum**(i[1])
++    return output
++
++
++def skew(outer, inner, maxrows=-1):
+     """
+     Compute the Schur expansion of a skew Schur function.
+ 
+@@ -557,11 +360,9 @@ def skew(outer, inner, maxrows=0):
+ 
+     INPUT:
+ 
+-    - ``outer`` -- a partition.
+-
+-    - ``inner`` -- a partition.
+-
+-    - ``maxrows`` -- an integer or ``None``.
++    - ``outer`` -- a partition
++    - ``inner`` -- a partition
++    - ``maxrows`` -- an integer or ``None``
+ 
+     If ``maxrows`` is specified, then only partitions with at most
+     this number of rows are included in the result.
+@@ -572,14 +373,7 @@ def skew(outer, inner, maxrows=0):
+         sage: sorted(skew([2,1],[1]).items())
+         [([1, 1], 1), ([2], 1)]
+     """
+-    cdef vector* v1 = iterable_to_vector(outer)
+-    cdef vector* v2 = iterable_to_vector(inner)
+-    cdef hashtab* ht = skew_c(v1, v2, int(maxrows))
+-    result = sf_hashtab_to_dict(ht)
+-    v_free(v1)
+-    v_free(v2)
+-    hash_free(ht)
+-    return result
++    return _lrcalc_dict_to_sage(lrcalc.skew(outer, inner, maxrows))
+ 
+ 
+ def coprod(part, all=0):
+@@ -592,9 +386,8 @@ def coprod(part, all=0):
+ 
+     INPUT:
+ 
+-    - ``part`` -- a partition.
+-
+-    - ``all`` -- an integer.
++    - ``part`` -- a partition
++    - ``all`` -- an integer
+ 
+     If ``all`` is non-zero then all terms are included in the result.
+     If ``all`` is zero, then only pairs of partitions ``(part1,
+@@ -609,12 +402,9 @@ def coprod(part, all=0):
+         sage: sorted(coprod([2,1]).items())
+         [(([1, 1], [1]), 1), (([2], [1]), 1), (([2, 1], []), 1)]
+     """
+-    cdef vector* v1 = iterable_to_vector(part)
+-    cdef hashtab* ht = coprod_c(v1, int(all))
+-    result = vp_hashtab_to_dict(ht)
+-    v_free(v1)
+-    hash_free(ht)
+-    return result
++    result = lrcalc.coprod(part, all)
++    return {tuple([_Partitions(mu) for mu in la]): Integer(k)
++            for la, k in result.items()}
+ 
+ 
+ def mult_schubert(w1, w2, rank=0):
+@@ -627,11 +417,9 @@ def mult_schubert(w1, w2, rank=0):
+ 
+     INPUT:
+ 
+-    - ``w1`` -- a permutation.
+-
+-    - ``w2`` -- a permutation.
+-
+-    - ``rank`` -- an integer.
++    - ``w1`` -- a permutation
++    - ``w2`` -- a permutation
++    - ``rank`` -- an integer
+ 
+     If ``rank`` is non-zero, then only permutations from the symmetric
+     group `S(\mathrm{rank})` are included in the result.
+@@ -646,33 +434,24 @@ def mult_schubert(w1, w2, rank=0):
+          ([6, 4, 3, 1, 2, 5], 1), ([6, 5, 2, 1, 3, 4], 1),
+          ([7, 3, 4, 1, 2, 5, 6], 1), ([7, 4, 2, 1, 3, 5, 6], 1)]
+     """
+-    cdef vector* v1 = iterable_to_vector(w1)
+-    cdef vector* v2 = iterable_to_vector(w2)
+-    cdef hashtab* ht = mult_schubert_c(v1, v2, int(rank))
+-    result = schubert_hashtab_to_dict(ht)
+-    v_free(v1)
+-    v_free(v2)
+-    hash_free(ht)
+-    return result
++    result = lrcalc.schubmult(w1, w2, rank)
++    return {Permutation(list(la)):Integer(k) for la,k in result.items()}
+ 
+ 
+-def lrskew(outer, inner, weight=None, maxrows=0):
++def lrskew(outer, inner, weight=None, maxrows=-1):
+     r"""
+     Iterate over the skew LR tableaux of shape ``outer / inner``.
+ 
+     INPUT:
+ 
+     - ``outer`` -- a partition
+-
+     - ``inner`` -- a partition
+-
+     - ``weight`` -- a partition (optional)
+-
+-    - ``maxrows`` -- an integer (optional)
++    - ``maxrows`` -- a positive integer (optional)
+ 
+     OUTPUT: an iterator of :class:`SkewTableau`
+ 
+-    Specifying ``maxrows`` restricts the alphabet to `\{1,2,\ldots,maxrows\}`.
++    Specifying ``maxrows`` = `M` restricts the alphabet to `\{1,2,\ldots,M\}`.
+ 
+     Specifying ``weight`` returns only those tableaux of given content/weight.
+ 
+@@ -702,22 +481,40 @@ def lrskew(outer, inner, weight=None, maxrows=0):
+ 
+         sage: list(lrskew([3,2,1],[2], weight=[3,1]))
+         [[[None, None, 1], [1, 1], [2]]]
++
++    TESTS::
++
++        sage: from sage.libs.lrcalc.lrcalc import lrskew
++        sage: list(lrskew([3,2,1],[2], weight=[]))
++        []
++        sage: list(lrskew([3,2,1],[2], weight=[0]))
++        []
++        sage: list(lrskew([3,2,1],[3,2,1], weight=[]))
++        [[[None, None, None], [None, None], [None]]]
++        sage: list(lrskew([3,2,1],[3,2,1], weight=[0]))
++        [[[None, None, None], [None, None], [None]]]
++        sage: list(lrskew([3,2,1],[3,2,1], weight=[1]))
++        []
+     """
+-    cdef vector* o = iterable_to_vector(outer)
+-    cdef vector* i = iterable_to_vector(inner + [0]*(len(outer) - len(inner)))
+-    cdef skewtab* st = st_new(o, i, NULL, int(maxrows))
++    iterator = lrcalc.lr_iterator(outer, inner, maxrows)
++    shape = SkewPartition([outer, inner])
+ 
+     if weight is None:
+-        yield skewtab_to_SkewTableau(st)
+-        while st_next(st):
+-            yield skewtab_to_SkewTableau(st)
++        ST = SemistandardSkewTableaux(shape)
++        for data in iterator:
++            yield ST.from_shape_and_word(shape, [i+1 for i in data])
+     else:
+         wt = _Partitions(weight)
+-        r = skewtab_to_SkewTableau(st)
+-        if r.weight() == wt:
+-            yield r
+-        while st_next(st):
+-            r = skewtab_to_SkewTableau(st)
+-            if r.weight() == wt:
+-                yield r
+-    st_free(st)
++        ST = SemistandardSkewTableaux(shape, wt)
++        m = len(wt)
++        for data in iterator:
++            w = [0] * m
++            for j in data:
++                if j >= m:
++                    # We know they are not equal, so make the check below quick
++                    w = None
++                    break
++                w[j] += 1
++            if w == wt:
++                yield ST.from_shape_and_word(shape, [i+1 for i in data])
++
diff --git a/srcpkgs/sagemath/patches/trac-33170-fix_doctest_ipython_8.patch b/srcpkgs/sagemath/patches/trac-33170-fix_doctest_ipython_8.patch
new file mode 100644
index 000000000000..1e2e0ba90742
--- /dev/null
+++ b/srcpkgs/sagemath/patches/trac-33170-fix_doctest_ipython_8.patch
@@ -0,0 +1,40 @@
+As produced by `git diff a90a3146{^^,}`
+
+diff --git a/src/sage/repl/interface_magic.py b/src/sage/repl/interface_magic.py
+index 8a455b69b0e..a93e1c9e04c 100644
+--- a/src/sage/repl/interface_magic.py
++++ b/src/sage/repl/interface_magic.py
+@@ -260,7 +260,7 @@ class InterfaceMagic(object):
+             2
+             120
+             sage: shell.run_cell('%%gap foo\n1+1;\n')
+-            ...File "<string>", line unknown
++            ...File...<string>...
+             SyntaxError: Interface magics have no options, got "foo"
+             <BLANKLINE>
+             sage: shell.run_cell('%%gap?')
+diff --git a/src/sage/repl/interpreter.py b/src/sage/repl/interpreter.py
+index 7468afe52d7..06c47b7374a 100644
+--- a/src/sage/repl/interpreter.py
++++ b/src/sage/repl/interpreter.py
+@@ -78,9 +78,9 @@ Check that Cython source code appears in tracebacks::
+     dummy line
+     ...
+     ZeroDivisionError...Traceback (most recent call last)
+-    <ipython-input-...> in <module>...
++    ...in <module>...
+     ----> 1 Integer(1)/Integer(0)
+-    .../sage/rings/integer.pyx in sage.rings.integer.Integer...div...
++    .../sage/rings/integer.pyx... in sage.rings.integer.Integer...div...
+     ...
+     -> ...                  raise ZeroDivisionError("rational division by zero")
+        ....:            x = <Rational> Rational.__new__(Rational)
+@@ -423,7 +423,7 @@ def SagePreparseTransformer(lines):
+         sage: from sage.repl.interpreter import get_test_shell
+         sage: shell = get_test_shell()
+         sage: shell.run_cell(bad_syntax)
+-          File "<string>", line unknown
++          File...<string>...
+         SyntaxError: Mismatched ']'
+         <BLANKLINE>
+         sage: shell.quit()
diff --git a/srcpkgs/sagemath/patches/trac-33170b-fix_doctest_ipython_8.1.patch b/srcpkgs/sagemath/patches/trac-33170b-fix_doctest_ipython_8.1.patch
new file mode 100644
index 000000000000..853813b0f5bd
--- /dev/null
+++ b/srcpkgs/sagemath/patches/trac-33170b-fix_doctest_ipython_8.1.patch
@@ -0,0 +1,13 @@
+Fix for ipython 8.1
+
+--- a/src/sage/repl/interpreter.py
++++ b/src/sage/repl/interpreter.py
+@@ -78,7 +78,7 @@ Check that Cython source code appears in tracebacks::
+     dummy line
+     ...
+     ZeroDivisionError...Traceback (most recent call last)
+-    ...in <module>...
++    ...
+     ----> 1 Integer(1)/Integer(0)
+     .../sage/rings/integer.pyx... in sage.rings.integer.Integer...div...
+     ...
diff --git a/srcpkgs/sagemath/patches/trac-33336-fix_doctest_scipy_1.8.patch b/srcpkgs/sagemath/patches/trac-33336-fix_doctest_scipy_1.8.patch
new file mode 100644
index 000000000000..19b69700a4f6
--- /dev/null
+++ b/srcpkgs/sagemath/patches/trac-33336-fix_doctest_scipy_1.8.patch
@@ -0,0 +1,19 @@
+commit 9c8235e44ffb509efa8a3ca6cdb55154e2b5066d
+Author: Antonio Rojas <arojas@archlinux.org>
+Date:   Sun Feb 13 19:53:14 2022 +0100
+
+    Fix deprecation warning with scipy 1.8
+
+diff --git a/src/sage/tests/books/computational-mathematics-with-sagemath/linsolve_doctest.py b/src/sage/tests/books/computational-mathematics-with-sagemath/linsolve_doctest.py
+index e9b60dae5ec..7932167b41d 100644
+--- a/src/sage/tests/books/computational-mathematics-with-sagemath/linsolve_doctest.py
++++ b/src/sage/tests/books/computational-mathematics-with-sagemath/linsolve_doctest.py
+@@ -356,7 +356,7 @@ Sage example in ./linsolve.tex, line 2230::
+ 
+ Sage example in ./linsolve.tex, line 2609::
+ 
+-  sage: from scipy.sparse.linalg.dsolve import *
++  sage: from scipy.sparse.linalg import factorized
+   sage: from scipy.sparse import lil_matrix
+   sage: from numpy import array
+   sage: n = 200
diff --git a/srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-609dd9deaeaa6380ab2f0d50276d911233c00a04.patch b/srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-609dd9deaeaa6380ab2f0d50276d911233c00a04.patch
new file mode 100644
index 000000000000..9ba7ca5a6b7d
--- /dev/null
+++ b/srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-609dd9deaeaa6380ab2f0d50276d911233c00a04.patch
@@ -0,0 +1,99 @@
+From 609dd9deaeaa6380ab2f0d50276d911233c00a04 Mon Sep 17 00:00:00 2001
+From: Matthias Koeppe <mkoeppe@math.ucdavis.edu>
+Date: Fri, 4 Mar 2022 16:07:09 -0800
+Subject: sage.manifolds: Update doctests for SymPy 1.10
+
+---
+ src/sage/manifolds/continuous_map.py              | 3 +--
+ src/sage/manifolds/differentiable/diff_form.py    | 4 ++--
+ src/sage/manifolds/differentiable/tensorfield.py  | 8 ++++----
+ src/sage/manifolds/vector_bundle_fiber_element.py | 2 +-
+ 4 files changed, 8 insertions(+), 9 deletions(-)
+
+diff --git a/src/sage/manifolds/continuous_map.py b/src/sage/manifolds/continuous_map.py
+index a6356e7..f6f9b6d 100644
+--- a/src/sage/manifolds/continuous_map.py
++++ b/src/sage/manifolds/continuous_map.py
+@@ -1357,8 +1357,7 @@ class ContinuousMap(Morphism):
+             sage: Phi.coord_functions(c_uv, c_xyz)
+             Coordinate functions (u*v, u/v, u + v) on the Chart (M, (u, v))
+             sage: Phi.coord_functions(c_UV, c_xyz)
+-            Coordinate functions (-U**2/4 + V**2/4, -(U + V)/(U - V), V)
+-             on the Chart (M, (U, V))
++            Coordinate functions (-U**2/4 + V**2/4, (-U - V)/(U - V), V) on the Chart (M, (U, V))
+             sage: Phi.coord_functions(c_UV, c_XYZ)
+             Coordinate functions ((-U**3 + U**2*V + U*V**2 + 2*U*V + 6*U - V**3
+              - 2*V**2 + 6*V)/(2*(U - V)), (U**3/4 - U**2*V/4 - U*V**2/4 + U*V
+diff --git a/src/sage/manifolds/differentiable/diff_form.py b/src/sage/manifolds/differentiable/diff_form.py
+index 70dd8fb..0aa3469 100644
+--- a/src/sage/manifolds/differentiable/diff_form.py
++++ b/src/sage/manifolds/differentiable/diff_form.py
+@@ -266,7 +266,7 @@ class DiffForm(TensorField):
+ 
+         sage: s = a.wedge(b)
+         sage: s.display(eU)
+-        a∧b = -x*(2*x*y + 1) dx∧dy
++        a∧b = x*(-2*x*y - 1) dx∧dy
+         sage: s.display(eV)
+         a∧b = (u**3/8 + u**2*v/8 - u*v**2/8 + u/4 - v**3/8 + v/4) du∧dv
+ 
+@@ -275,7 +275,7 @@ class DiffForm(TensorField):
+         sage: f = M.scalar_field({c_xy: (x+y)^2, c_uv: u^2}, name='f')
+         sage: s = f*a
+         sage: s.display(eU)
+-        f*a = -y*(x**2 + 2*x*y + y**2) dx + x*(x**2 + 2*x*y + y**2) dy
++        f*a = y*(-x**2 - 2*x*y - y**2) dx + x*(x**2 + 2*x*y + y**2) dy
+         sage: s.display(eV)
+         f*a = u**2*v/2 du - u**3/2 dv
+ 
+diff --git a/src/sage/manifolds/differentiable/tensorfield.py b/src/sage/manifolds/differentiable/tensorfield.py
+index 2775be9..6bc5c50 100644
+--- a/src/sage/manifolds/differentiable/tensorfield.py
++++ b/src/sage/manifolds/differentiable/tensorfield.py
+@@ -334,7 +334,7 @@ class TensorField(ModuleElementWithMutability):
+         sage: f.display()  # long time
+         t(a,b): S^2 → ℝ
+         on U: (x, y) ↦ -2*x*y - 3*x - y**2
+-        on V: (u, v) ↦ -(3*u**3 + 3*u*v**2 + 2*u*v + v**2)/(u**4 + 2*u**2*v**2 + v**4)
++        on V: (u, v) ↦ (-3*u**3 - 3*u*v**2 - 2*u*v - v**2)/(u**4 + 2*u**2*v**2 + v**4)
+ 
+     The vectors can be defined only on subsets of `S^2`, the domain of the
+     result is then the common subset::
+@@ -343,12 +343,12 @@ class TensorField(ModuleElementWithMutability):
+         sage: s.display()  # long time
+         t(a,b): U → ℝ
+            (x, y) ↦ -2*x*y - 3*x - y**2
+-        on W: (u, v) ↦ -(3*u**3 + 3*u*v**2 + 2*u*v + v**2)/(u**4 + 2*u**2*v**2 + v**4)
++        on W: (u, v) ↦ (-3*u**3 - 3*u*v**2 - 2*u*v - v**2)/(u**4 + 2*u**2*v**2 + v**4)
+         sage: s = t(a.restrict(U), b.restrict(W))  # long time
+         sage: s.display()  # long time
+         t(a,b): W → ℝ
+            (x, y) ↦ -2*x*y - 3*x - y**2
+-           (u, v) ↦ -(3*u**3 + 3*u*v**2 + 2*u*v + v**2)/(u**4 + 2*u**2*v**2 + v**4)
++           (u, v) ↦ (-3*u**3 - 3*u*v**2 - 2*u*v - v**2)/(u**4 + 2*u**2*v**2 + v**4)
+ 
+     The tensor itself can be defined only on some open subset of `S^2`,
+     yielding a result whose domain is this subset::
+@@ -356,7 +356,7 @@ class TensorField(ModuleElementWithMutability):
+         sage: s = t.restrict(V)(a,b)  # long time
+         sage: s.display()  # long time
+         t(a,b): V → ℝ
+-           (u, v) ↦ -(3*u**3 + 3*u*v**2 + 2*u*v + v**2)/(u**4 + 2*u**2*v**2 + v**4)
++           (u, v) ↦ (-3*u**3 - 3*u*v**2 - 2*u*v - v**2)/(u**4 + 2*u**2*v**2 + v**4)
+         on W: (x, y) ↦ -2*x*y - 3*x - y**2
+ 
+     Tests regarding the multiplication by a scalar field::
+diff --git a/src/sage/manifolds/vector_bundle_fiber_element.py b/src/sage/manifolds/vector_bundle_fiber_element.py
+index 29ee81d..048275a 100644
+--- a/src/sage/manifolds/vector_bundle_fiber_element.py
++++ b/src/sage/manifolds/vector_bundle_fiber_element.py
+@@ -110,4 +110,4 @@ class VectorBundleFiberElement(FiniteRankFreeModuleElement):
+             desc += str(self._name) + " "
+         desc += "in the fiber of {} at {}".format(self._vbundle._name,
+                                                   self._point)
+-        return desc
+\ No newline at end of file
++        return desc
+-- 
+cgit v1.0-1-gd88e
+
diff --git a/srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-c49eff347454ac7f07e5918470b20e97b8f2357e.patch b/srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-c49eff347454ac7f07e5918470b20e97b8f2357e.patch
new file mode 100644
index 000000000000..f5ac180baa90
--- /dev/null
+++ b/srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-c49eff347454ac7f07e5918470b20e97b8f2357e.patch
@@ -0,0 +1,29 @@
+From c49eff347454ac7f07e5918470b20e97b8f2357e Mon Sep 17 00:00:00 2001
+From: Matthias Koeppe <mkoeppe@math.ucdavis.edu>
+Date: Fri, 4 Mar 2022 15:14:43 -0800
+Subject: src/sage/calculus/calculus.py: Update laplace doctest for sympy 1.10
+
+---
+ src/sage/calculus/calculus.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/sage/calculus/calculus.py b/src/sage/calculus/calculus.py
+index 9c2f226..b335093 100644
+--- a/src/sage/calculus/calculus.py
++++ b/src/sage/calculus/calculus.py
+@@ -1639,9 +1639,9 @@ def laplace(ex, t, s, algorithm='maxima'):
+         sage: laplace(dirac_delta(t), t, s)
+         1
+         sage: F, a, cond = laplace(dirac_delta(t), t, s, algorithm='sympy')
+-        sage: a, cond
+-        (-oo, True)
+-        sage: F       # random - sympy <1.9 includes undefined heaviside(0) in answer
++        sage: a, cond  # random - sympy <1.10 gives (-oo, True)
++        (0, True)
++        sage: F        # random - sympy <1.9 includes undefined heaviside(0) in answer
+         1
+         sage: laplace(dirac_delta(t), t, s, algorithm='giac')
+         1
+-- 
+cgit v1.0-1-gd88e
+
diff --git a/srcpkgs/sagemath/patches/trac-33585-fix_doctest_sphinx_installed-a04a0a0b14f67f4804e7113c3db41bbcf8a58296.patch b/srcpkgs/sagemath/patches/trac-33585-fix_doctest_sphinx_installed-a04a0a0b14f67f4804e7113c3db41bbcf8a58296.patch
new file mode 100644
index 000000000000..8e7bb64f5b01
--- /dev/null
+++ b/srcpkgs/sagemath/patches/trac-33585-fix_doctest_sphinx_installed-a04a0a0b14f67f4804e7113c3db41bbcf8a58296.patch
@@ -0,0 +1,26 @@
+From a04a0a0b14f67f4804e7113c3db41bbcf8a58296 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
+Date: Mon, 28 Mar 2022 20:39:59 -0300
+Subject: Trac #33585: fix doctest when dochtml is missing...
+
+...but sphinx is available in PYTHONPATH.
+---
+ src/sage/misc/sagedoc.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/sage/misc/sagedoc.py b/src/sage/misc/sagedoc.py
+index 4b3853f..08c4225 100644
+--- a/src/sage/misc/sagedoc.py
++++ b/src/sage/misc/sagedoc.py
+@@ -1401,7 +1401,7 @@ class _sage_doc:
+             "...**File:**...**Type:**...**Definition:** identity_matrix..."
+             sage: identity_matrix.__doc__ in browse_sage_doc(identity_matrix, 'rst')
+             True
+-            sage: browse_sage_doc(identity_matrix, 'html', False)             # optional - sphinx
++            sage: browse_sage_doc(identity_matrix, 'html', False)             # optional - sphinx sagemath_doc_html
+             '...div...File:...Type:...Definition:...identity_matrix...'
+ 
+         In the 'text' version, double colons have been replaced with
+-- 
+cgit v1.0-1-gd88e
+
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 710a9e80c052..02d4333fa545 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
 version=9.5
-revision=1
+revision=2
 wrksrc=sage-$version
 build_wrksrc=pkgs/sagemath-standard
 build_style=python3-module
@@ -12,7 +12,7 @@ hostmakedepends="m4 pkg-config python3-Cython python3-Jinja2 python3-pkgconfig
 makedepends="arb-devel boost-devel brial-devel cliquer-devel ecl eclib-devel
  ecm-devel fflas-ffpack flintlib-devel gap-devel gd-devel giac-devel glpk-devel
  gsl-devel iml-devel lcalc-devel libbraiding-devel libhomfly-devel libmpc-devel
- libpng-devel linbox-devel lrcalc-devel m4ri-devel m4rie-devel mpfi-devel
+ libpng-devel linbox-devel m4ri-devel m4rie-devel mpfi-devel
  mpfr-devel ntl-devel openblas-devel pari-devel planarity-devel python3-cypari2
  python3-cysignals python3-devel python3-gmpy2 python3-memory_allocator
  python3-numpy rankwidth-devel singular symmetrica-devel zn_poly"
@@ -20,7 +20,7 @@ depends="FlintQS eclib-devel fflas-ffpack flintlib-devel gcc-fortran gd-devel
  gfan giac gsl-devel gzip libpng-devel linbox-devel m4ri-devel maxima-ecl
  mpfr-devel nauty ntl-devel palp pari-devel pari-elldata-small pari-galdata
  pari-galpol-small pari-seadata-small pkg-config python3-Cython python3-cypari2
- python3-cysignals python3-devel python3-fpylll python3-ipython
+ python3-cysignals python3-devel python3-fpylll python3-ipython python3-lrcalc
  python3-ipython_ipykernel python3-jupyter_ipywidgets python3-matplotlib
  python3-memory_allocator python3-networkx python3-pip python3-pkgconfig
  python3-pplpy python3-primecountpy python3-requests python3-scipy

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

* Re: sagemath-9.5: package updates and fixes
  2022-03-30 13:55 [PR PATCH] sagemath-9.5: package updates and fixes tornaria
@ 2022-03-30 14:48 ` dkwo
  2022-04-01 16:07 ` Eloitor
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dkwo @ 2022-03-30 14:48 UTC (permalink / raw)
  To: ml

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

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/36420#issuecomment-1083235767

Comment:
Great, let me take a look.

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

* Re: sagemath-9.5: package updates and fixes
  2022-03-30 13:55 [PR PATCH] sagemath-9.5: package updates and fixes tornaria
  2022-03-30 14:48 ` dkwo
@ 2022-04-01 16:07 ` Eloitor
  2022-04-01 16:20 ` tornaria
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Eloitor @ 2022-04-01 16:07 UTC (permalink / raw)
  To: ml

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

New comment by Eloitor on void-packages repository

https://github.com/void-linux/void-packages/pull/36420#issuecomment-1086095282

Comment:
Is it possible to make sagemath available for aarch64? It is [available in Fedora](https://fedora.pkgs.org/35/fedora-aarch64/sagemath-9.4-1.fc35.aarch64.rpm.html), but I don't know if they cross compile it...

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

* Re: sagemath-9.5: package updates and fixes
  2022-03-30 13:55 [PR PATCH] sagemath-9.5: package updates and fixes tornaria
  2022-03-30 14:48 ` dkwo
  2022-04-01 16:07 ` Eloitor
@ 2022-04-01 16:20 ` tornaria
  2022-04-01 16:29 ` Eloitor
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tornaria @ 2022-04-01 16:20 UTC (permalink / raw)
  To: ml

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

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/36420#issuecomment-1086108226

Comment:
> Is it possible to make sagemath available for aarch64? It is [available in Fedora](https://fedora.pkgs.org/35/fedora-aarch64/sagemath-9.4-1.fc35.aarch64.rpm.html), but I don't know if they cross compile it...

We have a few packages that are nocross at this moment (from top of my head: ntl, givaro/fflas/linbox, cysignals, and packages that depend on those). I wouldn't expect sagelib itself to be an issue, but I never tried

If you have an aarch64 box capable of running sagemath, you could try compiling sagemath native using xbps-src which should recursively compile all the packages that are not available in the official repo because of nocross.

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

* Re: sagemath-9.5: package updates and fixes
  2022-03-30 13:55 [PR PATCH] sagemath-9.5: package updates and fixes tornaria
                   ` (2 preceding siblings ...)
  2022-04-01 16:20 ` tornaria
@ 2022-04-01 16:29 ` Eloitor
  2022-04-01 16:46 ` dkwo
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Eloitor @ 2022-04-01 16:29 UTC (permalink / raw)
  To: ml

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

New comment by Eloitor on void-packages repository

https://github.com/void-linux/void-packages/pull/36420#issuecomment-1086115709

Comment:
Thanks for the answer, I'll try compiling from source.

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

* Re: sagemath-9.5: package updates and fixes
  2022-03-30 13:55 [PR PATCH] sagemath-9.5: package updates and fixes tornaria
                   ` (3 preceding siblings ...)
  2022-04-01 16:29 ` Eloitor
@ 2022-04-01 16:46 ` dkwo
  2022-04-01 19:57 ` [PR PATCH] [Updated] " tornaria
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dkwo @ 2022-04-01 16:46 UTC (permalink / raw)
  To: ml

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

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/36420#issuecomment-1086128241

Comment:
iirc, the main blocker to cross in ntl, the rest follows from that.

see also https://github.com/libntl/ntl/issues/8


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

* Re: [PR PATCH] [Updated] sagemath-9.5: package updates and fixes
  2022-03-30 13:55 [PR PATCH] sagemath-9.5: package updates and fixes tornaria
                   ` (4 preceding siblings ...)
  2022-04-01 16:46 ` dkwo
@ 2022-04-01 19:57 ` tornaria
  2022-04-03 15:24 ` tornaria
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tornaria @ 2022-04-01 19:57 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tornaria/void-packages sagemath-update
https://github.com/void-linux/void-packages/pull/36420

sagemath-9.5: package updates and fixes
#### Testing the changes
- I tested the changes in this PR: **YES**

This includes
 - upgrade to lrcalc-2.1 (from #36209)
 - upgrade to sympy-1.10.1 (from #36397)
 - upgrade to SuiteSparse-5.11.0, igraph-0.9.7, planarity-3.0.2.0, python3-cvxopt-1.3.0 (from #36423)
 - upgrade to giac-1.7.0.53 (from #36421)
 - upgrade to gp2c-0.0.12pl1 (from #36422)
 - backported fixes for sagemath-9.5 to accomodate these upgrades, and also ipython and scipy upgrades which are already merged

I want to see if the CI can cope with this. Otherwise I'll just split this in a few separate PR. Except for the upgrade to lrcalc-2.1, which must be coordinated with sage, everything else can be handled separately.

cc: @dkwo

EDIT: I ended up making 3 new PR to handle the packages that can be upgraded separately from sagemath (#36397, #36421, #36422, #36423 should be ok to merge if CI passes).

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

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

From a8a6543c9c2e3773804d0bd51a77e2e8d214d82e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 28 Feb 2022 12:03:22 -0300
Subject: [PATCH 1/5] lrcalc: update to 2.1.

---
 common/shlibs                         |  2 +-
 srcpkgs/lrcalc/patches/includes.patch | 90 ---------------------------
 srcpkgs/lrcalc/template               |  6 +-
 3 files changed, 4 insertions(+), 94 deletions(-)
 delete mode 100644 srcpkgs/lrcalc/patches/includes.patch

diff --git a/common/shlibs b/common/shlibs
index ccc55a1b3772..21748292c4e9 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4040,7 +4040,7 @@ libarb.so.2 arb-2.20.0_1
 libec.so.8 eclib-20210625_1
 libsymmetrica.so.2 symmetrica-3.0.1_1
 libLfunction.so.1 lcalc-2.0.4_1
-liblrcalc.so.1 lrcalc-1.2_1
+liblrcalc.so.2 lrcalc-2.1_1
 libwayland-client++.so.0 libwaylandpp-0.2.8_1
 libwayland-cursor++.so.0 libwaylandpp-0.2.8_1
 libwayland-egl++.so.0 libwaylandpp-0.2.8_1
diff --git a/srcpkgs/lrcalc/patches/includes.patch b/srcpkgs/lrcalc/patches/includes.patch
deleted file mode 100644
index 707da176a60f..000000000000
--- a/srcpkgs/lrcalc/patches/includes.patch
+++ /dev/null
@@ -1,90 +0,0 @@
-From 4a5e1c8c3c11efdb1cbb4239825a6bf4bf1c52f8 Mon Sep 17 00:00:00 2001
-From: Anders Skovsted Buch <asbuch@math.rutgers.edu>
-Date: Sun, 29 Nov 2015 16:25:56 -0500
-Subject: [PATCH] Patch by Jeroen Demeyer to change include <vector.h> to
- "vector.h", plus similar cases.
-
----
- src/lrcalc.c   | 2 +-
- src/maple.c    | 4 ++--
- src/schublib.h | 2 +-
- src/symfcn.c   | 6 +++---
- src/symfcn.h   | 4 ++--
- 5 files changed, 9 insertions(+), 9 deletions(-)
-
-diff --git a/src/lrcalc.c b/src/lrcalc.c
-index aff3f75..60df49e 100644
---- a/src/lrcalc.c
-+++ b/src/lrcalc.c
-@@ -8,7 +8,7 @@
- #include <stdlib.h>
- extern char *optarg;
- 
--#include <vectarg.h>
-+#include "vectarg.h"
- 
- #include "symfcn.h"
- #include "maple.h"
-diff --git a/src/maple.c b/src/maple.c
-index fdc0768..a5f4d14 100644
---- a/src/maple.c
-+++ b/src/maple.c
-@@ -4,8 +4,8 @@
-  */
- 
- #include <stdio.h>
--#include <vector.h>
--#include <hashtab.h>
-+#include "vector.h"
-+#include "hashtab.h"
- #include "maple.h"
- 
- 
-diff --git a/src/schublib.h b/src/schublib.h
-index a8e8511..864850c 100644
---- a/src/schublib.h
-+++ b/src/schublib.h
-@@ -1,7 +1,7 @@
- #ifndef _SCHUBLIB_H
- #define _SCHUBLIB_H
- 
--#include <hashtab.h>
-+#include "hashtab.h"
- 
- hashtab *trans(vector *w, int vars, hashtab *res);
- hashtab *monk(int i, hashtab *slc, int rank);
-diff --git a/src/symfcn.c b/src/symfcn.c
-index 4ffbe4b..fd5df5d 100644
---- a/src/symfcn.c
-+++ b/src/symfcn.c
-@@ -5,9 +5,9 @@
- 
- #include <stdio.h>
- 
--#include <alloc.h>
--#include <vector.h>
--#include <hashtab.h>
-+#include "alloc.h"
-+#include "vector.h"
-+#include "hashtab.h"
- 
- #include "symfcn.h"
- 
-diff --git a/src/symfcn.h b/src/symfcn.h
-index b8543b1..29bb00d 100644
---- a/src/symfcn.h
-+++ b/src/symfcn.h
-@@ -1,8 +1,8 @@
- #ifndef _SYMFCN_H
- #define _SYMFCN_H
- 
--#include <hashtab.h>
--#include <vector.h>
-+#include "hashtab.h"
-+#include "vector.h"
- 
- int part_itr_sz(vector *part);
- int part_itr_sub(vector *part, vector *outer);
--- 
-2.1.1.1.g1fb337f
-
diff --git a/srcpkgs/lrcalc/template b/srcpkgs/lrcalc/template
index 8b33c3cba6c8..afa889b6d6ad 100644
--- a/srcpkgs/lrcalc/template
+++ b/srcpkgs/lrcalc/template
@@ -1,14 +1,14 @@
 # Template file for 'lrcalc'
 pkgname=lrcalc
-version=1.2
-revision=2
+version=2.1
+revision=1
 build_style=gnu-configure
 short_desc="Littlewood-Richardson Calculator"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-3.0-or-later"
 homepage="https://sites.math.rutgers.edu/~asbuch/lrcalc/"
 distfiles="https://sites.math.rutgers.edu/~asbuch/lrcalc/lrcalc-$version.tar.gz"
-checksum=792dd538a0d19698be2c5b8c138730bbb4820e8a44e03b001ae14bd5f1d7040b
+checksum=996ac00e6ea8321ef09b34478f5379f613933c3254aeba624b6419b8afa5df57
 
 lrcalc-devel_package() {
 	depends="${sourcepkg}>=${version}_${revision} ${makedepends}"

From 35dadff886c897cbbcac48bf3dc9a4c093a95c25 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 28 Feb 2022 14:06:21 -0300
Subject: [PATCH 2/5] New package: python3-lrcalc-2.1

---
 srcpkgs/python3-lrcalc/template | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/python3-lrcalc/template

diff --git a/srcpkgs/python3-lrcalc/template b/srcpkgs/python3-lrcalc/template
new file mode 100644
index 000000000000..9f335dac35dd
--- /dev/null
+++ b/srcpkgs/python3-lrcalc/template
@@ -0,0 +1,14 @@
+# Template file for 'python3-lrcalc'
+pkgname=python3-lrcalc
+version=2.1
+revision=1
+wrksrc=lrcalc-${version}
+build_style=python3-module
+hostmakedepends="python3-setuptools python3-Cython"
+makedepends="python3-devel lrcalc-devel"
+short_desc="Python bindings for the Littlewood-Richardson Calculator library"
+maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
+license="GPL-3.0-or-later"
+homepage="https://math.rutgers.edu/~asbuch/lrcalc"
+distfiles="${PYPI_SITE}/l/lrcalc/lrcalc-${version}.tar.gz"
+checksum=e3a0509aeda487b412b391a52e817ca36b5c063a8305e09fd54d53259dd6aaa9

From 22fe2d17d4e37092795f1e561b201ecf80b1f475 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 22 Jan 2022 16:35:34 -0300
Subject: [PATCH 3/5] lcalc: ignore a version irrelevant for us

---
 srcpkgs/lcalc/update | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 srcpkgs/lcalc/update

diff --git a/srcpkgs/lcalc/update b/srcpkgs/lcalc/update
new file mode 100644
index 000000000000..4cfe261c03b8
--- /dev/null
+++ b/srcpkgs/lcalc/update
@@ -0,0 +1,2 @@
+# this version only adds a fix for cygwin
+ignore=2.0.5

From 2e71a70bf39b4ca9a5a7941a2f1312cf82ade653 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 22 Jan 2022 16:35:20 -0300
Subject: [PATCH 4/5] python3-gmpy2: ignore a version irrelevant for us

---
 srcpkgs/python3-gmpy2/update | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/python3-gmpy2/update b/srcpkgs/python3-gmpy2/update
index b5703618d280..0d9a7f7d2018 100644
--- a/srcpkgs/python3-gmpy2/update
+++ b/srcpkgs/python3-gmpy2/update
@@ -1 +1,3 @@
 ignore="*a[1-9] *b[1-9] *rc[1-9]"
+# this version only adds binary wheels for apple silicon
+ignore="$ignore 2.1.2"

From 27dd16a0a43548f4ae5f5fa2aa7804026d437361 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 28 Feb 2022 14:06:28 -0300
Subject: [PATCH 5/5] sagemath: rebuild for package updates

 - compatibility with lrcalc 2.1 (trac #31355)
 - fix doctests for ipython-8.1 (trac #33170)
 - fix doctests for scipy-1.8 (trac #33336)
 - fix doctests for sympy-1.10 (trac #33398)
 - fix doctests when sphinx is installed (trac #33585)
---
 .../trac-31355-upgrade_lrcalc_to_2.1.patch    | 670 ++++++++++++++++++
 .../trac-33170-fix_doctest_ipython_8.patch    |  40 ++
 .../trac-33170b-fix_doctest_ipython_8.1.patch |  13 +
 .../trac-33336-fix_doctest_scipy_1.8.patch    |  19 +
 ...d9deaeaa6380ab2f0d50276d911233c00a04.patch |  99 +++
 ...ff347454ac7f07e5918470b20e97b8f2357e.patch |  29 +
 ...0a0b14f67f4804e7113c3db41bbcf8a58296.patch |  26 +
 srcpkgs/sagemath/template                     |   6 +-
 8 files changed, 899 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/sagemath/patches/trac-31355-upgrade_lrcalc_to_2.1.patch
 create mode 100644 srcpkgs/sagemath/patches/trac-33170-fix_doctest_ipython_8.patch
 create mode 100644 srcpkgs/sagemath/patches/trac-33170b-fix_doctest_ipython_8.1.patch
 create mode 100644 srcpkgs/sagemath/patches/trac-33336-fix_doctest_scipy_1.8.patch
 create mode 100644 srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-609dd9deaeaa6380ab2f0d50276d911233c00a04.patch
 create mode 100644 srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-c49eff347454ac7f07e5918470b20e97b8f2357e.patch
 create mode 100644 srcpkgs/sagemath/patches/trac-33585-fix_doctest_sphinx_installed-a04a0a0b14f67f4804e7113c3db41bbcf8a58296.patch

diff --git a/srcpkgs/sagemath/patches/trac-31355-upgrade_lrcalc_to_2.1.patch b/srcpkgs/sagemath/patches/trac-31355-upgrade_lrcalc_to_2.1.patch
new file mode 100644
index 000000000000..4bd6f4f4e2dc
--- /dev/null
+++ b/srcpkgs/sagemath/patches/trac-31355-upgrade_lrcalc_to_2.1.patch
@@ -0,0 +1,670 @@
+As produced by `git diff 9.5 9.6.beta3 -- src/sage/libs/lrcalc`
+
+diff --git a/src/sage/libs/lrcalc/lrcalc.pxd b/src/sage/libs/lrcalc/lrcalc.pxd
+deleted file mode 100644
+index 10b88db93f2..00000000000
+--- a/src/sage/libs/lrcalc/lrcalc.pxd
++++ /dev/null
+@@ -1,77 +0,0 @@
+-# distutils: libraries = lrcalc
+-
+-cdef extern from "lrcalc/hashtab.h":
+-    ctypedef struct hashtab:
+-        pass
+-
+-    ctypedef struct hash_itr:
+-        pass
+-
+-    ctypedef unsigned long hashkey_t
+-    ctypedef int (*cmp_t) (void* a, void* b)
+-    ctypedef hashkey_t (*hash_t) (void* a)
+-
+-    hashtab* hash_new(cmp_t cm, hash_t hsh)
+-    void hash_free(hashtab *ht)
+-
+-    void* hash_lookup(hashtab *ht, void *key)
+-    void* hash_insert(hashtab *ht, void *key, void *value)
+-
+-    bint hash_good(hash_itr)
+-    void hash_first(hashtab* s, hash_itr itr)
+-    void hash_next(hash_itr itr)
+-    void* hash_key(hash_itr itr)
+-    void* hash_value(hash_itr itr)
+-    int hash_intvalue(hash_itr itr)
+-
+-cdef extern from "lrcalc/vector.h":
+-    ctypedef struct vector:
+-        size_t length
+-        int* array
+-
+-    vector* v_new(int length)
+-    void v_free(vector* v)
+-    void v_print(vector *v)
+-    int v_length(vector* v)
+-    int v_elem(vector* v, int i)
+-
+-    ctypedef struct vecpair:
+-        vector *first
+-        vector *second
+-
+-    vector* vp_first(vecpair* vp)
+-    vector* vp_second(vecpair* vp)
+-
+-cdef extern from "lrcalc/list.h":
+-    cdef struct _list:
+-        void **array
+-        size_t allocated
+-        size_t length
+-    void l_free(_list *lst)
+-
+-cdef extern from "lrcalc/symfcn.h":
+-    long long lrcoef_c "lrcoef"(vector* outer, vector* inner1, vector* inner2)
+-    hashtab* mult_c "mult"(vector *sh1, vector *sh2, int maxrows)
+-    hashtab* skew_c "skew"(vector *outer, vector *inner, int maxrows)
+-    hashtab* coprod_c "coprod"(vector *part, int all)
+-    void fusion_reduce_c "fusion_reduce"(hashtab* ht, int rows, int cols, int opt_zero)
+-    _list *quantum_reduce_c "quantum_reduce"(hashtab* ht, int rows, int col)
+-
+-    ctypedef struct skewtab:
+-        vector *outer
+-        vector *inner
+-        vector *conts
+-        int maxrows
+-        vector *conjugate
+-        int rows
+-        int cols
+-        int matrix[1]
+-
+-    skewtab *st_new(vector *outer, vector *inner, vector *conts, int maxrows)
+-    int st_next(skewtab *st)
+-    void st_print(skewtab *st)
+-    void st_free(skewtab *st)
+-
+-
+-cdef extern from "lrcalc/schublib.h":
+-    hashtab* mult_schubert_c "mult_schubert"(vector *sh1, vector *sh2, int rank)
+diff --git a/src/sage/libs/lrcalc/lrcalc.pyx b/src/sage/libs/lrcalc/lrcalc.py
+similarity index 60%
+rename from src/sage/libs/lrcalc/lrcalc.pyx
+rename to src/sage/libs/lrcalc/lrcalc.py
+index b591081ec4c..b541bfacd89 100644
+--- a/src/sage/libs/lrcalc/lrcalc.pyx
++++ b/src/sage/libs/lrcalc/lrcalc.py
+@@ -10,7 +10,8 @@ fusion products. All of the above are achieved by counting LR
+ appropriate shape and content by iterating through them.
+ Additionally, ``lrcalc`` handles products of Schubert polynomials.
+ 
+-The web page of ``lrcalc`` is `<http://sites.math.rutgers.edu/~asbuch/lrcalc/>`_.
++The web page of ``lrcalc`` is
++`<http://sites.math.rutgers.edu/~asbuch/lrcalc/>`_.
+ 
+ The following describes the Sage interface to this library.
+ 
+@@ -36,12 +37,13 @@ Schur expansion::
+      [4, 2]: 1}
+ 
+ Same product, but include only partitions with at most 3 rows.  This
+-corresponds to computing in the representation ring of gl(3)::
++corresponds to computing in the representation ring of `\mathfrak{gl}(3)`::
+ 
+     sage: lrcalc.mult([2,1], [2,1], 3)
+     {[2, 2, 2]: 1, [3, 2, 1]: 2, [3, 3]: 1, [4, 1, 1]: 1, [4, 2]: 1}
+ 
+-We can also compute the fusion product, here for sl(3) and level 2::
++We can also compute the fusion product, here for `\mathfrak{sl}(3)`
++and level 2::
+ 
+     sage: lrcalc.mult([3,2,1], [3,2,1], 3,2)
+     {[4, 4, 4]: 1, [5, 4, 3]: 1}
+@@ -77,42 +79,38 @@ Multiply two Schubert polynomials::
+      [6, 2, 1, 4, 3, 5]: 1}
+ 
+ Same product, but include only permutations of 5 elements in the result.
+-This corresponds to computing in the cohomology ring of Fl(5)::
++This corresponds to computing in the cohomology ring of `Fl(5)`::
+ 
+     sage: lrcalc.mult_schubert([4,2,1,3], [1,4,2,5,3], 5)
+     {[4, 5, 1, 3, 2]: 1, [5, 3, 1, 4, 2]: 1, [5, 4, 1, 2, 3]: 1}
+ 
+ List all Littlewood-Richardson tableaux of skew shape `\mu/\nu`; in
+ this example `\mu=[3,2,1]` and `\nu=[2,1]`. Specifying a third entry
+-`maxrows` restricts the alphabet to `\{1,2,\ldots,maxrows\}`::
++`M' = ``maxrows`` restricts the alphabet to `\{1,2,\ldots,M\}`::
+ 
+     sage: list(lrcalc.lrskew([3,2,1],[2,1]))
+     [[[None, None, 1], [None, 1], [1]], [[None, None, 1], [None, 1], [2]],
+     [[None, None, 1], [None, 2], [1]], [[None, None, 1], [None, 2], [3]]]
+ 
+     sage: list(lrcalc.lrskew([3,2,1],[2,1],maxrows=2))
+-    [[[None, None, 1], [None, 1], [1]], [[None, None, 1], [None, 1], [2]], [[None, None, 1], [None, 2], [1]]]
++    [[[None, None, 1], [None, 1], [1]], [[None, None, 1], [None, 1], [2]],
++     [[None, None, 1], [None, 2], [1]]]
+ 
+ .. TODO::
+ 
+-    use this library in the :class:`SymmetricFunctions` code, to
++    Use this library in the :class:`SymmetricFunctions` code, to
+     make it easy to apply it to linear combinations of Schur functions.
+ 
+ .. SEEALSO::
+ 
+     - :func:`lrcoef`
+-
+     - :func:`mult`
+-
+     - :func:`coprod`
+-
+     - :func:`skew`
+-
+     - :func:`lrskew`
+-
+     - :func:`mult_schubert`
+ 
+-.. rubric:: Underlying algorithmic in lrcalc
++.. RUBRIC:: Underlying algorithmic in lrcalc
+ 
+ Here is some additional information regarding the main low-level
+ C-functions in `lrcalc`. Given two partitions ``outer`` and ``inner``
+@@ -187,180 +185,24 @@ AUTHORS:
+ #                  https://www.gnu.org/licenses/
+ # ****************************************************************************
+ 
+-from sage.rings.integer cimport Integer
+-from sage.structure.parent cimport Parent
+ from sage.combinat.partition import _Partitions
+ from sage.combinat.permutation import Permutation
+-from sage.combinat.skew_tableau import SkewTableau
+-
+-
+-cdef vector* iterable_to_vector(it):
+-    """
+-    Return an lrcalc vector (which is a list of integers) from a Python iterable.
+-
+-    TESTS::
+-
+-        sage: from sage.libs.lrcalc.lrcalc import test_iterable_to_vector
+-        sage: x = test_iterable_to_vector(Partition([3,2,1])); x   #indirect doctest
+-        [3, 2, 1]
+-    """
+-    cdef vector* v
+-    cdef list itr = list(it)
+-    cdef int n = len(itr)
+-    cdef int i
+-    v = v_new(n)
+-    for i in range(n):
+-        v.array[i] = int(itr[i])
+-    return v
+-
+-
+-cdef list vector_to_list(vector *v):
+-    """
+-    Converts a lrcalc vector to Python list.
+-
+-    TESTS::
+-
+-        sage: from sage.libs.lrcalc.lrcalc import test_iterable_to_vector
+-        sage: x = test_iterable_to_vector([]); x         #indirect doctest
+-        []
+-    """
+-    cdef int i, n
+-    n = v_length(v)
+-    cdef list result = [None]*n
+-    for i in range(n):
+-        result[i] = Integer(v_elem(v, i))
+-    return result
+-
+-
+-def test_iterable_to_vector(it):
+-    """
+-    A wrapper function for the cdef function ``iterable_to_vector``
+-    and ``vector_to_list``, to test that they are working correctly.
++from sage.combinat.skew_tableau import SemistandardSkewTableaux
++from sage.combinat.skew_partition import SkewPartition
++from sage.rings.integer import Integer
++import lrcalc
+ 
+-    EXAMPLES::
+-
+-        sage: from sage.libs.lrcalc.lrcalc import test_iterable_to_vector
+-        sage: x = test_iterable_to_vector([3,2,1]); x
+-        [3, 2, 1]
+-    """
+-    cdef vector *v = iterable_to_vector(it)
+-    result = vector_to_list(v)
+-    v_free(v)
+-    return result
+-
+-
+-cdef skewtab_to_SkewTableau(skewtab *st):
+-    """
+-    A wrapper function which transforms the data set ``st`` used in
+-    ``lrcalc`` to a ``SkewTableau`` in Sage.
++def _lrcalc_dict_to_sage(result):
++    r"""
++    Translate from lrcalc output format to Sage expected format.
+ 
+     TESTS::
+ 
+-        sage: from sage.libs.lrcalc.lrcalc import test_skewtab_to_SkewTableau
+-        sage: test_skewtab_to_SkewTableau([],[])
+-        []
+-    """
+-    inner = vector_to_list(st.inner)
+-    outer = vector_to_list(st.outer)
+-    return SkewTableau(expr=[[inner[y] for y in range(len(outer))],
+-                             [[st.matrix[x + y * st.cols] + 1
+-                                for x in range(inner[y], outer[y])]
+-                              for y in range(len(outer) - 1, -1, -1)]])
+-
+-
+-def test_skewtab_to_SkewTableau(outer, inner):
+-    """
+-    A wrapper function for the cdef function ``skewtab_to_SkewTableau``
+-    for testing purposes.
+-
+-    It constructs the first LR skew tableau of shape ``outer/inner``
+-    as an ``lrcalc`` ``skewtab``, and converts it to a
+-    :class:`SkewTableau`.
+-
+-    EXAMPLES::
+-
+-        sage: from sage.libs.lrcalc.lrcalc import test_skewtab_to_SkewTableau
+-        sage: test_skewtab_to_SkewTableau([3,2,1],[])
+-        [[1, 1, 1], [2, 2], [3]]
+-        sage: test_skewtab_to_SkewTableau([4,3,2,1],[1,1]).pp()
+-        .  1  1  1
+-        .  2  2
+-        1  3
+-        2
+-    """
+-    cdef vector* o = iterable_to_vector(outer)
+-    cdef vector* i = iterable_to_vector(inner+[0]*(len(outer)-len(inner)))
+-    cdef skewtab* st = st_new(o, i, NULL, 0)
+-    return skewtab_to_SkewTableau(st)
+-
+-
+-cdef dict sf_hashtab_to_dict(hashtab *ht):
+-    """
+-    Return a dictionary representing a Schur function. The keys are
+-    partitions and the values are integers <class 'sage.rings.integer.Integer'>.
+-
+-    EXAMPLES::
+-
+         sage: from sage.libs.lrcalc.lrcalc import mult
+-        sage: sorted(mult([1],[1]).items())        #indirect doctest
+-        [([1, 1], 1), ([2], 1)]
+-        sage: assert isinstance(mult([1],[1]),dict)#indirect doctest
+-    """
+-    cdef hash_itr itr
+-    cdef dict result = {}
+-    cdef list p
+-    hash_first(ht, itr)
+-    while hash_good(itr):
+-        p = vector_to_list(<vector*> hash_key(itr))
+-        result[_Partitions(p)] = Integer(hash_intvalue(itr))
+-        hash_next(itr)
+-    return result
+-
+-
+-cdef dict schubert_hashtab_to_dict(hashtab *ht):
+-    """
+-    Return a dictionary corresponding to a Schubert polynomial whose keys
+-    are permutations and whose values are integers <class 'sage.rings.integer.Integer'>.
+-
+-    EXAMPLES::
+-
+-        sage: from sage.libs.lrcalc.lrcalc import mult_schubert
+-        sage: mult_schubert([3,2,1], [1,2,3])      #indirect doctest
+-        {[3, 2, 1]: 1}
+-    """
+-    cdef hash_itr itr
+-    cdef dict result = {}
+-    hash_first(ht, itr)
+-    while hash_good(itr):
+-        p = vector_to_list(<vector*> hash_key(itr))
+-        result[Permutation(p)] = Integer(hash_intvalue(itr))
+-        hash_next(itr)
+-    return result
+-
+-
+-cdef dict vp_hashtab_to_dict(hashtab *ht):
+-    """
+-    Return a dictionary corresponding to the coproduct of a Schur function whose keys are
+-    pairs of partitions and whose values are integers <class 'sage.rings.integer.Integer'>.
+-
+-    EXAMPLES::
+-
+-        sage: from sage.libs.lrcalc.lrcalc import coprod
+-        sage: coprod([1])      #indirect doctest
+-        {([1], []): 1}
++        sage: mult([2,1],[3,2,1],3) # indirect doctest
++        {[3, 3, 3]: 1, [4, 3, 2]: 2, [4, 4, 1]: 1, [5, 2, 2]: 1, [5, 3, 1]: 1}
+     """
+-    cdef hash_itr itr
+-    cdef vecpair* vp
+-    cdef dict result = {}
+-    hash_first(ht, itr)
+-    while hash_good(itr):
+-        vp = <vecpair*> hash_key(itr)
+-        p1 = _Partitions(vector_to_list(vp_first(vp)))
+-        p2 = _Partitions(vector_to_list(vp_second(vp)))
+-        result[(p1, p2)] = Integer(hash_intvalue(itr))
+-        hash_next(itr)
+-    return result
+-
++    return {_Partitions(la): Integer(k) for la, k in result.items()}
+ 
+ def lrcoef_unsafe(outer, inner1, inner2):
+     r"""
+@@ -371,13 +213,11 @@ def lrcoef_unsafe(outer, inner1, inner2):
+ 
+     INPUT:
+ 
+-    - ``outer`` -- a partition (weakly decreasing list of non-negative integers).
+-
+-    - ``inner1`` -- a partition.
++    - ``outer`` -- a partition (weakly decreasing list of non-negative integers)
++    - ``inner1`` -- a partition
++    - ``inner2`` -- a partition
+ 
+-    - ``inner2`` -- a partition.
+-
+-    .. warning::
++    .. WARNING::
+ 
+        This function does not do any check on its input.  If you want
+        to use a safer version, use :func:`lrcoef`.
+@@ -392,18 +232,7 @@ def lrcoef_unsafe(outer, inner1, inner2):
+         sage: lrcoef_unsafe([2,1,1,1,1], [2,1], [2,1])
+         0
+     """
+-    cdef long long result
+-    cdef vector *o
+-    cdef vector *i1
+-    cdef vector *i2
+-    o = iterable_to_vector(outer)
+-    i1 = iterable_to_vector(inner1)
+-    i2 = iterable_to_vector(inner2)
+-    result = lrcoef_c(o, i1, i2)
+-    v_free(o)
+-    v_free(i1)
+-    v_free(i2)
+-    return Integer(result)
++    return Integer(lrcalc.lrcoef(outer, inner1, inner2))
+ 
+ 
+ def lrcoef(outer, inner1, inner2):
+@@ -415,11 +244,9 @@ def lrcoef(outer, inner1, inner2):
+ 
+     INPUT:
+ 
+-    - ``outer`` -- a partition (weakly decreasing list of non-negative integers).
+-
+-    - ``inner1`` -- a partition.
+-
+-    - ``inner2`` -- a partition.
++    - ``outer`` -- a partition (weakly decreasing list of non-negative integers)
++    - ``inner1`` -- a partition
++    - ``inner2`` -- a partition
+ 
+     .. NOTE::
+ 
+@@ -436,7 +263,6 @@ def lrcoef(outer, inner1, inner2):
+         1
+         sage: lrcoef([2,1,1,1,1], [2,1], [2,1])
+         0
+-
+     """
+     return lrcoef_unsafe(_Partitions(outer), _Partitions(inner1), _Partitions(inner2))
+ 
+@@ -451,13 +277,9 @@ def mult(part1, part2, maxrows=None, level=None, quantum=None):
+     INPUT:
+ 
+     - ``part1`` -- a partition
+-
+     - ``part2`` -- a partition
+-
+     - ``maxrows`` -- (optional) an integer
+-
+     - ``level`` -- (optional) an integer
+-
+     - ``quantum`` -- (optional) an element of a ring
+ 
+     If ``maxrows`` is specified, then only partitions with at most
+@@ -479,7 +301,8 @@ def mult(part1, part2, maxrows=None, level=None, quantum=None):
+         sage: sorted(mult([2],[2]).items())
+         [([2, 2], 1), ([3, 1], 1), ([4], 1)]
+         sage: sorted(mult([2,1],[2,1]).items())
+-        [([2, 2, 1, 1], 1), ([2, 2, 2], 1), ([3, 1, 1, 1], 1), ([3, 2, 1], 2), ([3, 3], 1), ([4, 1, 1], 1), ([4, 2], 1)]
++        [([2, 2, 1, 1], 1), ([2, 2, 2], 1), ([3, 1, 1, 1], 1),
++         ([3, 2, 1], 2), ([3, 3], 1), ([4, 1, 1], 1), ([4, 2], 1)]
+         sage: sorted(mult([2,1],[2,1],maxrows=2).items())
+         [([3, 3], 1), ([4, 2], 1)]
+         sage: mult([2,1],[3,2,1],3)
+@@ -510,44 +333,24 @@ def mult(part1, part2, maxrows=None, level=None, quantum=None):
+     if quantum is not None and (level is None or maxrows is None):
+         raise ValueError('missing parameters maxrows or level')
+ 
+-    cdef vector* v1 = iterable_to_vector(part1)
+-    cdef vector* v2 = iterable_to_vector(part2)
+-    if maxrows is None:
+-        maxrows = 0
+-    cdef hashtab* ht = mult_c(v1, v2, int(maxrows))
+-    cdef hashtab* tab
+-    cdef dict result
+-
+     if quantum is None:
+         if level is not None:
+-            fusion_reduce_c(ht, int(maxrows), int(level), int(0))
+-        result = sf_hashtab_to_dict(ht)
+-        v_free(v1)
+-        v_free(v2)
+-        hash_free(ht)
+-        return result
++            return _lrcalc_dict_to_sage(lrcalc.mult_fusion(part1, part2, maxrows, level))
++        if maxrows is None:
++            maxrows = -1
++        return _lrcalc_dict_to_sage(lrcalc.mult(part1, part2, maxrows))
+ 
+     # Otherwise do quantum multiplication
+-    cdef _list *qlist
+-    cdef dict temp
+-    qlist = quantum_reduce_c(ht, int(maxrows), int(level))
+-    # The above call frees the memory associated with ht
+-    v_free(v1)
+-    v_free(v2)
+-
+-    cdef Parent P = quantum.parent()
+-    result = {}
+-    for i in range(qlist.length):
+-        tab = <hashtab*>(qlist.array[i])
+-        temp = sf_hashtab_to_dict(tab)
+-        for k in temp:
+-            result[k] = result.get(k, P.zero()) + quantum**i * temp[k]
+-        hash_free(tab)
+-    l_free(qlist)
+-    return result
+-
+-
+-def skew(outer, inner, maxrows=0):
++    result = lrcalc.mult_quantum(part1, part2, maxrows, level, degrees=True)
++    P = quantum.parent()
++    output = {}
++    for i,k in result.items():
++        la = _Partitions(i[0])
++        output[la] = output.get(la, P.zero()) + k * quantum**(i[1])
++    return output
++
++
++def skew(outer, inner, maxrows=-1):
+     """
+     Compute the Schur expansion of a skew Schur function.
+ 
+@@ -557,11 +360,9 @@ def skew(outer, inner, maxrows=0):
+ 
+     INPUT:
+ 
+-    - ``outer`` -- a partition.
+-
+-    - ``inner`` -- a partition.
+-
+-    - ``maxrows`` -- an integer or ``None``.
++    - ``outer`` -- a partition
++    - ``inner`` -- a partition
++    - ``maxrows`` -- an integer or ``None``
+ 
+     If ``maxrows`` is specified, then only partitions with at most
+     this number of rows are included in the result.
+@@ -572,14 +373,7 @@ def skew(outer, inner, maxrows=0):
+         sage: sorted(skew([2,1],[1]).items())
+         [([1, 1], 1), ([2], 1)]
+     """
+-    cdef vector* v1 = iterable_to_vector(outer)
+-    cdef vector* v2 = iterable_to_vector(inner)
+-    cdef hashtab* ht = skew_c(v1, v2, int(maxrows))
+-    result = sf_hashtab_to_dict(ht)
+-    v_free(v1)
+-    v_free(v2)
+-    hash_free(ht)
+-    return result
++    return _lrcalc_dict_to_sage(lrcalc.skew(outer, inner, maxrows))
+ 
+ 
+ def coprod(part, all=0):
+@@ -592,9 +386,8 @@ def coprod(part, all=0):
+ 
+     INPUT:
+ 
+-    - ``part`` -- a partition.
+-
+-    - ``all`` -- an integer.
++    - ``part`` -- a partition
++    - ``all`` -- an integer
+ 
+     If ``all`` is non-zero then all terms are included in the result.
+     If ``all`` is zero, then only pairs of partitions ``(part1,
+@@ -609,12 +402,9 @@ def coprod(part, all=0):
+         sage: sorted(coprod([2,1]).items())
+         [(([1, 1], [1]), 1), (([2], [1]), 1), (([2, 1], []), 1)]
+     """
+-    cdef vector* v1 = iterable_to_vector(part)
+-    cdef hashtab* ht = coprod_c(v1, int(all))
+-    result = vp_hashtab_to_dict(ht)
+-    v_free(v1)
+-    hash_free(ht)
+-    return result
++    result = lrcalc.coprod(part, all)
++    return {tuple([_Partitions(mu) for mu in la]): Integer(k)
++            for la, k in result.items()}
+ 
+ 
+ def mult_schubert(w1, w2, rank=0):
+@@ -627,11 +417,9 @@ def mult_schubert(w1, w2, rank=0):
+ 
+     INPUT:
+ 
+-    - ``w1`` -- a permutation.
+-
+-    - ``w2`` -- a permutation.
+-
+-    - ``rank`` -- an integer.
++    - ``w1`` -- a permutation
++    - ``w2`` -- a permutation
++    - ``rank`` -- an integer
+ 
+     If ``rank`` is non-zero, then only permutations from the symmetric
+     group `S(\mathrm{rank})` are included in the result.
+@@ -646,33 +434,24 @@ def mult_schubert(w1, w2, rank=0):
+          ([6, 4, 3, 1, 2, 5], 1), ([6, 5, 2, 1, 3, 4], 1),
+          ([7, 3, 4, 1, 2, 5, 6], 1), ([7, 4, 2, 1, 3, 5, 6], 1)]
+     """
+-    cdef vector* v1 = iterable_to_vector(w1)
+-    cdef vector* v2 = iterable_to_vector(w2)
+-    cdef hashtab* ht = mult_schubert_c(v1, v2, int(rank))
+-    result = schubert_hashtab_to_dict(ht)
+-    v_free(v1)
+-    v_free(v2)
+-    hash_free(ht)
+-    return result
++    result = lrcalc.schubmult(w1, w2, rank)
++    return {Permutation(list(la)):Integer(k) for la,k in result.items()}
+ 
+ 
+-def lrskew(outer, inner, weight=None, maxrows=0):
++def lrskew(outer, inner, weight=None, maxrows=-1):
+     r"""
+     Iterate over the skew LR tableaux of shape ``outer / inner``.
+ 
+     INPUT:
+ 
+     - ``outer`` -- a partition
+-
+     - ``inner`` -- a partition
+-
+     - ``weight`` -- a partition (optional)
+-
+-    - ``maxrows`` -- an integer (optional)
++    - ``maxrows`` -- a positive integer (optional)
+ 
+     OUTPUT: an iterator of :class:`SkewTableau`
+ 
+-    Specifying ``maxrows`` restricts the alphabet to `\{1,2,\ldots,maxrows\}`.
++    Specifying ``maxrows`` = `M` restricts the alphabet to `\{1,2,\ldots,M\}`.
+ 
+     Specifying ``weight`` returns only those tableaux of given content/weight.
+ 
+@@ -702,22 +481,40 @@ def lrskew(outer, inner, weight=None, maxrows=0):
+ 
+         sage: list(lrskew([3,2,1],[2], weight=[3,1]))
+         [[[None, None, 1], [1, 1], [2]]]
++
++    TESTS::
++
++        sage: from sage.libs.lrcalc.lrcalc import lrskew
++        sage: list(lrskew([3,2,1],[2], weight=[]))
++        []
++        sage: list(lrskew([3,2,1],[2], weight=[0]))
++        []
++        sage: list(lrskew([3,2,1],[3,2,1], weight=[]))
++        [[[None, None, None], [None, None], [None]]]
++        sage: list(lrskew([3,2,1],[3,2,1], weight=[0]))
++        [[[None, None, None], [None, None], [None]]]
++        sage: list(lrskew([3,2,1],[3,2,1], weight=[1]))
++        []
+     """
+-    cdef vector* o = iterable_to_vector(outer)
+-    cdef vector* i = iterable_to_vector(inner + [0]*(len(outer) - len(inner)))
+-    cdef skewtab* st = st_new(o, i, NULL, int(maxrows))
++    iterator = lrcalc.lr_iterator(outer, inner, maxrows)
++    shape = SkewPartition([outer, inner])
+ 
+     if weight is None:
+-        yield skewtab_to_SkewTableau(st)
+-        while st_next(st):
+-            yield skewtab_to_SkewTableau(st)
++        ST = SemistandardSkewTableaux(shape)
++        for data in iterator:
++            yield ST.from_shape_and_word(shape, [i+1 for i in data])
+     else:
+         wt = _Partitions(weight)
+-        r = skewtab_to_SkewTableau(st)
+-        if r.weight() == wt:
+-            yield r
+-        while st_next(st):
+-            r = skewtab_to_SkewTableau(st)
+-            if r.weight() == wt:
+-                yield r
+-    st_free(st)
++        ST = SemistandardSkewTableaux(shape, wt)
++        m = len(wt)
++        for data in iterator:
++            w = [0] * m
++            for j in data:
++                if j >= m:
++                    # We know they are not equal, so make the check below quick
++                    w = None
++                    break
++                w[j] += 1
++            if w == wt:
++                yield ST.from_shape_and_word(shape, [i+1 for i in data])
++
diff --git a/srcpkgs/sagemath/patches/trac-33170-fix_doctest_ipython_8.patch b/srcpkgs/sagemath/patches/trac-33170-fix_doctest_ipython_8.patch
new file mode 100644
index 000000000000..1e2e0ba90742
--- /dev/null
+++ b/srcpkgs/sagemath/patches/trac-33170-fix_doctest_ipython_8.patch
@@ -0,0 +1,40 @@
+As produced by `git diff a90a3146{^^,}`
+
+diff --git a/src/sage/repl/interface_magic.py b/src/sage/repl/interface_magic.py
+index 8a455b69b0e..a93e1c9e04c 100644
+--- a/src/sage/repl/interface_magic.py
++++ b/src/sage/repl/interface_magic.py
+@@ -260,7 +260,7 @@ class InterfaceMagic(object):
+             2
+             120
+             sage: shell.run_cell('%%gap foo\n1+1;\n')
+-            ...File "<string>", line unknown
++            ...File...<string>...
+             SyntaxError: Interface magics have no options, got "foo"
+             <BLANKLINE>
+             sage: shell.run_cell('%%gap?')
+diff --git a/src/sage/repl/interpreter.py b/src/sage/repl/interpreter.py
+index 7468afe52d7..06c47b7374a 100644
+--- a/src/sage/repl/interpreter.py
++++ b/src/sage/repl/interpreter.py
+@@ -78,9 +78,9 @@ Check that Cython source code appears in tracebacks::
+     dummy line
+     ...
+     ZeroDivisionError...Traceback (most recent call last)
+-    <ipython-input-...> in <module>...
++    ...in <module>...
+     ----> 1 Integer(1)/Integer(0)
+-    .../sage/rings/integer.pyx in sage.rings.integer.Integer...div...
++    .../sage/rings/integer.pyx... in sage.rings.integer.Integer...div...
+     ...
+     -> ...                  raise ZeroDivisionError("rational division by zero")
+        ....:            x = <Rational> Rational.__new__(Rational)
+@@ -423,7 +423,7 @@ def SagePreparseTransformer(lines):
+         sage: from sage.repl.interpreter import get_test_shell
+         sage: shell = get_test_shell()
+         sage: shell.run_cell(bad_syntax)
+-          File "<string>", line unknown
++          File...<string>...
+         SyntaxError: Mismatched ']'
+         <BLANKLINE>
+         sage: shell.quit()
diff --git a/srcpkgs/sagemath/patches/trac-33170b-fix_doctest_ipython_8.1.patch b/srcpkgs/sagemath/patches/trac-33170b-fix_doctest_ipython_8.1.patch
new file mode 100644
index 000000000000..853813b0f5bd
--- /dev/null
+++ b/srcpkgs/sagemath/patches/trac-33170b-fix_doctest_ipython_8.1.patch
@@ -0,0 +1,13 @@
+Fix for ipython 8.1
+
+--- a/src/sage/repl/interpreter.py
++++ b/src/sage/repl/interpreter.py
+@@ -78,7 +78,7 @@ Check that Cython source code appears in tracebacks::
+     dummy line
+     ...
+     ZeroDivisionError...Traceback (most recent call last)
+-    ...in <module>...
++    ...
+     ----> 1 Integer(1)/Integer(0)
+     .../sage/rings/integer.pyx... in sage.rings.integer.Integer...div...
+     ...
diff --git a/srcpkgs/sagemath/patches/trac-33336-fix_doctest_scipy_1.8.patch b/srcpkgs/sagemath/patches/trac-33336-fix_doctest_scipy_1.8.patch
new file mode 100644
index 000000000000..19b69700a4f6
--- /dev/null
+++ b/srcpkgs/sagemath/patches/trac-33336-fix_doctest_scipy_1.8.patch
@@ -0,0 +1,19 @@
+commit 9c8235e44ffb509efa8a3ca6cdb55154e2b5066d
+Author: Antonio Rojas <arojas@archlinux.org>
+Date:   Sun Feb 13 19:53:14 2022 +0100
+
+    Fix deprecation warning with scipy 1.8
+
+diff --git a/src/sage/tests/books/computational-mathematics-with-sagemath/linsolve_doctest.py b/src/sage/tests/books/computational-mathematics-with-sagemath/linsolve_doctest.py
+index e9b60dae5ec..7932167b41d 100644
+--- a/src/sage/tests/books/computational-mathematics-with-sagemath/linsolve_doctest.py
++++ b/src/sage/tests/books/computational-mathematics-with-sagemath/linsolve_doctest.py
+@@ -356,7 +356,7 @@ Sage example in ./linsolve.tex, line 2230::
+ 
+ Sage example in ./linsolve.tex, line 2609::
+ 
+-  sage: from scipy.sparse.linalg.dsolve import *
++  sage: from scipy.sparse.linalg import factorized
+   sage: from scipy.sparse import lil_matrix
+   sage: from numpy import array
+   sage: n = 200
diff --git a/srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-609dd9deaeaa6380ab2f0d50276d911233c00a04.patch b/srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-609dd9deaeaa6380ab2f0d50276d911233c00a04.patch
new file mode 100644
index 000000000000..9ba7ca5a6b7d
--- /dev/null
+++ b/srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-609dd9deaeaa6380ab2f0d50276d911233c00a04.patch
@@ -0,0 +1,99 @@
+From 609dd9deaeaa6380ab2f0d50276d911233c00a04 Mon Sep 17 00:00:00 2001
+From: Matthias Koeppe <mkoeppe@math.ucdavis.edu>
+Date: Fri, 4 Mar 2022 16:07:09 -0800
+Subject: sage.manifolds: Update doctests for SymPy 1.10
+
+---
+ src/sage/manifolds/continuous_map.py              | 3 +--
+ src/sage/manifolds/differentiable/diff_form.py    | 4 ++--
+ src/sage/manifolds/differentiable/tensorfield.py  | 8 ++++----
+ src/sage/manifolds/vector_bundle_fiber_element.py | 2 +-
+ 4 files changed, 8 insertions(+), 9 deletions(-)
+
+diff --git a/src/sage/manifolds/continuous_map.py b/src/sage/manifolds/continuous_map.py
+index a6356e7..f6f9b6d 100644
+--- a/src/sage/manifolds/continuous_map.py
++++ b/src/sage/manifolds/continuous_map.py
+@@ -1357,8 +1357,7 @@ class ContinuousMap(Morphism):
+             sage: Phi.coord_functions(c_uv, c_xyz)
+             Coordinate functions (u*v, u/v, u + v) on the Chart (M, (u, v))
+             sage: Phi.coord_functions(c_UV, c_xyz)
+-            Coordinate functions (-U**2/4 + V**2/4, -(U + V)/(U - V), V)
+-             on the Chart (M, (U, V))
++            Coordinate functions (-U**2/4 + V**2/4, (-U - V)/(U - V), V) on the Chart (M, (U, V))
+             sage: Phi.coord_functions(c_UV, c_XYZ)
+             Coordinate functions ((-U**3 + U**2*V + U*V**2 + 2*U*V + 6*U - V**3
+              - 2*V**2 + 6*V)/(2*(U - V)), (U**3/4 - U**2*V/4 - U*V**2/4 + U*V
+diff --git a/src/sage/manifolds/differentiable/diff_form.py b/src/sage/manifolds/differentiable/diff_form.py
+index 70dd8fb..0aa3469 100644
+--- a/src/sage/manifolds/differentiable/diff_form.py
++++ b/src/sage/manifolds/differentiable/diff_form.py
+@@ -266,7 +266,7 @@ class DiffForm(TensorField):
+ 
+         sage: s = a.wedge(b)
+         sage: s.display(eU)
+-        a∧b = -x*(2*x*y + 1) dx∧dy
++        a∧b = x*(-2*x*y - 1) dx∧dy
+         sage: s.display(eV)
+         a∧b = (u**3/8 + u**2*v/8 - u*v**2/8 + u/4 - v**3/8 + v/4) du∧dv
+ 
+@@ -275,7 +275,7 @@ class DiffForm(TensorField):
+         sage: f = M.scalar_field({c_xy: (x+y)^2, c_uv: u^2}, name='f')
+         sage: s = f*a
+         sage: s.display(eU)
+-        f*a = -y*(x**2 + 2*x*y + y**2) dx + x*(x**2 + 2*x*y + y**2) dy
++        f*a = y*(-x**2 - 2*x*y - y**2) dx + x*(x**2 + 2*x*y + y**2) dy
+         sage: s.display(eV)
+         f*a = u**2*v/2 du - u**3/2 dv
+ 
+diff --git a/src/sage/manifolds/differentiable/tensorfield.py b/src/sage/manifolds/differentiable/tensorfield.py
+index 2775be9..6bc5c50 100644
+--- a/src/sage/manifolds/differentiable/tensorfield.py
++++ b/src/sage/manifolds/differentiable/tensorfield.py
+@@ -334,7 +334,7 @@ class TensorField(ModuleElementWithMutability):
+         sage: f.display()  # long time
+         t(a,b): S^2 → ℝ
+         on U: (x, y) ↦ -2*x*y - 3*x - y**2
+-        on V: (u, v) ↦ -(3*u**3 + 3*u*v**2 + 2*u*v + v**2)/(u**4 + 2*u**2*v**2 + v**4)
++        on V: (u, v) ↦ (-3*u**3 - 3*u*v**2 - 2*u*v - v**2)/(u**4 + 2*u**2*v**2 + v**4)
+ 
+     The vectors can be defined only on subsets of `S^2`, the domain of the
+     result is then the common subset::
+@@ -343,12 +343,12 @@ class TensorField(ModuleElementWithMutability):
+         sage: s.display()  # long time
+         t(a,b): U → ℝ
+            (x, y) ↦ -2*x*y - 3*x - y**2
+-        on W: (u, v) ↦ -(3*u**3 + 3*u*v**2 + 2*u*v + v**2)/(u**4 + 2*u**2*v**2 + v**4)
++        on W: (u, v) ↦ (-3*u**3 - 3*u*v**2 - 2*u*v - v**2)/(u**4 + 2*u**2*v**2 + v**4)
+         sage: s = t(a.restrict(U), b.restrict(W))  # long time
+         sage: s.display()  # long time
+         t(a,b): W → ℝ
+            (x, y) ↦ -2*x*y - 3*x - y**2
+-           (u, v) ↦ -(3*u**3 + 3*u*v**2 + 2*u*v + v**2)/(u**4 + 2*u**2*v**2 + v**4)
++           (u, v) ↦ (-3*u**3 - 3*u*v**2 - 2*u*v - v**2)/(u**4 + 2*u**2*v**2 + v**4)
+ 
+     The tensor itself can be defined only on some open subset of `S^2`,
+     yielding a result whose domain is this subset::
+@@ -356,7 +356,7 @@ class TensorField(ModuleElementWithMutability):
+         sage: s = t.restrict(V)(a,b)  # long time
+         sage: s.display()  # long time
+         t(a,b): V → ℝ
+-           (u, v) ↦ -(3*u**3 + 3*u*v**2 + 2*u*v + v**2)/(u**4 + 2*u**2*v**2 + v**4)
++           (u, v) ↦ (-3*u**3 - 3*u*v**2 - 2*u*v - v**2)/(u**4 + 2*u**2*v**2 + v**4)
+         on W: (x, y) ↦ -2*x*y - 3*x - y**2
+ 
+     Tests regarding the multiplication by a scalar field::
+diff --git a/src/sage/manifolds/vector_bundle_fiber_element.py b/src/sage/manifolds/vector_bundle_fiber_element.py
+index 29ee81d..048275a 100644
+--- a/src/sage/manifolds/vector_bundle_fiber_element.py
++++ b/src/sage/manifolds/vector_bundle_fiber_element.py
+@@ -110,4 +110,4 @@ class VectorBundleFiberElement(FiniteRankFreeModuleElement):
+             desc += str(self._name) + " "
+         desc += "in the fiber of {} at {}".format(self._vbundle._name,
+                                                   self._point)
+-        return desc
+\ No newline at end of file
++        return desc
+-- 
+cgit v1.0-1-gd88e
+
diff --git a/srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-c49eff347454ac7f07e5918470b20e97b8f2357e.patch b/srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-c49eff347454ac7f07e5918470b20e97b8f2357e.patch
new file mode 100644
index 000000000000..f5ac180baa90
--- /dev/null
+++ b/srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-c49eff347454ac7f07e5918470b20e97b8f2357e.patch
@@ -0,0 +1,29 @@
+From c49eff347454ac7f07e5918470b20e97b8f2357e Mon Sep 17 00:00:00 2001
+From: Matthias Koeppe <mkoeppe@math.ucdavis.edu>
+Date: Fri, 4 Mar 2022 15:14:43 -0800
+Subject: src/sage/calculus/calculus.py: Update laplace doctest for sympy 1.10
+
+---
+ src/sage/calculus/calculus.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/sage/calculus/calculus.py b/src/sage/calculus/calculus.py
+index 9c2f226..b335093 100644
+--- a/src/sage/calculus/calculus.py
++++ b/src/sage/calculus/calculus.py
+@@ -1639,9 +1639,9 @@ def laplace(ex, t, s, algorithm='maxima'):
+         sage: laplace(dirac_delta(t), t, s)
+         1
+         sage: F, a, cond = laplace(dirac_delta(t), t, s, algorithm='sympy')
+-        sage: a, cond
+-        (-oo, True)
+-        sage: F       # random - sympy <1.9 includes undefined heaviside(0) in answer
++        sage: a, cond  # random - sympy <1.10 gives (-oo, True)
++        (0, True)
++        sage: F        # random - sympy <1.9 includes undefined heaviside(0) in answer
+         1
+         sage: laplace(dirac_delta(t), t, s, algorithm='giac')
+         1
+-- 
+cgit v1.0-1-gd88e
+
diff --git a/srcpkgs/sagemath/patches/trac-33585-fix_doctest_sphinx_installed-a04a0a0b14f67f4804e7113c3db41bbcf8a58296.patch b/srcpkgs/sagemath/patches/trac-33585-fix_doctest_sphinx_installed-a04a0a0b14f67f4804e7113c3db41bbcf8a58296.patch
new file mode 100644
index 000000000000..8e7bb64f5b01
--- /dev/null
+++ b/srcpkgs/sagemath/patches/trac-33585-fix_doctest_sphinx_installed-a04a0a0b14f67f4804e7113c3db41bbcf8a58296.patch
@@ -0,0 +1,26 @@
+From a04a0a0b14f67f4804e7113c3db41bbcf8a58296 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
+Date: Mon, 28 Mar 2022 20:39:59 -0300
+Subject: Trac #33585: fix doctest when dochtml is missing...
+
+...but sphinx is available in PYTHONPATH.
+---
+ src/sage/misc/sagedoc.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/sage/misc/sagedoc.py b/src/sage/misc/sagedoc.py
+index 4b3853f..08c4225 100644
+--- a/src/sage/misc/sagedoc.py
++++ b/src/sage/misc/sagedoc.py
+@@ -1401,7 +1401,7 @@ class _sage_doc:
+             "...**File:**...**Type:**...**Definition:** identity_matrix..."
+             sage: identity_matrix.__doc__ in browse_sage_doc(identity_matrix, 'rst')
+             True
+-            sage: browse_sage_doc(identity_matrix, 'html', False)             # optional - sphinx
++            sage: browse_sage_doc(identity_matrix, 'html', False)             # optional - sphinx sagemath_doc_html
+             '...div...File:...Type:...Definition:...identity_matrix...'
+ 
+         In the 'text' version, double colons have been replaced with
+-- 
+cgit v1.0-1-gd88e
+
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 710a9e80c052..02d4333fa545 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
 version=9.5
-revision=1
+revision=2
 wrksrc=sage-$version
 build_wrksrc=pkgs/sagemath-standard
 build_style=python3-module
@@ -12,7 +12,7 @@ hostmakedepends="m4 pkg-config python3-Cython python3-Jinja2 python3-pkgconfig
 makedepends="arb-devel boost-devel brial-devel cliquer-devel ecl eclib-devel
  ecm-devel fflas-ffpack flintlib-devel gap-devel gd-devel giac-devel glpk-devel
  gsl-devel iml-devel lcalc-devel libbraiding-devel libhomfly-devel libmpc-devel
- libpng-devel linbox-devel lrcalc-devel m4ri-devel m4rie-devel mpfi-devel
+ libpng-devel linbox-devel m4ri-devel m4rie-devel mpfi-devel
  mpfr-devel ntl-devel openblas-devel pari-devel planarity-devel python3-cypari2
  python3-cysignals python3-devel python3-gmpy2 python3-memory_allocator
  python3-numpy rankwidth-devel singular symmetrica-devel zn_poly"
@@ -20,7 +20,7 @@ depends="FlintQS eclib-devel fflas-ffpack flintlib-devel gcc-fortran gd-devel
  gfan giac gsl-devel gzip libpng-devel linbox-devel m4ri-devel maxima-ecl
  mpfr-devel nauty ntl-devel palp pari-devel pari-elldata-small pari-galdata
  pari-galpol-small pari-seadata-small pkg-config python3-Cython python3-cypari2
- python3-cysignals python3-devel python3-fpylll python3-ipython
+ python3-cysignals python3-devel python3-fpylll python3-ipython python3-lrcalc
  python3-ipython_ipykernel python3-jupyter_ipywidgets python3-matplotlib
  python3-memory_allocator python3-networkx python3-pip python3-pkgconfig
  python3-pplpy python3-primecountpy python3-requests python3-scipy

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

* Re: [PR PATCH] [Updated] sagemath-9.5: package updates and fixes
  2022-03-30 13:55 [PR PATCH] sagemath-9.5: package updates and fixes tornaria
                   ` (5 preceding siblings ...)
  2022-04-01 19:57 ` [PR PATCH] [Updated] " tornaria
@ 2022-04-03 15:24 ` tornaria
  2022-04-04  1:24 ` tornaria
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tornaria @ 2022-04-03 15:24 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tornaria/void-packages sagemath-update
https://github.com/void-linux/void-packages/pull/36420

sagemath-9.5: package updates and fixes
#### Testing the changes
- I tested the changes in this PR: **YES**

This includes
 - upgrade to lrcalc-2.1 (from #36209)
 -  _already merged_ ~upgrade to sympy-1.10.1 (from #36397)~
 - _postponed_ ~upgrade to SuiteSparse-5.11.0, igraph-0.9.7, planarity-3.0.2.0, python3-cvxopt-1.3.0 (from #36423)~
 - _already merged_ ~upgrade to giac-1.7.0.53 (from #36421)~
 - _already merged_ ~upgrade to gp2c-0.0.12pl1 (from #36422)~
 - backported fixes for sagemath-9.5 to accomodate these upgrades, and also ipython and scipy upgrades which are already merged

~I want to see if the CI can cope with this. Otherwise I'll just split this in a few separate PR. Except for the upgrade to lrcalc-2.1, which must be coordinated with sage, everything else can be handled separately.~

cc: @dkwo

EDIT: I ended up making 3 new PR to handle the packages that can be upgraded separately from sagemath (#36397, #36421, #36422, #36423 should be ok to merge if CI passes).

EDIT 2: this PR is now just to upgrade lrcalc to 2.1 (will be needed for sagemath-9.6) and fix sagemath-9.5 so it works with lrcalc 2.1 (and several minor doctest fixes for upgrades to ipython, scipy, sympy).

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

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

From f0dc576e5d5ba869fe4e8f7115f752fa128d579d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 3 Apr 2022 12:00:11 -0300
Subject: [PATCH 1/6] New package: threejs-sage-r122

---
 srcpkgs/threejs-sage/template | 16 ++++++++++++++++
 srcpkgs/threejs-sage/update   |  1 +
 2 files changed, 17 insertions(+)
 create mode 100644 srcpkgs/threejs-sage/template
 create mode 100644 srcpkgs/threejs-sage/update

diff --git a/srcpkgs/threejs-sage/template b/srcpkgs/threejs-sage/template
new file mode 100644
index 000000000000..cb5c87a19c12
--- /dev/null
+++ b/srcpkgs/threejs-sage/template
@@ -0,0 +1,16 @@
+# Template file for 'threejs-sage'
+pkgname=threejs-sage
+version=r122
+revision=1
+short_desc="Custom build of three.js for sagemath"
+maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
+license="MIT"
+homepage="https://github.com/sagemath/threejs-sage/"
+distfiles="https://github.com/sagemath/threejs-sage/archive/refs/tags/${version}.tar.gz"
+checksum=718767ab55876a3e957d1cfe89a322c6d9fa680fc737b9ca668aee6a3eac3bb8
+
+do_install() {
+	vlicense LICENSE
+	vinstall version 644 usr/share/sagemath/threejs-sage
+	vinstall build/three.min.js 644 usr/share/sagemath/threejs-sage/$version
+}
diff --git a/srcpkgs/threejs-sage/update b/srcpkgs/threejs-sage/update
new file mode 100644
index 000000000000..05c0c7ecebe1
--- /dev/null
+++ b/srcpkgs/threejs-sage/update
@@ -0,0 +1 @@
+site=https://mirrors.mit.edu/sage/spkg/upstream/threejs/

From 6a66d3d209dab35bbd5b3e1ce1d0d81de76fa624 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 28 Feb 2022 12:03:22 -0300
Subject: [PATCH 2/6] lrcalc: update to 2.1.

---
 common/shlibs                         |  2 +-
 srcpkgs/lrcalc/patches/includes.patch | 90 ---------------------------
 srcpkgs/lrcalc/template               |  6 +-
 3 files changed, 4 insertions(+), 94 deletions(-)
 delete mode 100644 srcpkgs/lrcalc/patches/includes.patch

diff --git a/common/shlibs b/common/shlibs
index 1007c400288a..1cd7191d5049 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4040,7 +4040,7 @@ libarb.so.2 arb-2.20.0_1
 libec.so.8 eclib-20210625_1
 libsymmetrica.so.2 symmetrica-3.0.1_1
 libLfunction.so.1 lcalc-2.0.4_1
-liblrcalc.so.1 lrcalc-1.2_1
+liblrcalc.so.2 lrcalc-2.1_1
 libwayland-client++.so.0 libwaylandpp-0.2.8_1
 libwayland-cursor++.so.0 libwaylandpp-0.2.8_1
 libwayland-egl++.so.0 libwaylandpp-0.2.8_1
diff --git a/srcpkgs/lrcalc/patches/includes.patch b/srcpkgs/lrcalc/patches/includes.patch
deleted file mode 100644
index 707da176a60f..000000000000
--- a/srcpkgs/lrcalc/patches/includes.patch
+++ /dev/null
@@ -1,90 +0,0 @@
-From 4a5e1c8c3c11efdb1cbb4239825a6bf4bf1c52f8 Mon Sep 17 00:00:00 2001
-From: Anders Skovsted Buch <asbuch@math.rutgers.edu>
-Date: Sun, 29 Nov 2015 16:25:56 -0500
-Subject: [PATCH] Patch by Jeroen Demeyer to change include <vector.h> to
- "vector.h", plus similar cases.
-
----
- src/lrcalc.c   | 2 +-
- src/maple.c    | 4 ++--
- src/schublib.h | 2 +-
- src/symfcn.c   | 6 +++---
- src/symfcn.h   | 4 ++--
- 5 files changed, 9 insertions(+), 9 deletions(-)
-
-diff --git a/src/lrcalc.c b/src/lrcalc.c
-index aff3f75..60df49e 100644
---- a/src/lrcalc.c
-+++ b/src/lrcalc.c
-@@ -8,7 +8,7 @@
- #include <stdlib.h>
- extern char *optarg;
- 
--#include <vectarg.h>
-+#include "vectarg.h"
- 
- #include "symfcn.h"
- #include "maple.h"
-diff --git a/src/maple.c b/src/maple.c
-index fdc0768..a5f4d14 100644
---- a/src/maple.c
-+++ b/src/maple.c
-@@ -4,8 +4,8 @@
-  */
- 
- #include <stdio.h>
--#include <vector.h>
--#include <hashtab.h>
-+#include "vector.h"
-+#include "hashtab.h"
- #include "maple.h"
- 
- 
-diff --git a/src/schublib.h b/src/schublib.h
-index a8e8511..864850c 100644
---- a/src/schublib.h
-+++ b/src/schublib.h
-@@ -1,7 +1,7 @@
- #ifndef _SCHUBLIB_H
- #define _SCHUBLIB_H
- 
--#include <hashtab.h>
-+#include "hashtab.h"
- 
- hashtab *trans(vector *w, int vars, hashtab *res);
- hashtab *monk(int i, hashtab *slc, int rank);
-diff --git a/src/symfcn.c b/src/symfcn.c
-index 4ffbe4b..fd5df5d 100644
---- a/src/symfcn.c
-+++ b/src/symfcn.c
-@@ -5,9 +5,9 @@
- 
- #include <stdio.h>
- 
--#include <alloc.h>
--#include <vector.h>
--#include <hashtab.h>
-+#include "alloc.h"
-+#include "vector.h"
-+#include "hashtab.h"
- 
- #include "symfcn.h"
- 
-diff --git a/src/symfcn.h b/src/symfcn.h
-index b8543b1..29bb00d 100644
---- a/src/symfcn.h
-+++ b/src/symfcn.h
-@@ -1,8 +1,8 @@
- #ifndef _SYMFCN_H
- #define _SYMFCN_H
- 
--#include <hashtab.h>
--#include <vector.h>
-+#include "hashtab.h"
-+#include "vector.h"
- 
- int part_itr_sz(vector *part);
- int part_itr_sub(vector *part, vector *outer);
--- 
-2.1.1.1.g1fb337f
-
diff --git a/srcpkgs/lrcalc/template b/srcpkgs/lrcalc/template
index 8b33c3cba6c8..afa889b6d6ad 100644
--- a/srcpkgs/lrcalc/template
+++ b/srcpkgs/lrcalc/template
@@ -1,14 +1,14 @@
 # Template file for 'lrcalc'
 pkgname=lrcalc
-version=1.2
-revision=2
+version=2.1
+revision=1
 build_style=gnu-configure
 short_desc="Littlewood-Richardson Calculator"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-3.0-or-later"
 homepage="https://sites.math.rutgers.edu/~asbuch/lrcalc/"
 distfiles="https://sites.math.rutgers.edu/~asbuch/lrcalc/lrcalc-$version.tar.gz"
-checksum=792dd538a0d19698be2c5b8c138730bbb4820e8a44e03b001ae14bd5f1d7040b
+checksum=996ac00e6ea8321ef09b34478f5379f613933c3254aeba624b6419b8afa5df57
 
 lrcalc-devel_package() {
 	depends="${sourcepkg}>=${version}_${revision} ${makedepends}"

From aee2bd910d8155ac61689bfbade15178e7ed3a75 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 28 Feb 2022 14:06:21 -0300
Subject: [PATCH 3/6] New package: python3-lrcalc-2.1

---
 srcpkgs/python3-lrcalc/template | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/python3-lrcalc/template

diff --git a/srcpkgs/python3-lrcalc/template b/srcpkgs/python3-lrcalc/template
new file mode 100644
index 000000000000..9f335dac35dd
--- /dev/null
+++ b/srcpkgs/python3-lrcalc/template
@@ -0,0 +1,14 @@
+# Template file for 'python3-lrcalc'
+pkgname=python3-lrcalc
+version=2.1
+revision=1
+wrksrc=lrcalc-${version}
+build_style=python3-module
+hostmakedepends="python3-setuptools python3-Cython"
+makedepends="python3-devel lrcalc-devel"
+short_desc="Python bindings for the Littlewood-Richardson Calculator library"
+maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
+license="GPL-3.0-or-later"
+homepage="https://math.rutgers.edu/~asbuch/lrcalc"
+distfiles="${PYPI_SITE}/l/lrcalc/lrcalc-${version}.tar.gz"
+checksum=e3a0509aeda487b412b391a52e817ca36b5c063a8305e09fd54d53259dd6aaa9

From 355e00f3f2f8aec2ff718661a040b552666f770d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 22 Jan 2022 16:35:34 -0300
Subject: [PATCH 4/6] lcalc: ignore a version irrelevant for us

---
 srcpkgs/lcalc/update | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 srcpkgs/lcalc/update

diff --git a/srcpkgs/lcalc/update b/srcpkgs/lcalc/update
new file mode 100644
index 000000000000..4cfe261c03b8
--- /dev/null
+++ b/srcpkgs/lcalc/update
@@ -0,0 +1,2 @@
+# this version only adds a fix for cygwin
+ignore=2.0.5

From 2864856a7261478dbc03c20dcfe56b47a8d25cbe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 22 Jan 2022 16:35:20 -0300
Subject: [PATCH 5/6] python3-gmpy2: ignore a version irrelevant for us

---
 srcpkgs/python3-gmpy2/update | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/python3-gmpy2/update b/srcpkgs/python3-gmpy2/update
index b5703618d280..0d9a7f7d2018 100644
--- a/srcpkgs/python3-gmpy2/update
+++ b/srcpkgs/python3-gmpy2/update
@@ -1 +1,3 @@
 ignore="*a[1-9] *b[1-9] *rc[1-9]"
+# this version only adds binary wheels for apple silicon
+ignore="$ignore 2.1.2"

From c5575a66c5ec498b507b9a56bcb4ea66b3874636 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 28 Feb 2022 14:06:28 -0300
Subject: [PATCH 6/6] sagemath: rebuild for package updates

 - compatibility with lrcalc 2.1 (trac #31355)
 - fix doctests for ipython-8.1 (trac #33170)
 - fix doctests for scipy-1.8 (trac #33336)
 - fix doctests for sympy-1.10 (trac #33398)
 - fix doctests when sphinx is installed (trac #33585)
 - use new package threejs-sage for 3d plots
---
 .../trac-31355-upgrade_lrcalc_to_2.1.patch    | 670 ++++++++++++++++++
 .../trac-33170-fix_doctest_ipython_8.patch    |  40 ++
 .../trac-33170b-fix_doctest_ipython_8.1.patch |  13 +
 .../trac-33336-fix_doctest_scipy_1.8.patch    |  19 +
 ...d9deaeaa6380ab2f0d50276d911233c00a04.patch |  99 +++
 ...ff347454ac7f07e5918470b20e97b8f2357e.patch |  29 +
 ...0a0b14f67f4804e7113c3db41bbcf8a58296.patch |  26 +
 .../patches/zzz-skip_doctest_no_threejs.patch |  13 -
 srcpkgs/sagemath/template                     |   9 +-
 9 files changed, 901 insertions(+), 17 deletions(-)
 create mode 100644 srcpkgs/sagemath/patches/trac-31355-upgrade_lrcalc_to_2.1.patch
 create mode 100644 srcpkgs/sagemath/patches/trac-33170-fix_doctest_ipython_8.patch
 create mode 100644 srcpkgs/sagemath/patches/trac-33170b-fix_doctest_ipython_8.1.patch
 create mode 100644 srcpkgs/sagemath/patches/trac-33336-fix_doctest_scipy_1.8.patch
 create mode 100644 srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-609dd9deaeaa6380ab2f0d50276d911233c00a04.patch
 create mode 100644 srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-c49eff347454ac7f07e5918470b20e97b8f2357e.patch
 create mode 100644 srcpkgs/sagemath/patches/trac-33585-fix_doctest_sphinx_installed-a04a0a0b14f67f4804e7113c3db41bbcf8a58296.patch
 delete mode 100644 srcpkgs/sagemath/patches/zzz-skip_doctest_no_threejs.patch

diff --git a/srcpkgs/sagemath/patches/trac-31355-upgrade_lrcalc_to_2.1.patch b/srcpkgs/sagemath/patches/trac-31355-upgrade_lrcalc_to_2.1.patch
new file mode 100644
index 000000000000..4bd6f4f4e2dc
--- /dev/null
+++ b/srcpkgs/sagemath/patches/trac-31355-upgrade_lrcalc_to_2.1.patch
@@ -0,0 +1,670 @@
+As produced by `git diff 9.5 9.6.beta3 -- src/sage/libs/lrcalc`
+
+diff --git a/src/sage/libs/lrcalc/lrcalc.pxd b/src/sage/libs/lrcalc/lrcalc.pxd
+deleted file mode 100644
+index 10b88db93f2..00000000000
+--- a/src/sage/libs/lrcalc/lrcalc.pxd
++++ /dev/null
+@@ -1,77 +0,0 @@
+-# distutils: libraries = lrcalc
+-
+-cdef extern from "lrcalc/hashtab.h":
+-    ctypedef struct hashtab:
+-        pass
+-
+-    ctypedef struct hash_itr:
+-        pass
+-
+-    ctypedef unsigned long hashkey_t
+-    ctypedef int (*cmp_t) (void* a, void* b)
+-    ctypedef hashkey_t (*hash_t) (void* a)
+-
+-    hashtab* hash_new(cmp_t cm, hash_t hsh)
+-    void hash_free(hashtab *ht)
+-
+-    void* hash_lookup(hashtab *ht, void *key)
+-    void* hash_insert(hashtab *ht, void *key, void *value)
+-
+-    bint hash_good(hash_itr)
+-    void hash_first(hashtab* s, hash_itr itr)
+-    void hash_next(hash_itr itr)
+-    void* hash_key(hash_itr itr)
+-    void* hash_value(hash_itr itr)
+-    int hash_intvalue(hash_itr itr)
+-
+-cdef extern from "lrcalc/vector.h":
+-    ctypedef struct vector:
+-        size_t length
+-        int* array
+-
+-    vector* v_new(int length)
+-    void v_free(vector* v)
+-    void v_print(vector *v)
+-    int v_length(vector* v)
+-    int v_elem(vector* v, int i)
+-
+-    ctypedef struct vecpair:
+-        vector *first
+-        vector *second
+-
+-    vector* vp_first(vecpair* vp)
+-    vector* vp_second(vecpair* vp)
+-
+-cdef extern from "lrcalc/list.h":
+-    cdef struct _list:
+-        void **array
+-        size_t allocated
+-        size_t length
+-    void l_free(_list *lst)
+-
+-cdef extern from "lrcalc/symfcn.h":
+-    long long lrcoef_c "lrcoef"(vector* outer, vector* inner1, vector* inner2)
+-    hashtab* mult_c "mult"(vector *sh1, vector *sh2, int maxrows)
+-    hashtab* skew_c "skew"(vector *outer, vector *inner, int maxrows)
+-    hashtab* coprod_c "coprod"(vector *part, int all)
+-    void fusion_reduce_c "fusion_reduce"(hashtab* ht, int rows, int cols, int opt_zero)
+-    _list *quantum_reduce_c "quantum_reduce"(hashtab* ht, int rows, int col)
+-
+-    ctypedef struct skewtab:
+-        vector *outer
+-        vector *inner
+-        vector *conts
+-        int maxrows
+-        vector *conjugate
+-        int rows
+-        int cols
+-        int matrix[1]
+-
+-    skewtab *st_new(vector *outer, vector *inner, vector *conts, int maxrows)
+-    int st_next(skewtab *st)
+-    void st_print(skewtab *st)
+-    void st_free(skewtab *st)
+-
+-
+-cdef extern from "lrcalc/schublib.h":
+-    hashtab* mult_schubert_c "mult_schubert"(vector *sh1, vector *sh2, int rank)
+diff --git a/src/sage/libs/lrcalc/lrcalc.pyx b/src/sage/libs/lrcalc/lrcalc.py
+similarity index 60%
+rename from src/sage/libs/lrcalc/lrcalc.pyx
+rename to src/sage/libs/lrcalc/lrcalc.py
+index b591081ec4c..b541bfacd89 100644
+--- a/src/sage/libs/lrcalc/lrcalc.pyx
++++ b/src/sage/libs/lrcalc/lrcalc.py
+@@ -10,7 +10,8 @@ fusion products. All of the above are achieved by counting LR
+ appropriate shape and content by iterating through them.
+ Additionally, ``lrcalc`` handles products of Schubert polynomials.
+ 
+-The web page of ``lrcalc`` is `<http://sites.math.rutgers.edu/~asbuch/lrcalc/>`_.
++The web page of ``lrcalc`` is
++`<http://sites.math.rutgers.edu/~asbuch/lrcalc/>`_.
+ 
+ The following describes the Sage interface to this library.
+ 
+@@ -36,12 +37,13 @@ Schur expansion::
+      [4, 2]: 1}
+ 
+ Same product, but include only partitions with at most 3 rows.  This
+-corresponds to computing in the representation ring of gl(3)::
++corresponds to computing in the representation ring of `\mathfrak{gl}(3)`::
+ 
+     sage: lrcalc.mult([2,1], [2,1], 3)
+     {[2, 2, 2]: 1, [3, 2, 1]: 2, [3, 3]: 1, [4, 1, 1]: 1, [4, 2]: 1}
+ 
+-We can also compute the fusion product, here for sl(3) and level 2::
++We can also compute the fusion product, here for `\mathfrak{sl}(3)`
++and level 2::
+ 
+     sage: lrcalc.mult([3,2,1], [3,2,1], 3,2)
+     {[4, 4, 4]: 1, [5, 4, 3]: 1}
+@@ -77,42 +79,38 @@ Multiply two Schubert polynomials::
+      [6, 2, 1, 4, 3, 5]: 1}
+ 
+ Same product, but include only permutations of 5 elements in the result.
+-This corresponds to computing in the cohomology ring of Fl(5)::
++This corresponds to computing in the cohomology ring of `Fl(5)`::
+ 
+     sage: lrcalc.mult_schubert([4,2,1,3], [1,4,2,5,3], 5)
+     {[4, 5, 1, 3, 2]: 1, [5, 3, 1, 4, 2]: 1, [5, 4, 1, 2, 3]: 1}
+ 
+ List all Littlewood-Richardson tableaux of skew shape `\mu/\nu`; in
+ this example `\mu=[3,2,1]` and `\nu=[2,1]`. Specifying a third entry
+-`maxrows` restricts the alphabet to `\{1,2,\ldots,maxrows\}`::
++`M' = ``maxrows`` restricts the alphabet to `\{1,2,\ldots,M\}`::
+ 
+     sage: list(lrcalc.lrskew([3,2,1],[2,1]))
+     [[[None, None, 1], [None, 1], [1]], [[None, None, 1], [None, 1], [2]],
+     [[None, None, 1], [None, 2], [1]], [[None, None, 1], [None, 2], [3]]]
+ 
+     sage: list(lrcalc.lrskew([3,2,1],[2,1],maxrows=2))
+-    [[[None, None, 1], [None, 1], [1]], [[None, None, 1], [None, 1], [2]], [[None, None, 1], [None, 2], [1]]]
++    [[[None, None, 1], [None, 1], [1]], [[None, None, 1], [None, 1], [2]],
++     [[None, None, 1], [None, 2], [1]]]
+ 
+ .. TODO::
+ 
+-    use this library in the :class:`SymmetricFunctions` code, to
++    Use this library in the :class:`SymmetricFunctions` code, to
+     make it easy to apply it to linear combinations of Schur functions.
+ 
+ .. SEEALSO::
+ 
+     - :func:`lrcoef`
+-
+     - :func:`mult`
+-
+     - :func:`coprod`
+-
+     - :func:`skew`
+-
+     - :func:`lrskew`
+-
+     - :func:`mult_schubert`
+ 
+-.. rubric:: Underlying algorithmic in lrcalc
++.. RUBRIC:: Underlying algorithmic in lrcalc
+ 
+ Here is some additional information regarding the main low-level
+ C-functions in `lrcalc`. Given two partitions ``outer`` and ``inner``
+@@ -187,180 +185,24 @@ AUTHORS:
+ #                  https://www.gnu.org/licenses/
+ # ****************************************************************************
+ 
+-from sage.rings.integer cimport Integer
+-from sage.structure.parent cimport Parent
+ from sage.combinat.partition import _Partitions
+ from sage.combinat.permutation import Permutation
+-from sage.combinat.skew_tableau import SkewTableau
+-
+-
+-cdef vector* iterable_to_vector(it):
+-    """
+-    Return an lrcalc vector (which is a list of integers) from a Python iterable.
+-
+-    TESTS::
+-
+-        sage: from sage.libs.lrcalc.lrcalc import test_iterable_to_vector
+-        sage: x = test_iterable_to_vector(Partition([3,2,1])); x   #indirect doctest
+-        [3, 2, 1]
+-    """
+-    cdef vector* v
+-    cdef list itr = list(it)
+-    cdef int n = len(itr)
+-    cdef int i
+-    v = v_new(n)
+-    for i in range(n):
+-        v.array[i] = int(itr[i])
+-    return v
+-
+-
+-cdef list vector_to_list(vector *v):
+-    """
+-    Converts a lrcalc vector to Python list.
+-
+-    TESTS::
+-
+-        sage: from sage.libs.lrcalc.lrcalc import test_iterable_to_vector
+-        sage: x = test_iterable_to_vector([]); x         #indirect doctest
+-        []
+-    """
+-    cdef int i, n
+-    n = v_length(v)
+-    cdef list result = [None]*n
+-    for i in range(n):
+-        result[i] = Integer(v_elem(v, i))
+-    return result
+-
+-
+-def test_iterable_to_vector(it):
+-    """
+-    A wrapper function for the cdef function ``iterable_to_vector``
+-    and ``vector_to_list``, to test that they are working correctly.
++from sage.combinat.skew_tableau import SemistandardSkewTableaux
++from sage.combinat.skew_partition import SkewPartition
++from sage.rings.integer import Integer
++import lrcalc
+ 
+-    EXAMPLES::
+-
+-        sage: from sage.libs.lrcalc.lrcalc import test_iterable_to_vector
+-        sage: x = test_iterable_to_vector([3,2,1]); x
+-        [3, 2, 1]
+-    """
+-    cdef vector *v = iterable_to_vector(it)
+-    result = vector_to_list(v)
+-    v_free(v)
+-    return result
+-
+-
+-cdef skewtab_to_SkewTableau(skewtab *st):
+-    """
+-    A wrapper function which transforms the data set ``st`` used in
+-    ``lrcalc`` to a ``SkewTableau`` in Sage.
++def _lrcalc_dict_to_sage(result):
++    r"""
++    Translate from lrcalc output format to Sage expected format.
+ 
+     TESTS::
+ 
+-        sage: from sage.libs.lrcalc.lrcalc import test_skewtab_to_SkewTableau
+-        sage: test_skewtab_to_SkewTableau([],[])
+-        []
+-    """
+-    inner = vector_to_list(st.inner)
+-    outer = vector_to_list(st.outer)
+-    return SkewTableau(expr=[[inner[y] for y in range(len(outer))],
+-                             [[st.matrix[x + y * st.cols] + 1
+-                                for x in range(inner[y], outer[y])]
+-                              for y in range(len(outer) - 1, -1, -1)]])
+-
+-
+-def test_skewtab_to_SkewTableau(outer, inner):
+-    """
+-    A wrapper function for the cdef function ``skewtab_to_SkewTableau``
+-    for testing purposes.
+-
+-    It constructs the first LR skew tableau of shape ``outer/inner``
+-    as an ``lrcalc`` ``skewtab``, and converts it to a
+-    :class:`SkewTableau`.
+-
+-    EXAMPLES::
+-
+-        sage: from sage.libs.lrcalc.lrcalc import test_skewtab_to_SkewTableau
+-        sage: test_skewtab_to_SkewTableau([3,2,1],[])
+-        [[1, 1, 1], [2, 2], [3]]
+-        sage: test_skewtab_to_SkewTableau([4,3,2,1],[1,1]).pp()
+-        .  1  1  1
+-        .  2  2
+-        1  3
+-        2
+-    """
+-    cdef vector* o = iterable_to_vector(outer)
+-    cdef vector* i = iterable_to_vector(inner+[0]*(len(outer)-len(inner)))
+-    cdef skewtab* st = st_new(o, i, NULL, 0)
+-    return skewtab_to_SkewTableau(st)
+-
+-
+-cdef dict sf_hashtab_to_dict(hashtab *ht):
+-    """
+-    Return a dictionary representing a Schur function. The keys are
+-    partitions and the values are integers <class 'sage.rings.integer.Integer'>.
+-
+-    EXAMPLES::
+-
+         sage: from sage.libs.lrcalc.lrcalc import mult
+-        sage: sorted(mult([1],[1]).items())        #indirect doctest
+-        [([1, 1], 1), ([2], 1)]
+-        sage: assert isinstance(mult([1],[1]),dict)#indirect doctest
+-    """
+-    cdef hash_itr itr
+-    cdef dict result = {}
+-    cdef list p
+-    hash_first(ht, itr)
+-    while hash_good(itr):
+-        p = vector_to_list(<vector*> hash_key(itr))
+-        result[_Partitions(p)] = Integer(hash_intvalue(itr))
+-        hash_next(itr)
+-    return result
+-
+-
+-cdef dict schubert_hashtab_to_dict(hashtab *ht):
+-    """
+-    Return a dictionary corresponding to a Schubert polynomial whose keys
+-    are permutations and whose values are integers <class 'sage.rings.integer.Integer'>.
+-
+-    EXAMPLES::
+-
+-        sage: from sage.libs.lrcalc.lrcalc import mult_schubert
+-        sage: mult_schubert([3,2,1], [1,2,3])      #indirect doctest
+-        {[3, 2, 1]: 1}
+-    """
+-    cdef hash_itr itr
+-    cdef dict result = {}
+-    hash_first(ht, itr)
+-    while hash_good(itr):
+-        p = vector_to_list(<vector*> hash_key(itr))
+-        result[Permutation(p)] = Integer(hash_intvalue(itr))
+-        hash_next(itr)
+-    return result
+-
+-
+-cdef dict vp_hashtab_to_dict(hashtab *ht):
+-    """
+-    Return a dictionary corresponding to the coproduct of a Schur function whose keys are
+-    pairs of partitions and whose values are integers <class 'sage.rings.integer.Integer'>.
+-
+-    EXAMPLES::
+-
+-        sage: from sage.libs.lrcalc.lrcalc import coprod
+-        sage: coprod([1])      #indirect doctest
+-        {([1], []): 1}
++        sage: mult([2,1],[3,2,1],3) # indirect doctest
++        {[3, 3, 3]: 1, [4, 3, 2]: 2, [4, 4, 1]: 1, [5, 2, 2]: 1, [5, 3, 1]: 1}
+     """
+-    cdef hash_itr itr
+-    cdef vecpair* vp
+-    cdef dict result = {}
+-    hash_first(ht, itr)
+-    while hash_good(itr):
+-        vp = <vecpair*> hash_key(itr)
+-        p1 = _Partitions(vector_to_list(vp_first(vp)))
+-        p2 = _Partitions(vector_to_list(vp_second(vp)))
+-        result[(p1, p2)] = Integer(hash_intvalue(itr))
+-        hash_next(itr)
+-    return result
+-
++    return {_Partitions(la): Integer(k) for la, k in result.items()}
+ 
+ def lrcoef_unsafe(outer, inner1, inner2):
+     r"""
+@@ -371,13 +213,11 @@ def lrcoef_unsafe(outer, inner1, inner2):
+ 
+     INPUT:
+ 
+-    - ``outer`` -- a partition (weakly decreasing list of non-negative integers).
+-
+-    - ``inner1`` -- a partition.
++    - ``outer`` -- a partition (weakly decreasing list of non-negative integers)
++    - ``inner1`` -- a partition
++    - ``inner2`` -- a partition
+ 
+-    - ``inner2`` -- a partition.
+-
+-    .. warning::
++    .. WARNING::
+ 
+        This function does not do any check on its input.  If you want
+        to use a safer version, use :func:`lrcoef`.
+@@ -392,18 +232,7 @@ def lrcoef_unsafe(outer, inner1, inner2):
+         sage: lrcoef_unsafe([2,1,1,1,1], [2,1], [2,1])
+         0
+     """
+-    cdef long long result
+-    cdef vector *o
+-    cdef vector *i1
+-    cdef vector *i2
+-    o = iterable_to_vector(outer)
+-    i1 = iterable_to_vector(inner1)
+-    i2 = iterable_to_vector(inner2)
+-    result = lrcoef_c(o, i1, i2)
+-    v_free(o)
+-    v_free(i1)
+-    v_free(i2)
+-    return Integer(result)
++    return Integer(lrcalc.lrcoef(outer, inner1, inner2))
+ 
+ 
+ def lrcoef(outer, inner1, inner2):
+@@ -415,11 +244,9 @@ def lrcoef(outer, inner1, inner2):
+ 
+     INPUT:
+ 
+-    - ``outer`` -- a partition (weakly decreasing list of non-negative integers).
+-
+-    - ``inner1`` -- a partition.
+-
+-    - ``inner2`` -- a partition.
++    - ``outer`` -- a partition (weakly decreasing list of non-negative integers)
++    - ``inner1`` -- a partition
++    - ``inner2`` -- a partition
+ 
+     .. NOTE::
+ 
+@@ -436,7 +263,6 @@ def lrcoef(outer, inner1, inner2):
+         1
+         sage: lrcoef([2,1,1,1,1], [2,1], [2,1])
+         0
+-
+     """
+     return lrcoef_unsafe(_Partitions(outer), _Partitions(inner1), _Partitions(inner2))
+ 
+@@ -451,13 +277,9 @@ def mult(part1, part2, maxrows=None, level=None, quantum=None):
+     INPUT:
+ 
+     - ``part1`` -- a partition
+-
+     - ``part2`` -- a partition
+-
+     - ``maxrows`` -- (optional) an integer
+-
+     - ``level`` -- (optional) an integer
+-
+     - ``quantum`` -- (optional) an element of a ring
+ 
+     If ``maxrows`` is specified, then only partitions with at most
+@@ -479,7 +301,8 @@ def mult(part1, part2, maxrows=None, level=None, quantum=None):
+         sage: sorted(mult([2],[2]).items())
+         [([2, 2], 1), ([3, 1], 1), ([4], 1)]
+         sage: sorted(mult([2,1],[2,1]).items())
+-        [([2, 2, 1, 1], 1), ([2, 2, 2], 1), ([3, 1, 1, 1], 1), ([3, 2, 1], 2), ([3, 3], 1), ([4, 1, 1], 1), ([4, 2], 1)]
++        [([2, 2, 1, 1], 1), ([2, 2, 2], 1), ([3, 1, 1, 1], 1),
++         ([3, 2, 1], 2), ([3, 3], 1), ([4, 1, 1], 1), ([4, 2], 1)]
+         sage: sorted(mult([2,1],[2,1],maxrows=2).items())
+         [([3, 3], 1), ([4, 2], 1)]
+         sage: mult([2,1],[3,2,1],3)
+@@ -510,44 +333,24 @@ def mult(part1, part2, maxrows=None, level=None, quantum=None):
+     if quantum is not None and (level is None or maxrows is None):
+         raise ValueError('missing parameters maxrows or level')
+ 
+-    cdef vector* v1 = iterable_to_vector(part1)
+-    cdef vector* v2 = iterable_to_vector(part2)
+-    if maxrows is None:
+-        maxrows = 0
+-    cdef hashtab* ht = mult_c(v1, v2, int(maxrows))
+-    cdef hashtab* tab
+-    cdef dict result
+-
+     if quantum is None:
+         if level is not None:
+-            fusion_reduce_c(ht, int(maxrows), int(level), int(0))
+-        result = sf_hashtab_to_dict(ht)
+-        v_free(v1)
+-        v_free(v2)
+-        hash_free(ht)
+-        return result
++            return _lrcalc_dict_to_sage(lrcalc.mult_fusion(part1, part2, maxrows, level))
++        if maxrows is None:
++            maxrows = -1
++        return _lrcalc_dict_to_sage(lrcalc.mult(part1, part2, maxrows))
+ 
+     # Otherwise do quantum multiplication
+-    cdef _list *qlist
+-    cdef dict temp
+-    qlist = quantum_reduce_c(ht, int(maxrows), int(level))
+-    # The above call frees the memory associated with ht
+-    v_free(v1)
+-    v_free(v2)
+-
+-    cdef Parent P = quantum.parent()
+-    result = {}
+-    for i in range(qlist.length):
+-        tab = <hashtab*>(qlist.array[i])
+-        temp = sf_hashtab_to_dict(tab)
+-        for k in temp:
+-            result[k] = result.get(k, P.zero()) + quantum**i * temp[k]
+-        hash_free(tab)
+-    l_free(qlist)
+-    return result
+-
+-
+-def skew(outer, inner, maxrows=0):
++    result = lrcalc.mult_quantum(part1, part2, maxrows, level, degrees=True)
++    P = quantum.parent()
++    output = {}
++    for i,k in result.items():
++        la = _Partitions(i[0])
++        output[la] = output.get(la, P.zero()) + k * quantum**(i[1])
++    return output
++
++
++def skew(outer, inner, maxrows=-1):
+     """
+     Compute the Schur expansion of a skew Schur function.
+ 
+@@ -557,11 +360,9 @@ def skew(outer, inner, maxrows=0):
+ 
+     INPUT:
+ 
+-    - ``outer`` -- a partition.
+-
+-    - ``inner`` -- a partition.
+-
+-    - ``maxrows`` -- an integer or ``None``.
++    - ``outer`` -- a partition
++    - ``inner`` -- a partition
++    - ``maxrows`` -- an integer or ``None``
+ 
+     If ``maxrows`` is specified, then only partitions with at most
+     this number of rows are included in the result.
+@@ -572,14 +373,7 @@ def skew(outer, inner, maxrows=0):
+         sage: sorted(skew([2,1],[1]).items())
+         [([1, 1], 1), ([2], 1)]
+     """
+-    cdef vector* v1 = iterable_to_vector(outer)
+-    cdef vector* v2 = iterable_to_vector(inner)
+-    cdef hashtab* ht = skew_c(v1, v2, int(maxrows))
+-    result = sf_hashtab_to_dict(ht)
+-    v_free(v1)
+-    v_free(v2)
+-    hash_free(ht)
+-    return result
++    return _lrcalc_dict_to_sage(lrcalc.skew(outer, inner, maxrows))
+ 
+ 
+ def coprod(part, all=0):
+@@ -592,9 +386,8 @@ def coprod(part, all=0):
+ 
+     INPUT:
+ 
+-    - ``part`` -- a partition.
+-
+-    - ``all`` -- an integer.
++    - ``part`` -- a partition
++    - ``all`` -- an integer
+ 
+     If ``all`` is non-zero then all terms are included in the result.
+     If ``all`` is zero, then only pairs of partitions ``(part1,
+@@ -609,12 +402,9 @@ def coprod(part, all=0):
+         sage: sorted(coprod([2,1]).items())
+         [(([1, 1], [1]), 1), (([2], [1]), 1), (([2, 1], []), 1)]
+     """
+-    cdef vector* v1 = iterable_to_vector(part)
+-    cdef hashtab* ht = coprod_c(v1, int(all))
+-    result = vp_hashtab_to_dict(ht)
+-    v_free(v1)
+-    hash_free(ht)
+-    return result
++    result = lrcalc.coprod(part, all)
++    return {tuple([_Partitions(mu) for mu in la]): Integer(k)
++            for la, k in result.items()}
+ 
+ 
+ def mult_schubert(w1, w2, rank=0):
+@@ -627,11 +417,9 @@ def mult_schubert(w1, w2, rank=0):
+ 
+     INPUT:
+ 
+-    - ``w1`` -- a permutation.
+-
+-    - ``w2`` -- a permutation.
+-
+-    - ``rank`` -- an integer.
++    - ``w1`` -- a permutation
++    - ``w2`` -- a permutation
++    - ``rank`` -- an integer
+ 
+     If ``rank`` is non-zero, then only permutations from the symmetric
+     group `S(\mathrm{rank})` are included in the result.
+@@ -646,33 +434,24 @@ def mult_schubert(w1, w2, rank=0):
+          ([6, 4, 3, 1, 2, 5], 1), ([6, 5, 2, 1, 3, 4], 1),
+          ([7, 3, 4, 1, 2, 5, 6], 1), ([7, 4, 2, 1, 3, 5, 6], 1)]
+     """
+-    cdef vector* v1 = iterable_to_vector(w1)
+-    cdef vector* v2 = iterable_to_vector(w2)
+-    cdef hashtab* ht = mult_schubert_c(v1, v2, int(rank))
+-    result = schubert_hashtab_to_dict(ht)
+-    v_free(v1)
+-    v_free(v2)
+-    hash_free(ht)
+-    return result
++    result = lrcalc.schubmult(w1, w2, rank)
++    return {Permutation(list(la)):Integer(k) for la,k in result.items()}
+ 
+ 
+-def lrskew(outer, inner, weight=None, maxrows=0):
++def lrskew(outer, inner, weight=None, maxrows=-1):
+     r"""
+     Iterate over the skew LR tableaux of shape ``outer / inner``.
+ 
+     INPUT:
+ 
+     - ``outer`` -- a partition
+-
+     - ``inner`` -- a partition
+-
+     - ``weight`` -- a partition (optional)
+-
+-    - ``maxrows`` -- an integer (optional)
++    - ``maxrows`` -- a positive integer (optional)
+ 
+     OUTPUT: an iterator of :class:`SkewTableau`
+ 
+-    Specifying ``maxrows`` restricts the alphabet to `\{1,2,\ldots,maxrows\}`.
++    Specifying ``maxrows`` = `M` restricts the alphabet to `\{1,2,\ldots,M\}`.
+ 
+     Specifying ``weight`` returns only those tableaux of given content/weight.
+ 
+@@ -702,22 +481,40 @@ def lrskew(outer, inner, weight=None, maxrows=0):
+ 
+         sage: list(lrskew([3,2,1],[2], weight=[3,1]))
+         [[[None, None, 1], [1, 1], [2]]]
++
++    TESTS::
++
++        sage: from sage.libs.lrcalc.lrcalc import lrskew
++        sage: list(lrskew([3,2,1],[2], weight=[]))
++        []
++        sage: list(lrskew([3,2,1],[2], weight=[0]))
++        []
++        sage: list(lrskew([3,2,1],[3,2,1], weight=[]))
++        [[[None, None, None], [None, None], [None]]]
++        sage: list(lrskew([3,2,1],[3,2,1], weight=[0]))
++        [[[None, None, None], [None, None], [None]]]
++        sage: list(lrskew([3,2,1],[3,2,1], weight=[1]))
++        []
+     """
+-    cdef vector* o = iterable_to_vector(outer)
+-    cdef vector* i = iterable_to_vector(inner + [0]*(len(outer) - len(inner)))
+-    cdef skewtab* st = st_new(o, i, NULL, int(maxrows))
++    iterator = lrcalc.lr_iterator(outer, inner, maxrows)
++    shape = SkewPartition([outer, inner])
+ 
+     if weight is None:
+-        yield skewtab_to_SkewTableau(st)
+-        while st_next(st):
+-            yield skewtab_to_SkewTableau(st)
++        ST = SemistandardSkewTableaux(shape)
++        for data in iterator:
++            yield ST.from_shape_and_word(shape, [i+1 for i in data])
+     else:
+         wt = _Partitions(weight)
+-        r = skewtab_to_SkewTableau(st)
+-        if r.weight() == wt:
+-            yield r
+-        while st_next(st):
+-            r = skewtab_to_SkewTableau(st)
+-            if r.weight() == wt:
+-                yield r
+-    st_free(st)
++        ST = SemistandardSkewTableaux(shape, wt)
++        m = len(wt)
++        for data in iterator:
++            w = [0] * m
++            for j in data:
++                if j >= m:
++                    # We know they are not equal, so make the check below quick
++                    w = None
++                    break
++                w[j] += 1
++            if w == wt:
++                yield ST.from_shape_and_word(shape, [i+1 for i in data])
++
diff --git a/srcpkgs/sagemath/patches/trac-33170-fix_doctest_ipython_8.patch b/srcpkgs/sagemath/patches/trac-33170-fix_doctest_ipython_8.patch
new file mode 100644
index 000000000000..1e2e0ba90742
--- /dev/null
+++ b/srcpkgs/sagemath/patches/trac-33170-fix_doctest_ipython_8.patch
@@ -0,0 +1,40 @@
+As produced by `git diff a90a3146{^^,}`
+
+diff --git a/src/sage/repl/interface_magic.py b/src/sage/repl/interface_magic.py
+index 8a455b69b0e..a93e1c9e04c 100644
+--- a/src/sage/repl/interface_magic.py
++++ b/src/sage/repl/interface_magic.py
+@@ -260,7 +260,7 @@ class InterfaceMagic(object):
+             2
+             120
+             sage: shell.run_cell('%%gap foo\n1+1;\n')
+-            ...File "<string>", line unknown
++            ...File...<string>...
+             SyntaxError: Interface magics have no options, got "foo"
+             <BLANKLINE>
+             sage: shell.run_cell('%%gap?')
+diff --git a/src/sage/repl/interpreter.py b/src/sage/repl/interpreter.py
+index 7468afe52d7..06c47b7374a 100644
+--- a/src/sage/repl/interpreter.py
++++ b/src/sage/repl/interpreter.py
+@@ -78,9 +78,9 @@ Check that Cython source code appears in tracebacks::
+     dummy line
+     ...
+     ZeroDivisionError...Traceback (most recent call last)
+-    <ipython-input-...> in <module>...
++    ...in <module>...
+     ----> 1 Integer(1)/Integer(0)
+-    .../sage/rings/integer.pyx in sage.rings.integer.Integer...div...
++    .../sage/rings/integer.pyx... in sage.rings.integer.Integer...div...
+     ...
+     -> ...                  raise ZeroDivisionError("rational division by zero")
+        ....:            x = <Rational> Rational.__new__(Rational)
+@@ -423,7 +423,7 @@ def SagePreparseTransformer(lines):
+         sage: from sage.repl.interpreter import get_test_shell
+         sage: shell = get_test_shell()
+         sage: shell.run_cell(bad_syntax)
+-          File "<string>", line unknown
++          File...<string>...
+         SyntaxError: Mismatched ']'
+         <BLANKLINE>
+         sage: shell.quit()
diff --git a/srcpkgs/sagemath/patches/trac-33170b-fix_doctest_ipython_8.1.patch b/srcpkgs/sagemath/patches/trac-33170b-fix_doctest_ipython_8.1.patch
new file mode 100644
index 000000000000..853813b0f5bd
--- /dev/null
+++ b/srcpkgs/sagemath/patches/trac-33170b-fix_doctest_ipython_8.1.patch
@@ -0,0 +1,13 @@
+Fix for ipython 8.1
+
+--- a/src/sage/repl/interpreter.py
++++ b/src/sage/repl/interpreter.py
+@@ -78,7 +78,7 @@ Check that Cython source code appears in tracebacks::
+     dummy line
+     ...
+     ZeroDivisionError...Traceback (most recent call last)
+-    ...in <module>...
++    ...
+     ----> 1 Integer(1)/Integer(0)
+     .../sage/rings/integer.pyx... in sage.rings.integer.Integer...div...
+     ...
diff --git a/srcpkgs/sagemath/patches/trac-33336-fix_doctest_scipy_1.8.patch b/srcpkgs/sagemath/patches/trac-33336-fix_doctest_scipy_1.8.patch
new file mode 100644
index 000000000000..19b69700a4f6
--- /dev/null
+++ b/srcpkgs/sagemath/patches/trac-33336-fix_doctest_scipy_1.8.patch
@@ -0,0 +1,19 @@
+commit 9c8235e44ffb509efa8a3ca6cdb55154e2b5066d
+Author: Antonio Rojas <arojas@archlinux.org>
+Date:   Sun Feb 13 19:53:14 2022 +0100
+
+    Fix deprecation warning with scipy 1.8
+
+diff --git a/src/sage/tests/books/computational-mathematics-with-sagemath/linsolve_doctest.py b/src/sage/tests/books/computational-mathematics-with-sagemath/linsolve_doctest.py
+index e9b60dae5ec..7932167b41d 100644
+--- a/src/sage/tests/books/computational-mathematics-with-sagemath/linsolve_doctest.py
++++ b/src/sage/tests/books/computational-mathematics-with-sagemath/linsolve_doctest.py
+@@ -356,7 +356,7 @@ Sage example in ./linsolve.tex, line 2230::
+ 
+ Sage example in ./linsolve.tex, line 2609::
+ 
+-  sage: from scipy.sparse.linalg.dsolve import *
++  sage: from scipy.sparse.linalg import factorized
+   sage: from scipy.sparse import lil_matrix
+   sage: from numpy import array
+   sage: n = 200
diff --git a/srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-609dd9deaeaa6380ab2f0d50276d911233c00a04.patch b/srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-609dd9deaeaa6380ab2f0d50276d911233c00a04.patch
new file mode 100644
index 000000000000..9ba7ca5a6b7d
--- /dev/null
+++ b/srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-609dd9deaeaa6380ab2f0d50276d911233c00a04.patch
@@ -0,0 +1,99 @@
+From 609dd9deaeaa6380ab2f0d50276d911233c00a04 Mon Sep 17 00:00:00 2001
+From: Matthias Koeppe <mkoeppe@math.ucdavis.edu>
+Date: Fri, 4 Mar 2022 16:07:09 -0800
+Subject: sage.manifolds: Update doctests for SymPy 1.10
+
+---
+ src/sage/manifolds/continuous_map.py              | 3 +--
+ src/sage/manifolds/differentiable/diff_form.py    | 4 ++--
+ src/sage/manifolds/differentiable/tensorfield.py  | 8 ++++----
+ src/sage/manifolds/vector_bundle_fiber_element.py | 2 +-
+ 4 files changed, 8 insertions(+), 9 deletions(-)
+
+diff --git a/src/sage/manifolds/continuous_map.py b/src/sage/manifolds/continuous_map.py
+index a6356e7..f6f9b6d 100644
+--- a/src/sage/manifolds/continuous_map.py
++++ b/src/sage/manifolds/continuous_map.py
+@@ -1357,8 +1357,7 @@ class ContinuousMap(Morphism):
+             sage: Phi.coord_functions(c_uv, c_xyz)
+             Coordinate functions (u*v, u/v, u + v) on the Chart (M, (u, v))
+             sage: Phi.coord_functions(c_UV, c_xyz)
+-            Coordinate functions (-U**2/4 + V**2/4, -(U + V)/(U - V), V)
+-             on the Chart (M, (U, V))
++            Coordinate functions (-U**2/4 + V**2/4, (-U - V)/(U - V), V) on the Chart (M, (U, V))
+             sage: Phi.coord_functions(c_UV, c_XYZ)
+             Coordinate functions ((-U**3 + U**2*V + U*V**2 + 2*U*V + 6*U - V**3
+              - 2*V**2 + 6*V)/(2*(U - V)), (U**3/4 - U**2*V/4 - U*V**2/4 + U*V
+diff --git a/src/sage/manifolds/differentiable/diff_form.py b/src/sage/manifolds/differentiable/diff_form.py
+index 70dd8fb..0aa3469 100644
+--- a/src/sage/manifolds/differentiable/diff_form.py
++++ b/src/sage/manifolds/differentiable/diff_form.py
+@@ -266,7 +266,7 @@ class DiffForm(TensorField):
+ 
+         sage: s = a.wedge(b)
+         sage: s.display(eU)
+-        a∧b = -x*(2*x*y + 1) dx∧dy
++        a∧b = x*(-2*x*y - 1) dx∧dy
+         sage: s.display(eV)
+         a∧b = (u**3/8 + u**2*v/8 - u*v**2/8 + u/4 - v**3/8 + v/4) du∧dv
+ 
+@@ -275,7 +275,7 @@ class DiffForm(TensorField):
+         sage: f = M.scalar_field({c_xy: (x+y)^2, c_uv: u^2}, name='f')
+         sage: s = f*a
+         sage: s.display(eU)
+-        f*a = -y*(x**2 + 2*x*y + y**2) dx + x*(x**2 + 2*x*y + y**2) dy
++        f*a = y*(-x**2 - 2*x*y - y**2) dx + x*(x**2 + 2*x*y + y**2) dy
+         sage: s.display(eV)
+         f*a = u**2*v/2 du - u**3/2 dv
+ 
+diff --git a/src/sage/manifolds/differentiable/tensorfield.py b/src/sage/manifolds/differentiable/tensorfield.py
+index 2775be9..6bc5c50 100644
+--- a/src/sage/manifolds/differentiable/tensorfield.py
++++ b/src/sage/manifolds/differentiable/tensorfield.py
+@@ -334,7 +334,7 @@ class TensorField(ModuleElementWithMutability):
+         sage: f.display()  # long time
+         t(a,b): S^2 → ℝ
+         on U: (x, y) ↦ -2*x*y - 3*x - y**2
+-        on V: (u, v) ↦ -(3*u**3 + 3*u*v**2 + 2*u*v + v**2)/(u**4 + 2*u**2*v**2 + v**4)
++        on V: (u, v) ↦ (-3*u**3 - 3*u*v**2 - 2*u*v - v**2)/(u**4 + 2*u**2*v**2 + v**4)
+ 
+     The vectors can be defined only on subsets of `S^2`, the domain of the
+     result is then the common subset::
+@@ -343,12 +343,12 @@ class TensorField(ModuleElementWithMutability):
+         sage: s.display()  # long time
+         t(a,b): U → ℝ
+            (x, y) ↦ -2*x*y - 3*x - y**2
+-        on W: (u, v) ↦ -(3*u**3 + 3*u*v**2 + 2*u*v + v**2)/(u**4 + 2*u**2*v**2 + v**4)
++        on W: (u, v) ↦ (-3*u**3 - 3*u*v**2 - 2*u*v - v**2)/(u**4 + 2*u**2*v**2 + v**4)
+         sage: s = t(a.restrict(U), b.restrict(W))  # long time
+         sage: s.display()  # long time
+         t(a,b): W → ℝ
+            (x, y) ↦ -2*x*y - 3*x - y**2
+-           (u, v) ↦ -(3*u**3 + 3*u*v**2 + 2*u*v + v**2)/(u**4 + 2*u**2*v**2 + v**4)
++           (u, v) ↦ (-3*u**3 - 3*u*v**2 - 2*u*v - v**2)/(u**4 + 2*u**2*v**2 + v**4)
+ 
+     The tensor itself can be defined only on some open subset of `S^2`,
+     yielding a result whose domain is this subset::
+@@ -356,7 +356,7 @@ class TensorField(ModuleElementWithMutability):
+         sage: s = t.restrict(V)(a,b)  # long time
+         sage: s.display()  # long time
+         t(a,b): V → ℝ
+-           (u, v) ↦ -(3*u**3 + 3*u*v**2 + 2*u*v + v**2)/(u**4 + 2*u**2*v**2 + v**4)
++           (u, v) ↦ (-3*u**3 - 3*u*v**2 - 2*u*v - v**2)/(u**4 + 2*u**2*v**2 + v**4)
+         on W: (x, y) ↦ -2*x*y - 3*x - y**2
+ 
+     Tests regarding the multiplication by a scalar field::
+diff --git a/src/sage/manifolds/vector_bundle_fiber_element.py b/src/sage/manifolds/vector_bundle_fiber_element.py
+index 29ee81d..048275a 100644
+--- a/src/sage/manifolds/vector_bundle_fiber_element.py
++++ b/src/sage/manifolds/vector_bundle_fiber_element.py
+@@ -110,4 +110,4 @@ class VectorBundleFiberElement(FiniteRankFreeModuleElement):
+             desc += str(self._name) + " "
+         desc += "in the fiber of {} at {}".format(self._vbundle._name,
+                                                   self._point)
+-        return desc
+\ No newline at end of file
++        return desc
+-- 
+cgit v1.0-1-gd88e
+
diff --git a/srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-c49eff347454ac7f07e5918470b20e97b8f2357e.patch b/srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-c49eff347454ac7f07e5918470b20e97b8f2357e.patch
new file mode 100644
index 000000000000..f5ac180baa90
--- /dev/null
+++ b/srcpkgs/sagemath/patches/trac-33398-fix_doctest_sympy_1.10-c49eff347454ac7f07e5918470b20e97b8f2357e.patch
@@ -0,0 +1,29 @@
+From c49eff347454ac7f07e5918470b20e97b8f2357e Mon Sep 17 00:00:00 2001
+From: Matthias Koeppe <mkoeppe@math.ucdavis.edu>
+Date: Fri, 4 Mar 2022 15:14:43 -0800
+Subject: src/sage/calculus/calculus.py: Update laplace doctest for sympy 1.10
+
+---
+ src/sage/calculus/calculus.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/sage/calculus/calculus.py b/src/sage/calculus/calculus.py
+index 9c2f226..b335093 100644
+--- a/src/sage/calculus/calculus.py
++++ b/src/sage/calculus/calculus.py
+@@ -1639,9 +1639,9 @@ def laplace(ex, t, s, algorithm='maxima'):
+         sage: laplace(dirac_delta(t), t, s)
+         1
+         sage: F, a, cond = laplace(dirac_delta(t), t, s, algorithm='sympy')
+-        sage: a, cond
+-        (-oo, True)
+-        sage: F       # random - sympy <1.9 includes undefined heaviside(0) in answer
++        sage: a, cond  # random - sympy <1.10 gives (-oo, True)
++        (0, True)
++        sage: F        # random - sympy <1.9 includes undefined heaviside(0) in answer
+         1
+         sage: laplace(dirac_delta(t), t, s, algorithm='giac')
+         1
+-- 
+cgit v1.0-1-gd88e
+
diff --git a/srcpkgs/sagemath/patches/trac-33585-fix_doctest_sphinx_installed-a04a0a0b14f67f4804e7113c3db41bbcf8a58296.patch b/srcpkgs/sagemath/patches/trac-33585-fix_doctest_sphinx_installed-a04a0a0b14f67f4804e7113c3db41bbcf8a58296.patch
new file mode 100644
index 000000000000..8e7bb64f5b01
--- /dev/null
+++ b/srcpkgs/sagemath/patches/trac-33585-fix_doctest_sphinx_installed-a04a0a0b14f67f4804e7113c3db41bbcf8a58296.patch
@@ -0,0 +1,26 @@
+From a04a0a0b14f67f4804e7113c3db41bbcf8a58296 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
+Date: Mon, 28 Mar 2022 20:39:59 -0300
+Subject: Trac #33585: fix doctest when dochtml is missing...
+
+...but sphinx is available in PYTHONPATH.
+---
+ src/sage/misc/sagedoc.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/sage/misc/sagedoc.py b/src/sage/misc/sagedoc.py
+index 4b3853f..08c4225 100644
+--- a/src/sage/misc/sagedoc.py
++++ b/src/sage/misc/sagedoc.py
+@@ -1401,7 +1401,7 @@ class _sage_doc:
+             "...**File:**...**Type:**...**Definition:** identity_matrix..."
+             sage: identity_matrix.__doc__ in browse_sage_doc(identity_matrix, 'rst')
+             True
+-            sage: browse_sage_doc(identity_matrix, 'html', False)             # optional - sphinx
++            sage: browse_sage_doc(identity_matrix, 'html', False)             # optional - sphinx sagemath_doc_html
+             '...div...File:...Type:...Definition:...identity_matrix...'
+ 
+         In the 'text' version, double colons have been replaced with
+-- 
+cgit v1.0-1-gd88e
+
diff --git a/srcpkgs/sagemath/patches/zzz-skip_doctest_no_threejs.patch b/srcpkgs/sagemath/patches/zzz-skip_doctest_no_threejs.patch
deleted file mode 100644
index 5cb62f56e902..000000000000
--- a/srcpkgs/sagemath/patches/zzz-skip_doctest_no_threejs.patch
+++ /dev/null
@@ -1,13 +0,0 @@
- - we don't have threejs in void
-
---- a/src/sage/repl/ipython_kernel/install.py
-+++ b/src/sage/repl/ipython_kernel/install.py
-@@ -124,7 +124,7 @@ class SageKernelSpec(object):
-             sage: spec = SageKernelSpec(prefix=tmp_dir())
-             sage: spec.use_local_threejs()
-             sage: threejs = os.path.join(spec.nbextensions_dir, 'threejs-sage')
--            sage: os.path.isdir(threejs)
-+            sage: os.path.isdir(threejs)    # optional - threejs
-             True
-         """
-         src = THREEJS_DIR
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 710a9e80c052..0d793262d572 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
 version=9.5
-revision=1
+revision=2
 wrksrc=sage-$version
 build_wrksrc=pkgs/sagemath-standard
 build_style=python3-module
@@ -12,7 +12,7 @@ hostmakedepends="m4 pkg-config python3-Cython python3-Jinja2 python3-pkgconfig
 makedepends="arb-devel boost-devel brial-devel cliquer-devel ecl eclib-devel
  ecm-devel fflas-ffpack flintlib-devel gap-devel gd-devel giac-devel glpk-devel
  gsl-devel iml-devel lcalc-devel libbraiding-devel libhomfly-devel libmpc-devel
- libpng-devel linbox-devel lrcalc-devel m4ri-devel m4rie-devel mpfi-devel
+ libpng-devel linbox-devel m4ri-devel m4rie-devel mpfi-devel
  mpfr-devel ntl-devel openblas-devel pari-devel planarity-devel python3-cypari2
  python3-cysignals python3-devel python3-gmpy2 python3-memory_allocator
  python3-numpy rankwidth-devel singular symmetrica-devel zn_poly"
@@ -20,13 +20,13 @@ depends="FlintQS eclib-devel fflas-ffpack flintlib-devel gcc-fortran gd-devel
  gfan giac gsl-devel gzip libpng-devel linbox-devel m4ri-devel maxima-ecl
  mpfr-devel nauty ntl-devel palp pari-devel pari-elldata-small pari-galdata
  pari-galpol-small pari-seadata-small pkg-config python3-Cython python3-cypari2
- python3-cysignals python3-devel python3-fpylll python3-ipython
+ python3-cysignals python3-devel python3-fpylll python3-ipython python3-lrcalc
  python3-ipython_ipykernel python3-jupyter_ipywidgets python3-matplotlib
  python3-memory_allocator python3-networkx python3-pip python3-pkgconfig
  python3-pplpy python3-primecountpy python3-requests python3-scipy
  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"
+ sage-data-polytopes_db sympow tachyon threejs-sage"
 checkdepends="$depends"
 short_desc="Open source mathematics software"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
@@ -55,6 +55,7 @@ do_configure() {
 	COMBINATORIAL_DESIGN_DATA_DIR = "/usr/share/sagemath/combinatorial_designs"
 	CREMONA_MINI_DATA_DIR = "/usr/share/sagemath/cremona"
 	CREMONA_LARGE_DATA_DIR = "/usr/share/sagemath/cremona"
+	THREEJS_DIR = "/usr/share/sagemath/threejs-sage"
 	EOF
 
 	# don't install sage-venv-config: it is used to set SAGE_VENV=/usr and

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

* Re: sagemath-9.5: package updates and fixes
  2022-03-30 13:55 [PR PATCH] sagemath-9.5: package updates and fixes tornaria
                   ` (6 preceding siblings ...)
  2022-04-03 15:24 ` tornaria
@ 2022-04-04  1:24 ` tornaria
  2022-04-04 20:22 ` [PR PATCH] [Merged]: " leahneukirchen
  2022-04-09  0:25 ` Duncaen
  9 siblings, 0 replies; 11+ messages in thread
From: tornaria @ 2022-04-04  1:24 UTC (permalink / raw)
  To: ml

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

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/36420#issuecomment-1087015295

Comment:
@leahneukirchen this is now ready to merge, it is an improvement over 9.5_1 on a few counts:
 - better compatibility with some python packages that were upgraded in void (ipython, scipy, sympy, sphinx)
 - upgrade lrcalc to 2.1 which is required by current betas of 9.6 and will be needed when we get around to release 9.6
 - enable 3d plots via new pkg threejs-sage (this feature was missing before).

Other upgrades (e.g. #36423) can be done later independently, in principle it shouldn't be necessary to change the sagemath pkg again until the release of 9.6.

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

* Re: [PR PATCH] [Merged]: sagemath-9.5: package updates and fixes
  2022-03-30 13:55 [PR PATCH] sagemath-9.5: package updates and fixes tornaria
                   ` (7 preceding siblings ...)
  2022-04-04  1:24 ` tornaria
@ 2022-04-04 20:22 ` leahneukirchen
  2022-04-09  0:25 ` Duncaen
  9 siblings, 0 replies; 11+ messages in thread
From: leahneukirchen @ 2022-04-04 20:22 UTC (permalink / raw)
  To: ml

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

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

sagemath-9.5: package updates and fixes
https://github.com/void-linux/void-packages/pull/36420

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

This includes
 - upgrade to lrcalc-2.1 (from #36209)
 -  _already merged_ ~upgrade to sympy-1.10.1 (from #36397)~
 - _postponed_ ~upgrade to SuiteSparse-5.11.0, igraph-0.9.7, planarity-3.0.2.0, python3-cvxopt-1.3.0 (from #36423)~
 - _already merged_ ~upgrade to giac-1.7.0.53 (from #36421)~
 - _already merged_ ~upgrade to gp2c-0.0.12pl1 (from #36422)~
 - new package threejs-sage for 3d plots (#36504)
 - backported fixes for sagemath-9.5 to accomodate these upgrades, and also ipython and scipy upgrades which are already merged

~I want to see if the CI can cope with this. Otherwise I'll just split this in a few separate PR. Except for the upgrade to lrcalc-2.1, which must be coordinated with sage, everything else can be handled separately.~

cc: @dkwo

EDIT: I ended up making 3 new PR to handle the packages that can be upgraded separately from sagemath (#36397, #36421, #36422, #36423 should be ok to merge if CI passes).

EDIT 2: this PR is now just to upgrade lrcalc to 2.1 (will be needed for sagemath-9.6) and fix sagemath-9.5 so it works with lrcalc 2.1 (and several minor doctest fixes for upgrades to ipython, scipy, sympy).

EDIT 3: rebased on top of #36504 (new package threejs-sage) and fix sagemath config to use it, now 3d plots work

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

* Re: sagemath-9.5: package updates and fixes
  2022-03-30 13:55 [PR PATCH] sagemath-9.5: package updates and fixes tornaria
                   ` (8 preceding siblings ...)
  2022-04-04 20:22 ` [PR PATCH] [Merged]: " leahneukirchen
@ 2022-04-09  0:25 ` Duncaen
  9 siblings, 0 replies; 11+ messages in thread
From: Duncaen @ 2022-04-09  0:25 UTC (permalink / raw)
  To: ml

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

New comment by Duncaen on void-packages repository

https://github.com/void-linux/void-packages/pull/36420#issuecomment-1093517776

Comment:
I don't think adding ignore patterns to the git repository for random versions you deem unsuitable is a good idea, just don't update them, no need to litter the history with versions that are never applied.

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

end of thread, other threads:[~2022-04-09  0:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-30 13:55 [PR PATCH] sagemath-9.5: package updates and fixes tornaria
2022-03-30 14:48 ` dkwo
2022-04-01 16:07 ` Eloitor
2022-04-01 16:20 ` tornaria
2022-04-01 16:29 ` Eloitor
2022-04-01 16:46 ` dkwo
2022-04-01 19:57 ` [PR PATCH] [Updated] " tornaria
2022-04-03 15:24 ` tornaria
2022-04-04  1:24 ` tornaria
2022-04-04 20:22 ` [PR PATCH] [Merged]: " leahneukirchen
2022-04-09  0:25 ` Duncaen

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).