From a1ced50fa01ba7edbab4742d12e24f1dca465c56 Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Sat, 7 Dec 2019 20:04:58 -0500 Subject: [PATCH] pantheon.elementary-settings-daemon: 3.30.2 -> 3.34.1 --- pkgs/desktops/pantheon/default.nix | 4 +- .../elementary-settings-daemon/default.nix | 198 +++++++++--------- .../elementary-dpms.patch | 84 ++++++++ .../fix-paths.patch | 11 - .../global-backlight-helper.patch | 30 +-- 5 files changed, 198 insertions(+), 129 deletions(-) create mode 100644 pkgs/desktops/pantheon/services/elementary-settings-daemon/elementary-dpms.patch diff --git a/pkgs/desktops/pantheon/default.nix b/pkgs/desktops/pantheon/default.nix index 8e8e5fc6318c..2bcbbf40d948 100644 --- a/pkgs/desktops/pantheon/default.nix +++ b/pkgs/desktops/pantheon/default.nix @@ -110,7 +110,9 @@ lib.makeScope pkgs.newScope (self: with self; { # We're using ubuntu and elementary's patchset due to reasons # explained here -> https://github.com/elementary/greeter/issues/92#issuecomment-376215614 # Take note of "I am holding off on "fixing" this bug for as long as possible." - elementary-settings-daemon = callPackage ./services/elementary-settings-daemon { }; + elementary-settings-daemon = callPackage ./services/elementary-settings-daemon { + inherit (gnome3) gnome-desktop; + }; pantheon-agent-geoclue2 = callPackage ./services/pantheon-agent-geoclue2 { }; diff --git a/pkgs/desktops/pantheon/services/elementary-settings-daemon/default.nix b/pkgs/desktops/pantheon/services/elementary-settings-daemon/default.nix index 582793ff5906..e5aa31ca0fb3 100644 --- a/pkgs/desktops/pantheon/services/elementary-settings-daemon/default.nix +++ b/pkgs/desktops/pantheon/services/elementary-settings-daemon/default.nix @@ -1,87 +1,128 @@ -{ accountsservice -, alsaLib -, colord -, docbook_xsl -, fetchgit -, fetchurl -, geoclue2 -, geocode-glib -, gettext -, glib -, gnome3 -, gsettings-desktop-schemas -, gtk3 -, lcms2 -, libcanberra-gtk3 -, libgnomekbd -, libgudev -, libgweather -, libnotify -, libpulseaudio -, libwacom -, libxml2 -, libxslt -, meson -, mousetweaks -, networkmanager -, ninja -, nss -, pantheon -, perl -, pkgconfig -, polkit -, python3 -, stdenv +{ stdenv , substituteAll -, systemd -, tzdata +, fetchurl +, fetchgit +, meson +, ninja +, pkgconfig +, gnome3 +, perl +, gettext +, gtk3 +, glib +, libnotify +, libgnomekbd +, lcms2 +, libpulseaudio +, alsaLib +, libcanberra-gtk3 , upower -, libXtst +, colord +, libgweather +, polkit +, gsettings-desktop-schemas +, geoclue2 +, systemd +, libgudev +, libwacom +, libxslt +, libxml2 +, modemmanager +, networkmanager +, gnome-desktop +, geocode-glib +, docbook_xsl +, accountsservice , wrapGAppsHook +, python3 +, tzdata +, nss +, gcr +, pantheon }: stdenv.mkDerivation rec { pname = "elementary-settings-daemon"; - version = "3.30.2"; + version = "3.34.1"; repoName = "gnome-settings-daemon"; - src = fetchurl { - url = "mirror://gnome/sources/${repoName}/${stdenv.lib.versions.majorMinor version}/${repoName}-${version}.tar.xz"; - sha256 = "0c663csa3gnsr6wm0xfll6aani45snkdj7zjwjfzcwfh8w4a3z12"; - }; - - # Source for ubuntu's patchset - src2 = fetchgit { + src = fetchgit { url = "https://git.launchpad.net/~ubuntu-desktop/ubuntu/+source/${repoName}"; - rev = "refs/tags/ubuntu/${version}-1ubuntu1"; - sha256 = "02awkhw6jqm7yh812mw0nsdmsljfi8ksz8mvd2qpns5pcv002g2c"; + rev = "refs/tags/ubuntu/${version}-1ubuntu2"; + sha256 = "0w0dsbzif7v0gk61rs9g20ldlimbdwb5yvlfdc568yyx5z643jbv"; }; # We've omitted the 53_sync_input_sources_to_accountsservice patch because it breaks the build. # See: https://gist.github.com/worldofpeace/2f152a20b7c47895bb93239fce1c9f52 # # Also omit ubuntu_calculator_snap.patch as that's obviously not useful here. - patches = let patchPath = "${src2}/debian/patches"; in [ + patches = let patchPath = "${src}/debian/patches"; in [ (substituteAll { src = ./fix-paths.patch; - inherit tzdata mousetweaks; + inherit tzdata; }) ./global-backlight-helper.patch "${patchPath}/45_suppress-printer-may-not-be-connected-notification.patch" + #"${patchPath}/53_sync_input_sources_to_accountsservice.patch" "${patchPath}/64_restore_terminal_keyboard_shortcut_schema.patch" "${patchPath}/correct_logout_action.patch" "${patchPath}/ubuntu-lid-close-suspend.patch" - "${patchPath}/revert-wacom-migration.patch" "${patchPath}/revert-gsettings-removals.patch" "${patchPath}/revert-mediakeys-dbus-interface-drop.patch" - "${patchPath}/ubuntu_ibus_configs.patch" - (fetchurl { - url = "https://github.com/elementary/os-patches/raw/6975d1c254cb6ab913b8e2396877203aea8eaa65/debian/patches/elementary-dpms.patch"; - sha256 = "0kh508ppiv4nvkg30gmw85cljlfq1bvkzhvf1iaxw0snb0mwgsxi"; - }) + #"${patchPath}/ubuntu_ibus_configs.patch" + # https://github.com/elementary/os-patches/blob/6975d1c254cb6ab913b8e2396877203aea8eaa65/debian/patches/elementary-dpms.patch + ./elementary-dpms.patch ]; + nativeBuildInputs = [ + meson + ninja + pkgconfig + perl + gettext + libxml2 + libxslt + docbook_xsl + wrapGAppsHook + python3 + ]; + + buildInputs = [ + accountsservice + alsaLib + colord + gcr + geoclue2 + geocode-glib + glib + gnome-desktop + gsettings-desktop-schemas + gtk3 + lcms2 + libcanberra-gtk3 + libgnomekbd # for org.gnome.libgnomekbd.keyboard schema + libgudev + libgweather + libnotify + libpulseaudio + libwacom + modemmanager + networkmanager + nss + polkit + systemd + upower + ]; + + mesonFlags = [ + "-Dudev_dir=${placeholder "out"}/lib/udev" + ]; + + # 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 @@ -105,53 +146,6 @@ stdenv.mkDerivation rec { ln -s $out/libexec/gsd-backlight-helper $out/bin/elementary-settings-daemon/gsd-backlight-helper ''; - nativeBuildInputs = [ - docbook_xsl - gettext - libxml2 - libxslt - meson - ninja - perl - pkgconfig - python3 - wrapGAppsHook - ]; - - buildInputs = [ - accountsservice - alsaLib - colord - geoclue2 - geocode-glib - glib - gnome3.gnome-desktop - gsettings-desktop-schemas - gtk3 - lcms2 - libXtst - libcanberra-gtk3 - libgnomekbd # for org.gnome.libgnomekbd.keyboard schema - libgudev - libgweather - libnotify - libpulseaudio - libwacom - networkmanager - nss - polkit - systemd - upower - ]; - - mesonFlags = [ - "-Dudev_dir=${placeholder "out"}/lib/udev" - ]; - - # Default for release buildtype but passed manually because - # we're using plain - NIX_CFLAGS_COMPILE = "-DG_DISABLE_CAST_CHECKS"; - passthru = { updateScript = gnome3.updateScript { packageName = repoName; diff --git a/pkgs/desktops/pantheon/services/elementary-settings-daemon/elementary-dpms.patch b/pkgs/desktops/pantheon/services/elementary-settings-daemon/elementary-dpms.patch new file mode 100644 index 000000000000..14d056ceca27 --- /dev/null +++ b/pkgs/desktops/pantheon/services/elementary-settings-daemon/elementary-dpms.patch @@ -0,0 +1,84 @@ +diff --git a/data/org.gnome.settings-daemon.plugins.power.gschema.xml.in b/data/org.gnome.settings-daemon.plugins.power.gschema.xml.in +index ec805d8a..cf0d6793 100644 +--- a/data/org.gnome.settings-daemon.plugins.power.gschema.xml.in ++++ b/data/org.gnome.settings-daemon.plugins.power.gschema.xml.in +@@ -11,6 +11,11 @@ + Activation of this plugin + Whether this plugin would be activated by unity-settings-daemon or not + ++ ++ false ++ Reset X DPMS values ++ Whether DPMS values will be adjusted by gnome-settings-daemon ++ + + 30 + The brightness of the screen when idle +diff --git a/plugins/power/gpm-common.c b/plugins/power/gpm-common.c +index a7ca87fb..a56a7cdc 100644 +--- a/plugins/power/gpm-common.c ++++ b/plugins/power/gpm-common.c +@@ -280,6 +280,18 @@ disable_builtin_screensaver (gpointer unused) + return TRUE; + } + ++gboolean ++manage_dpms (void) ++{ ++ GSettings *settings; ++ gboolean manage_dpms_defaults; ++ ++ settings = g_settings_new ("org.gnome.settings-daemon.plugins.power"); ++ manage_dpms_defaults = g_settings_get_boolean (settings, "manage-dpms-defaults"); ++ g_object_unref (settings); ++ return manage_dpms_defaults; ++} ++ + guint + gsd_power_enable_screensaver_watchdog (void) + { +@@ -290,7 +302,7 @@ gsd_power_enable_screensaver_watchdog (void) + * way. The defaults are now applied in Fedora 20 from + * being "0" by default to being "600" by default */ + gdk_x11_display_error_trap_push (gdk_display_get_default ()); +- if (DPMSQueryExtension(GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), &dummy, &dummy)) ++ if (manage_dpms () && DPMSQueryExtension(GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), &dummy, &dummy)) + DPMSSetTimeouts (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), 0, 0, 0); + gdk_x11_display_error_trap_pop_ignored (gdk_display_get_default ()); + id = g_timeout_add_seconds (XSCREENSAVER_WATCHDOG_TIMEOUT, +diff --git a/plugins/power/gpm-common.h b/plugins/power/gpm-common.h +index 88a8e00e..af106479 100644 +--- a/plugins/power/gpm-common.h ++++ b/plugins/power/gpm-common.h +@@ -34,6 +34,7 @@ gchar *gpm_get_timestring (guint time); + gboolean gsd_power_is_hardware_a_vm (void); + guint gsd_power_enable_screensaver_watchdog (void); + void reset_idletime (void); ++gboolean manage_dpms (void); + + /* Backlight helpers */ + +diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c +index c500fa38..445496ee 100644 +--- a/plugins/power/gsd-power-manager.c ++++ b/plugins/power/gsd-power-manager.c +@@ -1033,6 +1033,9 @@ backlight_enable (GsdPowerManager *manager) + gboolean ret; + GError *error = NULL; + ++ if (!(manage_dpms ())) ++ return; ++ + iio_proxy_claim_light (manager, TRUE); + ret = gnome_rr_screen_set_dpms_mode (manager->rr_screen, + GNOME_RR_DPMS_ON, +@@ -1052,6 +1055,9 @@ backlight_disable (GsdPowerManager *manager) + gboolean ret; + GError *error = NULL; + ++ if (!(manage_dpms ())) ++ return; ++ + iio_proxy_claim_light (manager, FALSE); + ret = gnome_rr_screen_set_dpms_mode (manager->rr_screen, + GNOME_RR_DPMS_OFF, diff --git a/pkgs/desktops/pantheon/services/elementary-settings-daemon/fix-paths.patch b/pkgs/desktops/pantheon/services/elementary-settings-daemon/fix-paths.patch index 272656fae78c..2229302cab7c 100644 --- a/pkgs/desktops/pantheon/services/elementary-settings-daemon/fix-paths.patch +++ b/pkgs/desktops/pantheon/services/elementary-settings-daemon/fix-paths.patch @@ -13,14 +13,3 @@ typedef struct _TzDB TzDB; typedef struct _TzLocation TzLocation; ---- a/plugins/mouse/gsd-mouse-manager.c -+++ b/plugins/mouse/gsd-mouse-manager.c -@@ -118,7 +118,7 @@ set_mousetweaks_daemon (GsdMouseManager *manager, - gboolean run_daemon = dwell_click_enabled || secondary_click_enabled; - - if (run_daemon || manager->priv->mousetweaks_daemon_running) -- comm = g_strdup_printf ("mousetweaks %s", -+ comm = g_strdup_printf ("@mousetweaks@/bin/mousetweaks %s", - run_daemon ? "" : "-s"); - else - return; diff --git a/pkgs/desktops/pantheon/services/elementary-settings-daemon/global-backlight-helper.patch b/pkgs/desktops/pantheon/services/elementary-settings-daemon/global-backlight-helper.patch index c073b23e6b9f..dcdc83934ba6 100644 --- a/pkgs/desktops/pantheon/services/elementary-settings-daemon/global-backlight-helper.patch +++ b/pkgs/desktops/pantheon/services/elementary-settings-daemon/global-backlight-helper.patch @@ -1,18 +1,18 @@ -diff --git a/plugins/power/gpm-common.c b/plugins/power/gpm-common.c -index e83f1549..15890053 100644 ---- a/plugins/power/gpm-common.c -+++ b/plugins/power/gpm-common.c -@@ -452,7 +452,7 @@ run_backlight_helper (enum BacklightHelperCommand command, - gchar *argv[5] = { 0 }; - - argv[0] = "pkexec"; -- argv[1] = LIBEXECDIR "/gsd-backlight-helper"; -+ argv[1] = "/run/current-system/sw/bin/elementary-settings-daemon/gsd-backlight-helper"; - argv[2] = helper_args[command]; - argv[3] = value; - +diff --git a/plugins/power/gsd-backlight.c b/plugins/power/gsd-backlight.c +index d7d10fd2..5619d6ad 100644 +--- a/plugins/power/gsd-backlight.c ++++ b/plugins/power/gsd-backlight.c +@@ -358,7 +358,7 @@ gsd_backlight_run_set_helper (GsdBacklight *backlight, GTask *task) + proc = g_subprocess_new (G_SUBPROCESS_FLAGS_STDOUT_SILENCE, + &error, + "pkexec", +- LIBEXECDIR "/gsd-backlight-helper", ++ "/run/current-system/sw/bin/elementary-settings-daemon/gsd-backlight-helper", + g_udev_device_get_sysfs_path (backlight->udev_device), + data->value_str, NULL); + } else { diff --git a/plugins/power/org.gnome.settings-daemon.plugins.power.policy.in.in b/plugins/power/org.gnome.settings-daemon.plugins.power.policy.in.in -index f16300f8..f19bba3e 100644 +index f16300f8..79d6bd17 100644 --- a/plugins/power/org.gnome.settings-daemon.plugins.power.policy.in.in +++ b/plugins/power/org.gnome.settings-daemon.plugins.power.policy.in.in @@ -25,7 +25,7 @@ @@ -22,5 +22,5 @@ index f16300f8..f19bba3e 100644 - @libexecdir@/gsd-backlight-helper + /run/current-system/sw/bin/elementary-settings-daemon/gsd-backlight-helper - +