[gnome-disk-utility] notify: Port g-s-d plugin to new architecture



commit 403e6e7ac38e80f5bfdd1bd0c3179f22823187a2
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Oct 31 12:27:28 2016 +0100

    notify: Port g-s-d plugin to new architecture
    
    gnome-settings-daemon 3.23.2 uses separate daemons for each one of what
    used to be plugins. The current g-s-d plugin should be a stand-alone
    daemon, with a .desktop file in the xdg autostart folder.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=772863

 configure.ac                                       |    4 -
 src/notify/Makefile.am                             |   77 ++++----------------
 src/notify/gdu-sd-plugin.gnome-settings-plugin.in  |    8 --
 src/notify/{testplugin.c => main.c}                |    0
 ...ome.SettingsDaemon.DiskUtilityNotify.desktop.in |    9 +++
 5 files changed, 24 insertions(+), 74 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 82afeeb..54970ac 100644
--- a/configure.ac
+++ b/configure.ac
@@ -67,9 +67,6 @@ PKG_CHECK_MODULES([LIBDVDREAD], [dvdread >= $LIBDVDREAD_REQUIRED])
 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify >= $LIBNOTIFY_REQUIRED])
 PKG_CHECK_MODULES([LIBLZMA], [liblzma >= $LIBLZMA_REQUIRED])
 
-gsd_plugindir='${libdir}/gnome-settings-daemon-3.0'
-AC_SUBST([gsd_plugindir])
-
 AX_REQUIRE_DEFINED([GLIB_GSETTINGS])
 GLIB_GSETTINGS
 
