Skip to content

Commit

Permalink
sci-mathematics/sage: patches updated. At this stage I don't expect t…
Browse files Browse the repository at this point in the history
…he documentation to build.

Package-Manager: portage-2.2.26
  • Loading branch information
kiwifb committed Feb 8, 2016
1 parent 893b2b4 commit 1058276
Show file tree
Hide file tree
Showing 9 changed files with 880 additions and 42 deletions.
8 changes: 8 additions & 0 deletions sci-mathematics/sage/ChangeLog
Expand Up @@ -2,6 +2,14 @@
# Copyright 1999-2016 Gentoo Foundation; Distributed under the GPL v2
# $Header: $

08 Feb 2016; François Bissey <francois.bissey@canterbury.ac.nz>
+files/sage-7.1-doc_common.patch, +files/sage-7.1-env.patch,
+files/sage-7.1-exec.patch, +files/sage-7.1-linguas.patch,
+files/sage-7.1-sagedoc.patch, +files/sage-7.1-sources.patch,
files/sage-7.1-jupyter.patch, sage-9999.ebuild:
sci-mathematics/sage: patches updated. At this stage I don't expect the
documentation to build.

31 Jan 2016; François Bissey <francois.bissey@canterbury.ac.nz> metadata.xml,
sage-6.10.ebuild, sage-6.9.ebuild, sage-7.0.ebuild, sage-9999.ebuild:
sci-mathematics/sage: change dep from libcliquer to cliquer
Expand Down
17 changes: 17 additions & 0 deletions sci-mathematics/sage/files/sage-7.1-doc_common.patch
@@ -0,0 +1,17 @@
diff -Naur src.orig/sage/doctest/control.py src/sage/doctest/control.py
--- src.orig/sage/doctest/control.py 2016-02-08 22:12:20.089294214 +1300
+++ src/sage/doctest/control.py 2016-02-08 22:13:49.935517660 +1300
@@ -541,11 +541,11 @@
'sagenb'
"""
opj = os.path.join
- from sage.env import SAGE_SRC, SAGE_ROOT
+ from sage.env import SAGE_SRC, SAGE_DOC, SAGE_ROOT
def all_files():
from glob import glob
self.files.append(opj(SAGE_SRC, 'sage'))
- self.files.extend(glob(opj(SAGE_SRC, 'doc', '[a-z][a-z]')))
+ self.files.extend(glob(opj(SAGE_DOC, '[a-z][a-z]')))
self.options.sagenb = True
DOT_GIT= opj(SAGE_ROOT, '.git')
have_git = os.path.exists(DOT_GIT)
47 changes: 47 additions & 0 deletions sci-mathematics/sage/files/sage-7.1-env.patch
@@ -0,0 +1,47 @@
diff -Naur src.orig/sage/env.py src/sage/env.py
--- src.orig/sage/env.py 2016-02-08 21:03:30.802138665 +1300
+++ src/sage/env.py 2016-02-08 21:28:38.713809278 +1300
@@ -87,26 +87,22 @@
_add_variable_or_fallback('LOCAL_IDENTIFIER','$HOSTNAME.%s'%os.getpid())

# bunch of sage directories and files
-_add_variable_or_fallback('SAGE_ROOT', None)
-_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'))
-_add_variable_or_fallback('SAGE_SHARE', opj('$SAGE_LOCAL', 'share'))
+_add_variable_or_fallback('SAGE_ROOT', opj('@GENTOO_PORTAGE_EPREFIX@/usr', 'share', 'sage'))
+_add_variable_or_fallback('SAGE_LOCAL', opj('@GENTOO_PORTAGE_EPREFIX@/usr')
+_add_variable_or_fallback('SAGE_ETC', opj('@GENTOO_PORTAGE_EPREFIX@/etc'))
+_add_variable_or_fallback('SAGE_INC', opj('@GENTOO_PORTAGE_EPREFIX@/usr/include'))
+_add_variable_or_fallback('SAGE_SHARE', opj('$SAGE_LOCAL', 'share', 'sage'))

-_add_variable_or_fallback('SAGE_SRC', opj('$SAGE_ROOT', 'src'))
_add_variable_or_fallback('SITE_PACKAGES', site.getsitepackages())
_add_variable_or_fallback('SAGE_LIB', SITE_PACKAGES[0])
+_add_variable_or_fallback('SAGE_SRC', opj('$SAGE_LIB'))

_add_variable_or_fallback('SAGE_CYTHONIZED', opj('$SAGE_SRC', 'build', 'cythonized'))

-_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_OUTPUT', opj('$SAGE_DOC', 'output'))
+_add_variable_or_fallback('SAGE_EXTCODE', opj('$SAGE_SHARE', 'ext'))
+_add_variable_or_fallback('SAGE_DOC', opj('$SAGE_LOCAL', 'share', 'doc', 'sage'))
+_add_variable_or_fallback('SAGE_DOC_OUTPUT', opj('$SAGE_DOC'))
_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'))

# misc
_add_variable_or_fallback('SAGE_URL', 'http://sage.math.washington.edu/sage/')
@@ -135,7 +131,6 @@
print("permissions to before you start sage.")

# things that need DOT_SAGE
-_add_variable_or_fallback('PYTHON_EGG_CACHE', opj('$DOT_SAGE', '.python-eggs'))
_add_variable_or_fallback('SAGE_STARTUP_FILE', opj('$DOT_SAGE', 'init.sage'))

# delete temporary variables used for setting up sage.env
591 changes: 591 additions & 0 deletions sci-mathematics/sage/files/sage-7.1-exec.patch

Large diffs are not rendered by default.

60 changes: 26 additions & 34 deletions sci-mathematics/sage/files/sage-7.1-jupyter.patch
@@ -1,8 +1,7 @@
diff --git a/bin/sage-notebook b/bin/sage-notebook
index cbe3e56..b13da52 100755
--- a/bin/sage-notebook
+++ b/bin/sage-notebook
@@ -74,7 +74,7 @@ class NotebookJupyter(object):
diff -Naur src.orig/bin/sage-notebook src/bin/sage-notebook
--- src.orig/bin/sage-notebook 2016-02-08 21:53:19.366463272 +1300
+++ src/bin/sage-notebook 2016-02-08 21:53:24.685476412 +1300
@@ -74,7 +74,7 @@
""")

