btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / fo / folks / package.nix
blob777bef9246623eb4dc6aa4dd261bfe6530c5f475
1 { stdenv
2 , lib
3 , fetchurl
4 , pkg-config
5 , meson
6 , ninja
7 , glib
8 , gnome
9 , gettext
10 , gobject-introspection
11 , vala
12 , sqlite
13 , dbus-glib
14 , dbus
15 , libgee
16 , evolution-data-server-gtk4
17 , python3
18 , readline
19 , gtk-doc
20 , docbook-xsl-nons
21 , docbook_xml_dtd_43
22 , telepathy-glib
23 , telepathySupport ? false
26 # TODO: enable more folks backends
28 stdenv.mkDerivation (finalAttrs: {
29   pname = "folks";
30   version = "0.15.9";
32   outputs = [ "out" "dev" "devdoc" ];
34   src = fetchurl {
35     url = "mirror://gnome/sources/folks/${lib.versions.majorMinor finalAttrs.version}/folks-${finalAttrs.version}.tar.xz";
36     hash = "sha256-IxGzc1XDUfM/Fj/cOUh0oioKBoLDGUk9bYpuQgcRQV8=";
37   };
39   nativeBuildInputs = [
40     gettext
41     gobject-introspection
42     gtk-doc
43     docbook-xsl-nons
44     docbook_xml_dtd_43
45     meson
46     ninja
47     pkg-config
48     vala
49   ] ++ lib.optionals telepathySupport [
50     python3
51   ];
53   buildInputs = [
54     dbus-glib
55     evolution-data-server-gtk4 # UI part not needed, using gtk4 version to reduce system closure.
56     readline
57   ] ++ lib.optionals telepathySupport [
58     telepathy-glib
59   ];
61   propagatedBuildInputs = [
62     glib
63     libgee
64     sqlite
65   ];
67   nativeCheckInputs = [
68     dbus
69     (python3.withPackages (pp: with pp; [
70       python-dbusmock
71       # The following possibly need to be propagated by dbusmock
72       # if they are not optional
73       dbus-python
74       pygobject3
75     ]))
76   ];
78   mesonFlags = [
79     "-Ddocs=true"
80     "-Dtelepathy_backend=${lib.boolToString telepathySupport}"
81     "-Dtests=${lib.boolToString (finalAttrs.finalPackage.doCheck && stdenv.hostPlatform.isLinux)}"
82   ];
84   # backends/eds/lib/libfolks-eds.so.26.0.0.p/edsf-persona-store.c:10697:4:
85   # error: call to undeclared function 'folks_persona_store_set_is_user_set_default';
86   # ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
87   env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=implicit-function-declaration";
89   # Checks last re-enabled in https://github.com/NixOS/nixpkgs/pull/279843, but timeouts in tests still
90   # occur inconsistently
91   doCheck = false;
93   mesonCheckFlags = [
94     # Prevents e-d-s add-contacts-stress-test from timing out
95     "--timeout-multiplier" "4"
96   ];
98   postPatch = lib.optionalString telepathySupport ''
99     patchShebangs tests/tools/manager-file.py
100   '';
102   passthru = {
103     updateScript = gnome.updateScript {
104       packageName = "folks";
105       versionPolicy = "none";
106     };
107   };
109   meta = with lib; {
110     description = "Library that aggregates people from multiple sources to create metacontacts";
111     homepage = "https://gitlab.gnome.org/GNOME/folks";
112     license = licenses.lgpl21Plus;
113     maintainers = teams.gnome.members;
114     platforms = platforms.unix;
115   };