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