From 545b239d33cea82e9e70aec687591d37d8084305 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Tue, 27 Sep 2022 21:31:16 -0600 Subject: [PATCH] Rebuild for gap 4.12.0 and pari 2.15.0. --- sagemath-cremona.patch | 13 ++ sagemath-libgap.patch | 485 +++++++++++++++++++++++++++++++++++++++-- sagemath.spec | 34 +-- 3 files changed, 480 insertions(+), 52 deletions(-) diff --git a/sagemath-cremona.patch b/sagemath-cremona.patch index fcfb82b..aa8aab1 100644 --- a/sagemath-cremona.patch +++ b/sagemath-cremona.patch @@ -1,3 +1,16 @@ +Fix this error: + +Inserting allgens.90000-99999 +Committing... +Traceback (most recent call last): + File "/builddir/build/BUILD/sage-9.6/cremona.sage.py", line 10, in + c._init_from_ftpdata('ecdata-2019-10-29') + File "/builddir/build/BUILDROOT/sagemath-9.6-4.fc38.x86_64/usr/lib64/python3.11/site-packages/sage/databases/cremona.py", line 1397, in _init_from_ftpdata + self.vacuum() + File "/builddir/build/BUILDROOT/sagemath-9.6-4.fc38.x86_64/usr/lib64/python3.11/site-packages/sage/databases/sql_db.py", line 2180, in vacuum + self.__connection__.execute('VACUUM') +sqlite3.OperationalError: cannot VACUUM from within a transaction + diff -up src/sage/databases/cremona.py.orig src/sage/databases/cremona.py --- src/sage/databases/cremona.py.orig 2021-08-22 02:44:33.000000000 -0600 +++ src/sage/databases/cremona.py 2021-08-26 13:33:03.200366675 -0600 diff --git a/sagemath-libgap.patch b/sagemath-libgap.patch index 2fce69a..abe37ad 100644 --- a/sagemath-libgap.patch +++ b/sagemath-libgap.patch @@ -1,7 +1,120 @@ +diff -up src/doc/en/thematic_tutorials/lie/weyl_groups.rst.orig src/doc/en/thematic_tutorials/lie/weyl_groups.rst +--- src/doc/en/thematic_tutorials/lie/weyl_groups.rst.orig 2022-05-15 16:11:11.000000000 -0600 ++++ src/doc/en/thematic_tutorials/lie/weyl_groups.rst 2022-09-14 15:23:59.397522485 -0600 +@@ -139,12 +139,12 @@ string, which you can print:: + X.1 1 1 1 1 1 1 1 1 1 1 1 1 1 + X.2 1 -1 1 1 -1 1 1 -1 -1 -1 1 1 1 + X.3 2 . 2 -1 . 2 2 . . . -1 2 2 +- X.4 3 -1 -1 . 1 -1 3 -1 1 -1 . -1 3 +- X.5 3 -1 -1 . 1 3 -1 -1 -1 1 . -1 3 +- X.6 3 1 -1 . -1 -1 3 1 -1 1 . -1 3 +- X.7 3 1 -1 . -1 3 -1 1 1 -1 . -1 3 +- X.8 3 -1 3 . -1 -1 -1 -1 1 1 . -1 3 +- X.9 3 1 3 . 1 -1 -1 1 -1 -1 . -1 3 ++ X.4 3 -1 -1 . 1 3 -1 -1 -1 1 . -1 3 ++ X.5 3 1 -1 . -1 3 -1 1 1 -1 . -1 3 ++ X.6 3 -1 3 . -1 -1 -1 -1 1 1 . -1 3 ++ X.7 3 -1 -1 . 1 -1 3 -1 1 -1 . -1 3 ++ X.8 3 1 3 . 1 -1 -1 1 -1 -1 . -1 3 ++ X.9 3 1 -1 . -1 -1 3 1 -1 1 . -1 3 + X.10 4 -2 . -1 . . . 2 . . 1 . -4 + X.11 4 2 . -1 . . . -2 . . 1 . -4 + X.12 6 . -2 . . -2 -2 . . . . 2 6 +diff -up src/sage/coding/codecan/autgroup_can_label.pyx.orig src/sage/coding/codecan/autgroup_can_label.pyx +--- src/sage/coding/codecan/autgroup_can_label.pyx.orig 2022-05-15 16:11:11.000000000 -0600 ++++ src/sage/coding/codecan/autgroup_can_label.pyx 2022-09-14 15:25:12.653773783 -0600 +@@ -76,7 +76,7 @@ columns do share the same coloring:: + [[1], + [2], + [3, 5, 4], +- [6, 19, 16, 9, 21, 10, 8, 15, 14, 11, 20, 13, 12, 7, 17, 18]] ++ [6, 19, 16, 21, 9, 10, 15, 8, 20, 11, 14, 13, 7, 12, 18, 17]] + + We can also restrict the group action to linear isometries:: + +diff -up src/sage/coding/linear_code.py.orig src/sage/coding/linear_code.py +--- src/sage/coding/linear_code.py.orig 2022-05-15 16:11:11.000000000 -0600 ++++ src/sage/coding/linear_code.py 2022-09-14 15:30:11.231797910 -0600 +@@ -465,7 +465,10 @@ class AbstractLinearCode(AbstractLinearC + 0 + sage: C = codes.HammingCode(GF(4, 'z'), 3) + sage: C.automorphism_group_gens() +- ([((1, 1, 1, 1, 1, z + 1, z, z + 1, z, z, z, 1, 1, z + 1, z + 1, z, z + 1, z, z + 1, z + 1, z + 1); (1,14,6,7,4,10,11,19)(2,8,16,13,3,17,21,15)(9,12,18,20), Ring endomorphism of Finite Field in z of size 2^2 ++ ([((1, 1, 1, z, z + 1, 1, 1, 1, 1, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z); (1,13,14,20)(2,21,8,18,7,16,19,15)(3,10,5,12,17,9,6,4), Ring endomorphism of Finite Field in z of size 2^2 ++ Defn: z |--> z + 1), ++ ((z, 1, z, z, z, z + 1, z, z, z, z, z, z, z + 1, z, z, z, z, z + 1, z, z, z); (1,11,5,12,3,19)(2,8)(6,18,13)(7,17,15)(9,10,14,16,20,21), Ring endomorphism of Finite Field in z of size 2^2 ++ Defn: z |--> z + 1), + Defn: z |--> z + 1), + ((z + 1, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z + 1, 1, z, z + 1, z + 1, z); (1,18,6,19,2,9,17,10,13,14,21,11,4,5,12)(3,20,7,16,8), Ring endomorphism of Finite Field in z of size 2^2 + Defn: z |--> z), +@@ -473,19 +476,20 @@ class AbstractLinearCode(AbstractLinearC + Defn: z |--> z)], + 362880) + sage: C.automorphism_group_gens(equivalence="linear") +- ([((z + 1, 1, z + 1, z + 1, z + 1, z, 1, z, 1, 1, 1, 1, z + 1, z + 1, z + 1, z, z, 1, z, z, z); (1,15,2,8,16,18,3)(4,9,12,13,20,10,11)(5,21,14,6,7,19,17), Ring endomorphism of Finite Field in z of size 2^2 ++ ([((z, 1, z + 1, z + 1, 1, z + 1, z, 1, z + 1, z + 1, 1, z, 1, z + 1, z, 1, z, 1, z + 1, 1, 1); (1,12,11,10,6,8,9,20,13,21,5,14,3,16,17,19,7,4,2,15,18), Ring endomorphism of Finite Field in z of size 2^2 + Defn: z |--> z), +- ((z + 1, z + 1, z + 1, z + 1, z + 1, 1, z, 1, z, z, z, 1, z, 1, 1, 1, z + 1, z + 1, z + 1, 1, z); (1,15,21,8,9)(2,18,5,3,11,16,7,10,19,13,12,4,17,6,20), Ring endomorphism of Finite Field in z of size 2^2 ++ ((z + 1, z + 1, z + 1, z, 1, 1, z, z, 1, z + 1, z, 1, 1, z, 1, z + 1, z, z + 1, z + 1, 1, z); (1,3,18,2,17,6,19)(4,15,13,20,7,14,16)(5,11,8,21,12,9,10), Ring endomorphism of Finite Field in z of size 2^2 ++ Defn: z |--> z), + Defn: z |--> z), + ((z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1); (), Ring endomorphism of Finite Field in z of size 2^2 + Defn: z |--> z)], + 181440) + sage: C.automorphism_group_gens(equivalence="permutational") +- ([((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,19)(3,17)(4,21)(5,20)(7,14)(9,12)(10,16)(11,15), Ring endomorphism of Finite Field in z of size 2^2 ++ ([((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,11)(3,10)(4,9)(5,7)(12,21)(14,20)(15,19)(16,17), Ring endomorphism of Finite Field in z of size 2^2 + Defn: z |--> z), +- ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,11)(3,10)(4,9)(5,7)(12,21)(14,20)(15,19)(16,17), Ring endomorphism of Finite Field in z of size 2^2 ++ ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (2,18)(3,19)(4,10)(5,16)(8,13)(9,14)(11,21)(15,20), Ring endomorphism of Finite Field in z of size 2^2 + Defn: z |--> z), +- ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,17)(2,8)(3,14)(4,10)(7,12)(9,19)(13,18)(15,20), Ring endomorphism of Finite Field in z of size 2^2 ++ ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,19)(3,17)(4,21)(5,20)(7,14)(9,12)(10,16)(11,15), Ring endomorphism of Finite Field in z of size 2^2 + Defn: z |--> z), + ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (2,13)(3,14)(4,20)(5,11)(8,18)(9,19)(10,15)(16,21), Ring endomorphism of Finite Field in z of size 2^2 + Defn: z |--> z)], +@@ -691,10 +695,10 @@ class AbstractLinearCode(AbstractLinearC + sage: C_iso == aut_group_can_label.get_canonical_form() + True + sage: aut_group_can_label.get_autom_gens() +- [((1, 1, 1, 1, 1, z + 1, z, z + 1, z, z, z, 1, 1, z + 1, z + 1, z, z + 1, z, z + 1, z + 1, z + 1); (1,14,6,7,4,10,11,19)(2,8,16,13,3,17,21,15)(9,12,18,20), Ring endomorphism of Finite Field in z of size 2^2 ++ [((1, 1, 1, z, z + 1, 1, 1, 1, 1, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z); (1,13,14,20)(2,21,8,18,7,16,19,15)(3,10,5,12,17,9,6,4), Ring endomorphism of Finite Field in z of size 2^2 +++ Defn: z |--> z + 1), +++ ((z, 1, z, z, z, z + 1, z, z, z, z, z, z, z + 1, z, z, z, z, z + 1, z, z, z); (1,11,5,12,3,19)(2,8)(6,18,13)(7,17,15)(9,10,14,16,20,21), Ring endomorphism of Finite Field in z of size 2^2 + Defn: z |--> z + 1), +- ((z + 1, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z + 1, 1, z, z + 1, z + 1, z); (1,18,6,19,2,9,17,10,13,14,21,11,4,5,12)(3,20,7,16,8), Ring endomorphism of Finite Field in z of size 2^2 +- Defn: z |--> z), + ((z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z); (), Ring endomorphism of Finite Field in z of size 2^2 + Defn: z |--> z)] + """ +diff -up src/sage/combinat/root_system/hecke_algebra_representation.py.orig src/sage/combinat/root_system/hecke_algebra_representation.py +--- src/sage/combinat/root_system/hecke_algebra_representation.py.orig 2022-05-15 16:11:11.000000000 -0600 ++++ src/sage/combinat/root_system/hecke_algebra_representation.py 2022-09-14 15:30:46.462918766 -0600 +@@ -355,7 +355,7 @@ class HeckeAlgebraRepresentation(WithEqu + sage: q1, q2 = K.gens() + sage: KW = W.algebra(K) + sage: x = KW.an_element(); x +- 123 + 3*32 + 2*3 + e ++ 123 + 3*2312 + 2*31 + e + + sage: T = KW.demazure_lusztig_operators(q1,q2) + sage: T12 = T.Tw( (1,2) ) +diff -up src/sage/combinat/symmetric_group_algebra.py.orig src/sage/combinat/symmetric_group_algebra.py +--- src/sage/combinat/symmetric_group_algebra.py.orig 2022-05-15 16:11:11.000000000 -0600 ++++ src/sage/combinat/symmetric_group_algebra.py 2022-09-14 15:35:42.552934349 -0600 +@@ -101,7 +101,7 @@ def SymmetricGroupAlgebra(R, W, category + sage: SGA.group() + Weyl Group of type ['A', 3] (as a matrix group acting on the ambient space) + sage: SGA.an_element() +- s1*s2*s3 + 3*s3*s2 + 2*s3 + 1 ++ s1*s2*s3 + 3*s2*s3*s1*s2 + 2*s3*s1 + 1 + + The preferred way to construct the symmetric group algebra is to + go through the usual ``algebra`` method:: diff -up src/sage/env.py.orig src/sage/env.py ---- src/sage/env.py.orig 2021-05-09 16:00:11.000000000 -0600 -+++ src/sage/env.py 2021-06-02 17:13:07.387813291 -0600 -@@ -194,7 +194,7 @@ CONWAY_POLYNOMIALS_DATA_DIR = var("CONWA +--- src/sage/env.py.orig 2022-05-15 16:11:11.000000000 -0600 ++++ src/sage/env.py 2022-09-14 15:15:42.303907557 -0600 +@@ -197,7 +197,7 @@ CONWAY_POLYNOMIALS_DATA_DIR = var("CONWA GRAPHS_DATA_DIR = var("GRAPHS_DATA_DIR", join(SAGE_SHARE, "graphs")) ELLCURVE_DATA_DIR = var("ELLCURVE_DATA_DIR", join(SAGE_SHARE, "ellcurves")) POLYTOPE_DATA_DIR = var("POLYTOPE_DATA_DIR", join(SAGE_SHARE, "reflexive_polytopes")) @@ -10,10 +123,264 @@ diff -up src/sage/env.py.orig src/sage/env.py THEBE_DIR = var("THEBE_DIR", join(SAGE_SHARE, "thebe")) COMBINATORIAL_DESIGN_DATA_DIR = var("COMBINATORIAL_DESIGN_DATA_DIR", join(SAGE_SHARE, "combinatorial_designs")) CREMONA_MINI_DATA_DIR = var("CREMONA_MINI_DATA_DIR", join(SAGE_SHARE, "cremona")) +diff -up src/sage/groups/abelian_gps/abelian_group_gap.py.orig src/sage/groups/abelian_gps/abelian_group_gap.py +--- src/sage/groups/abelian_gps/abelian_group_gap.py.orig 2022-05-15 16:11:11.000000000 -0600 ++++ src/sage/groups/abelian_gps/abelian_group_gap.py 2022-09-14 15:23:05.702338312 -0600 +@@ -338,7 +338,7 @@ class AbelianGroup_gap(UniqueRepresentat + if isinstance(x, AbelianGroupElement_gap): + try: + if x in self._cover: +- x = self.gap().NaturalHomomorphism().Image(x.gap()) ++ x = self._cover.gap().NaturalHomomorphismByNormalSubgroup(self._relations).Image(x.gap()) + else: + x = x.gap() + except AttributeError: +@@ -1043,7 +1043,7 @@ class AbelianGroupQuotient_gap(AbelianGr + From: Abelian group with gap, generator orders (4,) + To: Quotient abelian group with generator orders (2,) + """ +- phi = self.gap().NaturalHomomorphism() ++ phi = self._cover.gap().NaturalHomomorphismByNormalSubgroup(self._relations) + Hom = self._cover.Hom(self) + return Hom(phi) + +diff -up src/sage/groups/finitely_presented.py.orig src/sage/groups/finitely_presented.py +--- src/sage/groups/finitely_presented.py.orig 2022-05-15 16:11:11.000000000 -0600 ++++ src/sage/groups/finitely_presented.py 2022-09-14 15:36:48.057159029 -0600 +@@ -596,9 +596,9 @@ class RewritingSystem(object): + sage: k=G.rewriting_system() + sage: k.gap() + Knuth Bendix Rewriting System for Monoid( [ a, A, b, B ] ) with rules +- [ [ a^2, ], [ a*A, ], +- [ A*a, ], [ b^2, ], +- [ b*B, ], [ B*b, ] ] ++ [ [ a*A, ], [ A*a, ], ++ [ b*B, ], [ B*b, ], ++ [ a^2, ], [ b^2, ] ] + """ + return self._gap + +diff -up src/sage/groups/fqf_orthogonal.py.orig src/sage/groups/fqf_orthogonal.py +--- src/sage/groups/fqf_orthogonal.py.orig 2022-05-15 16:11:11.000000000 -0600 ++++ src/sage/groups/fqf_orthogonal.py 2022-09-14 15:37:12.377242440 -0600 +@@ -143,7 +143,7 @@ class FqfOrthogonalGroup(AbelianGroupAut + [2/3 0 0] + [ 0 2/3 0] + [ 0 0 4/3] +- generated by 2 elements ++ generated by 3 elements + sage: q = matrix.diagonal(QQ, [3/2, 1/4, 1/4]) + sage: T = TorsionQuadraticForm(q) + sage: T.orthogonal_group().order() +diff -up src/sage/groups/libgap_wrapper.pyx.orig src/sage/groups/libgap_wrapper.pyx +--- src/sage/groups/libgap_wrapper.pyx.orig 2022-05-15 16:11:11.000000000 -0600 ++++ src/sage/groups/libgap_wrapper.pyx 2022-09-14 15:37:50.457373037 -0600 +@@ -25,7 +25,7 @@ Note how we call the constructor of both + its output via LibGAP:: + + sage: FooGroup() +- ++ + sage: type(FooGroup().gap()) + + +@@ -106,7 +106,7 @@ class ParentLibGAP(SageObject): + ....: ParentLibGAP.__init__(self, lg) + ....: Group.__init__(self) + sage: FooGroup() +- ++ + """ + + def __init__(self, libgap_parent, ambient=None): +@@ -461,7 +461,7 @@ cdef class ElementLibGAP(MultiplicativeG + ....: ParentLibGAP.__init__(self, lg) + ....: Group.__init__(self) + sage: FooGroup() +- ++ + sage: FooGroup().gens() + (f1,) + """ +diff -up src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx.orig src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx +--- src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx.orig 2022-05-15 16:11:11.000000000 -0600 ++++ src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx 2022-09-14 15:39:54.849811749 -0600 +@@ -427,7 +427,7 @@ cdef class LabelledBranching: + sage: from sage.groups.perm_gps.partn_ref2.refinement_generic import LabelledBranching + sage: L = LabelledBranching(3) + sage: L.small_generating_set() +- [] ++ [()] + sage: L.add_gen(libgap.eval('(1,2,3)')) + sage: L.small_generating_set() + [(1,2,3)] +diff -up src/sage/groups/perm_gps/permgroup.py.orig src/sage/groups/perm_gps/permgroup.py +--- src/sage/groups/perm_gps/permgroup.py.orig 2022-05-15 16:11:11.000000000 -0600 ++++ src/sage/groups/perm_gps/permgroup.py 2022-09-14 16:03:50.495931767 -0600 +@@ -875,7 +875,7 @@ class PermutationGroup_generic(FiniteGro + sage: f=PG._coerce_map_from_(MG) + sage: mg = MG.an_element() + sage: p = f(mg); p +- (2,33,32,23,31,55)(3,49,38,44,40,28)(4,17,59,62,58,46)(5,21,47,20,43,8)(6,53,50)(7,37,12,57,14,29)(9,41,56,34,64,10)(11,25,19)(13,61,26,51,22,15)(16,45,36)(18,27,35,48,52,54)(24,63,42)(30,39,60) ++ (1,2,6,19,35,33)(3,9,26,14,31,23)(4,13,5)(7,22,17)(8,24,12)(10,16,32,27,20,28)(11,30,18)(15,25,36,34,29,21) + sage: PG(p._gap_()) == p + True + +@@ -921,12 +921,12 @@ class PermutationGroup_generic(FiniteGro + sage: P = G.as_permutation_group(algorithm='smaller', seed=5) + sage: P1 = G.as_permutation_group() + sage: P == P1 +- False ++ True + sage: g1, g2, g3 = G.gens() + sage: P(g1*g2) +- (1,3,7,12)(2,4,8,10)(5,11)(6,9) ++ (1,4,13,11)(2,5,14,18)(3,15,8,16)(6,7)(9,20,19,12)(10,17) + sage: P1(g1*g2) +- (2,29,25,68)(3,57,13,54)(4,11,72,37)(5,39,60,23)(6,64,75,63)(7,21,50,73)(8,46,38,32)(9,74,35,18)(10,44,49,48)(12,16,34,71)(14,79,27,40)(15,26)(17,62,59,76)(19,78,70,65)(20,22,58,51)(24,33,36,43)(28,81,80,52)(30,53,56,69)(31,61)(41,42,67,55)(45,77)(47,66) ++ (1,4,13,11)(2,5,14,18)(3,15,8,16)(6,7)(9,20,19,12)(10,17) + + Another check for :trac:`5583`:: + +@@ -4291,7 +4291,7 @@ class PermutationGroup_generic(FiniteGro + + sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)]]) #S_5 on [1..5] + sage: G.is_transitive([1,4,5]) +- True ++ False + sage: G.is_transitive([2..6]) + False + sage: G.is_transitive(G.non_fixed_points()) +@@ -4355,7 +4355,7 @@ class PermutationGroup_generic(FiniteGro + sage: G.is_primitive([1..4]) + False + sage: G.is_primitive([1,2,3]) +- True ++ False + sage: G = PermutationGroup([[(3,4,5,6)],[(3,4)]]) #S_4 on [3..6] + sage: G.is_primitive(G.non_fixed_points()) + True +diff -up src/sage/interfaces/gap.py.orig src/sage/interfaces/gap.py +--- src/sage/interfaces/gap.py.orig 2022-05-15 16:11:11.000000000 -0600 ++++ src/sage/interfaces/gap.py 2022-09-14 15:21:29.734019419 -0600 +@@ -1490,6 +1490,8 @@ def gap_reset_workspace(max_workspace_si + """ + # 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 -up src/sage/libs/gap/element.pxd.orig src/sage/libs/gap/element.pxd +--- src/sage/libs/gap/element.pxd.orig 2022-05-15 16:11:11.000000000 -0600 ++++ src/sage/libs/gap/element.pxd 2022-09-27 18:35:39.449724078 -0600 +@@ -29,9 +29,9 @@ cdef GapElement_Boolean make_GapElement_ + cdef GapElement_Function make_GapElement_Function(parent, Obj obj) + cdef GapElement_Permutation make_GapElement_Permutation(parent, Obj obj) + +-cdef char *capture_stdout(Obj, Obj) +-cdef char *gap_element_str(Obj) +-cdef char *gap_element_repr(Obj) ++cdef str capture_stdout(Obj, Obj) ++cdef str gap_element_str(Obj) ++cdef str gap_element_repr(Obj) + + + cdef class GapElement(RingElement): diff -up src/sage/libs/gap/element.pyx.orig src/sage/libs/gap/element.pyx ---- src/sage/libs/gap/element.pyx.orig 2021-05-09 16:00:11.000000000 -0600 -+++ src/sage/libs/gap/element.pyx 2021-05-28 11:43:51.678593573 -0600 -@@ -264,7 +264,7 @@ cdef Obj make_gap_string(sage_string) ex +--- src/sage/libs/gap/element.pyx.orig 2022-05-15 16:11:11.000000000 -0600 ++++ src/sage/libs/gap/element.pyx 2022-09-27 18:46:41.755240259 -0600 +@@ -120,7 +120,7 @@ cdef Obj make_gap_matrix(sage_list, gap_ + return l.value + + +-cdef char *capture_stdout(Obj func, Obj obj): ++cdef str capture_stdout(Obj func, Obj obj): + """ + Call a single-argument GAP function ``func`` with the argument ``obj`` + and return the stdout from that function call. +@@ -130,6 +130,7 @@ cdef char *capture_stdout(Obj func, 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, +@@ -139,36 +140,35 @@ cdef char *capture_stdout(Obj func, Obj + # that does not give consistent results. + # TODO: This is probably needlessly slow, but we might need better + # support from GAP to improve this... +- try: +- GAP_Enter() +- s = NEW_STRING(0) +- output_text_string = GAP_ValueGlobalVariable("OutputTextString") +- stream = CALL_2ARGS(output_text_string, s, GAP_True) ++ s = NEW_STRING(0) ++ output_text_string = GAP_ValueGlobalVariable("OutputTextString") ++ stream = CALL_2ARGS(output_text_string, s, GAP_True) + +- if not OpenOutputStream(stream): +- raise GAPError("failed to open output capture stream for " +- "representing GAP object") ++ if not OpenOutputStream(&output, stream): ++ raise GAPError("failed to open output capture stream for " ++ "representing GAP object") + +- CALL_1ARGS(func, obj) +- CloseOutput() +- return CSTR_STRING(s) +- finally: +- GAP_Leave() ++ CALL_1ARGS(func, obj) ++ CloseOutput(&output) ++ return char_to_str(CSTR_STRING(s)) + + +-cdef char *gap_element_repr(Obj obj): ++cdef str gap_element_repr(Obj obj): + """ + Implement ``repr()`` of ``GapElement``s using the ``ViewObj()`` function, + which is by default closest to what you get when displaying an object in + GAP on the command-line (i.e. when evaluating an expression that returns + that object. + """ ++ cdef Obj func ++ try: ++ GAP_Enter() ++ func = GAP_ValueGlobalVariable("ViewObj") ++ return capture_stdout(func, obj) ++ finally: ++ GAP_Leave() + +- cdef Obj func = GAP_ValueGlobalVariable("ViewObj") +- return capture_stdout(func, obj) +- +- +-cdef char *gap_element_str(Obj obj): ++cdef str gap_element_str(Obj obj): + """ + Implement ``str()`` of ``GapElement``s using the ``Print()`` function. + +@@ -178,9 +178,13 @@ cdef char *gap_element_str(Obj obj): + slightly different approach more closely mirroring Python's str/repr + difference (though this does not map perfectly onto GAP). + """ +- cdef Obj func = GAP_ValueGlobalVariable("Print") +- return capture_stdout(func, obj) +- ++ cdef Obj func ++ try: ++ GAP_Enter() ++ func = GAP_ValueGlobalVariable("Print") ++ return capture_stdout(func, obj) ++ finally: ++ GAP_Leave() + + cdef Obj make_gap_record(sage_dict) except NULL: + """ +@@ -264,7 +268,7 @@ cdef Obj make_gap_string(sage_string) ex try: GAP_Enter() b = str_to_bytes(sage_string) @@ -22,7 +389,25 @@ diff -up src/sage/libs/gap/element.pyx.orig src/sage/libs/gap/element.pyx return result finally: GAP_Leave() -@@ -955,7 +955,7 @@ cdef class GapElement(RingElement): +@@ -760,7 +764,7 @@ cdef class GapElement(RingElement): + if self.value == NULL: + return 'NULL' + +- s = char_to_str(gap_element_str(self.value)) ++ s = gap_element_str(self.value) + return s.strip() + + def _repr_(self): +@@ -782,7 +786,7 @@ cdef class GapElement(RingElement): + if self.value == NULL: + return 'NULL' + +- s = char_to_str(gap_element_repr(self.value)) ++ s = gap_element_repr(self.value) + return s.strip() + + cpdef _set_compare_by_id(self): +@@ -955,7 +959,7 @@ cdef class GapElement(RingElement): sig_on() try: GAP_Enter() @@ -31,7 +416,7 @@ diff -up src/sage/libs/gap/element.pyx.orig src/sage/libs/gap/element.pyx finally: GAP_Leave() sig_off() -@@ -977,7 +977,7 @@ cdef class GapElement(RingElement): +@@ -977,7 +981,7 @@ cdef class GapElement(RingElement): sig_on() try: GAP_Enter() @@ -40,7 +425,7 @@ diff -up src/sage/libs/gap/element.pyx.orig src/sage/libs/gap/element.pyx finally: GAP_Leave() sig_off() -@@ -1205,7 +1205,7 @@ cdef class GapElement(RingElement): +@@ -1205,7 +1209,7 @@ cdef class GapElement(RingElement): sage: a.is_function() False """ @@ -49,7 +434,7 @@ diff -up src/sage/libs/gap/element.pyx.orig src/sage/libs/gap/element.pyx def is_list(self): r""" -@@ -1222,7 +1222,7 @@ cdef class GapElement(RingElement): +@@ -1222,7 +1226,7 @@ cdef class GapElement(RingElement): sage: libgap.eval('3/2').is_list() False """ @@ -58,7 +443,7 @@ diff -up src/sage/libs/gap/element.pyx.orig src/sage/libs/gap/element.pyx def is_record(self): r""" -@@ -1239,7 +1239,7 @@ cdef class GapElement(RingElement): +@@ -1239,7 +1243,7 @@ cdef class GapElement(RingElement): sage: libgap.eval('rec(a:=1, b:=3)').is_record() True """ @@ -67,7 +452,7 @@ diff -up src/sage/libs/gap/element.pyx.orig src/sage/libs/gap/element.pyx cpdef is_bool(self): r""" -@@ -1272,7 +1272,7 @@ cdef class GapElement(RingElement): +@@ -1272,7 +1276,7 @@ cdef class GapElement(RingElement): sage: libgap('this is a string').is_string() True """ @@ -76,7 +461,7 @@ diff -up src/sage/libs/gap/element.pyx.orig src/sage/libs/gap/element.pyx def is_permutation(self): r""" -@@ -1469,7 +1469,7 @@ cdef class GapElement_Integer(GapElement +@@ -1469,7 +1473,7 @@ cdef class GapElement_Integer(GapElement sage: N.IsInt() true """ @@ -85,7 +470,7 @@ diff -up src/sage/libs/gap/element.pyx.orig src/sage/libs/gap/element.pyx def _rational_(self): r""" -@@ -2808,7 +2808,7 @@ cdef class GapElement_List(GapElement): +@@ -2806,7 +2810,7 @@ cdef class GapElement_List(GapElement): ... ValueError: too many indices """ @@ -94,7 +479,7 @@ diff -up src/sage/libs/gap/element.pyx.orig src/sage/libs/gap/element.pyx cdef Obj obj = self.value if isinstance(i, tuple): -@@ -2879,7 +2879,7 @@ cdef class GapElement_List(GapElement): +@@ -2877,7 +2881,7 @@ cdef class GapElement_List(GapElement): if not IS_MUTABLE_OBJ(self.value): raise TypeError('immutable Gap object does not support item assignment') @@ -104,8 +489,8 @@ diff -up src/sage/libs/gap/element.pyx.orig src/sage/libs/gap/element.pyx if isinstance(i, tuple): diff -up src/sage/libs/gap/gap_includes.pxd.orig src/sage/libs/gap/gap_includes.pxd ---- src/sage/libs/gap/gap_includes.pxd.orig 2021-05-09 16:00:11.000000000 -0600 -+++ src/sage/libs/gap/gap_includes.pxd 2021-05-28 11:43:51.679593573 -0600 +--- src/sage/libs/gap/gap_includes.pxd.orig 2022-05-15 16:11:11.000000000 -0600 ++++ src/sage/libs/gap/gap_includes.pxd 2022-09-14 15:19:47.996693822 -0600 @@ -13,8 +13,8 @@ from libc.stdint cimport uintptr_t, uint cdef extern from "gap/system.h" nogil: @@ -146,7 +531,7 @@ diff -up src/sage/libs/gap/gap_includes.pxd.orig src/sage/libs/gap/gap_includes. void AssGVar "AssGVar"(UInt gvar, Obj val) -@@ -70,7 +70,7 @@ cdef extern from "gap/integer.h" nogil: +@@ -70,14 +70,16 @@ cdef extern from "gap/integer.h" nogil: cdef extern from "gap/intobj.h" nogil: @@ -155,7 +540,18 @@ diff -up src/sage/libs/gap/gap_includes.pxd.orig src/sage/libs/gap/gap_includes. Obj INTOBJ_INT(Int) Int INT_INTOBJ(Obj) -@@ -100,11 +100,11 @@ cdef extern from "gap/libgap-api.h" nogi + + 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: +@@ -100,11 +102,11 @@ cdef extern from "gap/libgap-api.h" nogi cdef extern from "gap/lists.h" nogil: @@ -172,7 +568,7 @@ diff -up src/sage/libs/gap/gap_includes.pxd.orig src/sage/libs/gap/gap_includes. cdef extern from "gap/listfunc.h" nogil: -@@ -116,13 +116,13 @@ cdef extern from "gap/macfloat.h" nogil: +@@ -116,13 +118,13 @@ cdef extern from "gap/macfloat.h" nogil: cdef extern from "gap/objects.h" nogil: @@ -189,7 +585,7 @@ diff -up src/sage/libs/gap/gap_includes.pxd.orig src/sage/libs/gap/gap_includes. cdef enum TNUM: T_INT -@@ -163,23 +163,23 @@ cdef extern from "gap/permutat.h" nogil: +@@ -163,23 +165,23 @@ cdef extern from "gap/permutat.h" nogil: cdef extern from "gap/precord.h" nogil: @@ -224,10 +620,39 @@ diff -up src/sage/libs/gap/gap_includes.pxd.orig src/sage/libs/gap/gap_includes. + Int IsStringConv(Obj obj) + Obj NEW_STRING(Int len) + Obj MakeStringWithLen(const char *buf, size_t len) +diff -up src/sage/libs/gap/libgap.pyx.orig src/sage/libs/gap/libgap.pyx +--- src/sage/libs/gap/libgap.pyx.orig 2022-05-15 16:11:11.000000000 -0600 ++++ src/sage/libs/gap/libgap.pyx 2022-09-14 15:43:04.473558811 -0600 +@@ -691,7 +691,7 @@ class Gap(Parent): + sage: libgap.List + + sage: libgap.GlobalRandomSource +- ++ + """ + if name in dir(self.__class__): + return getattr(self.__class__, name) diff -up src/sage/libs/gap/util.pyx.orig src/sage/libs/gap/util.pyx ---- src/sage/libs/gap/util.pyx.orig 2021-05-09 16:00:11.000000000 -0600 -+++ src/sage/libs/gap/util.pyx 2021-05-28 11:43:51.679593573 -0600 -@@ -387,7 +387,7 @@ cdef Obj gap_eval(str gap_string) except +--- src/sage/libs/gap/util.pyx.orig 2022-05-15 16:11:11.000000000 -0600 ++++ src/sage/libs/gap/util.pyx 2022-09-14 16:00:31.367311730 -0600 +@@ -353,15 +353,9 @@ cdef Obj gap_eval(str gap_string) except + GAPError: Error, Variable: 'Complex' must have a value + Syntax error: ; expected in stream:1 + Complex Field with 53 bits of precision;; +- ^^^^^^^^^^^^ ++ ^^^^^ + Error, Variable: 'with' must have a value +- Syntax error: ; expected in stream:1 +- Complex Field with 53 bits of precision;; +- ^^^^^^^^^^^^^^^^^^^^ + Error, Variable: 'bits' must have a value +- Syntax error: ; expected in stream:1 +- Complex Field with 53 bits of precision;; +- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + Error, Variable: 'precision' must have a value + + Test that on a subsequent attempt we get the same message (no garbage was +@@ -379,7 +373,7 @@ cdef Obj gap_eval(str gap_string) except """ initialize() cdef Obj result @@ -236,3 +661,15 @@ diff -up src/sage/libs/gap/util.pyx.orig src/sage/libs/gap/util.pyx # Careful: We need to keep a reference to the bytes object here # so that Cython doesn't deallocate it before GAP is done with +diff -up src/sage/tests/gap_packages.py.orig src/sage/tests/gap_packages.py +--- src/sage/tests/gap_packages.py.orig 2022-05-15 16:11:11.000000000 -0600 ++++ src/sage/tests/gap_packages.py 2022-09-14 16:00:53.429380443 -0600 +@@ -103,7 +103,7 @@ def all_installed_packages(ignore_dot_ga + + sage: from sage.tests.gap_packages import all_installed_packages + sage: all_installed_packages() +- (...'GAPDoc'...) ++ (...'gapdoc'...) + sage: all_installed_packages(ignore_dot_gap=True) == all_installed_packages(gap=gap, ignore_dot_gap=True) + True + """ diff --git a/sagemath.spec b/sagemath.spec index b95322e..3132228 100644 --- a/sagemath.spec +++ b/sagemath.spec @@ -84,7 +84,7 @@ Name: sagemath Summary: A free open-source mathematics software system Version: 9.6 -Release: 5%{?dist} +Release: 6%{?dist} # The file ${SAGE_ROOT}/COPYING.txt is the upstream license breakdown file # Additionally, every $files section has a comment with the license name # before files with that license @@ -353,7 +353,6 @@ BuildRequires: python3-pplpy-devel BuildRequires: python3-tdlib-devel BuildRequires: python3-tkinter BuildRequires: pythran -BuildRequires: %{py3_dist argcomplete} BuildRequires: %{py3_dist argon2-cffi} %if %{with bundled_ipython} BuildRequires: %{py3_dist backcall} @@ -561,7 +560,6 @@ Requires: pari-gp Requires: pari-nftables Requires: pari-seadata Requires: python3-tdlib -Requires: %{py3_dist argcomplete} %if %{with bundled_ipython} Requires: %{py3_dist backcall} %endif @@ -957,34 +955,11 @@ pushd build/pkgs/threejs popd %endif -%patch0 -%patch1 -%patch2 -%patch3 -%patch4 -%patch5 -%patch6 -%patch7 -%patch8 -%patch9 -%patch10 -%patch11 -%patch12 - +%autopatch -p0 -M12 %if %{with fes} %patch13 %endif - -%patch14 -%patch15 -%patch16 -%patch17 -%patch18 -%patch19 -%patch20 -%patch21 -%patch22 -%patch23 +%autopatch -p0 -m14 sed -i 's|@@SAGE_LOCAL@@|%{SAGE_LOCAL}|' src/sage/env.py @@ -2040,6 +2015,9 @@ end ######################################################################## %changelog +* Wed Sep 21 2022 Jerry James - 9.6-6 +- Rebuild for gap 4.12.0 and pari 2.15.0 + * Tue Aug 23 2022 Mamoru TASAKA - 9.6-5 - Rebuild for gsl-2.7.1