summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2022-04-23 17:42:58 +0100
committerSimon McVittie <smcv@collabora.com>2022-04-23 17:42:58 +0100
commit95a4914b43db4d603c5137a16610c60a8e2bf66d (patch)
tree7df9fe38d4cbf7832ee5e38cbf8de515d12b1587
parentb5d2e78bfae32bd8b9eaaba0e053b6611face893 (diff)
parentfaf715828ddef259eceb547b7f68d67da5c9bc74 (diff)
downloadbubblewrap-wip/smcv/for-flatpak-meson-build.tar.gz
DO NOT MERGE: Merge branches 'detect-missing-xslt' and 'sanitize'wip/smcv/for-flatpak-meson-build
See #502, #506
-rw-r--r--meson.build17
1 files changed, 16 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index 9277ac4..c4ba441 100644
--- a/meson.build
+++ b/meson.build
@@ -124,9 +124,24 @@ bwrap = executable(
dependencies : [selinux_dep, libcap_dep],
)
+manpages_xsl = 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl'
xsltproc = find_program('xsltproc', required : get_option('man'))
+build_man_page = false
if xsltproc.found() and not meson.is_subproject()
+ if run_command([
+ xsltproc, '--nonet', manpages_xsl,
+ ], check : false).returncode() == 0
+ message('Docbook XSL found, man page enabled')
+ build_man_page = true
+ elif get_option('man').enabled()
+ error('Man page requested, but Docbook XSL stylesheets not found')
+ else
+ message('Docbook XSL not found, man page disabled automatically')
+ endif
+endif
+
+if build_man_page
custom_target(
'bwrap.1',
output : 'bwrap.1',
@@ -140,7 +155,7 @@ if xsltproc.found() and not meson.is_subproject()
'--stringparam', 'man.authors.section.enabled', '0',
'--stringparam', 'man.copyright.section.enabled', '0',
'-o', '@OUTPUT@',
- 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl',
+ manpages_xsl,
'@INPUT@',
],
install : true,