nixpkgs/pkgs/tools/text/sgml/opensp/setup-hook.sh
Lluís Batlle i Rossell d711dcc070 Adding setup-hook for opensp, to set the sgml catalog files
This sets the SGML_CATALOG_FILES, similar to how libxml2 does the same with
XML_CATALOG_FILES.

I based the hook on the libxml2 one, and I followed the instructions about this
variable here:
http://docbook.sourceforge.net/release/dsssl/1.79/doc/install.html
2013-03-18 15:07:20 +01:00

23 lines
709 B
Bash

addSGMLCatalogs () {
if test -d $1/sgml/dtd; then
for i in $(find $1/sgml/dtd -name docbook.cat); do
export SGML_CATALOG_FILES="${SGML_CATALOG_FILES:+:}$i"
done
fi
}
if test -z "$sgmlHookDone"; then
sgmlHookDone=1
# Set http_proxy and ftp_proxy to a invalid host to prevent
# xmllint and xsltproc from trying to download DTDs from the
# network even when --nonet is not given. That would be impure.
# (Note that .invalid is a reserved domain guaranteed not to
# work.)
export http_proxy=http://nodtd.invalid/
export ftp_proxy=http://nodtd.invalid/
export SGML_CATALOG_FILES
envHooks=(${envHooks[@]} addSGMLCatalogs)
fi