From 63e6939e63aaad504f690595d63e73915709eb90 Mon Sep 17 00:00:00 2001 From: David Schneider Date: Wed, 15 Feb 2012 00:10:18 -0800 Subject: [PATCH 1/2] Compile the plugin as a module and install to lib instead of libexec. --- 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 /libexec/xfce4/panel-plugins/ + libgenmon.so + libgenmon.la +installed in /lib/xfce4/panel/plugins/ and genmon.desktop -installed in /share/xfce4/panel-plugins/ +installed in /share/xfce4/panel/plugins/ xfce4-genmon-plugin.mo installed in /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 .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 1f7a029..04faf74 100644 --- a/panel-plugin/main.c +++ b/panel-plugin/main.c @@ -789,5 +789,5 @@ static void genmon_construct (XfcePanelPlugin *plugin) G_CALLBACK (ExecOnClickCmd), genmon); } -XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL (genmon_construct) +XFCE_PANEL_PLUGIN_REGISTER (genmon_construct) -- 1.7.5.4