[oe-commits] [openembedded-core] branch master updated: asciidoc: specify XML catalogue to use

git at git.openembedded.org git at git.openembedded.org
Wed Apr 3 13:57:22 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

The following commit(s) were added to refs/heads/master by this push:
     new efb6168  asciidoc: specify XML catalogue to use
efb6168 is described below

commit efb6168e41797ad6ed00ede6f3d9141b90eff4b5
Author: Ross Burton <ross.burton at intel.com>
AuthorDate: Tue Apr 2 17:52:07 2019 +0100

    asciidoc: specify XML catalogue to use
    
    libxml-native by default uses a XML catalogue at /etc/xml/catalog, instead of
    the one in the sysroot.  Until this is fixed (#13260) override the XML catalogue
    manually in the recipe to point explicitly at the docbook-xml and docbook-xsl
    catalogues.
    
    This fixes either complete build failures (where the host doesn't have
    docbook-xml installed) or slow builds (where the host doesn't have docbook-xsl
    installed).
    
    Signed-off-by: Ross Burton <ross.burton at intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 .../asciidoc/asciidoc/auto-catalogs.patch          | 53 ++++++++++++++++++++++
 meta/recipes-extended/asciidoc/asciidoc_8.6.9.bb   |  9 +++-
 2 files changed, 60 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-extended/asciidoc/asciidoc/auto-catalogs.patch b/meta/recipes-extended/asciidoc/asciidoc/auto-catalogs.patch
new file mode 100644
index 0000000..ca170db
--- /dev/null
+++ b/meta/recipes-extended/asciidoc/asciidoc/auto-catalogs.patch
@@ -0,0 +1,53 @@
+If SGML_CATALOG_FILES is in the environment, pass --catalogs to xmllint and
+xsltproc. Also pass --nonet to xsltproc to detect future missing stylesheet
+problems.
+
+An earlier version of this patch was filed upstream at
+https://github.com/asciidoc/asciidoc-py3/issues/61 so depending on how that goes
+this could get merged.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton at intel.com>
+
+diff --git a/a2x.py b/a2x.py
+index 2d7699a..582d809 100755
+--- a/a2x.py
++++ b/a2x.py
+@@ -57,6 +57,10 @@ LYNX_OPTS = '-dump'
+ W3M_OPTS = '-dump -cols 70 -T text/html -no-graph'
+ XSLTPROC_OPTS = ''
+ 
++if "SGML_CATALOG_FILES" in os.environ:
++  XMLLINT += " --catalogs"
++  XSLTPROC += " --catalogs"
++
+ ######################################################################
+ # End of configuration file parameters.
+ ######################################################################
+@@ -298,7 +302,7 @@ def exec_xsltproc(xsl_file, xml_file, dst_dir, opts = ''):
+     cwd = os.getcwd()
+     shell_cd(dst_dir)
+     try:
+-        shell('"%s" %s "%s" "%s"' % (XSLTPROC, opts, xsl_file, xml_file))
++        shell('%s %s "%s" "%s"' % (XSLTPROC, opts, xsl_file, xml_file))
+     finally:
+         shell_cd(cwd)
+ 
+@@ -483,7 +487,7 @@ class A2X(AttrDict):
+             self.asciidoc_opts += ' --doctype %s' % self.doctype
+         for attr in self.attributes:
+             self.asciidoc_opts += ' --attribute "%s"' % attr
+-#        self.xsltproc_opts += ' --nonet'
++        self.xsltproc_opts += ' --nonet'
+         if self.verbose:
+             self.asciidoc_opts += ' --verbose'
+             self.dblatex_opts += ' -V'
+@@ -634,7 +638,7 @@ class A2X(AttrDict):
+         shell('"%s" --backend docbook -a "a2x-format=%s" %s --out-file "%s" "%s"' %
+              (self.asciidoc, self.format, self.asciidoc_opts, docbook_file, self.asciidoc_file))
+         if not self.no_xmllint and XMLLINT:
+-            shell('"%s" --nonet --noout --valid "%s"' % (XMLLINT, docbook_file))
++            shell('%s --nonet --noout --valid "%s"' % (XMLLINT, docbook_file))
+ 
+     def to_xhtml(self):
+         self.to_docbook()
diff --git a/meta/recipes-extended/asciidoc/asciidoc_8.6.9.bb b/meta/recipes-extended/asciidoc/asciidoc_8.6.9.bb
index d0d1517..f684f12 100644
--- a/meta/recipes-extended/asciidoc/asciidoc_8.6.9.bb
+++ b/meta/recipes-extended/asciidoc/asciidoc_8.6.9.bb
@@ -8,14 +8,19 @@ LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
                     file://COPYRIGHT;md5=029ad5428ba5efa20176b396222d4069"
 
-SRC_URI = "git://github.com/asciidoc/asciidoc-py3;protocol=https"
+SRC_URI = "git://github.com/asciidoc/asciidoc-py3;protocol=https \
+           file://auto-catalogs.patch"
 SRCREV = "618f6e6f6b558ed1e5f2588cd60a5a6b4f881ca0"
 PV .= "+py3-git${SRCPV}"
 
-DEPENDS = "libxml2-native libxslt-native docbook-xml-dtd4-native"
+DEPENDS = "libxml2-native libxslt-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
 
 S = "${WORKDIR}/git"
 
+# Tell xmllint where to find the DocBook XML catalogue, because right now it
+# opens /etc/xml/catalog on the host. Depends on auto-catalogs.patch
+export SGML_CATALOG_FILES="file://${STAGING_ETCDIR_NATIVE}/xml/docbook-xml.xml file://${STAGING_ETCDIR_NATIVE}/xml/docbook-xsl.xml"
+
 # Not using automake
 inherit autotools-brokensep
 CLEANBROKEN = "1"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list