[arch-commits] Commit in sagemath-doc/repos/community-any (7 files)

Antonio Rojas arojas at archlinux.org
Wed Dec 5 17:21:20 UTC 2018


    Date: Wednesday, December 5, 2018 @ 17:21:20
  Author: arojas
Revision: 411566

archrelease: copy trunk to community-any

Added:
  sagemath-doc/repos/community-any/PKGBUILD
    (from rev 411565, sagemath-doc/trunk/PKGBUILD)
  sagemath-doc/repos/community-any/docbuild_main.patch
    (from rev 411565, sagemath-doc/trunk/docbuild_main.patch)
  sagemath-doc/repos/community-any/sagemath-doc-segfault.patch
    (from rev 411565, sagemath-doc/trunk/sagemath-doc-segfault.patch)
  sagemath-doc/repos/community-any/sagemath-doc-sphinx-1.8.patch
    (from rev 411565, sagemath-doc/trunk/sagemath-doc-sphinx-1.8.patch)
Deleted:
  sagemath-doc/repos/community-any/PKGBUILD
  sagemath-doc/repos/community-any/docbuild_main.patch
  sagemath-doc/repos/community-any/sagemath-doc-sphinx-1.8.patch

-------------------------------+
 PKGBUILD                      |  124 ++++++++++++++++++++--------------------
 docbuild_main.patch           |   12 +--
 sagemath-doc-segfault.patch   |   63 ++++++++++++++++++++
 sagemath-doc-sphinx-1.8.patch |   32 +++++-----
 4 files changed, 147 insertions(+), 84 deletions(-)

Deleted: PKGBUILD
===================================================================
--- PKGBUILD	2018-12-05 17:06:28 UTC (rev 411565)
+++ PKGBUILD	2018-12-05 17:21:20 UTC (rev 411566)
@@ -1,62 +0,0 @@
-# Maintainer: Antonio Rojas <arojas at archlinux.org>
-
-pkgname=sagemath-doc
-pkgver=8.4
-pkgrel=1
-pkgdesc="HTML documentation and inline help for SageMath"
-arch=(any)
-url="http://www.sagemath.org"
-license=(GPL)
-depends=(python2-sphinx gap-4.8-doc thebe)
-makedepends=(sage-notebook python2-pyzmq python2-docutils python2-jupyter_client python2-pkgconfig cython2 python2-ipywidgets)
-source=("$pkgname-$pkgver.tar.gz::https://github.com/sagemath/sage/archive/$pkgver.tar.gz"
-        docbuild_main.patch sagemath-doc-sphinx-1.8.patch sagemath-doc-segfault.patch)
-sha256sums=('961a21f60d251531db4b9935cfb6f67f7a207e1029288b4dc5b807f021078ab0'
-            'ea5e17bb7a7cb36a22e5e3872fcc2585852bc971c4b139b0b2cd69a36c1b009b'
-            'f2488c508c3322ad1bdedd56913adbcb4ab964531be95d12a86abb723b9fd25e'
-            '141ac064305526785fb6d9507896876cbf893cd41ec1e42d86fc836f766c200f')
-
-prepare() {
-  cd sage-$pkgver
-
-# fix relative imports
-  patch -p0 -i ../docbuild_main.patch
-# use sage_setup imports from sagemath source, but use system sage ones (which include compiled modules)
-  mkdir -p local-python
-  ln -sr src/sage_setup local-python
-# fix build with sphinx 1.8
-  patch -p1 -i ../sagemath-doc-sphinx-1.8.patch
-# Partially revert https://trac.sagemath.org/ticket/24655 to workaround a segfault
-  patch -Rp1 -i ../sagemath-doc-segfault.patch
-}
-
-build() {
-  cd sage-$pkgver/src
-
-  export SAGE_LOCAL="/usr"
-  export SAGE_ROOT="/usr"
-  export SAGE_SRC="$PWD"
-  export SAGE_DOC_SRC="$SAGE_SRC"/doc
-  export SAGE_DOC="$SAGE_DOC_SRC"
-  export SAGE_DOC_MATHJAX=yes
-  export PYTHONPATH="$srcdir"/sage-$pkgver/local-python
-  python2 sage_setup/docbuild --no-pdf-links -k all html
-}
-
-package() {
-  cd sage-$pkgver/src/doc
- 
-  mkdir -p "$pkgdir"/usr/share/doc/sage/en
-  cp -r en/introspect "$pkgdir"/usr/share/doc/sage/en
-  cp -r common "$pkgdir"/usr/share/doc/sage
-  cp -r html "$pkgdir"/usr/share/doc/sage
-
-# Replace duplicated files by symlinks (Gentoo)
-  cd "$pkgdir"/usr/share/doc/sage
-  mv html/en/_static{,.tmp}
-  for _dir in `find -name _static` ; do
-        rm -r $_dir
-        ln -s /usr/share/doc/sage/html/en/_static $_dir
-  done
-  mv html/en/_static{.tmp,}
-}

