* libxml2 / libxslt: provide a setup hook that prevents xmllint and

xsltproc from downloading DTDs from the network, which is impure.
  This caused a lot of problems with Gnome builds in the build farm,
  because those downloads are slow and would sometimes fail.

  The setup hook also sets up $XML_CATALOG_FILES.

svn path=/nixpkgs/trunk/; revision=9471
This commit is contained in:
Eelco Dolstra 2007-10-18 21:08:47 +00:00
parent f6073d7f34
commit eaa4db148d
7 changed files with 42 additions and 48 deletions

View file

@ -2,7 +2,8 @@
{ stdenv, fetchurl, pkgconfig, audiofile
, flex, bison, popt, perl, zlib, libxml2, libxslt
, perlXMLParser, docbook_xml_dtd_42, gettext, x11, libtiff, libjpeg
, perlXMLParser, docbook_xml_dtd_42, docbook_xml_dtd_412
, gettext, x11, libtiff, libjpeg
, libpng, gtkLibs, xlibs, bzip2, libcm, python, dbus_glib, ncurses
, which, libxml2Python, iconnamingutils
}:

View file

@ -4,7 +4,9 @@
stdenv.mkDerivation {
inherit (input) name src;
patches = [./xmlcatalog.patch];
preConfigure = "
substituteInPlace extract/dtds/Makefile.am --replace /usr/bin/xmlcatalog xmlcatalog
";
buildInputs = [pkgconfig perl perlXMLParser libxml2 libxslt];
configureFlags = "--with-xml-catalog=${docbook_xml_dtd_42}/xml/dtd/docbook/docbook.cat";
}

View file

@ -1,37 +0,0 @@
diff -rrc scrollkeeper-orig/extract/dtds/Makefile.in scrollkeeper-0.3.14/extract/dtds/Makefile.in
*** scrollkeeper-orig/extract/dtds/Makefile.in 2003-12-06 09:18:01.000000000 +0100
--- scrollkeeper-0.3.14/extract/dtds/Makefile.in 2005-03-08 19:22:27.000000000 +0100
***************
*** 408,414 ****
# ScrollKeeper OMF Variation DTD V1.0
install-data-hook:
! -/usr/bin/xmlcatalog --noout --add "public" \
"-//OMF//DTD Scrollkeeper OMF Variant V1.0//EN" \
"$(dtdsdir)/scrollkeeper-omf.dtd" $(CATALOG)
--- 408,414 ----
# ScrollKeeper OMF Variation DTD V1.0
install-data-hook:
! -xmlcatalog --noout --add "public" \
"-//OMF//DTD Scrollkeeper OMF Variant V1.0//EN" \
"$(dtdsdir)/scrollkeeper-omf.dtd" $(CATALOG)
***************
*** 418,424 ****
# ScrollKeeper OMF Variation DTD V1.0
uninstall-local:
! -/usr/bin/xmlcatalog --noout --del \
"$(dtdsdir)/scrollkeeper-omf.dtd" $(CATALOG)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
--- 418,424 ----
# ScrollKeeper OMF Variation DTD V1.0
uninstall-local:
! -xmlcatalog --noout --del \
"$(dtdsdir)/scrollkeeper-omf.dtd" $(CATALOG)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

View file

@ -4,12 +4,12 @@ assert zlib != null;
assert pythonSupport -> python != null;
stdenv.mkDerivation {
name = "libxml2-2.6.29";
name = "libxml2-2.6.30";
builder = ./builder.sh;
src = fetchurl {
url = ftp://xmlsoft.org/libxml2/libxml2-2.6.29.tar.gz;
sha256 = "14jrjvdbvlbc3m0q9p3np67sk18w317n5zfg9a3h7b6pp7h1jjp3";
url = ftp://xmlsoft.org/libxml2/libxml2-2.6.30.tar.gz;
sha256 = "0pkk6cw0qd56kz2fkn768dcygbb4ncyvvmvyfiyli1a7yjh64xw7";
};
python = if pythonSupport then python else null;
@ -17,4 +17,6 @@ stdenv.mkDerivation {
buildInputs = if pythonSupport then [python] else [];
propagatedBuildInputs = [zlib];
postInstall = "ensureDir $out/nix-support; cp ${./setup-hook.sh} $out/nix-support/setup-hook";
}

View file

@ -0,0 +1,25 @@
addXMLCatalogs () {
if test -d $1/xml/dtd; then
for i in $(find $1/xml/dtd -name catalog.xml); do
export XML_CATALOG_FILES="$XML_CATALOG_FILES $i"
done
fi
}
if test -z "$libxmlHookDone"; then
libxmlHookDone=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/
# 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=(${envHooks[@]} addXMLCatalogs)
fi

View file

@ -3,10 +3,11 @@
assert libxml2 != null;
stdenv.mkDerivation {
name = "libxslt-1.1.21";
name = "libxslt-1.1.22";
src = fetchurl {
url = ftp://xmlsoft.org/libxml2/libxslt-1.1.21.tar.gz;
sha256 = "1q2lzdp75lx9w4mxgg99znnk94aacn34m7csmbf2kdwvnb7d9vyc";
url = ftp://xmlsoft.org/libxml2/libxslt-1.1.22.tar.gz;
sha256 = "1nj9pvn4ibhwxpl3ry9n6d7jahppcnqc7mi87nld4vsr2vp3j7sf";
};
buildInputs = [libxml2];
postInstall = "ensureDir $out/nix-support; ln -s ${libxml2}/nix-support/setup-hook $out/nix-support/";
}

View file

@ -4067,9 +4067,9 @@ rec {
gnome = recurseIntoAttrs (import ../desktops/gnome {
inherit fetchurl stdenv pkgconfig audiofile
flex bison popt zlib libxml2 libxslt
perl perlXMLParser docbook_xml_dtd_42 gettext x11
libtiff libjpeg libpng gtkLibs xlibs bzip2 libcm
python dbus_glib ncurses which libxml2Python
perl perlXMLParser docbook_xml_dtd_42 docbook_xml_dtd_412
gettext x11 libtiff libjpeg libpng gtkLibs xlibs bzip2
libcm python dbus_glib ncurses which libxml2Python
iconnamingutils;
});