summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/ev/evolution-ews/package.nix
blob: 8c4bf01d126cac183768e9fddcbdf83dc53dcbe7 (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
{
  stdenv,
  lib,
  fetchurl,
  gnome,
  cmake,
  gettext,
  intltool,
  pkg-config,
  evolution-data-server,
  evolution,
  gtk3,
  libsoup_3,
  libical,
  json-glib,
  libmspack,
  webkitgtk_4_1,
  replaceVars,
  _experimental-update-script-combinators,
  glib,
  makeHardcodeGsettingsPatch,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "evolution-ews";
  version = "3.60.2";

  src = fetchurl {
    url = "mirror://gnome/sources/evolution-ews/${lib.versions.majorMinor finalAttrs.version}/evolution-ews-${finalAttrs.version}.tar.xz";
    hash = "sha256-lAIFgY9piEEUV931gE0hDzUVwm4zQV3r2Puycxsdrys=";
  };

  patches = [
    # evolution-ews contains .so files loaded by evolution-data-server referring
    # schemas from evolution. evolution-data-server is not wrapped with
    # evolution's schemas because it would be a circular dependency with
    # evolution.
    (replaceVars ./hardcode-gsettings.patch {
      evo = glib.makeSchemaPath evolution evolution.name;
    })
  ];

  nativeBuildInputs = [
    cmake
    gettext
    intltool
    pkg-config
  ];

  buildInputs = [
    evolution-data-server
    evolution
    gtk3
    libsoup_3
    libical
    json-glib
    libmspack
    # For evolution-shell-3.0
    webkitgtk_4_1
  ];

  cmakeFlags = [
    # don't try to install into ${evolution}
    "-DFORCE_INSTALL_PREFIX=ON"
  ];

  passthru = {
    hardcodeGsettingsPatch = makeHardcodeGsettingsPatch {
      inherit (finalAttrs) src;
      schemaIdToVariableMapping = {
        "org.gnome.evolution.mail" = "evo";
        "org.gnome.evolution.calendar" = "evo";
      };
      schemaExistsFunction = "e_ews_common_utils_gsettings_schema_exists";
    };

    updateScript =
      let
        updateSource = gnome.updateScript {
          packageName = "evolution-ews";
          versionPolicy = "odd-unstable";
        };
        updatePatch = _experimental-update-script-combinators.copyAttrOutputToFile "evolution-ews.hardcodeGsettingsPatch" ./hardcode-gsettings.patch;
      in
      _experimental-update-script-combinators.sequence [
        updateSource
        updatePatch
      ];
  };

  meta = {
    description = "Evolution connector for Microsoft Exchange Server protocols";
    homepage = "https://gitlab.gnome.org/GNOME/evolution-ews";
    license = lib.licenses.lgpl21Plus; # https://gitlab.gnome.org/GNOME/evolution-ews/issues/111
    maintainers = [ lib.maintainers.dasj19 ];
    platforms = lib.platforms.linux;
  };
})