Copied: sagemath-doc/repos/community-any/PKGBUILD (from rev 411565, sagemath-doc/trunk/PKGBUILD)
===================================================================
--- PKGBUILD	                        (rev 0)
+++ PKGBUILD	2018-12-05 17:21:20 UTC (rev 411566)
@@ -0,0 +1,62 @@
+# Maintainer: Antonio Rojas <arojas at archlinux.org>
+
+pkgname=sagemath-doc
+pkgver=8.4
+pkgrel=1
+pkgdesc="HTML documentation and inline help for SageMath"
+arch=(any)
+url="http://www.sagemath.org"
+license=(GPL)
+depends=(python2-sphinx gap-4.8-doc thebe)
+makedepends=(sage-notebook python2-pyzmq python2-docutils python2-jupyter_client python2-pkgconfig cython2 python2-ipywidgets)
+source=("$pkgname-$pkgver.tar.gz::https://github.com/sagemath/sage/archive/$pkgver.tar.gz"
+        docbuild_main.patch sagemath-doc-sphinx-1.8.patch sagemath-doc-segfault.patch)
+sha256sums=('961a21f60d251531db4b9935cfb6f67f7a207e1029288b4dc5b807f021078ab0'
+            'ea5e17bb7a7cb36a22e5e3872fcc2585852bc971c4b139b0b2cd69a36c1b009b'
+            'f2488c508c3322ad1bdedd56913adbcb4ab964531be95d12a86abb723b9fd25e'
+            '141ac064305526785fb6d9507896876cbf893cd41ec1e42d86fc836f766c200f')
+
+prepare() {
+  cd sage-$pkgver
+
+# fix relative imports
+  patch -p0 -i ../docbuild_main.patch
+# use sage_setup imports from sagemath source, but use system sage ones (which include compiled modules)
+  mkdir -p local-python
+  ln -sr src/sage_setup local-python
+# fix build with sphinx 1.8
+  patch -p1 -i ../sagemath-doc-sphinx-1.8.patch
+# Partially revert https://trac.sagemath.org/ticket/24655 to workaround a segfault
+  patch -Rp1 -i ../sagemath-doc-segfault.patch
+}
+
+build() {
+  cd sage-$pkgver/src
+
+  export SAGE_LOCAL="/usr"
+  export SAGE_ROOT="/usr"
+  export SAGE_SRC="$PWD"
+  export SAGE_DOC_SRC="$SAGE_SRC"/doc
+  export SAGE_DOC="$SAGE_DOC_SRC"
+  export SAGE_DOC_MATHJAX=yes
+  export PYTHONPATH="$srcdir"/sage-$pkgver/local-python
+  python2 sage_setup/docbuild --no-pdf-links -k all html
+}
+
+package() {
+  cd sage-$pkgver/src/doc
+ 
+  mkdir -p "$pkgdir"/usr/share/doc/sage/en
+  cp -r en/introspect "$pkgdir"/usr/share/doc/sage/en
+  cp -r common "$pkgdir"/usr/share/doc/sage
+  cp -r html "$pkgdir"/usr/share/doc/sage
+
+# Replace duplicated files by symlinks (Gentoo)
+  cd "$pkgdir"/usr/share/doc/sage
+  mv html/en/_static{,.tmp}
+  for _dir in `find -name _static` ; do
+        rm -r $_dir
+        ln -s /usr/share/doc/sage/html/en/_static $_dir
+  done
+  mv html/en/_static{.tmp,}
+}

Deleted: docbuild_main.patch
===================================================================
--- docbuild_main.patch	2018-12-05 17:06:28 UTC (rev 411565)
+++ docbuild_main.patch	2018-12-05 17:21:20 UTC (rev 411566)
@@ -1,6 +0,0 @@
---- src/sage_setup/docbuild/__main__.py.orig
-+++ src/sage_setup/docbuild/__main__.py
-@@ -1,2 +1,2 @@
--from . import main
-+from sage_setup.docbuild import main
- main()

Copied: sagemath-doc/repos/community-any/docbuild_main.patch (from rev 411565, sagemath-doc/trunk/docbuild_main.patch)
===================================================================
--- docbuild_main.patch	                        (rev 0)
+++ docbuild_main.patch	2018-12-05 17:21:20 UTC (rev 411566)
@@ -0,0 +1,6 @@
+--- src/sage_setup/docbuild/__main__.py.orig
++++ src/sage_setup/docbuild/__main__.py
+@@ -1,2 +1,2 @@
+-from . import main
++from sage_setup.docbuild import main
+ main()

