From b082de986e23822fb63984e908e87abdd40ed239 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Tue, 25 Oct 2022 16:08:28 +0200 Subject: [PATCH] evolution-data-server: add darwin support --- .../core/evolution-data-server/default.nix | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/pkgs/desktops/gnome/core/evolution-data-server/default.nix b/pkgs/desktops/gnome/core/evolution-data-server/default.nix index 73890d27a002..9f5721fcd54d 100644 --- a/pkgs/desktops/gnome/core/evolution-data-server/default.nix +++ b/pkgs/desktops/gnome/core/evolution-data-server/default.nix @@ -32,6 +32,7 @@ , ninja , libkrb5 , openldap +, enableOAuth2 ? stdenv.isLinux , webkitgtk_4_1 , webkitgtk_5_0 , libaccounts-glib @@ -46,6 +47,7 @@ , libgweather , boost , protobuf +, libiconv }: stdenv.mkDerivation rec { @@ -90,7 +92,6 @@ stdenv.mkDerivation rec { gnome-online-accounts p11-kit libgweather - libaccounts-glib icu sqlite libkrb5 @@ -101,11 +102,17 @@ stdenv.mkDerivation rec { 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_5_0 ]; @@ -130,8 +137,21 @@ stdenv.mkDerivation rec { "-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 = { # In order for GNOME not to depend on OCaml through Coccinelle, # we materialize the SmPL patch into a unified diff-style patch. @@ -175,6 +195,6 @@ stdenv.mkDerivation rec { homepage = "https://wiki.gnome.org/Apps/Evolution"; license = licenses.lgpl2Plus; maintainers = teams.gnome.members; - platforms = platforms.linux; + platforms = platforms.unix; }; }