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 rec {
19 pname = "libxslt";
20 version = "1.1.38";
21
22 outputs = [ "bin" "dev" "out" "doc" "devdoc" ] ++ lib.optional pythonSupport "py";
23 outputMan = "bin";
24
25 src = fetchurl {
26 url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
27 sha256 = "HzJFBCWBmgmsr/Krelp/ii7HlW5QXXvutF6EPQ4eyrE=";
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 postFixup = ''
64 moveToOutput bin/xslt-config "$dev"
65 moveToOutput lib/xsltConf.sh "$dev"
66 '' + lib.optionalString pythonSupport ''
67 mkdir -p $py/nix-support
68 echo ${libxml2.py} >> $py/nix-support/propagated-build-inputs
69 moveToOutput ${python.sitePackages} "$py"
70 '';
71
72 passthru = {
73 inherit pythonSupport;
74
75 updateScript = gnome.updateScript {
76 packageName = pname;
77 versionPolicy = "none";
78 };
79 };
80
81 meta = with lib; {
82 homepage = "https://gitlab.gnome.org/GNOME/libxslt";
83 description = "A C library and tools to do XSL transformations";
84 license = licenses.mit;
85 platforms = platforms.all;
86 maintainers = with maintainers; [ eelco jtojnar ];
87 broken = pythonSupport && !libxml2.pythonSupport; # see #73102 for why this is not an assert
88 };
89}