1{ lib
2, stdenv
3, fetchurl
4, pkg-config
5, autoreconfHook
6, libxml2
7, findXMLCatalogs
8, gettext
9, python
10, ncurses
11, libxcrypt
12, libgcrypt
13, cryptoSupport ? false
14, pythonSupport ? libxml2.pythonSupport
15, gnome
16}:
17
18stdenv.mkDerivation (finalAttrs: {
19 pname = "libxslt";
20 version = "1.1.42";
21
22 outputs = [ "bin" "dev" "out" "doc" "devdoc" ] ++ lib.optional pythonSupport "py";
23 outputMan = "bin";
24
25 src = fetchurl {
26 url = "mirror://gnome/sources/libxslt/${lib.versions.majorMinor finalAttrs.version}/libxslt-${finalAttrs.version}.tar.xz";
27 hash = "sha256-hcpiysDUH8d9P2Az2p32/XPSDqL8GLCjYJ/7QRDhuus=";
28 };
29
30 strictDeps = true;
31
32 nativeBuildInputs = [
33 pkg-config
34 autoreconfHook
35 ];
36
37 buildInputs = [
38 libxml2.dev libxcrypt
39 ] ++ lib.optionals stdenv.isDarwin [
40 gettext
41 ] ++ lib.optionals pythonSupport [
42 libxml2.py
43 python
44 ncurses
45 ] ++ lib.optionals cryptoSupport [
46 libgcrypt
47 ];
48
49 propagatedBuildInputs = [
50 findXMLCatalogs
51 ];
52
53 configureFlags = [
54 "--without-debug"
55 "--without-mem-debug"
56 "--without-debugger"
57 (lib.withFeature pythonSupport "python")
58 (lib.optionalString pythonSupport "PYTHON=${python.pythonOnBuildForHost.interpreter}")
59 ] ++ lib.optionals (!cryptoSupport) [
60 "--without-crypto"
61 ];
62
63 enableParallelBuilding = true;
64
65 postFixup = ''
66 moveToOutput bin/xslt-config "$dev"
67 moveToOutput lib/xsltConf.sh "$dev"
68 '' + lib.optionalString pythonSupport ''
69 mkdir -p $py/nix-support
70 echo ${libxml2.py} >> $py/nix-support/propagated-build-inputs
71 moveToOutput ${python.sitePackages} "$py"
72 '';
73
74 passthru = {
75 inherit pythonSupport;
76
77 updateScript = gnome.updateScript {
78 packageName = "libxslt";
79 versionPolicy = "none";
80 };
81 };
82
83 meta = with lib; {
84 homepage = "https://gitlab.gnome.org/GNOME/libxslt";
85 description = "C library and tools to do XSL transformations";
86 license = licenses.mit;
87 platforms = platforms.all;
88 maintainers = with maintainers; [ eelco jtojnar ];
89 broken = pythonSupport && !libxml2.pythonSupport; # see #73102 for why this is not an assert
90 };
91})