1{ stdenv, fetchpatch, fetchFromGitHub, meson, ninja, pkgconfig, gettext
2, xmlto, docbook_xsl, docbook_xml_dtd_45, libxslt
3, libstemmer, glib, xapian, libxml2, libyaml, gobjectIntrospection
4, pcre, itstool
5}:
6
7stdenv.mkDerivation rec {
8 name = "appstream-${version}";
9 version = "0.11.8";
10
11 src = fetchFromGitHub {
12 owner = "ximion";
13 repo = "appstream";
14 rev = "APPSTREAM_${stdenv.lib.replaceStrings ["."] ["_"] version}";
15 sha256 = "07vzz57g1p5byj2jfg17y5n3il0g07d9wkiynzwra71mcxar1p08";
16 };
17
18 patches = [
19 # drop this in version 0.11.9 and above
20 (fetchpatch {
21 name = "define-location-and-soname.patch";
22 url = "https://github.com/ximion/appstream/commit/3e58f9c9.patch";
23 sha256 = "1ffgbdfg80yq5vahjrvdd4f8xsp32ksm9vyasfmc7hzhx294s78w";
24 })
25 ];
26
27 nativeBuildInputs = [
28 meson ninja pkgconfig gettext
29 libxslt xmlto docbook_xsl docbook_xml_dtd_45
30 gobjectIntrospection itstool
31 ];
32
33 buildInputs = [ libstemmer pcre glib xapian libxml2 libyaml ];
34
35 prePatch = ''
36 substituteInPlace meson.build \
37 --replace /usr/include ${libstemmer}/include
38
39 substituteInPlace data/meson.build \
40 --replace /etc $out/etc
41 '';
42
43 mesonFlags = [
44 "-Dapidocs=false"
45 "-Ddocs=false"
46 "-Dgir=false"
47 ];
48
49 meta = with stdenv.lib; {
50 description = "Software metadata handling library";
51 homepage = https://www.freedesktop.org/wiki/Distributions/AppStream/;
52 longDescription = ''
53 AppStream is a cross-distro effort for building Software-Center applications
54 and enhancing metadata provided by software components. It provides
55 specifications for meta-information which is shipped by upstream projects and
56 can be consumed by other software.
57 '';
58 license = licenses.lgpl21Plus;
59 platforms = platforms.linux;
60 };
61}