@@ -102,7 +99,6 @@ AC_ARG_ENABLE([gsd_plugin], AS_HELP_STRING([--disable-gsd-plugin],[don't build g
 msg_gsd_plugin=no
 if test "x$enable_gsd_plugin" != "xno"; then
   msg_gsd_plugin=yes
-  PKG_CHECK_MODULES([GSD_PLUGIN], [gnome-settings-daemon >= GSD_PLUGIN_REQUIRED])
 fi
 AM_CONDITIONAL([USE_GSD_PLUGIN], [test "$msg_gsd_plugin" = "yes"])
 
diff --git a/src/notify/Makefile.am b/src/notify/Makefile.am
index 9a3dae5..8eed907 100644
--- a/src/notify/Makefile.am
+++ b/src/notify/Makefile.am
@@ -5,67 +5,26 @@ if USE_GSD_PLUGIN
 
 gdu_sd_plugin_name = gdu-sd
 
-gdu_sd_plugindir=$(gsd_plugindir)
-
-gdu_sd_plugin_LTLIBRARIES =                                    \
-       libgdu-sd.la                                            \
-       $(NULL)
-
-libgdu_sd_la_SOURCES =                                                 \
-       gdusdmanager.h          gdusdmanager.c                  \
-       gdusdmonitor.h          gdusdmonitor.c                  \
-       $(NULL)
-
-libgdu_sd_la_CPPFLAGS =                                        \
-       -DGNOME_SETTINGS_LOCALEDIR=\""$(datadir)/locale"\"      \
-       $(AM_CPPFLAGS)
-
-libgdu_sd_la_CFLAGS =                                          \
-       $(GSD_PLUGIN_CFLAGS)                                    \
-       $(GLIB2_CFLAGS)                                         \
-       $(GTK3_CFLAGS)                                          \
-       $(UDISKS2_CFLAGS)                                       \
-       $(LIBNOTIFY_CFLAGS)                                     \
-       $(NULL)
-
-libgdu_sd_la_LDFLAGS =                                                 \
-       -export-dynamic                                         \
-       -export-symbols-regex '^register_gnome_settings_plugin' \
-       -module                                                 \
-       -avoid-version                                          \
-       -no-undefined                                           \
-       $(NULL)
-
-libgdu_sd_la_LIBADD  =                                                 \
-       $(GSD_PLUGIN_LIBS)                                      \
-       $(GLIB2_LIBS)                                           \
-       $(GTK3_LIBS)                                            \
-       $(UDISKS2_LIBS)                                         \
-       $(LIBNOTIFY_LIBS)                                       \
-       $(NULL)
-
-endif # USE_GSD_PLUGIN
-
 # ----------------------------------------------------------------------
 
-noinst_PROGRAMS = test-plugin
+libexec_PROGRAMS = gsd-disk-utility-notify
 
-test_plugin_SOURCES =                                          \
-       testplugin.c                                            \
+gsd_disk_utility_notify_SOURCES =                              \
+       main.c                                                  \
        gdusdmonitor.h          gdusdmonitor.c                  \
        $(NULL)
 
-test_plugin_CPPFLAGS =                                         \
+gsd_disk_utility_notify_CPPFLAGS =                             \
        $(NULL)
 
-test_plugin_CFLAGS =                                           \
+gsd_disk_utility_notify_CFLAGS =                               \
        $(GLIB2_CFLAGS)                                         \
        $(GTK3_CFLAGS)                                          \
        $(UDISKS2_CFLAGS)                                       \
        $(LIBNOTIFY_CFLAGS)                                     \
        $(NULL)
 
-test_plugin_LDADD =                                            \
+gsd_disk_utility_notify_LDADD =                                        \
        $(GLIB2_LIBS)                                           \
        $(GTK3_LIBS)                                            \
        $(UDISKS2_LIBS)                                         \
@@ -74,29 +33,23 @@ test_plugin_LDADD =                                         \
 
 # ----------------------------------------------------------------------
 
-gdu_sd_plugin_in_files =                                       \
-       gdu-sd-plugin.gnome-settings-plugin.in                  \
-       $(NULL)
-
-if USE_GSD_PLUGIN
-
-gdu_sd_plugin_DATA = $(gdu_sd_plugin_in_files:.gnome-settings-plugin.in=.gnome-settings-plugin)
+autostart_desktopdir = $(sysconfdir)/xdg/autostart
+autostart_desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
 
 endif # USE_GSD_PLUGIN
 
-%.gnome-settings-plugin: %.gnome-settings-plugin.in
-       LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+desktop_in_files = org.gnome.SettingsDaemon.DiskUtilityNotify.desktop.in
+%.desktop: %.desktop.in
+       $(AM_V_GEN) sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
 
-EXTRA_DIST =                           \
-       $(gdu_sd_plugin_in_files)       \
-       $(NULL)
+EXTRA_DIST = $(desktop_in_files)
 
-CLEANFILES =                           \
-       $(gdu_sd_plugin_DATA)           \
+CLEANFILES =                                           \
+       $(autostart_desktop_DATA)                       \
        $(NULL)
 
 DISTCLEANFILES =                       \
-       $(gdu_sd_plugin_DATA)           \
+       $(autostart_desktop_DATA)                       \
        $(NULL)
 
 clean-local :
diff --git a/src/notify/testplugin.c b/src/notify/main.c
similarity index 100%
rename from src/notify/testplugin.c
rename to src/notify/main.c
diff --git a/src/notify/org.gnome.SettingsDaemon.DiskUtilityNotify.desktop.in 
b/src/notify/org.gnome.SettingsDaemon.DiskUtilityNotify.desktop.in
new file mode 100644
index 0000000..1121c5e
--- /dev/null
+++ b/src/notify/org.gnome.SettingsDaemon.DiskUtilityNotify.desktop.in
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Type=Application
+Name=gnome-disk-utility notification plugin for GNOME Settings Daemon
+Exec=@libexecdir@/gsd-disk-utility-notify
+OnlyShowIn=GNOME;
+NoDisplay=true
+X-GNOME-Autostart-Phase=Initialization
+X-GNOME-Autostart-Notify=true
+X-GNOME-AutoRestart=true


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