Move finding XML catalogs into a separate setup hook
This is because libxml/libxslt are not the only implementations that respect $XML_CATALOG_FILES. Also, look in share/xml for catalogs (in addition to the now-deprecated xml/dtd and xml/xsl).
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{ stdenv, fetchurl, zlib, xz, python ? null, pythonSupport ? true }:
|
||||
{ stdenv, fetchurl, zlib, xz, python ? null, pythonSupport ? true, findXMLCatalogs }:
|
||||
|
||||
assert pythonSupport -> python != null;
|
||||
|
||||
@@ -22,9 +22,7 @@ stdenv.mkDerivation (rec {
|
||||
# RUNPATH for that, leading to undefined references for its users.
|
||||
++ (stdenv.lib.optional stdenv.isFreeBSD xz);
|
||||
|
||||
propagatedBuildInputs = [ zlib ];
|
||||
|
||||
setupHook = ./setup-hook.sh;
|
||||
propagatedBuildInputs = [ zlib findXMLCatalogs ];
|
||||
|
||||
passthru = { inherit pythonSupport version; };
|
||||
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
addXMLCatalogs () {
|
||||
for kind in dtd xsl; do
|
||||
if test -d $1/xml/$kind; then
|
||||
for i in $(find $1/xml/$kind -name catalog.xml); do
|
||||
export XML_CATALOG_FILES="$XML_CATALOG_FILES $i"
|
||||
done
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
if test -z "$libxmlHookDone"; then
|
||||
libxmlHookDone=1
|
||||
|
||||
# Set up XML_CATALOG_FILES. An empty initial value prevents
|
||||
# xmllint and xsltproc from looking in /etc/xml/catalog.
|
||||
export XML_CATALOG_FILES
|
||||
if test -z "$XML_CATALOG_FILES"; then XML_CATALOG_FILES=" "; fi
|
||||
envHooks+=(addXMLCatalogs)
|
||||
fi
|
||||
Reference in New Issue
Block a user