Copied: sagemath-doc/repos/community-any/sagemath-doc-segfault.patch (from rev 411565, sagemath-doc/trunk/sagemath-doc-segfault.patch)
===================================================================
--- sagemath-doc-segfault.patch	                        (rev 0)
+++ sagemath-doc-segfault.patch	2018-12-05 17:21:20 UTC (rev 411566)
@@ -0,0 +1,63 @@
+diff --git a/src/sage_setup/docbuild/__init__.py b/src/sage_setup/docbuild/__init__.py
+index 5877b5b..7dc8ff7 100644
+--- a/src/sage_setup/docbuild/__init__.py
++++ b/src/sage_setup/docbuild/__init__.py
+@@ -265,35 +265,29 @@ class DocBuilder(object):
+     # import the customized builder for object.inv files
+     inventory = builder_helper('inventory')
+ 
+-if NUM_THREADS > 1:
+-    def build_many(target, args):
+-        from multiprocessing import Pool
+-        pool = Pool(NUM_THREADS, maxtasksperchild=1)
+-        # map_async handles KeyboardInterrupt correctly. Plain map and
+-        # apply_async does not, so don't use it.
+-        x = pool.map_async(target, args, 1)
+-        try:
+-            ret = x.get(99999)
+-            pool.close()
+-            pool.join()
+-        except Exception:
+-            pool.terminate()
+-            if ABORT_ON_ERROR:
+-                raise
+-        return ret
+-else:
+-    def build_many(target, args):
+-        results = []
+-
+-        for arg in args:
+-            try:
+-                results.append(target(arg))
+-            except Exception:
+-                if ABORT_ON_ERROR:
+-                    raise
+-
+-        return results
+-
++def build_many(target, args):
++    # Pool() uses an actual fork() to run each new instance. This is important
++    # for performance reasons, i.e., don't use a forkserver when it becomes
++    # available with Python 3: Here, sage is already initialized which is quite
++    # costly, with a forkserver we would have to reinitialize it for every
++    # document we build. At the same time, don't serialize this by taking the
++    # pool (and thus the call to fork()) out completely: The call to Sphinx
++    # leaks memory, so we need to build each document in its own process to
++    # control the RAM usage.
++    from multiprocessing import Pool
++    pool = Pool(NUM_THREADS, maxtasksperchild=1)
++    # map_async handles KeyboardInterrupt correctly. Plain map and
++    # apply_async does not, so don't use it.
++    x = pool.map_async(target, args, 1)
++    try:
++        ret = x.get(99999)
++        pool.close()
++        pool.join()
++    except Exception:
++        pool.terminate()
++        if ABORT_ON_ERROR:
++            raise
++    return ret
+ 
+ ##########################################
+ #      Parallel Building Ref Manual      #

Deleted: sagemath-doc-sphinx-1.8.patch
===================================================================
--- sagemath-doc-sphinx-1.8.patch	2018-12-05 17:06:28 UTC (rev 411565)
+++ sagemath-doc-sphinx-1.8.patch	2018-12-05 17:21:20 UTC (rev 411566)
@@ -1,16 +0,0 @@
-diff --git a/src/sage_setup/docbuild/ext/sage_autodoc.py b/src/sage_setup/docbuild/ext/sage_autodoc.py
-index 2c399bad51..96abec3382 100644
---- a/src/sage_setup/docbuild/ext/sage_autodoc.py
-+++ b/src/sage_setup/docbuild/ext/sage_autodoc.py
-@@ -39,8 +39,9 @@ from docutils.statemachine import ViewList
- import sphinx
- from sphinx.util import rpartition, force_decode
- from sphinx.locale import _
--from sphinx.pycode import ModuleAnalyzer, PycodeError
--from sphinx.application import ExtensionError
-+from sphinx.pycode import ModuleAnalyzer
-+from sphinx.errors import ExtensionError, PycodeError
-+from sphinx.util.logging import getLogger
- from sphinx.util.nodes import nested_parse_with_titles
- from docutils.parsers.rst import Directive
- from sphinx.util.inspect import getargspec, isdescriptor, safe_getmembers, \

Copied: sagemath-doc/repos/community-any/sagemath-doc-sphinx-1.8.patch (from rev 411565, sagemath-doc/trunk/sagemath-doc-sphinx-1.8.patch)
===================================================================
--- sagemath-doc-sphinx-1.8.patch	                        (rev 0)
+++ sagemath-doc-sphinx-1.8.patch	2018-12-05 17:21:20 UTC (rev 411566)
@@ -0,0 +1,16 @@
+diff --git a/src/sage_setup/docbuild/ext/sage_autodoc.py b/src/sage_setup/docbuild/ext/sage_autodoc.py
+index 2c399bad51..96abec3382 100644
+--- a/src/sage_setup/docbuild/ext/sage_autodoc.py
++++ b/src/sage_setup/docbuild/ext/sage_autodoc.py
+@@ -39,8 +39,9 @@ from docutils.statemachine import ViewList
+ import sphinx
+ from sphinx.util import rpartition, force_decode
+ from sphinx.locale import _
+-from sphinx.pycode import ModuleAnalyzer, PycodeError
+-from sphinx.application import ExtensionError
++from sphinx.pycode import ModuleAnalyzer
++from sphinx.errors import ExtensionError, PycodeError
++from sphinx.util.logging import getLogger
+ from sphinx.util.nodes import nested_parse_with_titles
+ from docutils.parsers.rst import Directive
+ from sphinx.util.inspect import getargspec, isdescriptor, safe_getmembers, \


More information about the arch-commits mailing list