[Xfce4-commits] <xfce4-battery-plugin:master> Compile the plugin as a module.

Landry Breuil noreply at xfce.org
Sat Apr 14 15:48:05 CEST 2012


Updating branch refs/heads/master
         to 242bc96a5fef91d75cab52e03c483c6de175a4c9 (commit)
       from a24e726bcc0133a6a8a54db4bcfc74b99258d9a9 (commit)

commit 242bc96a5fef91d75cab52e03c483c6de175a4c9
Author: Landry Breuil <landry at xfce.org>
Date:   Sat Apr 14 15:46:10 2012 +0200

    Compile the plugin as a module.
    
    - Switch from _PROGRAMS to _LTLIBRARIES
    - Register the plugin as not external
    - Rename .desktop.in.in to .desktop.in (and while here battmon->battery)
    - install plugin/desktop file in the correct panel/plugins dir

 configure.ac.in                                    |    5 ++-
 panel-plugin/Makefile.am                           |   33 +++++++++----------
 panel-plugin/battery.c                             |    2 +-
 .../{battmon.desktop.in.in => battery.desktop.in}  |    3 +-
 4 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index 8e46f76..e4c354c 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -37,9 +37,12 @@ dnl ********************************
 AC_PROG_CC()
 AC_PROG_LD()
 AC_PROG_INSTALL()
-AC_PROG_LIBTOOL()
 AC_PROG_INTLTOOL()
 
+dnl Initialize libtool
+LT_PREREQ([2.2.6])
+LT_INIT([disable-static])
+
 dnl **********************************
 dnl *** Check for standard headers ***
 dnl **********************************
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index 681a449..44a6263 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -7,48 +7,47 @@ INCLUDES =								\
 #
 # Battery plugin
 #
-plugindir =								\
-	$(libexecdir)/xfce4/panel-plugins
+plugindir = $(libdir)/xfce4/panel/plugins
 
-plugin_PROGRAMS =							\
-	xfce4-battery-plugin
+plugin_LTLIBRARIES = libbattery.la
 
-xfce4_battery_plugin_SOURCES =						\
+libbattery_la_SOURCES =							\
 	battery.c							\
 	libacpi.h							\
 	libacpi.c							\
 	libapm.h							\
 	libapm.c
 
-xfce4_battery_plugin_CFLAGS =						\
+libbattery_la_CFLAGS =							\
 	$(LIBXFCE4PANEL_CFLAGS)						\
 	$(LIBXFCE4UI_CFLAGS)						\
 	$(LIBXFCE4UTIL_CFLAGS)						\
 	$(GTK_CFLAGS)							\
 	$(PLATFORM_CFLAGS)
 
-xfce4_battery_plugin_LDADD =						\
+libbattery_la_LIBADD =							\
 	$(LIBXFCE4PANEL_LIBS)						\
 	$(LIBXFCE4UI_LIBS)						\
 	$(LIBXFCE4UTIL_LIBS)						\
 	$(GTK_LIBS)
 
+libbattery_la_LDFLAGS = \
+	-avoid-version \
+	-module \
+	-no-undefined \
+	-export-symbols-regex '^xfce_panel_module_(preinit|init|construct)' \
+	$(PLATFORM_LDFLAGS)
+
 #
 # Desktop file
 #
-desktopdir = $(datadir)/xfce4/panel-plugins
-desktop_in_in_files = battmon.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" < $< > $@
+desktopdir = $(datadir)/xfce4/panel/plugins
+desktop_in_files = battery.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/battery.c b/panel-plugin/battery.c
index f6323ef..0bade03 100644
--- a/panel-plugin/battery.c
+++ b/panel-plugin/battery.c
@@ -1538,5 +1538,5 @@ battmon_construct (XfcePanelPlugin *plugin)
 }
 
 /* register the plugin */
-XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL (battmon_construct);
+XFCE_PANEL_PLUGIN_REGISTER (battmon_construct);
 
diff --git a/panel-plugin/battmon.desktop.in.in b/panel-plugin/battery.desktop.in
similarity index 68%
rename from panel-plugin/battmon.desktop.in.in
rename to panel-plugin/battery.desktop.in
index cae3fae..66085c9 100644
--- a/panel-plugin/battmon.desktop.in.in
+++ b/panel-plugin/battery.desktop.in
@@ -4,4 +4,5 @@ Encoding=UTF-8
 _Name=Battery Monitor
 _Comment=Show and monitor the battery status
 Icon=xfce4-battery-plugin
-X-XFCE-Exec=@libexecdir@/xfce4/panel-plugins/xfce4-battery-plugin
+X-XFCE-Internal=FALSE
+X-XFCE-Module=battery


More information about the Xfce4-commits mailing list