From bb4c7e2cefcdf504784e1c224b3e031ac3e00446 Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Tue, 24 Jul 2012 12:34:16 +0200 Subject: [PATCH] Build the plugin as a module. - Switch from _PROGRAMS to _LTLIBRARIES - Register the plugin as not external - Rename .desktop.in.in to .desktop.in since there's no path replacement dance anymore --- panel-plugin/Makefile.am | 32 ++++++++++++++++---------------- panel-plugin/weather.c | 2 +- panel-plugin/weather.desktop.in | 6 ++++++ panel-plugin/weather.desktop.in.in | 6 ------ po/POTFILES.in | 2 +- 5 files changed, 24 insertions(+), 24 deletions(-) create mode 100644 panel-plugin/weather.desktop.in delete mode 100644 panel-plugin/weather.desktop.in.in diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am index ed06da1..f1fe387 100644 --- a/panel-plugin/Makefile.am +++ b/panel-plugin/Makefile.am @@ -4,12 +4,11 @@ INCLUDES = \ -DPACKAGE_LOCALE_DIR=\"$(localedir)\" \ -DG_LOG_DOMAIN=\"weather\" -plugin_PROGRAMS = \ - xfce4-weather-plugin +plugin_LTLIBRARIES = libweather.la -plugindir = $(libexecdir)/xfce4/panel-plugins +plugindir = $(libdir)/xfce4/panel/plugins -xfce4_weather_plugin_SOURCES = \ +libweather_la_SOURCES = \ weather.c \ weather.h \ weather-config.c \ @@ -31,14 +30,14 @@ xfce4_weather_plugin_SOURCES = \ weather-translate.c \ weather-translate.h -xfce4_weather_plugin_CFLAGS = \ +libweather_la_CFLAGS = \ $(LIBXFCE4PANEL_CFLAGS) \ $(LIBXFCE4UI_CFLAGS) \ $(LIBXFCE4UTIL_CFLAGS) \ $(GTK_CFLAGS) \ $(LIBXML_CFLAGS) -xfce4_weather_plugin_LDADD = \ +libweather_la_LIBADD = \ $(LIBXFCE4PANEL_LIBS) \ $(LIBXFCE4UTIL_LIBS) \ $(LIBXFCE4UI_LIBS) \ @@ -46,19 +45,20 @@ xfce4_weather_plugin_LDADD = \ $(LIBXML_LIBS) \ $(LIBRESOLV) -desktopdir = $(datadir)/xfce4/panel-plugins -desktop_in_in_files = weather.desktop.in.in -desktop_in_files = $(desktop_in_in_files:.desktop.in.in=.desktop.in) -%.desktop.in: %.desktop.in.in - sed -e "s,\@libexecdir\@,$(libexecdir),g" < $< > $@ +libweather_la_LDFLAGS = \ + -avoid-version \ + -module \ + -no-undefined \ + -export-symbols-regex '^xfce_panel_module_(preinit|init|construct)' \ + $(PLATFORM_LDFLAGS) + +desktopdir = $(datadir)/xfce4/panel/plugins +desktop_in_files = weather.desktop.in desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) @INTLTOOL_DESKTOP_RULE@ -EXTRA_DIST = \ - $(desktop_in_in_files) +EXTRA_DIST = $(desktop_in_files) -CLEANFILES = \ - $(desktop_in_files) \ - $(desktop_DATA) +CLEANFILES = $(desktop_DATA) # vi:set ts=8 sw=8 noet ai nocindent syntax=automake: diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c index c95cccb..aab4cd9 100644 --- a/panel-plugin/weather.c +++ b/panel-plugin/weather.c @@ -1186,4 +1186,4 @@ weather_construct (XfcePanelPlugin *plugin) update_weatherdata (data); } -XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL (weather_construct); +XFCE_PANEL_PLUGIN_REGISTER (weather_construct); diff --git a/panel-plugin/weather.desktop.in b/panel-plugin/weather.desktop.in new file mode 100644 index 0000000..6c39f68 --- /dev/null +++ b/panel-plugin/weather.desktop.in @@ -0,0 +1,6 @@ +[Xfce Panel] +Type=X-XFCE-PanelPlugin +_Name=Weather Update +_Comment=Show current weather conditions +Icon=xfce4-weather +X-XFCE-Exec=@libexecdir@/xfce4/panel-plugins/xfce4-weather-plugin diff --git a/panel-plugin/weather.desktop.in.in b/panel-plugin/weather.desktop.in.in deleted file mode 100644 index 6c39f68..0000000 --- a/panel-plugin/weather.desktop.in.in +++ /dev/null @@ -1,6 +0,0 @@ -[Xfce Panel] -Type=X-XFCE-PanelPlugin -_Name=Weather Update -_Comment=Show current weather conditions -Icon=xfce4-weather -X-XFCE-Exec=@libexecdir@/xfce4/panel-plugins/xfce4-weather-plugin diff --git a/po/POTFILES.in b/po/POTFILES.in index 3f2884b..c834059 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -19,4 +19,4 @@ panel-plugin/weather-summary.h panel-plugin/weather-translate.c panel-plugin/weather-translate.h -panel-plugin/weather.desktop.in.in +panel-plugin/weather.desktop.in -- 1.7.6