Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at flake-libs 161 lines 3.4 kB view raw
1{ 2 lib, 3 stdenv, 4 buildPackages, 5 replaceVars, 6 fetchFromGitHub, 7 fetchpatch, 8 meson, 9 mesonEmulatorHook, 10 appstream, 11 ninja, 12 pkg-config, 13 cmake, 14 gettext, 15 xmlto, 16 docbook-xsl-nons, 17 docbook_xml_dtd_45, 18 libxslt, 19 libstemmer, 20 glib, 21 xapian, 22 libxml2, 23 libxmlb, 24 libyaml, 25 gobject-introspection, 26 itstool, 27 gperf, 28 vala, 29 curl, 30 cairo, 31 gdk-pixbuf, 32 pango, 33 librsvg, 34 systemd, 35 nixosTests, 36 testers, 37 withIntrospection ? 38 lib.meta.availableOn stdenv.hostPlatform gobject-introspection 39 && stdenv.hostPlatform.emulatorAvailable buildPackages, 40 withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, 41}: 42 43stdenv.mkDerivation (finalAttrs: { 44 pname = "appstream"; 45 version = "1.0.4"; 46 47 outputs = [ 48 "out" 49 "dev" 50 "installedTests" 51 ]; 52 53 src = fetchFromGitHub { 54 owner = "ximion"; 55 repo = "appstream"; 56 rev = "v${finalAttrs.version}"; 57 sha256 = "sha256-UnSJcXH0yWK/dPKgbOx9x3iJjKcKNYFkD2Qs5c3FtM8="; 58 }; 59 60 patches = [ 61 # Fix hardcoded paths 62 (replaceVars ./fix-paths.patch { 63 libstemmer_includedir = "${lib.getDev libstemmer}/include"; 64 }) 65 66 # Allow installing installed tests to a separate output. 67 ./installed-tests-path.patch 68 69 (fetchpatch { 70 name = "static.patch"; 71 url = "https://github.com/ximion/appstream/commit/90675d8853188f65897d2453346cb0acd531b58f.patch"; 72 hash = "sha256-d3h5h7B/MP3Sun5YwYCqMHcw4PMMwg1YS/S9vsMzkQ4="; 73 }) 74 ]; 75 76 strictDeps = true; 77 78 depsBuildBuild = [ 79 pkg-config 80 ]; 81 82 nativeBuildInputs = 83 [ 84 meson 85 ninja 86 pkg-config 87 cmake 88 gettext 89 libxslt 90 xmlto 91 docbook-xsl-nons 92 docbook_xml_dtd_45 93 glib 94 itstool 95 gperf 96 ] 97 ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ 98 mesonEmulatorHook 99 ] 100 ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ 101 appstream 102 ] 103 ++ lib.optionals withIntrospection [ 104 gobject-introspection 105 vala 106 ]; 107 108 buildInputs = 109 [ 110 libstemmer 111 glib 112 xapian 113 libxml2 114 libxmlb 115 libyaml 116 curl 117 cairo 118 gdk-pixbuf 119 pango 120 librsvg 121 ] 122 ++ lib.optionals withSystemd [ 123 systemd 124 ]; 125 126 mesonFlags = 127 [ 128 "-Dapidocs=false" 129 "-Dc_args=-Wno-error=missing-include-dirs" 130 "-Ddocs=false" 131 "-Dvapi=true" 132 "-Dinstalled_test_prefix=${placeholder "installedTests"}" 133 "-Dcompose=true" 134 (lib.mesonBool "gir" withIntrospection) 135 ] 136 ++ lib.optionals (!withSystemd) [ 137 "-Dsystemd=false" 138 ]; 139 140 passthru.tests = { 141 installed-tests = nixosTests.installed-tests.appstream; 142 pkg-config = testers.hasPkgConfigModules { 143 package = finalAttrs.finalPackage; 144 }; 145 }; 146 147 meta = with lib; { 148 description = "Software metadata handling library"; 149 longDescription = '' 150 AppStream is a cross-distro effort for building Software-Center applications 151 and enhancing metadata provided by software components. It provides 152 specifications for meta-information which is shipped by upstream projects and 153 can be consumed by other software. 154 ''; 155 homepage = "https://www.freedesktop.org/wiki/Distributions/AppStream/"; 156 license = licenses.lgpl21Plus; 157 mainProgram = "appstreamcli"; 158 platforms = platforms.unix; 159 pkgConfigModules = [ "appstream" ]; 160 }; 161})