From 5d8e4da91f1711acc64209ca53dd1631f251f257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Sat, 9 Sep 2023 21:26:04 -0300 Subject: [PATCH] sagemath: patch and rebuild for ecl-23.9.9 Also add a patch to support matplotlib 3.8.0 --- .../sagemath/patches/36006-gmp_6.3.0.patch | 2 +- .../sagemath/patches/36235-ecl_23.9.9.patch | 39 +++++++++++++++++++ .../patches/36279-matplotlib_3.8.0.patch | 24 ++++++++++++ srcpkgs/sagemath/patches/get_patches | 10 ++++- srcpkgs/sagemath/template | 2 +- 5 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 srcpkgs/sagemath/patches/36235-ecl_23.9.9.patch create mode 100644 srcpkgs/sagemath/patches/36279-matplotlib_3.8.0.patch diff --git a/srcpkgs/sagemath/patches/36006-gmp_6.3.0.patch b/srcpkgs/sagemath/patches/36006-gmp_6.3.0.patch index 91a77de3429..6a35ec38365 100644 --- a/srcpkgs/sagemath/patches/36006-gmp_6.3.0.patch +++ b/srcpkgs/sagemath/patches/36006-gmp_6.3.0.patch @@ -24,7 +24,7 @@ index 1de6dedab82..b95130b19dd 100644 AUTHORS: diff --git a/src/sage/rings/integer.pyx b/src/sage/rings/integer.pyx -index 2cd080ddafa..090ab59cb28 100644 +index d5e87626d31..37ed9364845 100644 --- a/src/sage/rings/integer.pyx +++ b/src/sage/rings/integer.pyx @@ -6654,7 +6654,7 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement): diff --git a/srcpkgs/sagemath/patches/36235-ecl_23.9.9.patch b/srcpkgs/sagemath/patches/36235-ecl_23.9.9.patch new file mode 100644 index 00000000000..684b62affaf --- /dev/null +++ b/srcpkgs/sagemath/patches/36235-ecl_23.9.9.patch @@ -0,0 +1,39 @@ +diff --git a/src/sage/libs/ecl.pyx b/src/sage/libs/ecl.pyx +index 8f46570313d..a8e73e57b52 100644 +--- a/src/sage/libs/ecl.pyx ++++ b/src/sage/libs/ecl.pyx +@@ -563,15 +563,15 @@ cdef class EclObject: + Floats in Python are IEEE double, which LISP has as well. However, + the printing of floating point types in LISP depends on settings:: + +- sage: a = EclObject(float(10^40)) ++ sage: a = EclObject(float(1.234e40)) + sage: ecl_eval("(setf *read-default-float-format* 'single-float)") + + sage: a +- ++ + sage: ecl_eval("(setf *read-default-float-format* 'double-float)") + + sage: a +- ++ + + Tuples are translated to dotted lists:: + +diff --git a/src/sage/libs/eclsig.h b/src/sage/libs/eclsig.h +index e249ccf6874..005b2d99d0b 100644 +--- a/src/sage/libs/eclsig.h ++++ b/src/sage/libs/eclsig.h +@@ -45,7 +45,11 @@ static inline void ecl_sig_off(void) + sig_off(); + } + ++#if ECL_VERSION_NUMBER < 230909 + #define ecl_mpz_from_bignum(obj) ((obj)->big.big_num) ++#else ++#define ecl_mpz_from_bignum(obj) ecl_bignum(obj) ++#endif + + cl_object ecl_bignum_from_mpz(mpz_t num) + { diff --git a/srcpkgs/sagemath/patches/36279-matplotlib_3.8.0.patch b/srcpkgs/sagemath/patches/36279-matplotlib_3.8.0.patch new file mode 100644 index 00000000000..e858f2fd4a4 --- /dev/null +++ b/srcpkgs/sagemath/patches/36279-matplotlib_3.8.0.patch @@ -0,0 +1,24 @@ +diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py +index 59f10f6b13f..adcccff059b 100644 +--- a/src/sage/plot/graphics.py ++++ b/src/sage/plot/graphics.py +@@ -36,6 +36,7 @@ + # **************************************************************************** + + import os ++from numbers import Integral + from collections.abc import Iterable + from math import isnan + import sage.misc.verbose +@@ -2874,6 +2875,11 @@ def matplotlib(self, filename=None, + weight=lopts.pop('font_weight', 'medium'), + variant=lopts.pop('font_variant', 'normal')) + color = lopts.pop('back_color', 'white') ++ if 'loc' in lopts: ++ loc = lopts['loc'] ++ if isinstance(loc, Integral): ++ # matplotlib 3.8 doesn't support sage integers ++ lopts['loc'] = int(loc) + leg = subplot.legend(prop=prop, **lopts) + if leg is None: + from warnings import warn diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches index c2c5aa1c7ec..836d5bf7098 100755 --- a/srcpkgs/sagemath/patches/get_patches +++ b/srcpkgs/sagemath/patches/get_patches @@ -24,6 +24,14 @@ cd $(dirname "$0") #get_pr 36018 "singular 4.3.2p4" # included in #35934 get_pr 36046 "fix memory leak" -# positive review +# merged in 10.2.beta1 get_pr 35934 "singular 4.3.2p7" + +# merged in 10.2.beta2 get_pr 36006 "gmp 6.3.0" + +# merged in 10.2.beta3 +get_pr 36235 "ecl 23.9.9" + +# positive review +get_pr 36279 "matplotlib 3.8.0" diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template index 019ad37cb3a..e180eda47d3 100644 --- a/srcpkgs/sagemath/template +++ b/srcpkgs/sagemath/template @@ -1,7 +1,7 @@ # Template file for 'sagemath' pkgname=sagemath version=10.1 -revision=2 +revision=3 build_wrksrc=pkgs/sagemath-standard build_style=python3-module _bindir=/usr/lib/sagemath/$version/bin