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
This commit is contained in:
parent
4ae71ad19d
commit
d711dcc070
@ -3,13 +3,17 @@
|
|||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "sp-compat-${builtins.substring 7 100 opensp.name}";
|
name = "sp-compat-${builtins.substring 7 100 opensp.name}";
|
||||||
|
|
||||||
buildCommand = ''
|
phases = [ "fixupPhase" "installPhase" ];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
mkdir -pv $out/bin
|
mkdir -pv $out/bin
|
||||||
for i in ${opensp}/bin/o*; do
|
for i in ${opensp}/bin/o*; do
|
||||||
ln -sv $i $out/bin/''${i#${opensp}/bin/o}
|
ln -sv $i $out/bin/''${i#${opensp}/bin/o}
|
||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
setupHook = opensp.setupHook;
|
||||||
|
|
||||||
meta.description =
|
meta.description =
|
||||||
"Compatibility wrapper for old programs looking for original sp programs";
|
"Compatibility wrapper for old programs looking for original sp programs";
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,8 @@ stdenv.mkDerivation {
|
|||||||
docsrc/*.xml
|
docsrc/*.xml
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
setupHook = ./setup-hook.sh;
|
||||||
|
|
||||||
buildInputs = [ xmlto docbook_xml_dtd_412 libxslt docbook_xsl ];
|
buildInputs = [ xmlto docbook_xml_dtd_412 libxslt docbook_xsl ];
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
|
22
pkgs/tools/text/sgml/opensp/setup-hook.sh
Normal file
22
pkgs/tools/text/sgml/opensp/setup-hook.sh
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
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
|
Loading…
x
Reference in New Issue
Block a user