def __init__(self, argv):
Expand All @@ -11,23 +10,20 @@ index cbe3e56..b13da52 100755
if not have_prerequisites():
print(self.PREREQUISITE_ERROR)
raise SystemExit(1)
diff --git a/doc/en/reference/repl/index.rst b/doc/en/reference/repl/index.rst
index 1ddae8b..97fb4bd 100644
--- a/doc/en/reference/repl/index.rst
+++ b/doc/en/reference/repl/index.rst
@@ -94,7 +94,6 @@ Miscellaneous
diff -Naur src.orig/doc/en/reference/repl/index.rst src/doc/en/reference/repl/index.rst
--- src.orig/doc/en/reference/repl/index.rst 2016-02-08 21:53:19.376463296 +1300
+++ src/doc/en/reference/repl/index.rst 2016-02-08 21:53:24.685476412 +1300
@@ -94,7 +94,6 @@
sage/repl/interpreter
sage/repl/ipython_extension
sage/repl/interface_magic
- sage/repl/ipython_kernel/install
sage/repl/ipython_kernel/kernel
sage/repl/ipython_tests

diff --git a/sage/repl/ipython_kernel/install.py b/sage/repl/ipython_kernel/install.py
deleted file mode 100644
index fe8aafb..0000000
--- a/sage/repl/ipython_kernel/install.py
+++ /dev/null
diff -Naur src.orig/sage/repl/ipython_kernel/install.py src/sage/repl/ipython_kernel/install.py
--- src.orig/sage/repl/ipython_kernel/install.py 2016-02-08 21:53:19.470463527 +1300
+++ src/sage/repl/ipython_kernel/install.py 1970-01-01 12:00:00.000000000 +1200
@@ -1,272 +0,0 @@
-"""
-Installing the SageMath Jupyter Kernel and extensions
Expand All @@ -41,7 +37,7 @@ index fe8aafb..0000000
-import errno
-
-from sage.env import (
- SAGE_ROOT, SAGE_DOC, SAGE_LOCAL, SAGE_EXTCODE,
- SAGE_ROOT, SAGE_DOC, SAGE_DOC_OUTPUT, SAGE_LOCAL, SAGE_EXTCODE,
- SAGE_VERSION
-)
-from jupyter_core.paths import ENV_JUPYTER_PATH
Expand Down Expand Up @@ -245,7 +241,7 @@ index fe8aafb..0000000
- os.path.join(self.kernel_dir, filename)
- )
- self.symlink(
- os.path.join(SAGE_DOC, 'output', 'html', 'en'),
- os.path.join(SAGE_DOC_OUTPUT, 'html', 'en'),
- os.path.join(self.kernel_dir, 'doc')
- )
-
Expand Down Expand Up @@ -301,11 +297,10 @@ index fe8aafb..0000000
- import traceback
- traceback.print_exc()
- return False
diff --git a/sage/repl/ipython_kernel/kernel.py b/sage/repl/ipython_kernel/kernel.py
index 9639322..e407cf0 100644
--- a/sage/repl/ipython_kernel/kernel.py
+++ b/sage/repl/ipython_kernel/kernel.py
@@ -95,9 +95,7 @@ class SageKernel(IPythonKernel):
diff -Naur src.orig/sage/repl/ipython_kernel/kernel.py src/sage/repl/ipython_kernel/kernel.py
--- src.orig/sage/repl/ipython_kernel/kernel.py 2016-02-08 21:53:19.470463527 +1300
+++ src/sage/repl/ipython_kernel/kernel.py 2016-02-08 21:53:29.224487632 +1300
@@ -95,9 +95,7 @@
'url': 'kernelspecs/sagemath/doc/index.html'},
...]
"""
Expand All @@ -316,7 +311,7 @@ index 9639322..e407cf0 100644
return [
{
'text': 'Sage Documentation',
@@ -168,3 +166,49 @@ class SageKernel(IPythonKernel):
@@ -168,3 +166,49 @@
def pre_handler_hook(self):
from sage.ext.interrupt.interrupt import init_interrupts
self.saved_sigint_handler = init_interrupts()
Expand Down Expand Up @@ -366,11 +361,9 @@ index 9639322..e407cf0 100644
+ import traceback
+ traceback.print_exc()
+ return False
diff --git a/sage_setup/jupyter/install.py b/sage_setup/jupyter/install.py
new file mode 100644
index 0000000..4a335bd
--- /dev/null
+++ b/sage_setup/jupyter/install.py
diff -Naur src.orig/sage_setup/jupyter/install.py src/sage_setup/jupyter/install.py
--- src.orig/sage_setup/jupyter/install.py 1970-01-01 12:00:00.000000000 +1200
+++ src/sage_setup/jupyter/install.py 2016-02-08 21:53:29.224487632 +1300
@@ -0,0 +1,229 @@
+"""
+Installing the SageMath Jupyter Kernel and extensions
Expand Down Expand Up @@ -601,11 +594,10 @@ index 0000000..4a335bd
+
+ return data_files
+
diff --git a/setup.py b/setup.py
index cf00136..07dc4a9 100755
--- a/setup.py
+++ b/setup.py
@@ -635,19 +635,11 @@ print('Finished cleaning, time: %.2f seconds.' % (time.time() - t))
diff -Naur src.orig/setup.py src/setup.py
--- src.orig/setup.py 2016-02-08 21:53:19.499463598 +1300
+++ src/setup.py 2016-02-08 21:53:29.225487635 +1300
@@ -635,19 +635,11 @@


#########################################################
Expand All @@ -628,7 +620,7 @@ index cf00136..07dc4a9 100755


#########################################################
@@ -664,5 +656,5 @@ code = setup(name = 'sage',
@@ -664,5 +656,5 @@
packages = python_packages,
data_files = python_data_files,
scripts = [],
Expand Down
26 changes: 26 additions & 0 deletions sci-mathematics/sage/files/sage-7.1-linguas.patch
@@ -0,0 +1,26 @@
diff -Naur src.orig/sage_setup/docbuild/build_options.py src/sage_setup/docbuild/build_options.py
--- src.orig/sage_setup/docbuild/build_options.py 2016-02-08 22:32:28.710300114 +1300
+++ src/sage_setup/docbuild/build_options.py 2016-02-08 22:35:04.805687370 +1300
@@ -4,9 +4,20 @@

import os, re

-from sage.env import SAGE_DOC, SAGE_DOC_OUTPUT
+from sage.env import SAGE_DOC
+
+LANGUAGESLIST = [d for d in os.listdir(SAGE_DOC) if re.match('^[a-z][a-z]$', d)]
+try:
+ DESIRED_LANGUAGES = list(set((os.environ['LANGUAGES']).split()))
+except KeyError:
+ DESIRED_LANGUAGES = LANGUAGELIST
+LANGUAGES = []
+for d in DESIRED_LANGUAGES:
+ if d in LANGUAGELIST:
+ LANGUAGES.append(d)
+if not LANGUAGES:
+ LANGUAGES=LANGUAGELIST

-LANGUAGES = [d for d in os.listdir(SAGE_DOC) if re.match('^[a-z][a-z]$', d)]
SPHINXOPTS = ""
PAPER = ""
OMIT = ["introspect"] # docs/dirs to omit when listing and building 'all'
80 changes: 80 additions & 0 deletions sci-mathematics/sage/files/sage-7.1-sagedoc.patch
@@ -0,0 +1,80 @@
diff -Naur src.orig/sage/misc/sagedoc.py src/sage/misc/sagedoc.py
--- src.orig/sage/misc/sagedoc.py 2016-02-08 22:17:58.966137012 +1300
+++ src/sage/misc/sagedoc.py 2016-02-08 22:28:43.595740239 +1300
@@ -18,8 +18,8 @@
Check that argspecs of extension function/methods appear correctly,
see :trac:`12849`::

- sage: from sage.env import SAGE_DOC_OUTPUT
- sage: docfilename = os.path.join(SAGE_DOC_OUTPUT, 'html', 'en', 'reference', 'calculus', 'sage', 'symbolic', 'expression.html')
+ sage: from sage.env import SAGE_DOC
+ sage: docfilename = os.path.join(SAGE_DOC, 'html', 'en', 'reference', 'calculus', 'sage', 'symbolic', 'expression.html')
sage: for line in open(docfilename):
....: if "#sage.symbolic.expression.Expression.N" in line:
....: print line
@@ -40,7 +40,7 @@
from sage.misc.viewer import browser
from sage.misc.temporary_file import tmp_dir
import sage.version
-from sage.env import SAGE_DOC, SAGE_DOC_OUTPUT, SAGE_SRC
+from sage.env import SAGE_DOC, SAGE_DOC, SAGE_SRC

# The detex function does two kinds of substitutions: math, which
# should only be done on the command line -- in the notebook, these
@@ -800,7 +800,7 @@
module = ''
exts = ['html']
title = 'Documentation'
- base_path = SAGE_DOC_OUTPUT
+ base_path = SAGE_DOC
doc_path = SAGE_DOC

from sage_setup.docbuild.build_options import LANGUAGES, OMIT
@@ -819,9 +819,9 @@
# Check to see if any documents are missing. This just
# checks to see if the appropriate output directory exists,
# not that it contains a complete build of the docs.
- missing = [os.path.join(SAGE_DOC_OUTPUT, 'html', doc)
+ missing = [os.path.join(SAGE_DOC, 'html', doc)
for doc in documents if not
- os.path.exists(os.path.join(SAGE_DOC_OUTPUT, 'html', doc))]
+ os.path.exists(os.path.join(SAGE_DOC, 'html', doc))]
num_missing = len(missing)
if num_missing > 0:
print("""Warning, the following Sage documentation hasn't been built,
@@ -1102,7 +1102,7 @@
search is case-insensitive by default.

The file paths in the output are relative to
- ``$SAGE_DOC_OUTPUT``.
+ ``$SAGE_DOC``.

INPUT: same as for :func:`search_src`.

@@ -1309,7 +1309,7 @@
'http://localhost:8000/doc/live/'
"""
self._base_url = "http://localhost:8000/doc/live/"
- self._base_path = os.path.join(SAGE_DOC_OUTPUT, "html", "en")
+ self._base_path = os.path.join(SAGE_DOC, "html", "en")

def __call__(self, obj, output='html', view=True):
r"""
@@ -1376,7 +1376,7 @@
path = os.path.join(tmp_dir(), "temp.html")
filed = open(path, 'w')

- static_path = os.path.join(SAGE_DOC_OUTPUT, "html", "en", "_static")
+ static_path = os.path.join(SAGE_DOC, "html", "en", "_static")
if os.path.exists(static_path):
title = obj_name + ' - Sage ' + sage.version.version + ' Documentation'
template = """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
@@ -1463,7 +1463,7 @@
sage: browse_sage_doc._open("reference", testing=True)[0]
'http://localhost:8000/doc/live/reference/index.html'
sage: browse_sage_doc._open("tutorial", testing=True)[1]
- '...doc/output/html/en/tutorial/index.html'
+ '.../html/en/tutorial/index.html'
"""
url = self._base_url + os.path.join(name, "index.html")
path = os.path.join(self._base_path, name, "index.html")
77 changes: 77 additions & 0 deletions sci-mathematics/sage/files/sage-7.1-sources.patch
@@ -0,0 +1,77 @@
diff -Naur src.orig/sage/doctest/control.py src/sage/doctest/control.py
--- src.orig/sage/doctest/control.py 2016-02-05 12:56:01.335192754 +1300
+++ src/sage/doctest/control.py 2016-02-05 12:57:01.572345296 +1300
@@ -545,7 +545,6 @@
def all_files():
from glob import glob
self.files.append(opj(SAGE_SRC, 'sage'))
- self.files.append(opj(SAGE_SRC, 'sage_setup'))
self.files.extend(glob(opj(SAGE_SRC, 'doc', '[a-z][a-z]')))
self.options.sagenb = True
DOT_GIT= opj(SAGE_ROOT, '.git')
diff -Naur src.orig/sage/doctest/sources.py src/sage/doctest/sources.py
--- src.orig/sage/doctest/sources.py 2016-02-05 12:56:01.335192754 +1300
+++ src/sage/doctest/sources.py 2016-02-05 12:56:37.285283793 +1300
@@ -27,7 +27,7 @@
from parsing import SageDocTestParser
from util import NestedName
from sage.structure.dynamic_class import dynamic_class
-from sage.env import SAGE_SRC, SAGE_LOCAL
+from sage.env import SAGE_SRC, SAGE_LOCAL, SAGE_LIB

# Python file parsing
triple_quotes = re.compile("\s*[rRuU]*((''')|(\"\"\"))")
@@ -80,7 +80,7 @@
# If the file is in the sage library, we can use our knowledge of
# the directory structure
dev = SAGE_SRC
- sp = os.path.join(SAGE_LOCAL, 'lib', 'python', 'site-packages')
+ sp = SAGE_LIB
if path.startswith(dev):
# there will be a branch name
i = path.find(os.path.sep, len(dev))
diff -Naur src.orig/sage_setup/find.py src/sage_setup/find.py
--- src.orig/sage_setup/find.py 2016-02-05 12:56:01.419192966 +1300
+++ src/sage_setup/find.py 2016-02-05 12:56:37.285283793 +1300
@@ -116,7 +116,7 @@
cydir = os.path.join(cythonized_dir, dir)

files = [os.path.join(sdir, f) for f in os.listdir(sdir)
- if f.endswith((".pxd", ".pxi")) or f in special_filenames]
+ if f.endswith((".pxd", ".pxi", ".pyx", ".rst")) or f in special_filenames]
if os.path.isdir(cydir): # Not every directory contains Cython files
files += [os.path.join(cydir, f) for f in os.listdir(cydir)
if f.endswith(".h")]
diff -Naur src.orig/setup.py src/setup.py
--- src.orig/setup.py 2016-02-05 12:56:01.419192966 +1300
+++ src/setup.py 2016-02-05 12:56:37.285283793 +1300
@@ -613,28 +613,13 @@
t = time.time()
from sage_setup.find import find_python_sources, find_extra_files
python_packages, python_modules = find_python_sources(
- SAGE_SRC, ['sage', 'sage_setup'])
+ SAGE_SRC, ['sage'])
python_data_files = find_extra_files(python_packages,
".", SAGE_CYTHONIZED, SAGE_LIB, ["ntlwrap.cpp"])
print("Discovered Python/Cython sources, time: %.2f seconds." % (time.time() - t))


#########################################################
-### Clean
-#########################################################
-
-print('Cleaning up stale installed files....')
-t = time.time()
-from sage_setup.clean import clean_install_dir
-output_dirs = SITE_PACKAGES + glob.glob(os.path.join(SAGE_SRC, 'build', 'lib*'))
-for output_dir in output_dirs:
- print('- cleaning {0}'.format(output_dir))
- clean_install_dir(output_dir, python_packages, python_modules,
- ext_modules, python_data_files)
-print('Finished cleaning, time: %.2f seconds.' % (time.time() - t))
-
-
-#########################################################
### Install also Jupyter kernel spec
#########################################################

0 comments on commit 1058276

Please sign in to comment.