Hi!
This patch adds a pre-check to meson for the ability to use docbookx.dtd
to avoid obscure errors when the docbook-xsl package is missing from the OS.
--
Andrey Teplitskiy
Postgres Professional
diff --git a/doc/build/check-dtd.xml b/doc/build/check-dtd.xml
new file mode 100644
index 00000000000..8d361447a19
--- /dev/null
+++ b/doc/build/check-dtd.xml
@@ -0,0 +1,3 @@
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<book id="check-dtd" />
diff --git a/meson.build b/meson.build
index ab8101d67b2..fb8ce940bbe 100644
--- a/meson.build
+++ b/meson.build
@@ -621,7 +621,11 @@ docs_opt = get_option('docs')
docs_dep = not_found_dep
if not docs_opt.disabled()
if xmllint_bin.found() and xsltproc_bin.found()
- docs_dep = declare_dependency()
+ if run_command(xmllint_bin, '--nonet', '--valid', '--noout', 'doc/build/check-dtd.xml', check: false).returncode() != 0
+ error('missing required DocBook XML DTD (probably missing package docbook-xsl)')
+ else
+ docs_dep = declare_dependency()
+ endif
elif docs_opt.enabled()
error('missing required tools (xmllint and xsltproc needed) for docs in HTML / man page format')
endif