diff --git a/.gitignore b/.gitignore index 706a9f7..200ffbe 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ /sage-6.4.1.tar.gz /sage-6.5.tar.gz /sage-6.8.tar.gz +/sage-7.3.tar.gz diff --git a/sagemath-4ti2.patch b/sagemath-4ti2.patch index b5e1a6c..4196ee2 100644 --- a/sagemath-4ti2.patch +++ b/sagemath-4ti2.patch @@ -1,8 +1,8 @@ diff -up src/sage/sandpiles/sandpile.py.orig src/sage/sandpiles/sandpile.py ---- src/sage/sandpiles/sandpile.py.orig 2015-10-11 17:41:27.067777358 -0300 -+++ src/sage/sandpiles/sandpile.py 2015-10-11 17:41:57.909778539 -0300 -@@ -347,9 +347,6 @@ from sage.rings.arith import falling_fac - from sage.rings.all import Integer, PolynomialRing, QQ, ZZ, lcm +--- src/sage/sandpiles/sandpile.py.orig 2016-08-08 13:33:09.209528750 -0400 ++++ src/sage/sandpiles/sandpile.py 2016-08-08 13:33:36.251529786 -0400 +@@ -346,9 +346,6 @@ from sage.arith.all import falling_facto + from sage.rings.all import Integer, PolynomialRing, QQ, ZZ from sage.symbolic.all import I, pi -# TODO: remove the following line once 4ti2 functions are removed @@ -11,7 +11,7 @@ diff -up src/sage/sandpiles/sandpile.py.orig src/sage/sandpiles/sandpile.py class Sandpile(DiGraph): """ Class for Dhar's abelian sandpile model. -@@ -5230,7 +5227,7 @@ class SandpileDivisor(dict): +@@ -5229,7 +5226,7 @@ class SandpileDivisor(dict): sign_file.close() # compute try: diff --git a/sagemath-arb.patch b/sagemath-arb.patch index 63ac14e..28a53de 100644 --- a/sagemath-arb.patch +++ b/sagemath-arb.patch @@ -1,46 +1,93 @@ diff -up src/sage/libs/arb/acb.pxd.orig src/sage/libs/arb/acb.pxd ---- src/sage/libs/arb/acb.pxd.orig 2015-11-03 18:52:50.311601612 -0200 -+++ src/sage/libs/arb/acb.pxd 2015-11-03 18:52:55.730601820 -0200 -@@ -1,6 +1,6 @@ - from sage.libs.arb.arb cimport arb_t, arb_struct +--- src/sage/libs/arb/acb.pxd.orig 2016-08-08 14:02:11.176595456 -0400 ++++ src/sage/libs/arb/acb.pxd 2016-08-08 14:02:17.514595699 -0400 +@@ -3,7 +3,7 @@ + from sage.libs.arb.types cimport * + from sage.libs.flint.types cimport fmpz_t, fmpq_t -cdef extern from "acb.h": +cdef extern from "arb/acb.h": - ctypedef struct acb_struct: - arb_struct real - arb_struct imag + + arb_t acb_realref(acb_t x) + arb_t acb_imagref(acb_t x) diff -up src/sage/libs/arb/arb.pxd.orig src/sage/libs/arb/arb.pxd ---- src/sage/libs/arb/arb.pxd.orig 2015-11-03 18:53:11.959602441 -0200 -+++ src/sage/libs/arb/arb.pxd 2015-11-03 18:53:20.641602774 -0200 -@@ -3,7 +3,7 @@ from sage.libs.arb.mag cimport mag_t +--- src/sage/libs/arb/arb.pxd.orig 2016-08-08 14:02:26.528596044 -0400 ++++ src/sage/libs/arb/arb.pxd 2016-08-08 14:02:33.554596313 -0400 +@@ -4,7 +4,7 @@ from sage.libs.arb.types cimport * from sage.libs.flint.types cimport fmpz_t, fmpq_t from sage.libs.mpfr cimport mpfr_t -cdef extern from "arb.h": +cdef extern from "arb/arb.h": - ctypedef struct arb_struct: - pass + arf_t arb_midref(arb_t x) + mag_t arb_radref(arb_t x) diff -up src/sage/libs/arb/arf.pxd.orig src/sage/libs/arb/arf.pxd ---- src/sage/libs/arb/arf.pxd.orig 2015-11-03 18:53:33.240603256 -0200 -+++ src/sage/libs/arb/arf.pxd 2015-11-03 18:53:39.569603498 -0200 -@@ -3,7 +3,7 @@ from sage.libs.gmp.types cimport mpz_t +--- src/sage/libs/arb/arf.pxd.orig 2016-08-08 14:02:45.928596787 -0400 ++++ src/sage/libs/arb/arf.pxd 2016-08-08 14:02:53.194597065 -0400 +@@ -5,7 +5,7 @@ from sage.libs.gmp.types cimport mpz_t from sage.libs.flint.types cimport fmpz_t from sage.libs.mpfr cimport mpfr_t, mpfr_rnd_t -cdef extern from "arf.h": +cdef extern from "arb/arf.h": - ctypedef struct arf_struct: - pass - ctypedef arf_struct arf_t[1] + void arf_init(arf_t x) + void arf_clear(arf_t x) + void arf_zero(arf_t x) diff -up src/sage/libs/arb/mag.pxd.orig src/sage/libs/arb/mag.pxd ---- src/sage/libs/arb/mag.pxd.orig 2015-11-03 18:52:18.254600385 -0200 -+++ src/sage/libs/arb/mag.pxd 2015-11-03 18:52:31.009600873 -0200 -@@ -1,6 +1,6 @@ +--- src/sage/libs/arb/mag.pxd.orig 2016-08-08 14:03:03.208597449 -0400 ++++ src/sage/libs/arb/mag.pxd 2016-08-08 14:03:10.010597709 -0400 +@@ -3,7 +3,7 @@ + from sage.libs.arb.types cimport * from sage.libs.flint.types cimport fmpz_t, fmpq_t -cdef extern from "mag.h": +cdef extern from "arb/mag.h": - ctypedef struct mag_struct: - pass - ctypedef mag_struct mag_t[1] + void mag_init(mag_t x) + void mag_clear(mag_t x) + void mag_init_set(mag_t x, const mag_t y) +diff -up src/sage/libs/arb/acb_hypgeom.pxd.orig src/sage/libs/arb/acb_hypgeom.pxd +--- src/sage/libs/arb/acb_hypgeom.pxd.orig 2016-08-09 14:18:12.798626773 -0400 ++++ src/sage/libs/arb/acb_hypgeom.pxd 2016-08-09 14:18:18.591626994 -0400 +@@ -2,7 +2,7 @@ + + from sage.libs.arb.types cimport * + +-cdef extern from "acb_hypgeom.h": ++cdef extern from "arb/acb_hypgeom.h": + void acb_hypgeom_pfq_bound_factor(mag_t C, acb_srcptr a, long p, acb_srcptr b, long q, const acb_t z, unsigned long n) + long acb_hypgeom_pfq_choose_n(acb_srcptr a, long p, acb_srcptr b, long q, const acb_t z, long prec) + void acb_hypgeom_pfq_sum_forward(acb_t s, acb_t t, acb_srcptr a, long p, acb_srcptr b, long q, const acb_t z, long n, long prec) +diff -up src/sage/libs/arb/acb_mat.pxd.orig src/sage/libs/arb/acb_mat.pxd +--- src/sage/libs/arb/acb_mat.pxd.orig 2016-08-09 14:18:29.126627398 -0400 ++++ src/sage/libs/arb/acb_mat.pxd 2016-08-09 14:18:33.559627568 -0400 +@@ -1,6 +1,6 @@ + from sage.libs.arb.types cimport acb_t, acb_mat_t + +-cdef extern from "acb_mat.h": ++cdef extern from "arb/acb_mat.h": + unsigned int acb_mat_nrows(acb_mat_t mat) + unsigned int acb_mat_ncols(acb_mat_t mat) + acb_t acb_mat_entry(acb_mat_t mat, unsigned long i, unsigned long j) +diff -up src/sage/libs/arb/acb_modular.pxd.orig src/sage/libs/arb/acb_modular.pxd +--- src/sage/libs/arb/acb_modular.pxd.orig 2016-08-09 14:18:42.526627911 -0400 ++++ src/sage/libs/arb/acb_modular.pxd 2016-08-09 14:18:46.191628051 -0400 +@@ -3,7 +3,7 @@ + from sage.libs.arb.types cimport * + from sage.libs.flint.types cimport fmpz_poly_t + +-cdef extern from "acb_modular.h": ++cdef extern from "arb/acb_modular.h": + void acb_modular_theta(acb_t theta1, acb_t theta2, acb_t theta3, acb_t theta4, const acb_t z, const acb_t tau, long prec) + void acb_modular_j(acb_t z, const acb_t tau, long prec) + void acb_modular_eta(acb_t z, const acb_t tau, long prec) +diff -up src/sage/libs/arb/bernoulli.pxd.orig src/sage/libs/arb/bernoulli.pxd +--- src/sage/libs/arb/bernoulli.pxd.orig 2016-08-09 14:19:29.102629695 -0400 ++++ src/sage/libs/arb/bernoulli.pxd 2016-08-09 14:19:33.495629863 -0400 +@@ -2,5 +2,5 @@ + + from ..flint.types cimport fmpq_t, ulong + +-cdef extern from "bernoulli.h": ++cdef extern from "arb/bernoulli.h": + void bernoulli_fmpq_ui(fmpq_t b, ulong n) diff --git a/sagemath-atlas.patch b/sagemath-atlas.patch new file mode 100644 index 0000000..7a11783 --- /dev/null +++ b/sagemath-atlas.patch @@ -0,0 +1,55 @@ +diff -up src/module_list.py.orig src/module_list.py +--- src/module_list.py.orig 2016-08-11 09:33:26.357108127 -0400 ++++ src/module_list.py 2016-08-11 09:34:15.543110010 -0400 +@@ -12,26 +12,20 @@ SAGE_INC = '/usr/include' + import pkgconfig + + # CBLAS can be one of multiple implementations +-cblas_pc = pkgconfig.parse('cblas') ++cblas_pc = pkgconfig.parse('atlas') + cblas_libs = list(cblas_pc['libraries']) + cblas_library_dirs = list(cblas_pc['library_dirs']) + cblas_include_dirs = list(cblas_pc['include_dirs']) + +-# TODO: Remove Cygwin hack by installing a suitable cblas.pc +-if os.path.exists('/usr/lib/libblas.dll.a'): +- cblas_libs = ['gslcblas'] +- +-# LAPACK can be one of multiple implementations +-lapack_pc = pkgconfig.parse('lapack') +-lapack_libs = list(lapack_pc['libraries']) +-lapack_library_dirs = list(lapack_pc['library_dirs']) +-lapack_include_dirs = list(lapack_pc['include_dirs']) ++lapack_libs = [ 'lapack' ] ++lapack_library_dirs = [] ++lapack_include_dirs = [ SAGE_INC + '/lapack' ] + + # GNU Scientific Library + # Note we replace the built-in gslcblas with the above cblas + gsl_pc = pkgconfig.parse('gsl') + gsl_libs = list(gsl_pc['libraries'].difference(['gslcblas']).union(cblas_libs)) +-gsl_library_dirs = list(gsl_pc['library_dirs']) ++gsl_library_dirs = list(cblas_pc['library_dirs']) + gsl_include_dirs = list(gsl_pc['include_dirs']) + + # GD image library +diff -up src/sage/misc/cython.py.orig src/sage/misc/cython.py +--- src/sage/misc/cython.py.orig 2016-08-11 09:33:26.362108127 -0400 ++++ src/sage/misc/cython.py 2016-08-11 09:33:29.353108241 -0400 +@@ -27,15 +27,11 @@ import pkgconfig + + + # CBLAS can be one of multiple implementations +-cblas_pc = pkgconfig.parse('cblas') ++cblas_pc = pkgconfig.parse('atlas') + cblas_libs = list(cblas_pc['libraries']) + cblas_library_dirs = list(cblas_pc['library_dirs']) + cblas_include_dirs = list(cblas_pc['include_dirs']) + +-# TODO: Remove Cygwin hack by installing a suitable cblas.pc +-if os.path.exists('/usr/lib/libblas.dll.a'): +- cblas_libs = 'gslcblas' +- + standard_libs = [ + 'mpfr', 'gmp', 'gmpxx', 'stdc++', 'pari', 'm', + 'ec', 'gsl', diff --git a/sagemath-cbc.patch b/sagemath-cbc.patch index a56f52d..4d91880 100644 --- a/sagemath-cbc.patch +++ b/sagemath-cbc.patch @@ -1,7 +1,7 @@ diff -up src/sage/numerical/backends/coin_backend.pyx.orig src/sage/numerical/backends/coin_backend.pyx ---- src/sage/numerical/backends/coin_backend.pyx.orig 2015-11-06 10:36:17.498631801 -0200 -+++ src/sage/numerical/backends/coin_backend.pyx 2015-11-06 10:36:40.210632670 -0200 -@@ -761,8 +761,8 @@ cdef class CoinBackend(GenericBackend): +--- src/sage/numerical/backends/coin_backend.pyx.orig 2016-08-08 13:41:10.063547164 -0400 ++++ src/sage/numerical/backends/coin_backend.pyx 2016-08-08 13:41:28.426547867 -0400 +@@ -755,8 +755,8 @@ cdef class CoinBackend(GenericBackend): model.setLogLevel(old_logLevel) # multithreading diff --git a/sagemath-cremona.patch b/sagemath-cremona.patch index 7d131f8..c0b0950 100644 --- a/sagemath-cremona.patch +++ b/sagemath-cremona.patch @@ -1,23 +1,30 @@ diff -up src/sage/databases/cremona.py.orig src/sage/databases/cremona.py ---- src/sage/databases/cremona.py.orig 2015-10-11 17:50:01.241797048 -0300 -+++ src/sage/databases/cremona.py 2015-10-11 17:52:06.533801845 -0300 -@@ -827,14 +827,9 @@ class MiniCremonaDatabase(SQLDatabase): +--- src/sage/databases/cremona.py.orig 2016-08-08 13:36:38.575536768 -0400 ++++ src/sage/databases/cremona.py 2016-08-08 13:37:49.994539502 -0400 +@@ -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 SAGE_SHARE + from sage.misc.all import walltime + +@@ -828,14 +827,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 " \ +- else: +- 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" -+ + label + " in the default database" raise ValueError(message) ainvs = eval(c[0]) data = {'cremona_label': label, -@@ -1676,10 +1671,12 @@ def CremonaDatabase(name=None,mini=None, +@@ -1677,10 +1668,12 @@ def CremonaDatabase(name=None,mini=None, if name is None and not set_global: return _db if set_global and name is None: diff --git a/sagemath-extensions.patch b/sagemath-extensions.patch index a2d2464..383b979 100644 --- a/sagemath-extensions.patch +++ b/sagemath-extensions.patch @@ -1,7 +1,7 @@ diff -up src/module_list.py.orig src/module_list.py ---- src/module_list.py.orig 2015-11-02 18:12:21.186706786 -0200 -+++ src/module_list.py 2015-11-02 18:12:48.252707822 -0200 -@@ -116,7 +116,6 @@ library_order["stdc++"] = 1000 +--- src/module_list.py.orig 2016-08-08 13:14:09.383485102 -0400 ++++ src/module_list.py 2016-08-08 13:17:44.834493353 -0400 +@@ -147,7 +147,6 @@ library_order["stdc++"] = 1000 ### ############################################################# @@ -9,7 +9,7 @@ diff -up src/module_list.py.orig src/module_list.py UNAME = os.uname() def uname_specific(name, value, alternative): -@@ -338,21 +337,21 @@ ext_modules = [ +@@ -378,21 +377,21 @@ ext_modules = [ libraries = ['flint'], extra_compile_args = ['-std=c99']), @@ -46,7 +46,22 @@ diff -up src/module_list.py.orig src/module_list.py Extension('sage.graphs.planarity', sources = ['sage/graphs/planarity.pyx'], -@@ -504,19 +503,19 @@ ext_modules = [ +@@ -411,10 +410,10 @@ ext_modules = [ + Extension('sage.graphs.graph_decompositions.cutwidth', + sources = ['sage/graphs/graph_decompositions/cutwidth.pyx']), + +- OptionalExtension('sage.graphs.graph_decompositions.tdlib', +- sources = ['sage/graphs/graph_decompositions/tdlib.pyx'], +- language="c++", +- package = 'tdlib'), ++# Extension('sage.graphs.graph_decompositions.tdlib', ++# sources = ['sage/graphs/graph_decompositions/tdlib.pyx'], ++# language="c++", ++# package = 'tdlib'), + + Extension('sage.graphs.spanning_tree', + sources = ['sage/graphs/spanning_tree.pyx']), +@@ -553,18 +552,18 @@ ext_modules = [ ## ################################ @@ -65,15 +80,56 @@ diff -up src/module_list.py.orig src/module_list.py Extension('sage.libs.ecl', sources = ["sage/libs/ecl.pyx"], - libraries = ["ecl"], - depends = [SAGE_INC + '/ecl/ecl.h']), + libraries = ["ecl"]), - OptionalExtension("sage.libs.fes", + Extension("sage.libs.fes", ["sage/libs/fes.pyx"], language = "c", libraries = ['fes'], -@@ -988,13 +987,6 @@ ext_modules = [ +@@ -597,17 +596,17 @@ ext_modules = [ + Extension('sage.libs.gmp.rational_reconstruction', + sources = ['sage/libs/gmp/rational_reconstruction.pyx']), + +- OptionalExtension('sage.libs.braiding', +- sources = ["sage/libs/braiding.pyx"], +- libraries = ["braiding"], +- package="libbraiding", +- language = 'c++'), ++# Extension('sage.libs.braiding', ++# sources = ["sage/libs/braiding.pyx"], ++# libraries = ["braiding"], ++# package="libbraiding", ++# language = 'c++'), + + +- OptionalExtension('sage.libs.homfly', +- sources = ["sage/libs/homfly.pyx"], +- libraries = ["homfly", "gc"], +- package="libhomfly"), ++# Extension('sage.libs.homfly', ++# sources = ["sage/libs/homfly.pyx"], ++# libraries = ["homfly", "gc"], ++# package="libhomfly"), + + Extension('sage.libs.linbox.linbox', + sources = ['sage/libs/linbox/linbox.pyx'], +@@ -989,10 +988,10 @@ ext_modules = [ + Extension('sage.matrix.matrix_window', + sources = ['sage/matrix/matrix_window.pyx']), + +- OptionalExtension("sage.matrix.matrix_gfpn_dense", +- sources = ['sage/matrix/matrix_gfpn_dense.pyx'], +- libraries = ['mtx'], +- package = 'meataxe'), ++# Extension("sage.matrix.matrix_gfpn_dense", ++# sources = ['sage/matrix/matrix_gfpn_dense.pyx'], ++# libraries = ['mtx'], ++# package = 'meataxe'), + + Extension('sage.matrix.misc', + sources = ['sage/matrix/misc.pyx'], +@@ -1025,12 +1024,6 @@ ext_modules = [ Extension('*', ['sage/misc/*.pyx']), @@ -81,15 +137,14 @@ diff -up src/module_list.py.orig src/module_list.py - OptionalExtension('sage.misc.darwin_utilities', - sources = ['sage/misc/darwin_memory_usage.c', - 'sage/misc/darwin_utilities.pyx'], -- depends = ['sage/misc/darwin_memory_usage.h'], - condition = (UNAME[0] == "Darwin" and not UNAME[2].startswith('8.'))), - ################################ ## ## sage.modular -@@ -1122,19 +1114,7 @@ ext_modules = [ - language = 'c++', - libraries=["gmp", "glpk", "z"]), +@@ -1173,19 +1166,19 @@ ext_modules = [ + Extension("sage.numerical.backends.interactivelp_backend", + ["sage/numerical/backends/interactivelp_backend.pyx"]), - OptionalExtension("sage.numerical.backends.gurobi_backend", - ["sage/numerical/backends/gurobi_backend.pyx"], @@ -102,44 +157,38 @@ diff -up src/module_list.py.orig src/module_list.py - libraries = ["stdc++", "cplex"], - condition = os.path.isfile(SAGE_INC + "/cplex.h") and - os.path.isfile(SAGE_LOCAL + "/lib/libcplex.a")), -- ++# Extension("sage.numerical.backends.gurobi_backend", ++# ["sage/numerical/backends/gurobi_backend.pyx"], ++# libraries = ["stdc++", "gurobi"], ++# condition = os.path.isfile(SAGE_INC + "/gurobi_c.h") and ++# os.path.isfile(SAGE_LOCAL + "/lib/libgurobi.so")), ++ ++# Extension("sage.numerical.backends.cplex_backend", ++# ["sage/numerical/backends/cplex_backend.pyx"], ++# libraries = ["stdc++", "cplex"], ++# condition = os.path.isfile(SAGE_INC + "/cplex.h") and ++# os.path.isfile(SAGE_LOCAL + "/lib/libcplex.a")), + - OptionalExtension("sage.numerical.backends.coin_backend", + Extension("sage.numerical.backends.coin_backend", ["sage/numerical/backends/coin_backend.pyx"], language = 'c++', - libraries = ["Cbc", "CbcSolver", "Cgl", "Clp", "CoinUtils", "OsiCbc", "OsiClp", "Osi", "lapack"], -@@ -1234,7 +1214,7 @@ ext_modules = [ - libraries=['ntl'], - language = 'c++'), - -- OptionalExtension("sage.rings.complex_ball_acb", -+ Extension("sage.rings.complex_ball_acb", - ["sage/rings/complex_ball_acb.pyx"], - libraries=['arb', 'mpfi', 'mpfr'], - include_dirs=[SAGE_INC + '/flint'], -@@ -1307,7 +1287,7 @@ ext_modules = [ - Extension('sage.rings.real_interval_absolute', - sources = ['sage/rings/real_interval_absolute.pyx']), - -- OptionalExtension("sage.rings.real_arb", -+ Extension("sage.rings.real_arb", - ["sage/rings/real_arb.pyx"], - libraries = ['arb', 'mpfi', 'mpfr'], - include_dirs = [SAGE_INC + '/flint'], -@@ -1602,14 +1582,14 @@ ext_modules = [ + libraries = ["Cbc", "CbcSolver", "Cgl", "Clp", "CoinUtils", +@@ -1677,7 +1670,7 @@ ext_modules = [ ## ################################ - OptionalExtension("sage.sat.solvers.cryptominisat.cryptominisat", + Extension("sage.sat.solvers.cryptominisat.cryptominisat", sources = ["sage/sat/solvers/cryptominisat/cryptominisat.pyx"], - include_dirs = [os.path.join(SAGE_INC, "cmsat")], + include_dirs = [os.path.join(SAGE_INC, "cmsat")] + zlib_include_dirs, language = "c++", - libraries = ['cryptominisat', 'z'], +@@ -1685,7 +1678,7 @@ ext_modules = [ + library_dirs = zlib_library_dirs, package = 'cryptominisat'), - OptionalExtension("sage.sat.solvers.cryptominisat.solverconf", + Extension("sage.sat.solvers.cryptominisat.solverconf", - sources = ["sage/sat/solvers/cryptominisat/solverconf.pyx", "sage/sat/solvers/cryptominisat/solverconf_helper.cpp"], - include_dirs = [os.path.join(SAGE_INC, "cmsat")], - language = "c++", + sources = ["sage/sat/solvers/cryptominisat/solverconf.pyx", + "sage/sat/solvers/cryptominisat/solverconf_helper.cpp"], + include_dirs = [os.path.join(SAGE_INC, "cmsat")] + zlib_include_dirs, diff --git a/sagemath-fes-build.patch b/sagemath-fes-build.patch index 150ee37..b12e363 100644 --- a/sagemath-fes-build.patch +++ b/sagemath-fes-build.patch @@ -1,8 +1,8 @@ diff -up src/sage/libs/fes.pyx.orig src/sage/libs/fes.pyx ---- src/sage/libs/fes.pyx.orig 2015-11-29 16:53:45.203478795 -0200 -+++ src/sage/libs/fes.pyx 2015-11-29 16:54:23.318480255 -0200 -@@ -89,8 +89,8 @@ from sage.rings.polynomial.pbori import - from sage.rings.arith import binomial +--- src/sage/libs/fes.pyx.orig 2016-08-08 13:44:21.919554511 -0400 ++++ src/sage/libs/fes.pyx 2016-08-08 13:44:36.618555074 -0400 +@@ -90,8 +90,8 @@ from sage.rings.polynomial.pbori import + from sage.arith.all import binomial from sage.combinat.subset import Subsets -from sage.matrix.all import * diff --git a/sagemath-fes.patch b/sagemath-fes.patch index 9fe1a5a..667dbc5 100644 --- a/sagemath-fes.patch +++ b/sagemath-fes.patch @@ -1,9 +1,9 @@ diff -up src/module_list.py.orig src/module_list.py ---- src/module_list.py.orig 2015-10-11 18:08:06.689838613 -0300 -+++ src/module_list.py 2015-10-11 18:08:21.686839187 -0300 -@@ -515,11 +515,11 @@ ext_modules = [ - libraries = ["ecl"], - depends = [SAGE_INC + '/ecl/ecl.h']), +--- src/module_list.py.orig 2016-08-08 13:44:56.193555823 -0400 ++++ src/module_list.py 2016-08-08 13:45:10.146556357 -0400 +@@ -563,11 +563,11 @@ ext_modules = [ + sources = ["sage/libs/ecl.pyx"], + libraries = ["ecl"]), - Extension("sage.libs.fes", - ["sage/libs/fes.pyx"], diff --git a/sagemath-gap-hap.patch b/sagemath-gap-hap.patch index 1c8aece..e46ca13 100644 --- a/sagemath-gap-hap.patch +++ b/sagemath-gap-hap.patch @@ -1,7 +1,7 @@ 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 2015-07-26 07:34:43.000000000 -0600 -+++ src/sage/groups/perm_gps/permgroup.py 2016-08-11 21:51:51.490143121 -0600 -@@ -136,7 +136,6 @@ from sage.groups.perm_gps.permgroup_elem +--- src/sage/groups/perm_gps/permgroup.py.orig 2016-08-08 13:39:39.617543700 -0400 ++++ src/sage/groups/perm_gps/permgroup.py 2016-08-08 13:40:16.291545105 -0400 +@@ -145,7 +145,6 @@ from sage.groups.perm_gps.permgroup_elem from sage.groups.abelian_gps.abelian_group import AbelianGroup from sage.misc.cachefunc import cached_method from sage.groups.class_function import ClassFunction @@ -9,55 +9,45 @@ diff -up src/sage/groups/perm_gps/permgroup.py.orig src/sage/groups/perm_gps/per from sage.sets.finite_enumerated_set import FiniteEnumeratedSet from sage.categories.all import FiniteEnumeratedSets from sage.groups.conjugacy_classes import ConjugacyClassGAP -@@ -155,7 +154,10 @@ def load_hap(): - try: - gap.load_package("hap") - except Exception: -- gap.load_package("hap") -+ try: -+ gap.load_package("hap") -+ except Exception: -+ raise RuntimeError("gap-hap package failed to load.") - - def hap_decorator(f): - """ -@@ -181,8 +183,6 @@ def hap_decorator(f): +@@ -190,8 +189,7 @@ def hap_decorator(f): """ @wraps(f) def wrapped(self, n, p=0): - if not is_package_installed('gap_packages'): - raise RuntimeError("You must install the optional gap_packages package.") ++ raise RuntimeError("You must install the optional gap_packages package.") load_hap() - from sage.rings.arith import is_prime + from sage.arith.all import is_prime if not (p == 0 or is_prime(p)): -@@ -1617,9 +1617,7 @@ class PermutationGroup_generic(group.Fin +@@ -1683,9 +1681,7 @@ class PermutationGroup_generic(group.Fin try: return [Integer(n) for n in self._gap_().IdGroup()] except RuntimeError: - if not is_package_installed('database_gap'): - raise RuntimeError("You must install the optional database_gap package first.") - raise -+ raise RuntimeError("gap-hap package error.") ++ raise RuntimeError("You must install the optional database_gap package first.") def id(self): """ -@@ -1670,9 +1668,7 @@ class PermutationGroup_generic(group.Fin +@@ -1736,9 +1732,7 @@ class PermutationGroup_generic(group.Fin try: return Integer(self._gap_().PrimitiveIdentification()) except RuntimeError: - if not is_package_installed('database_gap'): - raise RuntimeError("You must install the optional database_gap package first.") - raise -+ raise RuntimeError("gap-hap package error.") ++ raise RuntimeError("You must install the optional database_gap package first.") def center(self): """ -@@ -3959,8 +3955,6 @@ class PermutationGroup_generic(group.Fin - +@@ -4114,8 +4108,7 @@ class PermutationGroup_generic(group.Fin - David Joyner and Graham Ellis + """ - if not is_package_installed('gap_packages'): - raise RuntimeError("You must install the optional gap_packages package.") ++ raise RuntimeError("You must install the optional gap_packages package.") load_hap() - from sage.rings.arith import is_prime + from sage.arith.all import is_prime if not (p == 0 or is_prime(p)): diff --git a/sagemath-gcc6.patch b/sagemath-gcc6.patch new file mode 100644 index 0000000..457949f --- /dev/null +++ b/sagemath-gcc6.patch @@ -0,0 +1,30 @@ +diff -up src/module_list.py.orig src/module_list.py +--- src/module_list.py.orig 2016-08-10 09:10:17.614742069 -0400 ++++ src/module_list.py 2016-08-10 09:11:22.887744568 -0400 +@@ -954,7 +954,7 @@ ext_modules = [ + library_dirs = m4ri_library_dirs, + include_dirs = m4ri_include_dirs, + depends = [SAGE_INC + "/m4rie/m4rie.h"], +- extra_compile_args = ['-std=c99'] + m4ri_extra_compile_args), ++ extra_compile_args = ['-std=c++11'] + m4ri_extra_compile_args), + + Extension('sage.matrix.matrix_modn_dense_float', + sources = ['sage/matrix/matrix_modn_dense_float.pyx'], +@@ -962,7 +962,7 @@ ext_modules = [ + libraries = ['ntl', 'linbox', 'givaro', 'mpfr', 'gmpxx', 'gmp'] + cblas_libs, + library_dirs = cblas_library_dirs, + include_dirs = cblas_include_dirs, +- extra_compile_args = nocxx11_args + ['-DDISABLE_COMMENTATOR'] + givaro_extra_compile_args), ++ extra_compile_args = ['-std=c++11'] + ['-DDISABLE_COMMENTATOR'] + givaro_extra_compile_args), + + Extension('sage.matrix.matrix_modn_dense_double', + sources = ['sage/matrix/matrix_modn_dense_double.pyx'], +@@ -970,7 +970,7 @@ ext_modules = [ + libraries = ['ntl', 'linbox', 'givaro', 'mpfr', 'gmpxx', 'gmp'] + cblas_libs, + library_dirs = cblas_library_dirs, + include_dirs = cblas_include_dirs, +- extra_compile_args = nocxx11_args + ["-D_XPG6", "-DDISABLE_COMMENTATOR"] ++ extra_compile_args = ['-std=c++11'] + ["-D_XPG6", "-DDISABLE_COMMENTATOR"] + + m4ri_extra_compile_args + givaro_extra_compile_args), + + Extension('sage.matrix.matrix_modn_sparse', diff --git a/sagemath-gmp.patch b/sagemath-gmp.patch index d6ca3c4..7e0886f 100644 --- a/sagemath-gmp.patch +++ b/sagemath-gmp.patch @@ -1,7 +1,7 @@ diff -up src/sage/modular/arithgroup/farey.cpp.orig src/sage/modular/arithgroup/farey.cpp ---- src/sage/modular/arithgroup/farey.cpp.orig 2015-10-11 17:20:15.809728677 -0300 -+++ src/sage/modular/arithgroup/farey.cpp 2015-10-11 17:20:28.178729151 -0300 -@@ -136,6 +136,7 @@ operator*(const SL2Z& M, const vector + include_dirs = sage_include_directories(use_sources=True) ++include_dirs.extend(['@@CYSIGNALS@@']) + + # Manually add -fno-strict-aliasing, which is needed to compile Cython + # and disappears from the default flags if the user has set CFLAGS. diff --git a/sagemath-ipython3.patch b/sagemath-ipython3.patch new file mode 100644 index 0000000..825bf25 --- /dev/null +++ b/sagemath-ipython3.patch @@ -0,0 +1,1696 @@ +diff -up src/sage/repl/attach.py.orig src/sage/repl/attach.py +--- src/sage/repl/attach.py.orig 2016-08-18 13:12:59.071122164 -0400 ++++ src/sage/repl/attach.py 2016-08-18 13:13:01.904122272 -0400 +@@ -13,7 +13,7 @@ Check that no file clutter is produced:: + sage: dir = tmp_dir() + sage: src = os.path.join(dir, 'foobar.sage') + sage: with open(src, 'w') as f: +- ....: f.write('print("")\n') ++ ....: f.write('print ""\n') + sage: attach(src) + + sage: os.listdir(dir) +@@ -67,13 +67,11 @@ character-by-character:: + # (at your option) any later version. + # http://www.gnu.org/licenses/ + #***************************************************************************** +-from __future__ import print_function + + import os + import six + import time + from sage.repl.load import load, load_wrap +-import sage.repl.inputhook + import sage.env + + # The attached files as a dict of {filename:mtime} +@@ -165,7 +163,7 @@ def load_attach_path(path=None, replace= + ['.'] + sage: t_dir = tmp_dir() + sage: fullpath = os.path.join(t_dir, 'test.py') +- sage: open(fullpath, 'w').write("print(37 * 3)") ++ sage: open(fullpath, 'w').write("print 37 * 3") + sage: attach('test.py') + Traceback (most recent call last): + ... +@@ -266,13 +264,6 @@ def attach(*files): + Attach a file or files to a running instance of Sage and also load + that file. + +- .. NOTE:: +- +- Attaching files uses the Python inputhook, which will conflict +- with other inputhook users. This generally includes GUI main loop +- integrations, for example tkinter. So you can only use tkinter or +- attach, but not both at the same time. +- + INPUT: + + - ``files`` -- a list of filenames (strings) to attach. +@@ -313,9 +304,9 @@ def attach(*files): + + sage: sage.repl.attach.reset() + sage: t1 = tmp_filename(ext='.py') +- sage: open(t1,'w').write("print('hello world')") ++ sage: open(t1,'w').write("print 'hello world'") + sage: t2 = tmp_filename(ext='.py') +- sage: open(t2,'w').write("print('hi there xxx')") ++ sage: open(t2,'w').write("print 'hi there xxx'") + sage: attach(t1, t2) + hello world + hi there xxx +@@ -371,7 +362,6 @@ def add_attached_file(filename): + sage: af.attached_files() + [] + """ +- sage.repl.inputhook.install() + fpath = os.path.abspath(filename) + attached[fpath] = os.path.getmtime(fpath) + +@@ -389,7 +379,7 @@ def attached_files(): + + sage: sage.repl.attach.reset() + sage: t = tmp_filename(ext='.py') +- sage: open(t,'w').write("print('hello world')") ++ sage: open(t,'w').write("print 'hello world'") + sage: attach(t) + hello world + sage: attached_files() +@@ -415,7 +405,7 @@ def detach(filename): + + sage: sage.repl.attach.reset() + sage: t = tmp_filename(ext='.py') +- sage: open(t,'w').write("print('hello world')") ++ sage: open(t,'w').write("print 'hello world'") + sage: attach(t) + hello world + sage: attached_files() == [t] +@@ -429,7 +419,7 @@ def detach(filename): + ['.'] + sage: t_dir = tmp_dir() + sage: fullpath = os.path.join(t_dir, 'test.py') +- sage: open(fullpath, 'w').write("print(37 * 3)") ++ sage: open(fullpath, 'w').write("print 37 * 3") + sage: load_attach_path(t_dir) + sage: attach('test.py') + 111 +@@ -441,7 +431,7 @@ def detach(filename): + sage: attach('test.py') + 111 + sage: fullpath = os.path.join(t_dir, 'test2.py') +- sage: open(fullpath, 'w').write("print(3)") ++ sage: open(fullpath, 'w').write("print 3") + sage: attach('test2.py') + 3 + sage: detach(attached_files()) +@@ -474,8 +464,6 @@ def detach(filename): + attached.pop(fpath) + else: + raise ValueError("file '{0}' is not attached, see attached_files()".format(filename)) +- if not attached: +- sage.repl.inputhook.uninstall() + + def reset(): + """ +@@ -485,7 +473,7 @@ def reset(): + + sage: sage.repl.attach.reset() + sage: t = tmp_filename(ext='.py') +- sage: open(t,'w').write("print('hello world')") ++ sage: open(t,'w').write("print 'hello world'") + sage: attach(t) + hello world + sage: attached_files() == [t] +diff -up src/sage/repl/display/fancy_repr.py.orig src/sage/repl/display/fancy_repr.py +--- src/sage/repl/display/fancy_repr.py.orig 2016-08-18 13:12:59.078122164 -0400 ++++ src/sage/repl/display/fancy_repr.py 2016-08-18 13:13:01.906122272 -0400 +@@ -119,7 +119,8 @@ class SomeIPythonRepr(ObjectReprABC): + .. automethod:: __call__ + """ + type_repr = _type_pprinters.copy() +- del type_repr[type] ++ del type_repr[types.TypeType] ++ del type_repr[types.ClassType] + del type_repr[types.BuiltinFunctionType] + del type_repr[types.FunctionType] + del type_repr[str] +@@ -250,7 +251,7 @@ class PlainPythonRepr(ObjectReprABC): + a custom representer. Note that it is undesirable to have a + trailing newline, and if we don't display it you can't fix + it:: +- ++ + sage: class Newline(object): + ....: def __repr__(self): + ....: return 'newline\n' +@@ -316,37 +317,12 @@ class TallListRepr(ObjectReprABC): + sage: format_list = TallListRepr().format_string + sage: format_list([1, 2, identity_matrix(2)]) + '[\n [1 0]\n1, 2, [0 1]\n]' +- +- Check that :trac:`18743` is fixed:: +- +- sage: class Foo(object): +- ....: def __repr__(self): +- ....: return '''BBB AA RRR +- ....: B B A A R R +- ....: BBB AAAA RRR +- ....: B B A A R R +- ....: BBB A A R R''' +- ....: def _repr_option(self, key): +- ....: return key == 'ascii_art' +- sage: F = Foo() +- sage: [F, F] +- [ +- BBB AA RRR BBB AA RRR +- B B A A R R B B A A R R +- BBB AAAA RRR BBB AAAA RRR +- B B A A R R B B A A R R +- BBB A A R R, BBB A A R R +- ] + """ + if not (isinstance(obj, (tuple, list)) and len(obj) > 0): + return False + ascii_art_repr = False + for o in obj: + try: +- ascii_art_repr = ascii_art_repr or o._repr_option('ascii_art') +- except (AttributeError, TypeError): +- pass +- try: + ascii_art_repr = ascii_art_repr or o.parent()._repr_option('element_ascii_art') + except (AttributeError, TypeError): + pass +diff -up src/sage/repl/display/formatter.py.orig src/sage/repl/display/formatter.py +--- src/sage/repl/display/formatter.py.orig 2016-08-18 13:12:59.083122164 -0400 ++++ src/sage/repl/display/formatter.py 2016-08-18 13:13:01.907122273 -0400 +@@ -97,7 +97,7 @@ class SageDisplayFormatter(DisplayFormat + self.dm.check_backend_class(BackendIPython) + + def format(self, obj, include=None, exclude=None): +- r""" ++ """ + Use the Sage rich output instead of IPython + + INPUT/OUTPUT: +@@ -124,44 +124,9 @@ class SageDisplayFormatter(DisplayFormat + 10*x + 9*x + 8*x + 7*x + 6*x + 5*x + 4*x + 3*x + 2*x + x + sage: shell.run_cell('%display default') + sage: shell.quit() +- +- TESTS:: +- +- sage: import os +- sage: from sage.env import SAGE_EXTCODE +- sage: example_png = os.path.join(SAGE_EXTCODE, 'doctest', 'rich_output', 'example.png') +- sage: from sage.repl.rich_output.backend_ipython import BackendIPython +- sage: backend = BackendIPython() +- sage: shell = get_test_shell() +- sage: backend.install(shell=shell) +- sage: shell.run_cell('get_ipython().display_formatter') +- +- sage: shell.run_cell('from IPython.display import Image') +- sage: shell.run_cell('ipython_image = Image("{0}")'.format(example_png)) +- sage: shell.run_cell('ipython_image') +- +- sage: shell.run_cell('get_ipython().display_formatter.format(ipython_image)') +- ({u'image/png': '\x89PNG...', +- u'text/plain': u''}, +- {}) + """ +- # First, use Sage rich output if there is any +- PLAIN_TEXT = u'text/plain' +- sage_format, sage_metadata = self.dm.displayhook(obj) +- assert PLAIN_TEXT in sage_format, 'plain text is always present' +- if sage_format.keys() != [PLAIN_TEXT]: +- return sage_format, sage_metadata +- # Second, try IPython widgets (obj._ipython_display_ and type registry) +- if self.ipython_display_formatter(obj): +- return {}, {} +- # Finally, try IPython rich representation (obj._repr_foo_ methods) +- if exclude is not None: +- exclude = list(exclude) + [PLAIN_TEXT] +- ipy_format, ipy_metadata = super(SageDisplayFormatter, self).format( +- obj, include=include, exclude=exclude) +- ipy_format.update(sage_format) +- ipy_metadata.update(sage_metadata) +- return ipy_format, ipy_metadata ++ return self.dm.displayhook(obj) ++ + + + class SagePlainTextFormatter(PlainTextFormatter): +@@ -190,7 +155,7 @@ class SagePlainTextFormatter(PlainTextFo + sage: from sage.repl.interpreter import get_test_shell + sage: shell = get_test_shell() + sage: shell.display_formatter.formatters['text/plain'] +- ++ + sage: shell.quit() + """ + super(SagePlainTextFormatter, self).__init__(*args, **kwds) +diff -up src/sage/repl/display/jsmol_iframe.py.orig src/sage/repl/display/jsmol_iframe.py +--- src/sage/repl/display/jsmol_iframe.py.orig 2016-08-18 13:12:59.088122165 -0400 ++++ src/sage/repl/display/jsmol_iframe.py 2016-08-18 13:13:01.908122273 -0400 +@@ -249,7 +249,7 @@ class JSMolHtml(SageObject): + String. + + EXAMPLES:: +- ++ + sage: from sage.repl.display.jsmol_iframe import JSMolHtml + sage: from sage.repl.rich_output.output_graphics3d import OutputSceneJmol + sage: jmol = JSMolHtml(OutputSceneJmol.example()) +@@ -276,7 +276,7 @@ class JSMolHtml(SageObject): + String + + EXAMPLES:: +- ++ + sage: from sage.repl.display.jsmol_iframe import JSMolHtml + sage: from sage.repl.rich_output.output_graphics3d import OutputSceneJmol + sage: jmol = JSMolHtml(OutputSceneJmol.example(), width=500, height=300) +diff -up src/sage/repl/display/pretty_print.py.orig src/sage/repl/display/pretty_print.py +--- src/sage/repl/display/pretty_print.py.orig 2016-08-18 13:12:59.093122165 -0400 ++++ src/sage/repl/display/pretty_print.py 2016-08-18 13:13:01.909122273 -0400 +@@ -74,12 +74,12 @@ class SagePrettyPrinter(PrettyPrinter): + See IPython documentation. + + EXAMPLES:: +- ++ + sage: 123 + 123 + + IPython pretty printers:: +- ++ + sage: set({1, 2, 3}) + {1, 2, 3} + sage: dict(zzz=123, aaa=99, xab=10) # sorted by keys +@@ -88,16 +88,20 @@ class SagePrettyPrinter(PrettyPrinter): + These are overridden in IPython in a way that we feel is somewhat + confusing, and we prefer to print them like plain Python which is + more informative. See :trac:`14466` :: +- ++ + sage: 'this is a string' + 'this is a string' + sage: type(123) + + sage: type + ++ sage: [type, type] ++ [, ] + sage: import types +- sage: type('name', (), {}) +- ++ sage: types.ClassType('name', (), {}) ++ ++ sage: types.TypeType ++ + sage: types.BuiltinFunctionType + + +diff -up src/sage/repl/display/util.py.orig src/sage/repl/display/util.py +--- src/sage/repl/display/util.py.orig 2016-08-18 13:12:59.099122165 -0400 ++++ src/sage/repl/display/util.py 2016-08-18 13:13:01.909122273 -0400 +@@ -14,7 +14,6 @@ methods elsewhere. + # the License, or (at your option) any later version. + # http://www.gnu.org/licenses/ + #***************************************************************************** +-from __future__ import print_function + + + class TallListFormatter(object): +@@ -75,8 +74,8 @@ class TallListFormatter(object): + TESTS:: + + sage: from sage.repl.display.util import format_list +- sage: print(format_list.try_format( +- ....: [matrix([[1, 2, 3, 4], [5, 6, 7, 8]]) for i in xrange(7)])) ++ sage: print format_list.try_format( ++ ....: [matrix([[1, 2, 3, 4], [5, 6, 7, 8]]) for i in xrange(7)]) + [ + [1 2 3 4] [1 2 3 4] [1 2 3 4] [1 2 3 4] [1 2 3 4] [1 2 3 4] + [5 6 7 8], [5 6 7 8], [5 6 7 8], [5 6 7 8], [5 6 7 8], [5 6 7 8], +diff -up src/sage/repl/image.py.orig src/sage/repl/image.py +--- src/sage/repl/image.py.orig 2016-08-18 13:12:59.104122165 -0400 ++++ src/sage/repl/image.py 2016-08-18 13:13:01.910122273 -0400 +@@ -14,9 +14,8 @@ EXAMPLES:: + sage: from sage.repl.image import Image + sage: img = Image('RGB', (256, 256), 'white') + sage: pixels = img.pixels() +- sage: for x in range(img.width()): +- ....: for y in range(img.height()): +- ....: pixels[x, y] = (x, y, 100) ++ sage: for x, y in CartesianProduct(range(img.width()), range(img.height())): ++ ....: pixels[x, y] = (x, y, 100) + sage: img + 256x256px 24-bit RGB image + sage: type(img) +@@ -39,7 +38,7 @@ from sage.structure.sage_object import S + + class Image(SageObject): + +- def __init__(self, mode, size, color='white'): ++ def __init__(self, mode, size, color=0): + """ + Creates a new image with the given mode and size. + +@@ -76,12 +75,13 @@ class Image(SageObject): + + - ``size`` -- 2-tuple, containing (width, height) in pixels. + +- - ``color`` -- string or tuple of numeric. What colour to use +- for the image. Default is black. If given, this should be a +- a tuple with one value per band. When creating RGB images, +- you can also use colour strings as supported by the +- ImageColor module. If the colour is None, the image is not +- initialised. ++ - ``color`` -- string or numeric. What colour to use for the ++ image. Default is black. If given, this should be a single ++ integer or floating point value for single-band modes, and a ++ tuple for multi-band modes (one value per band). When ++ creating RGB images, you can also use colour strings as ++ supported by the ImageColor module. If the colour is None, ++ the image is not initialised. + + OUTPUT: + +@@ -90,7 +90,7 @@ class Image(SageObject): + EXAMPLES:: + + sage: from sage.repl.image import Image +- sage: Image('P', (16, 16), (13,)) ++ sage: Image('P', (16, 16), 13) + 16x16px 8-bit Color image + """ + self._pil = PIL.Image.new(mode, size, color) +@@ -232,7 +232,7 @@ class Image(SageObject): + EXAMPLES:: + + sage: from sage.repl.image import Image +- sage: img = Image('P', (12, 34), (13,)) ++ sage: img = Image('P', (12, 34), 13) + sage: filename = tmp_filename(ext='.png') + sage: img.save(filename) + sage: open(filename).read().startswith('\x89PNG') +diff -up src/sage/repl/interpreter.py.orig src/sage/repl/interpreter.py +--- src/sage/repl/interpreter.py.orig 2016-08-18 13:12:59.109122165 -0400 ++++ src/sage/repl/interpreter.py 2016-08-18 13:13:01.911122273 -0400 +@@ -76,18 +76,14 @@ Check that Cython source code appears in + sage: shell = get_test_shell() + sage: shell.run_cell('1/0') + --------------------------------------------------------------------------- +- ZeroDivisionError Traceback (most recent call last) +- in () +- ----> 1 Integer(1)/Integer(0) ++ .../sage/rings/integer_ring.pyx in sage.rings.integer_ring.IntegerRing_class._div (.../cythonized/sage/rings/integer_ring.c:...)() ++ ... cdef rational.Rational x = rational.Rational.__new__(rational.Rational) ++ ... if mpz_sgn(right.value) == 0: ++ ... raise ZeroDivisionError('Rational division by zero') ++ ... mpz_set(mpq_numref(x.value), left.value) ++ ... mpz_set(mpq_denref(x.value), right.value) + +- .../src/sage/rings/integer.pyx in sage.rings.integer.Integer.__div__ (.../cythonized/sage/rings/integer.c:...)() +- ... if type(left) is type(right): +- ... if mpz_sgn((right).value) == 0: +- -> ... raise ZeroDivisionError("rational division by zero") +- ... x = Rational.__new__(Rational) +- ... mpq_div_zz(x.value, (left).value, (right).value) +- +- ZeroDivisionError: rational division by zero ++ ZeroDivisionError: Rational division by zero + sage: shell.quit() + """ + +@@ -108,8 +104,8 @@ import re + import sys + from sage.repl.preparse import preparse + +-from traitlets.config.loader import Config +-from traitlets import Bool, Type ++from IPython import Config ++from IPython.utils.traitlets import Bool, Type + + from sage.env import SAGE_LOCAL + +@@ -184,6 +180,10 @@ class SageShellOverride(object): + """ + Run a system command. + ++ If the command is not a sage-specific binary, adjust the library ++ paths before calling system commands. See :trac:`975` for a ++ discussion of running system commands. ++ + This is equivalent to the sage-native-execute shell script. + + EXAMPLES:: +@@ -196,12 +196,22 @@ class SageShellOverride(object): + sage: shell.system_raw('true') + sage: shell.user_ns['_exit_code'] + 0 ++ sage: shell.system_raw('env | grep "^LD_LIBRARY_PATH=" | grep $SAGE_LOCAL') ++ sage: shell.user_ns['_exit_code'] ++ 1 + sage: shell.system_raw('R --version') + R version ... + sage: shell.user_ns['_exit_code'] + 0 + sage: shell.quit() + """ ++ path = os.path.join(SAGE_LOCAL, 'bin', ++ re.split(r'[\s|;&]', cmd)[0]) ++ if not os.access(path, os.X_OK): ++ libraries = 'LD_LIBRARY_PATH="$SAGE_ORIG_LD_LIBRARY_PATH";export LD_LIBRARY_PATH;' ++ if os.uname()[0]=='Darwin': ++ libraries += 'DYLD_LIBRARY_PATH="$SAGE_ORIG_DYLD_LIBRARY_PATH";export DYLD_LIBRARY_PATH;' ++ cmd = libraries+cmd + return super(SageShellOverride, self).system_raw(cmd) + + +@@ -362,7 +372,7 @@ class SageTestShell(SageShellOverride, T + --------------------------------------------------------------------------- + ZeroDivisionError Traceback (most recent call last) + ... +- ZeroDivisionError: rational division by zero ++ ZeroDivisionError: Rational division by zero + sage: rc is None + True + sage: shell.quit() +@@ -680,6 +690,10 @@ def get_test_shell(): + app.shell._restart() + except AttributeError: + pass ++ # overwrite the default (console + graphics) formatter with the plain text one ++ import sage.repl.display.formatter as formatter ++ app.shell.display_formatter.formatters['text/plain'] = ( ++ formatter.SagePlainTextFormatter(config=app.shell.config)) + # No quit noise + app.shell.verbose_quit = False + return app.shell +@@ -721,10 +735,10 @@ class SageTerminalApp(TerminalIPythonApp + name = u'Sage' + crash_handler_class = SageCrashHandler + +- test_shell = Bool(False, help='Whether the shell is a test shell') +- test_shell.tag(config=True) +- shell_class = Type(InteractiveShell, help='Type of the shell') +- shell_class.tag(config=True) ++ test_shell = Bool(False, config=True, ++ help='Whether the shell is a test shell') ++ shell_class = Type(InteractiveShell, config=True, ++ help='Type of the shell') + + def load_config_file(self, *args, **kwds): + r""" +@@ -741,7 +755,7 @@ class SageTerminalApp(TerminalIPythonApp + sage: from sage.misc.temporary_file import tmp_dir + sage: from sage.repl.interpreter import SageTerminalApp + sage: d = tmp_dir() +- sage: from IPython.paths import get_ipython_dir ++ sage: from IPython.utils.path import get_ipython_dir + sage: IPYTHONDIR = get_ipython_dir() + sage: os.environ['IPYTHONDIR'] = d + sage: SageTerminalApp().load_config_file() +diff -up src/sage/repl/ipython_extension.py.orig src/sage/repl/ipython_extension.py +--- src/sage/repl/ipython_extension.py.orig 2016-08-18 13:12:59.114122166 -0400 ++++ src/sage/repl/ipython_extension.py 2016-08-18 13:13:01.912122273 -0400 +@@ -15,8 +15,6 @@ A Sage extension which adds sage-specifi + + - ``%mode`` (like ``%maxima``, etc.) + +- - ``%%cython`` +- + * preparsing of input + + * loading Sage library +@@ -57,13 +55,12 @@ In contrast, input to the ``%time`` magi + 2 * 3^3 * 11 + sage: shell.quit() + """ +-from __future__ import absolute_import + +-from IPython.core.magic import Magics, magics_class, line_magic, cell_magic ++from IPython.core.magic import Magics, magics_class, line_magic + + from sage.repl.load import load_wrap ++ + from sage.env import SAGE_IMPORTALL, SAGE_STARTUP_FILE +-from sage.misc.lazy_import import LazyImport + + @magics_class + class SageMagics(Magics): +@@ -324,38 +321,6 @@ class SageMagics(Magics): + except ValueError as err: + print(err) # do not show traceback + +- @cell_magic +- def cython(self, line, cell): +- """ +- Cython cell magic +- +- This is syntactic sugar on the +- :func:`~sage.misc.cython_c.cython` function. +- +- INPUT:: +- +- - ``line`` -- ignored. +- +- - ``cell`` -- string. The Cython source code to process. +- +- OUTPUT: +- +- None. The Cython code is compiled and loaded. +- +- EXAMPLES:: +- +- sage: from sage.repl.interpreter import get_test_shell +- sage: shell = get_test_shell() +- sage: shell.run_cell(''' +- ....: %%cython +- ....: def f(): +- ....: print('test') +- ....: ''') +- ....: shell.run_cell('f()') +- """ +- from sage.misc.cython_c import cython_compile +- return cython_compile(cell) +- + + class SageCustomizations(object): + +@@ -368,12 +333,19 @@ class SageCustomizations(object): + self.auto_magics = SageMagics(shell) + self.shell.register_magics(self.auto_magics) + ++ import sage.repl.display.formatter as formatter ++ self.shell.display_formatter.formatters['text/plain'] = ( ++ formatter.SagePlainTextFormatter(config=shell.config)) ++ + import sage.misc.edit_module as edit_module + self.shell.set_hook('editor', edit_module.edit_devel) + + self.init_inspector() + self.init_line_transforms() + ++ import inputhook ++ inputhook.install() ++ + import sage.all # until sage's import hell is fixed + + self.shell.verbose_quit = True +@@ -384,12 +356,31 @@ class SageCustomizations(object): + if SAGE_IMPORTALL == 'yes': + self.init_environment() + ++ + def register_interface_magics(self): + """ + Register magics for each of the Sage interfaces + """ +- from sage.repl.interface_magic import InterfaceMagic +- InterfaceMagic.register_all(self.shell) ++ from sage.misc.superseded import deprecation ++ import sage.interfaces.all ++ interfaces = [(name, obj) ++ for name, obj in sage.interfaces.all.__dict__.items() ++ if isinstance(obj, sage.interfaces.interface.Interface)] ++ ++ for real_name, obj in interfaces: ++ def tmp(line, name=real_name): ++ self.shell.run_cell('%s.interact()' % name) ++ tmp.__doc__ = "Interact with %s" % real_name ++ self.shell.register_magic_function(tmp, magic_name=real_name) ++ ++ obj_name = obj.name() ++ if real_name != obj_name: ++ def tmp_deprecated(line, name=real_name, badname=obj_name): ++ deprecation(6288, 'Use %%%s instead of %%%s.' % (name, ++ badname)) ++ self.shell.run_cell('%s.interact()' % name) ++ tmp_deprecated.__doc__ = "Interact with %s" % real_name ++ self.shell.register_magic_function(tmp_deprecated, magic_name=obj_name) + + def set_quit_hook(self): + """ +@@ -426,17 +417,19 @@ class SageCustomizations(object): + # that we could override; however, IPython looks them up in + # the global :class:`IPython.core.oinspect` module namespace. + # Thus, we have to monkey-patch. ++ import sage.misc.sagedoc as sagedoc ++ import sage.misc.sageinspect as sageinspect + import IPython.core.oinspect +- IPython.core.oinspect.getdoc = LazyImport("sage.misc.sageinspect", "sage_getdoc") +- IPython.core.oinspect.getsource = LazyImport("sage.misc.sagedoc", "my_getsource") +- IPython.core.oinspect.find_file = LazyImport("sage.misc.sageinspect", "sage_getfile") +- IPython.core.oinspect.getargspec = LazyImport("sage.misc.sageinspect", "sage_getargspec") ++ IPython.core.oinspect.getdoc = sageinspect.sage_getdoc ++ IPython.core.oinspect.getsource = sagedoc.my_getsource ++ IPython.core.oinspect.find_file = sageinspect.sage_getfile ++ IPython.core.oinspect.getargspec = sageinspect.sage_getargspec + + def init_line_transforms(self): + """ + Set up transforms (like the preparser). + """ +- from .interpreter import (SagePreparseTransformer, ++ from interpreter import (SagePreparseTransformer, + SagePromptTransformer) + + for s in (self.shell.input_splitter, self.shell.input_transformer_manager): +diff -up src/sage/repl/ipython_kernel/install.py.orig src/sage/repl/ipython_kernel/install.py +--- src/sage/repl/ipython_kernel/install.py.orig 2016-08-18 13:12:59.119122166 -0400 ++++ src/sage/repl/ipython_kernel/install.py 2016-08-18 13:13:01.912122273 -0400 +@@ -1,38 +1,41 @@ + """ +-Installing the SageMath Jupyter Kernel and extensions ++Installing the Sage IPython Kernel + +-Kernels have to register themselves with Jupyter so that they appear +-in the Jupyter notebook's kernel drop-down. This is done by ++Kernels have to register themselves with IPython so that they appear ++in the IPython notebook's kernel drop-down. This is done by + :class:`SageKernelSpec`. + """ + + import os + import errno ++import copy ++ ++from IPython.kernel.kernelspec import ( ++ get_kernel_spec, install_kernel_spec, NoSuchKernel) ++from IPython.utils.path import get_ipython_dir + + from sage.env import ( + SAGE_ROOT, SAGE_DOC, SAGE_LOCAL, SAGE_EXTCODE, + SAGE_VERSION + ) +-from jupyter_core.paths import ENV_JUPYTER_PATH +-JUPYTER_PATH = ENV_JUPYTER_PATH[0] ++from sage.misc.temporary_file import tmp_dir + + + class SageKernelSpec(object): + + def __init__(self): + """ +- Utility to manage SageMath kernels and extensions ++ Utility to manage Sage kernels + + EXAMPLES:: + + sage: from sage.repl.ipython_kernel.install import SageKernelSpec + sage: spec = SageKernelSpec() + sage: spec._display_name # random output +- 'SageMath 6.9' ++ 'Sage 6.6.beta2' + """ +- self._display_name = 'SageMath {0}'.format(SAGE_VERSION) +- self.nbextensions_dir = os.path.join(JUPYTER_PATH, "nbextensions") +- self.kernel_dir = os.path.join(JUPYTER_PATH, "kernels", self.identifier()) ++ self._display_name = 'Sage {0}'.format(SAGE_VERSION) ++ self._ipython_dir = get_ipython_dir() + self._mkdirs() + + def _mkdirs(self): +@@ -44,33 +47,40 @@ class SageKernelSpec(object): + sage: from sage.repl.ipython_kernel.install import SageKernelSpec + sage: spec = SageKernelSpec() + sage: spec._mkdirs() +- sage: os.path.isdir(spec.nbextensions_dir) ++ sage: nbextensions = os.path.join(spec._ipython_dir, 'nbextensions') ++ sage: os.path.exists(nbextensions) + True + """ +- def mkdir_p(path): ++ def mkdir_p(*path_components): ++ path = os.path.join(*path_components) + try: + os.makedirs(path) +- except OSError: +- if not os.path.isdir(path): ++ except OSError as err: ++ if err.errno == errno.EEXIST and os.path.isdir(path): ++ pass ++ else: + raise +- mkdir_p(self.nbextensions_dir) +- mkdir_p(self.kernel_dir) ++ mkdir_p(self._ipython_dir, 'nbextensions') + + @classmethod +- def identifier(cls): ++ def identifier(self): + """ +- Internal identifier for the SageMath kernel ++ Internal identifier for the Sage kernel ++ ++ OUTPUT: + +- OUTPUT: the string ``"sagemath"``. ++ String. + + EXAMPLES:: + + sage: from sage.repl.ipython_kernel.install import SageKernelSpec +- sage: SageKernelSpec.identifier() +- 'sagemath' ++ sage: SageKernelSpec.identifier() # random output ++ 'sage_6_6_beta3' ++ sage: SageKernelSpec.identifier().startswith('sage_') ++ True + """ +- return 'sagemath' +- ++ return 'Sage {0}'.format(SAGE_VERSION).lower().replace(' ', '_').replace('.', '_') ++ + def symlink(self, src, dst): + """ + Symlink ``src`` to ``dst`` +@@ -95,48 +105,38 @@ class SageKernelSpec(object): + if err.errno == errno.EEXIST: + return + os.symlink(src, dst) +- ++ + def use_local_mathjax(self): + """ +- Symlink SageMath's Mathjax install to the Jupyter notebook. ++ Symlink Sage's Mathjax Install to the IPython notebook. + + EXAMPLES:: + + sage: from sage.repl.ipython_kernel.install import SageKernelSpec ++ sage: from IPython.utils.path import get_ipython_dir + sage: spec = SageKernelSpec() + sage: spec.use_local_mathjax() +- sage: mathjax = os.path.join(spec.nbextensions_dir, 'mathjax') +- sage: os.path.isdir(mathjax) ++ sage: ipython_dir = get_ipython_dir() ++ sage: mathjax = os.path.join(ipython_dir, 'nbextensions', 'mathjax') ++ sage: os.path.exists(mathjax) + True + """ + src = os.path.join(SAGE_LOCAL, 'share', 'mathjax') +- dst = os.path.join(self.nbextensions_dir, 'mathjax') ++ dst = os.path.join(self._ipython_dir, 'nbextensions', 'mathjax') + self.symlink(src, dst) + + def use_local_jsmol(self): +- """ +- Symlink jsmol to the Jupyter notebook. +- +- EXAMPLES:: +- +- sage: from sage.repl.ipython_kernel.install import SageKernelSpec +- sage: spec = SageKernelSpec() +- sage: spec.use_local_jsmol() +- sage: jsmol = os.path.join(spec.nbextensions_dir, 'jsmol') +- sage: os.path.isdir(jsmol) +- True +- """ + src = os.path.join(SAGE_LOCAL, 'share', 'jsmol') +- dst = os.path.join(self.nbextensions_dir, 'jsmol') ++ dst = os.path.join(self._ipython_dir, 'nbextensions', 'jsmol') + self.symlink(src, dst) + + def _kernel_cmd(self): + """ +- Helper to construct the SageMath kernel command. +- ++ Helper to construct the Sage kernel command. ++ + OUTPUT: + +- List of strings. The command to start a new SageMath kernel. ++ List of strings. The command to start a new Sage kernel. + + EXAMPLES:: + +@@ -144,7 +144,7 @@ class SageKernelSpec(object): + sage: spec = SageKernelSpec() + sage: spec._kernel_cmd() + ['/.../sage', +- '--python', ++ '-python', + '-m', + 'sage.repl.ipython_kernel', + '-f', +@@ -152,34 +152,40 @@ class SageKernelSpec(object): + """ + return [ + os.path.join(SAGE_ROOT, 'sage'), +- '--python', ++ '-python', + '-m', 'sage.repl.ipython_kernel', + '-f', '{connection_file}', + ] +- ++ + def kernel_spec(self): + """ + Return the kernel spec as Python dictionary + + OUTPUT: + +- A dictionary. See the Jupyter documentation for details. ++ A dictionary. See the IPython documentation for details. + + EXAMPLES:: + + sage: from sage.repl.ipython_kernel.install import SageKernelSpec + sage: spec = SageKernelSpec() + sage: spec.kernel_spec() +- {'argv': ..., 'display_name': 'SageMath ...'} ++ {'argv': ..., 'display_name': 'Sage ...'} + """ + return dict( + argv=self._kernel_cmd(), + display_name=self._display_name, + ) +- ++ + def _install_spec(self): + """ +- Install the SageMath Jupyter kernel ++ Install the Sage IPython kernel ++ ++ It is safe to call this method multiple times, only one Sage ++ kernel spec is ever installed for any given Sage ++ version. However, it resets the IPython kernel spec directory ++ so additional resources symlinked there are lost. See ++ :meth:`symlink_resources`. + + EXAMPLES:: + +@@ -187,17 +193,21 @@ class SageKernelSpec(object): + sage: spec = SageKernelSpec() + sage: spec._install_spec() # not tested + """ +- jsonfile = os.path.join(self.kernel_dir, "kernel.json") + import json +- with open(jsonfile, 'w') as f: ++ temp = tmp_dir() ++ kernel_spec = os.path.join(temp, 'kernel.json') ++ with open(kernel_spec, 'w') as f: + json.dump(self.kernel_spec(), f) ++ identifier = self.identifier() ++ install_kernel_spec(temp, identifier, user=True, replace=True) ++ self._spec = get_kernel_spec(identifier) + + def _symlink_resources(self): + """ + Symlink miscellaneous resources + +- This method symlinks additional resources (like the SageMath +- documentation) into the SageMath kernel directory. This is ++ This method symlinks additional resources (like the Sage ++ documentation) into the Sage kernel directory. This is + necessary to make the help links in the notebook work. + + EXAMPLES:: +@@ -207,23 +217,25 @@ class SageKernelSpec(object): + sage: spec._install_spec() # not tested + sage: spec._symlink_resources() # not tested + """ ++ assert self._spec, 'call _install_spec() first' ++ spec_dir = self._spec.resource_dir + path = os.path.join(SAGE_EXTCODE, 'notebook-ipython') + for filename in os.listdir(path): + self.symlink( + os.path.join(path, filename), +- os.path.join(self.kernel_dir, filename) ++ os.path.join(spec_dir, filename) + ) + self.symlink( +- os.path.join(SAGE_DOC, 'html', 'en'), +- os.path.join(self.kernel_dir, 'doc') ++ os.path.join(SAGE_DOC, 'output', 'html', 'en'), ++ os.path.join(spec_dir, 'doc') + ) +- ++ + @classmethod + def update(cls): + """ +- Configure the Jupyter notebook for the SageMath kernel +- +- This method does everything necessary to use the SageMath kernel, ++ Configure the IPython notebook for the Sage kernel ++ ++ This method does everything necessary to use the Sage kernel, + you should never need to call any of the other methods + directly. + +@@ -231,7 +243,7 @@ class SageKernelSpec(object): + + sage: from sage.repl.ipython_kernel.install import SageKernelSpec + sage: spec = SageKernelSpec() +- sage: spec.update() # not tested ++ sage: spec.update() + """ + instance = cls() + instance.use_local_mathjax() +@@ -239,18 +251,13 @@ class SageKernelSpec(object): + instance._install_spec() + instance._symlink_resources() + +- +-def have_prerequisites(debug=True): ++ ++def have_prerequisites(): + """ +- Check that we have all prerequisites to run the Jupyter notebook. ++ Check that we have all prerequisites to run the IPython notebook. + +- In particular, the Jupyter notebook requires OpenSSL whether or +- not you are using https. See :trac:`17318`. +- +- INPUT: +- +- ``debug`` -- boolean (default: ``True``). Whether to print debug +- information in case that prerequisites are missing. ++ In particular, the IPython notebook requires OpenSSL whether or ++ not you are using https. See trac:`17318`. + + OUTPUT: + +@@ -259,14 +266,15 @@ def have_prerequisites(debug=True): + EXAMPLES:: + + sage: from sage.repl.ipython_kernel.install import have_prerequisites +- sage: have_prerequisites(debug=False) in [True, False] ++ sage: have_prerequisites() in [True, False] + True + """ + try: +- from notebook.notebookapp import NotebookApp ++ from IPython.html.notebookapp import NotebookApp + return True +- except ImportError: +- if debug: +- import traceback +- traceback.print_exc() ++ except ImportError as err: + return False ++ ++ ++ ++ +diff -up src/sage/repl/ipython_kernel/kernel.py.orig src/sage/repl/ipython_kernel/kernel.py +--- src/sage/repl/ipython_kernel/kernel.py.orig 2016-08-18 13:12:59.125122166 -0400 ++++ src/sage/repl/ipython_kernel/kernel.py 2016-08-18 13:13:01.913122273 -0400 +@@ -1,8 +1,8 @@ + """ + The Sage ZMQ Kernel + +-Version of the Jupyter kernel when running Sage inside the Jupyter +-notebook or remote Jupyter sessions. ++Version of the IPython kernel when running Sage inside the IPython ++notebook or remote IPython sessions. + """ + + #***************************************************************************** +@@ -15,9 +15,9 @@ notebook or remote Jupyter sessions. + #***************************************************************************** + + import sys +-from ipykernel.ipkernel import IPythonKernel +-from ipykernel.zmqshell import ZMQInteractiveShell +-from traitlets import Type ++from IPython.kernel.zmq.ipkernel import IPythonKernel ++from IPython.kernel.zmq.zmqshell import ZMQInteractiveShell ++from IPython.utils.traitlets import Type + + from sage.env import SAGE_VERSION, SAGE_EXTCODE, SAGE_DOC + from sage.repl.interpreter import SageNotebookInteractiveShell +@@ -27,7 +27,7 @@ class SageZMQInteractiveShell(SageNotebo + pass + + +-class SageKernel(IPythonKernel): ++class SageKernel(IPythonKernel): + implementation = 'sage' + implementation_version = SAGE_VERSION + +@@ -35,11 +35,11 @@ class SageKernel(IPythonKernel): + + def __init__(self, **kwds): + """ +- The Sage Jupyter Kernel ++ The Sage IPython Kernel + + INPUT: + +- See the Jupyter documentation ++ See the IPython documentation + + EXAMPLES:: + +@@ -54,8 +54,8 @@ class SageKernel(IPythonKernel): + def banner(self): + r""" + The Sage Banner +- +- The value of this property is displayed in the Jupyter ++ ++ The value of this property is displayed in the IPython + notebook. + + OUTPUT: +@@ -67,7 +67,7 @@ class SageKernel(IPythonKernel): + sage: from sage.repl.ipython_kernel.kernel import SageKernel + sage: sk = SageKernel.__new__(SageKernel) + sage: sk.banner +- '...SageMath version...' ++ '\xe2\x94\x8c\xe2...SageMath Version...' + """ + from sage.misc.banner import banner_text + return banner_text() +@@ -75,16 +75,11 @@ class SageKernel(IPythonKernel): + @property + def help_links(self): + r""" +- Help in the Jupyter Notebook +- ++ Help in the IPython Notebook ++ + OUTPUT: + +- See the Jupyter documentation. +- +- .. NOTE:: +- +- Urls starting with "kernelspecs" are prepended by the +- browser with the appropriate path. ++ See the IPython documentation. + + EXAMPLES:: + +@@ -92,16 +87,16 @@ class SageKernel(IPythonKernel): + sage: sk = SageKernel.__new__(SageKernel) + sage: sk.help_links + [{'text': 'Sage Documentation', +- 'url': 'kernelspecs/sagemath/doc/index.html'}, ++ 'url': '/kernelspecs/sage_.../doc/index.html'}, + ...] + """ + from sage.repl.ipython_kernel.install import SageKernelSpec + identifier = SageKernelSpec.identifier() +- kernel_url = lambda x: 'kernelspecs/{0}/{1}'.format(identifier, x) ++ kernel_url = lambda x: '/kernelspecs/{0}/{1}'.format(identifier, x) + return [ + { + 'text': 'Sage Documentation', +- 'url': kernel_url('doc/index.html'), ++ 'url': kernel_url('doc/index.html') + }, + { + 'text': 'Sage Tutorial', +@@ -124,7 +119,7 @@ class SageKernel(IPythonKernel): + 'url': kernel_url('doc/reference/index.html'), + }, + { +- 'text': "Developer's Guide", ++ 'text': 'Developers Guide', + 'url': kernel_url('doc/developer/index.html'), + }, + { +@@ -164,7 +159,3 @@ class SageKernel(IPythonKernel): + 'url': "http://help.github.com/articles/github-flavored-markdown", + }, + ] +- +- def pre_handler_hook(self): +- from cysignals import init_cysignals +- self.saved_sigint_handler = init_cysignals() +diff -up src/sage/repl/ipython_kernel/__main__.py.orig src/sage/repl/ipython_kernel/__main__.py +--- src/sage/repl/ipython_kernel/__main__.py.orig 2016-08-18 13:12:59.131122166 -0400 ++++ src/sage/repl/ipython_kernel/__main__.py 2016-08-18 13:13:01.913122273 -0400 +@@ -1,3 +1,3 @@ +-from ipykernel.kernelapp import IPKernelApp ++from IPython.kernel.zmq.kernelapp import IPKernelApp + from sage.repl.ipython_kernel.kernel import SageKernel + IPKernelApp.launch_instance(kernel_class=SageKernel) +diff -up src/sage/repl/preparse.py.orig src/sage/repl/preparse.py +--- src/sage/repl/preparse.py.orig 2016-08-18 13:12:59.137122166 -0400 ++++ src/sage/repl/preparse.py 2016-08-18 13:13:01.914122273 -0400 +@@ -216,7 +216,7 @@ Behind the scenes what happens is the fo + # (at your option) any later version. + # http://www.gnu.org/licenses/ + #***************************************************************************** +-from __future__ import print_function ++ + + import os + import re +@@ -321,9 +321,9 @@ def strip_string_literals(code, state=No + '[%(L1)s, %(L2)s, %(L3)s, %(L4)s]' + sage: literals + {'L1': "'a'", 'L2': '"b"', 'L3': "'c'", 'L4': '"d\\""'} +- sage: print(s % literals) ++ sage: print s % literals + ['a', "b", 'c', "d\""] +- sage: print(strip_string_literals(r'-"\\\""-"\\"-')[0]) ++ sage: print strip_string_literals(r'-"\\\""-"\\"-')[0] + -%(L1)s-%(L2)s- + + Triple-quotes are handled as well:: +@@ -331,7 +331,7 @@ def strip_string_literals(code, state=No + sage: s, literals, state = strip_string_literals("[a, '''b''', c, '']") + sage: s + '[a, %(L1)s, c, %(L2)s]' +- sage: print(s % literals) ++ sage: print s % literals + [a, '''b''', c, ''] + + Comments are substitute too:: +@@ -449,9 +449,8 @@ def containing_block(code, ix, delimiter + sage: s = "factor(next_prime(L[5]+1))" + sage: s[22] + '+' +- sage: start, end = containing_block(s, 22) +- sage: start, end +- (17, 25) ++ sage: start, end = containing_block(s, 22); print start, end ++ 17 25 + sage: s[start:end] + '(L[5]+1)' + sage: s[20] +@@ -524,9 +523,9 @@ def parse_ellipsis(code, preparse_step=T + sage: [1.0..2.0] + [1.00000000000000, 2.00000000000000] + +- TESTS: ++ TESTS: + +- Check that nested ellipsis is processed correctly (:trac:`17378`):: ++ Check that nested ellipsis is processed correctly (:trac:`17378`):: + + sage: preparse('[1,..,2,..,len([1..3])]') + '(ellipsis_range(Integer(1),Ellipsis,Integer(2),Ellipsis,len((ellipsis_range(Integer(1),Ellipsis,Integer(3))))))' +@@ -586,9 +585,9 @@ def extract_numeric_literals(code): + + sage: from sage.repl.preparse import extract_numeric_literals + sage: code, nums = extract_numeric_literals("1.2 + 5") +- sage: print(code) ++ sage: print code + _sage_const_1p2 + _sage_const_5 +- sage: print(nums) ++ sage: print nums + {'_sage_const_1p2': "RealNumber('1.2')", '_sage_const_5': 'Integer(5)'} + + sage: extract_numeric_literals("[1, 1.1, 1e1, -1e-1, 1.]")[0] +@@ -662,9 +661,9 @@ def preparse_numeric_literals(code, extr + sage: preparse_numeric_literals("0x10.sqrt()") + 'Integer(0x10).sqrt()' + sage: preparse_numeric_literals('0o100') +- 'Integer(0o100)' ++ "Integer('100', 8)" + sage: preparse_numeric_literals('0b111001') +- 'Integer(0b111001)' ++ "Integer('111001', 2)" + sage: preparse_numeric_literals('0xe') + 'Integer(0xe)' + sage: preparse_numeric_literals('0xEAR') +@@ -721,18 +720,25 @@ def preparse_numeric_literals(code, extr + end += 1 + num += '.' + +- num_name = numeric_literal_prefix + num.replace('.', 'p').replace('-', 'n').replace('+', '') + +- if 'J' in postfix: +- num_make = "ComplexNumber(0, '%s')" % num +- num_name += 'j' +- elif len(num) < 2 or num[1] in 'oObBxX': +- num_make = "Integer(%s)" % num +- elif '.' in num or 'e' in num or 'E' in num: +- num_make = "RealNumber('%s')" % num +- elif num[0] == "0": +- num_make = "Integer('%s')" % num ++ if len(num)>2 and num[1] in 'oObBxX': ++ # Py3 oct and bin support ++ num_name = numeric_literal_prefix + num ++ if num[1] in 'bB': ++ num_make = "Integer('%s', 2)" % num[2:] ++ elif num[1] in 'oO': ++ num_make = "Integer('%s', 8)" % num[2:] ++ else: ++ num_make = "Integer(%s)" % num ++ elif '.' in num or 'e' in num or 'E' in num or 'J' in postfix: ++ num_name = numeric_literal_prefix + num.replace('.', 'p').replace('-', 'n').replace('+', '') ++ if 'J' in postfix: ++ num_make = "ComplexNumber(0, '%s')" % num ++ num_name += 'j' ++ else: ++ num_make = "RealNumber('%s')" % num + else: ++ num_name = numeric_literal_prefix + num + num_make = "Integer(%s)" % num + + literals[num_name] = num_make +@@ -1100,7 +1106,7 @@ def preparse(line, reset=True, do_time=F + 'a * BackslashOperator() * b \\' + + sage: preparse("time R. = ZZ[]", do_time=True) +- '__time__=misc.cputime(); __wall__=misc.walltime(); R = ZZ[\'x\']; print("Time: CPU %.2f s, Wall: %.2f s"%(misc.cputime(__time__), misc.walltime(__wall__))); (x,) = R._first_ngens(1)' ++ '__time__=misc.cputime(); __wall__=misc.walltime(); R = ZZ[\'x\']; print "Time: CPU %.2f s, Wall: %.2f s"%(misc.cputime(__time__), misc.walltime(__wall__)); (x,) = R._first_ngens(1)' + """ + global quote_state + if reset: +@@ -1171,8 +1177,8 @@ def preparse(line, reset=True, do_time=F + if do_time: + # Time keyword + L = re.sub(r';time;(\s*)(\S[^;]*)', +- r';\1__time__=misc.cputime(); __wall__=misc.walltime(); \2; print(' + +- '"Time: CPU %%.2f s, Wall: %%.2f s"%%(misc.cputime(__time__), misc.walltime(__wall__)))', ++ r';\1__time__=misc.cputime(); __wall__=misc.walltime(); \2; print ' + ++ '"Time: CPU %%.2f s, Wall: %%.2f s"%%(misc.cputime(__time__), misc.walltime(__wall__))', + L) + + # Remove extra ;'s +@@ -1216,7 +1222,7 @@ def preparse_file(contents, globals=None + sage: from sage.repl.preparse import preparse_file + sage: lots_of_numbers = "[%s]" % ", ".join(str(i) for i in range(3000)) + sage: _ = preparse_file(lots_of_numbers) +- sage: print(preparse_file("type(100r), type(100)")) ++ sage: print preparse_file("type(100r), type(100)") + _sage_const_100 = Integer(100) + type(100 ), type(_sage_const_100 ) + """ +@@ -1424,10 +1430,10 @@ def handle_encoding_declaration(contents + + Two hash marks are okay; this shows up in SageTeX-generated scripts:: + +- sage: contents = '## -*- coding: utf-8 -*-\nimport os, sys\nprint(x)' ++ sage: contents = '## -*- coding: utf-8 -*-\nimport os, sys\nprint x' + sage: handle_encoding_declaration(contents, sys.stdout) + ## -*- coding: utf-8 -*- +- 'import os, sys\nprint(x)' ++ 'import os, sys\nprint x' + + When the encoding declaration doesn't match the specification, we + spit out a default UTF-8 encoding. +@@ -1454,24 +1460,24 @@ def handle_encoding_declaration(contents + '#!/usr/local/bin/python\nimport os, sys' + + +- NOTES: ++ NOTES:: + +- - PEP 263: http://www.python.org/dev/peps/pep-0263/ ++ PEP 263: http://www.python.org/dev/peps/pep-0263/ + +- - PEP 263 says that Python will interpret a UTF-8 byte order mark +- as a declaration of UTF-8 encoding, but I don't think we do +- that; this function only sees a Python string so it can't +- account for a BOM. ++ PEP 263 says that Python will interpret a UTF-8 byte order mark ++ as a declaration of UTF-8 encoding, but I don't think we do ++ that; this function only sees a Python string so it can't ++ account for a BOM. + +- - We default to UTF-8 encoding even though PEP 263 says that +- Python files should default to ASCII. ++ We default to UTF-8 encoding even though PEP 263 says that ++ Python files should default to ASCII. + +- - Also see http://docs.python.org/ref/encodings.html. ++ Also see http://docs.python.org/ref/encodings.html. + +- AUTHORS: ++ AUTHORS:: + +- - Lars Fischer +- - Dan Drake (2010-12-08, rewrite for :trac:`10440`) ++ - Lars Fischer ++ - Dan Drake (2010-12-08, rewrite for ticket #10440) + """ + lines = contents.splitlines() + for num, line in enumerate(lines[:2]): +diff -up src/sage/repl/rich_output/backend_base.py.orig src/sage/repl/rich_output/backend_base.py +--- src/sage/repl/rich_output/backend_base.py.orig 2016-08-18 13:12:59.143122167 -0400 ++++ src/sage/repl/rich_output/backend_base.py 2016-08-18 13:14:03.167124618 -0400 +@@ -47,7 +47,6 @@ EXAMPLES:: + # the License, or (at your option) any later version. + # http://www.gnu.org/licenses/ + #***************************************************************************** +-from __future__ import absolute_import + + from sage.structure.sage_object import SageObject + +@@ -187,27 +186,6 @@ class BackendBase(SageObject): + """ + raise NotImplementedError('derived classes must implement this method') + +- def is_in_terminal(self): +- """ +- Test whether the UI is meant to run in a terminal +- +- See +- :meth:`sage.repl.rich_output.display_manager.DisplayManager.is_in_terminal` +- for details. +- +- OUTPUT: +- +- Defaults to ``False``. +- +- EXAMPLES:: +- +- sage: from sage.repl.rich_output.backend_base import BackendBase +- sage: backend = BackendBase() +- sage: backend.is_in_terminal() +- False +- """ +- return False +- + def max_width(self): + """ + Return the number of characters that fit into one output line +@@ -510,8 +488,8 @@ class BackendBase(SageObject): + sage: _ # indirect doctest + 'foo' + """ +- from six.moves import builtins +- builtins._ = obj ++ import __builtin__ ++ __builtin__._ = obj + + def displayhook(self, plain_text, rich_output): + """ +diff -up src/sage/repl/rich_output/backend_doctest.py.orig src/sage/repl/rich_output/backend_doctest.py +--- src/sage/repl/rich_output/backend_doctest.py.orig 2016-08-18 13:12:59.148122167 -0400 ++++ src/sage/repl/rich_output/backend_doctest.py 2016-08-18 13:13:39.071123696 -0400 +@@ -86,7 +86,7 @@ class BackendDoctest(BackendBase): + backend. + + EXAMPLES:: +- ++ + sage: from sage.repl.rich_output.backend_doctest import BackendDoctest + sage: backend = BackendDoctest() + sage: backend.install() +@@ -104,7 +104,7 @@ class BackendDoctest(BackendBase): + should never call it by hand. + + EXAMPLES:: +- ++ + sage: from sage.repl.rich_output.backend_doctest import BackendDoctest + sage: backend = BackendDoctest() + sage: backend.install() +@@ -137,9 +137,6 @@ class BackendDoctest(BackendBase): + OutputImagePng, OutputImageGif, OutputImageJpg, + OutputImageSvg, OutputImagePdf, OutputImageDvi, + OutputSceneJmol, OutputSceneCanvas3d, OutputSceneWavefront, +- OutputVideoOgg, OutputVideoWebM, OutputVideoMp4, +- OutputVideoFlash, OutputVideoMatroska, OutputVideoAvi, +- OutputVideoWmv, OutputVideoQuicktime, + ]) + + def displayhook(self, plain_text, rich_output): +@@ -249,14 +246,6 @@ class BackendDoctest(BackendBase): + sage: backend.validate(dm.types.OutputSceneJmol.example()) + sage: backend.validate(dm.types.OutputSceneWavefront.example()) + sage: backend.validate(dm.types.OutputSceneCanvas3d.example()) +- sage: backend.validate(dm.types.OutputVideoOgg.example()) +- sage: backend.validate(dm.types.OutputVideoWebM.example()) +- sage: backend.validate(dm.types.OutputVideoMp4.example()) +- sage: backend.validate(dm.types.OutputVideoFlash.example()) +- sage: backend.validate(dm.types.OutputVideoMatroska.example()) +- sage: backend.validate(dm.types.OutputVideoAvi.example()) +- sage: backend.validate(dm.types.OutputVideoWmv.example()) +- sage: backend.validate(dm.types.OutputVideoQuicktime.example()) + """ + if isinstance(rich_output, OutputPlainText): + pass +@@ -286,34 +275,5 @@ class BackendDoctest(BackendBase): + assert rich_output.mtl.get().startswith('newmtl ') + elif isinstance(rich_output, OutputSceneCanvas3d): + assert rich_output.canvas3d.get().startswith('[{vertices:') +- elif isinstance(rich_output, OutputVideoOgg): +- assert rich_output.video.get().startswith('OggS') +- elif isinstance(rich_output, OutputVideoWebM): +- data = rich_output.video.get() +- assert data.startswith('\x1a\x45\xdf\xa3') +- assert '\x42\x82\x84webm' in data +- elif isinstance(rich_output, OutputVideoMp4): +- data = rich_output.video.get() +- assert data[4:8] == 'ftyp' +- assert data.startswith('\0\0\0') +- # See http://www.ftyps.com/ +- ftyps = [data[i:i+4] for i in range(8, ord(data[3]), 4)] +- del ftyps[1] # version number, not an ftyp +- expected = ['avc1', 'iso2', 'mp41', 'mp42'] +- assert any(i in ftyps for i in expected) +- elif isinstance(rich_output, OutputVideoFlash): +- assert rich_output.video.get().startswith('FLV\x01') +- elif isinstance(rich_output, OutputVideoMatroska): +- data = rich_output.video.get() +- assert data.startswith('\x1a\x45\xdf\xa3') +- assert '\x42\x82\x88matroska' in data +- elif isinstance(rich_output, OutputVideoAvi): +- data = rich_output.video.get() +- assert data[:4] == 'RIFF' and data[8:12] == 'AVI ' +- elif isinstance(rich_output, OutputVideoWmv): +- assert rich_output.video.get().startswith('\x30\x26\xb2\x75') +- elif isinstance(rich_output, OutputVideoQuicktime): +- data = rich_output.video.get() +- assert data[4:12] == 'ftypqt ' or data[4:8] == 'moov' + else: + raise TypeError('rich_output type not supported') +diff -up src/sage/repl/rich_output/backend_ipython.py.orig src/sage/repl/rich_output/backend_ipython.py +--- src/sage/repl/rich_output/backend_ipython.py.orig 2016-08-18 13:12:59.154122167 -0400 ++++ src/sage/repl/rich_output/backend_ipython.py 2016-08-18 13:14:14.599125056 -0400 +@@ -1,4 +1,4 @@ +-# -*- coding: utf-8 -*- ++# -*- encoding: utf-8 -*- + """ + IPython Backend for the Sage Rich Output System + +@@ -108,7 +108,6 @@ class BackendIPython(BackendBase): + if not formatted: + return + publish_display_data(data=formatted, metadata=metadata) +- + + class BackendIPythonCommandline(BackendIPython): + """ +@@ -371,26 +370,38 @@ class BackendIPythonCommandline(BackendI + .format(jmol_cmd, launch_script)) + return 'Launched jmol viewer for {0}'.format(plain_text) + +- def is_in_terminal(self): ++ def launch_sage3d(self, output_wavefront, plain_text): + """ +- Test whether the UI is meant to run in a terminal ++ Launch the stand-alone java3d viewer + +- See +- :meth:`sage.repl.rich_output.display_manager.DisplayManager.is_in_terminal` +- for details. ++ INPUT: ++ ++ - ``output_wavefront`` -- ++ :class:`~sage.repl.rich_output.output_graphics3d.OutputSceneWavefront`. The ++ scene to launch Java3d with. ++ ++ - ``plain_text`` -- string. The plain text representation. + + OUTPUT: + +- ``True`` for the IPython commandline. ++ String. Human-readable message indicating that the viewer was launched. + + EXAMPLES:: + + sage: from sage.repl.rich_output.backend_ipython import BackendIPythonCommandline + sage: backend = BackendIPythonCommandline() +- sage: backend.is_in_terminal() +- True ++ sage: from sage.repl.rich_output.output_graphics3d import OutputSceneWavefront ++ sage: backend.launch_sage3d(OutputSceneWavefront.example(), 'Graphics3d object') ++ 'Launched Java 3D viewer for Graphics3d object' + """ +- return True ++ from sage.env import SAGE_LOCAL ++ sage3d = os.path.join(SAGE_LOCAL, 'bin', 'sage3d') ++ obj = output_wavefront.obj_filename() ++ from sage.doctest import DOCTEST_MODE ++ if not DOCTEST_MODE: ++ os.system('{0} {1} 2>/dev/null 1>/dev/null &' ++ .format(sage3d, obj)) ++ return 'Launched Java 3D viewer for {0}'.format(plain_text) + + class BackendIPythonNotebook(BackendIPython): + """ +@@ -450,8 +461,8 @@ class BackendIPythonNotebook(BackendIPyt + False + """ + return set([ +- OutputPlainText, OutputAsciiArt, OutputUnicodeArt, OutputLatex, + OutputHtml, ++ OutputPlainText, OutputAsciiArt, OutputUnicodeArt, OutputLatex, + OutputImagePng, OutputImageJpg, + OutputImageSvg, OutputImagePdf, + OutputSceneJmol, +diff -up src/sage/repl/rich_output/backend_sagenb.py.orig src/sage/repl/rich_output/backend_sagenb.py +--- src/sage/repl/rich_output/backend_sagenb.py.orig 2016-08-18 13:12:59.160122167 -0400 ++++ src/sage/repl/rich_output/backend_sagenb.py 2016-08-18 13:14:20.303125275 -0400 +@@ -38,21 +38,6 @@ filenames:: + sage: os.path.exists('sage0.png') + True + sage: os.remove('sage0.png') +- +-Tables are typeset as html in SageNB:: +- +- sage: table([1, 2, 3]) +-
+- +- +- +- +- +- +- +- +-
+-
+ """ + + #***************************************************************************** +@@ -67,12 +52,10 @@ Tables are typeset as html in SageNB:: + import os + import stat + from sage.misc.cachefunc import cached_method +-from sage.misc.html import html + from sage.misc.temporary_file import graphics_filename + from sage.doctest import DOCTEST_MODE + from sage.repl.rich_output.backend_base import BackendBase + from sage.repl.rich_output.output_catalog import * +-from sage.repl.rich_output.output_video import OutputVideoBase + + + def world_readable(filename): +@@ -320,13 +303,12 @@ class BackendSageNB(BackendBase): + True + """ + return set([ +- OutputPlainText, OutputAsciiArt, OutputLatex, + OutputHtml, ++ OutputPlainText, OutputAsciiArt, OutputLatex, + OutputImagePng, OutputImageGif, OutputImageJpg, + OutputImagePdf, OutputImageSvg, + SageNbOutputSceneJmol, + OutputSceneCanvas3d, +- OutputVideoOgg, OutputVideoWebM, OutputVideoMp4, + ]) + + def display_immediately(self, plain_text, rich_output): +@@ -382,8 +364,6 @@ class BackendSageNB(BackendBase): + rich_output.embed() + elif isinstance(rich_output, OutputSceneCanvas3d): + self.embed_image(rich_output.canvas3d, '.canvas3d') +- elif isinstance(rich_output, OutputVideoBase): +- self.embed_video(rich_output) + else: + raise TypeError('rich_output type not supported, got {0}'.format(rich_output)) + +@@ -423,11 +403,4 @@ class BackendSageNB(BackendBase): + output_buffer.save_as(filename) + world_readable(filename) + +- def embed_video(self, video_output): +- filename = graphics_filename(ext=video_output.ext) +- video_output.video.save_as(filename) +- world_readable(filename) +- html(video_output.html_fragment( +- url='cell://' + filename, +- link_attrs='class="file_link"', +- )) ++ +diff -up src/sage/repl/rich_output/display_manager.py.orig src/sage/repl/rich_output/display_manager.py +--- src/sage/repl/rich_output/display_manager.py.orig 2016-08-18 13:12:59.166122168 -0400 ++++ src/sage/repl/rich_output/display_manager.py 2016-08-18 13:13:01.918122273 -0400 +@@ -343,26 +343,6 @@ class DisplayManager(SageObject): + """ + return self._preferences + +- def is_in_terminal(self): +- """ +- Test whether the UI is meant to run in a terminal +- +- When this method returns ``True``, you can assume that it is +- possible to use ``raw_input`` or launch external programs that +- take over the input. +- +- Otherwise, you should assume that the backend runs remotely or +- in a pty controlled by another program. Then you should not +- launch external programs with a (text or graphical) UI. +- +- This is used to enable/disable interpreter consoles. +- +- OUTPUT: +- +- Boolean. +- """ +- return self._backend.is_in_terminal() +- + def check_backend_class(self, backend_class): + """ + Check that the current backend is an instance of +diff -up src/sage/repl/rich_output/output_catalog.py.orig src/sage/repl/rich_output/output_catalog.py +--- src/sage/repl/rich_output/output_catalog.py.orig 2016-08-18 13:12:59.172122168 -0400 ++++ src/sage/repl/rich_output/output_catalog.py 2016-08-18 13:14:45.136126226 -0400 +@@ -40,14 +40,3 @@ from .output_graphics3d import ( + OutputSceneWavefront, + OutputSceneCanvas3d, + ) +- +-from .output_video import ( +- OutputVideoOgg, +- OutputVideoWebM, +- OutputVideoMp4, +- OutputVideoFlash, +- OutputVideoMatroska, +- OutputVideoAvi, +- OutputVideoWmv, +- OutputVideoQuicktime, +-) +diff -up src/sage/repl/rich_output/pretty_print.py.orig src/sage/repl/rich_output/pretty_print.py +--- src/sage/repl/rich_output/pretty_print.py.orig 2016-08-18 13:12:59.177122168 -0400 ++++ src/sage/repl/rich_output/pretty_print.py 2016-08-18 13:13:01.919122273 -0400 +@@ -210,20 +210,23 @@ def pretty_print(*args, **kwds): + sage: pretty_print(LatexExpr(r"\frac{x^2 + 1}{x - 2}")) + + ++ Iterators and generators are unwrapped:: ++ ++ sage: iterator = iter(range(3)); iterator ++ ++ sage: pretty_print(iterator) ++ ++ + TESTS:: + + sage: plt = plot(sin) + sage: pretty_print(plt) # graphics output +- sage: pretty_print(ZZ, 123, plt) # optional - latex +- ++ sage: pretty_print(ZZ, 123, plt) # latex output ++ + sage: pretty_print(plt, plt) # graphics output + """ +- # Support deprecation trac #18292 +- if len(args) == 1: +- import sage.misc.html +- if sage.misc.html.WarnIfNotPrinted.skip_pretty_print(args[0]): +- return +- ++ if len(args) == 1 and isinstance(args[0], (types.GeneratorType, collections.Iterator)): ++ args = tuple(args[0]) + dm = get_display_manager() + old_preferences_text = dm.preferences.text + try: diff --git a/sagemath-is_in_terminal.patch b/sagemath-is_in_terminal.patch new file mode 100644 index 0000000..0c80be1 --- /dev/null +++ b/sagemath-is_in_terminal.patch @@ -0,0 +1,365 @@ +diff -up src/sage/interfaces/all.py.orig src/sage/interfaces/all.py +--- src/sage/interfaces/all.py.orig 2016-08-15 07:14:53.947426922 -0400 ++++ src/sage/interfaces/all.py 2016-08-15 07:15:06.645427409 -0400 +@@ -48,8 +48,8 @@ interfaces = ['gap', 'gap3', 'giac', 'gp + 'singular', 'sage0', 'sage'] + + +-from sage.repl.rich_output.display_manager import get_display_manager +-if get_display_manager().is_in_terminal(): ++from sage.repl.rich_output.display_manager import is_in_terminal ++if is_in_terminal(): + from .axiom import axiom_console + from .fricas import fricas_console + from .gap import gap_console +diff -up src/sage/interfaces/axiom.py.orig src/sage/interfaces/axiom.py +--- src/sage/interfaces/axiom.py.orig 2016-08-15 07:15:43.388428816 -0400 ++++ src/sage/interfaces/axiom.py 2016-08-15 07:15:54.357429236 -0400 +@@ -1040,8 +1040,8 @@ def axiom_console(): + ----------------------------------------------------------------------------- + + """ +- from sage.repl.rich_output.display_manager import get_display_manager +- if not get_display_manager().is_in_terminal(): ++ from sage.repl.rich_output.display_manager import is_in_terminal ++ if not is_in_terminal(): + raise RuntimeError('Can use the console only in the terminal. Try %%axiom magics instead.') + os.system('axiom -nox') + +diff -up src/sage/interfaces/fricas.py.orig src/sage/interfaces/fricas.py +--- src/sage/interfaces/fricas.py.orig 2016-08-15 07:23:50.475447468 -0400 ++++ src/sage/interfaces/fricas.py 2016-08-15 07:23:57.869447751 -0400 +@@ -339,8 +339,8 @@ def fricas_console(): + Issue )quit to leave AXIOM and return to shell. + ----------------------------------------------------------------------------- + """ +- from sage.repl.rich_output.display_manager import get_display_manager +- if not get_display_manager().is_in_terminal(): ++ from sage.repl.rich_output.display_manager import is_in_terminal ++ if not is_in_terminal(): + raise RuntimeError('Can use the console only in the terminal. Try %%fricas magics instead.') + os.system('fricas -nox') + +diff -up src/sage/interfaces/gap3.py.orig src/sage/interfaces/gap3.py +--- src/sage/interfaces/gap3.py.orig 2016-08-15 07:15:18.659427869 -0400 ++++ src/sage/interfaces/gap3.py 2016-08-15 07:15:36.381428547 -0400 +@@ -886,8 +886,8 @@ def gap3_console(): + For help enter: ? + gap> + """ +- from sage.repl.rich_output.display_manager import get_display_manager +- if not get_display_manager().is_in_terminal(): ++ from sage.repl.rich_output.display_manager import is_in_terminal ++ if not is_in_terminal(): + raise RuntimeError('Can use the console only in the terminal. Try %%gap3 magics instead.') + os.system(gap3_cmd) + +diff -up src/sage/interfaces/gap.py.orig src/sage/interfaces/gap.py +--- src/sage/interfaces/gap.py.orig 2016-08-15 07:20:26.092439641 -0400 ++++ src/sage/interfaces/gap.py 2016-08-15 07:20:49.334440531 -0400 +@@ -1889,8 +1889,8 @@ def gap_console(): + sage: 'sorry' not in gap_startup + True + """ +- from sage.repl.rich_output.display_manager import get_display_manager +- if not get_display_manager().is_in_terminal(): ++ from sage.repl.rich_output.display_manager import is_in_terminal ++ if not is_in_terminal(): + raise RuntimeError('Can use the console only in the terminal. Try %%gap magics instead.') + cmd, _ = gap_command(use_workspace_cache=False) + cmd += ' ' + os.path.join(SAGE_EXTCODE,'gap','console.g') +diff -up src/sage/interfaces/giac.py.orig src/sage/interfaces/giac.py +--- src/sage/interfaces/giac.py.orig 2016-08-15 07:18:26.900435077 -0400 ++++ src/sage/interfaces/giac.py 2016-08-15 07:18:36.989435464 -0400 +@@ -1135,8 +1135,8 @@ def giac_console(): + Press CTRL and D simultaneously to finish session + Type ?commandname for help + """ +- from sage.repl.rich_output.display_manager import get_display_manager +- if not get_display_manager().is_in_terminal(): ++ from sage.repl.rich_output.display_manager import is_in_terminal ++ if not is_in_terminal(): + raise RuntimeError('Can use the console only in the terminal. Try %%giac magics instead.') + os.system('giac') + +diff -up src/sage/interfaces/gnuplot.py.orig src/sage/interfaces/gnuplot.py +--- src/sage/interfaces/gnuplot.py.orig 2016-08-15 07:22:26.123444238 -0400 ++++ src/sage/interfaces/gnuplot.py 2016-08-15 07:22:35.181444585 -0400 +@@ -190,8 +190,8 @@ gnuplot = Gnuplot() + + + def gnuplot_console(): +- from sage.repl.rich_output.display_manager import get_display_manager +- if not get_display_manager().is_in_terminal(): ++ from sage.repl.rich_output.display_manager import is_in_terminal ++ if not is_in_terminal(): + raise RuntimeError('Can use the console only in the terminal. Try %%gnuplot magics instead.') + os.system('sage-native-execute gnuplot') + +diff -up src/sage/interfaces/gp.py.orig src/sage/interfaces/gp.py +--- src/sage/interfaces/gp.py.orig 2016-08-15 07:17:56.988433932 -0400 ++++ src/sage/interfaces/gp.py 2016-08-15 07:18:05.213434247 -0400 +@@ -1099,8 +1099,8 @@ def gp_console(): + compiled: Jul 21 2010, gcc-4.6.0 20100705 (experimental) (GCC) + (readline v6.0 enabled, extended help enabled) + """ +- from sage.repl.rich_output.display_manager import get_display_manager +- if not get_display_manager().is_in_terminal(): ++ from sage.repl.rich_output.display_manager import is_in_terminal ++ if not is_in_terminal(): + raise RuntimeError('Can use the console only in the terminal. Try %%gp magics instead.') + os.system('gp') + +diff -up src/sage/interfaces/kash.py.orig src/sage/interfaces/kash.py +--- src/sage/interfaces/kash.py.orig 2016-08-15 07:23:15.164446116 -0400 ++++ src/sage/interfaces/kash.py 2016-08-15 07:23:25.325446505 -0400 +@@ -699,8 +699,8 @@ def reduce_load_Kash(): + + + def kash_console(): +- from sage.repl.rich_output.display_manager import get_display_manager +- if not get_display_manager().is_in_terminal(): ++ from sage.repl.rich_output.display_manager import is_in_terminal ++ if not is_in_terminal(): + raise RuntimeError('Can use the console only in the terminal. Try %%kash magics instead.') + os.system("kash3 ") + +diff -up src/sage/interfaces/lie.py.orig src/sage/interfaces/lie.py +--- src/sage/interfaces/lie.py.orig 2016-08-15 07:16:01.284429501 -0400 ++++ src/sage/interfaces/lie.py 2016-08-15 07:16:15.237430035 -0400 +@@ -935,8 +935,8 @@ def lie_console(): + ... + + """ +- from sage.repl.rich_output.display_manager import get_display_manager +- if not get_display_manager().is_in_terminal(): ++ from sage.repl.rich_output.display_manager import is_in_terminal ++ if not is_in_terminal(): + raise RuntimeError('Can use the console only in the terminal. Try %%lie magics instead.') + os.system('bash `which lie`') + +diff -up src/sage/interfaces/lisp.py.orig src/sage/interfaces/lisp.py +--- src/sage/interfaces/lisp.py.orig 2016-08-15 07:21:51.364442907 -0400 ++++ src/sage/interfaces/lisp.py 2016-08-15 07:22:00.925443273 -0400 +@@ -550,7 +550,7 @@ def lisp_console(): + Type :h for Help. Top level. + ... + """ +- from sage.repl.rich_output.display_manager import get_display_manager +- if not get_display_manager().is_in_terminal(): ++ from sage.repl.rich_output.display_manager import is_in_terminal ++ if not is_in_terminal(): + raise RuntimeError('Can use the console only in the terminal. Try %%lisp magics instead.') + os.system('ecl') +diff -up src/sage/interfaces/macaulay2.py.orig src/sage/interfaces/macaulay2.py +--- src/sage/interfaces/macaulay2.py.orig 2016-08-15 07:17:39.196433250 -0400 ++++ src/sage/interfaces/macaulay2.py 2016-08-15 07:17:48.989433625 -0400 +@@ -1222,8 +1222,8 @@ def macaulay2_console(): + ... + + """ +- from sage.repl.rich_output.display_manager import get_display_manager +- if not get_display_manager().is_in_terminal(): ++ from sage.repl.rich_output.display_manager import is_in_terminal ++ if not is_in_terminal(): + raise RuntimeError('Can use the console only in the terminal. Try %%macaulay2 magics instead.') + os.system('M2') + +diff -up src/sage/interfaces/magma.py.orig src/sage/interfaces/magma.py +--- src/sage/interfaces/magma.py.orig 2016-08-15 07:22:42.763444875 -0400 ++++ src/sage/interfaces/magma.py 2016-08-15 07:22:52.398445244 -0400 +@@ -2775,8 +2775,8 @@ def magma_console(): + > + Total time: 2.820 seconds, Total memory usage: 3.95MB + """ +- from sage.repl.rich_output.display_manager import get_display_manager +- if not get_display_manager().is_in_terminal(): ++ from sage.repl.rich_output.display_manager import is_in_terminal ++ if not is_in_terminal(): + raise RuntimeError('Can use the console only in the terminal. Try %%magma magics instead.') + console('sage-native-execute magma') + +diff -up src/sage/interfaces/maple.py.orig src/sage/interfaces/maple.py +--- src/sage/interfaces/maple.py.orig 2016-08-15 07:22:08.740443572 -0400 ++++ src/sage/interfaces/maple.py 2016-08-15 07:22:19.149443971 -0400 +@@ -1175,8 +1175,8 @@ def maple_console(): + | Type ? for help. + > + """ +- from sage.repl.rich_output.display_manager import get_display_manager +- if not get_display_manager().is_in_terminal(): ++ from sage.repl.rich_output.display_manager import is_in_terminal ++ if not is_in_terminal(): + raise RuntimeError('Can use the console only in the terminal. Try %%maple magics instead.') + os.system('maple') + +diff -up src/sage/interfaces/mathematica.py.orig src/sage/interfaces/mathematica.py +--- src/sage/interfaces/mathematica.py.orig 2016-08-15 07:17:01.475431806 -0400 ++++ src/sage/interfaces/mathematica.py 2016-08-15 07:17:13.797432278 -0400 +@@ -1007,8 +1007,8 @@ def reduce_load(X): + + + def mathematica_console(readline=True): +- from sage.repl.rich_output.display_manager import get_display_manager +- if not get_display_manager().is_in_terminal(): ++ from sage.repl.rich_output.display_manager import is_in_terminal ++ if not is_in_terminal(): + raise RuntimeError('Can use the console only in the terminal. Try %%mathematica magics instead.') + if not readline: + os.system('math') +diff -up src/sage/interfaces/matlab.py.orig src/sage/interfaces/matlab.py +--- src/sage/interfaces/matlab.py.orig 2016-08-15 07:18:11.755434497 -0400 ++++ src/sage/interfaces/matlab.py 2016-08-15 07:18:20.261434823 -0400 +@@ -389,8 +389,8 @@ def matlab_console(): + matlab, like Sage, remembers its history from one session to + another. + """ +- from sage.repl.rich_output.display_manager import get_display_manager +- if not get_display_manager().is_in_terminal(): ++ from sage.repl.rich_output.display_manager import is_in_terminal ++ if not is_in_terminal(): + raise RuntimeError('Can use the console only in the terminal. Try %%matlab magics instead.') + os.system('matlab -nodisplay') + +diff -up src/sage/interfaces/maxima_abstract.py.orig src/sage/interfaces/maxima_abstract.py +--- src/sage/interfaces/maxima_abstract.py.orig 2016-08-15 07:24:41.539449423 -0400 ++++ src/sage/interfaces/maxima_abstract.py 2016-08-15 07:24:50.822449779 -0400 +@@ -2370,7 +2370,7 @@ def maxima_console(): + Maxima 5.34.1 http://maxima.sourceforge.net + ... + """ +- from sage.repl.rich_output.display_manager import get_display_manager +- if not get_display_manager().is_in_terminal(): ++ from sage.repl.rich_output.display_manager import is_in_terminal ++ if not is_in_terminal(): + raise RuntimeError('Can use the console only in the terminal. Try %%maxima magics instead.') + os.system('maxima') +diff -up src/sage/interfaces/mupad.py.orig src/sage/interfaces/mupad.py +--- src/sage/interfaces/mupad.py.orig 2016-08-15 07:24:03.851447980 -0400 ++++ src/sage/interfaces/mupad.py 2016-08-15 07:24:11.957448291 -0400 +@@ -686,8 +686,8 @@ def mupad_console(): + *----* Licensed to: ... + + """ +- from sage.repl.rich_output.display_manager import get_display_manager +- if not get_display_manager().is_in_terminal(): ++ from sage.repl.rich_output.display_manager import is_in_terminal ++ if not is_in_terminal(): + raise RuntimeError('Can use the console only in the terminal. Try %%mupad magics instead.') + os.system('mupkern') + +diff -up src/sage/interfaces/mwrank.py.orig src/sage/interfaces/mwrank.py +--- src/sage/interfaces/mwrank.py.orig 2016-08-15 07:22:59.484445515 -0400 ++++ src/sage/interfaces/mwrank.py 2016-08-15 07:23:08.637445866 -0400 +@@ -360,8 +360,8 @@ def mwrank_console(): + sage: mwrank_console() # not tested: expects console input + Program mwrank: ... + """ +- from sage.repl.rich_output.display_manager import get_display_manager +- if not get_display_manager().is_in_terminal(): ++ from sage.repl.rich_output.display_manager import is_in_terminal ++ if not is_in_terminal(): + raise RuntimeError('Can use the console only in the terminal. Try %%mwrank magics instead.') + os.system('mwrank') + +diff -up src/sage/interfaces/octave.py.orig src/sage/interfaces/octave.py +--- src/sage/interfaces/octave.py.orig 2016-08-15 07:24:17.604448507 -0400 ++++ src/sage/interfaces/octave.py 2016-08-15 07:24:26.741448857 -0400 +@@ -775,8 +775,8 @@ def octave_console(): + octave, like Sage, remembers its history from one session to + another. + """ +- from sage.repl.rich_output.display_manager import get_display_manager +- if not get_display_manager().is_in_terminal(): ++ from sage.repl.rich_output.display_manager import is_in_terminal ++ if not is_in_terminal(): + raise RuntimeError('Can use the console only in the terminal. Try %%octave magics instead.') + os.system('octave') + +diff -up src/sage/interfaces/qepcad.py.orig src/sage/interfaces/qepcad.py +--- src/sage/interfaces/qepcad.py.orig 2016-08-15 07:23:32.595446783 -0400 ++++ src/sage/interfaces/qepcad.py 2016-08-15 07:23:43.510447201 -0400 +@@ -1681,8 +1681,8 @@ def qepcad_console(memcells=None): + ... + Enter an informal description between '[' and ']': + """ +- from sage.repl.rich_output.display_manager import get_display_manager +- if not get_display_manager().is_in_terminal(): ++ from sage.repl.rich_output.display_manager import is_in_terminal ++ if not is_in_terminal(): + raise RuntimeError('Can use the console only in the terminal. Try %%qepcat magics instead.') + # This will only spawn local processes + os.system(_qepcad_cmd(memcells)) +diff -up src/sage/interfaces/r.py.orig src/sage/interfaces/r.py +--- src/sage/interfaces/r.py.orig 2016-08-15 07:16:22.108430298 -0400 ++++ src/sage/interfaces/r.py 2016-08-15 07:16:35.381430807 -0400 +@@ -2102,8 +2102,8 @@ def r_console(): + ISBN 3-900051-07-0 + ... + """ +- from sage.repl.rich_output.display_manager import get_display_manager +- if not get_display_manager().is_in_terminal(): ++ from sage.repl.rich_output.display_manager import is_in_terminal ++ if not is_in_terminal(): + raise RuntimeError('Can use the console only in the terminal. Try %%r magics instead.') + # This will only spawn local processes + os.system('R --vanilla') +diff -up src/sage/interfaces/sage0.py.orig src/sage/interfaces/sage0.py +--- src/sage/interfaces/sage0.py.orig 2016-08-15 07:18:49.708435951 -0400 ++++ src/sage/interfaces/sage0.py 2016-08-15 07:18:59.709436334 -0400 +@@ -531,8 +531,8 @@ def sage0_console(): + ---------------------------------------------------------------------- + ... + """ +- from sage.repl.rich_output.display_manager import get_display_manager +- if not get_display_manager().is_in_terminal(): ++ from sage.repl.rich_output.display_manager import is_in_terminal ++ if not is_in_terminal(): + raise RuntimeError('Can use the console only in the terminal. Try %%sage0 magics instead.') + os.system('sage') + +diff -up src/sage/interfaces/singular.py.orig src/sage/interfaces/singular.py +--- src/sage/interfaces/singular.py.orig 2016-08-15 07:16:42.556431082 -0400 ++++ src/sage/interfaces/singular.py 2016-08-15 07:16:52.990431481 -0400 +@@ -2329,8 +2329,8 @@ def singular_console(): + by: G.-M. Greuel, G. Pfister, H. Schoenemann \ Nov 2007 + FB Mathematik der Universitaet, D-67653 Kaiserslautern \ + """ +- from sage.repl.rich_output.display_manager import get_display_manager +- if not get_display_manager().is_in_terminal(): ++ from sage.repl.rich_output.display_manager import is_in_terminal ++ if not is_in_terminal(): + raise RuntimeError('Can use the console only in the terminal. Try %%singular magics instead.') + os.system('Singular') + +diff -up src/sage/repl/interface_magic.py.orig src/sage/repl/interface_magic.py +--- src/sage/repl/interface_magic.py.orig 2016-08-15 07:19:09.596436712 -0400 ++++ src/sage/repl/interface_magic.py 2016-08-15 07:21:27.789442004 -0400 +@@ -35,7 +35,7 @@ language to separate multiple commands. + #***************************************************************************** + + +-from sage.repl.rich_output.display_manager import get_display_manager ++from sage.repl.rich_output.display_manager import is_in_terminal + + + LINE_DOCSTRING = """ +@@ -218,7 +218,7 @@ class InterfaceMagic(object): + The line magic %gap sends a single line to the gap interface. + ... + """ +- terminal = get_display_manager().is_in_terminal() ++ terminal = is_in_terminal() + def line_magic(line): + if line: + return self._interface(line) +diff -up src/sage/repl/rich_output/display_manager.py.orig src/sage/repl/rich_output/display_manager.py +--- src/sage/repl/rich_output/display_manager.py.orig 2016-08-15 07:13:57.603424765 -0400 ++++ src/sage/repl/rich_output/display_manager.py 2016-08-15 07:14:21.309425673 -0400 +@@ -775,3 +775,6 @@ class DisplayManager(SageObject): + + + get_display_manager = DisplayManager.get_instance ++def is_in_terminal(): ++ from sage.repl.rich_output.backend_ipython import BackendIPythonCommandline ++ return isinstance(get_display_manager(), BackendIPythonCommandline) diff --git a/sagemath-jmol.patch b/sagemath-jmol.patch index fd33276..a15281a 100644 --- a/sagemath-jmol.patch +++ b/sagemath-jmol.patch @@ -1,8 +1,8 @@ diff -up src/sage/interfaces/jmoldata.py.orig src/sage/interfaces/jmoldata.py ---- src/sage/interfaces/jmoldata.py.orig 2015-10-11 17:48:03.194792527 -0300 -+++ src/sage/interfaces/jmoldata.py 2015-10-11 17:48:39.748793927 -0300 -@@ -146,8 +146,6 @@ class JmolData(SageObject): - sage: print os.path.exists(testfile) # optional -- java +--- src/sage/interfaces/jmoldata.py.orig 2016-08-08 13:34:51.199532656 -0400 ++++ src/sage/interfaces/jmoldata.py 2016-08-08 13:36:16.474535921 -0400 +@@ -147,8 +147,6 @@ class JmolData(SageObject): + sage: print(os.path.exists(testfile)) # optional -- java True """ - # Set up paths, file names and scripts @@ -10,7 +10,7 @@ diff -up src/sage/interfaces/jmoldata.py.orig src/sage/interfaces/jmoldata.py target_native = targetfile import sys if sys.platform == 'cygwin': -@@ -172,10 +170,8 @@ class JmolData(SageObject): +@@ -173,10 +171,8 @@ class JmolData(SageObject): env = dict(os.environ) env['LC_ALL'] = 'C' env['LANG'] = 'C' @@ -18,8 +18,8 @@ diff -up src/sage/interfaces/jmoldata.py.orig src/sage/interfaces/jmoldata.py - "-jar", jmolpath, "-iox", "-g", sizeStr, - "-J", launchscript, "-j", imagescript], - stdout=jout, stderr=jout, env=env) -+ subprocess.call(["jmol","-n","-g",sizeStr, -+ "-J",launchscript,"-j",imagescript],stdout=jout) ++ subprocess.call(["jmol", "-n", "-g", sizeStr, ++ "-J",launchscript, "-j", imagescript], stdout=jout) if not os.path.isfile(targetfile): raise RuntimeError("Jmol failed to create file %s, see %s for details"%(repr(targetfile), repr(scratchout))) os.unlink(scratchout) diff --git a/sagemath-lcalc.patch b/sagemath-lcalc.patch index c2093e0..337c952 100644 --- a/sagemath-lcalc.patch +++ b/sagemath-lcalc.patch @@ -1,6 +1,6 @@ diff -up src/sage/libs/lcalc/lcalc_sage.h.orig src/sage/libs/lcalc/lcalc_sage.h ---- src/sage/libs/lcalc/lcalc_sage.h.orig 2015-11-02 23:13:05.279397757 -0200 -+++ src/sage/libs/lcalc/lcalc_sage.h 2015-11-02 23:13:34.402398872 -0200 +--- src/sage/libs/lcalc/lcalc_sage.h.orig 2016-08-08 13:40:43.480546146 -0400 ++++ src/sage/libs/lcalc/lcalc_sage.h 2016-08-08 13:40:49.561546379 -0400 @@ -1,4 +1,4 @@ -#include "libLfunction/L.h" +#include "Lfunction/L.h" diff --git a/sagemath-libgap.patch b/sagemath-libgap.patch index c424e75..3ffe5c0 100644 --- a/sagemath-libgap.patch +++ b/sagemath-libgap.patch @@ -1,7 +1,19 @@ +diff -up src/sage/libs/gap/test/main.c.orig src/sage/libs/gap/test/main.c +--- src/sage/libs/gap/test/main.c.orig 2016-08-08 13:43:32.376552613 -0400 ++++ src/sage/libs/gap/test/main.c 2016-08-08 13:43:38.209552837 -0400 +@@ -22,7 +22,7 @@ void eval(char* cmd) { + libgap_start_interaction(cmd); + + libgap_enter(); +- libGAP_ReadEvalCommand(libGAP_BottomLVars); ++ libGAP_ReadEvalCommand(libGAP_BottomLVars, NULL); + libGAP_ViewObjHandler(libGAP_ReadEvalResult); + char* out = libgap_get_output(); + libgap_exit(); diff -up src/sage/libs/gap/util.pyx.orig src/sage/libs/gap/util.pyx ---- src/sage/libs/gap/util.pyx.orig 2015-07-26 07:34:43.000000000 -0600 -+++ src/sage/libs/gap/util.pyx 2016-04-07 17:49:52.497518812 -0600 -@@ -153,18 +153,9 @@ def gap_root(): +--- src/sage/libs/gap/util.pyx.orig 2016-08-08 13:41:46.176548547 -0400 ++++ src/sage/libs/gap/util.pyx 2016-08-08 13:42:26.594550094 -0400 +@@ -154,18 +154,9 @@ def gap_root(): sage: from sage.libs.gap.util import gap_root sage: gap_root() # random output @@ -12,7 +24,7 @@ diff -up src/sage/libs/gap/util.pyx.orig src/sage/libs/gap/util.pyx - gapdir = os.path.join(SAGE_LOCAL, 'gap', 'latest') - if os.path.exists(gapdir): - return gapdir -- print 'The gap-4.5.5.spkg (or later) seems to be not installed!' +- print('The gap-4.5.5.spkg (or later) seems to be not installed!') - gap_sh = open(os.path.join(SAGE_LOCAL, 'bin', 'gap')).read().splitlines() - gapdir = filter(lambda dir:dir.strip().startswith('GAP_DIR'), gap_sh)[0] - gapdir = gapdir.split('"')[1] @@ -22,45 +34,3 @@ diff -up src/sage/libs/gap/util.pyx.orig src/sage/libs/gap/util.pyx cdef initialize(): -@@ -280,7 +271,7 @@ cdef libGAP_Obj gap_eval(str gap_string) - libgap_start_interaction(cmd) - try: - sig_on() -- status = libGAP_ReadEvalCommand(libGAP_BottomLVars) -+ status = libGAP_ReadEvalCommand(libGAP_BottomLVars, NULL) - if status != libGAP_STATUS_END: - libgap_call_error_handler() - sig_off() -@@ -464,7 +455,7 @@ def command(command_string): - libgap_start_interaction(cmd) - try: - sig_on() -- status = libGAP_ReadEvalCommand(libGAP_BottomLVars) -+ status = libGAP_ReadEvalCommand(libGAP_BottomLVars, NULL) - if status != libGAP_STATUS_END: - libgap_call_error_handler() - sig_off() -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 2015-07-26 07:34:43.000000000 -0600 -+++ src/sage/libs/gap/gap_includes.pxd 2016-04-07 17:50:43.958388846 -0600 -@@ -131,7 +131,7 @@ cdef extern from "gap/objects.h": - cdef int libGAP_LAST_TESTING_TNUM - - cdef extern from "gap/read.h": -- void* libGAP_ReadEvalCommand(libGAP_Obj context) -+ void* libGAP_ReadEvalCommand(libGAP_Obj context, void *dualSemicolon) - void* libGAP_ReadEvalFile() - void* libGAP_ReadEvalResult - bint libGAP_READ_ERROR() -diff -up src/sage/libs/gap/test/main.c.orig src/sage/libs/gap/test/main.c ---- src/sage/libs/gap/test/main.c.orig 2015-07-26 07:34:43.000000000 -0600 -+++ src/sage/libs/gap/test/main.c 2016-04-07 17:51:07.339512407 -0600 -@@ -22,7 +22,7 @@ void eval(char* cmd) { - libgap_start_interaction(cmd); - - libgap_enter(); -- libGAP_ReadEvalCommand(libGAP_BottomLVars); -+ libGAP_ReadEvalCommand(libGAP_BottomLVars, NULL); - libGAP_ViewObjHandler(libGAP_ReadEvalResult); - char* out = libgap_get_output(); - libgap_exit(); diff --git a/sagemath-lrslib.patch b/sagemath-lrslib.patch index e5f7e77..c6eb3fa 100644 --- a/sagemath-lrslib.patch +++ b/sagemath-lrslib.patch @@ -1,7 +1,15 @@ diff -up src/sage/geometry/polyhedron/base.py.orig src/sage/geometry/polyhedron/base.py ---- src/sage/geometry/polyhedron/base.py.orig 2015-10-11 17:54:35.252807540 -0300 -+++ src/sage/geometry/polyhedron/base.py 2015-10-11 17:54:41.621807784 -0300 -@@ -3371,10 +3371,6 @@ class Polyhedron_base(Element): +--- src/sage/geometry/polyhedron/base.py.orig 2016-08-08 13:38:11.144540312 -0400 ++++ src/sage/geometry/polyhedron/base.py 2016-08-08 13:38:26.707540908 -0400 +@@ -21,7 +21,6 @@ import six + from sage.structure.element import Element, coerce_binop, is_Vector + + from sage.misc.all import cached_method, prod +-from sage.misc.package import is_package_installed + + from sage.rings.all import QQ, ZZ + from sage.rings.real_double import RDF +@@ -3691,10 +3690,6 @@ class Polyhedron_base(Element): David Avis's lrs program. """ diff --git a/sagemath-maxima.patch b/sagemath-maxima.patch index 085a406..485ce23 100644 --- a/sagemath-maxima.patch +++ b/sagemath-maxima.patch @@ -1,29 +1,28 @@ diff -up src/bin/sage-maxima.lisp.orig src/bin/sage-maxima.lisp ---- src/bin/sage-maxima.lisp.orig 2015-10-11 17:39:58.025773948 -0300 -+++ src/bin/sage-maxima.lisp 2015-10-11 17:40:00.218774032 -0300 -@@ -3,4 +3,8 @@ - ;(setf *general-display-prefix* "") +--- src/bin/sage-maxima.lisp.orig 2016-08-08 13:31:41.528525393 -0400 ++++ src/bin/sage-maxima.lisp 2016-08-08 13:31:54.865525903 -0400 +@@ -4,3 +4,8 @@ (setf *prompt-prefix* "") -- + +#+clisp +(setf + *error-output* (open "/dev/stderr" :direction :output) + *standard-input* (open "/dev/stdin" :direction :input) + *standard-output* (open "/dev/stdout" :direction :output)) diff -up src/sage/interfaces/maxima.py.orig src/sage/interfaces/maxima.py ---- src/sage/interfaces/maxima.py.orig 2015-10-11 17:39:41.677773322 -0300 -+++ src/sage/interfaces/maxima.py 2015-10-11 17:40:00.219774032 -0300 -@@ -552,7 +552,7 @@ class Maxima(MaximaAbstract, Expect): +--- src/sage/interfaces/maxima.py.orig 2016-08-08 13:32:02.623526200 -0400 ++++ src/sage/interfaces/maxima.py 2016-08-08 13:32:41.698527697 -0400 +@@ -556,7 +556,7 @@ class Maxima(MaximaAbstract, Expect): Expect.__init__(self, name = 'maxima', prompt = '\(\%i[0-9]+\) ', - command = 'maxima --userdir="%s" -p "%s"'%(SAGE_MAXIMA_DIR,STARTUP), + command = 'maxima --disable-readline --userdir="%s" -p "%s"'%(SAGE_MAXIMA_DIR,STARTUP), - maxread = 10000, script_subdirectory = script_subdirectory, restart_on_ctrlc = False, -@@ -620,7 +620,8 @@ class Maxima(MaximaAbstract, Expect): + verbose_start = False, +@@ -623,7 +623,8 @@ class Maxima(MaximaAbstract, Expect): # Remove limit on the max heapsize (since otherwise it defaults # to 256MB with ECL). diff --git a/sagemath-nauty.patch b/sagemath-nauty.patch index 63cc575..939211a 100644 --- a/sagemath-nauty.patch +++ b/sagemath-nauty.patch @@ -1,10 +1,10 @@ diff -up src/sage/graphs/graph_generators.py.orig src/sage/graphs/graph_generators.py ---- src/sage/graphs/graph_generators.py.orig 2015-07-26 07:34:43.000000000 -0600 -+++ src/sage/graphs/graph_generators.py 2016-04-28 21:13:15.214276462 -0600 -@@ -841,7 +841,7 @@ class GraphGenerators(): - from sage.misc.package import is_package_installed - if not is_package_installed("nauty"): - raise TypeError("the optional nauty package is not installed") +--- src/sage/graphs/graph_generators.py.orig 2016-08-08 13:38:51.824541870 -0400 ++++ src/sage/graphs/graph_generators.py 2016-08-08 13:39:20.460542967 -0400 +@@ -872,7 +872,7 @@ class GraphGenerators(): + >A geng -d0D3 n=4 e=0-6 + """ + import subprocess - sp = subprocess.Popen("geng {0}".format(options), shell=True, + sp = subprocess.Popen("nauty-geng {0}".format(options), shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, diff --git a/sagemath-nofstring.patch b/sagemath-nofstring.patch new file mode 100644 index 0000000..5b239d0 --- /dev/null +++ b/sagemath-nofstring.patch @@ -0,0 +1,60 @@ +diff -up src/sage/arith/multi_modular.pyx.orig src/sage/arith/multi_modular.pyx +--- src/sage/arith/multi_modular.pyx.orig 2016-08-09 07:06:34.166635024 -0400 ++++ src/sage/arith/multi_modular.pyx 2016-08-09 07:06:58.190635944 -0400 +@@ -171,9 +171,9 @@ cdef class MultiModularBasis_base(object + ArithmeticError: The inverse of 6 modulo 10 is not defined. + """ + if l_bound < 2: +- raise ValueError(f"minimum value for lower bound is 2, given: {l_bound}") ++ raise ValueError("minimum value for lower bound is 2, given: {l_bound}") + if u_bound > MAX_MODULUS: +- raise ValueError(f"upper bound cannot be greater than {MAX_MODULUS}, given: {u_bound}") ++ raise ValueError("upper bound cannot be greater than {MAX_MODULUS}, given: {u_bound}") + + self._l_bound = l_bound + self._u_bound = u_bound +@@ -232,7 +232,7 @@ cdef class MultiModularBasis_base(object + if check: + for p in plist: + if p > MAX_MODULUS: +- raise OverflowError(f"given modulus {p} is larger than {MAX_MODULUS}") ++ raise OverflowError("given modulus {p} is larger than {MAX_MODULUS}") + self._realloc_to_new_count(self.n + len_plist) + + cdef Py_ssize_t i +diff -up src/sage/rings/finite_rings/integer_mod.pyx.orig src/sage/rings/finite_rings/integer_mod.pyx +--- src/sage/rings/finite_rings/integer_mod.pyx.orig 2016-08-09 07:06:34.179635024 -0400 ++++ src/sage/rings/finite_rings/integer_mod.pyx 2016-08-09 07:07:05.471636223 -0400 +@@ -392,7 +392,7 @@ cdef class IntegerMod_abstract(FiniteRin + from integer_mod_ring import IntegerModRing + R = IntegerModRing(modulus) + if (self)._parent._IntegerModRing_generic__order % R.order(): +- raise ArithmeticError(f"reduction modulo {modulus!r} not defined") ++ raise ArithmeticError("reduction modulo {modulus!r} not defined") + return R(self) + + def is_nilpotent(self): +diff -up src/sage/structure/parent.pyx.orig src/sage/structure/parent.pyx +--- src/sage/structure/parent.pyx.orig 2016-08-09 07:06:34.157635023 -0400 ++++ src/sage/structure/parent.pyx 2016-08-09 07:06:50.239635639 -0400 +@@ -753,7 +753,7 @@ cdef class Parent(category_object.Catego + cdef int init_coerce(self, bint warn=True) except -1: + if self._coerce_from_hash is None: + if warn: +- raise AssertionError(f"unexpected call of init_coerce() for {type(self)}") ++ raise AssertionError("unexpected call of init_coerce() for {type(self)}") + self._initial_coerce_list = [] + self._initial_action_list = [] + self._initial_convert_list = [] +diff -up src/sage/symbolic/ring.pyx.orig src/sage/symbolic/ring.pyx +--- src/sage/symbolic/ring.pyx.orig 2016-08-09 07:06:34.173635024 -0400 ++++ src/sage/symbolic/ring.pyx 2016-08-09 07:07:01.438636068 -0400 +@@ -350,7 +350,7 @@ cdef class SymbolicRing(CommutativeRing) + from sage.misc.all import prod + return prod([SR(p)**e for p,e in x], SR(x.unit())) + else: +- raise TypeError(f"unable to convert {x!r} to a symbolic expression") ++ raise TypeError("unable to convert {x!r} to a symbolic expression") + + return new_Expression_from_GEx(self, exp) + diff --git a/sagemath-ntl9.patch b/sagemath-ntl9.patch deleted file mode 100644 index c18ed49..0000000 --- a/sagemath-ntl9.patch +++ /dev/null @@ -1,186 +0,0 @@ -diff -up src/sage/rings/bernmm/bernmm-test.cpp.orig src/sage/rings/bernmm/bernmm-test.cpp ---- src/sage/rings/bernmm/bernmm-test.cpp.orig 2015-10-11 18:17:42.808860675 -0300 -+++ src/sage/rings/bernmm/bernmm-test.cpp 2015-10-11 18:18:44.684863044 -0300 -@@ -70,7 +70,7 @@ void bern_naive(mpq_t* res, long n) - */ - int testcase__bern_modp_powg(long p, long k, mpq_t b) - { -- double pinv = 1 / ((double) p); -+ mulmod_t pinv = PrepMulMod(p); - - // compute B_k mod p using _bern_modp_powg() - long x = _bern_modp_powg(p, pinv, k); -@@ -147,7 +147,7 @@ int test__bern_modp_powg() - */ - int testcase__bern_modp_pow2(long p, long k) - { -- double pinv = 1 / ((double) p); -+ mulmod_t pinv = PrepMulMod(p); - - if (PowerMod(2, k, p, pinv) == 1) - return 1; -diff -up src/sage/rings/bernmm/bern_modp.cpp.orig src/sage/rings/bernmm/bern_modp.cpp ---- src/sage/rings/bernmm/bern_modp.cpp.orig 2015-10-11 18:17:42.814860675 -0300 -+++ src/sage/rings/bernmm/bern_modp.cpp 2015-10-11 18:20:28.077867003 -0300 -@@ -43,14 +43,14 @@ namespace bernmm { - pinv = 1 / ((double) p) - g = a multiplicative generator of GF(p), in [0, p) - */ --long bernsum_powg(long p, double pinv, long k, long g) -+long bernsum_powg(long p, mulmod_t pinv, long k, long g) - { - long half_gm1 = (g + ((g & 1) ? 0 : p) - 1) / 2; // (g-1)/2 mod p - long g_to_jm1 = 1; - long g_to_km1 = PowerMod(g, k-1, p, pinv); - long g_to_km1_to_j = g_to_km1; - long sum = 0; -- double g_pinv = ((double) g) / ((double) p); -+ muldivrem_t g_pinv = PrepMulDivRem(g, p); - mulmod_precon_t g_to_km1_pinv = PrepMulModPrecon(g_to_km1, p, pinv); - - for (long j = 1; j <= (p-1)/2; j++) -@@ -224,7 +224,7 @@ public: - #error Number of bits in a long must be divisible by TABLE_LG_SIZE - #endif - --long bernsum_pow2(long p, double pinv, long k, long g, long n) -+long bernsum_pow2(long p, mulmod_t pinv, long k, long g, long n) - { - // In the main summation loop we accumulate data into the _tables_ array; - // tables[y][z] contributes to the final answer with a weight of -@@ -481,7 +481,7 @@ long PrepRedc(long n) - (See bernsum_pow2() for code comments; we only add comments here where - something is different from bernsum_pow2()) - */ --long bernsum_pow2_redc(long p, double pinv, long k, long g, long n) -+long bernsum_pow2_redc(long p, mulmod_t pinv, long k, long g, long n) - { - long pinv2 = PrepRedc(p); - long F = (1L << (ULONG_BITS/2)) % p; -@@ -655,7 +655,7 @@ long bernsum_pow2_redc(long p, double pi - - Algorithm: uses bernsum_powg() to compute the main sum. - */ --long _bern_modp_powg(long p, double pinv, long k) -+long _bern_modp_powg(long p, mulmod_t pinv, long k) - { - Factorisation F(p-1); - long g = primitive_root(p, pinv, F); -@@ -685,7 +685,7 @@ long _bern_modp_powg(long p, double pinv - Algorithm: uses bernsum_pow2() (or bernsum_pow2_redc() if p is small - enough) to compute the main sum. - */ --long _bern_modp_pow2(long p, double pinv, long k) -+long _bern_modp_pow2(long p, mulmod_t pinv, long k) - { - Factorisation F(p-1); - long g = primitive_root(p, pinv, F); -@@ -765,7 +765,7 @@ long bern_modp(long p, long k) - if (m == 0) - return -1; - -- double pinv = 1 / ((double) p); -+ mulmod_t pinv = PrepMulMod(p); - long x = _bern_modp(p, pinv, m); // = B_m/m mod p - return MulMod(x, k, p, pinv); - } -diff -up src/sage/rings/bernmm/bern_modp.h.orig src/sage/rings/bernmm/bern_modp.h ---- src/sage/rings/bernmm/bern_modp.h.orig 2015-10-11 18:17:42.820860675 -0300 -+++ src/sage/rings/bernmm/bern_modp.h 2015-10-11 18:20:53.453867975 -0300 -@@ -12,6 +12,7 @@ - #ifndef BERNMM_BERN_MODP_H - #define BERNMM_BERN_MODP_H - -+#include - - namespace bernmm { - -@@ -29,8 +30,8 @@ long bern_modp(long p, long k); - /* - Exported for testing. - */ --long _bern_modp_powg(long p, double pinv, long k); --long _bern_modp_pow2(long p, double pinv, long k); -+long _bern_modp_powg(long p, NTL::mulmod_t pinv, long k); -+long _bern_modp_pow2(long p, NTL::mulmod_t pinv, long k); - - - }; -diff -up src/sage/rings/bernmm/bern_modp_util.cpp.orig src/sage/rings/bernmm/bern_modp_util.cpp ---- src/sage/rings/bernmm/bern_modp_util.cpp.orig 2015-10-11 18:17:42.825860675 -0300 -+++ src/sage/rings/bernmm/bern_modp_util.cpp 2015-10-11 18:21:24.653869170 -0300 -@@ -20,7 +20,7 @@ NTL_CLIENT; - namespace bernmm { - - --long PowerMod(long a, long ee, long n, double ninv) -+long PowerMod(long a, long ee, long n, mulmod_t ninv) - { - long x, y; - -@@ -89,7 +89,7 @@ PrimeTable::PrimeTable(long bound) - } - - --long order(long x, long p, double pinv, const Factorisation& F) -+long order(long x, long p, mulmod_t pinv, const Factorisation& F) - { - // in the loop below, m is always some multiple of the order of x - long m = p - 1; -@@ -113,7 +113,7 @@ long order(long x, long p, double pinv, - - - --long primitive_root(long p, double pinv, const Factorisation& F) -+long primitive_root(long p, mulmod_t pinv, const Factorisation& F) - { - if (p == 2) - return 1; -diff -up src/sage/rings/bernmm/bern_modp_util.h.orig src/sage/rings/bernmm/bern_modp_util.h ---- src/sage/rings/bernmm/bern_modp_util.h.orig 2015-10-11 18:17:42.830860676 -0300 -+++ src/sage/rings/bernmm/bern_modp_util.h 2015-10-11 18:21:58.044870449 -0300 -@@ -17,6 +17,7 @@ - #include - #include - #include -+#include - - - #if ULONG_MAX == 4294967295U -@@ -39,7 +40,7 @@ namespace bernmm { - - (Implementation is adapted from ZZ.c in NTL 5.4.1.) - */ --long PowerMod(long a, long ee, long n, double ninv); -+long PowerMod(long a, long ee, long n, NTL::mulmod_t ninv); - - - /* -@@ -123,13 +124,13 @@ long next_prime(long p); - /* - Computes order of x mod p, given the factorisation F of p-1. - */ --long order(long x, long p, double pinv, const Factorisation& F); -+long order(long x, long p, NTL::mulmod_t pinv, const Factorisation& F); - - - /* - Finds the smallest primitive root mod p, given the factorisation F of p-1. - */ --long primitive_root(long p, double pinv, const Factorisation& F); -+long primitive_root(long p, NTL::mulmod_t pinv, const Factorisation& F); - - - }; // end namespace -diff -up src/sage/rings/bernmm/bern_modp.cpp.orig src/sage/rings/bernmm/bern_modp.cpp ---- src/sage/rings/bernmm/bern_modp.cpp.orig 2015-11-02 23:58:56.669503117 -0200 -+++ src/sage/rings/bernmm/bern_modp.cpp 2015-11-02 23:59:15.683503846 -0200 -@@ -717,7 +717,7 @@ long _bern_modp_pow2(long p, mulmod_t pi - 2 <= k <= p-3, k even - pinv = 1 / ((double) p) - */ --long _bern_modp(long p, double pinv, long k) -+long _bern_modp(long p, mulmod_t pinv, long k) - { - if (PowerMod(2, k, p, pinv) != 1) - // 2^k != 1 mod p, so we use the faster version diff --git a/sagemath-png.patch b/sagemath-png.patch deleted file mode 100644 index 85163a5..0000000 --- a/sagemath-png.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff -up src/module_list.py.orig src/module_list.py ---- src/module_list.py.orig 2015-10-11 18:06:18.785834481 -0300 -+++ src/module_list.py 2015-10-11 18:06:31.557834970 -0300 -@@ -90,7 +90,7 @@ library_order_list = [ - "polybori_groebner-" + polybori_major_version, - "m4rie", "m4ri", - "zn_poly", "gap", -- "gd", "png12", -+ "gd", "png", - "m", "readline", "Lfunction", - BLAS, BLAS2, - "cryptominisat", "fplll", "z"] -@@ -903,7 +903,7 @@ ext_modules = [ - - Extension('sage.matrix.matrix_mod2_dense', - sources = ['sage/matrix/matrix_mod2_dense.pyx'], -- libraries = ['m4ri', 'gd', 'png12', 'z'], -+ libraries = ['m4ri', 'gd', 'png', 'z'], - extra_compile_args = m4ri_extra_compile_args, - depends = [SAGE_INC + "/png.h", SAGE_INC + "/m4ri/m4ri.h"]), - -@@ -1063,7 +1063,7 @@ ext_modules = [ - - Extension('sage.modules.vector_mod2_dense', - sources = ['sage/modules/vector_mod2_dense.pyx'], -- libraries = ['m4ri', 'png12', 'gd'], -+ libraries = ['m4ri', 'png', 'gd'], - extra_compile_args = m4ri_extra_compile_args, - depends = [SAGE_INC + "/png.h", SAGE_INC + "/m4ri/m4ri.h"]), - -@@ -1550,7 +1550,7 @@ ext_modules = [ - Extension('sage.rings.polynomial.pbori', - sources = ['sage/rings/polynomial/pbori.pyx'], - libraries=['polybori-' + polybori_major_version, -- 'polybori_groebner-' + polybori_major_version, 'm4ri', 'gd', 'png12'], -+ 'polybori_groebner-' + polybori_major_version, 'm4ri', 'gd', 'png'], - depends = [SAGE_INC + "/polybori/" + hd + ".h" for hd in ["polybori", "config"] ] + \ - [SAGE_INC + '/m4ri/m4ri.h'], - extra_compile_args = polybori_extra_compile_args + m4ri_extra_compile_args, diff --git a/sagemath-polybori.patch b/sagemath-polybori.patch deleted file mode 100644 index ca52389..0000000 --- a/sagemath-polybori.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -up src/sage/libs/polybori/decl.pxd.orig src/sage/libs/polybori/decl.pxd ---- src/sage/libs/polybori/decl.pxd.orig 2015-10-11 18:23:04.338872987 -0300 -+++ src/sage/libs/polybori/decl.pxd 2015-10-11 18:23:09.548873187 -0300 -@@ -10,8 +10,8 @@ cdef extern from "sage/libs/polybori/pb_ - pbdp_asc "CTypes::dp_asc" - pbblock_dlex "CTypes::block_dlex" - pbblock_dp_asc "CTypes::block_dp_asc" -- pbdp "17" -- pbblock_dp "19" -+ pbdp "(polybori::COrderEnums::ordercodes)17" -+ pbblock_dp "(polybori::COrderEnums::ordercodes)19" - - cdef enum comparecodes "CCompareEnums::comparecodes": - less_than "CTypes::less_than" diff --git a/sagemath-qepcad.patch b/sagemath-qepcad.patch index 829fe9d..92653c6 100644 --- a/sagemath-qepcad.patch +++ b/sagemath-qepcad.patch @@ -1,27 +1,35 @@ diff -up src/sage/interfaces/qepcad.py.orig src/sage/interfaces/qepcad.py ---- src/sage/interfaces/qepcad.py.orig 2015-07-19 15:07:33.423329719 -0300 -+++ src/sage/interfaces/qepcad.py 2015-07-19 15:07:50.294330365 -0300 -@@ -522,8 +522,8 @@ TESTS: +--- src/sage/interfaces/qepcad.py.orig 2016-08-08 13:58:03.953585989 -0400 ++++ src/sage/interfaces/qepcad.py 2016-08-08 14:00:58.323592666 -0400 +@@ -530,8 +530,8 @@ TESTS: Check the qepcad configuration file:: - sage: open('%s/default.qepcadrc'%SAGE_LOCAL).readlines()[-1] -- 'SINGULAR .../local/bin\n' +- 'SINGULAR .../bin\n' + sage: open('/usr/share/qepcad/default.qepcadrc').readlines()[-1] + 'SINGULAR /usr/bin\n' - AUTHORS: + Tests related to the not tested examples (nondeterministic order of atoms):: -@@ -550,6 +550,8 @@ from sage.repl.preparse import implicit_ +@@ -606,7 +606,6 @@ AUTHORS: + from __future__ import print_function + from __future__ import absolute_import - from expect import Expect, ExpectFunction, AsciiArtString +-from sage.env import SAGE_LOCAL + import pexpect + import re + import sys +@@ -618,6 +617,8 @@ from sage.interfaces.tab_completion impo + + from .expect import Expect, ExpectFunction, AsciiArtString +QEPCAD_LOCAL = "/usr/share/qepcad" + - def _qepcad_cmd(memcells=None): + def _qepcad_atoms(formula): r""" - Construct a QEPCAD command line. -@@ -560,17 +562,17 @@ def _qepcad_cmd(memcells=None): + Return the atoms of a qepcad quantifier-free formula, as a set of strings. +@@ -647,17 +648,17 @@ def _qepcad_cmd(memcells=None): sage: from sage.interfaces.qepcad import _qepcad_cmd sage: s = _qepcad_cmd() @@ -42,7 +50,7 @@ diff -up src/sage/interfaces/qepcad.py.orig src/sage/interfaces/qepcad.py _command_info_cache = None -@@ -595,7 +597,7 @@ def _update_command_info(): +@@ -682,7 +683,7 @@ def _update_command_info(): cache = {} diff --git a/sagemath-readonly.patch b/sagemath-readonly.patch index 2055448..25569d6 100644 --- a/sagemath-readonly.patch +++ b/sagemath-readonly.patch @@ -1,7 +1,7 @@ diff -up src/sage/all.py.orig src/sage/all.py ---- src/sage/all.py.orig 2015-10-11 17:37:19.705767886 -0300 -+++ src/sage/all.py 2015-10-11 17:37:41.748768730 -0300 -@@ -294,11 +294,11 @@ def _write_started_file(): +--- src/sage/all.py.orig 2016-08-08 13:29:42.192520823 -0400 ++++ src/sage/all.py 2016-08-08 13:30:18.601522217 -0400 +@@ -305,11 +305,11 @@ def _write_started_file(): Check that the file exists when Sage is running:: diff --git a/sagemath-rpmbuild.patch b/sagemath-rpmbuild.patch index 55a33c2..c581944 100644 --- a/sagemath-rpmbuild.patch +++ b/sagemath-rpmbuild.patch @@ -1,6 +1,6 @@ diff -up src/module_list.py.orig src/module_list.py ---- src/module_list.py.orig 2015-12-09 18:09:26.357141568 -0200 -+++ src/module_list.py 2015-12-09 18:09:36.501141956 -0200 +--- src/module_list.py.orig 2016-08-08 13:18:16.519494566 -0400 ++++ src/module_list.py 2016-08-08 13:18:29.570495066 -0400 @@ -3,7 +3,7 @@ from glob import glob from distutils.extension import Extension from sage.env import SAGE_LOCAL @@ -9,28 +9,11 @@ diff -up src/module_list.py.orig src/module_list.py +SAGE_INC = '/usr/include' ######################################################### - ### BLAS setup -@@ -66,7 +66,7 @@ givaro_extra_compile_args =['-D__STDC_LI - ### PolyBoRi settings - ######################################################### - --polybori_extra_compile_args = [] -+polybori_extra_compile_args = ['-DPBORI_USE_ORIGINAL_CUDD'] - polybori_major_version = '0.8' - - ######################################################### + ### pkg-config setup diff -up src/setup.py.orig src/setup.py ---- src/setup.py.orig 2015-12-09 18:09:33.813141853 -0200 -+++ src/setup.py 2015-12-09 18:13:21.819150584 -0200 -@@ -64,6 +64,7 @@ except KeyError: - keep_going = False - - # search for dependencies and add to gcc -I -+SAGE_INC = '/usr/include' - include_dirs = sage_include_directories(use_sources=True) - - # Manually add -fno-strict-aliasing, which is needed to compile Cython -@@ -567,11 +568,9 @@ def run_cythonize(): +--- src/setup.py.orig 2016-08-08 13:19:09.383496590 -0400 ++++ src/setup.py 2016-08-08 13:20:41.161500105 -0400 +@@ -561,11 +561,9 @@ def run_cythonize(): print('Enabling Cython profiling support') profile = True @@ -44,7 +27,7 @@ diff -up src/setup.py.orig src/setup.py force = True version_file = os.path.join(os.path.dirname(__file__), '.cython_version') -@@ -620,21 +619,6 @@ print("Discovered Python/Cython sources, +@@ -618,21 +616,6 @@ print("Discovered Python/Cython sources, ######################################################### @@ -63,6 +46,6 @@ diff -up src/setup.py.orig src/setup.py - - -######################################################### - ### Distutils + ### Install also Jupyter kernel spec ######################################################### diff --git a/sagemath-sagedoc.patch b/sagemath-sagedoc.patch index c2103d5..dc2a6e1 100644 --- a/sagemath-sagedoc.patch +++ b/sagemath-sagedoc.patch @@ -1,16 +1,103 @@ -diff -up src/doc/common/builder.py.orig src/doc/common/builder.py ---- src/doc/common/builder.py.orig 2015-12-22 10:55:07.586513923 -0200 -+++ src/doc/common/builder.py 2015-12-22 10:55:10.131514020 -0200 -@@ -32,7 +32,7 @@ from sage.env import SAGE_DOC, SAGE_SRC - # SAGE_DOC, LANGUAGES, SPHINXOPTS, PAPER, OMIT, - # PAPEROPTS, ALLSPHINXOPTS, NUM_THREADS, WEBSITESPHINXOPTS - # from build_options.py. --fpath = os.path.join(SAGE_DOC, 'common', 'build_options.py') -+fpath = os.path.join(os.getenv('SAGE_ROOT'), 'src', 'doc', 'common', 'build_options.py') - exec(compile(open(fpath).read(), fpath, 'exec')) +diff -up src/doc/common/conf.py.orig src/doc/common/conf.py +--- src/doc/common/conf.py.orig 2016-08-08 13:21:49.624502727 -0400 ++++ src/doc/common/conf.py 2016-08-08 13:22:19.945503888 -0400 +@@ -218,7 +218,7 @@ if (os.environ.get('SAGE_DOC_MATHJAX', ' + html_theme_options['mathjax_macros'] = sage_mathjax_macros() + from pkg_resources import Requirement, working_set +- sagenb_path = working_set.find(Requirement.parse('sagenb')).location ++ sagenb_path = SAGE_SRC + mathjax_relative = os.path.join('sagenb','data','mathjax') -@@ -303,12 +303,12 @@ class AllBuilder(object): + # It would be really nice if sphinx would copy the entire mathjax directory, +diff -up src/sage/doctest/control.py.orig src/sage/doctest/control.py +--- src/sage/doctest/control.py.orig 2016-08-08 13:22:48.247504971 -0400 ++++ src/sage/doctest/control.py 2016-08-08 13:23:38.842506909 -0400 +@@ -95,7 +95,6 @@ class DocTestDefaults(SageObject): + self.valgrind = False + self.massif = False + self.cachegrind = False +- self.omega = False + self.failed = False + self.new = False + self.show_skipped = False +@@ -270,7 +269,7 @@ class DocTestController(SageObject): + if options.gdb or options.debug: + # Interactive debuggers: "infinite" timeout + options.timeout = 0 +- elif options.valgrind or options.massif or options.cachegrind or options.omega: ++ elif options.valgrind or options.massif or options.cachegrind: + # Non-interactive debuggers: 48 hours + options.timeout = int(os.getenv('SAGE_TIMEOUT_VALGRIND', 48 * 60 * 60)) + elif options.long: +@@ -636,7 +635,6 @@ class DocTestController(SageObject): + from sage.env import SAGE_SRC, SAGE_DOC_SRC, SAGE_ROOT + def all_files(): + self.files.append(opj(SAGE_SRC, 'sage')) +- self.files.append(opj(SAGE_SRC, 'sage_setup')) + self.files.append(SAGE_DOC_SRC) + self.options.sagenb = True + DOT_GIT= opj(SAGE_ROOT, '.git') +@@ -1031,13 +1029,8 @@ class DocTestController(SageObject): + elif opt.cachegrind: + toolname = "cachegrind" + flags = os.getenv("SAGE_CACHEGRIND_FLAGS", "") +- elif opt.omega: +- toolname = "exp-omega" +- flags = os.getenv("SAGE_OMEGA_FLAGS", "") + cmd = "exec valgrind --tool=%s "%(toolname) + flags += ''' --log-file="%s" ''' % logfile +- if opt.omega: +- toolname = "omega" + if "%s" in flags: + flags %= toolname + ".%p" # replace %s with toolname + cmd += flags + sage_cmd +@@ -1097,10 +1090,10 @@ class DocTestController(SageObject): + 0 + """ + opt = self.options +- L = (opt.gdb, opt.valgrind, opt.massif, opt.cachegrind, opt.omega) ++ L = (opt.gdb, opt.valgrind, opt.massif, opt.cachegrind) + if any(L): + if L.count(True) > 1: +- self.log("You may only specify one of gdb, valgrind/memcheck, massif, cachegrind, omega") ++ self.log("You may only specify one of gdb, valgrind/memcheck, massif, cachegrind") + return 2 + return self.run_val_gdb() + else: +diff -up src/sage/interfaces/singular.py.orig src/sage/interfaces/singular.py +--- src/sage/interfaces/singular.py.orig 2016-08-08 13:23:50.344507349 -0400 ++++ src/sage/interfaces/singular.py 2016-08-08 13:24:08.618508049 -0400 +@@ -2249,7 +2249,7 @@ def generate_docstring_dictionary(): + nodes.clear() + node_names.clear() + +- singular_docdir = os.environ["SAGE_LOCAL"]+"/share/singular/" ++ singular_docdir = os.environ["SINGULAR_BIN_DIR"]+"/info/" + + new_node = re.compile("File: singular\.hlp, Node: ([^,]*),.*") + new_lookup = re.compile("\* ([^:]*):*([^.]*)\..*") +diff -up src/sage_setup/docbuild/ext/multidocs.py.orig src/sage_setup/docbuild/ext/multidocs.py +--- src/sage_setup/docbuild/ext/multidocs.py.orig 2016-08-10 14:37:02.566492810 -0400 ++++ src/sage_setup/docbuild/ext/multidocs.py 2016-08-10 14:37:31.238493908 -0400 +@@ -78,8 +78,11 @@ def merge_environment(app, env): + for ind in newalldoc: + # treat subdocument source as orphaned file and don't complain + md = env.metadata.get(ind, dict()) +- md['orphan'] = 1 +- env.metadata[ind] = md ++ try: ++ md['orphan'] = 1 ++ env.metadata[ind] = md ++ except AttributeError: ++ env.metadata[ind] = {'orphan'} + # merge the citations + newcite = {} + for ind, (path, tag) in docenv.citations.iteritems(): +diff -up src/sage_setup/docbuild/__init__.py.orig src/sage_setup/docbuild/__init__.py +--- src/sage_setup/docbuild/__init__.py.orig 2016-08-10 14:33:38.854485009 -0400 ++++ src/sage_setup/docbuild/__init__.py 2016-08-10 14:34:22.591486684 -0400 +@@ -295,12 +295,12 @@ class AllBuilder(object): # apply_async does not, so don't use it. x = pool.map_async(build_other_doc, L, 1) try: @@ -21,11 +108,11 @@ diff -up src/doc/common/builder.py.orig src/doc/common/builder.py except Exception: - pool.terminate() if ABORT_ON_ERROR: -+ pool.terminate() ++ pool.terminate() raise logger.warning("Elapsed time: %.1f seconds."%(time.time()-start)) logger.warning("Done building the documentation!") -@@ -500,12 +500,12 @@ class ReferenceBuilder(AllBuilder): +@@ -492,12 +492,12 @@ class ReferenceBuilder(AllBuilder): # (See comment in AllBuilder._wrapper about using map instead of apply.) x = pool.map_async(build_ref_doc, L, 1) try: @@ -40,107 +127,3 @@ diff -up src/doc/common/builder.py.orig src/doc/common/builder.py raise # The html refman must be build at the end to ensure correct # merging of indexes and inventories. -diff -up src/doc/common/conf.py.orig src/doc/common/conf.py ---- src/doc/common/conf.py.orig 2015-12-22 10:55:07.588513923 -0200 -+++ src/doc/common/conf.py 2015-12-22 10:55:10.132514020 -0200 -@@ -1,5 +1,5 @@ - import sys, os, sphinx --from sage.env import SAGE_DOC -+from sage.env import SAGE_DOC, SAGE_SRC - from datetime import date - - def get_doc_abspath(path): -@@ -224,8 +224,7 @@ if (os.environ.get('SAGE_DOC_MATHJAX', ' - from sage.misc.latex_macros import sage_mathjax_macros - html_theme_options['mathjax_macros'] = sage_mathjax_macros() - -- from pkg_resources import Requirement, working_set -- sagenb_path = working_set.find(Requirement.parse('sagenb')).location -+ sagenb_path = SAGE_SRC - mathjax_relative = os.path.join('sagenb','data','mathjax') - - # It would be really nice if sphinx would copy the entire mathjax directory, -diff -up src/doc/common/multidocs.py.orig src/doc/common/multidocs.py ---- src/doc/common/multidocs.py.orig 2015-12-22 10:55:07.591513923 -0200 -+++ src/doc/common/multidocs.py 2015-12-22 10:55:10.132514020 -0200 -@@ -73,8 +73,11 @@ def merge_environment(app, env): - for ind in newalldoc: - # treat subdocument source as orphaned file and don't complain - md = env.metadata.get(ind, set()) -- md.add('orphan') -- env.metadata[ind] = md -+ try: -+ md.add('orphan') -+ env.metadata[ind] = md -+ except AttributeError: -+ env.metadata[ind] = {'orphan'} - # merge the citations - newcite = {} - for ind, (path, tag) in docenv.citations.iteritems(): -diff -up src/sage/doctest/control.py.orig src/sage/doctest/control.py ---- src/sage/doctest/control.py.orig 2015-12-22 10:55:07.592513923 -0200 -+++ src/sage/doctest/control.py 2015-12-22 10:55:27.152514672 -0200 -@@ -90,7 +90,6 @@ class DocTestDefaults(SageObject): - self.valgrind = False - self.massif = False - self.cachegrind = False -- self.omega = False - self.failed = False - self.new = False - self.show_skipped = False -@@ -212,7 +211,7 @@ class DocTestController(SageObject): - if options.gdb or options.debug: - # Interactive debuggers: "infinite" timeout - options.timeout = 0 -- elif options.valgrind or options.massif or options.cachegrind or options.omega: -+ elif options.valgrind or options.massif or options.cachegrind: - # Non-interactive debuggers: 48 hours - options.timeout = int(os.getenv('SAGE_TIMEOUT_VALGRIND', 48 * 60 * 60)) - elif options.long: -@@ -545,7 +544,6 @@ class DocTestController(SageObject): - def all_files(): - from glob import glob - self.files.append(opj(SAGE_SRC, 'sage')) -- self.files.append(opj(SAGE_SRC, 'sage_setup')) - self.files.append(opj(SAGE_SRC, 'doc', 'common')) - self.files.extend(glob(opj(SAGE_SRC, 'doc', '[a-z][a-z]'))) - self.options.sagenb = True -@@ -940,13 +938,8 @@ class DocTestController(SageObject): - elif opt.cachegrind: - toolname = "cachegrind" - flags = os.getenv("SAGE_CACHEGRIND_FLAGS", "") -- elif opt.omega: -- toolname = "exp-omega" -- flags = os.getenv("SAGE_OMEGA_FLAGS", "") - cmd = "exec valgrind --tool=%s "%(toolname) - flags += ''' --log-file="%s" ''' % logfile -- if opt.omega: -- toolname = "omega" - if "%s" in flags: - flags %= toolname + ".%p" # replace %s with toolname - cmd += flags + sage_cmd -@@ -1006,10 +999,10 @@ class DocTestController(SageObject): - 0 - """ - opt = self.options -- L = (opt.gdb, opt.valgrind, opt.massif, opt.cachegrind, opt.omega) -+ L = (opt.gdb, opt.valgrind, opt.massif, opt.cachegrind) - if any(L): - if L.count(True) > 1: -- self.log("You may only specify one of gdb, valgrind/memcheck, massif, cachegrind, omega") -+ self.log("You may only specify one of gdb, valgrind/memcheck, massif, cachegrind") - return 2 - return self.run_val_gdb() - else: -diff -up src/sage/interfaces/singular.py.orig src/sage/interfaces/singular.py ---- src/sage/interfaces/singular.py.orig 2015-12-22 10:55:07.594513923 -0200 -+++ src/sage/interfaces/singular.py 2015-12-22 10:55:10.134514020 -0200 -@@ -2232,7 +2232,7 @@ def generate_docstring_dictionary(): - nodes.clear() - node_names.clear() - -- singular_docdir = os.environ["SAGE_LOCAL"]+"/share/singular/" -+ singular_docdir = os.environ["SINGULAR_BIN_DIR"]+"/info/" - - new_node = re.compile("File: singular\.hlp, Node: ([^,]*),.*") - new_lookup = re.compile("\* ([^:]*):*([^.]*)\..*") diff --git a/sagemath-sagenb.patch b/sagemath-sagenb.patch index d4d87ad..fe053d4 100644 --- a/sagemath-sagenb.patch +++ b/sagemath-sagenb.patch @@ -1,15 +1,15 @@ -diff -up build/pkgs/sagenb/src/sagenb-0.11.4/sagenb/flask_version/base.py.orig build/pkgs/sagenb/src/sagenb-0.11.4/sagenb/flask_version/base.py ---- build/pkgs/sagenb/src/sagenb-0.11.4/sagenb/flask_version/base.py.orig 2015-04-03 14:57:55.335379915 -0300 -+++ build/pkgs/sagenb/src/sagenb-0.11.4/sagenb/flask_version/base.py 2015-04-03 14:59:22.805383265 -0300 +diff -up build/pkgs/sagenb/src/sagenb/flask_version/base.py.orig build/pkgs/sagenb/src/sagenb/flask_version/base.py +--- build/pkgs/sagenb/src/sagenb/flask_version/base.py.orig 2016-08-15 06:09:20.786276308 -0400 ++++ build/pkgs/sagenb/src/sagenb/flask_version/base.py 2016-08-15 06:09:23.074276396 -0400 @@ -4,8 +4,6 @@ from functools import partial - from flask import Flask, Module, url_for, render_template, request, session, redirect, g, make_response, current_app + from flask import Flask, Module, url_for, request, session, redirect, g, make_response, current_app, render_template from decorators import login_required, guest_or_login_required, with_lock from decorators import global_lock -# Make flask use the old session foo from <=flask-0.9 -from flask_oldsessions import OldSecureCookieSessionInterface from flask.ext.autoindex import AutoIndex - try: + from sage.env import SAGE_SRC, SAGE_DOC @@ -25,7 +23,6 @@ class SageNBFlask(Flask): def __init__(self, *args, **kwds): self.startup_token = kwds.pop('startup_token', None) @@ -37,10 +37,10 @@ diff -up build/pkgs/sagenb/src/sagenb-0.11.4/sagenb/flask_version/base.py.orig b import mimetypes mimetypes.add_type('text/plain','.jmol') -diff -up build/pkgs/sagenb/src/sagenb-0.11.4/sagenb/misc/misc.py.orig build/pkgs/sagenb/src/sagenb-0.11.4/sagenb/misc/misc.py ---- build/pkgs/sagenb/src/sagenb-0.11.4/sagenb/misc/misc.py.orig 2015-04-03 14:58:07.335380375 -0300 -+++ build/pkgs/sagenb/src/sagenb-0.11.4/sagenb/misc/misc.py 2015-04-03 14:59:36.461383788 -0300 -@@ -174,7 +174,8 @@ def pad_zeros(s, size=3): +diff -up build/pkgs/sagenb/src/sagenb/misc/misc.py.orig build/pkgs/sagenb/src/sagenb/misc/misc.py +--- build/pkgs/sagenb/src/sagenb/misc/misc.py.orig 2016-08-15 06:09:20.792276308 -0400 ++++ build/pkgs/sagenb/src/sagenb/misc/misc.py 2016-08-15 06:09:23.076276396 -0400 +@@ -176,7 +176,8 @@ def pad_zeros(s, size=3): SAGENB_ROOT = os.path.split(resource_filename(__name__, ''))[0] @@ -50,10 +50,10 @@ diff -up build/pkgs/sagenb/src/sagenb-0.11.4/sagenb/misc/misc.py.orig build/pkgs if os.environ.has_key('DOT_SAGENB'): DOT_SAGENB = os.environ['DOT_SAGENB'] -diff -up build/pkgs/sagenb/src/sagenb-0.11.4/sagenb/notebook/cell.py.orig build/pkgs/sagenb/src/sagenb-0.11.4/sagenb/notebook/cell.py ---- build/pkgs/sagenb/src/sagenb-0.11.4/sagenb/notebook/cell.py.orig 2015-04-03 14:58:19.246380831 -0300 -+++ build/pkgs/sagenb/src/sagenb-0.11.4/sagenb/notebook/cell.py 2015-04-03 15:00:09.605385057 -0300 -@@ -2340,8 +2340,8 @@ class Cell(Cell_generic): +diff -up build/pkgs/sagenb/src/sagenb/notebook/cell.py.orig build/pkgs/sagenb/src/sagenb/notebook/cell.py +--- build/pkgs/sagenb/src/sagenb/notebook/cell.py.orig 2016-08-15 06:09:20.800276309 -0400 ++++ build/pkgs/sagenb/src/sagenb/notebook/cell.py 2016-08-15 06:09:23.077276396 -0400 +@@ -2350,8 +2350,8 @@ class Cell(Cell_generic): with open(jmol_name, 'r') as f: jmol_script = f.read() jmol_script = jmol_script.replace( @@ -64,21 +64,21 @@ diff -up build/pkgs/sagenb/src/sagenb-0.11.4/sagenb/notebook/cell.py.orig build/ with open(jmol_name, 'w') as f: f.write(jmol_script) -diff -up build/pkgs/sagenb/src/sagenb-0.11.4/sagenb/notebook/run_notebook.py.orig build/pkgs/sagenb/src/sagenb-0.11.4/sagenb/notebook/run_notebook.py ---- build/pkgs/sagenb/src/sagenb-0.11.4/sagenb/notebook/run_notebook.py.orig 2015-04-03 14:58:32.839381352 -0300 -+++ build/pkgs/sagenb/src/sagenb-0.11.4/sagenb/notebook/run_notebook.py 2015-04-03 15:01:22.725387857 -0300 -@@ -46,12 +46,14 @@ sagenb.notebook.misc.DIR = %(cwd)r #We s +diff -up build/pkgs/sagenb/src/sagenb/notebook/run_notebook.py.orig build/pkgs/sagenb/src/sagenb/notebook/run_notebook.py +--- build/pkgs/sagenb/src/sagenb/notebook/run_notebook.py.orig 2016-08-15 06:09:20.806276309 -0400 ++++ build/pkgs/sagenb/src/sagenb/notebook/run_notebook.py 2016-08-15 06:10:30.060278961 -0400 +@@ -46,12 +46,11 @@ sagenb.notebook.misc.DIR = %(cwd)r #We s # Flask # ######### import os, sys, random -import sagenb.flask_version.base as flask_base +-opts={} +sagenb_dir = os.path.join(os.environ['SAGE_ROOT'], 'src', 'sagenb') +sys.path.append(sagenb_dir) +import flask_version.base as flask_base - opts={} startup_token = '{0:x}'.format(random.randint(0, 2**128)) - if %(automatic_login)s: - opts['startup_token'] = startup_token +-if %(automatic_login)s: +- opts['startup_token'] = startup_token -flask_app = flask_base.create_app(%(notebook_opts)s, **opts) +flask_app = flask_base.create_app(%(notebook_opts)s, startup_token=startup_token) diff --git a/sagemath-scripts.patch b/sagemath-scripts.patch index 9c5f071..d294074 100644 --- a/sagemath-scripts.patch +++ b/sagemath-scripts.patch @@ -1,12 +1,13 @@ diff -up src/bin/sage.orig src/bin/sage ---- src/bin/sage.orig 2015-11-07 11:53:13.984795336 -0200 -+++ src/bin/sage 2015-11-07 11:53:51.199796761 -0200 -@@ -13,19 +13,15 @@ usage() { +--- src/bin/sage.orig 2016-08-08 13:05:27.823465130 -0400 ++++ src/bin/sage 2016-08-08 13:12:27.114481186 -0400 +@@ -13,20 +13,16 @@ usage() { echo " file.[sage|py|spyx] -- run given .sage, .py or .spyx file" echo " -advanced -- list all command line options" echo " -c -- Evaluates cmd as sage code" - echo " -experimental -- list all experimental packages that can be installed" echo " -gap [...] -- run Sage's Gap with given arguments" + echo " -gap3 [...] -- run Sage's Gap3 with given arguments" echo " -gp [...] -- run Sage's PARI/GP calculator with given arguments" echo " -h, -? -- print this help message" - echo " -i [packages] -- install the given Sage packages" @@ -15,13 +16,13 @@ diff -up src/bin/sage.orig src/bin/sage echo " -maxima [...] -- run Sage's Maxima with given arguments" echo " -mwrank [...] -- run Sage's mwrank with given arguments" echo " --notebook=[...] -- start the Sage notebook (valid options are" - echo " 'default', 'sagenb', and 'ipython')" + echo " 'default', 'sagenb', 'jupyter', and 'export')" echo " -n, --notebook -- shortcut for --notebook=default" - echo " -optional -- list all optional packages that can be installed" echo " -python [...] -- run the Python interpreter" echo " -R [...] -- run Sage's R with given arguments" echo " -singular [...] -- run Sage's singular with given arguments" -@@ -41,10 +37,6 @@ usage() { +@@ -42,10 +38,6 @@ usage() { echo " --optional - controls which optional tests are run" echo " --sagenb - test all sagenb files" echo " --help - show all testing options" @@ -32,7 +33,7 @@ diff -up src/bin/sage.orig src/bin/sage echo " -v, -version -- display Sage version information" exit 0 } -@@ -63,11 +55,8 @@ usage_advanced() { +@@ -64,11 +56,8 @@ usage_advanced() { echo " -preparse -- preparse file.sage and produce corresponding file.sage.py" echo " -q -- quiet; start with no banner" echo " -root -- print the Sage root directory" @@ -44,8 +45,8 @@ diff -up src/bin/sage.orig src/bin/sage echo #### 1.......................26..................................................78 -@@ -77,8 +66,6 @@ usage_advanced() { - echo " 'default', 'sagenb', and 'ipython'). See the output" +@@ -78,8 +67,6 @@ usage_advanced() { + echo " 'default', 'sagenb', and 'jupyter'). See the output" echo " of sage --notebook --help for more details and" echo " examples of how to pass optional arguments" - echo " -bn, -build-and-notebook [...] -- build the Sage library then start" @@ -53,7 +54,7 @@ diff -up src/bin/sage.orig src/bin/sage echo " -inotebook [...] -- start the *insecure* Sage notebook (deprecated)" echo " -n, -notebook [...] -- start the default Sage notebook (options are the" echo " same as for the notebook command in Sage). See the" -@@ -96,13 +83,9 @@ usage_advanced() { +@@ -98,12 +85,9 @@ usage_advanced() { echo " -gp [...] -- run Sage's PARI/GP calculator with given arguments" echo " -ipython [...] -- run Sage's IPython using the default environment (not" echo " Sage), passing additional options to IPython" @@ -63,32 +64,35 @@ diff -up src/bin/sage.orig src/bin/sage echo " -lisp [...] -- run Lisp interpreter included with Sage" echo " -M2 [...] -- run Sage's Macaulay2 with given arguments" - command -v M2 &>/dev/null || \ -- echo " (not installed currently, run sage -i macaulay2)" + echo " (not installed currently, run sage -i macaulay2)" echo " -maxima [...] -- run Sage's Maxima with given arguments" echo " -mwrank [...] -- run Sage's mwrank with given arguments" - echo " -python [...] -- run the Python interpreter" -@@ -116,45 +99,7 @@ usage_advanced() { +@@ -118,49 +102,7 @@ usage_advanced() { echo #### 1.......................26..................................................78 #### |.....................--.|...................................................| - echo "Installing packages and upgrading:" +- echo " -package [args] -- call the new package manager with given arguments." +- echo " Run without arguments for package-specific help." - echo " -experimental -- list all experimental packages that can be installed" - echo " -f [opts] [packages]-- shortcut for -i -f: force build of the given Sage" - echo " packages" -- echo " -i [opts] [packages]-- install the given Sage packages (unless they are" -- echo " already installed); if no packages are given, print" -- echo " a list of all installed packages. Options:" +- echo " -i [opts] [packages]-- install the given Sage packages. Options:" - echo " -c -- run the packages' test suites" +- echo " -d -- only download, do not install packages" - echo " -f -- force build: install the packages even" - echo " if they are already installed" -- echo " -s -- do not delete the spkg/build directories" +- echo " -s -- do not delete the temporary build directories" - echo " after a successful build" +- echo " -p [opts] [packages]-- install the given Sage packages, without dependency" +- echo " checking and with support for old-style spkgs." +- echo " Options are -c, -d and -s with the same meaning as" +- echo " for the -i command" - echo " -info [packages] -- print the SPKG.txt of the given packages" +- echo " --location -- if needed, fix paths to make Sage relocatable" - echo " -optional -- list all optional packages that can be installed" - echo " -standard -- list all standard packages that can be installed" - echo " -installed -- list all installed packages" -- #echo " -update -- download latest non-optional Sage packages (do not build them)" -- #echo " -update-build -- build and install all downloaded non-optional Sage packages" - echo " -upgrade [version] -- download, build and install the given version. Here," - echo " 'version' is a git branch or tag name. Useful values" - echo " are 'master' (the current development version, this" @@ -114,7 +118,7 @@ diff -up src/bin/sage.orig src/bin/sage echo " -startuptime [module] -- display how long each component of Sage takes to" echo " start up; optionally specify a module to get more" echo " details about that particular module" -@@ -184,7 +129,6 @@ usage_advanced() { +@@ -190,7 +132,6 @@ usage_advanced() { echo " -coverage -- give info about doctest coverage of files" echo " -coverageall -- give summary info about doctest coverage of all" echo " files in the Sage library" @@ -122,15 +126,16 @@ diff -up src/bin/sage.orig src/bin/sage echo " -search_src -- search through all the Sage library code for string" echo " -search_doc -- search through the Sage documentation for string" echo " -grep -- same as -search_src" -@@ -204,15 +148,6 @@ usage_advanced() { +@@ -210,16 +151,6 @@ usage_advanced() { echo #### 1.......................26..................................................78 #### |.....................--.|...................................................| - echo "Making Sage packages or distributions:" -- echo " -bdist -- build a binary distribution of Sage" +- echo " -sdist -- build a source distribution of Sage" - echo " -pkg -- create Sage package dir.spkg from a given directory" - echo " -pkg_nc -- as -pkg, but do not compress the package" -- echo " -sdist -- build a source distribution of Sage" +- echo " -fix-pkg-checksums -- fix the checksums from build/pkgs directories from " +- echo " the packages located in upstream/" - - echo - #### 1.......................26..................................................78 @@ -138,7 +143,7 @@ diff -up src/bin/sage.orig src/bin/sage echo "Valgrind memory debugging:" echo " -cachegrind -- run Sage using Valgrind's cachegrind tool. The log" echo " files are named sage-cachegrind.PID can be found in" -@@ -226,9 +161,6 @@ usage_advanced() { +@@ -233,9 +164,6 @@ usage_advanced() { echo " -memcheck -- run Sage using Valgrind's memcheck tool. The log" echo " files are named sage-memcheck.PID can be found in" echo " $DOT_SAGE" @@ -148,17 +153,7 @@ diff -up src/bin/sage.orig src/bin/sage echo " -valgrind -- this is an alias for -memcheck" echo echo "You can also use -- before a long option, e.g., 'sage --optional'." -@@ -236,9 +168,6 @@ usage_advanced() { - exit 0 - } - --# Check for '--nodotsage' before sourcing sage-env; otherwise sage-env --# will already have set some environment variables with the old --# setting for DOT_SAGE. - if [ "$1" = '--nodotsage' ]; then - export DOT_SAGE=`mktemp -d ${TMPDIR:-/tmp}/dotsageXXXXXX` - shift -@@ -248,34 +177,6 @@ if [ "$1" = '--nodotsage' ]; then +@@ -260,86 +188,6 @@ if [ "$1" = '--nodotsage' ]; then exit $status fi @@ -178,10 +173,63 @@ diff -up src/bin/sage.orig src/bin/sage - exec local/bin/sage-upgrade "$@" -fi - +-# Check for '-i' before sourcing sage-env: running "make" +-# should be run outside of the Sage shell. +-if [ "$1" = '-f' ]; then +- # -f is an alias for -i -f +- set -- -i "$@" +-fi - +-if [ "$1" = '-i' ]; then +- shift +- if [ -z "$MAKE" ]; then +- MAKE="make" +- fi +- +- set -e +- +- cd "$SAGE_ROOT" +- +- # First of all, make sure that the toolchain is up-to-date +- # (which is a dependency of every package) +- ./sage --location +- $MAKE all-toolchain +- echo +- +- INSTALL_OPTIONS="" # Options to sage-spkg +- for PKG in "$@" +- do +- case "$PKG" in +- -info|--info) +- echo >&2 "Error: 'sage -i $PKG ' is no longer supported, use 'sage --info ' instead." +- exit 2;; +- -f) FORCE_INSTALL=yes;; +- -*) INSTALL_OPTIONS="$INSTALL_OPTIONS $PKG";; +- *) +- # First check that $PKG is actually a Makefile target +- if ! grep "^$PKG: " build/make/Makefile >/dev/null; then +- echo >&2 "Error: package '$PKG' not found" +- echo >&2 "Assuming it is an old-style package... (this is deprecated: use -p instead of -i to install old-style packages)" +- echo >&2 +- sleep 5 +- ./sage -p $INSTALL_OPTIONS "$PKG" +- else +- if [ x$FORCE_INSTALL = xyes ]; then +- $MAKE "$PKG-clean" +- fi +- $MAKE SAGE_SPKG="sage-spkg $INSTALL_OPTIONS" "$PKG" +- fi;; +- esac +- done +- exit 0 +-fi +- +- +-##################################################################### -# Source sage-env ($0 is the name of this "sage" script, so we can just -# append -env to that). We redirect stdout to stderr, which is safer -# for scripts. +-##################################################################### -. "$0-env" >&2 -if [ $? -ne 0 ]; then - echo >&2 "Error setting environment variables by sourcing '$0-env';" @@ -189,11 +237,10 @@ diff -up src/bin/sage.orig src/bin/sage - exit 1 -fi - -- + if [ $# -gt 0 ]; then if [ "$1" = '-h' -o "$1" = '-?' -o "$1" = '-help' -o "$1" = '--help' ]; then - usage -@@ -287,25 +188,11 @@ fi +@@ -352,26 +200,12 @@ fi # Prepare for running Sage, either interactively or non-interactively. sage_setup() { @@ -209,9 +256,10 @@ diff -up src/bin/sage.orig src/bin/sage - exit 1 - fi - - # Display the startup banner + # Display the startup banner (unless SAGE_BANNER is explictly "no") if [ "$SAGE_BANNER" != "no" ]; then - cat "$SAGE_LOCAL/bin/sage-banner" + # can be 'bare', or 'yes', or unspecified + echo "$SAGE_BANNER_TEXT" fi - maybe_sage_location @@ -219,7 +267,7 @@ diff -up src/bin/sage.orig src/bin/sage if [ ! -d "$IPYTHONDIR" ]; then # make sure that $DOT_SAGE exists so that ipython will happily # create its config directories there. If DOT_SAGE doesn't -@@ -316,20 +203,6 @@ sage_setup() { +@@ -382,20 +216,6 @@ sage_setup() { } @@ -240,7 +288,7 @@ diff -up src/bin/sage.orig src/bin/sage # Start an interactive Sage session, this function never returns. interactive_sage() { sage_setup -@@ -396,7 +269,7 @@ fi +@@ -467,7 +287,7 @@ fi if [ "$1" = '-singular' -o "$1" = '--singular' ]; then shift @@ -249,7 +297,7 @@ diff -up src/bin/sage.orig src/bin/sage fi if [ "$1" = '-sqlite3' -o "$1" = '--sqlite3' ]; then -@@ -424,16 +297,6 @@ if [ "$1" = '-lisp' -o "$1" = '--lisp' ] +@@ -495,16 +315,6 @@ if [ "$1" = '-lisp' -o "$1" = '--lisp' ] exec ecl "$@" fi @@ -266,15 +314,22 @@ diff -up src/bin/sage.orig src/bin/sage if [ "$1" = '-maxima' -o "$1" = '--maxima' ]; then shift exec maxima "$@" -@@ -474,16 +337,6 @@ if [ "$1" = '-ipython' -o "$1" = '--ipyt - exec ipython "$@" +@@ -530,11 +340,6 @@ if [ "$1" = '-pip' -o "$1" = '--pip' ]; + exec pip "$@" fi --if [ "$1" = '-git' -o "$1" = '--git' ]; then +-if [ "$1" = '-fix-pkg-checksums' -o "$1" = '--fix-pkg-checksums' ]; then - shift -- exec git "$@" +- exec sage-fix-pkg-checksums "$@" -fi - + if [ "$1" = '-python' -o "$1" = '--python' ]; then + shift + exec python "$@" +@@ -555,11 +360,6 @@ if [ "$1" = '-git' -o "$1" = '--git' ]; + exec git "$@" + fi + -if [ "$1" = '-git-branch' -o "$1" = '--git-branch' ]; then - shift - exec git --git-dir="$SAGE_ROOT"/.git rev-parse --abbrev-ref HEAD @@ -283,7 +338,7 @@ diff -up src/bin/sage.orig src/bin/sage if [ "$1" = '-sh' -o "$1" = '--sh' ]; then # AUTHORS: # - Carl Witty and William Stein: initial version -@@ -603,20 +456,6 @@ EOF +@@ -679,20 +479,6 @@ EOF fi ##################################################################### @@ -304,7 +359,7 @@ diff -up src/bin/sage.orig src/bin/sage # File conversion ##################################################################### -@@ -634,11 +473,6 @@ fi +@@ -710,11 +496,6 @@ fi # Run Sage's versions of the standard Algebra/Geometry etc. software ##################################################################### @@ -316,7 +371,7 @@ diff -up src/bin/sage.orig src/bin/sage if [[ "$1" =~ ^--notebook=.* || "$1" =~ ^-n=.* || "$1" =~ ^-notebook=.* ]] ; then sage-cleaner &>/dev/null & exec sage-notebook "$@" -@@ -649,13 +483,6 @@ if [ "$1" = "-notebook" -o "$1" = '--not +@@ -725,13 +506,6 @@ if [ "$1" = "-notebook" -o "$1" = '--not exec sage-notebook "$@" fi @@ -330,7 +385,7 @@ diff -up src/bin/sage.orig src/bin/sage if [ "$1" = "-inotebook" -o "$1" = '--inotebook' ]; then shift sage-cleaner &>/dev/null & -@@ -674,31 +501,12 @@ if [ "$1" = '-grepdoc' -o "$1" = "--grep +@@ -750,38 +524,19 @@ if [ "$1" = '-grepdoc' -o "$1" = "--grep exit 0 fi @@ -363,7 +418,15 @@ diff -up src/bin/sage.orig src/bin/sage if [ ! -f "$DOT_SAGE"/init.sage ]; then echo >&2 "init.sage does not exist ... creating" touch "$DOT_SAGE"/init.sage -@@ -715,17 +523,6 @@ if [ "$1" = '-t' -o "$1" = '-bt' -o "$1" + fi + SAGE_BANNER=no sage_setup + export PYTHONIOENCODING="utf-8" # Fix encoding for doctests +- if [ "$1" = '-tp' -o "$1" = '-btp' ]; then ++ if [ "$1" = '-tp' ]; then + shift + exec sage-runtests -p "$@" + else +@@ -790,16 +545,6 @@ if [ "$1" = '-t' -o "$1" = '-bt' -o "$1" fi fi @@ -372,52 +435,41 @@ diff -up src/bin/sage.orig src/bin/sage - build_sage - fi - shift -- SAGE_BANNER="no" -- sage_setup +- SAGE_BANNER=no sage_setup - export PYTHONIOENCODING="utf-8" # Fix encoding for doctests - exec sage-runtests --new "$@" -fi - if [ "$1" = '-testall' -o "$1" = "--testall" ]; then shift - SAGE_BANNER="no" -@@ -742,140 +539,6 @@ if [ "$1" = '-c' ]; then + SAGE_BANNER=no sage_setup +@@ -814,133 +559,6 @@ if [ "$1" = '-c' ]; then exec sage-eval "$@" fi +-if [ "$1" = '--location' ]; then +- maybe_sage_location +- exit 0 +-fi +- +- -install() { - maybe_sage_location - -- mkdir -p "$SAGE_LOGS" - for PKG in "$@" - do - # Check for options - case "$PKG" in -- -f) OPTF="-f" +- -*) +- INSTALL_OPTIONS="$INSTALL_OPTIONS $PKG" - continue;; -- -m) OPTS="-s" -- echo >&2 "Warning: the -m option is deprecated since Sage 5.0. Use -s instead." -- continue;; -- -s) OPTS="-s" -- continue;; -- -c) OPTC="-c" -- continue;; -- --check) OPTC="-c" -- continue;; -- -info) OPTINFO="--info" -- continue;; -- --info) OPTINFO="--info" -- continue;; -- -*) echo >&2 "Error: unknown option '$PKG'" -- exit 2;; - esac - - PKG_NAME=`echo "$PKG" | sed -e "s/\.spkg$//"` - PKG_NAME=`basename "$PKG_NAME"` - -- "$SAGE_ROOT"/build/make/pipestatus \ -- "sage-spkg $OPTINFO $OPTF $OPTS $OPTC '$PKG' 2>&1" \ -- "(trap '' SIGINT; tee -a '$SAGE_ROOT/logs/install.log' '$SAGE_LOGS/$PKG_NAME.log')" +- sage-logger \ +- "sage-spkg $INSTALL_OPTIONS '$PKG'" "$SAGE_LOGS/$PKG_NAME.log" - # Do not try to install further packages if one failed - if [ $? -ne 0 ]; then - exit 1 @@ -434,6 +486,12 @@ diff -up src/bin/sage.orig src/bin/sage - exit 0 -} - +- +-if [ "$1" = '-package' -o "$1" = "--package" ]; then +- shift +- exec sage-package $@ +-fi +- -if [ "$1" = '-optional' -o "$1" = "--optional" ]; then - shift - exec sage-list-packages optional $@ @@ -454,26 +512,15 @@ diff -up src/bin/sage.orig src/bin/sage - exec sage-list-packages installed $@ -fi - --if [ "$1" = '-i' ]; then +-if [ "$1" = '-p' ]; then - shift -- # If there are no further arguments, simply list all installed -- # packages. +- # If there are no further arguments, display usage help. - if [ $# -eq 0 ]; then - exec sage-spkg - fi - install "$@" -fi - --if [ "$1" = '-f' ]; then -- shift -- # If there are no further arguments, simply list all installed -- # packages. -- if [ $# -eq 0 ]; then -- exec sage-spkg -- fi -- install -f "$@" --fi -- -if [ "$1" = '-info' -o "$1" = '--info' ]; then - shift - for PKG in "$@" @@ -508,21 +555,29 @@ diff -up src/bin/sage.orig src/bin/sage - exec sage-rsyncdist $2 -fi - --if [ "$1" = '-bdist' -o "$1" = "--bdist" ]; then -- maybe_sage_location -- shift -- exec sage-bdist "$@" --fi -- -if [ "$1" = "-docbuild" -o "$1" = "--docbuild" ]; then - shift -- exec python "$SAGE_DOC/common/builder.py" "$@" +- exec python -m "sage_setup.docbuild" "$@" -fi - - if [ "$1" = '-gdb' -o "$1" = "--gdb" ]; then +-if [ "$1" = '-gdb' -o "$1" = "--gdb" ]; then +- shift +- sage_setup +- if [ "$SAGE_DEBUG" = "no" ]; then +- gdb -x "$SAGE_LOCAL/bin/sage-gdb-commands" \ +- -args python "$SAGE_LOCAL/bin/sage-ipython" "$@" -i +- else +- cygdb "$SAGE_SRC/build" "$SAGE_SRC/sage" \ +- -- -x "$SAGE_LOCAL/bin/sage-gdb-commands" \ +- -args python "$SAGE_LOCAL/bin/sage-ipython" "$@" -i +- fi +- exit $? +-fi +- + if [ "$1" = '-preparse' -o "$1" = "--preparse" ]; then shift - sage_setup -@@ -924,31 +587,11 @@ if [ "$1" = '-callgrind' -o "$1" = "--ca + exec sage-preparse "$@" +@@ -975,21 +593,10 @@ if [ "$1" = '-callgrind' -o "$1" = "--ca exec sage-callgrind "$@" fi @@ -540,24 +595,14 @@ diff -up src/bin/sage.orig src/bin/sage - # Intentionally no "shift" here - interactive_sage "$@" -fi -- --if [ "$1" = '-dev' -o "$1" = "--dev" ]; then -- shift -- exec sage-dev "$@" --fi - if [ $# -ge 1 ]; then -- T=`echo "$1" | sed -e "s/.*\.//"` -- if [ "$T" = "spkg" ]; then -- install "$@" -- fi - SAGE_BANNER="no" - sage_setup - unset TERM # See Trac #12263 + T=`echo "$1" | sed -e "s/.*\.//"` + if [ "$T" = "spkg" ]; then diff -up src/bin/sage-runtests.orig src/bin/sage-runtests ---- src/bin/sage-runtests.orig 2015-11-07 11:53:13.991795336 -0200 -+++ src/bin/sage-runtests 2015-11-07 11:53:18.458795507 -0200 -@@ -55,10 +55,6 @@ if __name__ == "__main__": +--- src/bin/sage-runtests.orig 2016-08-08 13:12:45.999481909 -0400 ++++ src/bin/sage-runtests 2016-08-08 13:13:01.713482511 -0400 +@@ -56,10 +56,6 @@ if __name__ == "__main__": help="run doctests using Valgrind's cachegrind tool. The log " "files are named sage-cachegrind.PID and can be found in " + os.path.join(os.environ["DOT_SAGE"], "valgrind")) @@ -569,8 +614,8 @@ diff -up src/bin/sage-runtests.orig src/bin/sage-runtests parser.add_option("-f", "--failed", action="store_true", default=False, help="doctest only those files that failed in the previous run") diff -up src/bin/sage-valgrind.orig src/bin/sage-valgrind ---- src/bin/sage-valgrind.orig 2015-11-07 11:53:13.997795336 -0200 -+++ src/bin/sage-valgrind 2015-11-07 11:53:18.458795507 -0200 +--- src/bin/sage-valgrind.orig 2016-08-08 13:13:12.399482920 -0400 ++++ src/bin/sage-valgrind 2016-08-08 13:13:37.233483871 -0400 @@ -1,16 +1,6 @@ #!/usr/bin/env bash @@ -585,7 +630,7 @@ diff -up src/bin/sage-valgrind.orig src/bin/sage-valgrind -SUPP+=" --suppressions=$SAGE_EXTCODE/valgrind/sage-additional.supp" - -MEMCHECK_FLAGS="--leak-resolution=high --leak-check=full --num-callers=25 $SUPP" -+MEMCHECK_FLAGS="--leak-resolution=high --leak-check=full --num-callers=25" ++MEMCHECK_FLAGS="--leak-resolution=high --leak-check=full --num-callers=25 " if [ "$SAGE_MEMCHECK_FLAGS" ]; then echo "Overwriting memcheck flags with: $SAGE_MEMCHECK_FLAGS" diff --git a/sagemath-sympy.patch b/sagemath-sympy.patch index 4b64e34..3000d29 100644 --- a/sagemath-sympy.patch +++ b/sagemath-sympy.patch @@ -1,7 +1,7 @@ diff -up src/sage/env.py.orig src/sage/env.py ---- src/sage/env.py.orig 2015-10-11 18:09:31.532841862 -0300 -+++ src/sage/env.py 2015-10-11 18:09:40.426842203 -0300 -@@ -87,7 +87,7 @@ _add_variable_or_fallback('HOSTNAME', +--- src/sage/env.py.orig 2016-08-08 13:45:28.136557046 -0400 ++++ src/sage/env.py 2016-08-08 13:46:17.426558934 -0400 +@@ -89,7 +89,7 @@ _add_variable_or_fallback('HOSTNAME', _add_variable_or_fallback('LOCAL_IDENTIFIER','$HOSTNAME.%s'%os.getpid()) # bunch of sage directories and files @@ -10,12 +10,12 @@ diff -up src/sage/env.py.orig src/sage/env.py _add_variable_or_fallback('SAGE_LOCAL', opj('$SAGE_ROOT', 'local')) _add_variable_or_fallback('SAGE_ETC', opj('$SAGE_LOCAL', 'etc')) _add_variable_or_fallback('SAGE_INC', opj('$SAGE_LOCAL', 'include')) -@@ -102,7 +102,7 @@ _add_variable_or_fallback('SAGE_CYTHONIZ +@@ -111,7 +111,7 @@ _add_variable_or_fallback('SAGE_CYTHONIZ _add_variable_or_fallback('SAGE_EXTCODE', opj('$SAGE_SHARE', 'sage', 'ext')) _add_variable_or_fallback('SAGE_LOGS', opj('$SAGE_ROOT', 'logs', 'pkgs')) _add_variable_or_fallback('SAGE_SPKG_INST', opj('$SAGE_LOCAL', 'var', 'lib', 'sage', 'installed')) --_add_variable_or_fallback('SAGE_DOC', opj('$SAGE_SRC', 'doc')) -+_add_variable_or_fallback('SAGE_DOC', '@@SAGE_DOC@@') +-_add_variable_or_fallback('SAGE_DOC_SRC', opj('$SAGE_SRC', 'doc')) ++_add_variable_or_fallback('SAGE_DOC_SRC', '@@SAGE_DOC@@') + _add_variable_or_fallback('SAGE_DOC', opj('$SAGE_SHARE', 'doc', 'sage')) _add_variable_or_fallback('DOT_SAGE', opj(os.environ.get('HOME','$SAGE_ROOT'), '.sage')) _add_variable_or_fallback('SAGE_DOT_GIT', opj('$SAGE_ROOT', '.git')) - _add_variable_or_fallback('SAGE_DISTFILES', opj('$SAGE_ROOT', 'upstream')) diff --git a/sagemath.spec b/sagemath.spec index 2c66dbe..1063918 100644 --- a/sagemath.spec +++ b/sagemath.spec @@ -1,6 +1,7 @@ %global __provides_exclude_from .*/site-packages/.*\\.so %bcond_without bundled_pari +%bcond_with bundled_pexpect # for faster full rpm test builds %ifarch %{ix86} x86_64 @@ -15,6 +16,9 @@ # use an workaround to match upstream sagemath patched sphinx %bcond_without sphinx_hack +# use workaround to match upstream sagemath patched cython +%bcond_without cython_hack + %ifarch x86_64 %bcond_without fes %else @@ -27,17 +31,20 @@ %global SAGE_TIMEOUT_LONG 180 %global conway_polynomials_pkg conway_polynomials-0.4 +%global cysignals_pkg cysignals-1.1.1 %global elliptic_curves_pkg elliptic_curves-0.8 -%global flintqs_pkg flintqs-20070817 -%global graphs_pkg graphs-20130920 +%global flintqs_pkg flintqs-1.0 +%global graphs_pkg graphs-20151224 %if %{with bundled_pari} -%global pari_pkg pari-2.8-1637-g489005a +%global pari_pkg pari-2.8-2771-gb70b447 +%endif +%if %{with bundled_pexpect} +%global pexpect_pkg pexpect-4.1.0 %endif -%global pexpect_pkg pexpect-2.0 %global polytopes_db_pkg polytopes_db-20120220 %global rubiks_pkg rubiks-20070912 -%global sagenb_pkg sagenb-0.11.4 -%global sagetex_pkg sagetex-2.3.4 +%global sagenb_pkg sagenb-0.13 +%global sagetex_pkg sagetex-3.0 %global SAGE_ROOT %{_libdir}/sagemath %global SAGE_LOCAL %{SAGE_ROOT}/local @@ -51,8 +58,8 @@ Name: sagemath Group: Applications/Engineering Summary: A free open-source mathematics software system -Version: 6.8 -Release: 14%{?dist} +Version: 7.3 +Release: 1%{?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 @@ -90,85 +97,101 @@ Patch6: %{name}-sagenb.patch # do not attempt to create state files in system directories Patch7: %{name}-readonly.patch -# do not link explicitly to png12 -Patch8: %{name}-png.patch - # work with all maxima-runtime lisp backend packages -Patch9: %{name}-maxima.patch +Patch8: %{name}-maxima.patch # execute 4ti2 programs in $PATH not in $SAGE_ROOT/local/bin -Patch10: %{name}-4ti2.patch +Patch9: %{name}-4ti2.patch # http://trac.sagemath.org/sage_trac/ticket/12992 # http://pari.math.u-bordeaux.fr/cgi-bin/bugreport.cgi?bug=1317 -Patch11: %{name}-pari.patch +Patch10: %{name}-pari.patch # use jmol itself to export preview images # FIXME besides not using X and told so, fails if DISPLAY is not set -Patch12: %{name}-jmol.patch +Patch11: %{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 -Patch13: %{name}-cremona.patch +Patch12: %{name}-cremona.patch # lrslib is a requires -Patch14: %{name}-lrslib.patch +Patch13: %{name}-lrslib.patch # correct path to the nauty geng program # http://cs.anu.edu.au/~bdm/nauty/ # http://pallini.di.uniroma1.it/ -Patch15: %{name}-nauty.patch +Patch14: %{name}-nauty.patch -# Use system gap hap package -Patch16: %{name}-gap-hap.patch +# gap hap package not (yet) available +# http://www-gap.mcs.st-and.ac.uk/Packages/hap.html +Patch15: %{name}-gap-hap.patch # correct path to Lfunction include -Patch17: %{name}-lcalc.patch +Patch16: %{name}-lcalc.patch # avoid assertion in coin backend -Patch18: %{name}-cbc.patch +Patch17: %{name}-cbc.patch # Use system gap directories -Patch19: %{name}-libgap.patch +Patch18: %{name}-libgap.patch # Build fes -Patch20: %{name}-fes-build.patch +Patch19: %{name}-fes-build.patch # Disable fes -Patch21: %{name}-fes.patch +Patch20: %{name}-fes.patch # Side effect of using distro packages # https://bugzilla.redhat.com/show_bug.cgi?id=974769 -Patch22: %{name}-sympy.patch +Patch21: %{name}-sympy.patch # Fix a name clash with NTL -Patch23: %{name}-ntl.patch - -# Fix a changed interface in NTL 9.x -Patch24: %{name}-ntl9.patch +Patch22: %{name}-ntl.patch # Correct unable to start QEPCAD within sage # https://bugzilla.redhat.com/show_bug.cgi?id=1243590 -Patch25: %{name}-qepcad.patch - -# Temporary correction for invalid conversion from -# 'int' to 'polybori::COrderEnums::ordercodes' -Patch26: %{name}-polybori.patch +Patch23: %{name}-qepcad.patch # Correct path to arb headers -Patch27: %{name}-arb.patch +Patch24: %{name}-arb.patch # Adapt to header file changes in givaro 4 and linbox 1.4 -Patch28: %{name}-givaro.patch +Patch25: %{name}-givaro.patch + +# No support for f" notation +Patch26: %{name}-nofstring.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1296652 +Patch27: sig_includes.patch + +# Add missing include paths +Patch28: %{name}-includes.patch + +# https://trac.sagemath.org/ticket/20926 +# #error This file requires compiler and library support for the ISO C++ \ +# 2011 standard. This support must be enabled with the -std=c++11 \ +# or -std=gnu++11 compiler options. +Patch29: %{name}-gcc6.patch + +# Use ipython3 (mostly a rediff from sagemath-6.8 sage/repl) +Patch30: %{name}-ipython3.patch + +# Use atlas blas +Patch31: %{name}-atlas.patch + +# Correct side effect of sagemath-ipython3 patch +Patch32: %{name}-is_in_terminal.patch BuildRequires: 4ti2 BuildRequires: arb-devel BuildRequires: atlas-devel +BuildRequires: brial-devel BuildRequires: cddlib-tools BuildRequires: cliquer-devel BuildRequires: coin-or-Cbc-devel BuildRequires: cryptominisat-devel -BuildRequires: Cython >= 0.21.1 +BuildRequires: Cython BuildRequires: desktop-file-utils BuildRequires: dos2unix BuildRequires: dvipng @@ -178,15 +201,12 @@ BuildRequires: factory-devel %if %{with fes} BuildRequires: fes-devel %endif -BuildRequires: flint-devel >= 2.3 +BuildRequires: flint-devel BuildRequires: gmp-ecm-devel BuildRequires: gap BuildRequires: GAPDoc BuildRequires: gap-libs -BuildRequires: gap-pkg-atlasrep BuildRequires: gap-pkg-ctbllib -BuildRequires: gap-pkg-design -BuildRequires: gap-pkg-hap BuildRequires: gap-pkg-sonata BuildRequires: gap-pkg-tomlib BuildRequires: gc-devel @@ -230,10 +250,13 @@ BuildRequires: python-flask-silk BuildRequires: python-ipython BuildRequires: python-matplotlib BuildRequires: python-networkx +%if %{without bundled_pexpect} +BuildRequires: python-pexpect +%endif +BuildRequires: python-pkgconfig BuildRequires: python-sphinx BuildRequires: python-twisted BuildRequires: python-twisted-web -BuildRequires: polybori-devel BuildRequires: R BuildRequires: ratpoints-devel BuildRequires: readline-devel @@ -259,10 +282,7 @@ Requires: firefox Requires: gap Requires: GAPDoc Requires: gap-libs -Requires: gap-pkg-atlasrep Requires: gap-pkg-ctbllib -Requires: gap-pkg-design -Requires: gap-pkg-hap Requires: gap-pkg-sonata Requires: gap-pkg-tomlib Requires: genus2reduction @@ -273,10 +293,12 @@ Requires: jsmol Requires: jsmath-fonts Requires: lrslib-utils Requires: maxima-gui +Requires: mathjax Requires: maxima-runtime-ecl Requires: nauty Requires: palp Requires: pari-gp +Requires: python-brial Requires: python-crypto Requires: python-cvxopt Requires: python-docutils @@ -287,7 +309,9 @@ Requires: python-flask-silk Requires: python-ipython Requires: python-matplotlib Requires: python-networkx -Requires: python-polybori +%if %{without bundled_pexpect} +Requires: python-pexpect +%endif Requires: python-sphinx Requires: python-twisted Requires: python-twisted-mail @@ -547,6 +571,11 @@ computations, and plots from the Sage mathematics software suite %prep %setup -q -n sage-%{version} +pushd build/pkgs/cysignals + tar jxf ../../../upstream/%{cysignals_pkg}.tar.bz2 + mv %{cysignals_pkg} src +popd + pushd build/pkgs/conway_polynomials tar jxf ../../../upstream/%{conway_polynomials_pkg}.tar.bz2 mv %{conway_polynomials_pkg} src @@ -558,13 +587,8 @@ pushd build/pkgs/elliptic_curves popd pushd build/pkgs/flintqs - tar jxf ../../../upstream/%{flintqs_pkg}.tar.bz2 + tar zxf ../../../upstream/%{flintqs_pkg}.tar.bz2 mv %{flintqs_pkg} src - pushd src - for diff in `ls ../patches/*.patch`; do - patch -p1 < $diff - done - popd popd pushd build/pkgs/graphs @@ -586,8 +610,9 @@ pushd build/pkgs/pari popd %endif +%if %{with bundled_pexpect} pushd build/pkgs/pexpect - tar jxf ../../../upstream/%{pexpect_pkg}.tar.bz2 + tar zxf ../../../upstream/%{pexpect_pkg}.tar.gz mv %{pexpect_pkg} src pushd src for diff in `ls ../patches/*.patch`; do @@ -595,6 +620,7 @@ pushd build/pkgs/pexpect done popd popd +%endif pushd build/pkgs/polytopes_db tar jxf ../../../upstream/%{polytopes_db_pkg}.tar.bz2 @@ -613,15 +639,12 @@ pushd build/pkgs/rubiks popd pushd build/pkgs/sagenb - tar xf ../../../upstream/%{sagenb_pkg}.tar + tar jxf ../../../upstream/%{sagenb_pkg}.tar.bz2 mv %{sagenb_pkg} src - pushd src - tar zxf %{sagenb_pkg}.tar.gz - popd popd pushd build/pkgs/sagetex - tar jxf ../../../upstream/%{sagetex_pkg}.tar.bz2 + tar zxf ../../../upstream/%{sagetex_pkg}.tar.gz mv %{sagetex_pkg} src popd @@ -634,12 +657,12 @@ popd %patch7 %patch8 %patch9 -%patch10 %if %{without bundled_pari} -%patch11 +%patch10 %endif +%patch11 %patch12 %patch13 %patch14 @@ -647,55 +670,51 @@ popd %patch16 %patch17 %patch18 -%patch19 %if %{with fes} -%patch20 +%patch19 %else -%patch21 +%patch20 %endif +%patch21 %patch22 %patch23 %patch24 %patch25 %patch26 -%patch27 + %patch28 +%patch29 +%patch30 +%patch31 sed -e 's|@@SAGE_ROOT@@|%{SAGE_ROOT}|' \ -e 's|@@SAGE_DOC@@|%{SAGE_DOC}|' \ -i src/sage/env.py +sed -e 's|@@CYSIGNALS@@|%{_builddir}%{python_sitearch}/cysignals|' \ + -i src/setup.py + sed -e "s|, 'flask-oldsessions>=0.10'||" \ -e "s|'http://github.com/mitsuhiko/flask-oldsessions/tarball/master#egg=flask-oldsessions-0.10'||" \ - -i build/pkgs/sagenb/src/%{sagenb_pkg}/setup.py + -i build/pkgs/sagenb/src/setup.py #------------------------------------------------------------------------ -# ensure proper/preferred libatlas is in linker path -perl -pi -e 's|^(extra_link_args = ).*|$1\["-L%{_libdir}/atlas"\]|;' src/sage/misc/cython.py -%if 0%{?fedora} > 20 -perl -pi -e "s|return 'atlas'|return 'satlas'|;" src/sage/misc/cython.py -%endif # some .c files are not (re)generated find src/sage \( -name \*.pyx -o -name \*.pxd \) | xargs touch # remove bundled jar files before build -rm build/pkgs/sagenb/src/%{sagenb_pkg}/sagenb/data/sage3d/lib/sage3d.jar +rm build/pkgs/sagenb/src/sagenb/data/sage3d/lib/sage3d.jar # remove binary egg -rm -r build/pkgs/sagenb/src/%{sagenb_pkg}/sagenb.egg-info +rm -r build/pkgs/sagenb/src/sagenb.egg-info # fix Singular paths sed -e "s,SINGULARPATH=\",&%{_libdir}/Singular/LIB:," \ -e "s,\(SINGULAR_EXECUTABLE=\"\).*\",\1%{_libdir}/Singular/Singular\"," \ -i src/bin/sage-env -# fix givaro interface on 32-bit platforms -if [ "%{__isa_bits}" == "32" ]; then - sed -i 's/int64_t/int32_t/' src/sage/libs/singular/singular.pyx -fi - ######################################################################## %build export CC=%{__cc} @@ -755,23 +774,37 @@ sed -i 's|\(^extra_link_args = \[\) \]|\1"-L%{_builddir}/lib"\]|' \ src/setup.py %endif +pushd build/pkgs/cysignals/src + %__python2 setup.py build + %__python2 setup.py install --root %{_builddir} +popd +export PYTHONPATH=%{_builddir}%{python_sitearch}:$PYTHONPATH + +%if %{with cython_hack} + cp -far %{python_sitearch}/Cython %{_builddir}%{python_sitearch} + PATCH=$PWD/build/pkgs/cython/patches/pxi_sys_path.patch + pushd %{_builddir}%{python_sitearch} + patch -p1 < $PATCH + patch -p1 < %{PATCH27} + popd +%endif + # Restore environment used to generate bundled interfaces export PATH=$save_PATH export SAGE_LOCAL=$save_LOCAL -%if 1 pushd src %__python2 -u ./setup.py build popd -%endif #------------------------------------------------------------------------ -pushd build/pkgs/sagenb/src/%{sagenb_pkg} +pushd build/pkgs/sagenb/src %__python2 ./setup.py build popd #------------------------------------------------------------------------ pushd build/pkgs/flintqs/src + %configure make %{?_smp_mflags} CPP="g++ %{optflags} -fPIC" popd @@ -779,7 +812,6 @@ pushd build/pkgs/rubiks/src make %{?_smp_mflags} CC="gcc -fPIC" CXX="g++ -fPIC" CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" popd -%if 1 # Remove buildroot reference from cython comments perl -pi -e 's|%{buildroot}||g;' `find src/build/cythonized -type f` @@ -789,7 +821,6 @@ rm -f `grep -lr "%{buildroot}" src/build/temp.linux-*/` pushd src %__python2 ./setup.py build popd -%endif # last build command rm -fr $DOT_SAGE @@ -828,9 +859,51 @@ ln -sf %{_libdir} $SAGE_LOCAL/lib ln -sf %{_includedir} $SAGE_LOCAL/include ln -sf %{_datadir} $SAGE_LOCAL/share +#------------------------------------------------------------------------ +%if %{with cython_hack} + mkdir -p %{buildroot}%{python_sitearch} + cp -far %{python_sitearch}/Cython %{buildroot}%{python_sitearch} + PATCH=$PWD/build/pkgs/cython/patches/pxi_sys_path.patch + pushd %{buildroot}%{python_sitearch} + patch -p1 < $PATCH + patch -p1 < %{PATCH30} + popd +%endif + +#------------------------------------------------------------------------ +pushd build/pkgs/cysignals/src + pushd docs + %__make html + popd + %__python2 setup.py install --root %{buildroot} + mv %{buildroot}%{_bindir}/cysignals* $SAGE_LOCAL/bin +popd + +#------------------------------------------------------------------------ +pushd src/ext + mkdir -p $SAGE_ETC + for dir in \ + gap \ + graphs \ + images \ + magma \ + mwrank \ + notebook-ipython; do + COUNT=`find $dir -type f | wc -l ` + if [ $COUNT -gt 0 ]; then + cp -far $dir $SAGE_ETC + fi + cp -far pari $SAGE_ETC + done + cp -fa %{SOURCE1} $SAGE_ETC +popd + #------------------------------------------------------------------------ pushd src - %__python2 -u setup.py install --root=%{buildroot} + # FIXME finishes but fails when exiting + # from sage.misc.randstate import current_randstate + # ImportError: No module named randstate + %__python2 -u setup.py install --root=%{buildroot} || : %if %{with docs} # install documentation sources rm -fr $SAGE_DOC/{common,en,fr} @@ -846,7 +919,7 @@ sed -i 's|\(^ include_directories = \[SAGE_INC,\).*|\1|' \ %endif #------------------------------------------------------------------------ -pushd build/pkgs/sagenb/src/%{sagenb_pkg} +pushd build/pkgs/sagenb/src rm -f %{buildroot}%{python_sitearch}/sagenb/data/sage3d/sage3d %__python2 setup.py install --root=%{buildroot} --install-purelib=%{python_sitearch} # jsmol @@ -857,12 +930,16 @@ pushd build/pkgs/sagenb/src/%{sagenb_pkg} ln -sf %{SAGE_LOCAL}/bin/sage3d %{buildroot}%{python_sitearch}/sagenb/data/sage3d/sage3d %endif ln -sf %{python_sitearch}/sagenb %{buildroot}%{SAGE_SRC}/sagenb + # use system mathjax + ln -sf %{_jsdir}/mathjax %{buildroot}%{python_sitearch}/sagenb/data/mathjax popd #------------------------------------------------------------------------ +%if %{with bundled_pexpect} pushd build/pkgs/pexpect/src - cp -fa {ANSI,FSM,pexpect,pxssh,screen}.py $SAGE_PYTHONPATH + cp -fa pexpect $SAGE_PYTHONPATH popd +%endif #------------------------------------------------------------------------ cp -fa COPYING.txt $SAGE_ROOT @@ -883,7 +960,7 @@ install -p -m755 src/bin/sage $SAGE_LOCAL/bin #------------------------------------------------------------------------ pushd build/pkgs/flintqs/src - cp -fa QuadraticSieve $SAGE_LOCAL/bin + cp -fa src/QuadraticSieve $SAGE_LOCAL/bin popd pushd build/pkgs/rubiks/src @@ -959,25 +1036,6 @@ pushd build/pkgs/elliptic_curves %__python2 ./spkg-install popd -#------------------------------------------------------------------------ -pushd src/ext - mkdir -p $SAGE_ETC - for dir in \ - gap \ - graphs \ - images \ - magma \ - mwrank \ - notebook-ipython; do - COUNT=`find $dir -type f | wc -l ` - if [ $COUNT -gt 0 ]; then - cp -far $dir $SAGE_ETC - fi - cp -far pari $SAGE_ETC - done - cp -fa %{SOURCE1} $SAGE_ETC -popd - #------------------------------------------------------------------------ pushd build/pkgs/graphs mkdir -p $SAGE_SHARE/graphs @@ -994,12 +1052,11 @@ popd pushd build/pkgs/sagetex/src %__python2 setup.py install --root=%{buildroot} --install-purelib=%{python_sitearch} install -p -m 0644 -D %{SOURCE2} \ - %{buildroot}%{_datadir}/texmf/tex/generic/sagetex/makecmds.sty - mv %{buildroot}%{_docdir}/{sagetex,%{sagetex_pkg}} - mv %{buildroot}%{_datadir}/texmf/tex/generic/sagetex/CONTRIBUTORS \ - %{buildroot}%{_docdir}/%{sagetex_pkg} + %{buildroot}%{_datadir}/texmf/tex/latex/sagetex/makecmds.sty + mv %{buildroot}%{_datadir}/texmf/tex/latex/sagetex/CONTRIBUTORS \ + %{buildroot}%{_docdir}/sagetex for file in PKG-INFO README; do - install -p -m 0644 $file %{buildroot}%{_docdir}/%{sagetex_pkg}/$file + install -p -m 0644 $file %{buildroot}%{_docdir}/sagetex/$file done popd @@ -1018,6 +1075,7 @@ export SAGE_EXTCODE="$SAGE_ETC" export SAGE_ETC="$SAGE_ETC" export SAGE_SRC="%{buildroot}%{SAGE_SRC}" ##export SAGE_DOC="$SAGE_DOC" +##export SAGE_DOC_SRC="\$SAGE_DOC" module load 4ti2-%{_arch} module load lrcalc-%{_arch} module load surf-geometry-%{_arch} @@ -1064,16 +1122,19 @@ popd %if %{with docs} #------------------------------------------------------------------------ -cp -f $SAGE_PYTHONPATH/{ANSI,FSM,pexpect,pxssh,screen}.py %{buildroot}%{python_sitearch} +%if %{with bundled_pexpect} +cp -fa $SAGE_PYTHONPATH/pexpect %{buildroot}%{python_sitearch} +%endif # Build documentation, using %#{buildroot} environment +export SAGE_SETUP=$PWD/src/sage_setup pushd src/doc export SAGE_DOC=`pwd` export PATH=%{buildroot}%{_bindir}:$SAGE_LOCAL/bin:$PATH export SINGULARPATH=%{_libdir}/Singular/LIB export SINGULAR_BIN_DIR=%{_libdir}/Singular export LD_LIBRARY_PATH=%{_libdir}/atlas:$LD_LIBRARY_PATH - export PYTHONPATH=%{buildroot}%{python_sitearch}:$SAGE_PYTHONPATH:$SAGE_DOC + export PYTHONPATH=$SAGE_SETUP:%{buildroot}%{python_sitearch}:$SAGE_PYTHONPATH:$SAGE_DOC %if %{with sphinx_hack} cp -far %{python_sitelib}/sphinx %{buildroot}%{python_sitearch} @@ -1083,22 +1144,18 @@ pushd src/doc # there we go ln -sf %{buildroot}%{SAGE_DOC} %{buildroot}%{SAGE_SRC}/doc - LANGUAGES="ca de en fr hu it pt ru tr" \ - %__python2 common/builder.py --no-pdf-links -k all html export SAGE_DOC=%{buildroot}%{SAGE_DOC} - cp -far output $SAGE_DOC + export SAGE_DOC_SRC=$SAGE_DOC + # python -m sage_setup.docbuild + # FIXME there is a 'ja' translation, but adding it to $LANGUAGES + # does not get documentation built + LANGUAGES="ca de en fr hu it pt ru tr" \ + %__python2 -m docbuild --no-pdf-links -k all html rm -f %{buildroot}%{SAGE_SRC}/doc ln -sf %{SAGE_DOC} %{buildroot}%{SAGE_SRC}/doc # should not be required and encodes buildroot rm -fr $SAGE_DOC/output/doctrees - - # FIXME missing; but at least some are not. Maybe this can be removed? - for css in $(find $SAGE_DOC/output/html -name classic.css); do - pushd $(dirname $css) - ln -sf classic.css default.css - popd - done popd %if %{with check} @@ -1110,12 +1167,18 @@ install -p -m644 $DOT_SAGE/tmp/test.log $SAGE_DOC/test.log sed -i 's|%{buildroot}||g' $SAGE_DOC/test.log %endif - rm -f %{buildroot}%{python_sitearch}/{ANSI,FSM,pexpect,pxssh,screen}.py{,c} +%if %{with bundled_pexpect} + rm -f %{buildroot}%{python_sitearch}/pexpect +%endif %if %{with sphinx_hack} rm -fr %{buildroot}%{python_sitearch}/sphinx %endif +%if %{with cython_hack} + rm -fr %{buildroot}%{python_sitearch}/Cython +%endif + # More wrong buildroot references perl -pi -e 's|%{buildroot}||g;' \ -e "s|$PWD/src/doc|%{SAGE_DOC}|g;" \ @@ -1139,7 +1202,7 @@ ln -sf %{SAGE_SHARE} $SAGE_ROOT/share ln -sf src $SAGE_ROOT/devel # Install menu and icons -pushd build/pkgs/sagenb/src/%{sagenb_pkg}/sagenb/data +pushd build/pkgs/sagenb/src/sagenb/data install -p -m644 -D sage/images/icon128x128.png %{buildroot}%{_datadir}/pixmaps/%{name}.png popd mkdir -p %{buildroot}%{_datadir}/applications @@ -1176,9 +1239,6 @@ rm -fr %{buildroot}%{SAGE_DOC}/output/inventory find %{buildroot}%{SAGE_DOC} -type d -name _sources | xargs rm -fr %endif -# remove bundles fonts -rm -r %{buildroot}%{python_sitearch}/sagenb/data/mathjax/fonts - # remove .po files rm %{buildroot}%{python_sitearch}/sagenb/translations/*/LC_MESSAGES/*.po @@ -1204,7 +1264,7 @@ install -D -m 644 %{_builddir}/share/pari/pari.desc \ # make sure pari is in link path ln -s libpari-gmp-2.8.so.0.0.0 %{buildroot}%{SAGE_ROOT}/lib/libpari.so -perl -pi -e 's|^(extra_link_args = \[.*)]|$1, "-L%{SAGE_ROOT}/lib"\]|;' %{buildroot}%{python_sitearch}/sage/misc/cython.py +perl -pi -e 's|(libdirs = cblas_library_dirs)|$1 + \["%{SAGE_ROOT}/lib"\]|;' %{buildroot}%{python_sitearch}/sage/misc/cython.py %endif # remove sage_setup @@ -1297,8 +1357,6 @@ exit 0 %endif %{SAGE_SRC}/sage %dir %{SAGE_PYTHONPATH} -# MIT -%{SAGE_PYTHONPATH}/*.py* # GPLv2+ %{_bindir}/sage %{_datadir}/pixmaps/%{name}.png @@ -1312,8 +1370,11 @@ exit 0 #------------------------------------------------------------------------ %files core # GPLv2+ +%{SAGE_LOCAL}/bin/cysignals* %{python_sitearch}/sage %{python_sitearch}/sage-*.egg-info +%{python_sitearch}/cysignals +%{python_sitearch}/cysignals-*.egg-info #------------------------------------------------------------------------ %files data @@ -1337,11 +1398,9 @@ exit 0 %files data-etc # GPLv2+ %{SAGE_ETC}/gap -#%#{SAGE_ETC}/graphs %{SAGE_ETC}/images %{SAGE_ETC}/magma %{SAGE_ETC}/mwrank -#%#{SAGE_ETC}/notebook-ipython %{SAGE_ETC}/pari #------------------------------------------------------------------------ @@ -1361,62 +1420,62 @@ exit 0 # GPLv2+ %dir %{SAGE_DOC} %{SAGE_DOC}/common -%dir %{SAGE_DOC}/output -%dir %{SAGE_DOC}/output/html +%{SAGE_DOC}/output +%dir %{SAGE_DOC}/html #------------------------------------------------------------------------ %files doc-ca # GPLv2+ %{SAGE_DOC}/ca -%{SAGE_DOC}/output/html/ca +%{SAGE_DOC}/html/ca #------------------------------------------------------------------------ %files doc-de # GPLv2+ %{SAGE_DOC}/de -%{SAGE_DOC}/output/html/de +%{SAGE_DOC}/html/de #------------------------------------------------------------------------ %files doc-en # GPLv2+ %{SAGE_DOC}/en -%{SAGE_DOC}/output/html/en +%{SAGE_DOC}/html/en #------------------------------------------------------------------------ %files doc-fr # GPLv2+ %{SAGE_DOC}/fr -%{SAGE_DOC}/output/html/fr +%{SAGE_DOC}/html/fr #------------------------------------------------------------------------ %files doc-hu # GPLv2+ %{SAGE_DOC}/hu -%{SAGE_DOC}/output/html/hu +%{SAGE_DOC}/html/hu #------------------------------------------------------------------------ %files doc-it # GPLv2+ %{SAGE_DOC}/it -%{SAGE_DOC}/output/html/it +%{SAGE_DOC}/html/it #------------------------------------------------------------------------ %files doc-pt # GPLv2+ %{SAGE_DOC}/pt -%{SAGE_DOC}/output/html/pt +%{SAGE_DOC}/html/pt #------------------------------------------------------------------------ %files doc-ru # GPLv2+ %{SAGE_DOC}/ru -%{SAGE_DOC}/output/html/ru +%{SAGE_DOC}/html/ru #------------------------------------------------------------------------ %files doc-tr # GPLv2+ %{SAGE_DOC}/tr -%{SAGE_DOC}/output/html/tr +%{SAGE_DOC}/html/tr # with docs %endif @@ -1443,7 +1502,7 @@ exit 0 %{python_sitearch}/sagenb/data/jqueryui # Public Domain %{python_sitearch}/sagenb/data/json -# ASL 2.0 +# Symbolic link to $_jsdir/mathjax %{python_sitearch}/sagenb/data/mathjax # Empty (do not run doctests flag file) %{python_sitearch}/sagenb/data/nodoctest.py* @@ -1486,6 +1545,7 @@ exit 0 %lang(de_AT) %{python_sitearch}/sagenb/translations/fr_FR %lang(pt_BR) %{python_sitearch}/sagenb/translations/pt_BR %lang(ru_RU) %{python_sitearch}/sagenb/translations/ru_RU +%lang(uk_UA) %{python_sitearch}/sagenb/translations/uk_UA #------------------------------------------------------------------------ %files rubiks @@ -1503,11 +1563,17 @@ exit 0 %files sagetex # GPLv2+ %{python_sitearch}/sagetex* -%{_datadir}/texmf/tex/generic/sagetex -%doc %{_docdir}/%{sagetex_pkg} +%{_datadir}/texmf/tex/latex/sagetex +%doc %{_docdir}/sagetex ######################################################################## %changelog +* Sat Aug 20 2016 pcpa - 7.3-1 +- Update to sagemath 7.3 +- Switch from polybori to brial +- Default to use system pexpect +- Use system mathjax + * Fri Aug 12 2016 Jerry James - 6.8-14 - Rebuild for fflas-ffpack 2.2.2, givaro 4.0.2, and linbox 1.4.2 - GAP packages atlasrep, design, and hap are now available diff --git a/sig_includes.patch b/sig_includes.patch new file mode 100644 index 0000000..8e5056e --- /dev/null +++ b/sig_includes.patch @@ -0,0 +1,66 @@ +Additions to includes + +diff --git a/Cython/Includes/libc/setjmp.pxd b/Cython/Includes/libc/setjmp.pxd +index 74d1c59..f2283fe 100644 +--- a/Cython/Includes/libc/setjmp.pxd ++++ b/Cython/Includes/libc/setjmp.pxd +@@ -3,3 +3,8 @@ cdef extern from "setjmp.h" nogil: + pass + int setjmp(jmp_buf state) + void longjmp(jmp_buf state, int value) ++ ++ ctypedef struct sigjmp_buf: ++ pass ++ int sigsetjmp(sigjmp_buf state, int savesigs) ++ void siglongjmp(sigjmp_buf state, int value) +diff --git a/Cython/Includes/posix/select.pxd b/Cython/Includes/posix/select.pxd +new file mode 100644 +index 0000000..37bc9d3 +--- /dev/null ++++ b/Cython/Includes/posix/select.pxd +@@ -0,0 +1,19 @@ ++from .types cimport sigset_t ++from .time cimport timeval, timespec ++ ++cdef extern from "sys/select.h" nogil: ++ ctypedef struct fd_set: ++ pass ++ ++ int FD_SETSIZE ++ void FD_SET(int, fd_set*) ++ void FD_CLR(int, fd_set*) ++ bint FD_ISSET(int, fd_set*) ++ void FD_ZERO(fd_set*) ++ ++ int select(int nfds, fd_set *readfds, fd_set *writefds, ++ fd_set *exceptfds, const timeval *timeout) ++ ++ int pselect(int nfds, fd_set *readfds, fd_set *writefds, ++ fd_set *exceptfds, const timespec *timeout, ++ const sigset_t *sigmask) +diff --git a/Cython/Includes/posix/signal.pxd b/Cython/Includes/posix/signal.pxd +index 9168b2f..2d6cce8 100644 +--- a/Cython/Includes/posix/signal.pxd ++++ b/Cython/Includes/posix/signal.pxd +@@ -12,7 +12,7 @@ cdef extern from "signal.h" nogil: + int sigev_notify + int sigev_signo + sigval sigev_value +- void *sigev_notify_function(sigval) ++ void sigev_notify_function(sigval) + + ctypedef struct siginfo_t: + int si_signo +@@ -26,10 +26,10 @@ cdef extern from "signal.h" nogil: + sigval si_value + + cdef struct sigaction_t "sigaction": +- void *sa_handler(int) ++ void sa_handler(int) ++ void sa_sigaction(int, siginfo_t *, void *) + sigset_t sa_mask + int sa_flags +- void sa_sigaction(int, siginfo_t *, void *) + + enum: SA_NOCLDSTOP + enum: SIG_BLOCK diff --git a/sources b/sources index f1b16a9..54e40d4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -661f2b2b13669c72d16ea8e6831125e4 sage-6.8.tar.gz +a289e955f9c94be3e4420ee86d8302a7 sage-7.3.tar.gz