From dfad2c6e978ed2a5430e01938cef885e5ec6e422 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Tue, 25 Oct 2022 16:07:11 +0200 Subject: [PATCH 1/3] gvfs: add darwin support --- pkgs/development/libraries/gvfs/default.nix | 33 ++++++++++++++------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/pkgs/development/libraries/gvfs/default.nix b/pkgs/development/libraries/gvfs/default.nix index 28ced142caf4..d80d7f82bfd9 100644 --- a/pkgs/development/libraries/gvfs/default.nix +++ b/pkgs/development/libraries/gvfs/default.nix @@ -7,6 +7,7 @@ , gettext , dbus , glib +, udevSupport ? stdenv.isLinux , libgudev , udisks2 , libgcrypt @@ -72,26 +73,27 @@ stdenv.mkDerivation rec { buildInputs = [ glib - libgudev - udisks2 libgcrypt dbus libgphoto2 avahi libarchive + libimobiledevice + libbluray + libnfs + openssh + gsettings-desktop-schemas + libsoup_3 + ] ++ lib.optionals udevSupport [ + libgudev + udisks2 fuse3 libcdio samba libmtp libcap polkit - libimobiledevice - libbluray libcdio-paranoia - libnfs - openssh - gsettings-desktop-schemas - libsoup_3 ] ++ lib.optionals gnomeSupport [ gcr glib-networking # TLS support @@ -103,6 +105,17 @@ stdenv.mkDerivation rec { mesonFlags = [ "-Dsystemduserunitdir=${placeholder "out"}/lib/systemd/user" "-Dtmpfilesdir=no" + ] ++ lib.optionals (!udevSupport) [ + "-Dgudev=false" + "-Dudisks2=false" + "-Dfuse=false" + "-Dcdda=false" + "-Dsmb=false" + "-Dmtp=false" + "-Dadmin=false" + "-Dgphoto2=false" + "-Dlibusb=false" + "-Dlogind=false" ] ++ lib.optionals (!gnomeSupport) [ "-Dgcr=false" "-Dgoa=false" @@ -128,7 +141,7 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Virtual Filesystem support library" + optionalString gnomeSupport " (full GNOME support)"; license = licenses.lgpl2Plus; - platforms = platforms.linux; - maintainers = [ ] ++ teams.gnome.members; + platforms = platforms.unix; + maintainers = teams.gnome.members; }; } From 079a950f524db708d59491b1f84a528925766790 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Tue, 25 Oct 2022 16:07:20 +0200 Subject: [PATCH 2/3] gnome-online-accounts: add darwin support --- .../libraries/gnome-online-accounts/default.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/gnome-online-accounts/default.nix b/pkgs/development/libraries/gnome-online-accounts/default.nix index 9ffa5d2a0d72..5344534aec5d 100644 --- a/pkgs/development/libraries/gnome-online-accounts/default.nix +++ b/pkgs/development/libraries/gnome-online-accounts/default.nix @@ -8,6 +8,7 @@ , ninja , libxslt , gtk3 +, enableBackend ? stdenv.isLinux , webkitgtk_4_1 , json-glib , librest_1_0 @@ -33,7 +34,7 @@ stdenv.mkDerivation rec { pname = "gnome-online-accounts"; version = "3.46.0"; - outputs = [ "out" "man" "dev" "devdoc" ]; + outputs = [ "out" "dev" ] ++ lib.optionals enableBackend [ "man" "devdoc" ]; # https://gitlab.gnome.org/GNOME/gnome-online-accounts/issues/87 src = fetchFromGitLab { @@ -46,8 +47,9 @@ stdenv.mkDerivation rec { mesonFlags = [ "-Dfedora=false" # not useful in NixOS or for NixOS users. - "-Dgtk_doc=true" - "-Dman=true" + "-Dgoabackend=${lib.boolToString enableBackend}" + "-Dgtk_doc=${lib.boolToString enableBackend}" + "-Dman=${lib.boolToString enableBackend}" "-Dmedia_server=true" ]; @@ -79,6 +81,7 @@ stdenv.mkDerivation rec { libxml2 libsecret libsoup_3 + ] ++ lib.optionals enableBackend [ webkitgtk_4_1 ]; @@ -94,7 +97,7 @@ stdenv.mkDerivation rec { meta = with lib; { homepage = "https://wiki.gnome.org/Projects/GnomeOnlineAccounts"; description = "Single sign-on framework for GNOME"; - platforms = platforms.linux; + platforms = platforms.unix; license = licenses.lgpl2Plus; maintainers = teams.gnome.members; }; 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 3/3] 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; }; }