summaryrefslogtreecommitdiff
path: root/pkgs/development/libraries/librest/default.nix
blob: ac64dc7d13f905a8e39627c684c10ba9d45c8212 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{
  lib,
  stdenv,
  fetchurl,
  pkg-config,
  glib,
  libsoup_2_4,
  libxml2,
  gobject-introspection,
  gtk-doc,
  docbook-xsl-nons,
  docbook_xml_dtd_412,
  gnome,
}:

stdenv.mkDerivation rec {
  pname = "rest";
  version = "0.8.1";

  outputs = [
    "out"
    "dev"
    "devdoc"
  ];

  src = fetchurl {
    url = "mirror://gnome/sources/rest/${lib.versions.majorMinor version}/rest-${version}.tar.xz";
    sha256 = "0513aad38e5d3cedd4ae3c551634e3be1b9baaa79775e53b2dba9456f15b01c9";
  };

  nativeBuildInputs = [
    pkg-config
    gobject-introspection
  ]
  ++ lib.optionals (stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
    gtk-doc
    docbook-xsl-nons
    docbook_xml_dtd_412
  ];

  propagatedBuildInputs = [
    glib
    libsoup_2_4
    libxml2
  ];

  strictDeps = true;

  configureFlags = [
    (lib.enableFeature (stdenv.buildPlatform.canExecute stdenv.hostPlatform) "gtk-doc")
    # Remove when https://gitlab.gnome.org/GNOME/librest/merge_requests/2 is merged.
    "--with-ca-certificates=/etc/ssl/certs/ca-certificates.crt"
  ];

  postPatch = ''
    # pkg-config doesn't look in $PATH if strictDeps is on
    substituteInPlace ./configure \
      --replace-fail 'have_gtk_doc=no' "echo gtk-doc is present"
  '';

  passthru = {
    updateScript = gnome.updateScript {
      packageName = "rest";
      attrPath = "librest";
      versionPolicy = "odd-unstable";
      freeze = true;
    };
  };

  meta = {
    description = "Helper library for RESTful services";
    homepage = "https://gitlab.gnome.org/GNOME/librest";
    license = lib.licenses.lgpl21Only;
    platforms = lib.platforms.unix;
    teams = [ lib.teams.gnome ];
  };
}