From ff3ccd3df7cdddd4bb0f44e96418edec0a2d4842 Mon Sep 17 00:00:00 2001
From: Aleksander Alekseev <aleksander@timescale.com>
Date: Mon, 30 Jan 2023 14:39:41 +0300
Subject: [PATCH v1] Document the workaround for xsltproc when building on
 macOS

The build of the documentation is known to fail without specifying
extra environment variables on macOS. Hopefully this patch will save some time
to those who encounter this problem.

Author: Aleksander Alekseev
Reviewed-by: TODO FIXME
Discussion: https://postgr.es/m/CAJ7c6TO8Aro2nxg%3DEQsVGiSDe-TstP4EsSvDHd7DSRsP40PgGA%40mail.gmail.com
---
 doc/src/sgml/docguide.sgml | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/doc/src/sgml/docguide.sgml b/doc/src/sgml/docguide.sgml
index 787caef70d..096516cade 100644
--- a/doc/src/sgml/docguide.sgml
+++ b/doc/src/sgml/docguide.sgml
@@ -221,6 +221,22 @@ sudo port install docbook-xml-4.5 docbook-xsl fop
     If you use Homebrew, use this:
 <programlisting>
 brew install docbook docbook-xsl fop
+</programlisting>
+   </para>
+
+   <para>
+    If <command>xltproc</command> throws errors like:
+<programlisting>
+error : Unknown IO error
+warning: failed to load external entity
+  "http://docbook.sourceforge.net/release/xsl/current/xhtml/chunk.xsl"
+...
+</programlisting>
+    ... use the following environment variables:
+<programlisting>
+export SGML_CATALOG_FILES=/usr/local/etc/xml/catalog
+export XMLLINT="xmllint --catalogs"
+export XSLTPROC="xsltproc --catalogs"
 </programlisting>
    </para>
   </sect2>
-- 
2.39.1

