From be31980848dee782c4504b88c57edcfbb72c6f6b Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Tue, 8 Nov 2016 10:36:12 +0100 Subject: libxslt: build python bindings and add a pythonPackages.libxslt alias. --- pkgs/development/libraries/libxslt/default.nix | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'pkgs/development/libraries/libxslt/default.nix') diff --git a/pkgs/development/libraries/libxslt/default.nix b/pkgs/development/libraries/libxslt/default.nix index 2afbfc2fe99..df054319479 100644 --- a/pkgs/development/libraries/libxslt/default.nix +++ b/pkgs/development/libraries/libxslt/default.nix @@ -1,4 +1,9 @@ -{ stdenv, fetchurl, fetchpatch, libxml2, findXMLCatalogs }: +{ stdenv, fetchurl, fetchpatch, libxml2, findXMLCatalogs +, pythonSupport ? true, python2 +}: + +assert pythonSupport -> python2 != null; +assert pythonSupport -> libxml2.pythonSupport; stdenv.mkDerivation rec { name = "libxslt-1.1.29"; @@ -10,26 +15,33 @@ stdenv.mkDerivation rec { patches = stdenv.lib.optional stdenv.isSunOS ./patch-ah.patch; - outputs = [ "bin" "dev" "out" "doc" ]; + outputs = [ "bin" "dev" "out" "doc" ] ++ stdenv.lib.optional pythonSupport "py"; - buildInputs = [ libxml2 ]; + buildInputs = [ libxml2.dev ] ++ stdenv.lib.optionals pythonSupport [ libxml2.py python2 ]; propagatedBuildInputs = [ findXMLCatalogs ]; configureFlags = [ - "--without-python" "--without-crypto" "--without-debug" "--without-mem-debug" "--without-debugger" - ]; + ] ++ stdenv.lib.optional pythonSupport "--with-python=${python2}"; postFixup = '' moveToOutput bin/xslt-config "$dev" moveToOutput lib/xsltConf.sh "$dev" moveToOutput share/man/man1 "$bin" + '' + stdenv.lib.optionalString pythonSupport '' + mkdir -p $py/nix-support + echo ${libxml2.py} >> $py/nix-support/propagated-native-build-inputs + moveToOutput lib/python2.7 "$py" ''; + passthru = { + inherit pythonSupport; + }; + meta = with stdenv.lib; { homepage = http://xmlsoft.org/XSLT/; description = "A C library and tools to do XSL transformations"; -- cgit 1.4.1