3
0
Fork 0
forked from mirrors/nixpkgs

libxml2,libxslt: split into multiple outputs

Fixed all references, hopefully.
libxml2Python is slightly hacky now, but it seems to work.
This commit is contained in:
Vladimír Čunát 2015-10-05 13:23:01 +02:00
parent f8c211fd2b
commit 38313d5d87
32 changed files with 83 additions and 79 deletions

View file

@ -43,7 +43,7 @@ let
echo "for hints about the offending path)."
exit 1
fi
${libxslt}/bin/xsltproc \
${libxslt.bin}/bin/xsltproc \
--stringparam revision '${revision}' \
-o $out ${./options-to-docbook.xsl} $optionsXML
'';

View file

@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
};
patchPhase = ''
sed -e "s#xsltproc#${libxslt}/bin/xsltproc#" -i Makefile
sed -e "s#xsltproc#${libxslt.bin}/bin/xsltproc#" -i Makefile
sed -e "s#PREFIX = /usr/local#PREFIX = $out#" -i Makefile
'';

View file

@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
'';
NIX_CFLAGS_COMPILE =
"-I${libxml2}/include/libxml2 -I${json-c-0-11}/include/json-c";
"-I${libxml2.dev}/include/libxml2 -I${json-c-0-11}/include/json-c";
NIX_LDFLAGS = "-lsqlite3 -lcurl -lxml2 -lstfl -ljson";

View file

@ -11,7 +11,7 @@ stdenv.mkDerivation {
sha256 = "189qndkfq9kgv3qi3wx8ivla4j8fxr4iv7c8y9rjrjaz8jwdkn5x";
};
NIX_CFLAGS_COMPILE = "-I${glib}/include/glib-2.0 -I${glib}/lib/glib-2.0/include -I${libxml2}/include/libxml2 -I${sqlcipher}/include/sqlcipher";
NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/glib-2.0 -I${glib.dev}/lib/glib-2.0/include -I${libxml2.dev}/include/libxml2 -I${sqlcipher}/include/sqlcipher";
patchPhase = ''
# Fix build error

View file

@ -9,7 +9,7 @@ stdenv.mkDerivation {
sha256 = "0l2n4pr1hq66q6qa073hrdx3s3d7iw54z8ay1zy82zhk2rwhsavp";
};
NIX_CFLAGS_COMPILE = "-I${glib}/include/glib-2.0 -I${glib}/lib/glib-2.0/include -I${libxml2}/include/libxml2";
NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/glib-2.0 -I${glib.dev}/lib/glib-2.0/include -I${libxml2.dev}/include/libxml2";
patchPhase = ''
sed -i 's/UpnpString_get_String(es_event->PublisherUrl)/es_event->PublisherUrl/' \

View file

@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
substituteInPlace $f --replace grep ${gnugrep}/bin/grep
substituteInPlace $f --replace groff ${groff}/bin/groff
substituteInPlace $f --replace gunzip ${gzip}/bin/gunzip
substituteInPlace $f --replace iconv ${libiconv}/bin/iconv
substituteInPlace $f --replace iconv ${libiconv.bin}/bin/iconv
substituteInPlace $f --replace lyx ${lyx}/bin/lyx
substituteInPlace $f --replace pdftotext ${xpdf}/bin/pdftotext
substituteInPlace $f --replace pstotext ${ghostscript}/bin/ps2ascii
@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
substituteInPlace $f --replace tar ${gnutar}/bin/tar
substituteInPlace $f --replace unzip ${unzip}/bin/unzip
substituteInPlace $f --replace xls2csv ${catdoc}/bin/xls2csv
substituteInPlace $f --replace xsltproc ${libxslt}/bin/xsltproc
substituteInPlace $f --replace xsltproc ${libxslt.bin}/bin/xsltproc
substituteInPlace $f --replace unrtf ${unrtf}/bin/unrtf
substituteInPlace $f --replace untex ${untex}/bin/untex
substituteInPlace $f --replace wpd2html ${libwpd}/bin/wpd2html

View file

@ -32,8 +32,8 @@ in stdenv.mkDerivation rec {
bundle config --local build.nokogiri --use-system-libraries \
--with-iconv-dir=${libiconv} \
--with-xslt-dir=${libxslt} \
--with-xml2-dir=${libxml2} \
--with-xslt-dir=${libxslt.out} \
--with-xml2-dir=${libxml2.out} \
--with-pkg-config \
--with-pg-config=${postgresql}/bin/pg_config

View file

@ -67,7 +67,7 @@ let
libxml2 = {
configureFlags = [
"--with-libxml-dir=${libxml2}"
"--with-libxml-dir=${libxml2.dev}"
];
buildInputs = [ libxml2 ];
};

View file

@ -63,12 +63,12 @@ in
buildFlags = [
"--use-system-libraries"
"--with-zlib-dir=${zlib}"
"--with-xml2-lib=${libxml2}/lib"
"--with-xml2-include=${libxml2}/include/libxml2"
"--with-xslt-lib=${libxslt}/lib"
"--with-xslt-include=${libxslt}/include"
"--with-exslt-lib=${libxslt}/lib"
"--with-exslt-include=${libxslt}/include"
"--with-xml2-lib=${libxml2.out}/lib"
"--with-xml2-include=${libxml2.dev}/include/libxml2"
"--with-xslt-lib=${libxslt.out}/lib"
"--with-xslt-include=${libxslt.dev}/include"
"--with-exslt-lib=${libxslt.out}/lib"
"--with-exslt-include=${libxslt.dev}/include"
] ++ lib.optional stdenv.isDarwin "--with-iconv-dir=${libiconv}";
buildInputs = lib.optional stdenv.isDarwin darwin.libobjc;
};

View file

@ -82,8 +82,8 @@ in
nokogiri = {
buildInputs = [ libxml2 ];
buildFlags =
[ "--with-xml2-dir=${libxml2} --with-xml2-include=${libxml2}/include/libxml2"
"--with-xslt-dir=${libxslt} --use-system-libraries"
[ "--with-xml2-dir=${libxml2.out} --with-xml2-include=${libxml2.dev}/include/libxml2"
"--with-xslt-dir=${libxslt.out} --use-system-libraries"
libiconv
];
};

View file

@ -67,7 +67,7 @@ stdenv.mkDerivation rec {
postInstall = ''
cd "$out/etc/fonts"
rm conf.d/{50-user,51-local}.conf
"${libxslt}/bin/xsltproc" --stringparam fontDirectories "${fontbhttf}" \
"${libxslt.bin}/bin/xsltproc" --stringparam fontDirectories "${fontbhttf}" \
--stringparam fontconfig "$out" \
--stringparam fontconfigConfigVersion "${configVersion}" \
--path $out/share/xml/fontconfig \

View file

@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
postInstall = ''
ln -sv ${libsoup}/include/*/libsoup $out/include
ln -sv ${libxml2}/include/*/libxml $out/include
ln -sv ${libxml2.dev}/include/*/libxml $out/include
ln -sv ${gssdp}/include/*/libgssdp $out/include
'';

View file

@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
configureFlags = "--disable-appliance --disable-daemon";
patches = [ ./libguestfs-syms.patch ];
NIX_CFLAGS_COMPILE="-I${libxml2}/include/libxml2/";
NIX_CFLAGS_COMPILE="-I${libxml2.dev}/include/libxml2/";
preConfigure = ''
AUTOPOINT=true LIBTOOLIZE=true autoreconf --verbose --install

View file

@ -1,14 +1,11 @@
{ stdenv, fetchurl, zlib, xz, python ? null, pythonSupport ? true, findXMLCatalogs }:
assert pythonSupport -> python != null;
#TODO: share most stuff between python and non-python builds, perhaps via multiple-output
{ stdenv, fetchurl, zlib, xz, python, findXMLCatalogs }:
let
version = "2.9.2";
inherit (stdenv.lib) optional;
in
stdenv.mkDerivation (rec {
stdenv.mkDerivation rec {
name = "libxml2-${version}";
src = fetchurl {
@ -16,20 +13,32 @@ stdenv.mkDerivation (rec {
sha256 = "1g6mf03xcabmk5ing1lwqmasr803616gb2xhn7pll10x2l5w6y2i";
};
outputs = [ "out" "doc" ];
outputs = [ "dev" "out" "bin" "doc" "py" ];
propagatedOutputs = "out bin py";
buildInputs = stdenv.lib.optional pythonSupport python
buildInputs = [ python ]
# Libxml2 has an optional dependency on liblzma. However, on impure
# platforms, it may end up using that from /usr/lib, and thus lack a
# RUNPATH for that, leading to undefined references for its users.
++ stdenv.lib.optional stdenv.isFreeBSD xz;
++ optional stdenv.isFreeBSD xz;
propagatedBuildInputs = [ zlib findXMLCatalogs ];
passthru = { inherit pythonSupport version; };
configureFlags = "--with-python=${python}";
enableParallelBuilding = true;
preInstall = ''substituteInPlace python/libxml2mod.la --replace "${python}" "$py"'';
installFlags = ''pythondir="$(py)/lib/${python.libPrefix}/site-packages"'';
postFixup = ''
_moveToOutput bin/xml2-config "$dev"
_moveToOutput lib/xml2Conf.sh "$dev"
_moveToOutput share/man/man1 "$bin"
'';
passthru = { inherit version; pythonSupport = true; };
meta = {
homepage = http://xmlsoft.org/;
description = "An XML parsing library for C";
@ -37,15 +46,5 @@ stdenv.mkDerivation (rec {
platforms = stdenv.lib.platforms.unix;
maintainers = [ stdenv.lib.maintainers.eelco ];
};
} // stdenv.lib.optionalAttrs pythonSupport {
configureFlags = "--with-python=${python}";
# this is a pair of ugly hacks to make python stuff install into the right place
preInstall = ''substituteInPlace python/libxml2mod.la --replace "${python}" "$out"'';
installFlags = ''pythondir="$(out)/lib/${python.libPrefix}/site-packages"'';
} // stdenv.lib.optionalAttrs (!pythonSupport) {
configureFlags = "--with-python=no"; # otherwise build impurity bites us
})
}

View file

@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
sha256 = "13029baw9kkyjgr7q3jccw2mz38amq7mmpr5p3bh775qawd1bisz";
};
outputs = [ "out" "doc" ];
outputs = [ "dev" "out" "bin" "doc" ];
buildInputs = [ libxml2 ];
@ -17,7 +17,6 @@ stdenv.mkDerivation rec {
patches = stdenv.lib.optionals stdenv.isSunOS [ ./patch-ah.patch ];
configureFlags = [
"--with-libxml-prefix=${libxml2}"
"--without-python"
"--without-crypto"
"--without-debug"
@ -25,11 +24,17 @@ stdenv.mkDerivation rec {
"--without-debugger"
];
meta = {
postFixup = ''
_moveToOutput bin/xslt-config "$dev"
_moveToOutput lib/xsltConf.sh "$dev"
_moveToOutput share/man/man1 "$bin"
'';
meta = with stdenv.lib; {
homepage = http://xmlsoft.org/XSLT/;
description = "A C library and tools to do XSL transformations";
license = "bsd";
platforms = stdenv.lib.platforms.unix;
maintainers = [ stdenv.lib.maintainers.eelco ];
platforms = platforms.unix;
maintainers = [ maintainers.eelco ];
};
}

View file

@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
substituteInPlace CMakeLists.txt \
--replace "tidy/tidy.h" "tidy.h" \
--replace "/usr/include/tidy" "${libtidy}/include" \
--replace "/usr/include/libxml2" "${libxml2}/include/libxml2" \
--replace "/usr/include/libxml2" "${libxml2.dev}/include/libxml2" \
'';
cmakeFlags = [

View file

@ -16,8 +16,8 @@ stdenv.mkDerivation {
preBuild = ''
cp Makefile.linux Makefile
sed -i 's|/usr/include/libxml2|${libxml2}/include/libxml2|' Makefile
sed -i 's|-lxml2|-lxml2 -L${libxml2}/lib|' Makefile
sed -i 's|/usr/include/libxml2|${libxml2.dev}/include/libxml2|' Makefile
sed -i 's|-lxml2|-lxml2 -L${libxml2.out}/lib|' Makefile
sed -i 's|XPDF = xpdf_3.01|XPDF = ${libxpdf}/lib|' Makefile
mkdir exe

View file

@ -1558,7 +1558,7 @@ let
});
xml2 = old.xml2.overrideDerivation (attrs: {
preConfigure = "export LIBXML_INCDIR=${pkgs.libxml2}/include/libxml2";
preConfigure = "export LIBXML_INCDIR=${pkgs.libxml2.dev}/include/libxml2";
});
curl = old.curl.overrideDerivation (attrs: {

View file

@ -57,8 +57,8 @@ stdenv.mkDerivation rec {
# openssl: c_rehash, openssl
rm opt/vagrant/embedded/bin/{c_rehash,openssl}
ln -s ${openssl}/bin/c_rehash opt/vagrant/embedded/bin
ln -s ${openssl}/bin/openssl opt/vagrant/embedded/bin
ln -s ${openssl.bin}/bin/c_rehash opt/vagrant/embedded/bin
ln -s ${openssl.bin}/bin/openssl opt/vagrant/embedded/bin
# ruby: erb, gem, irb, rake, rdoc, ri, ruby, testrb
rm opt/vagrant/embedded/bin/{erb,gem,irb,rake,rdoc,ri,ruby,testrb}
@ -77,14 +77,14 @@ stdenv.mkDerivation rec {
# libxml: xml2-config, xmlcatalog, xmllint
rm opt/vagrant/embedded/bin/{xml2-config,xmlcatalog,xmllint}
ln -s ${libxml2}/bin/xml2-config opt/vagrant/embedded/bin
ln -s ${libxml2}/bin/xmlcatalog opt/vagrant/embedded/bin
ln -s ${libxml2}/bin/xmllint opt/vagrant/embedded/bin
ln -s ${libxml2.dev}/bin/xml2-config opt/vagrant/embedded/bin
ln -s ${libxml2.bin}/bin/xmlcatalog opt/vagrant/embedded/bin
ln -s ${libxml2.bin}/bin/xmllint opt/vagrant/embedded/bin
# libxslt: xslt-config, xsltproc
rm opt/vagrant/embedded/bin/{xslt-config,xsltproc}
ln -s ${libxslt}/bin/xslt-config opt/vagrant/embedded/bin
ln -s ${libxslt}/bin/xsltproc opt/vagrant/embedded/bin
ln -s ${libxslt.dev}/bin/xslt-config opt/vagrant/embedded/bin
ln -s ${libxslt.bin}/bin/xsltproc opt/vagrant/embedded/bin
mkdir -p "$out"
cp -r opt "$out"

View file

@ -9,7 +9,7 @@ stdenv.mkDerivation {
sha256 = "1k35xppfqi3qfysv81xq3hj4qdy9j2ciinbkfdcmwclcsf3nh94z";
};
NIX_CFLAGS_COMPILE = "-I${libxml2}/include/libxml2";
NIX_CFLAGS_COMPILE = "-I${libxml2.dev}/include/libxml2";
# The breakpad fails to build on x86_64, and it's only to report bugs upstream
cmakeFlags = [ "-DBREAKPAD=0" ];

View file

@ -202,10 +202,10 @@ stdenv.mkDerivation rec {
cp libs/ThLB* $out/share/ufr2filter
)
patchelf --set-rpath "$out/lib32:${i686_libxml2}/lib" $out/lib32/libcanonufr2.so.1.0.0
patchelf --set-rpath "$out/lib32:${i686_libxml2.out}/lib" $out/lib32/libcanonufr2.so.1.0.0
patchelf --interpreter "$(cat ${i686_NIX_GCC}/nix-support/dynamic-linker)" --set-rpath "$out/lib32" $out/bin/cnpkmoduleufr2
patchelf --interpreter "$(cat ${i686_NIX_GCC}/nix-support/dynamic-linker)" --set-rpath "$out/lib32:${i686_libxml2}/lib" $out/bin/cnpkbidi
patchelf --interpreter "$(cat ${i686_NIX_GCC}/nix-support/dynamic-linker)" --set-rpath "$out/lib32:${i686_libxml2.out}/lib" $out/bin/cnpkbidi
makeWrapper "${ghostscript}/bin/gs" "$out/bin/gs" \
--prefix LD_LIBRARY_PATH ":" "$out/lib" \

View file

@ -45,7 +45,7 @@ stdenv.mkDerivation rec {
${optionalString proxySupport "--enable-proxy"}
${optionalString sslSupport "--enable-ssl"}
${optionalString luaSupport "--enable-lua --with-lua=${lua5}"}
${optionalString libxml2Support "--with-libxml2=${libxml2}/include/libxml2"}
${optionalString libxml2Support "--with-libxml2=${libxml2.dev}/include/libxml2"}
'';
postInstall = ''

View file

@ -149,7 +149,7 @@ stdenv.mkDerivation rec {
NIX_CFLAGS_COMPILE = optionalString modsecurity "-I${aprutil}/include/apr-1 -I${apacheHttpd}/include -I${apr}/include/apr-1 -I${yajl}/include";
preConfigure = ''
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${libxml2}/include/libxml2 $additionalFlags"
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${libxml2.dev}/include/libxml2 $additionalFlags"
'';
meta = {

View file

@ -117,7 +117,7 @@ stdenv.mkDerivation rec {
additionalFlags = optionalString stdenv.isDarwin "-Wno-error=deprecated-declarations";
preConfigure = ''
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${libxml2}/include/libxml2 $additionalFlags"
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${libxml2.dev}/include/libxml2 $additionalFlags"
'';
postInstall = ''

View file

@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
'';
preConfigure = ''
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${libxml2}/include/libxml2 $additionalFlags"
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${libxml2.dev}/include/libxml2 $additionalFlags"
export PATH="$PATH:${stdenv.cc.libc.bin}/bin"
patchShebangs .
'';

View file

@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
makeFlags = "DESTDIR=$(out)";
NIX_CFLAGS_COMPILE = [ "-I${libxml2}/include/libxml2" ];
NIX_CFLAGS_COMPILE = [ "-I${libxml2.dev}/include/libxml2" ];
# Probably a hack, but using DESTDIR and PREFIX makes everything work!
postInstall = ''

View file

@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
preConfigure = ''
export PKG_CONFIG=${pkgconfig}/bin/pkg-config
export LIBXML2_CFLAGS="-I ${libxml2}/include/libxml2"
export LIBXML2_LIBS="-L${libxml2}/lib -lxml2"
export LIBXML2_CFLAGS="-I ${libxml2.dev}/include/libxml2"
export LIBXML2_LIBS="-L${libxml2.out}/lib -lxml2"
'';
configureFlags = [

View file

@ -1,4 +1,4 @@
{ stdenv, lib, fetchurl
{ stdenv, lib, fetchurl, pkgconfig
, curl, apacheHttpd, pcre, apr, aprutil, libxml2 }:
with lib;
@ -12,6 +12,7 @@ stdenv.mkDerivation rec {
sha256 = "e2bbf789966c1f80094d88d9085a81bde082b2054f8e38e0db571ca49208f434";
};
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ curl apacheHttpd pcre apr aprutil libxml2 ];
configureFlags = [
"--enable-standalone-module"

View file

@ -27,7 +27,7 @@ in stdenv.mkDerivation {
patchShebangs .
'';
NIX_CFLAGS_COMPILE = "-I${libxml2}/include/libxml2";
NIX_CFLAGS_COMPILE = "-I${libxml2.dev}/include/libxml2";
buildInputs = [ autoconf automake openssl libxml2 ];

View file

@ -237,12 +237,12 @@ stdenv.mkDerivation rec {
# We can remove PATH= when those impurities are fixed.
sed -e "s|^ENV =.*|ENV = dict(XML_CATALOG_FILES='${docbook_xml_dtd_45}/xml/dtd/docbook/catalog.xml ${docbook5_xsl}/xml/xsl/docbook/catalog.xml ${docbook_xsl}/xml/xsl/docbook/catalog.xml', PATH='${tetex}/bin:${coreutils}/bin:${gnused}/bin')|" \
-e "s|^ASCIIDOC =.*|ASCIIDOC = '$out/bin/asciidoc'|" \
-e "s|^XSLTPROC =.*|XSLTPROC = '${libxslt}/bin/xsltproc'|" \
-e "s|^XSLTPROC =.*|XSLTPROC = '${libxslt.bin}/bin/xsltproc'|" \
-e "s|^DBLATEX =.*|DBLATEX = '${dblatexFull}/bin/dblatex'|" \
-e "s|^FOP =.*|FOP = '${fop}/bin/fop'|" \
-e "s|^W3M =.*|W3M = '${w3m}/bin/w3m'|" \
-e "s|^LYNX =.*|LYNX = '${lynx}/bin/lynx'|" \
-e "s|^XMLLINT =.*|XMLLINT = '${libxml2}/bin/xmllint'|" \
-e "s|^XMLLINT =.*|XMLLINT = '${libxml2.bin}/bin/xmllint'|" \
-e "s|^EPUBCHECK =.*|EPUBCHECK = 'nixpkgs_is_missing_epubcheck'|" \
-i a2x.py
'' + ''

View file

@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
postInstall = ''
wrapProgram "$out/bin/xmlto" \
--prefix PATH : "${libxslt}/bin:${libxml2}/bin:${getopt}/bin"
--prefix PATH : "${libxslt.bin}/bin:${libxml2.bin}/bin:${getopt}/bin"
# `w3m' is needed for HTML to text conversions.
substituteInPlace "$out/share/xmlto/format/docbook/txt" \

View file

@ -7480,14 +7480,13 @@ let
libxmi = callPackage ../development/libraries/libxmi { };
libxml2 = callPackage ../development/libraries/libxml2 {
pythonSupport = false;
libxml2 = callPackage ../development/libraries/libxml2 { };
libxml2Python = pkgs.buildEnv { # slightly hacky
name = "libxml2+py-${pkgs.libxml2.version}";
paths = with libxml2; [ dev bin py ];
inherit (pkgs.libxml2) passthru;
};
libxml2Python = lowPrio (libxml2.override {
pythonSupport = true;
});
libxmlxx = callPackage ../development/libraries/libxmlxx { };
libxmp = callPackage ../development/libraries/libxmp { };