1{ stdenv
2, lib
3, fetchurl
4, fetchpatch
5, pkg-config
6, meson
7, ninja
8, glib
9, gnome
10, nspr
11, gettext
12, gobject-introspection
13, vala
14, sqlite
15, libxml2
16, dbus-glib
17, libsoup
18, nss
19, dbus
20, libgee
21, evolution-data-server
22, libgdata
23, libsecret
24, db
25, python3
26, readline
27, gtk3
28, gtk-doc
29, docbook-xsl-nons
30, docbook_xml_dtd_43
31, telepathy-glib
32, telepathySupport ? false
33}:
34
35# TODO: enable more folks backends
36
37stdenv.mkDerivation rec {
38 pname = "folks";
39 version = "0.15.3";
40
41 outputs = [ "out" "dev" "devdoc" ];
42
43 src = fetchurl {
44 url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
45 sha256 = "Idc3+vCT9L4GVHPucMogiFuaLDaFlB26JMIjn9PFRKU=";
46 };
47
48 patches = [
49 # Fix build with evolution-data-server ≥ 3.41
50 # https://gitlab.gnome.org/GNOME/folks/-/merge_requests/52
51 (fetchpatch {
52 url = "https://gitlab.gnome.org/GNOME/folks/-/commit/62d588b0c609de17df5b4d1ebfbc67c456267efc.patch";
53 sha256 = "TDL/5kvVwHnvDMuKDdPLQmpmE1FTZhY+7HG8NxKqt5w=";
54 })
55 ];
56
57 nativeBuildInputs = [
58 gettext
59 gobject-introspection
60 gtk3
61 gtk-doc
62 docbook-xsl-nons
63 docbook_xml_dtd_43
64 meson
65 ninja
66 pkg-config
67 python3
68 vala
69 ];
70
71 buildInputs = [
72 db
73 dbus-glib
74 evolution-data-server
75 libgdata # required for some backends transitively
76 libsecret
77 libsoup
78 libxml2
79 nspr
80 nss
81 readline
82 ] ++ lib.optional telepathySupport telepathy-glib;
83
84 propagatedBuildInputs = [
85 glib
86 libgee
87 sqlite
88 ];
89
90 checkInputs = [
91 dbus
92 (python3.withPackages (pp: with pp; [
93 python-dbusmock
94 # The following possibly need to be propagated by dbusmock
95 # if they are not optional
96 dbus-python
97 pygobject3
98 ]))
99 ];
100
101 mesonFlags = [
102 "-Ddocs=true"
103 "-Dtelepathy_backend=${lib.boolToString telepathySupport}"
104 # For some reason, the tests are getting stuck on 31/32,
105 # even though the one missing test finishes just fine on next run,
106 # when tests are permuted differently. And another test that
107 # previously passed will be stuck instead.
108 "-Dtests=false"
109 ];
110
111 doCheck = false;
112
113 # Prevents e-d-s add-contacts-stress-test from timing out
114 checkPhase = ''
115 runHook preCheck
116 meson test --timeout-multiplier 4
117 runHook postCheck
118 '';
119
120 postPatch = ''
121 chmod +x meson_post_install.py
122 patchShebangs meson_post_install.py
123 patchShebangs tests/tools/manager-file.py
124 '';
125
126 passthru = {
127 updateScript = gnome.updateScript {
128 packageName = pname;
129 versionPolicy = "none";
130 };
131 };
132
133 meta = with lib; {
134 description = "A library that aggregates people from multiple sources to create metacontacts";
135 homepage = "https://wiki.gnome.org/Projects/Folks";
136 license = licenses.lgpl2Plus;
137 maintainers = teams.gnome.members;
138 platforms = platforms.gnu ++ platforms.linux; # arbitrary choice
139 };
140}