Date: Sunday, August 28, 2022 @ 17:27:10 Author: arojas Revision: 1285131
upgpkg: sagemath 9.6-7: GAP 4.12 rebuild Added: sagemath/trunk/sagemath-gap-4.12.patch Modified: sagemath/trunk/PKGBUILD -------------------------+ PKGBUILD | 11 ++++++-- sagemath-gap-4.12.patch | 57 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 3 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2022-08-28 17:06:52 UTC (rev 1285130) +++ PKGBUILD 2022-08-28 17:27:10 UTC (rev 1285131) @@ -7,7 +7,7 @@ pkgname=sagemath pkgver=9.6 -pkgrel=6 +pkgrel=7 pkgdesc='Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab' arch=(x86_64) url='http://www.sagemath.org' @@ -58,7 +58,8 @@ sagemath-linbox-1.7.patch sagemath-bliss-0.77.patch sagemath-tachyon-0.99.patch - sagemath-jupyter-jsmol.patch) + sagemath-jupyter-jsmol.patch + sagemath-gap-4.12.patch) sha256sums=('c6225d48f70ac955fceed5c1fddfdd7294001d460b43a686329d5d44d836f6a3' 'e24c075a9f8e562fe9d85e6fd5b01eac4691683c01d4d22c83cde145b63f4dba' 'bd188af45ce31579b82407adee8e9bf6033a996f7ea6e328fabca526f31c08ba' @@ -66,7 +67,8 @@ 'eacea27b214d32cb886a75695153dfc36b5bad2fd2517e8e4eee18e74220e9e3' 'b467a41e1e0a0850f7722d875a743233751966a206c2f61401c7582aa722f84e' '4ee8071efd7b9ad66ac5bbfe081fe670cc58cfcac8fb783d5a40b6da3593cbf4' - '14431ef93a68324ed276d79d7be66b0fb6b73df74f0e049be522480153e22afa') + '14431ef93a68324ed276d79d7be66b0fb6b73df74f0e049be522480153e22afa' + '17b8ea5ff1f7da2781ec9c190c094f17ba555f1a66d4300d8ee14d6b608c0fd0') prepare(){ cd sage-$pkgver @@ -78,6 +80,8 @@ patch -p1 -i ../sagemath-bliss-0.77.patch # Fix tests with tachyon 0.99 https://trac.sagemath.org/ticket/23712 patch -p1 -i ../sagemath-tachyon-0.99.patch +# Port to GAP 4.12 + patch -p1 -i ../sagemath-gap-4.12.patch # Arch-specific patches # assume all optional packages are installed @@ -98,6 +102,7 @@ export SAGE_NUM_THREADS=10 export PYTHONPATH="$PWD"/../sage-setup + export CPPFLAGS+=" -DUSE_GASMAN=1" python setup.py build } Added: sagemath-gap-4.12.patch =================================================================== --- sagemath-gap-4.12.patch (rev 0) +++ sagemath-gap-4.12.patch 2022-08-28 17:27:10 UTC (rev 1285131) @@ -0,0 +1,57 @@ +diff --git a/src/sage/interfaces/gap.py b/src/sage/interfaces/gap.py +index c34fe530c3..569caa27bf 100644 +--- a/src/sage/interfaces/gap.py ++++ b/src/sage/interfaces/gap.py +@@ -1512,6 +1512,8 @@ def gap_reset_workspace(max_workspace_size=None, verbose=False): + """ + # Create new workspace with filename WORKSPACE + g = Gap(use_workspace_cache=False, max_workspace_size=None) ++ g.eval('ColorPrompt(false)') ++ g.eval('SetUserPreference("UseColorPrompt", false)') + g.eval('SetUserPreference("HistoryMaxLines", 30)') + from sage.tests.gap_packages import all_installed_packages + for pkg in all_installed_packages(gap=g): +diff --git a/src/sage/libs/gap/element.pyx b/src/sage/libs/gap/element.pyx +index be43c4c3ee..e2681165a2 100644 +--- a/src/sage/libs/gap/element.pyx ++++ b/src/sage/libs/gap/element.pyx +@@ -130,6 +130,7 @@ cdef char *capture_stdout(Obj func, Obj obj): + """ + cdef Obj s, stream, output_text_string + cdef UInt res ++ cdef TypOutputFile output + # The only way to get a string representation of an object that is truly + # consistent with how it would be represented at the GAP REPL is to call + # ViewObj on it. Unfortunately, ViewObj *prints* to the output stream, +@@ -145,12 +146,12 @@ cdef char *capture_stdout(Obj func, Obj obj): + output_text_string = GAP_ValueGlobalVariable("OutputTextString") + stream = CALL_2ARGS(output_text_string, s, GAP_True) + +- if not OpenOutputStream(stream): ++ if not OpenOutputStream(&output, stream): + raise GAPError("failed to open output capture stream for " + "representing GAP object") + + CALL_1ARGS(func, obj) +- CloseOutput() ++ CloseOutput(&output) + return CSTR_STRING(s) + finally: + GAP_Leave() +diff --git a/src/sage/libs/gap/gap_includes.pxd b/src/sage/libs/gap/gap_includes.pxd +index 5a9ab486f7..34035fe4e6 100644 +--- a/src/sage/libs/gap/gap_includes.pxd ++++ b/src/sage/libs/gap/gap_includes.pxd +@@ -76,8 +76,10 @@ cdef extern from "gap/intobj.h" nogil: + + + cdef extern from "gap/io.h" nogil: +- UInt OpenOutputStream(Obj stream) +- UInt CloseOutput() ++ ctypedef struct TypOutputFile: ++ pass ++ UInt OpenOutputStream(TypOutputFile* output, Obj stream) ++ UInt CloseOutput(TypOutputFile* output) + + + cdef extern from "gap/libgap-api.h" nogil: