From 52b9217b50379007c9de158d314e4d96134746f9 Mon Sep 17 00:00:00 2001 From: Timo Kaufmann Date: Thu, 16 Aug 2018 00:17:14 +0200 Subject: [PATCH] sage: 8.4.beta0 -> 8.4.beta1 --- .../math/sage/patches/dochtml-optional.patch | 127 ------------------ .../math/sage/patches/eclib-20180710.patch | 24 ---- .../math/sage/patches/pari-no-threads.patch | 18 --- .../math/sage/patches/test-in-tmpdir.patch | 31 ----- .../science/math/sage/sage-src.nix | 36 +---- 5 files changed, 2 insertions(+), 234 deletions(-) delete mode 100644 pkgs/applications/science/math/sage/patches/dochtml-optional.patch delete mode 100644 pkgs/applications/science/math/sage/patches/pari-no-threads.patch delete mode 100644 pkgs/applications/science/math/sage/patches/test-in-tmpdir.patch diff --git a/pkgs/applications/science/math/sage/patches/dochtml-optional.patch b/pkgs/applications/science/math/sage/patches/dochtml-optional.patch deleted file mode 100644 index a51e30312ed9..000000000000 --- a/pkgs/applications/science/math/sage/patches/dochtml-optional.patch +++ /dev/null @@ -1,127 +0,0 @@ -diff --git a/src/doc/common/conf.py b/src/doc/common/conf.py -index 25f94f7b7d..9f6139ea4a 100644 ---- a/src/doc/common/conf.py -+++ b/src/doc/common/conf.py -@@ -622,9 +622,9 @@ def call_intersphinx(app, env, node, contnode): - Check that the link from the thematic tutorials to the reference - manual is relative, see :trac:`20118`:: - -- sage: from sage.env import SAGE_DOC -- sage: thematic_index = os.path.join(SAGE_DOC, "html", "en", "thematic_tutorials", "index.html") -- sage: for line in open(thematic_index).readlines(): -+ sage: from sage.env import SAGE_DOC # optional - dochtml -+ sage: thematic_index = os.path.join(SAGE_DOC, "html", "en", "thematic_tutorials", "index.html") # optional - dochtml -+ sage: for line in open(thematic_index).readlines(): # optional - dochtml - ....: if "padics" in line: - ....: sys.stdout.write(line) -
  • Introduction to the -adics
  • -diff --git a/src/sage/doctest/control.py b/src/sage/doctest/control.py -index 4236fd05e0..8e499cbaf7 100644 ---- a/src/sage/doctest/control.py -+++ b/src/sage/doctest/control.py -@@ -87,7 +87,7 @@ class DocTestDefaults(SageObject): - self.sagenb = False - self.long = False - self.warn_long = None -- self.optional = set(['sage']) | auto_optional_tags -+ self.optional = set(['sage', 'dochtml']) | auto_optional_tags - self.randorder = None - self.global_iterations = 1 # sage-runtests default is 0 - self.file_iterations = 1 # sage-runtests default is 0 -@@ -343,7 +343,8 @@ class DocTestController(SageObject): - if not optionaltag_regex.search(o): - raise ValueError('invalid optional tag {!r}'.format(o)) - -- options.optional |= auto_optional_tags -+ if "sage" in options.optional: -+ options.optional |= auto_optional_tags - - self.options = options - self.files = args -@@ -741,7 +742,7 @@ class DocTestController(SageObject): - sage: DC = DocTestController(DD, [dirname]) - sage: DC.expand_files_into_sources() - sage: sorted(DC.sources[0].options.optional) # abs tol 1 -- ['guava', 'magma', 'py3'] -+ ['guava', 'magma'] - - We check that files are skipped appropriately:: - -@@ -968,7 +969,7 @@ class DocTestController(SageObject): - sage: from sage.doctest.control import DocTestDefaults, DocTestController - sage: DC = DocTestController(DocTestDefaults(), []) - sage: DC._optional_tags_string() -- 'sage' -+ 'dochtml,sage' - sage: DC = DocTestController(DocTestDefaults(optional="all,and,some,more"), []) - sage: DC._optional_tags_string() - 'all' -diff --git a/src/sage/misc/sagedoc.py b/src/sage/misc/sagedoc.py -index 9255aa848f..cc4712d3ec 100644 ---- a/src/sage/misc/sagedoc.py -+++ b/src/sage/misc/sagedoc.py -@@ -18,9 +18,9 @@ TESTS: - Check that argspecs of extension function/methods appear correctly, - see :trac:`12849`:: - -- sage: from sage.env import SAGE_DOC -- sage: docfilename = os.path.join(SAGE_DOC, 'html', 'en', 'reference', 'calculus', 'sage', 'symbolic', 'expression.html') -- sage: with open(docfilename) as fobj: -+ sage: from sage.env import SAGE_DOC # optional - dochtml -+ sage: docfilename = os.path.join(SAGE_DOC, 'html', 'en', 'reference', 'calculus', 'sage', 'symbolic', 'expression.html') # optional - dochtml -+ sage: with open(docfilename) as fobj: # optional - dochtml - ....: for line in fobj: - ....: if "#sage.symbolic.expression.Expression.numerical_approx" in line: - ....: print(line) -@@ -790,11 +790,12 @@ def _search_src_or_doc(what, string, extra1='', extra2='', extra3='', - - :: - -- sage: len(_search_src_or_doc('src', r'matrix\(', 'incidence_structures', 'self', 'combinat', interact=False).splitlines()) > 1 -+ sage: from sage.misc.sagedoc import _search_src_or_doc # optional - dochtml -+ sage: len(_search_src_or_doc('src', r'matrix\(', 'incidence_structures', 'self', 'combinat', interact=False).splitlines()) > 1 # optional - dochtml - True -- sage: 'abvar/homology' in _search_src_or_doc('doc', 'homology', 'variety', interact=False) # long time (4s on sage.math, 2012) -+ sage: 'abvar/homology' in _search_src_or_doc('doc', 'homology', 'variety', interact=False) # optional - dochtml, long time (4s on sage.math, 2012) - True -- sage: 'divisors' in _search_src_or_doc('src', '^ *def prime', interact=False) -+ sage: 'divisors' in _search_src_or_doc('src', '^ *def prime', interact=False) # optional - dochtml - True - """ - # process keywords -@@ -1160,9 +1161,9 @@ def search_doc(string, extra1='', extra2='', extra3='', extra4='', - counting the length of ``search_doc('tree', - interact=False).splitlines()`` gives the number of matches. :: - -- sage: len(search_doc('tree', interact=False).splitlines()) > 4000 # long time -+ sage: len(search_doc('tree', interact=False).splitlines()) > 4000 # optional - dochtml, long time - True -- sage: len(search_doc('tree', whole_word=True, interact=False).splitlines()) < 2000 # long time -+ sage: len(search_doc('tree', whole_word=True, interact=False).splitlines()) < 2000 # optional - dochtml, long time - True - """ - return _search_src_or_doc('doc', string, extra1=extra1, extra2=extra2, -@@ -1332,9 +1333,9 @@ class _sage_doc: - - EXAMPLES:: - -- sage: browse_sage_doc._open("reference", testing=True)[0] # indirect doctest -+ sage: browse_sage_doc._open("reference", testing=True)[0] # optional - dochtml, indirect doctest - 'http://localhost:8000/doc/live/reference/index.html' -- sage: browse_sage_doc(identity_matrix, 'rst')[-107:-47] -+ sage: browse_sage_doc(identity_matrix, 'rst')[-107:-47] # optional - dochtml - 'Full MatrixSpace of 3 by 3 sparse matrices over Integer Ring' - """ - def __init__(self): -@@ -1494,9 +1495,9 @@ class _sage_doc: - - EXAMPLES:: - -- sage: browse_sage_doc._open("reference", testing=True)[0] -+ sage: browse_sage_doc._open("reference", testing=True)[0] # optional - dochtml - 'http://localhost:8000/doc/live/reference/index.html' -- sage: browse_sage_doc._open("tutorial", testing=True)[1] -+ sage: browse_sage_doc._open("tutorial", testing=True)[1] # optional - dochtml - '.../html/en/tutorial/index.html' - """ - url = self._base_url + os.path.join(name, "index.html") diff --git a/pkgs/applications/science/math/sage/patches/eclib-20180710.patch b/pkgs/applications/science/math/sage/patches/eclib-20180710.patch index d06e1e6cedf2..986ae42aeb62 100644 --- a/pkgs/applications/science/math/sage/patches/eclib-20180710.patch +++ b/pkgs/applications/science/math/sage/patches/eclib-20180710.patch @@ -14,27 +14,3 @@ index 4417b59276..ae57ca2991 100644 """ global instances try: -diff --git a/src/sage/libs/eclib/wrap.cpp b/src/sage/libs/eclib/wrap.cpp -index 5fd5693b53..d12468faa8 100644 ---- a/src/sage/libs/eclib/wrap.cpp -+++ b/src/sage/libs/eclib/wrap.cpp -@@ -133,8 +133,8 @@ char* Curvedata_isogeny_class(struct Curvedata* E, int verbose) - - - int mw_process(struct Curvedata* curve, struct mw* m, -- const struct bigint* x, const struct bigint* y, -- const struct bigint* z, int sat) -+ const bigint* x, const bigint* y, -+ const bigint* z, int sat) - { - Point P(*curve, *x, *y, *z); - if (!P.isvalid()) -@@ -188,7 +188,7 @@ int mw_rank(struct mw* m) - } - - /* Returns index and unsat long array, which user must deallocate */ --int mw_saturate(struct mw* m, struct bigint* index, char** unsat, -+int mw_saturate(struct mw* m, bigint* index, char** unsat, - long sat_bd, int odd_primes_only) - { - vector v; diff --git a/pkgs/applications/science/math/sage/patches/pari-no-threads.patch b/pkgs/applications/science/math/sage/patches/pari-no-threads.patch deleted file mode 100644 index 13b47dbdd31b..000000000000 --- a/pkgs/applications/science/math/sage/patches/pari-no-threads.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/src/sage/libs/pari/__init__.py b/src/sage/libs/pari/__init__.py -index e451766474..77eda66097 100644 ---- a/src/sage/libs/pari/__init__.py -+++ b/src/sage/libs/pari/__init__.py -@@ -205,6 +205,13 @@ def _get_pari_instance(): - # messages in Sage. - P.default("debugmem", 0) - -+ # Make sure pari doesn't use threads, regardless of how it was compiled. -+ # Threads cause some doctest failures (memory issues). Those could probably -+ # be solved without disabling threads. But that would require figuring out -+ # some sensible values for `threadsizemax`. See -+ # https://pari.math.u-bordeaux.fr/dochtml/html/GP_defaults.html -+ P.default("nbthreads", 1) -+ - return P - - pari = _get_pari_instance() diff --git a/pkgs/applications/science/math/sage/patches/test-in-tmpdir.patch b/pkgs/applications/science/math/sage/patches/test-in-tmpdir.patch deleted file mode 100644 index febab3702771..000000000000 --- a/pkgs/applications/science/math/sage/patches/test-in-tmpdir.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/src/sage/repl/ipython_kernel/install.py b/src/sage/repl/ipython_kernel/install.py -index aa23c8405d..8a87de0591 100644 ---- a/src/sage/repl/ipython_kernel/install.py -+++ b/src/sage/repl/ipython_kernel/install.py -@@ -112,7 +112,7 @@ class SageKernelSpec(object): - EXAMPLES:: - - sage: from sage.repl.ipython_kernel.install import SageKernelSpec -- sage: spec = SageKernelSpec() -+ sage: spec = SageKernelSpec(prefix = tmp_dir()) - sage: spec.use_local_mathjax() - sage: mathjax = os.path.join(spec.nbextensions_dir, 'mathjax') - sage: os.path.isdir(mathjax) -@@ -129,7 +129,7 @@ class SageKernelSpec(object): - EXAMPLES:: - - sage: from sage.repl.ipython_kernel.install import SageKernelSpec -- sage: spec = SageKernelSpec() -+ sage: spec = SageKernelSpec(prefix = tmp_dir()) - sage: spec.use_local_jsmol() - sage: jsmol = os.path.join(spec.nbextensions_dir, 'jsmol') - sage: os.path.isdir(jsmol) -@@ -146,7 +146,7 @@ class SageKernelSpec(object): - EXAMPLES:: - - sage: from sage.repl.ipython_kernel.install import SageKernelSpec -- sage: spec = SageKernelSpec() -+ sage: spec = SageKernelSpec(prefix = tmp_dir()) - sage: spec.use_local_threejs() - sage: threejs = os.path.join(spec.nbextensions_dir, 'threejs') - sage: os.path.isdir(threejs) diff --git a/pkgs/applications/science/math/sage/sage-src.nix b/pkgs/applications/science/math/sage/sage-src.nix index 3dd62817bde7..43360f76da69 100644 --- a/pkgs/applications/science/math/sage/sage-src.nix +++ b/pkgs/applications/science/math/sage/sage-src.nix @@ -3,20 +3,17 @@ , fetchpatch }: stdenv.mkDerivation rec { - version = "8.4.beta0"; + version = "8.4.beta1"; name = "sage-src-${version}"; src = fetchFromGitHub { owner = "sagemath"; repo = "sage"; rev = version; - sha256 = "1jph4slscpni0smp2fxs3s12282c9r3mdfbgxpyx67gic0d9iya8"; + sha256 = "0yk5ndjr1kap7vhd2i6i5bpcfgmr4fhypn6x7myiymiy9s93d37j"; }; nixPatches = [ - # https://trac.sagemath.org/ticket/25722 - ./patches/test-in-tmpdir.patch - # https://trac.sagemath.org/ticket/25358 (fetchpatch { name = "safe-directory-test-without-patch.patch"; @@ -30,21 +27,6 @@ stdenv.mkDerivation rec { # https://trac.sagemath.org/ticket/25316 # https://github.com/python/cpython/pull/7476 ./patches/python-5755-hotpatch.patch - - # https://trac.sagemath.org/ticket/25315 - (fetchpatch { - name = "find-libraries-in-dyld-library-path.patch"; - url = "https://git.sagemath.org/sage.git/patch/?h=20d4593876ce9c6004eac2ab6fd61786d0d96a06"; - sha256 = "1k3afq3qlzmgqwx6rzs5wv153vv9dsf5rk8pi61g57l3r3npbjmc"; - }) - - # https://trac.sagemath.org/ticket/25345 - # (upstream patch doesn't apply on 8.2 source) - ./patches/dochtml-optional.patch - - # work with pari with threads enabled at compile time (disable them at runtime) - # https://trac.sagemath.org/ticket/26002 - ./patches/pari-no-threads.patch ]; packageUpgradePatches = [ @@ -96,20 +78,6 @@ stdenv.mkDerivation rec { url = "https://git.archlinux.org/svntogit/community.git/plain/trunk/sagemath-lcalc-c++11.patch?h=packages/sagemath&id=0e31ae526ab7c6b5c0bfacb3f8b1c4fd490035aa"; sha256 = "0p5wnvbx65i7cp0bjyaqgp4rly8xgnk12pqwaq3dqby0j2bk6ijb"; }) - - # cddlib 0.94i -> 0.94j - (fetchpatch { - name = "cddlib-0.94j.patch"; - url = "https://git.sagemath.org/sage.git/patch/?id=2ab1546b3e21d1d0ab3b4fcd58576848b3a2d888"; - sha256 = "1c5gnasq7y9xxj762bn79bis0zi8d9bgg7jzlf64ifixsrc5cymb"; - }) - - # arb 2.13.0 -> 2.14.0 - (fetchpatch { - name = "arb-2.14.0.patch"; - url = "https://git.sagemath.org/sage.git/patch?id2=8.4.beta0&id=8bef4fd2876a61969b516fe4eb3b8ad7cc076c5e"; - sha256 = "00p3hfsfn3w2vxgd9fjd23mz7xfxjfravf8ysjxkyd657jbkpjmk"; - }) ]; patches = nixPatches ++ packageUpgradePatches ++ [