about summary refs log tree commit diff
path: root/nixpkgs/pkgs/desktops/gnome/core/evolution-data-server/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/desktops/gnome/core/evolution-data-server/default.nix')
-rw-r--r--nixpkgs/pkgs/desktops/gnome/core/evolution-data-server/default.nix93
1 files changed, 69 insertions, 24 deletions
diff --git a/nixpkgs/pkgs/desktops/gnome/core/evolution-data-server/default.nix b/nixpkgs/pkgs/desktops/gnome/core/evolution-data-server/default.nix
index c4a12cd5ca86..950be481eced 100644
--- a/nixpkgs/pkgs/desktops/gnome/core/evolution-data-server/default.nix
+++ b/nixpkgs/pkgs/desktops/gnome/core/evolution-data-server/default.nix
@@ -4,17 +4,17 @@
 , substituteAll
 , pkg-config
 , gnome
+, _experimental-update-script-combinators
 , python3
 , gobject-introspection
 , gettext
-, libsoup
+, libsoup_3
 , libxml2
 , libsecret
 , icu
 , sqlite
 , tzdata
 , libcanberra-gtk3
-, gcr
 , p11-kit
 , db
 , nspr
@@ -29,29 +29,34 @@
 , ninja
 , libkrb5
 , openldap
-, webkitgtk
+, enableOAuth2 ? stdenv.isLinux
+, webkitgtk_4_1
+, webkitgtk_6_0
 , libaccounts-glib
 , json-glib
 , glib
 , gtk3
+, gtk4
+, withGtk3 ? true
+, withGtk4 ? false
 , libphonenumber
 , gnome-online-accounts
 , libgweather
-, libgdata
-, gsettings-desktop-schemas
 , boost
 , protobuf
+, libiconv
+, makeHardcodeGsettingsPatch
 }:
 
 stdenv.mkDerivation rec {
   pname = "evolution-data-server";
-  version = "3.44.3";
+  version = "3.48.3";
 
   outputs = [ "out" "dev" ];
 
   src = fetchurl {
     url = "mirror://gnome/sources/evolution-data-server/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "kEOrU/NB2hAxXFUDhKazIEMBk/yNeGHdJcTpsuC+Qls=";
+    sha256 = "tx5BLlL1Z8gzlLWSbfkrT09tLN3rrThKUXxyBnH62ZY=";
   };
 
   patches = [
@@ -63,8 +68,7 @@ stdenv.mkDerivation rec {
 
   prePatch = ''
     substitute ${./hardcode-gsettings.patch} hardcode-gsettings.patch \
-      --subst-var-by ESD_GSETTINGS_PATH ${glib.makeSchemaPath "$out" "${pname}-${version}"} \
-      --subst-var-by GDS_GSETTINGS_PATH ${glib.getSchemaPath gsettings-desktop-schemas}
+      --subst-var-by EDS ${glib.makeSchemaPath "$out" "${pname}-${version}"}
     patches="$patches $PWD/hardcode-gsettings.patch"
   '';
 
@@ -82,27 +86,32 @@ stdenv.mkDerivation rec {
 
   buildInputs = [
     glib
-    libsoup
-    libxml2
-    gtk3
+    libsoup_3
     gnome-online-accounts
-    gcr
     p11-kit
     libgweather
-    libgdata
-    libaccounts-glib
-    json-glib
     icu
     sqlite
     libkrb5
     openldap
-    webkitgtk
     glib-networking
     libcanberra-gtk3
     pcre
     libphonenumber
     boost
     protobuf
+  ] ++ lib.optionals stdenv.isLinux [
+    libaccounts-glib
+  ] ++ lib.optionals stdenv.isDarwin [
+    libiconv
+  ] ++ lib.optionals withGtk3 [
+    gtk3
+  ] ++ lib.optionals (withGtk3 && enableOAuth2) [
+    webkitgtk_4_1
+  ] ++ lib.optionals withGtk4 [
+    gtk4
+  ] ++ lib.optionals (withGtk4 && enableOAuth2) [
+    webkitgtk_6_0
   ];
 
   propagatedBuildInputs = [
@@ -111,8 +120,9 @@ stdenv.mkDerivation rec {
     nss
     nspr
     libical
-    libgdata # needed for GObject inspection, https://gitlab.gnome.org/GNOME/evolution-data-server/-/merge_requests/57/diffs
-    libsoup
+    libsoup_3
+    libxml2
+    json-glib
   ];
 
   cmakeFlags = [
@@ -121,14 +131,49 @@ stdenv.mkDerivation rec {
     "-DENABLE_INTROSPECTION=ON"
     "-DINCLUDE_INSTALL_DIR=${placeholder "dev"}/include"
     "-DWITH_PHONENUMBER=ON"
-    "-DWITH_GWEATHER4=ON"
+    "-DENABLE_GTK=${lib.boolToString withGtk3}"
+    "-DENABLE_EXAMPLES=${lib.boolToString withGtk3}"
+    "-DENABLE_CANBERRA=${lib.boolToString withGtk3}"
+    "-DENABLE_GTK4=${lib.boolToString withGtk4}"
+    "-DENABLE_OAUTH2_WEBKITGTK=${lib.boolToString (withGtk3 && enableOAuth2)}"
+    "-DENABLE_OAUTH2_WEBKITGTK4=${lib.boolToString (withGtk4 && enableOAuth2)}"
   ];
 
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace cmake/modules/SetupBuildFlags.cmake \
+      --replace "-Wl,--no-undefined" ""
+    substituteInPlace src/services/evolution-alarm-notify/e-alarm-notify.c \
+      --replace "G_OS_WIN32" "__APPLE__"
+  '';
+
+  postInstall = lib.optionalString stdenv.isDarwin ''
+    ln -s $out/lib/${pname}/*.dylib $out/lib/
+  '';
+
   passthru = {
-    updateScript = gnome.updateScript {
-      packageName = "evolution-data-server";
-      versionPolicy = "odd-unstable";
+    hardcodeGsettingsPatch = makeHardcodeGsettingsPatch {
+      schemaIdToVariableMapping = {
+        "org.gnome.Evolution.DefaultSources" = "EDS";
+        "org.gnome.evolution.shell.network-config" = "EDS";
+        "org.gnome.evolution-data-server.addressbook" = "EDS";
+        "org.gnome.evolution-data-server.calendar" = "EDS";
+        "org.gnome.evolution-data-server" = "EDS";
+
+      };
+      inherit src;
     };
+    updateScript =
+      let
+        updateSource = gnome.updateScript {
+          packageName = "evolution-data-server";
+          versionPolicy = "odd-unstable";
+        };
+        updatePatch = _experimental-update-script-combinators.copyAttrOutputToFile "evolution-data-server.hardcodeGsettingsPatch" ./hardcode-gsettings.patch;
+      in
+      _experimental-update-script-combinators.sequence [
+        updateSource
+        updatePatch
+      ];
   };
 
   meta = with lib; {
@@ -136,6 +181,6 @@ stdenv.mkDerivation rec {
     homepage = "https://wiki.gnome.org/Apps/Evolution";
     license = licenses.lgpl2Plus;
     maintainers = teams.gnome.members;
-    platforms = platforms.linux;
+    platforms = platforms.unix;
   };
 }