1{
2 lib,
3 stdenv,
4 fetchurl,
5 pkg-config,
6 glib,
7 libsoup_2_4,
8 libxml2,
9 gobject-introspection,
10 gtk-doc,
11 docbook-xsl-nons,
12 docbook_xml_dtd_412,
13 gnome,
14}:
15
16stdenv.mkDerivation rec {
17 pname = "rest";
18 version = "0.8.1";
19
20 outputs = [
21 "out"
22 "dev"
23 "devdoc"
24 ];
25
26 src = fetchurl {
27 url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
28 sha256 = "0513aad38e5d3cedd4ae3c551634e3be1b9baaa79775e53b2dba9456f15b01c9";
29 };
30
31 nativeBuildInputs =
32 [
33 pkg-config
34 gobject-introspection
35 ]
36 ++ lib.optionals (stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
37 gtk-doc
38 docbook-xsl-nons
39 docbook_xml_dtd_412
40 ];
41
42 propagatedBuildInputs = [
43 glib
44 libsoup_2_4
45 libxml2
46 ];
47
48 strictDeps = true;
49
50 configureFlags = [
51 (lib.enableFeature (stdenv.buildPlatform.canExecute stdenv.hostPlatform) "gtk-doc")
52 # Remove when https://gitlab.gnome.org/GNOME/librest/merge_requests/2 is merged.
53 "--with-ca-certificates=/etc/ssl/certs/ca-certificates.crt"
54 ];
55
56 postPatch = ''
57 # pkg-config doesn't look in $PATH if strictDeps is on
58 substituteInPlace ./configure \
59 --replace-fail 'have_gtk_doc=no' "echo gtk-doc is present"
60 '';
61
62 passthru = {
63 updateScript = gnome.updateScript {
64 packageName = pname;
65 attrPath = "librest";
66 versionPolicy = "odd-unstable";
67 freeze = true;
68 };
69 };
70
71 meta = with lib; {
72 description = "Helper library for RESTful services";
73 homepage = "https://gitlab.gnome.org/GNOME/librest";
74 license = licenses.lgpl21Only;
75 platforms = platforms.unix;
76 teams = [ teams.gnome ];
77 };
78}