[gnome-flashback] systemd: configure session using a drop-in



commit 489c7c8b2c632c1bb34059ac0814f47fa81b4b75
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sat Sep 5 20:55:12 2020 +0300

    systemd: configure session using a drop-in

 configure.ac                                       | 23 +++++++++++++++
 data/sessions/Makefile.am                          | 27 +++---------------
 data/systemd/Makefile.am                           | 33 ++++++++++++++++++++--
 data/systemd/gnome-flashback.session.conf.in       |  4 +++
 ...gnome-session-x11@gnome-flashback-compiz.target | 19 -------------
 ...ome-session-x11@gnome-flashback-metacity.target | 19 -------------
 6 files changed, 62 insertions(+), 63 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 428fe067..018b0f83 100644
--- a/configure.ac
+++ b/configure.ac
@@ -372,6 +372,29 @@ AC_SEARCH_LIBS([pam_start], [pam], [], [
   AC_MSG_ERROR([PAM library not found])
 ])
 
+dnl **************************************************************************
+dnl Required components from GNOME Settings Deamon
+dnl **************************************************************************
+
+AC_SUBST([REQUIRED_COMPNENTS_GSD], [" \
+  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.UsbProtection \
+  org.gnome.SettingsDaemon.Wacom \
+  org.gnome.SettingsDaemon.XSettings \
+"])
+
 dnl **************************************************************************
 dnl Process .in files
 dnl **************************************************************************
diff --git a/data/sessions/Makefile.am b/data/sessions/Makefile.am
index 8380e711..547118f0 100644
--- a/data/sessions/Makefile.am
+++ b/data/sessions/Makefile.am
@@ -5,42 +5,23 @@ required_components_common = \
        gnome-panel \
        $(NULL)
 
-required_components_gsd = \
-       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.UsbProtection \
-       org.gnome.SettingsDaemon.Wacom \
-       org.gnome.SettingsDaemon.XSettings \
-       $(NULL)
-
 required_components_compiz = \
        compiz \
        $(required_components_common) \
-       $(required_components_gsd) \
+       $(REQUIRED_COMPNENTS_GSD) \
        $(NULL)
 
 required_components_metacity = \
        metacity \
        $(required_components_common) \
-       $(required_components_gsd) \
+       $(REQUIRED_COMPNENTS_GSD) \
        $(NULL)
 
 space = $(NULL) $(NULL)
 compiz = $(subst $(space),;,$(strip $(required_components_compiz)))
 metacity = $(subst $(space),;,$(strip $(required_components_metacity)))
 
-gnome-flashback-metacity.session: Makefile.am gnome-flashback.session.in
+gnome-flashback-metacity.session: ../../configure.ac Makefile.am gnome-flashback.session.in
        $(AM_V_GEN) sed \
                -e 's,[@]NAME[@],Metacity,g' \
                -e 's,[@]REQUIRED_COMPONENTS[@],$(metacity),g' \
@@ -51,7 +32,7 @@ sessions = \
        $(NULL)
 
 if WITH_COMPIZ_SESSION
-gnome-flashback-compiz.session: Makefile.am gnome-flashback.session.in
+gnome-flashback-compiz.session: ../../configure.ac Makefile.am gnome-flashback.session.in
        $(AM_V_GEN) sed \
                -e 's,[@]NAME[@],Compiz,g' \
                -e 's,[@]REQUIRED_COMPONENTS[@],$(compiz),g' \
diff --git a/data/systemd/Makefile.am b/data/systemd/Makefile.am
index 69d964a1..04df1bec 100644
--- a/data/systemd/Makefile.am
+++ b/data/systemd/Makefile.am
@@ -7,8 +7,6 @@ service_files = $(service_in_files:.service.in=.service)
 
 target_files = \
        gnome-flashback.target \
-       gnome-session-x11@gnome-flashback-compiz.target \
-       gnome-session-x11@gnome-flashback-metacity.target \
        $(NULL)
 
 systemduserunitdir = $(prefix)/lib/systemd/user
@@ -20,13 +18,44 @@ systemduserunit_DATA = \
 %.service: %.service.in
        $(AM_V_GEN) sed -e 's,[@]bindir[@],$(bindir),g' < $< > $@
 
+space = $(NULL) $(NULL)
+wants_gsd = Wants=$(subst $(space),.target\nWants=,$(strip $(REQUIRED_COMPNENTS_GSD))).target
+
+metacity/session.conf: ../../configure.ac Makefile.am gnome-flashback.session.conf.in
+       $(AM_V_GEN) mkdir -p `dirname $@` && sed \
+               -e 's,[@]WANTS_GSD[@],$(wants_gsd),g' \
+               < $(srcdir)/gnome-flashback.session.conf.in > $@
+
+systemd_metacity_sessiondir = $(prefix)/lib/systemd/user/gnome-session@gnome-flashback-metacity.target.d
+systemd_metacity_session_DATA = \
+       metacity/session.conf \
+       $(NULL)
+
 CLEANFILES = \
        $(service_files) \
+       $(systemd_metacity_session_DATA) \
+       $(NULL)
+
+if WITH_COMPIZ_SESSION
+compiz/session.conf: ../../configure.ac Makefile.am gnome-flashback.session.conf.in
+       $(AM_V_GEN) mkdir -p `dirname $@` && sed \
+               -e 's,[@]WANTS_GSD[@],$(wants_gsd),g' \
+               < $(srcdir)/gnome-flashback.session.conf.in > $@
+
+systemd_compiz_sessiondir = $(prefix)/lib/systemd/user/gnome-session@gnome-flashback-compiz.target.d
+systemd_compiz_session_DATA = \
+       compiz/session.conf \
        $(NULL)
 
+CLEANFILES += \
+       $(systemd_compiz_session_DATA) \
+       $(NULL)
+endif
+
 endif
 
 EXTRA_DIST = \
+       gnome-flashback.session.conf.in \
        $(service_in_files) \
        $(target_files) \
        $(NULL)
diff --git a/data/systemd/gnome-flashback.session.conf.in b/data/systemd/gnome-flashback.session.conf.in
new file mode 100644
index 00000000..e5dcdda8
--- /dev/null
+++ b/data/systemd/gnome-flashback.session.conf.in
@@ -0,0 +1,4 @@
+[Unit]
+@WANTS_GSD@
+
+Requires=gnome-flashback.target


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]