[Xfce4-commits] <xfce4-genmon-plugin:master> Compile the plugin as a module and install to lib instead of libexec. Patch from David Schneider.

John Lindgren noreply at xfce.org
Thu May 10 01:14:01 CEST 2012


Updating branch refs/heads/master
         to 0c4c582e87f1f0b4b36782b3d4dc021bffce93df (commit)
       from 2a488de06506ff297ae6e686f5f2640e38ba9fdd (commit)

commit 0c4c582e87f1f0b4b36782b3d4dc021bffce93df
Author: John Lindgren <john.lindgren at aol.com>
Date:   Wed May 9 19:10:20 2012 -0400

    Compile the plugin as a module and install to lib instead of libexec. Patch from David Schneider.

 README                            |    9 ++++++---
 configure.ac.in                   |    4 ++++
 panel-plugin/Makefile.am          |   24 +++++++++++++++---------
 panel-plugin/genmon.desktop.in.in |    3 ++-
 panel-plugin/main.c               |    2 +-
 5 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/README b/README
index 16dd87c..27f7c5c 100644
--- a/README
+++ b/README
@@ -17,16 +17,19 @@ Do the usual stuff:
 	- make install  (as root)
 	
 You should then end up with:
-        xfce4-genmon-plugin
-installed in <XFce4InstallationDir>/libexec/xfce4/panel-plugins/
+        libgenmon.so
+        libgenmon.la
+installed in <XFce4InstallationDir>/lib/xfce4/panel/plugins/
 and
         genmon.desktop
-installed in <XFce4InstallationDir>/share/xfce4/panel-plugins/
+installed in <XFce4InstallationDir>/share/xfce4/panel/plugins/
 
         xfce4-genmon-plugin.mo
 installed in <XFce4InstallationDir>/share/locale/XX/LC_MESSAGES/
 where XX represents the languages supported by genmon plugin
 
+You are encouraged to delete the installed libgenmon.la
+
 3 -	Testing
 	-------
 
diff --git a/configure.ac.in b/configure.ac.in
index a04d0ec..485ed7e 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -27,6 +27,10 @@ AC_PROG_CC
 AC_PROG_INSTALL
 AC_PROG_INTLTOOL
 
+dnl Initialize libtool
+LT_PREREQ([2.2.6])
+LT_INIT([disable-static])
+
 dnl Check for standard header files
 AC_HEADER_STDC
 
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index f819ff6..6e32d7c 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -1,16 +1,22 @@
-plugindir = $(libexecdir)/xfce4/panel-plugins
-plugin_PROGRAMS = xfce4-genmon-plugin
+plugindir = $(libdir)/xfce4/panel/plugins
+plugin_LTLIBRARIES = libgenmon.la
 
-xfce4_genmon_plugin_CFLAGS =					\
+libgenmon_la_CFLAGS =						\
 	-DPACKAGE_LOCALE_DIR=\"$(localedir)\"			\
 	@LIBXFCE4PANEL_CFLAGS@					\
 	@LIBXFCE4UI_CFLAGS@
 
-xfce4_genmon_plugin_LDADD =					\
+libgenmon_la_LDFLAGS = 						\
+	-avoid-version 						\
+	-module 						\
+	-no-undefined 						\
+	-export-symbols-regex '^xfce_panel_module_(preinit|init|construct)'
+
+libgenmon_la_LIBADD =						\
 	@LIBXFCE4PANEL_LIBS@					\
 	@LIBXFCE4UI_LIBS@
 
-xfce4_genmon_plugin_SOURCES =	\
+libgenmon_la_SOURCES =		\
 	main.c			\
 	config_gui.h		\
 	config_gui.c		\
@@ -19,7 +25,7 @@ xfce4_genmon_plugin_SOURCES =	\
 
 # .desktop file
 #
-# Some automake trickery here. Because we cannot use $(libexecdir) in the
+# Some automake trickery here. Because we cannot use $(libdir) in the
 # automake stage, we'll use sed to get the full path into the .desktop file.
 # We also need to let intltool merge the translated fields, so we add an
 # additional level of indirection: a <name>.desktop.in.in file.
@@ -27,7 +33,7 @@ xfce4_genmon_plugin_SOURCES =	\
 desktop_in_in_files = genmon.desktop.in.in
 desktop_in_files = $(desktop_in_in_files:.desktop.in.in=.desktop.in)
 	
-desktopdir = $(datadir)/xfce4/panel-plugins
+desktopdir = $(datadir)/xfce4/panel/plugins
 desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
 @INTLTOOL_DESKTOP_RULE@
 
@@ -38,7 +44,7 @@ DISTCLEANFILES =							\
 	$(desktop_DATA) $(desktop_in_files)
 	
 # get full path into .desktop file
-%.desktop.in: %.desktop.in.in
-	sed -e "s^@PLUGIN_PATH@^$(libexecdir)/xfce4/panel-plugins^" \
+$(desktop_in_files): $(desktop_in_in_files)
+	sed -e "s^@PLUGIN_PATH@^$(plugindir)^" \
 		$< > $@
 
diff --git a/panel-plugin/genmon.desktop.in.in b/panel-plugin/genmon.desktop.in.in
index 9508f9d..d412ee4 100644
--- a/panel-plugin/genmon.desktop.in.in
+++ b/panel-plugin/genmon.desktop.in.in
@@ -4,4 +4,5 @@ Encoding=UTF-8
 _Name=Generic Monitor
 _Comment=Show output of a command.
 Icon=utilities-system-monitor
-X-XFCE-Exec=@PLUGIN_PATH@/xfce4-genmon-plugin
+X-XFCE-Module=genmon
+X-XFCE-Internal=false
diff --git a/panel-plugin/main.c b/panel-plugin/main.c
index 73248f9..05389cd 100644
--- a/panel-plugin/main.c
+++ b/panel-plugin/main.c
@@ -791,5 +791,5 @@ static void genmon_construct (XfcePanelPlugin *plugin)
         G_CALLBACK (ExecOnClickCmd), genmon);
 }
 
-XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL (genmon_construct)
+XFCE_PANEL_PLUGIN_REGISTER (genmon_construct)
 


More information about the Xfce4-commits mailing list