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

Landry Breuil noreply at xfce.org
Wed Feb 15 11:22:01 CET 2012


Updating branch refs/heads/master
         to 11e6ebca679265ff5fb4e2cda585d8a26f3c99c1 (commit)
       from 8cff2d09308edb3eddef2ecd199b0ec96660c758 (commit)

commit 11e6ebca679265ff5fb4e2cda585d8a26f3c99c1
Author: Landry Breuil <landry at xfce.org>
Date:   Wed Feb 15 10:26:09 2012 +0100

    Compile 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

 configure.ac.in                                    |    4 ++
 panel-plugin/Makefile.am                           |   35 +++++++++-----------
 panel-plugin/xfce4-mpc-plugin.c                    |    2 +-
 ...n.desktop.in.in => xfce4-mpc-plugin.desktop.in} |    4 +-
 4 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index c6877ba..f559c95 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -30,6 +30,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 a99f218..fc478a2 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -1,24 +1,30 @@
 plugindir = $(libdir)/xfce4/panel/plugins
-plugin_PROGRAMS = xfce4-mpc-plugin
+plugin_LTLIBRARIES = libmpc.la
 
-xfce4_mpc_plugin_CFLAGS =						\
+libmpc_la_CFLAGS =							\
 	-DPACKAGE_LOCALE_DIR=\"$(localedir)\"				\
 	@EXO_CFLAGS@							\
 	@LIBXFCE4UI_CFLAGS@						\
 	@LIBXFCE4PANEL_CFLAGS@
 
-xfce4_mpc_plugin_LDADD =						\
+libmpc_la_LIBADD =							\
 	@EXO_LIBS@							\
 	@LIBXFCE4UI_LIBS@						\
 	@LIBXFCE4PANEL_LIBS@
 
+libmpc_la_LDFLAGS = \
+	-avoid-version \
+	-module \
+	-no-undefined \
+	-export-symbols-regex '^xfce_panel_module_(preinit|init|construct)' \
+	$(PLATFORM_LDFLAGS)
 
-xfce4_mpc_plugin_SOURCES = xfce4-mpc-plugin.c xfce4-mpc-plugin.h
+libmpc_la_SOURCES = xfce4-mpc-plugin.c xfce4-mpc-plugin.h
 if USE_LIBMPD
-xfce4_mpc_plugin_CFLAGS += @LIBMPD_CFLAGS@
-xfce4_mpc_plugin_LDADD += @LIBMPD_LIBS@
+libmpc_la_CFLAGS += @LIBMPD_CFLAGS@
+libmpc_la_LIBADD += @LIBMPD_LIBS@
 else
-xfce4_mpc_plugin_SOURCES += simple-libmpd.c simple-libmpd.h
+libmpc_la_SOURCES += simple-libmpd.c simple-libmpd.h
 endif
 
 # .desktop file
@@ -28,21 +34,12 @@ endif
 # 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 = xfce4-mpc-plugin.desktop.in.in
-desktop_in_files = $(desktop_in_in_files:.desktop.in.in=.desktop.in)
+desktop_in_files = xfce4-mpc-plugin.desktop.in
 	
 desktopdir = $(datadir)/xfce4/panel/plugins
 desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
 @INTLTOOL_DESKTOP_RULE@
 
-# get full path into .desktop file
-%.desktop.in: %.desktop.in.in
-	sed -e "s^@PLUGIN_PATH@^$(libdir)/xfce4/panel/plugins^" 	\
-		$< > $@
-	
-EXTRA_DIST =								\
-	$(desktop_in_in_files)
-
-DISTCLEANFILES =							\
-	$(desktop_DATA) $(desktop_in_files)
+EXTRA_DIST = $(desktop_in_files)
 
+DISTCLEANFILES = $(desktop_DATA)
diff --git a/panel-plugin/xfce4-mpc-plugin.c b/panel-plugin/xfce4-mpc-plugin.c
index 2febf64..aefad7f 100644
--- a/panel-plugin/xfce4-mpc-plugin.c
+++ b/panel-plugin/xfce4-mpc-plugin.c
@@ -840,5 +840,5 @@ mpc_construct (XfcePanelPlugin * plugin)
 
 
 /* register the plugin */
-XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL (mpc_construct);
+XFCE_PANEL_PLUGIN_REGISTER (mpc_construct);
 
diff --git a/panel-plugin/xfce4-mpc-plugin.desktop.in.in b/panel-plugin/xfce4-mpc-plugin.desktop.in
similarity index 69%
rename from panel-plugin/xfce4-mpc-plugin.desktop.in.in
rename to panel-plugin/xfce4-mpc-plugin.desktop.in
index 77227a7..74acb9a 100644
--- a/panel-plugin/xfce4-mpc-plugin.desktop.in.in
+++ b/panel-plugin/xfce4-mpc-plugin.desktop.in
@@ -3,6 +3,6 @@ Type=X-XFCE-PanelPlugin
 Encoding=UTF-8
 _Name=MPD Client Plugin
 _Comment=A client for MPD, The Music Player Daemon
-Icon=xfce-multimedia
+Icon=application-multimedia
 X-XFCE-Internal=FALSE
-X-XFCE-Exec=@PLUGIN_PATH@/xfce4-mpc-plugin
+X-XFCE-Module=mpc


More information about the Xfce4-commits mailing list