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

Landry Breuil noreply at xfce.org
Wed Apr 18 23:30:03 CEST 2012


Updating branch refs/heads/master
         to 7312a9e437c0d799f59dcf1ae33cc64f0c60d2aa (commit)
       from 961f109619d37ecbc95c64724f879369b5d2933e (commit)

commit 7312a9e437c0d799f59dcf1ae33cc64f0c60d2aa
Author: Landry Breuil <landry at rhaalovely.net>
Date:   Wed Apr 18 23:21:14 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
    - install plugin/desktop file in the correct panel/plugins dir
    - fix goodies-dev ml address while here, it was still referencing berlios.de..

 configure.ac.in                                    |    6 ++-
 panel-plugin/Makefile.am                           |   42 ++++++++------------
 panel-plugin/cpu.c                                 |    2 +-
 ...{cpugraph.desktop.in.in => cpugraph.desktop.in} |    3 +-
 4 files changed, 25 insertions(+), 28 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index 3aa57bb..9078b5c 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -8,7 +8,7 @@ dnl
 m4_define([cpugraph_version],[1.0.1])
 
 AC_INIT([xfce4-cpugraph-plugin], [cpugraph_version],
-	[xfce-goodies-dev at lists.berlios.de])
+	[goodies-dev at xfce.org])
 AC_USE_SYSTEM_EXTENSIONS()
 
 CPUGRAPH_VERSION=cpugraph_version()
@@ -23,6 +23,10 @@ AC_PROG_INSTALL
 AC_PROG_INTLTOOL
 AM_PROG_CC_C_O
 
+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 6340196..a129fc1 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -1,16 +1,16 @@
-plugindir = $(libexecdir)/xfce4/panel-plugins
-plugin_PROGRAMS = xfce4-cpugraph-plugin
+plugindir = $(libdir)/xfce4/panel/plugins
+plugin_LTLIBRARIES = libcpugraph.la
 
-xfce4_cpugraph_plugin_CFLAGS =					\
+libcpugraph_la_CFLAGS =					\
 	-DPACKAGE_LOCALE_DIR=\"$(localedir)\"			\
 	@LIBXFCE4UI_CFLAGS@					\
 	@LIBXFCE4PANEL_CFLAGS@
 
-xfce4_cpugraph_plugin_LDADD =					\
+libcpugraph_la_LIBADD =					\
 	@LIBXFCE4UI_LIBS@					\
 	@LIBXFCE4PANEL_LIBS@
 
-xfce4_cpugraph_plugin_SOURCES =                                 \
+libcpugraph_la_SOURCES =                                 \
 	mode.c                                                  \
 	mode.h                                                  \
 	cpu.c                                                   \
@@ -22,29 +22,21 @@ xfce4_cpugraph_plugin_SOURCES =                                 \
 	settings.c                                              \
 	settings.h
 
+libcpugraph_la_LDFLAGS = \
+	-avoid-version \
+	-module \
+	-no-undefined \
+	-export-symbols-regex '^xfce_panel_module_(preinit|init|construct)' \
+	$(PLATFORM_LDFLAGS)
+
 # .desktop file
 #
-# Some automake trickery here. Because we cannot use $(libexecdir) 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.
-# 
-desktop_in_in_files = cpugraph.desktop.in.in
-desktop_in_files = $(desktop_in_in_files:.desktop.in.in=.desktop.in)
-
-desktopdir = $(datadir)/xfce4/panel-plugins
+desktop_in_files = cpugraph.desktop.in
+
+desktopdir = $(datadir)/xfce4/panel/plugins
 desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
 @INTLTOOL_DESKTOP_RULE@
 
-EXTRA_DIST = 								\
-	$(desktop_in_in_files)
-
-DISTCLEANFILES =							\
-	$(desktop_DATA) $(desktop_in_files)
-
-# get full path into .desktop file
-cpugraph.desktop.in: cpugraph.desktop.in.in
-	sed -e "s^@PLUGIN_PATH@^$(libexecdir)/xfce4/panel-plugins^" \
-		$< > $@
-
+EXTRA_DIST = $(desktop_in_files)
 
+DISTCLEANFILES = $(desktop_DATA)
diff --git a/panel-plugin/cpu.c b/panel-plugin/cpu.c
index 1f13b51..21d49f7 100644
--- a/panel-plugin/cpu.c
+++ b/panel-plugin/cpu.c
@@ -50,7 +50,7 @@ static void draw_area_cb( GtkWidget *da, GdkEventExpose *event, gpointer data );
 static void draw_graph( CPUGraph *base );
 static gboolean command_cb( GtkWidget *w, GdkEventButton *event, CPUGraph *base );
 
-XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL( cpugraph_construct );
+XFCE_PANEL_PLUGIN_REGISTER( cpugraph_construct );
 
 static void cpugraph_construct( XfcePanelPlugin *plugin )
 {
diff --git a/panel-plugin/cpugraph.desktop.in.in b/panel-plugin/cpugraph.desktop.in
similarity index 75%
rename from panel-plugin/cpugraph.desktop.in.in
rename to panel-plugin/cpugraph.desktop.in
index f771a4c..191788a 100644
--- a/panel-plugin/cpugraph.desktop.in.in
+++ b/panel-plugin/cpugraph.desktop.in
@@ -4,5 +4,6 @@ Encoding=UTF-8
 _Name=CPU Graph
 _Comment=Graphical representation of the CPU load
 Icon=xfce4-cpugraph-plugin
-X-XFCE-Exec=@PLUGIN_PATH@/xfce4-cpugraph-plugin
+X-XFCE-Module=cpugraph
+X-XFCE-Unique=FALSE
 


More information about the Xfce4-commits mailing list