From 75473c2d7002b08e53d437f6f88c8975721834e2 Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Sun, 18 Jul 2021 20:28:38 +0800 Subject: [PATCH] gnome.gnome-settings-daemon338: init at 3.38.2 light-locker is no longer used in Pantheon 6, we will try using the upstream gnome-settings-daemon --- .../x11/desktop-managers/pantheon.nix | 6 +- .../gnome-settings-daemon/3.38/default.nix | 135 ++++++++++++++++++ .../3.38/fix-paths.patch | 15 ++ pkgs/desktops/gnome/default.nix | 3 + pkgs/desktops/pantheon/default.nix | 3 + 5 files changed, 159 insertions(+), 3 deletions(-) create mode 100644 pkgs/desktops/gnome/core/gnome-settings-daemon/3.38/default.nix create mode 100644 pkgs/desktops/gnome/core/gnome-settings-daemon/3.38/fix-paths.patch diff --git a/nixos/modules/services/x11/desktop-managers/pantheon.nix b/nixos/modules/services/x11/desktop-managers/pantheon.nix index e492073b80ff..18f1883932dd 100644 --- a/nixos/modules/services/x11/desktop-managers/pantheon.nix +++ b/nixos/modules/services/x11/desktop-managers/pantheon.nix @@ -162,12 +162,11 @@ in isAllowed = true; isSystem = true; }; - # Use gnome-settings-daemon fork services.udev.packages = [ - pkgs.pantheon.elementary-settings-daemon + pkgs.gnome.gnome-settings-daemon338 ]; systemd.packages = [ - pkgs.pantheon.elementary-settings-daemon + pkgs.gnome.gnome-settings-daemon338 ]; programs.dconf.enable = true; networking.networkmanager.enable = mkDefault true; @@ -217,6 +216,7 @@ in gnome.geary gnome.epiphany gnome.gnome-font-viewer + gnome.gnome-settings-daemon338 ] config.environment.pantheon.excludePackages); programs.evince.enable = mkDefault true; diff --git a/pkgs/desktops/gnome/core/gnome-settings-daemon/3.38/default.nix b/pkgs/desktops/gnome/core/gnome-settings-daemon/3.38/default.nix new file mode 100644 index 000000000000..06a560380537 --- /dev/null +++ b/pkgs/desktops/gnome/core/gnome-settings-daemon/3.38/default.nix @@ -0,0 +1,135 @@ +{ lib, stdenv +, fetchpatch +, substituteAll +, fetchurl +, meson +, ninja +, pkg-config +, gnome +, perl +, gettext +, gtk3 +, glib +, libnotify +, libgnomekbd +, lcms2 +, libpulseaudio +, alsa-lib +, libcanberra-gtk3 +, upower +, colord +, libgweather +, polkit +, gsettings-desktop-schemas +, geoclue2 +, systemd +, libgudev +, libwacom +, libxslt +, libxml2 +, modemmanager +, networkmanager +, gnome-desktop +, geocode-glib +, docbook_xsl +, wrapGAppsHook +, python3 +, tzdata +, nss +, gcr +, gnome-session-ctl +, pantheon +}: + +stdenv.mkDerivation rec { + pname = "gnome-settings-daemon"; + version = "3.38.2"; + + src = fetchurl { + url = "mirror://gnome/sources/gnome-settings-daemon/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; + sha256 = "136p3prdqvc0lvrcqs4h7crpnfqnimqklpzjivq5w4g1rhbdbhrj"; + }; + + patches = [ + # https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/merge_requests/202 + (fetchpatch { + url = "https://gitlab.gnome.org/GNOME/gnome-settings-daemon/commit/aae1e774dd9de22fe3520cf9eb2bfbf7216f5eb0.patch"; + sha256 = "O4m0rOW8Zrgu3Q0p0OA8b951VC0FjYbOUk9MLzB9icI="; + }) + + (substituteAll { + src = ./fix-paths.patch; + inherit tzdata; + }) + + # Adjust to libgweather changes. + # https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/merge_requests/217 + (fetchpatch { + url = "https://gitlab.gnome.org/GNOME/gnome-settings-daemon/commit/82d88014dfca2df7e081712870e1fb017c16b808.patch"; + sha256 = "H5k/v+M2bRaswt5nrDJFNn4gS4BdB0UfzdjUCT4yLKg="; + }) + ]; + + nativeBuildInputs = [ + meson + ninja + pkg-config + perl + gettext + libxml2 + libxslt + docbook_xsl + wrapGAppsHook + python3 + ]; + + buildInputs = [ + gtk3 + glib + gsettings-desktop-schemas + modemmanager + networkmanager + libnotify + libgnomekbd # for org.gnome.libgnomekbd.keyboard schema + gnome-desktop + lcms2 + libpulseaudio + alsa-lib + libcanberra-gtk3 + upower + colord + libgweather + nss + polkit + geocode-glib + geoclue2 + systemd + libgudev + libwacom + gcr + ]; + + mesonFlags = [ + "-Dudev_dir=${placeholder "out"}/lib/udev" + "-Dgnome_session_ctl_path=${gnome-session-ctl}/libexec/gnome-session-ctl" + ]; + + # Default for release buildtype but passed manually because + # we're using plain + NIX_CFLAGS_COMPILE = "-DG_DISABLE_CAST_CHECKS"; + + postPatch = '' + for f in gnome-settings-daemon/codegen.py plugins/power/gsd-power-constants-update.pl meson_post_install.py; do + chmod +x $f + patchShebangs $f + done + ''; + + meta = with lib; { + description = "GNOME Settings Daemon"; + homepage = "https://gitlab.gnome.org/GNOME/gnome-settings-daemon/"; + license = licenses.gpl2Plus; + maintainers = pantheon.maintainers; + platforms = platforms.linux; + }; +} diff --git a/pkgs/desktops/gnome/core/gnome-settings-daemon/3.38/fix-paths.patch b/pkgs/desktops/gnome/core/gnome-settings-daemon/3.38/fix-paths.patch new file mode 100644 index 000000000000..2229302cab7c --- /dev/null +++ b/pkgs/desktops/gnome/core/gnome-settings-daemon/3.38/fix-paths.patch @@ -0,0 +1,15 @@ +--- a/plugins/datetime/tz.h ++++ b/plugins/datetime/tz.h +@@ -27,11 +27,7 @@ + + #include + +-#ifndef __sun +-# define TZ_DATA_FILE "/usr/share/zoneinfo/zone.tab" +-#else +-# define TZ_DATA_FILE "/usr/share/lib/zoneinfo/tab/zone_sun.tab" +-#endif ++#define TZ_DATA_FILE "@tzdata@/share/zoneinfo/zone.tab" + + typedef struct _TzDB TzDB; + typedef struct _TzLocation TzLocation; diff --git a/pkgs/desktops/gnome/default.nix b/pkgs/desktops/gnome/default.nix index c1f0a82f0b5b..a3f0107c288b 100644 --- a/pkgs/desktops/gnome/default.nix +++ b/pkgs/desktops/gnome/default.nix @@ -88,6 +88,9 @@ lib.makeScope pkgs.newScope (self: with self; { gnome-settings-daemon = callPackage ./core/gnome-settings-daemon { }; + # Using 3.38 to match Mutter used in Pantheon + gnome-settings-daemon338 = callPackage ./core/gnome-settings-daemon/3.38 { }; + gnome-software = callPackage ./core/gnome-software { }; gnome-system-monitor = callPackage ./core/gnome-system-monitor { }; diff --git a/pkgs/desktops/pantheon/default.nix b/pkgs/desktops/pantheon/default.nix index 9288b94f7ca8..290d6320e11a 100644 --- a/pkgs/desktops/pantheon/default.nix +++ b/pkgs/desktops/pantheon/default.nix @@ -28,6 +28,9 @@ lib.makeScope pkgs.newScope (self: with self; { mutter = pkgs.gnome.mutter338; + # Using 3.38 to match Mutter used in Pantheon + gnome-settings-daemon = pkgs.gnome.gnome-settings-daemon338; + elementary-gsettings-schemas = callPackage ./desktop/elementary-gsettings-schemas { }; notes-up = pkgs.notes-up.override { withPantheon = true; };