From ecae6482c5d5d7d3e9fb0dcad91d4d08c39c0468 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Thu, 12 Sep 2019 20:34:03 -0600 Subject: [PATCH] Changes: - Improve the -ecm patch. - Add -formatargspec patch to silence doc-building warnings. - Add -data-elliptic_curves_large subpackage. - Build with bliss, coxeter3, and mcqd support. - Fix typo that made the singular.hlp file inaccessible. - Add more gap packages to get closer to the set shipped by upstream. - Refactor Requires so they apply to the correct subpackages. - More python 3 patching due to changes in python 3.8. - Use upstream's method of installing jupyter support. - Obsolete the sagemath-notebook-export subpackage. --- .gitignore | 1 + sagemath-cremona.patch | 54 ++----- sagemath-ecm.patch | 15 +- sagemath-escape.patch | 36 +++-- sagemath-extensions.patch | 70 +++++---- sagemath-fes.patch | 6 +- sagemath-formatargspec.patch | 173 +++++++++++++++++++++ sagemath-includes.patch | 34 ++--- sagemath-python3.patch | 282 ++++++++++++++++++++++++++++++++++- sagemath-sagedoc.patch | 2 +- sagemath.spec | 225 ++++++++++++++++++---------- sources | 1 + 12 files changed, 723 insertions(+), 176 deletions(-) create mode 100644 sagemath-formatargspec.patch diff --git a/.gitignore b/.gitignore index 47d07fd..6115d55 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /sage-*.tar.gz +/cremona-*.tar.gz diff --git a/sagemath-cremona.patch b/sagemath-cremona.patch index fa4baa4..7974057 100644 --- a/sagemath-cremona.patch +++ b/sagemath-cremona.patch @@ -1,43 +1,21 @@ diff -up src/sage/databases/cremona.py.orig src/sage/databases/cremona.py ---- src/sage/databases/cremona.py.orig 2018-12-22 16:37:08.000000000 -0700 -+++ src/sage/databases/cremona.py 2019-01-04 10:29:55.578694061 -0700 -@@ -53,7 +53,6 @@ from sage.misc.prandom import randint - - import sage.schemes.elliptic_curves.constructor as elliptic - from .sql_db import SQLDatabase, verify_column --from sage.misc.package import is_package_installed - from sage.env import CREMONA_MINI_DATA_DIR, CREMONA_LARGE_DATA_DIR - from sage.misc.all import walltime - -@@ -835,14 +834,6 @@ class MiniCremonaDatabase(SQLDatabase): - if N < self.largest_conductor(): - message = "There is no elliptic curve with label " + label \ - + " in the database" -- elif is_package_installed('database_cremona_ellcurve'): -- message = "There is no elliptic curve with label " + label \ -- + " in the currently available databases" -- else: -- message = "There is no elliptic curve with label " \ -- + label + " in the default database; try installing " \ -- + "the optional package database_cremona_ellcurve which " \ +--- src/sage/databases/cremona.py.orig 2019-06-26 14:41:04.000000000 -0600 ++++ src/sage/databases/cremona.py 2019-09-09 15:37:13.321511378 -0600 +@@ -842,7 +842,8 @@ class MiniCremonaDatabase(SQLDatabase): + message = "There is no elliptic curve with label " \ + + label + " in the default database; try installing " \ + + "the optional package database_cremona_ellcurve which " \ - + "contains the complete Cremona database" ++ + "contains the complete Cremona database: " \ ++ + "sudo dnf install sagemath-data-elliptic_curves_large" raise ValueError(message) ainvs = eval(c[0]) data = {'cremona_label': label, -@@ -1683,10 +1674,12 @@ def CremonaDatabase(name=None,mini=None, - if name is None and not set_global: - return _db - if set_global and name is None: -- if is_package_installed('database_cremona_ellcurve'): -- name = 'cremona' -- else: -- name = 'cremona mini' -+ # currently the sagemath rpm package only installs cremona mini -+ #if is_package_installed('database_cremona_ellcurve'): -+ # name = 'cremona' -+ #else: -+ # name = 'cremona mini' -+ name = 'cremona mini' - if name == 'cremona': - mini = False - elif name == 'cremona mini': +@@ -1640,6 +1641,7 @@ class LargeCremonaDatabase(MiniCremonaDa + con.executemany("UPDATE t_curve SET gens=? WHERE curve=?", \ + curve_data) + print("Committing...") ++ self.commit() + if largest_conductor and int(v[0]) > largest_conductor: break + + _db = None diff --git a/sagemath-ecm.patch b/sagemath-ecm.patch index a8e5034..3857cbe 100644 --- a/sagemath-ecm.patch +++ b/sagemath-ecm.patch @@ -1,12 +1,21 @@ diff -up src/sage/interfaces/ecm.py.orig src/sage/interfaces/ecm.py ---- src/sage/interfaces/ecm.py.orig 2018-12-22 16:37:08.000000000 -0700 -+++ src/sage/interfaces/ecm.py 2019-01-15 10:26:31.060040736 -0700 +--- src/sage/interfaces/ecm.py.orig 2019-06-26 14:41:04.000000000 -0600 ++++ src/sage/interfaces/ecm.py 2019-09-04 09:29:09.529723744 -0600 +@@ -39,7 +39,7 @@ from __future__ import print_function + + from six import iteritems, PY2 + +-import os ++import subprocess + import re + + from sage.structure.sage_object import SageObject @@ -256,7 +256,7 @@ class ECM(SageObject): """ print("Enter numbers to run ECM on them.") print("Press control-C to exit.") - os.system(self._cmd) -+ os.system(' '.join(self._cmd)) ++ subprocess.call(self._cmd) # Recommended settings from # http://www.mersennewiki.org/index.php/Elliptic_Curve_Method diff --git a/sagemath-escape.patch b/sagemath-escape.patch index 16ee016..d81a410 100644 --- a/sagemath-escape.patch +++ b/sagemath-escape.patch @@ -1,3 +1,15 @@ +diff -up src/sage/algebras/clifford_algebra.py.orig src/sage/algebras/clifford_algebra.py +--- src/sage/algebras/clifford_algebra.py.orig 2019-06-26 14:41:04.000000000 -0600 ++++ src/sage/algebras/clifford_algebra.py 2019-09-11 15:46:56.658681891 -0600 +@@ -1520,7 +1520,7 @@ class ExteriorAlgebra(CliffordAlgebra): + return term + + def _ascii_art_term(self, m): +- """ ++ r""" + Return ascii art for the basis element indexed by ``m``. + + EXAMPLES:: diff -up src/sage/combinat/crystals/alcove_path.py.orig src/sage/combinat/crystals/alcove_path.py --- src/sage/combinat/crystals/alcove_path.py.orig 2019-06-26 14:41:04.000000000 -0600 +++ src/sage/combinat/crystals/alcove_path.py 2019-06-27 11:46:03.613253846 -0600 @@ -10,15 +22,15 @@ diff -up src/sage/combinat/crystals/alcove_path.py.orig src/sage/combinat/crysta search algorithm. .. WARNING:: -diff -up src/sage/homology/homology_group.py.orig src/sage/homology/homology_group.py ---- src/sage/homology/homology_group.py.orig 2019-06-26 14:41:04.000000000 -0600 -+++ src/sage/homology/homology_group.py 2019-06-27 11:46:03.614253830 -0600 -@@ -109,7 +109,7 @@ class HomologyGroup_class(AdditiveAbelia - sage: from sage.homology.homology_group import HomologyGroup - sage: H = HomologyGroup(7, ZZ, [4,4,4,4,4,7,7]) - sage: H._latex_() -- 'C_{4}^{5} \\times C_{7} \\times C_{7}' -+ 'C_{4}^{5} \times C_{7} \times C_{7}' - sage: latex(HomologyGroup(6, ZZ)) - \ZZ^{6} - """ +diff -up src/sage/rings/lazy_laurent_series_ring.py.orig src/sage/rings/lazy_laurent_series_ring.py +--- src/sage/rings/lazy_laurent_series_ring.py.orig 2019-06-26 14:41:05.000000000 -0600 ++++ src/sage/rings/lazy_laurent_series_ring.py 2019-09-11 15:41:19.871081870 -0600 +@@ -260,7 +260,7 @@ class LazyLaurentSeriesRing(UniqueRepres + return self._element_constructor_(0) + + def series(self, coefficient, valuation, constant=None): +- """ ++ r""" + Return a lazy Laurent series. + + INPUT: diff --git a/sagemath-extensions.patch b/sagemath-extensions.patch index 01b43b2..4aa640e 100644 --- a/sagemath-extensions.patch +++ b/sagemath-extensions.patch @@ -1,29 +1,25 @@ diff -up src/module_list.py.orig src/module_list.py --- src/module_list.py.orig 2019-06-26 14:41:04.000000000 -0600 -+++ src/module_list.py 2019-06-27 11:29:54.622601184 -0600 ++++ src/module_list.py 2019-09-11 08:38:22.467995023 -0600 @@ -357,16 +357,16 @@ ext_modules = [ Extension('sage.graphs.matchpoly', sources = ['sage/graphs/matchpoly.pyx']), - OptionalExtension("sage.graphs.mcqd", -- ["sage/graphs/mcqd.pyx"], -- language = "c++", ++ Extension("sage.graphs.mcqd", + ["sage/graphs/mcqd.pyx"], + language = "c++", - package = 'mcqd'), -+# OptionalExtension("sage.graphs.mcqd", -+# ["sage/graphs/mcqd.pyx"], -+# language = "c++", -+# package = 'mcqd'), ++ libraries = ['mcqd']), - OptionalExtension("sage.graphs.bliss", -- ["sage/graphs/bliss.pyx"], -- language = "c++", ++ Extension("sage.graphs.bliss", + ["sage/graphs/bliss.pyx"], + language = "c++", - libraries = ['bliss'], - package = 'bliss'), -+# OptionalExtension("sage.graphs.bliss", -+# ["sage/graphs/bliss.pyx"], -+# language = "c++", -+# libraries = ['bliss'], -+# package = 'bliss'), ++ include_dirs = ['/usr/include/bliss'], ++ libraries = ['bliss']), Extension('sage.graphs.planarity', sources = ['sage/graphs/planarity.pyx'], @@ -42,22 +38,19 @@ diff -up src/module_list.py.orig src/module_list.py Extension('sage.graphs.spanning_tree', sources = ['sage/graphs/spanning_tree.pyx']), -@@ -461,21 +461,20 @@ ext_modules = [ +@@ -461,21 +461,19 @@ ext_modules = [ ## ################################ - OptionalExtension('sage.libs.coxeter3.coxeter', -- sources = ['sage/libs/coxeter3/coxeter.pyx'], ++ Extension('sage.libs.coxeter3.coxeter', + sources = ['sage/libs/coxeter3/coxeter.pyx'], - include_dirs = [os.path.join(SAGE_INC, 'coxeter')], -- language="c++", ++ include_dirs = ['/usr/include/coxeter'], + language="c++", - libraries = ['coxeter3'], - package = 'coxeter3'), -+# OptionalExtension('sage.libs.coxeter3.coxeter', -+# sources = ['sage/libs/coxeter3/coxeter.pyx'], -+# include_dirs = [os.path.join(SAGE_INC, 'coxeter')], -+# language="c++", -+# libraries = ['coxeter3'], -+# package = 'coxeter3'), ++ libraries = ['coxeter3']), Extension('sage.libs.ecl', sources = ["sage/libs/ecl.pyx"]), @@ -72,7 +65,34 @@ diff -up src/module_list.py.orig src/module_list.py Extension('sage.libs.flint.flint', sources = ["sage/libs/flint/flint.pyx"], -@@ -841,10 +840,10 @@ ext_modules = [ +@@ -504,10 +502,9 @@ ext_modules = [ + sources = ["sage/libs/homfly.pyx"], + libraries = ["homfly", "gc"]), + +- OptionalExtension('sage.libs.sirocco', ++ Extension('sage.libs.sirocco', + sources = ["sage/libs/sirocco.pyx"], + libraries = ["sirocco"], +- package="sirocco", + language = 'c++'), + + Extension('*', ['sage/libs/linbox/*.pyx']), +@@ -527,10 +524,10 @@ ext_modules = [ + Extension('sage.libs.lrcalc.lrcalc', + sources = ["sage/libs/lrcalc/lrcalc.pyx"]), + +- OptionalExtension("sage.libs.meataxe", +- sources = ['sage/libs/meataxe.pyx'], +- libraries = ['mtx'], +- package = 'meataxe'), ++# OptionalExtension("sage.libs.meataxe", ++# sources = ['sage/libs/meataxe.pyx'], ++# libraries = ['mtx'], ++# package = 'meataxe'), + + Extension('*', ['sage/libs/pari/*.pyx']), + +@@ -841,10 +838,10 @@ ext_modules = [ Extension('sage.matrix.matrix_window', sources = ['sage/matrix/matrix_window.pyx']), @@ -87,7 +107,7 @@ diff -up src/module_list.py.orig src/module_list.py Extension('sage.matrix.misc', sources = ['sage/matrix/misc.pyx']), -@@ -1021,26 +1020,25 @@ ext_modules = [ +@@ -1021,26 +1018,25 @@ ext_modules = [ Extension("sage.numerical.backends.interactivelp_backend", ["sage/numerical/backends/interactivelp_backend.pyx"]), diff --git a/sagemath-fes.patch b/sagemath-fes.patch index 4bb46d1..093df9b 100644 --- a/sagemath-fes.patch +++ b/sagemath-fes.patch @@ -1,7 +1,7 @@ diff -up src/module_list.py.orig src/module_list.py ---- src/module_list.py.orig 2019-06-27 11:38:23.103196674 -0600 -+++ src/module_list.py 2019-06-27 11:44:42.052478294 -0600 -@@ -471,10 +471,10 @@ ext_modules = [ +--- src/module_list.py.orig 2019-09-11 08:51:57.722696682 -0600 ++++ src/module_list.py 2019-09-11 08:52:38.084040542 -0600 +@@ -470,10 +470,10 @@ ext_modules = [ Extension('sage.libs.ecl', sources = ["sage/libs/ecl.pyx"]), diff --git a/sagemath-formatargspec.patch b/sagemath-formatargspec.patch new file mode 100644 index 0000000..e03392b --- /dev/null +++ b/sagemath-formatargspec.patch @@ -0,0 +1,173 @@ +diff -up src/sage/misc/sageinspect.py.orig src/sage/misc/sageinspect.py +--- src/sage/misc/sageinspect.py.orig 2019-06-26 14:41:05.000000000 -0600 ++++ src/sage/misc/sageinspect.py 2019-09-11 08:58:24.194413905 -0600 +@@ -1658,6 +1658,121 @@ def sage_getargspec(obj): + defaults = None + return inspect.ArgSpec(args, varargs, varkw, defaults) + ++def formatannotation(annotation, base_module=None): ++ """ ++ This is taken from Python 3.7's inspect.py; the only change is to ++ add documentation. ++ ++ INPUT: ++ ++ - ``annotation`` -- annotation for a function ++ - ``base_module`` (optional, default ``None``) ++ ++ This is only relevant with Python 3, so the doctests are marked ++ accordingly. ++ ++ EXAMPLES:: ++ ++ sage: from sage.misc.sageinspect import formatannotation ++ sage: import inspect ++ sage: def foo(a, *, b:int, **kwargs): # py3 ++ ....: pass ++ ....: ++ sage: s = inspect.signature(foo) # py3 ++ ++ sage: a = s.parameters['a'].annotation # py3 ++ sage: a # py3 ++ ++ sage: formatannotation(a) # py3 ++ 'inspect._empty' ++ ++ sage: b = s.parameters['b'].annotation # py3 ++ sage: b # py3 ++ ++ sage: formatannotation(b) # py3 ++ 'int' ++ """ ++ if getattr(annotation, '__module__', None) == 'typing': ++ return repr(annotation).replace('typing.', '') ++ if isinstance(annotation, type): ++ if annotation.__module__ in ('builtins', base_module): ++ return annotation.__qualname__ ++ return annotation.__module__+'.'+annotation.__qualname__ ++ return repr(annotation) ++ ++def sage_formatargspec(args, varargs=None, varkw=None, defaults=None, ++ kwonlyargs=(), kwonlydefaults={}, annotations={}, ++ formatarg=str, ++ formatvarargs=lambda name: '*' + name, ++ formatvarkw=lambda name: '**' + name, ++ formatvalue=lambda value: '=' + repr(value), ++ formatreturns=lambda text: ' -> ' + text, ++ formatannotation=formatannotation): ++ """ ++ Format an argument spec from the values returned by getfullargspec. ++ ++ The first seven arguments are (args, varargs, varkw, defaults, ++ kwonlyargs, kwonlydefaults, annotations). The other five arguments ++ are the corresponding optional formatting functions that are called to ++ turn names and values into strings. The last argument is an optional ++ function to format the sequence of arguments. ++ ++ This is taken from Python 3.7's inspect.py, where it is ++ deprecated. The only change, aside from documentation (this ++ paragraph and the next, plus doctests), is to remove the ++ deprecation warning. ++ ++ Sage uses this function to format arguments, as obtained by ++ :func:`sage_getargspec`. Since :func:`sage_getargspec` works for ++ Cython functions while Python's inspect module does not, it makes ++ sense to keep this function for formatting instances of ++ ``inspect.ArgSpec``. ++ ++ EXAMPLES:: ++ ++ sage: from sage.misc.sageinspect import sage_formatargspec ++ sage: from inspect import formatargspec # deprecated in Python 3 ++ sage: args = ['a', 'b', 'c'] ++ sage: defaults = [3] ++ sage: sage_formatargspec(args, defaults=defaults) ++ '(a, b, c=3)' ++ sage: formatargspec(args, defaults=defaults) == sage_formatargspec(args, defaults=defaults) # py2 ++ True ++ sage: formatargspec(args, defaults=defaults) == sage_formatargspec(args, defaults=defaults) # py3 ++ doctest:...: DeprecationWarning: `formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directly ++ True ++ """ ++ def formatargandannotation(arg): ++ result = formatarg(arg) ++ if arg in annotations: ++ result += ': ' + formatannotation(annotations[arg]) ++ return result ++ specs = [] ++ if defaults: ++ firstdefault = len(args) - len(defaults) ++ for i, arg in enumerate(args): ++ spec = formatargandannotation(arg) ++ if defaults and i >= firstdefault: ++ spec = spec + formatvalue(defaults[i - firstdefault]) ++ specs.append(spec) ++ if varargs is not None: ++ specs.append(formatvarargs(formatargandannotation(varargs))) ++ else: ++ if kwonlyargs: ++ specs.append('*') ++ if kwonlyargs: ++ for kwonlyarg in kwonlyargs: ++ spec = formatargandannotation(kwonlyarg) ++ if kwonlydefaults and kwonlyarg in kwonlydefaults: ++ spec += formatvalue(kwonlydefaults[kwonlyarg]) ++ specs.append(spec) ++ if varkw is not None: ++ specs.append(formatvarkw(formatargandannotation(varkw))) ++ result = '(' + ', '.join(specs) + ')' ++ if 'return' in annotations: ++ result += formatreturns(formatannotation(annotations['return'])) ++ return result ++ + + def sage_getdef(obj, obj_name=''): + r""" +@@ -1693,7 +1808,7 @@ def sage_getdef(obj, obj_name=''): + """ + try: + spec = sage_getargspec(obj) +- s = str(inspect.formatargspec(*spec)) ++ s = str(sage_formatargspec(*spec)) + s = s.strip('(').strip(')').strip() + if s[:4] == 'self': + s = s[4:] +diff -up src/sage_setup/docbuild/ext/sage_autodoc.py.orig src/sage_setup/docbuild/ext/sage_autodoc.py +--- src/sage_setup/docbuild/ext/sage_autodoc.py.orig 2019-06-26 14:41:05.000000000 -0600 ++++ src/sage_setup/docbuild/ext/sage_autodoc.py 2019-09-11 08:59:53.728932096 -0600 +@@ -38,7 +38,7 @@ from six import PY2, iteritems, itervalu + import sphinx + from sphinx.errors import ExtensionError + from sphinx.ext.autodoc.importer import mock, import_object, get_object_members +-from sphinx.ext.autodoc.inspector import format_annotation, formatargspec ++from sphinx.ext.autodoc.inspector import format_annotation + from sphinx.locale import _, __ + from sphinx.pycode import ModuleAnalyzer + from sphinx.errors import ExtensionError, PycodeError +@@ -51,7 +51,8 @@ from sphinx.util.inspect import Signatur + from sphinx.util.inspect import getargspec + + from sage.misc.sageinspect import (sage_getdoc_original, +- sage_getargspec, isclassinstance) ++ sage_getargspec, isclassinstance, ++ sage_formatargspec) + from sage.misc.lazy_import import LazyImport + + # This is used to filter objects of classes that inherit from +@@ -123,6 +124,16 @@ def bool_option(arg): + return True + + ++def formatargspec(function, args, varargs=None, varkw=None, defaults=None, ++ kwonlyargs=(), kwonlydefaults={}, annotations={}): ++ """ ++ Sphinx's version of formatargspec is deprecated, so use Sage's instead. ++ """ ++ return sage_formatargspec(args, varargs=varargs, varkw=varkw, defaults=defaults, ++ kwonlyargs=kwonlyargs, kwonlydefaults=kwonlydefaults, ++ annotations=annotations) ++ ++ + class AutodocReporter(object): + """ + A reporter replacement that assigns the correct source name diff --git a/sagemath-includes.patch b/sagemath-includes.patch index 3ed9e79..ef1e1cb 100644 --- a/sagemath-includes.patch +++ b/sagemath-includes.patch @@ -1,6 +1,6 @@ diff -up src/module_list.py.orig src/module_list.py ---- src/module_list.py.orig 2019-06-27 11:38:23.103196674 -0600 -+++ src/module_list.py 2019-06-27 11:47:48.026686317 -0600 +--- src/module_list.py.orig 2019-09-11 08:52:38.084040542 -0600 ++++ src/module_list.py 2019-09-11 09:03:51.394981074 -0600 @@ -44,6 +44,9 @@ zlib_libs = zlib_pc['libraries'] zlib_library_dirs = zlib_pc['library_dirs'] zlib_include_dirs = zlib_pc['include_dirs'] @@ -36,7 +36,7 @@ diff -up src/module_list.py.orig src/module_list.py Extension('*', sources = ['sage/algebras/finite_dimensional_algebras/*.pyx']), -@@ -524,7 +536,8 @@ ext_modules = [ +@@ -522,7 +534,8 @@ ext_modules = [ [])), Extension('sage.libs.lrcalc.lrcalc', @@ -44,9 +44,9 @@ diff -up src/module_list.py.orig src/module_list.py + sources = ["sage/libs/lrcalc/lrcalc.pyx"], + include_dirs = [os.path.join(SAGE_INC, 'lrcalc')]), - OptionalExtension("sage.libs.meataxe", - sources = ['sage/libs/meataxe.pyx'], -@@ -546,23 +559,28 @@ ext_modules = [ + # OptionalExtension("sage.libs.meataxe", + # sources = ['sage/libs/meataxe.pyx'], +@@ -544,23 +557,28 @@ ext_modules = [ sources = ['sage/libs/readline.pyx'], libraries = ['readline']), @@ -80,7 +80,7 @@ diff -up src/module_list.py.orig src/module_list.py ################################### ## -@@ -570,7 +588,8 @@ ext_modules = [ +@@ -568,7 +586,8 @@ ext_modules = [ ## ################################### @@ -90,7 +90,7 @@ diff -up src/module_list.py.orig src/module_list.py ################################### ## -@@ -742,7 +761,8 @@ ext_modules = [ +@@ -740,7 +759,8 @@ ext_modules = [ Extension("sage.matrix.matrix_complex_ball_dense", ["sage/matrix/matrix_complex_ball_dense.pyx"], @@ -100,7 +100,7 @@ diff -up src/module_list.py.orig src/module_list.py Extension('sage.matrix.matrix_complex_double_dense', sources = ['sage/matrix/matrix_complex_double_dense.pyx']), -@@ -750,6 +770,7 @@ ext_modules = [ +@@ -748,6 +768,7 @@ ext_modules = [ Extension('sage.matrix.matrix_cyclo_dense', sources = ['sage/matrix/matrix_cyclo_dense.pyx'], language = "c++", @@ -108,7 +108,7 @@ diff -up src/module_list.py.orig src/module_list.py libraries=['ntl']), Extension('sage.matrix.matrix_gap', -@@ -812,6 +833,7 @@ ext_modules = [ +@@ -810,6 +831,7 @@ ext_modules = [ sources = ['sage/matrix/matrix_modn_sparse.pyx']), Extension('sage.matrix.matrix_mpolynomial_dense', @@ -116,7 +116,7 @@ diff -up src/module_list.py.orig src/module_list.py sources = ['sage/matrix/matrix_mpolynomial_dense.pyx']), Extension('sage.matrix.matrix_polynomial_dense', -@@ -1101,7 +1123,8 @@ ext_modules = [ +@@ -1099,7 +1121,8 @@ ext_modules = [ language = 'c++'), Extension("sage.rings.complex_arb", @@ -126,7 +126,7 @@ diff -up src/module_list.py.orig src/module_list.py Extension('sage.rings.complex_double', sources = ['sage/rings/complex_double.pyx'], -@@ -1177,7 +1200,8 @@ ext_modules = [ +@@ -1175,7 +1198,8 @@ ext_modules = [ sources = ['sage/rings/real_interval_absolute.pyx']), Extension("sage.rings.real_arb", @@ -136,7 +136,7 @@ diff -up src/module_list.py.orig src/module_list.py Extension('sage.rings.real_lazy', sources = ['sage/rings/real_lazy.pyx']), -@@ -1260,6 +1284,7 @@ ext_modules = [ +@@ -1258,6 +1282,7 @@ ext_modules = [ Extension('sage.rings.number_field.number_field_element_quadratic', sources = ['sage/rings/number_field/number_field_element_quadratic.pyx'], @@ -144,7 +144,7 @@ diff -up src/module_list.py.orig src/module_list.py libraries=['ntl'], language = 'c++'), -@@ -1399,12 +1424,15 @@ ext_modules = [ +@@ -1397,12 +1422,15 @@ ext_modules = [ sources = ['sage/rings/polynomial/multi_polynomial.pyx']), Extension('sage.rings.polynomial.multi_polynomial_ideal_libsingular', @@ -160,7 +160,7 @@ diff -up src/module_list.py.orig src/module_list.py sources = ['sage/rings/polynomial/multi_polynomial_libsingular.pyx']), Extension('sage.rings.polynomial.multi_polynomial_ring_base', -@@ -1417,7 +1445,8 @@ ext_modules = [ +@@ -1415,7 +1443,8 @@ ext_modules = [ sources = ['sage/rings/polynomial/polydict.pyx']), Extension('sage.rings.polynomial.polynomial_complex_arb', @@ -171,8 +171,8 @@ diff -up src/module_list.py.orig src/module_list.py Extension('sage.rings.polynomial.polynomial_compiled', sources = ['sage/rings/polynomial/polynomial_compiled.pyx']), diff -up src/setup.py.orig src/setup.py ---- src/setup.py.orig 2019-06-27 11:38:14.984320180 -0600 -+++ src/setup.py 2019-06-27 11:47:48.027686302 -0600 +--- src/setup.py.orig 2019-09-11 08:51:46.080885941 -0600 ++++ src/setup.py 2019-09-11 09:03:51.394981074 -0600 @@ -85,6 +85,7 @@ keep_going = False # search for dependencies and add to gcc -I diff --git a/sagemath-python3.patch b/sagemath-python3.patch index 28cc7bf..74b2331 100644 --- a/sagemath-python3.patch +++ b/sagemath-python3.patch @@ -132,6 +132,18 @@ diff -up build/pkgs/sagetex/src/remote-sagetex.py.orig build/pkgs/sagetex/src/re if not password: from getpass import getpass +diff -up build/pkgs/sagetex/src/sagetexparse.py.orig build/pkgs/sagetex/src/sagetexparse.py +--- build/pkgs/sagetex/src/sagetexparse.py.orig 2019-01-09 09:51:28.000000000 -0700 ++++ build/pkgs/sagetex/src/sagetexparse.py 2019-09-10 12:24:06.752516723 -0600 +@@ -132,7 +132,7 @@ class SageCodeExtractor(): + + def plotout(self, s, l, t): + self.result += '# \\sageplot{} from line %s:\n' % lineno(l, s) +- if t.format is not '': ++ if t.format != '': + self.result += '# format: %s' % t.format[0][1:-1] + '\n' + self.result += t.code[1:-1] + '\n\n' + diff -up src/doc/common/conf.py.orig src/doc/common/conf.py --- src/doc/common/conf.py.orig 2019-06-26 14:41:04.000000000 -0600 +++ src/doc/common/conf.py 2019-06-27 11:33:54.099080488 -0600 @@ -153,6 +165,18 @@ diff -up src/doc/common/conf.py.orig src/doc/common/conf.py return True objname = getattr(obj, "__name__", None) +diff -up src/sage/coding/linear_code.py.orig src/sage/coding/linear_code.py +--- src/sage/coding/linear_code.py.orig 2019-06-26 14:41:04.000000000 -0600 ++++ src/sage/coding/linear_code.py 2019-09-10 12:21:10.421332817 -0600 +@@ -3793,7 +3793,7 @@ class LinearCode(AbstractLinearCode): + [1 2 1] + [2 1 1] + """ +- if encoder_name is None or encoder_name is 'GeneratorMatrix': ++ if encoder_name is None or encoder_name == 'GeneratorMatrix': + g = self._generator_matrix + else: + g = super(LinearCode, self).generator_matrix(encoder_name, **kwargs) diff -up src/sage/combinat/finite_state_machine.py.orig src/sage/combinat/finite_state_machine.py --- src/sage/combinat/finite_state_machine.py.orig 2019-06-26 14:41:04.000000000 -0600 +++ src/sage/combinat/finite_state_machine.py 2019-06-27 11:36:38.804783269 -0600 @@ -174,9 +198,42 @@ diff -up src/sage/combinat/finite_state_machine.py.orig src/sage/combinat/finite """ This class takes an input, feeds it into a finite state machine (automaton or transducer, in particular), tests whether this was +diff -up src/sage/combinat/multiset_partition_into_sets_ordered.py.orig src/sage/combinat/multiset_partition_into_sets_ordered.py +--- src/sage/combinat/multiset_partition_into_sets_ordered.py.orig 2019-06-26 14:41:04.000000000 -0600 ++++ src/sage/combinat/multiset_partition_into_sets_ordered.py 2019-09-10 12:20:47.787694285 -0600 +@@ -1952,7 +1952,7 @@ class OrderedMultisetPartitionsIntoSets( + + # slice by 'order' + if "alphabet" in fc: +- no_alpha = {k: v for (k, v) in iteritems(self.constraints) if k is not "alphabet"} ++ no_alpha = {k: v for (k, v) in iteritems(self.constraints) if k != "alphabet"} + return OrderedMultisetPartitionsIntoSets(fc["alphabet"], size, **no_alpha) + + # slice by 'size' +diff -up src/sage/combinat/root_system/branching_rules.py.orig src/sage/combinat/root_system/branching_rules.py +--- src/sage/combinat/root_system/branching_rules.py.orig 2019-06-26 14:41:04.000000000 -0600 ++++ src/sage/combinat/root_system/branching_rules.py 2019-09-09 15:08:59.383139652 -0600 +@@ -1750,7 +1750,7 @@ def branching_rule(Rtype, Stype, rule="d + elif rule == "tensor" or rule == "tensor-debug": + if not Stype.is_compound(): + raise ValueError("Tensor product requires more than one factor") +- if len(stypes) is not 2: ++ if len(stypes) != 2: + raise ValueError("Not implemented") + if Rtype[0] == 'A': + nr = Rtype[1]+1 diff -up src/sage/cpython/dict_del_by_value.pyx.orig src/sage/cpython/dict_del_by_value.pyx --- src/sage/cpython/dict_del_by_value.pyx.orig 2019-06-26 14:41:04.000000000 -0600 -+++ src/sage/cpython/dict_del_by_value.pyx 2019-06-27 11:33:54.103080432 -0600 ++++ src/sage/cpython/dict_del_by_value.pyx 2019-09-09 15:32:24.921024261 -0600 +@@ -291,7 +291,7 @@ ELIF PY_VERSION_HEX>=0x03060000: + #general lookup function (which can deal with DKIX_DUMMY) + PyDict_GetItemWithError(mp,None) + #this can actually fail if mp is a dictionary with split table +- assert DK_LOOKUP(mp) == lookdict ++ #assert DK_LOOKUP(mp) == lookdict + + cdef del_dictitem_by_exact_value(PyDictObject *mp, PyObject *value, Py_hash_t hash): + """ @@ -347,8 +347,8 @@ ELIF PY_VERSION_HEX>=0x03060000: cdef MyPyDictKeysObject * keys = (mp.ma_keys) cdef size_t perturb @@ -200,6 +257,67 @@ diff -up src/sage/geometry/triangulation/point_configuration.py.orig src/sage/ge proc.expect(r'Evaluating Commandline Options \.\.\.') proc.expect(r'\.\.\. done\.') proc.setecho(0) +diff -up src/sage/graphs/graph_latex.py.orig src/sage/graphs/graph_latex.py +--- src/sage/graphs/graph_latex.py.orig 2019-06-26 14:41:04.000000000 -0600 ++++ src/sage/graphs/graph_latex.py 2019-09-10 12:23:28.891121378 -0600 +@@ -1156,7 +1156,7 @@ class GraphLatex(SageObject): + # + elif name in color_dicts: + if not isinstance(value, dict): +- raise TypeError('%s option must be a dictionary, not %s' (name, value)) ++ raise TypeError('%s option must be a dictionary, not %s' % (name, value)) + else: + for key, c in value.items(): + try: +@@ -1165,42 +1165,42 @@ class GraphLatex(SageObject): + raise ValueError('%s option for %s needs to be a matplotlib color (always as a string), not %s' % (name, key, c)) + elif name in positive_scalar_dicts: + if not isinstance(value, dict): +- raise TypeError('%s option must be a dictionary, not %s' (name, value)) ++ raise TypeError('%s option must be a dictionary, not %s' % (name, value)) + else: + for key, x in value.items(): + if not type(x) in [int, Integer, float, RealLiteral] or not x >= 0.0: + raise ValueError('%s option for %s needs to be a positive number, not %s' % (name, key, x)) + elif name in boolean_dicts: + if not isinstance(value, dict): +- raise TypeError('%s option must be a dictionary, not %s' (name, value)) ++ raise TypeError('%s option must be a dictionary, not %s' % (name, value)) + else: + for key, b in value.items(): + if not isinstance(b, bool): + raise ValueError('%s option for %s needs to be True or False, not %s' % (name, key, b)) + elif name == 'vertex_shapes': + if not isinstance(value, dict): +- raise TypeError('%s option must be a dictionary, not %s' (name, value)) ++ raise TypeError('%s option must be a dictionary, not %s' % (name, value)) + else: + for key, s in value.items(): + if s not in shape_names: + raise ValueError('%s option for %s needs to be a vertex shape, not %s' % (name, key, s)) + elif name == 'vertex_label_placements': + if not isinstance(value, dict): +- raise TypeError('%s option must be a dictionary, not %s' (name, value)) ++ raise TypeError('%s option must be a dictionary, not %s' % (name, value)) + else: + for key, p in value.items(): + if not(p == 'center') and not(isinstance(p, tuple) and len(p) == 2 and type(p[0]) in number_types and p[0] >= 0 and type(p[1]) in number_types and p[1] >= 0): + raise ValueError('%s option for %s needs to be None or a pair of positive numbers, not %s' % (name, key, p)) + elif name == 'edge_label_placements': + if not isinstance(value, dict): +- raise TypeError('%s option must be a dictionary, not %s' (name, value)) ++ raise TypeError('%s option must be a dictionary, not %s' % (name, value)) + else: + for key, p in value.items(): + if not(type(p) in [float, RealLiteral] and (0 <= p) and (p <= 1)) and not(p in label_places): + raise ValueError('%s option for %s needs to be a number between 0.0 and 1.0 or a place (like "above"), not %s' % (name, key, p)) + elif name == 'loop_placements': + if not isinstance(value, dict): +- raise TypeError('%s option must be a dictionary, not %s' (name, value)) ++ raise TypeError('%s option must be a dictionary, not %s' % (name, value)) + else: + for key, p in value.items(): + if not((isinstance(p, tuple)) and (len(p) == 2) and (p[0] >= 0) and (p[1] in compass_points)): diff -up src/sage/interfaces/frobby.py.orig src/sage/interfaces/frobby.py --- src/sage/interfaces/frobby.py.orig 2019-06-26 14:41:04.000000000 -0600 +++ src/sage/interfaces/frobby.py 2019-06-27 11:33:54.103080432 -0600 @@ -314,6 +432,144 @@ diff -up src/sage/interfaces/sagespawn.pyx.orig src/sage/interfaces/sagespawn.py except (OSError, IOError): pass self.fileobj.close() +diff -up src/sage/libs/coxeter3/coxeter.pyx.orig src/sage/libs/coxeter3/coxeter.pyx +--- src/sage/libs/coxeter3/coxeter.pyx.orig 2019-06-26 14:41:05.000000000 -0600 ++++ src/sage/libs/coxeter3/coxeter.pyx 2019-09-12 14:57:59.755712128 -0600 +@@ -32,7 +32,7 @@ cdef class String: + EXAMPLES:: + + sage: from sage.libs.coxeter3.coxeter import String # optional - coxeter3 +- sage: s = String("hello"); s # optional - coxeter3 ++ sage: s = String(b"hello"); s # optional - coxeter3 + hello + sage: del s # optional - coxeter3 + """ +@@ -43,11 +43,11 @@ cdef class String: + EXAMPLES:: + + sage: from sage.libs.coxeter3.coxeter import String # optional - coxeter3 +- sage: s = String('Hi') # optional - coxeter3 ++ sage: s = String(b'Hi') # optional - coxeter3 + sage: s # optional - coxeter3 + Hi + """ +- return self.x.ptr() ++ return self.x.ptr().decode('utf-8') + + def __hash__(self): + """ +@@ -59,7 +59,7 @@ cdef class String: + EXAMPLES:: + + sage: from sage.libs.coxeter3.coxeter import String # optional - coxeter3 +- sage: s = String('hello') # optional - coxeter3 ++ sage: s = String(b'hello') # optional - coxeter3 + sage: hash(s) == hash('hello') # optional - coxeter3 + True + """ +@@ -70,9 +70,9 @@ cdef class String: + EXAMPLES:: + + sage: from sage.libs.coxeter3.coxeter import String # optional - coxeter3 +- sage: ta1 = String('A') # optional - coxeter3 +- sage: ta2 = String('A') # optional - coxeter3 +- sage: tb = String('b') # optional - coxeter3 ++ sage: ta1 = String(b'A') # optional - coxeter3 ++ sage: ta2 = String(b'A') # optional - coxeter3 ++ sage: tb = String(b'b') # optional - coxeter3 + sage: ta1 == ta2 # optional - coxeter3 + True + sage: tb != ta1 # optional - coxeter3 +@@ -108,7 +108,7 @@ cdef class String: + EXAMPLES:: + + sage: from sage.libs.coxeter3.coxeter import String # optional - coxeter3 +- sage: s = String('Hi') # optional - coxeter3 ++ sage: s = String(b'Hi') # optional - coxeter3 + sage: len(s) # optional - coxeter3 + 2 + """ +@@ -119,7 +119,7 @@ cdef class String: + EXAMPLES:: + + sage: from sage.libs.coxeter3.coxeter import String # optional - coxeter3 +- sage: s = String('Hi') # optional - coxeter3 ++ sage: s = String(b'Hi') # optional - coxeter3 + sage: TestSuite(s).run() # optional - coxeter3 + """ + return (String, (repr(self),) ) +@@ -133,7 +133,7 @@ cdef class Type: + EXAMPLES:: + + sage: from sage.libs.coxeter3.coxeter import Type # optional - coxeter3 +- sage: t = Type('A'); t # optional - coxeter3 ++ sage: t = Type(b'A'); t # optional - coxeter3 + A + sage: del t # optional - coxeter3 + """ +@@ -144,17 +144,17 @@ cdef class Type: + EXAMPLES:: + + sage: from sage.libs.coxeter3.coxeter import Type # optional - coxeter3 +- sage: t = Type('A'); t # optional - coxeter3 ++ sage: t = Type(b'A'); t # optional - coxeter3 + A + """ +- return self.x.name().ptr() ++ return self.x.name().ptr().decode('utf-8') + + def name(self): + """ + EXAMPLES:: + + sage: from sage.libs.coxeter3.coxeter import Type # optional - coxeter3 +- sage: t = Type('A') # optional - coxeter3 ++ sage: t = Type(b'A') # optional - coxeter3 + sage: t.name() # optional - coxeter3 + A + """ +@@ -170,8 +170,8 @@ cdef class Type: + EXAMPLES:: + + sage: from sage.libs.coxeter3.coxeter import Type # optional - coxeter3 +- sage: a = Type('A') # optional - coxeter3 +- sage: b = Type('B') # optional - coxeter3 ++ sage: a = Type(b'A') # optional - coxeter3 ++ sage: b = Type(b'B') # optional - coxeter3 + sage: hash(a) == hash(b) # optional - coxeter3 + False + sage: d = {a: 1, b: 2} # optional - coxeter3 +@@ -183,9 +183,9 @@ cdef class Type: + EXAMPLES:: + + sage: from sage.libs.coxeter3.coxeter import Type # optional - coxeter3 +- sage: ta1 = Type('A') # optional - coxeter3 +- sage: ta2 = Type('A') # optional - coxeter3 +- sage: tb = Type('b') # optional - coxeter3 ++ sage: ta1 = Type(b'A') # optional - coxeter3 ++ sage: ta2 = Type(b'A') # optional - coxeter3 ++ sage: tb = Type(b'b') # optional - coxeter3 + sage: ta1 == ta2 # optional - coxeter3 + True + sage: tb != ta1 # optional - coxeter3 +@@ -219,7 +219,7 @@ cdef class Type: + EXAMPLES:: + + sage: from sage.libs.coxeter3.coxeter import Type # optional - coxeter3 +- sage: t = Type('A') # optional - coxeter3 ++ sage: t = Type(b'A') # optional - coxeter3 + sage: TestSuite(t).run() # optional - coxeter3 + """ + return (Type, (repr(self), )) +@@ -256,7 +256,7 @@ cdef class CoxGroup(SageObject): + type = type.lower() + rank = rank + 1 + +- type = 'B' if type == 'C' else type ++ type = b'B' if type == 'C' else type.encode('utf-8') + + if rank == 0: + raise NotImplementedError("Coxeter group of type ['A',0] using Coxeter 3 not yet implemented") diff -up src/sage/misc/parser.pyx.orig src/sage/misc/parser.pyx --- src/sage/misc/parser.pyx.orig 2019-06-26 14:41:05.000000000 -0600 +++ src/sage/misc/parser.pyx 2019-06-27 11:33:54.105080405 -0600 @@ -615,6 +871,18 @@ diff -up src/sage/misc/parser.pyx.orig src/sage/misc/parser.pyx tokens.backtrack() return self.p_list(tokens) else: +diff -up src/sage/modular/abvar/abvar.py.orig src/sage/modular/abvar/abvar.py +--- src/sage/modular/abvar/abvar.py.orig 2019-06-26 14:41:05.000000000 -0600 ++++ src/sage/modular/abvar/abvar.py 2019-09-09 15:08:24.875810751 -0600 +@@ -3703,7 +3703,7 @@ class ModularAbelianVariety_abstract(Par + C = self.__complement + except AttributeError: + pass +- if self.dimension() is 0: ++ if self.dimension() == 0: + if A is None: + C = self.ambient_variety() + else: diff -up src/sage/plot/plot3d/plot3d.py.orig src/sage/plot/plot3d/plot3d.py --- src/sage/plot/plot3d/plot3d.py.orig 2019-06-26 14:41:05.000000000 -0600 +++ src/sage/plot/plot3d/plot3d.py 2019-06-27 11:33:54.105080405 -0600 @@ -695,6 +963,18 @@ diff -up src/sage/rings/integer.pyx.orig src/sage/rings/integer.pyx x = "" # Force an error below assert base >= 2 +diff -up src/sage/rings/multi_power_series_ring_element.py.orig src/sage/rings/multi_power_series_ring_element.py +--- src/sage/rings/multi_power_series_ring_element.py.orig 2019-06-26 14:41:05.000000000 -0600 ++++ src/sage/rings/multi_power_series_ring_element.py 2019-09-09 15:01:45.746217568 -0600 +@@ -1417,7 +1417,7 @@ class MPowerSeries(PowerSeries): + # at this stage, self is probably a non-zero + # element of the base ring + for a in range(len(self._bg_value.list())): +- if self._bg_value.list()[a] is not 0: ++ if self._bg_value.list()[a] != 0: + return a + + def is_nilpotent(self): diff -up src/sage/rings/polynomial/pbori.pyx.orig src/sage/rings/polynomial/pbori.pyx --- src/sage/rings/polynomial/pbori.pyx.orig 2019-06-26 14:41:05.000000000 -0600 +++ src/sage/rings/polynomial/pbori.pyx 2019-06-27 11:33:54.123080154 -0600 diff --git a/sagemath-sagedoc.patch b/sagemath-sagedoc.patch index 223bfdb..7a3bd69 100644 --- a/sagemath-sagedoc.patch +++ b/sagemath-sagedoc.patch @@ -64,7 +64,7 @@ diff -up src/sage/interfaces/singular.py.orig src/sage/interfaces/singular.py - with io.open(os.path.join(singular_docdir, 'singular.hlp'), - encoding='latin-1') as f: + import gzip -+ with gzip.open(os.path.join(singular_doctir, 'singular.hlp.gz'), ++ with gzip.open(os.path.join(singular_docdir, 'singular.hlp.gz'), + encoding='utf-8') as f: for line in f: m = re.match(new_node,line) diff --git a/sagemath.spec b/sagemath.spec index 18ca078..dc7f28c 100644 --- a/sagemath.spec +++ b/sagemath.spec @@ -40,6 +40,7 @@ %global combinatorial_designs_pkg combinatorial_designs-20140630 %global conway_polynomials_pkg conway_polynomials-0.5 +%global cremona_ver 2016-10-17 %global elliptic_curves_pkg elliptic_curves-0.8.1 %global flintqs_pkg flintqs-1.0 %global graphs_pkg graphs-20161026 @@ -76,9 +77,11 @@ %endif # Spkg equivalents of required rpms; we pretend they are installed as spkgs. -# The version numbers shown are those of the latest released spkg, if the Fedora -# version is not behind. -%global SAGE_REQUIRED_PKGS 4ti2-1.6.7 cbc-2.9.4 CoCoALib-0.99564 cryptominisat-5.6.6 gap_packages-4.10.1 gmp-6.1.2 libsirocco-2.0 lrslib-062+autotools-2017-03-03 qepcad-B.1.71 saclib-2.2.7 surf-1.0.6-gcc6 +%global SAGE_REQUIRED_PKGS 4ti2-1.6.9 bliss-0.73 cbc-2.10.3 CoCoALib-0.99601 coxeter3-1.1 cryptominisat-5.6.8 database_cremona_ellcurve-%{cremona_ver} gap_packages-4.10.2 gmp-6.1.2 libsirocco-2.0 lrslib-070 mcqd-1.0 qepcad-B.1.72 saclib-2.2.7 surf-1.0.6-gcc6 + +%ifarch %{ix86} x86_64 +%global SAGE_REQUIRED_PKGS %{SAGE_REQUIRED_PKGS} fes-0.2 +%endif %global SAGE_ROOT %{_libdir}/sagemath %global SAGE_LOCAL %{SAGE_ROOT}/local @@ -92,14 +95,15 @@ Name: sagemath Summary: A free open-source mathematics software system Version: 8.8 -Release: 4%{?dist} +Release: 5%{?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 License: ASL 2.0 and BSD and GPL+ and GPLv2+ and LGPLv2+ and MIT and Public Domain URL: http://www.sagemath.org Source0: http://files.sagemath.org/src/sage-%{version}.tar.gz -Source1: gprc.expect +Source1: https://github.com/JohnCremona/ecdata/archive/%{cremona_ver}/ecdata-%{cremona_ver}.tar.gz +Source2: gprc.expect # Follow maxima's ExclusiveArch ExclusiveArch: aarch64 %{arm} %{ix86} x86_64 ppc sparcv9 @@ -143,9 +147,8 @@ Patch9: %{name}-4ti2.patch # FIXME besides not using X and told so, fails if DISPLAY is not set Patch10: %{name}-jmol.patch -# only cremona mini database built and installed -# FIXME add a package with the full cremona database -# FIXME actually it should be already available in pari-elldata +# tell the user how to install the large Cremona database +# add a missing commit() that causes large database construction to fail Patch11: %{name}-cremona.patch # adapt to python 3 and cython running in python 3 mode @@ -212,13 +215,20 @@ Patch31: %{name}-env.patch # Make notebook minimally function until upstream finally removes it Patch32: %{name}-sagenb-python3.patch +# Replace python's deprecated formatargspec with a custom implementation +# https://trac.sagemath.org/ticket/27971 +# https://git.sagemath.org/sage.git/commit/?id=bbd5b28fc8e451bea4f87c2f2b0c27586386262a +Patch33: %{name}-formatargspec.patch + BuildRequires: 4ti2 BuildRequires: arb-devel +BuildRequires: bliss-devel BuildRequires: boost-devel BuildRequires: brial-devel BuildRequires: cddlib-tools BuildRequires: cliquer-devel BuildRequires: coin-or-Cbc-devel +BuildRequires: coxeter-devel BuildRequires: desktop-file-utils BuildRequires: dvipng BuildRequires: ecl @@ -234,8 +244,13 @@ BuildRequires: gap-libs BuildRequires: gap-pkg-atlasrep BuildRequires: gap-pkg-crime BuildRequires: gap-pkg-design +BuildRequires: gap-pkg-forms +BuildRequires: gap-pkg-francy BuildRequires: gap-pkg-guava BuildRequires: gap-pkg-hapcryst +BuildRequires: gap-pkg-hecke +BuildRequires: gap-pkg-jupyterviz +BuildRequires: gap-pkg-singular BuildRequires: gap-pkg-sonata BuildRequires: gap-pkg-toric BuildRequires: gc-devel @@ -273,6 +288,7 @@ BuildRequires: m4ri-devel BuildRequires: m4rie-devel BuildRequires: mathjax BuildRequires: maxima-runtime-ecl +BuildRequires: mcqd-devel BuildRequires: mpfi-devel BuildRequires: nauty BuildRequires: ntl-devel @@ -317,12 +333,14 @@ BuildRequires: python3dist(networkx) BuildRequires: python3dist(notebook) %if %{with bundled_ipython} BuildRequires: python3dist(path.py) -%endif BuildRequires: python3dist(pathlib2) +%endif %if %{without bundled_pexpect} BuildRequires: python3dist(pexpect) %endif +%if %{with bundled_ipython} BuildRequires: python3dist(pickleshare) +%endif BuildRequires: python3dist(pip) BuildRequires: python3dist(pkgconfig) BuildRequires: python3dist(psutil) @@ -367,28 +385,58 @@ BuildRequires: xorg-x11-server-Xvfb BuildRequires: zlib-devel BuildRequires: zn_poly-devel +Requires: hicolor-icon-theme +Requires: %{name}-core +Requires: %{name}-data +%if %{with docs} +Requires: %{name}-doc-en +%endif +Requires: %{name}-notebook +Requires: %{name}-rubiks +Requires: %{name}-sagetex + +%if %{with bundled_thebe} +Provides: bundled(thebe) = %{thebe_ver} +%endif +%if %{with bundled_threejs} +Provides: bundled(threejs) = %{threejs_ver} +%endif + +# This can be removed when Fedora 30 reaches EOL +Obsoletes: %{name}-notebook-export < 8.8-5 +Provides: %{name}-notebook-export = %{version}-%{release} + +%description +Sage is a free open-source mathematics software system licensed +under the GPL. It combines the power of many existing open-source +packages into a common Python-based interface. + +#------------------------------------------------------------------------ +%package core +Summary: Open Source Mathematics Software +Requires: %{name}%{?_isa} = %{version}-%{release} Requires: 4ti2 Requires: cddlib-tools -Requires: ecl Requires: gap -Requires: GAPDoc Requires: gap-pkg-atlasrep Requires: gap-pkg-crime Requires: gap-pkg-design +Requires: gap-pkg-forms +Requires: gap-pkg-francy Requires: gap-pkg-guava Requires: gap-pkg-hapcryst +Requires: gap-pkg-hecke +Requires: gap-pkg-jupyterviz Requires: gap-pkg-sonata Requires: gap-pkg-toric Requires: gfan Requires: gmp-ecm -Requires: hicolor-icon-theme Requires: jmol -Requires: jsmol Requires: jsmath-fonts +Requires: jsmol Requires: latte-integrale Requires: lrslib-utils Requires: mathjax -Requires: maxima-gui Requires: maxima-runtime-ecl Requires: nauty Requires: palp @@ -401,10 +449,6 @@ Requires: python3dist(cysignals) Requires: python3dist(cvxopt) Requires: python3dist(cython) Requires: python3dist(docutils) -Requires: python3dist(flask-autoindex) -Requires: python3dist(flask-babel) -Requires: python3dist(flask-openid) -Requires: python3dist(flask-silk) Requires: python3dist(fpylll) Requires: python3dist(future) Requires: python3dist(gmpy2) @@ -416,71 +460,41 @@ Requires: python3dist(ipykernel) %if %{without bundled_ipython} Requires: python3dist(ipython) %endif -Requires: python3dist(kiwisolver) Requires: python3dist(matplotlib) Requires: python3dist(networkx) -Requires: python3dist(notebook) %if %{with bundled_ipython} Requires: python3dist(path.py) -%endif Requires: python3dist(pathlib2) +%endif %if %{without bundled_pexpect} Requires: python3dist(pexpect) %endif +%if %{with bundled_ipython} Requires: python3dist(pickleshare) -Requires: python3dist(pillow) +%endif Requires: python3dist(pplpy) Requires: python3dist(psutil) Requires: python3dist(ptyprocess) Requires: python3dist(pycryptosat) -Requires: python3dist(rpy2) -Requires: python3dist(scipy) -Requires: python3dist(send2trash) -%if %{with bundled_ipython} -BuildRequires: python3dist(simplegeneric) -%endif -Requires: python3dist(six) -Requires: python3dist(speaklater) -Requires: python3dist(sphinx) -Requires: python3dist(sympy) -Requires: python3dist(twisted) %if %{with bundled_ipython} Requires: python3dist(pyzmq) %endif +Requires: python3dist(rpy2) +Requires: python3dist(scipy) +%if %{with bundled_ipython} +Requires: python3dist(simplegeneric) +%endif +Requires: python3dist(six) +Requires: python3dist(sphinx) +Requires: python3dist(sympy) Requires: python3dist(zodb3) Requires: qepcad-B -Requires: R -Requires: %{name}-core -Requires: %{name}-data -%if %{with docs} -Requires: %{name}-doc-en -%endif -Requires: %{name}-notebook -Requires: %{name}-rubiks -Requires: %{name}-sagetex Requires: Singular +# Required by widgetsnbextension and thebe; remove when they are unbundled Requires: stix-math-fonts Requires: sympow Requires: tachyon Requires: texlive -Requires: vecmath - -%if %{with bundled_thebe} -Provides: bundled(thebe) = %{thebe_ver} -%endif -%if %{with bundled_threejs} -Provides: bundled(threejs) = %{threejs_ver} -%endif - -%description -Sage is a free open-source mathematics software system licensed -under the GPL. It combines the power of many existing open-source -packages into a common Python-based interface. - -#------------------------------------------------------------------------ -%package core -Summary: Open Source Mathematics Software -Requires: %{name}%{?_isa} = %{version}-%{release} %if %{with bundled_ipython} Provides: bundled(ipython) = %{ipython_ver} Provides: bundled(prompt_toolkit) = %{prompt_toolkit_ver} @@ -539,11 +553,22 @@ BuildArch: noarch Includes two databases: * A small subset of the data in John Cremona's database of elliptic curves up - to conductor 10000. See http://www.warwick.ac.uk/~masgaj/ftp/data/ or - http://sage.math.washington.edu/cremona/INDEX.html + to conductor 10000. See http://johncremona.github.io/ecdata/. * William Stein's database of interesting curves +#------------------------------------------------------------------------ +%package data-elliptic_curves_large +Summary: Large database of elliptic curves +Requires: %{name}-data = %{version}-%{release} +BuildArch: noarch + +%description data-elliptic_curves_large +John Cremona's full database of elliptic curves, and also data related to +the BSD conjecture and modular degrees for all of these curves, and +generators for the Mordell-Weil groups. See +http://johncremona.github.io/ecdata/. + #------------------------------------------------------------------------ %package data-etc Summary: Extcode for Sagemath @@ -665,6 +690,9 @@ This package contains the Turkish %{name} documentation. Summary: The Sage Notebook Requires: %{name}%{?_isa} = %{version}-%{release} Requires: python-jupyter-filesystem +Requires: python3dist(flask-silk) +Requires: python3dist(send2trash) +Requires: vecmath %description notebook The Sage Notebook is a web-based graphical user interface for @@ -697,6 +725,7 @@ Eric Dietz (GPL) http://www.wrongway.org/?rubiksource %package sagetex Summary: Sagemath into LaTeX documents Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: python3dist(pillow) Requires: tex(color.sty) Requires: tex(fancyvrb.sty) Requires: tex(graphicx.sty) @@ -718,6 +747,7 @@ computations, and plots from the Sage mathematics software suite ######################################################################## %prep %setup -q -n sage-%{version} +%setup -q -n sage-%{version} -T -D -a 1 pushd build/pkgs/combinatorial_designs tar jxf ../../../upstream/%{combinatorial_designs_pkg}.tar.bz2 @@ -877,6 +907,7 @@ popd %patch30 %patch31 %patch32 +%patch33 sed -e 's|@@SAGE_ROOT@@|%{SAGE_ROOT}|' \ -e 's|@@SAGE_DOC@@|%{SAGE_DOC}|' \ @@ -1078,6 +1109,7 @@ export SAGE_SHARE=%{buildroot}%{SAGE_SHARE} export SAGE_ETC=%{buildroot}%{SAGE_ETC} export SAGE_EXTCODE=%{buildroot}%{SAGE_ETC} export SAGE_DOC=%{buildroot}%{SAGE_DOC} +export SAGE_PYTHON3=yes export SAGE_PYTHONPATH=%{buildroot}%{SAGE_PYTHONPATH} export DESTDIR=%{buildroot} export SAGE_DEBUG=no @@ -1116,7 +1148,7 @@ pushd src/ext fi done cp -far pari $SAGE_ETC - cp -fa %{SOURCE1} $SAGE_ETC + cp -fa %{SOURCE2} $SAGE_ETC popd #------------------------------------------------------------------------ @@ -1518,7 +1550,10 @@ rm -r %{buildroot}%{python3_sitearch}/sage_setup mkdir -p %{buildroot}%{SAGE_SPKG_INST} pushd upstream for file in *.tar.*; do - mkdir %{buildroot}%{SAGE_SPKG_INST}/$(echo $file | sed -e 's|\.tar.*||') + mkdir %{buildroot}%{SAGE_SPKG_INST}/${file%.tar.*} +done +for file in *.zip; do + mkdir %{buildroot}%{SAGE_SPKG_INST}/${file%.zip} done popd pushd %{buildroot}%{SAGE_SPKG_INST} @@ -1542,7 +1577,7 @@ done if [ \$INSTALLED = no ]; then exit 0 fi -LIST=\$(cd %{SAGE_SPKG_INST}; echo *) +LIST=\$(ls -1 %{SAGE_SPKG_INST}) if [ \$NOVERSION = false ]; then for pkg in \$LIST; do echo \$pkg | sed -e 's/-/ /' @@ -1567,18 +1602,35 @@ chmod +x %{buildroot}%{SAGE_LOCAL}/bin/sage-list-packages #------------------------------------------------------------------------ # Jupyter integration -mkdir -p %{buildroot}%{_datadir}/jupyter/kernels/sagemath -pushd %{buildroot}%{_datadir}/jupyter/kernels/sagemath -ln -s %{_docdir}/%{name}/html/en doc -ln -s %{SAGE_ETC}/notebook-ipython/logo-64x64.png logo-64x64.png -ln -s %{SAGE_ETC}/notebook-ipython/logo.svg logo.svg -cat > kernel.json << EOF -{"display_name": "SageMath %{version}", "argv": ["%{_bindir}/sage", "--python", "-m", "sage.repl.ipython_kernel", "-f", "{connection_file}"]} +pushd src +%{__python3} << EOF +from sage.repl.ipython_kernel.install import SageKernelSpec +SageKernelSpec.update(prefix='%{buildroot}%{_prefix}') EOF popd -# Allow displaying 3d plots in the jupyter notebook -mkdir -p %{buildroot}%{_datadir}/jupyter/nbextensions/ -ln -sf %{_jsdir}/jsmol %{buildroot}%{_datadir}/jupyter/nbextensions/ +# Remove buildroot from the json and symbolic links +pushd %{buildroot}%{_datadir}/jupyter + sed -i 's,%{buildroot},,g' kernels/sagemath/kernel.json + for link in $(find . -type l); do + target=$(readlink $link) + if [[ "$target" =~ "%{buildroot}" ]]; then + rm $link + ln -s ${target#%{buildroot}} $link + fi + done +popd + +#------------------------------------------------------------------------ +# Build the large Cremona database +PATH=%{buildroot}%{SAGE_LOCAL}/bin:$PATH +PYTHONPATH=%{buildroot}%{SAGE_PYTHONPATH}:%{buildroot}%{python3_sitearch} +cat > cremona.sage << EOF +import sage.databases.cremona +db_path = '%{buildroot}%{SAGE_SHARE}/cremona/cremona' +c = sage.databases.cremona.LargeCremonaDatabase(db_path, False, True) +c._init_from_ftpdata('ecdata-%{cremona_ver}') +EOF +%{buildroot}%{SAGE_LOCAL}/bin/sage cremona.sage # last install command rm -fr $DOT_SAGE @@ -1604,6 +1656,7 @@ rm -fr $DOT_SAGE %{SAGE_LOCAL}/lib %{SAGE_LOCAL}/share %{SAGE_LOCAL}/var +%exclude %{SAGE_LOCAL}/var/lib/sage/installed/database_cremona_ellcurve-%{cremona_ver} %{SAGE_ROOT}/doc %{SAGE_ROOT}/devel %{SAGE_ROOT}/share @@ -1661,9 +1714,17 @@ rm -fr $DOT_SAGE #------------------------------------------------------------------------ %files data-elliptic_curves # GPLv2+ -%{SAGE_SHARE}/cremona +%dir %{SAGE_SHARE}/cremona/ +%{SAGE_SHARE}/cremona/cremona_mini.db %{SAGE_SHARE}/ellcurves +#------------------------------------------------------------------------ +%files data-elliptic_curves_large +# GPLv2+ +%dir %{SAGE_SHARE}/cremona/ +%{SAGE_SHARE}/cremona/cremona.db +%{SAGE_LOCAL}/var/lib/sage/installed/database_cremona_ellcurve-%{cremona_ver} + #------------------------------------------------------------------------ %files data-etc # GPLv2+ @@ -1847,6 +1908,18 @@ rm -fr $DOT_SAGE ######################################################################## %changelog +* Thu Sep 12 2019 Jerry James - 8.8-5 +- Improve the -ecm patch +- Add -formatargspec patch to silence doc-building warnings +- Add -data-elliptic_curves_large subpackage +- Build with bliss, coxeter3, and mcqd support +- Fix typo that made the singular.hlp file inaccessible +- Add more gap packages to get closer to the set shipped by upstream +- Refactor Requires so they apply to the correct subpackages +- More python 3 patching due to changes in python 3.8 +- Use upstream's method of installing jupyter support +- Obsolete the sagemath-notebook-export subpackage + * Tue Aug 20 2019 Susi Lehtola - 8.8-4 - Rebuilt for GSL 2.6. diff --git a/sources b/sources index c8f0d25..d749bcb 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ SHA512 (sage-8.8.tar.gz) = bac6cdd07e1c1bb36cf8617bc5b580818048702f9f73ba1d034e0ae100bbdb7f2ef3f2133d7cea739c98f103ca9e3b90a7c29d87314fb398b9d7984f194d0357 +SHA512 (cremona-2016-10-17.tar.gz) = 61f55ec5c15e32b5fdaf1fe8f2f3d50ba9afa542d8634918ec9493d739127f8c06a44b3cb1227a2979522baf61951ac37a67ae2b12c920958b04f8198d07ff57