[gtk-doc] mkhtml/pdf: fix out-of-srcdir builds
- From: Stefan Sauer <stefkost src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-doc] mkhtml/pdf: fix out-of-srcdir builds
- Date: Fri, 23 Mar 2018 21:12:01 +0000 (UTC)
commit 350fbc5adaf5f996287ce9bbdd6b73000de9a401
Author: Stefan Sauer <ensonic users sf net>
Date: Fri Mar 23 21:32:29 2018 +0100
mkhtml/pdf: fix out-of-srcdir builds
Fix how we assemble the --path param to xsltproc. We can only use --path once.
If there are multipel path we can separate them with a colon.
Also pass the search-path in dblatex through to xsltproc.
Finally from reading the xslt-sources we found out that the searchpath works
by appending only the filename part to each searchpath entry. Hence define
a path for the gobject example so that the source-file includes work.
gtkdoc/mkhtml.py | 8 ++++----
gtkdoc/mkpdf.py | 7 +++++--
tests/gobject/docs/Makefile.am | 5 ++++-
3 files changed, 13 insertions(+), 7 deletions(-)
---
diff --git a/gtkdoc/mkhtml.py b/gtkdoc/mkhtml.py
index 290dc85..73eda12 100644
--- a/gtkdoc/mkhtml.py
+++ b/gtkdoc/mkhtml.py
@@ -36,14 +36,14 @@ def run_xsltproc(options, args):
# we could do "$path_option $PWD " to avoid needing rewriting entities that
# are copied from the header into docs under xml
if os.environ.get("GTKDOC_PROFILE", '') == '':
- for path in options.path:
- command += ['--path', path]
+ if len(options.path):
+ command += ['--path', ':'.join(options.path)]
logging.info('running "%s"', ' '.join(command + args))
return subprocess.call(command + args)
else:
command += ['--profile']
- for path in options.path:
- command += ['--path', path]
+ if len(options.path):
+ command += ['--path', ':'.join(options.path)]
logging.info('running "%s"', ' '.join(command + args))
return subprocess.call(command + args, stderr=open('profile.txt', 'w'))
diff --git a/gtkdoc/mkpdf.py b/gtkdoc/mkpdf.py
index c84ec16..6a034da 100755
--- a/gtkdoc/mkpdf.py
+++ b/gtkdoc/mkpdf.py
@@ -34,8 +34,8 @@ def run_xsltproc(options, args):
command = [config.xsltproc]
# we could do "--path $PWD " to avoid needing rewriting entities that are
# copied from the header into docs under xml
- for path in options.path:
- command += ['--path', path]
+ if len(options.path):
+ command += ['--path', ':'.join(options.path)]
logging.info('running "%s"', ' '.join(command + args))
pc = subprocess.Popen(command + args, stderr=subprocess.PIPE)
(o, stde) = pc.communicate()
@@ -65,11 +65,14 @@ def run(options):
# -T db2latex : different style
# -d : keep transient files (for debugging)
# -P abc.def=$quiet : once the stylesheets have a quiet mode
+ # -x "--path /path/to/more/files"
# xsltproc is already called with --xinclude
# does not work: --xslt-opts "--path $searchpath --nonet $@"
dblatex_options = ['-o', module + '.pdf']
for i in options.imgdir:
dblatex_options += ['-I', i]
+ if len(options.path):
+ dblatex_options += ['-x', '--path ' + ':'.join(options.path)]
dblatex_options.append(document)
if not options.verbose:
pc = subprocess.Popen([config.dblatex, '--help'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
diff --git a/tests/gobject/docs/Makefile.am b/tests/gobject/docs/Makefile.am
index 3eb5b7e..c5b6bd0 100644
--- a/tests/gobject/docs/Makefile.am
+++ b/tests/gobject/docs/Makefile.am
@@ -25,7 +25,10 @@ SCAN_OPTIONS=--deprecated-guards="GTKDOC_TESTER_DISABLE_DEPRECATED" \
MKDB_OPTIONS=--xml-mode
# Extra options to supply to gtkdoc-mkhtml
-MKHTML_OPTIONS=
+MKHTML_OPTIONS=--path=$(abs_top_srcdir)/tests/gobject/examples
+
+# Extra options to supply to gtkdoc-mkpdf
+MKPDF_OPTIONS=--path=$(abs_top_srcdir)/tests/gobject/examples
# Extra options to supply to gtkdoc-fixref. Not normally needed.
# --html-dir=$(HTML_DIR)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]