[gdm: 5/11] session: Leave to meson the duty of keeping the lists in sync
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdm: 5/11] session: Leave to meson the duty of keeping the lists in sync
- Date: Mon, 31 Aug 2020 13:28:03 +0000 (UTC)
commit cbd156524587fc27e5ad594c223be03a3e257590
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date: Fri Aug 28 13:17:44 2020 +0200
session: Leave to meson the duty of keeping the lists in sync
Don't leave to humans what machines can do, the gnome-login.session list
is filled with an hard-to-maintain single-line semicolon separated list of
components, that then are repeated in the gnome systemd session.conf.
And these are meant to be kept in sync.
Meson can help us in this, so let's just keep a single list in meson and
use it to generate the various formats we need.
data/gnome-login.session.in | 3 +--
data/meson.build | 43 +++++++++++++++++++++++++++++++++++++++----
data/session.conf | 19 -------------------
data/session.conf.in | 4 ++++
4 files changed, 44 insertions(+), 25 deletions(-)
---
diff --git a/data/gnome-login.session.in b/data/gnome-login.session.in
index fd9d45aa..63470962 100644
--- a/data/gnome-login.session.in
+++ b/data/gnome-login.session.in
@@ -1,4 +1,3 @@
[GNOME Session]
Name=Display Manager
-# Keep in sync with gnome-session@gnome-login.target.d/session.conf
-RequiredComponents=org.gnome.Shell;org.gnome.SettingsDaemon.A11ySettings;org.gnome.SettingsDaemon.Color;org.gnome.SettingsDaemon.Datetime;org.gnome.SettingsDaemon.Housekeeping;org.gnome.SettingsDaemon.Keyboard;org.gnome.SettingsDaemon.MediaKeys;org.gnome.SettingsDaemon.Power;org.gnome.SettingsDaemon.PrintNotifications;org.gnome.SettingsDaemon.Rfkill;org.gnome.SettingsDaemon.ScreensaverProxy;org.gnome.SettingsDaemon.Sharing;org.gnome.SettingsDaemon.Smartcard;org.gnome.SettingsDaemon.Sound;org.gnome.SettingsDaemon.Wacom;
+RequiredComponents=@gnome_required_components@;
diff --git a/data/meson.build b/data/meson.build
index bbcad589..cf068599 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -61,12 +61,38 @@ gdm_schema = configure_file(
install_data('locale.alias',
install_dir: get_option('datadir') / 'gdm',
)
+
+gdm_gnome_shell_component = 'org.gnome.Shell'
+gdm_gnome_session_required_components = [
+ 'org.gnome.SettingsDaemon.A11ySettings',
+ 'org.gnome.SettingsDaemon.Color',
+ 'org.gnome.SettingsDaemon.Datetime',
+ 'org.gnome.SettingsDaemon.Housekeeping',
+ 'org.gnome.SettingsDaemon.Keyboard',
+ 'org.gnome.SettingsDaemon.MediaKeys',
+ 'org.gnome.SettingsDaemon.Power',
+ 'org.gnome.SettingsDaemon.PrintNotifications',
+ 'org.gnome.SettingsDaemon.Rfkill',
+ 'org.gnome.SettingsDaemon.ScreensaverProxy',
+ 'org.gnome.SettingsDaemon.Sharing',
+ 'org.gnome.SettingsDaemon.Smartcard',
+ 'org.gnome.SettingsDaemon.Sound',
+ 'org.gnome.SettingsDaemon.Wacom',
+]
+
+gdm_gnome_user_session_wanted_components = gdm_gnome_session_required_components
+gdm_gnome_user_session_wanted_components += [
+ 'org.gnome.SettingsDaemon.XSettings',
+]
+
configure_file(
input: 'gnome-login.session.in',
output: '@BASENAME@',
configuration: {
'libexecdir': gdm_prefix / get_option('libexecdir'),
'check_accelerated_dir': check_accelerated_dir,
+ 'gnome_required_components': ';'.join(
+ [ gdm_gnome_shell_component ] + gdm_gnome_session_required_components),
},
install_dir: get_option('datadir') / 'gnome-session' / 'sessions',
)
@@ -165,10 +191,19 @@ configure_file(
format: 'cmake'
)
-install_data(
- 'session.conf',
- rename: join_paths('gnome-session@gnome-login.target.d', 'session.conf'),
- install_dir: systemd_userunitdir,
+gdm_gnome_session_wanted_targets = []
+foreach component: gdm_gnome_user_session_wanted_components
+ gdm_gnome_session_wanted_targets += 'Wants=@0@.target'.format(component)
+endforeach
+
+configure_file(
+ input: 'session.conf.in',
+ output: 'session.conf',
+ configuration: {
+ 'requires_component': gdm_gnome_shell_component,
+ 'wants_required_components': '\n'.join(gdm_gnome_session_wanted_targets),
+ },
+ install_dir: systemd_userunitdir / 'gnome-session@gnome-login.target.d',
)
# XSession
diff --git a/data/session.conf.in b/data/session.conf.in
new file mode 100644
index 00000000..7bfa3652
--- /dev/null
+++ b/data/session.conf.in
@@ -0,0 +1,4 @@
+[Unit]
+@wants_required_components@
+
+Requires=@requires_component@.target
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]