From 4950a4b1af717fd7889fb615437397fdc50d0144 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Mon, 30 Jan 2023 11:04:46 -0300 Subject: [PATCH 1/2] brial: update to 1.2.12. --- srcpkgs/brial/template | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/srcpkgs/brial/template b/srcpkgs/brial/template index 8f988c1296c6..2f8e195a8804 100644 --- a/srcpkgs/brial/template +++ b/srcpkgs/brial/template @@ -1,6 +1,6 @@ # Template file for 'brial' pkgname=brial -version=1.2.11 +version=1.2.12 revision=1 build_style=gnu-configure hostmakedepends="pkg-config" @@ -9,8 +9,9 @@ short_desc="BRiAl (Boolean Ring Algebra) is the successor to PolyBoRi" maintainer="Gonzalo Tornaría " license="GPL-2.0-or-later" homepage="https://github.com/BRiAl/BRiAl" +changelog="https://github.com/BRiAl/BRiAl/releases" distfiles="https://github.com/BRiAl/BRiAl/releases/download/$version/brial-$version.tar.bz2" -checksum=6c0f622009dcd9928295d748226baa9cdc1a87c32552e13772fddf95bbb6f02c +checksum=ca009e3722dd3f0a60d15501caed1413146c80abced57423e32ae0116f407494 if [ -n "$CROSS_BUILD" ]; then configure_args+=" --with-boost-unit-test-framework=no" From 679fc510689f744a977ecb3c9a761f456684beb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Thu, 2 Feb 2023 19:03:34 -0300 Subject: [PATCH 2/2] sagemath: rebuild for updates Also: - rebuild for boost update in sync with brial (same PR) - fixes for numpy 1.24 (already updated) - fixes to support updating giac to 1.9.0.37 - fixes to support updating tachyon 0.99.5 - fix an edge case of python 3.11 integer conversion on 32 bit - tarball was moved; sha256 changed only b/c of main dirname change --- ...4623a4b7404f5e4f9d152366d53e9c21cfa6.patch | 75 ++++++++++++++++++ .../patches/trac-34816-numpy_1.24.patch | 76 +++++++++++++++++++ ...c3c9be2ca04e799fa6baf4ad09f21ed6eb91.patch | 65 ++++++++++++++++ .../zz-fix_edge_case_of_integer_check.patch | 38 ++++++++++ srcpkgs/sagemath/template | 6 +- srcpkgs/sagemath/update | 2 + 6 files changed, 259 insertions(+), 3 deletions(-) create mode 100644 srcpkgs/sagemath/patches/trac-23712-support_tachyon_0.99.2-55c04623a4b7404f5e4f9d152366d53e9c21cfa6.patch create mode 100644 srcpkgs/sagemath/patches/trac-34816-numpy_1.24.patch create mode 100644 srcpkgs/sagemath/patches/trac-34926-fix_tests_with_giac_1.9.0.35-3c98c3c9be2ca04e799fa6baf4ad09f21ed6eb91.patch create mode 100644 srcpkgs/sagemath/patches/zz-fix_edge_case_of_integer_check.patch create mode 100644 srcpkgs/sagemath/update diff --git a/srcpkgs/sagemath/patches/trac-23712-support_tachyon_0.99.2-55c04623a4b7404f5e4f9d152366d53e9c21cfa6.patch b/srcpkgs/sagemath/patches/trac-23712-support_tachyon_0.99.2-55c04623a4b7404f5e4f9d152366d53e9c21cfa6.patch new file mode 100644 index 000000000000..77c0dcb9a95b --- /dev/null +++ b/srcpkgs/sagemath/patches/trac-23712-support_tachyon_0.99.2-55c04623a4b7404f5e4f9d152366d53e9c21cfa6.patch @@ -0,0 +1,75 @@ +From 55c04623a4b7404f5e4f9d152366d53e9c21cfa6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= +Date: Wed, 21 Dec 2022 19:43:02 -0300 +Subject: Trac #23712: support tachyon >= 0.99.2 + +In tachyon 0.99.2 the keyword `focallength` was changed to `focaldist`. +To support it, when running on version >= 0.99.2 we "patch" the model as +constructed by class `sage.plot.plot3d.tachyon.Tachyon`. + +In the future (possibly when tachyon in sage gets upgraded), all the +focallength occurences in sage.plot.plot3d.tachyon can be replaced by +focaldist for consistency with new tachyon, and the logic here can be +reversed (i.e. patch the model when self.version() < '0.99.2') or just +drop support for old versions. +--- + src/sage/interfaces/tachyon.py | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +diff --git a/src/sage/interfaces/tachyon.py b/src/sage/interfaces/tachyon.py +index 23671e5..21cc1db 100644 +--- a/src/sage/interfaces/tachyon.py ++++ b/src/sage/interfaces/tachyon.py +@@ -683,12 +683,14 @@ properly. + #***************************************************************************** + + import os ++import re + + from sage.cpython.string import bytes_to_str + from sage.misc.pager import pager + from sage.misc.superseded import deprecation + from sage.misc.temporary_file import tmp_filename + from sage.structure.sage_object import SageObject ++from sage.misc.cachefunc import cached_method + + + class TachyonRT(SageObject): +@@ -799,6 +801,11 @@ class TachyonRT(SageObject): + Parser failed due to an input file syntax error. + Aborting render. + """ ++ if self.version() >= '0.99.2': ++ # this keyword was changed in 0.99.2 ++ model = model.replace( ++ " focallength ", ++ " focaldist ") + modelfile = tmp_filename(ext='.dat') + with open(modelfile, 'w') as file: + file.write(model) +@@ -851,6 +858,22 @@ class TachyonRT(SageObject): + else: + print(r) + ++ @cached_method ++ def version(self): ++ """ ++ Returns the version of the Tachyon raytracer being used. ++ ++ TESTS:: ++ ++ sage: tachyon_rt.version() # not tested ++ 0.98.9 ++ sage: tachyon_rt.version() >= '0.98.9' ++ True ++ """ ++ with os.popen('tachyon') as f: ++ r = f.read() ++ return re.search(r"Version ([\d.]*)", r)[1] ++ + def help(self, use_pager=True): + """ + Deprecated: type 'sage.interfaces.tachyon?' for help +-- +cgit v1.0-1-gd88e + diff --git a/srcpkgs/sagemath/patches/trac-34816-numpy_1.24.patch b/srcpkgs/sagemath/patches/trac-34816-numpy_1.24.patch new file mode 100644 index 000000000000..5fbab81ebcde --- /dev/null +++ b/srcpkgs/sagemath/patches/trac-34816-numpy_1.24.patch @@ -0,0 +1,76 @@ +commit 1f22dea27235eeb7dd74cab2cee60cffa55fff2a +Author: Gonzalo Tornaría +Date: Wed Jan 4 22:16:32 2023 -0300 + + complex_plot: fix plot of undefined values + + Undefined values would get some random color. + Rreplace all undefined values by white. + + In numpy 1.24 this avoids a runtime warning (cast of nan to uint8). + +diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx +index 6f0aeab87ae..b77c69b2f77 100644 +--- a/src/sage/plot/complex_plot.pyx ++++ b/src/sage/plot/complex_plot.pyx +@@ -461,6 +461,8 @@ def complex_to_rgb(z_values, contoured=False, tiled=False, + rgb[i, j, 2] = b + + sig_off() ++ nan_indices = np.isnan(rgb).any(-1) # Mask for undefined points ++ rgb[nan_indices] = 1 # Make nan_indices white + return rgb + + + +commit c57458d245f9e24c0283d72d5b97ace0ff011fd6 +Author: Gonzalo Tornaría +Date: Wed Jan 4 20:25:15 2023 -0300 + + doctest: fixes for numpy 1.24 + +diff --git a/src/sage/misc/persist.pyx b/src/sage/misc/persist.pyx +index 3ac5f1cc2b0..cb1f327c199 100644 +--- a/src/sage/misc/persist.pyx ++++ b/src/sage/misc/persist.pyx +@@ -157,7 +157,7 @@ def load(*filename, compress=True, verbose=True, **kwargs): + ....: _ = f.write(code) + sage: load(t) + sage: hello +- ++ + """ + import sage.repl.load + if len(filename) != 1: +diff --git a/src/sage/plot/histogram.py b/src/sage/plot/histogram.py +index 3bc2b76b58e..388c2d1391d 100644 +--- a/src/sage/plot/histogram.py ++++ b/src/sage/plot/histogram.py +@@ -87,13 +87,8 @@ class Histogram(GraphicPrimitive): + + TESTS:: + +- sage: h = histogram([10,3,5], normed=True)[0] +- doctest:warning...: +- DeprecationWarning: the 'normed' option is deprecated. Use 'density' instead. +- See https://trac.sagemath.org/25260 for details. ++ sage: h = histogram([10,3,5], density=True)[0] + sage: h.get_minmax_data() +- doctest:warning ... +- ...VisibleDeprecationWarning: Passing `normed=True` on non-uniform bins has always been broken, and computes neither the probability density function nor the probability mass function. The result is only correct if the bins are uniform, when density=True will produce the same result anyway. The argument will be removed in a future version of numpy. + {'xmax': 10.0, 'xmin': 3.0, 'ymax': 0.476190476190..., 'ymin': 0} + """ + import numpy +diff --git a/src/sage/repl/ipython_extension.py b/src/sage/repl/ipython_extension.py +index 798671aab42..cad6a47ca8b 100644 +--- a/src/sage/repl/ipython_extension.py ++++ b/src/sage/repl/ipython_extension.py +@@ -405,7 +405,7 @@ class SageMagics(Magics): + ....: C END FILE FIB1.F + ....: ''') + sage: fib +- ++ + sage: from numpy import array + sage: a = array(range(10), dtype=float) + sage: fib(a, 10) diff --git a/srcpkgs/sagemath/patches/trac-34926-fix_tests_with_giac_1.9.0.35-3c98c3c9be2ca04e799fa6baf4ad09f21ed6eb91.patch b/srcpkgs/sagemath/patches/trac-34926-fix_tests_with_giac_1.9.0.35-3c98c3c9be2ca04e799fa6baf4ad09f21ed6eb91.patch new file mode 100644 index 000000000000..7b072e2ba18e --- /dev/null +++ b/srcpkgs/sagemath/patches/trac-34926-fix_tests_with_giac_1.9.0.35-3c98c3c9be2ca04e799fa6baf4ad09f21ed6eb91.patch @@ -0,0 +1,65 @@ +From f28961e88271c6685f9d7e4697f36affe3bbe65c Mon Sep 17 00:00:00 2001 +From: Antonio Rojas +Date: Fri, 20 Jan 2023 21:36:27 +0100 +Subject: Fix tests with giac 1.9.0.35 + +--- + src/sage/libs/giac/giac.pyx | 3 +-- + src/sage/symbolic/relation.py | 15 +++++---------- + 2 files changed, 6 insertions(+), 12 deletions(-) + +diff --git a/src/sage/libs/giac/giac.pyx b/src/sage/libs/giac/giac.pyx +index 4e451db..ccad516 100644 +--- a/src/sage/libs/giac/giac.pyx ++++ b/src/sage/libs/giac/giac.pyx +@@ -374,8 +374,7 @@ def _giac(s): + + sage: x = libgiac('x') + sage: (1+2*sin(3*x)).solve(x).simplify() +- Warning, argument is not an equation, solving 1+2*sin(3*x)=0 +- list[-pi/18,7*pi/18] ++ ...list[-pi/18,7*pi/18] + + sage: libgiac.solve('sin(3*x)>2*sin(x)',x) + Traceback (most recent call last): +diff --git a/src/sage/symbolic/relation.py b/src/sage/symbolic/relation.py +index e9dbc0f..b8896a9 100644 +--- a/src/sage/symbolic/relation.py ++++ b/src/sage/symbolic/relation.py +@@ -935,8 +935,7 @@ def solve(f, *args, **kwds): + + sage: f = (sin(x) - 8*cos(x)*sin(x))*(sin(x)^2 + cos(x)) - (2*cos(x)*sin(x) - sin(x))*(-2*sin(x)^2 + 2*cos(x)^2 - cos(x)) + sage: solve(f, x, algorithm='giac') +- ... +- [-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi] ++ ...[-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi] + + sage: x, y = SR.var('x,y') + sage: solve([x+y-4,x*y-3],[x,y],algorithm='giac') +@@ -1440,19 +1439,15 @@ def _giac_solver(f, x, solution_dict=False): + EXAMPLES:: + + sage: solve([(2/3)^x-2], [x], algorithm='giac') +- ... +- [[-log(2)/(log(3) - log(2))]] ++ ...[[-log(2)/(log(3) - log(2))]] + sage: solve([(2/3)^x-2], [x], algorithm='giac', solution_dict=True) +- ... +- [{x: -log(2)/(log(3) - log(2))}] ++ ...[{x: -log(2)/(log(3) - log(2))}] + + sage: f = (sin(x) - 8*cos(x)*sin(x))*(sin(x)^2 + cos(x)) - (2*cos(x)*sin(x) - sin(x))*(-2*sin(x)^2 + 2*cos(x)^2 - cos(x)) + sage: solve(f, x, algorithm='giac') +- ... +- [-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi] ++ ...[-2*arctan(sqrt(2)), 0, 2*arctan(sqrt(2)), pi] + sage: solve(f, x, algorithm='giac', solution_dict=True) +- ... +- [{x: -2*arctan(sqrt(2))}, {x: 0}, {x: 2*arctan(sqrt(2))}, {x: pi}] ++ ...[{x: -2*arctan(sqrt(2))}, {x: 0}, {x: 2*arctan(sqrt(2))}, {x: pi}] + + sage: x, y = SR.var('x,y') + sage: solve([x+y-7,x*y-10],[x,y],algorithm='giac') +-- +cgit v1.0-1-gd88e + diff --git a/srcpkgs/sagemath/patches/zz-fix_edge_case_of_integer_check.patch b/srcpkgs/sagemath/patches/zz-fix_edge_case_of_integer_check.patch new file mode 100644 index 000000000000..384d73283a2e --- /dev/null +++ b/srcpkgs/sagemath/patches/zz-fix_edge_case_of_integer_check.patch @@ -0,0 +1,38 @@ +commit d95ccbdc02a63124bd5dd2743a2356c6f873c5b4 +Author: Gonzalo Tornaría +Date: Wed Jan 4 20:21:51 2023 -0300 + + sage.arith.long: fix edge case of integer_check_py + +diff --git a/src/sage/arith/long.pxd b/src/sage/arith/long.pxd +index 1c9a53387a0..16d13512f68 100644 +--- a/src/sage/arith/long.pxd ++++ b/src/sage/arith/long.pxd +@@ -270,6 +270,17 @@ cdef inline bint integer_check_long_py(x, long* value, int* err): + sage: L += [-x for x in L] + [0, long_min()] + sage: for v in L: + ....: assert check_long_py(int(v)) == v ++ sage: check_long_py(int(2^60)) ++ 1152921504606846976 # 64-bit ++ 'Overflow (...)' # 32-bit ++ sage: check_long_py(int(2^61)) ++ 2305843009213693952 # 64-bit ++ 'Overflow (...)' # 32-bit ++ sage: check_long_py(int(2^62)) ++ 4611686018427387904 # 64-bit ++ 'Overflow (...)' # 32-bit ++ sage: check_long_py(int(2^63)) ++ 'Overflow (...)' + sage: check_long_py(int(2^100)) + 'Overflow (...)' + sage: check_long_py(int(long_max() + 1)) +@@ -310,6 +321,9 @@ cdef inline bint integer_check_long_py(x, long* value, int* err): + cdef long lead + cdef long lead_2_overflow = (1) << (BITS_IN_LONG - PyLong_SHIFT) + cdef long lead_3_overflow = (1) << (BITS_IN_LONG - 2 * PyLong_SHIFT) ++ if BITS_IN_LONG < 2 * PyLong_SHIFT: ++ # in this case 3 digit is always overflow ++ lead_3_overflow = 0 + if size == 0: + value[0] = 0 + err[0] = 0 diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template index 74445c3aa8c1..c5af07ee73a9 100644 --- a/srcpkgs/sagemath/template +++ b/srcpkgs/sagemath/template @@ -1,7 +1,7 @@ # Template file for 'sagemath' pkgname=sagemath version=9.7 -revision=4 +revision=5 build_wrksrc=pkgs/sagemath-standard build_style=python3-module _bindir=/usr/lib/sagemath/$version/bin @@ -31,8 +31,8 @@ short_desc="Open source mathematics software" maintainer="Gonzalo Tornaría " license="GPL-2.0-or-later" homepage="http://sagemath.org/" -distfiles="https://github.com/sagemath/sage/archive/refs/tags/$version.tar.gz" -checksum=9f26f14aa322e3cf38a71835b12ac34b23026b467f74d54b064c5d025e76fbfd +distfiles="https://github.com/sagemath/sage-archive-2023-02-01/archive/refs/tags/$version.tar.gz" +checksum=7c09f0ab84fa44380146cf1305b9c0e8ec7aea86d975259ca264be6798202bde do_configure() { # git tree needs bootstrapping diff --git a/srcpkgs/sagemath/update b/srcpkgs/sagemath/update new file mode 100644 index 000000000000..68be3c5752d0 --- /dev/null +++ b/srcpkgs/sagemath/update @@ -0,0 +1,2 @@ +pkgname="sage" +site="https://mirrors.mit.edu/sage/src/index.html"