2016-12-11 17:06:40 +00:00
|
|
|
{ stdenv, fetchurl, fetchpatch, libxml2, findXMLCatalogs, python2
|
2017-02-11 06:51:13 +00:00
|
|
|
, buildPlatform, hostPlatform
|
2016-12-11 17:06:40 +00:00
|
|
|
, cryptoSupport ? false
|
2017-02-11 06:51:13 +00:00
|
|
|
, pythonSupport ? buildPlatform == hostPlatform
|
2016-11-08 09:36:12 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
assert pythonSupport -> python2 != null;
|
|
|
|
assert pythonSupport -> libxml2.pythonSupport;
|
2006-10-12 16:43:01 +01:00
|
|
|
|
2016-12-11 17:06:40 +00:00
|
|
|
with stdenv.lib;
|
|
|
|
|
2009-10-30 12:42:48 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2016-09-28 14:40:37 +01:00
|
|
|
name = "libxslt-1.1.29";
|
2012-09-28 22:19:48 +01:00
|
|
|
|
2006-10-12 16:43:01 +01:00
|
|
|
src = fetchurl {
|
2015-04-04 15:07:31 +01:00
|
|
|
url = "http://xmlsoft.org/sources/${name}.tar.gz";
|
2016-09-28 14:40:37 +01:00
|
|
|
sha256 = "1klh81xbm9ppzgqk339097i39b7fnpmlj8lzn8bpczl3aww6x5xm";
|
2006-10-12 16:43:01 +01:00
|
|
|
};
|
2012-09-28 22:19:48 +01:00
|
|
|
|
2017-08-16 14:10:09 +01:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "CVE-2017-5029";
|
|
|
|
url = "https://git.gnome.org/browse/libxslt/"
|
|
|
|
+ "patch/?id=08ab2774b870de1c7b5a48693df75e8154addae5";
|
|
|
|
sha256 = "10azfmyffjf9d7b5js4ipxw9f20qi0kw3zq34bpqmbcpq3l338ky";
|
|
|
|
})
|
|
|
|
] ++ stdenv.lib.optional stdenv.isSunOS ./patch-ah.patch;
|
2016-02-06 12:21:18 +00:00
|
|
|
|
2017-05-23 14:36:02 +01:00
|
|
|
# fixes: can't build x86_64-unknown-cygwin shared library unless -no-undefined is specified
|
|
|
|
postPatch = optionalString hostPlatform.isCygwin ''
|
|
|
|
substituteInPlace tests/plugins/Makefile.in \
|
|
|
|
--replace 'la_LDFLAGS =' 'la_LDFLAGS = $(WIN32_EXTRA_LDFLAGS)'
|
|
|
|
'';
|
|
|
|
|
2017-07-11 10:14:14 +01:00
|
|
|
outputs = [ "bin" "dev" "out" "man" "doc" ] ++ stdenv.lib.optional pythonSupport "py";
|
2015-07-26 23:25:53 +01:00
|
|
|
|
2016-11-08 09:36:12 +00:00
|
|
|
buildInputs = [ libxml2.dev ] ++ stdenv.lib.optionals pythonSupport [ libxml2.py python2 ];
|
2012-09-28 22:19:48 +01:00
|
|
|
|
2014-11-25 16:52:43 +00:00
|
|
|
propagatedBuildInputs = [ findXMLCatalogs ];
|
|
|
|
|
2016-12-11 17:06:40 +00:00
|
|
|
# TODO move cryptoSupport as last flag, when upgrading libxslt
|
|
|
|
configureFlags = optional (!cryptoSupport) "--without-crypto" ++ [
|
2013-03-25 12:43:45 +00:00
|
|
|
"--without-debug"
|
|
|
|
"--without-mem-debug"
|
|
|
|
"--without-debugger"
|
2016-12-11 17:06:40 +00:00
|
|
|
] ++ optional pythonSupport "--with-python=${python2}";
|
2013-03-25 12:43:45 +00:00
|
|
|
|
2015-10-05 12:23:01 +01:00
|
|
|
postFixup = ''
|
2015-12-02 09:03:23 +00:00
|
|
|
moveToOutput bin/xslt-config "$dev"
|
|
|
|
moveToOutput lib/xsltConf.sh "$dev"
|
|
|
|
moveToOutput share/man/man1 "$bin"
|
2016-12-11 17:06:40 +00:00
|
|
|
'' + optionalString pythonSupport ''
|
2016-11-08 09:36:12 +00:00
|
|
|
mkdir -p $py/nix-support
|
|
|
|
echo ${libxml2.py} >> $py/nix-support/propagated-native-build-inputs
|
|
|
|
moveToOutput lib/python2.7 "$py"
|
2015-10-05 12:23:01 +01:00
|
|
|
'';
|
|
|
|
|
2016-11-08 09:36:12 +00:00
|
|
|
passthru = {
|
|
|
|
inherit pythonSupport;
|
|
|
|
};
|
|
|
|
|
2015-10-05 12:23:01 +01:00
|
|
|
meta = with stdenv.lib; {
|
2009-02-03 16:14:23 +00:00
|
|
|
homepage = http://xmlsoft.org/XSLT/;
|
|
|
|
description = "A C library and tools to do XSL transformations";
|
2017-04-29 04:02:37 +01:00
|
|
|
license = licenses.mit;
|
2015-10-05 12:23:01 +01:00
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = [ maintainers.eelco ];
|
2009-02-03 16:14:23 +00:00
|
|
|
};
|
2006-10-12 16:43:01 +01:00
|
|
|
}
|