summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorshmilee2019-04-23 21:41:05 +0800
committershmilee2019-04-23 21:41:05 +0800
commit43b0d997949bdd446e11121a680eb33d137d282f (patch)
treef4516805c117d1474dbc4e1dd18b03a6a7777324
parent12c82a4c315909639e44e05ce4e4bc69538e5a82 (diff)
downloadaur-43b0d997949bdd446e11121a680eb33d137d282f.tar.gz
fix kernel Documentation build error with sphinx2
* https://bugs.archlinux.org/task/62332 * http://www.sphinx-doc.org/en/master/changes.html * https://github.com/sphinx-doc/sphinx/pull/4310/commits/299b11f26f98b1f6bf61602ff9955a12b7d1593e * https://github.com/sphinx-doc/sphinx/pull/4702 * https://github.com/sphinx-doc/sphinx/issues/2367
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD5
-rw-r--r--doc-sphinx-2.patch188
3 files changed, 196 insertions, 1 deletions
diff --git a/.SRCINFO b/.SRCINFO
index dc43207403f..1674a8b40f2 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,5 +1,5 @@
# Generated by makepkg 5.1.3
-# Mon Apr 22 14:15:15 UTC 2019
+# Tue Apr 23 13:39:59 UTC 2019
pkgbase = linux-shmilee
pkgver = 4.19.36
pkgrel = 1
@@ -23,6 +23,7 @@ pkgbase = linux-shmilee
source = ck-patch-for-4.19.34+.patch
source = https://raw.githubusercontent.com/dolohow/uksm/c4fc85e4e513f97c38806358c472cc45270d936f/uksm-4.19.patch
source = linux-cjktty-4.19.patch::https://github.com/torvalds/linux/compare/v4.19...Gentoo-zh:4.19-utf8.patch
+ source = doc-sphinx-2.patch
source = config
source = 60-linux.hook
source = 90-linux.hook
@@ -38,6 +39,7 @@ pkgbase = linux-shmilee
sha256sums = 0aafe8360e9a3b9b801ca1327fbfd15b950840d9ddaccd3e7bfc71749e9e3a0c
sha256sums = ec617b1718e6cadfad02c75aca9c4b0e6b6f944bc1a93b7e4d82c847c04b5653
sha256sums = 72be48252f30bc644071bbce2607b773f789c6f19e281b89ab7e16a3d8161ed3
+ sha256sums = b2704cb2a90b48df0d9aac1d16e9a3ead41e2bf2e00562526c5b90eff5eecef4
sha256sums = c804c47ecb6d01f29ed4af5bd9c50fa3bb2545ebe9d1c3b560bc6c61a72966f5
sha256sums = ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21
sha256sums = 75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919
diff --git a/PKGBUILD b/PKGBUILD
index 826565e49f9..44d745111a5 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -58,6 +58,7 @@ source=(
'ck-patch-for-4.19.34+.patch'
${_UKSM_PATCH}
${_CJKTTY_PATCH}
+ 'doc-sphinx-2.patch'
'config' # the main kernel config file
'60-linux.hook' # pacman hook for depmod
'90-linux.hook' # pacman hook for initramfs regeneration
@@ -77,6 +78,7 @@ sha256sums=('0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1'
'0aafe8360e9a3b9b801ca1327fbfd15b950840d9ddaccd3e7bfc71749e9e3a0c'
'ec617b1718e6cadfad02c75aca9c4b0e6b6f944bc1a93b7e4d82c847c04b5653'
'72be48252f30bc644071bbce2607b773f789c6f19e281b89ab7e16a3d8161ed3'
+ 'b2704cb2a90b48df0d9aac1d16e9a3ead41e2bf2e00562526c5b90eff5eecef4'
'c804c47ecb6d01f29ed4af5bd9c50fa3bb2545ebe9d1c3b560bc6c61a72966f5'
'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21'
'75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919'
@@ -111,6 +113,9 @@ prepare() {
cp "../${_CJKTTY_PATCH_FILE}" "../${_CJKTTY_PATCH_FILE}.${_LLL_SUBVER}.patch"
patch -Np1 -i "../${_CJKTTY_PATCH_FILE}.${_LLL_SUBVER}.patch"
+ msg "Patching source with Sphinx-2.0 Documentation build patch"
+ patch -Np1 -i ../doc-sphinx-2.patch
+
cp -Tf ../config .config
if [ "${_kernelname}" != "" ]; then
diff --git a/doc-sphinx-2.patch b/doc-sphinx-2.patch
new file mode 100644
index 00000000000..fb45d2520b9
--- /dev/null
+++ b/doc-sphinx-2.patch
@@ -0,0 +1,188 @@
+diff -Nur a/Documentation/conf.py b/Documentation/conf.py
+--- a/Documentation/conf.py 2018-10-22 14:37:37.000000000 +0800
++++ b/Documentation/conf.py 2019-04-23 21:00:17.000000000 +0800
+@@ -37,7 +37,7 @@
+ extensions = ['kerneldoc', 'rstFlatTable', 'kernel_include', 'cdomain', 'kfigure', 'sphinx.ext.ifconfig']
+
+ # The name of the math extension changed on Sphinx 1.4
+-if major == 1 and minor > 3:
++if (major == 1 and minor > 3) or major > 1:
+ extensions.append("sphinx.ext.imgmath")
+ else:
+ extensions.append("sphinx.ext.pngmath")
+diff -Nur a/Documentation/sphinx/kerneldoc.py b/Documentation/sphinx/kerneldoc.py
+--- a/Documentation/sphinx/kerneldoc.py 2018-10-22 14:37:37.000000000 +0800
++++ b/Documentation/sphinx/kerneldoc.py 2019-04-23 21:16:41.000000000 +0800
+@@ -37,7 +37,10 @@
+ from docutils import nodes, statemachine
+ from docutils.statemachine import ViewList
+ from docutils.parsers.rst import directives, Directive
+-from sphinx.ext.autodoc import AutodocReporter
++from sphinx.util.docutils import switch_source_input
++
++from sphinx.util import logging
++logger = logging.getLogger(__name__)
+
+ __version__ = '1.0'
+
+@@ -90,7 +93,7 @@
+ cmd += [filename]
+
+ try:
+- env.app.verbose('calling kernel-doc \'%s\'' % (" ".join(cmd)))
++ logger.verbose('calling kernel-doc \'%s\'' % (" ".join(cmd)))
+
+ p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ out, err = p.communicate()
+@@ -100,7 +103,7 @@
+ if p.returncode != 0:
+ sys.stderr.write(err)
+
+- env.app.warn('kernel-doc \'%s\' failed with return code %d' % (" ".join(cmd), p.returncode))
++ logger.warning('kernel-doc \'%s\' failed with return code %d' % (" ".join(cmd), p.returncode))
+ return [nodes.error(None, nodes.paragraph(text = "kernel-doc missing"))]
+ elif env.config.kerneldoc_verbosity > 0:
+ sys.stderr.write(err)
+@@ -122,17 +125,17 @@
+
+ node = nodes.section()
+ buf = self.state.memo.title_styles, self.state.memo.section_level, self.state.memo.reporter
+- self.state.memo.reporter = AutodocReporter(result, self.state.memo.reporter)
+ self.state.memo.title_styles, self.state.memo.section_level = [], 0
+ try:
+- self.state.nested_parse(result, 0, node, match_titles=1)
++ with switch_source_input(self.state, result):
++ self.state.nested_parse(result, 0, node, match_titles=1)
+ finally:
+ self.state.memo.title_styles, self.state.memo.section_level, self.state.memo.reporter = buf
+
+ return node.children
+
+ except Exception as e: # pylint: disable=W0703
+- env.app.warn('kernel-doc \'%s\' processing failed with: %s' %
++ logger.warning('kernel-doc \'%s\' processing failed with: %s' %
+ (" ".join(cmd), str(e)))
+ return [nodes.error(None, nodes.paragraph(text = "kernel-doc missing"))]
+
+diff -Nur a/Documentation/sphinx/kfigure.py b/Documentation/sphinx/kfigure.py
+--- a/Documentation/sphinx/kfigure.py 2018-10-22 14:37:37.000000000 +0800
++++ b/Documentation/sphinx/kfigure.py 2019-04-23 21:13:32.000000000 +0800
+@@ -60,6 +60,9 @@
+ from sphinx.util.nodes import clean_astext
+ from six import iteritems
+
++from sphinx.util import logging
++logger = logging.getLogger(__name__)
++
+ PY3 = sys.version_info[0] == 3
+
+ if PY3:
+@@ -171,20 +174,20 @@
+ This function is called once, when the builder is initiated.
+ """
+ global dot_cmd, convert_cmd # pylint: disable=W0603
+- app.verbose("kfigure: check installed tools ...")
++ logger.verbose("kfigure: check installed tools ...")
+
+ dot_cmd = which('dot')
+ convert_cmd = which('convert')
+
+ if dot_cmd:
+- app.verbose("use dot(1) from: " + dot_cmd)
++ logger.verbose("use dot(1) from: " + dot_cmd)
+ else:
+- app.warn("dot(1) not found, for better output quality install "
++ logger.warning("dot(1) not found, for better output quality install "
+ "graphviz from http://www.graphviz.org")
+ if convert_cmd:
+- app.verbose("use convert(1) from: " + convert_cmd)
++ logger.verbose("use convert(1) from: " + convert_cmd)
+ else:
+- app.warn(
++ logger.warning(
+ "convert(1) not found, for SVG to PDF conversion install "
+ "ImageMagick (https://www.imagemagick.org)")
+
+@@ -220,12 +223,12 @@
+
+ # in kernel builds, use 'make SPHINXOPTS=-v' to see verbose messages
+
+- app.verbose('assert best format for: ' + img_node['uri'])
++ logger.verbose('assert best format for: ' + img_node['uri'])
+
+ if in_ext == '.dot':
+
+ if not dot_cmd:
+- app.verbose("dot from graphviz not available / include DOT raw.")
++ logger.verbose("dot from graphviz not available / include DOT raw.")
+ img_node.replace_self(file2literal(src_fname))
+
+ elif translator.builder.format == 'latex':
+@@ -252,7 +255,7 @@
+
+ if translator.builder.format == 'latex':
+ if convert_cmd is None:
+- app.verbose("no SVG to PDF conversion available / include SVG raw.")
++ logger.verbose("no SVG to PDF conversion available / include SVG raw.")
+ img_node.replace_self(file2literal(src_fname))
+ else:
+ dst_fname = path.join(translator.builder.outdir, fname + '.pdf')
+@@ -265,18 +268,18 @@
+ _name = dst_fname[len(translator.builder.outdir) + 1:]
+
+ if isNewer(dst_fname, src_fname):
+- app.verbose("convert: {out}/%s already exists and is newer" % _name)
++ logger.verbose("convert: {out}/%s already exists and is newer" % _name)
+
+ else:
+ ok = False
+ mkdir(path.dirname(dst_fname))
+
+ if in_ext == '.dot':
+- app.verbose('convert DOT to: {out}/' + _name)
++ logger.verbose('convert DOT to: {out}/' + _name)
+ ok = dot2format(app, src_fname, dst_fname)
+
+ elif in_ext == '.svg':
+- app.verbose('convert SVG to: {out}/' + _name)
++ logger.verbose('convert SVG to: {out}/' + _name)
+ ok = svg2pdf(app, src_fname, dst_fname)
+
+ if not ok:
+@@ -305,7 +308,7 @@
+ with open(out_fname, "w") as out:
+ exit_code = subprocess.call(cmd, stdout = out)
+ if exit_code != 0:
+- app.warn("Error #%d when calling: %s" % (exit_code, " ".join(cmd)))
++ logger.warning("Error #%d when calling: %s" % (exit_code, " ".join(cmd)))
+ return bool(exit_code == 0)
+
+ def svg2pdf(app, svg_fname, pdf_fname):
+@@ -322,7 +325,7 @@
+ # use stdout and stderr from parent
+ exit_code = subprocess.call(cmd)
+ if exit_code != 0:
+- app.warn("Error #%d when calling: %s" % (exit_code, " ".join(cmd)))
++ logger.warning("Error #%d when calling: %s" % (exit_code, " ".join(cmd)))
+ return bool(exit_code == 0)
+
+
+@@ -415,15 +418,15 @@
+ app = self.builder.app
+ srclang = node.get('srclang')
+
+- app.verbose('visit kernel-render node lang: "%s"' % (srclang))
++ logger.verbose('visit kernel-render node lang: "%s"' % (srclang))
+
+ tmp_ext = RENDER_MARKUP_EXT.get(srclang, None)
+ if tmp_ext is None:
+- app.warn('kernel-render: "%s" unknown / include raw.' % (srclang))
++ logger.warning('kernel-render: "%s" unknown / include raw.' % (srclang))
+ return
+
+ if not dot_cmd and tmp_ext == '.dot':
+- app.verbose("dot from graphviz not available / include raw.")
++ logger.verbose("dot from graphviz not available / include raw.")
+ return
+
+ literal_block = node[0]