pantheon.elementary-settings-daemon: reinit at 1.0.0

the former package has been renamed and upgraded to gnome.gnome-settings-daemon338
This commit is contained in:
Bobby Rong 2021-07-18 20:33:27 +08:00
parent e9facd8a46
commit 1558d9c17b
No known key found for this signature in database
GPG Key ID: ED07364437C91161
5 changed files with 34 additions and 263 deletions

View File

@ -109,12 +109,7 @@ lib.makeScope pkgs.newScope (self: with self; {
elementary-notifications = callPackage ./services/elementary-notifications { };
# 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 {
inherit (gnome) gnome-desktop;
};
elementary-settings-daemon = callPackage ./services/elementary-settings-daemon { };
pantheon-agent-geoclue2 = callPackage ./services/pantheon-agent-geoclue2 { };

View File

@ -1,165 +1,66 @@
{ lib, stdenv
, substituteAll
, fetchurl
, fetchgit
, fetchpatch
, fetchFromGitHub
, 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
, accountsservice
, wrapGAppsHook
, python3
, tzdata
, nss
, gcr
, pantheon
, pkg-config
, python3
, vala
, accountsservice
, dbus
, desktop-file-utils
, geoclue2
, glib
, gobject-introspection
, gtk3
, granite
, libgee
, wrapGAppsHook
}:
stdenv.mkDerivation rec {
pname = "elementary-settings-daemon";
version = "3.34.1";
version = "1.0.0";
repoName = "gnome-settings-daemon";
repoName = "settings-daemon";
src = fetchgit {
url = "https://git.launchpad.net/~ubuntu-desktop/ubuntu/+source/${repoName}";
rev = "refs/tags/ubuntu/${version}-1ubuntu2";
sha256 = "0w0dsbzif7v0gk61rs9g20ldlimbdwb5yvlfdc568yyx5z643jbv";
src = fetchFromGitHub {
owner = "elementary";
repo = repoName;
rev = version;
sha256 = "1masvy1f9z2cp8w5ajnhy4k9bzvzgfziqlm59bf146pdd2567hiw";
};
# 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 = "${src}/debian/patches"; in [
(substituteAll {
src = ./fix-paths.patch;
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-gsettings-removals.patch"
"${patchPath}/revert-mediakeys-dbus-interface-drop.patch"
#"${patchPath}/ubuntu_ibus_configs.patch"
# https://github.com/elementary/os-patches/blob/6975d1c254cb6ab913b8e2396877203aea8eaa65/debian/patches/elementary-dpms.patch
./elementary-dpms.patch
# Query GWeather DB on the fly instead of caching.
# Needed for the next patch to apply.
# https://gitlab.gnome.org/GNOME/gnome-settings-daemon/merge_requests/175
(fetchpatch {
url = "https://gitlab.gnome.org/GNOME/gnome-settings-daemon/commit/df6c69f028d27b53ac86829e11df103b25ed5a74.patch";
sha256 = "bKZkPzN64DXMgitjn0vUzUvKl7ldhN/mNVtPKVmHd0Q=";
})
# 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 = [
desktop-file-utils
gobject-introspection
meson
ninja
pkg-config
perl
gettext
libxml2
libxslt
docbook_xsl
wrapGAppsHook
python3
vala
wrapGAppsHook
];
buildInputs = [
accountsservice
alsa-lib
colord
gcr
dbus
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
granite
libgee
];
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
patchShebangs $f
done
chmod +x meson/post_install.py
patchShebangs meson/post_install.py
'';
postFixup = ''
# So the polkit policy can reference /run/current-system/sw/bin/elementary-settings-daemon/gsd-backlight-helper
mkdir -p $out/bin/elementary-settings-daemon
ln -s $out/libexec/gsd-backlight-helper $out/bin/elementary-settings-daemon/gsd-backlight-helper
'';
passthru = {
updateScript = gnome.updateScript {
packageName = repoName;
attrPath = "pantheon.${pname}";
};
};
meta = with lib; {
license = licenses.gpl2Plus;
description = "Settings daemon for Pantheon";
homepage = "https://github.com/elementary/settings-daemon";
license = licenses.gpl3Plus;
maintainers = pantheon.maintainers;
platforms = platforms.linux;
};

View File

@ -1,84 +0,0 @@
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 @@
<summary>Activation of this plugin</summary>
<description>Whether this plugin would be activated by unity-settings-daemon or not</description>
</key>
+ <key name="manage-dpms-defaults" type="b">
+ <default>false</default>
+ <summary>Reset X DPMS values</summary>
+ <description>Whether DPMS values will be adjusted by gnome-settings-daemon</description>
+ </key>
<key name="idle-brightness" type="i">
<default>30</default>
<summary>The brightness of the screen when idle</summary>
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,

View File

@ -1,15 +0,0 @@
--- a/plugins/datetime/tz.h
+++ b/plugins/datetime/tz.h
@@ -27,11 +27,7 @@
#include <glib.h>
-#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;

View File

@ -1,26 +0,0 @@
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..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 @@
<allow_inactive>no</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
- <annotate key="org.freedesktop.policykit.exec.path">@libexecdir@/gsd-backlight-helper</annotate>
+ <annotate key="org.freedesktop.policykit.exec.path">/run/current-system/sw/bin/elementary-settings-daemon/gsd-backlight-helper</annotate>
</action>
</policyconfig>