Github messages for voidlinux
 help / color / mirror / Atom feed
From: tornaria <tornaria@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] Sagemath
Date: Thu, 02 Feb 2023 23:54:17 +0100	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-42048@inbox.vuxu.org> (raw)

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

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

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

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

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

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

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


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

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

From 4950a4b1af717fd7889fb615437397fdc50d0144 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
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 <tornaria@cmat.edu.uy>"
 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 9a3c730c67b4c30c3ec470c66b7129281ae0ead2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
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
---
 ...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                     |  2 +-
 srcpkgs/sagemath/update                       |  2 +
 6 files changed, 257 insertions(+), 1 deletion(-)
 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?= <tornaria@cmat.edu.uy>
+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 <tornaria@cmat.edu.uy>
+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 <tornaria@cmat.edu.uy>
+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
+-        <fortran object>
++        <fortran ...>
+     """
+     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
+-            <fortran object>
++            <fortran ...>
+             sage: from numpy import array
+             sage: a = array(range(10), dtype=float)
+             sage: fib(a, 10)
diff --git a/srcpkgs/sagemath/patches/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 <arojas@archlinux.org>
+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 <tornaria@cmat.edu.uy>
+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 = (<long>1) << (BITS_IN_LONG - PyLong_SHIFT)
+     cdef long lead_3_overflow = (<long>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..2bbced6290e0 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
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"

             reply	other threads:[~2023-02-02 22:54 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-02 22:54 tornaria [this message]
2023-02-02 23:07 ` sagemath: rebuild for dep updates and fixes tornaria
2023-02-02 23:16 ` [PR PATCH] [Updated] " tornaria
2023-02-03  1:29 ` tornaria
2023-02-03  1:33 ` [PR PATCH] [Updated] " tornaria
2023-02-03 23:42 ` tornaria
2023-02-04  1:04 ` tornaria
2023-02-04  1:38 ` tornaria
2023-02-04 11:47 ` [PR PATCH] [Updated] " tornaria
2023-02-05 14:00 ` tornaria
2023-02-05 14:00 ` tornaria
2023-02-05 14:42 ` [PR PATCH] [Updated] " tornaria
2023-02-05 14:56 ` tornaria
2023-02-06  2:54 ` [PR PATCH] [Updated] " tornaria
2023-02-06 12:43 ` tornaria
2023-02-06 21:23 ` dkwo
2023-02-06 21:24 ` dkwo
2023-02-06 21:39 ` tornaria
2023-02-06 23:37 ` dkwo
2023-02-06 23:42 ` dkwo
2023-02-07 16:47 ` dkwo
2023-02-13 15:58 ` tornaria
2023-02-13 16:08 ` dkwo
2023-02-13 18:31 ` [PR PATCH] [Updated] " tornaria
2023-02-14  0:11 ` tornaria
2023-02-14  0:17 ` tornaria
2023-02-14 13:03 ` [PR PATCH] [Updated] sagemath: update to 9.8 tornaria
2023-02-14 13:05 ` tornaria
2023-02-15 13:19 ` tornaria
2023-02-15 13:32 ` [PR PATCH] [Merged]: " leahneukirchen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-42048@inbox.vuxu.org \
    --to=tornaria@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).