iputils/0001-build-sys-doc-Fix-the-dependency-on-xsltproc.patch
2019-05-22 09:17:09 +02:00

78 lines
2.3 KiB
Diff

From 3b013f271931c3fe771e5a2c591f35d617de90f3 Mon Sep 17 00:00:00 2001
From: Michael Weiss <dev.primeos@gmail.com>
Date: Thu, 16 May 2019 10:08:50 +0000
Subject: [PATCH] build-sys/doc: Fix the dependency on xsltproc
This dependency is only required if either the man pages or the HTML
documentation is being build. Both targets require docbook-xsl-ns and
not docbook-xsl (the former is preferred and in use since c503834).
---
.travis.yml | 1 -
doc/meson.build | 27 +++++++++++++++++----------
2 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 54edb61..6a6e8c3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -14,7 +14,6 @@ addons:
- "libidn2-0-dev"
- "nettle-dev"
- "xsltproc"
- - "docbook-xsl"
- "docbook-xsl-ns"
matrix:
include:
diff --git a/doc/meson.build b/doc/meson.build
index 369090f..9a007b3 100644
--- a/doc/meson.build
+++ b/doc/meson.build
@@ -38,7 +38,7 @@ if build_ninfod == true
manpages += ['ninfod']
endif
-xsltproc = find_program('xsltproc', required : true)
+xsltproc = find_program('xsltproc', required : build_mans or build_html_mans)
xsltproc_args = [
'--nonet',
'--stringparam', 'man.output.quietly', '1',
@@ -48,19 +48,26 @@ xsltproc_args = [
]
if xsltproc.found()
- xsl = 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl'
- testrun = run_command([xsltproc, '--nonet', xsl])
- xsltproc_works = testrun.returncode() == 0
- if xsltproc_works == false
- warning('xsltproc: cannot process ' + xsl)
+ doc_targets = []
+ if build_mans
+ doc_targets += ['manpages']
endif
-else
- warning('No docbook stylesheet found for generating man pages')
- xsltproc_works = false
+ if build_html_mans
+ doc_targets += ['html']
+ endif
+ xsltproc_works = true
+ foreach doc_target : doc_targets
+ xsl = 'http://docbook.sourceforge.net/release/xsl-ns/current/' + doc_target + '/docbook.xsl'
+ testrun = run_command([xsltproc, '--nonet', xsl])
+ if testrun.returncode() != 0
+ xsltproc_works = false
+ warning('xsltproc: cannot process ' + xsl)
+ endif
+ endforeach
endif
if xsltproc_works == false
- error('Man pages cannot be built: xsltproc does not work correctly')
+ error('Docs cannot be built: xsltproc does not work correctly')
endif
if build_mans
--
2.20.1