2016-12-11 09:06:40 -08:00
|
|
|
{ stdenv, fetchurl, fetchpatch, libxml2, findXMLCatalogs, python2
|
2017-02-10 22:51:13 -08:00
|
|
|
, buildPlatform, hostPlatform
|
2016-12-11 09:06:40 -08:00
|
|
|
, cryptoSupport ? false
|
2017-02-10 22:51:13 -08:00
|
|
|
, pythonSupport ? buildPlatform == hostPlatform
|
2016-11-08 01:36:12 -08:00
|
|
|
}:
|
|
|
|
|
|
|
|
assert pythonSupport -> python2 != null;
|
|
|
|
assert pythonSupport -> libxml2.pythonSupport;
|
2006-10-12 08:43:01 -07:00
|
|
|
|
2016-12-11 09:06:40 -08:00
|
|
|
with stdenv.lib;
|
|
|
|
|
2009-10-30 05:42:48 -07:00
|
|
|
stdenv.mkDerivation rec {
|
2017-11-09 03:26:09 -08:00
|
|
|
pname = "libxslt";
|
2018-01-28 07:16:27 -08:00
|
|
|
version = "1.1.32";
|
2017-11-09 03:26:09 -08:00
|
|
|
name = pname + "-" + version;
|
2012-09-28 14:19:48 -07:00
|
|
|
|
2006-10-12 08:43:01 -07:00
|
|
|
src = fetchurl {
|
2015-04-04 07:07:31 -07:00
|
|
|
url = "http://xmlsoft.org/sources/${name}.tar.gz";
|
2018-01-28 07:16:27 -08:00
|
|
|
sha256 = "0q2l6m56iv3ysxgm2walhg4c9wp7q183jb328687i9zlp85csvjj";
|
2006-10-12 08:43:01 -07:00
|
|
|
};
|
2012-09-28 14:19:48 -07:00
|
|
|
|
2018-01-28 07:16:27 -08:00
|
|
|
patches = stdenv.lib.optional stdenv.isSunOS ./patch-ah.patch;
|
2016-02-06 04:21:18 -08:00
|
|
|
|
2017-05-23 06:36:02 -07: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 02:14:14 -07:00
|
|
|
outputs = [ "bin" "dev" "out" "man" "doc" ] ++ stdenv.lib.optional pythonSupport "py";
|
2015-07-26 15:25:53 -07:00
|
|
|
|
2016-11-08 01:36:12 -08:00
|
|
|
buildInputs = [ libxml2.dev ] ++ stdenv.lib.optionals pythonSupport [ libxml2.py python2 ];
|
2012-09-28 14:19:48 -07:00
|
|
|
|
2014-11-25 08:52:43 -08:00
|
|
|
propagatedBuildInputs = [ findXMLCatalogs ];
|
|
|
|
|
2018-01-22 16:57:13 -08:00
|
|
|
configureFlags = [
|
|
|
|
"--with-libxml-prefix=${libxml2.dev}"
|
2013-03-25 05:43:45 -07:00
|
|
|
"--without-debug"
|
|
|
|
"--without-mem-debug"
|
|
|
|
"--without-debugger"
|
2018-01-22 16:57:13 -08:00
|
|
|
] ++ optional pythonSupport "--with-python=${python2}"
|
|
|
|
++ optional (!cryptoSupport) "--without-crypto";
|
2013-03-25 05:43:45 -07:00
|
|
|
|
2015-10-05 04:23:01 -07:00
|
|
|
postFixup = ''
|
2015-12-02 01:03:23 -08:00
|
|
|
moveToOutput bin/xslt-config "$dev"
|
|
|
|
moveToOutput lib/xsltConf.sh "$dev"
|
|
|
|
moveToOutput share/man/man1 "$bin"
|
2016-12-11 09:06:40 -08:00
|
|
|
'' + optionalString pythonSupport ''
|
2016-11-08 01:36:12 -08:00
|
|
|
mkdir -p $py/nix-support
|
2017-11-17 10:26:21 -08:00
|
|
|
echo ${libxml2.py} >> $py/nix-support/propagated-build-inputs
|
2016-11-08 01:36:12 -08:00
|
|
|
moveToOutput lib/python2.7 "$py"
|
2015-10-05 04:23:01 -07:00
|
|
|
'';
|
|
|
|
|
2016-11-08 01:36:12 -08:00
|
|
|
passthru = {
|
|
|
|
inherit pythonSupport;
|
|
|
|
};
|
|
|
|
|
2015-10-05 04:23:01 -07:00
|
|
|
meta = with stdenv.lib; {
|
2009-02-03 08:14:23 -08:00
|
|
|
homepage = http://xmlsoft.org/XSLT/;
|
|
|
|
description = "A C library and tools to do XSL transformations";
|
2017-04-28 20:02:37 -07:00
|
|
|
license = licenses.mit;
|
2015-10-05 04:23:01 -07:00
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = [ maintainers.eelco ];
|
2009-02-03 08:14:23 -08:00
|
|
|
};
|
2006-10-12 08:43:01 -07:00
|
|
|
}
|