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

Landry Breuil noreply at xfce.org
Tue Apr 10 19:26:04 CEST 2012


Updating branch refs/heads/master
         to d91c15bb1cb5ffa64e8c97e3bc95bb4b91182444 (commit)
       from 599edfef58711a2635fbee81aa71a3b8e44a46b5 (commit)

commit d91c15bb1cb5ffa64e8c97e3bc95bb4b91182444
Author: Landry Breuil <landry at xfce.org>
Date:   Tue Apr 10 12:38:57 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

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

diff --git a/configure.ac.in b/configure.ac.in
index fcb4c59..ed3c6dd 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -33,6 +33,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 990de3f..0cd803a 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -1,9 +1,9 @@
-plugindir = $(libexecdir)/xfce4/panel-plugins
-plugin_PROGRAMS = xfce4-mount-plugin
+plugindir = $(libdir)/xfce4/panel/plugins
+plugin_LTLIBRARIES = libmount.la
 
 LIBS = @LIBS@ @SOLLIBS@
 
-xfce4_mount_plugin_SOURCES =                                \
+libmount_la_SOURCES =                                \
 	devices.c                                           \
 	devices.h                                           \
 	mount-plugin.c  				\
@@ -11,37 +11,37 @@ xfce4_mount_plugin_SOURCES =                                \
 	helpers.c						\
 	helpers.h
 
-xfce4_mount_plugin_CFLAGS =			         \
+libmount_la_CFLAGS =			         \
 	-DPACKAGE_LOCALE_DIR=\"$(localedir)\"               \
 	@LIBXFCE4PANEL_CFLAGS@				\
 	@LIBXFCEGUI4_CFLAGS@
 
-xfce4_mount_plugin_LDADD =                                \
+libmount_LIBADD =                                \
 	@SOLLIBS@                                   			\
 	@LIBXFCE4PANEL_LIBS@				\
 	@LIBXFCEGUI4_LIBS@
 
+libmount_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 = xfce4-mount-plugin.desktop.in.in
-desktop_in_files = $(desktop_in_in_files:.desktop.in.in=.desktop.in)
+desktop_in_files = xfce4-mount-plugin.desktop.in
 	
-desktopdir = $(datadir)/xfce4/panel-plugins
+desktopdir = $(datadir)/xfce4/panel/plugins
 desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
 @INTLTOOL_DESKTOP_RULE@
 
 EXTRA_DIST =														\
 	icons.h 														\
 	kcmpartitions.png												\
-	$(desktop_in_in_files)
+	$(desktop_in_files)
 
-DISTCLEANFILES =													\
-	$(desktop_DATA) $(desktop_in_files)
+DISTCLEANFILES = $(desktop_DATA)
 	
 noinst_DATA =							                           \
 	icons.h 						                                 \
@@ -50,11 +50,3 @@ noinst_DATA =							                           \
 icons.h: $(srcdir)/kcmpartitions.png
 	gdk-pixbuf-csource --raw --build-list 			            \
 	icon_plugin kcmpartitions.png > icons.h
-	
-# get full path into .desktop file
-%.desktop.in: %.desktop.in.in
-	sed -e "s^@PLUGIN_PATH@^$(libexecdir)/xfce4/panel-plugins^" \
-		$< > $@
-
-
-
diff --git a/panel-plugin/mount-plugin.c b/panel-plugin/mount-plugin.c
index 6105555..d6f6449 100644
--- a/panel-plugin/mount-plugin.c
+++ b/panel-plugin/mount-plugin.c
@@ -1083,4 +1083,4 @@ mount_construct (XfcePanelPlugin *plugin)
 
 }
 
-XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL (mount_construct);
+XFCE_PANEL_PLUGIN_REGISTER (mount_construct);
diff --git a/panel-plugin/xfce4-mount-plugin.desktop.in.in b/panel-plugin/xfce4-mount-plugin.desktop.in
similarity index 77%
rename from panel-plugin/xfce4-mount-plugin.desktop.in.in
rename to panel-plugin/xfce4-mount-plugin.desktop.in
index ffd440e..ae9bcaa 100644
--- a/panel-plugin/xfce4-mount-plugin.desktop.in.in
+++ b/panel-plugin/xfce4-mount-plugin.desktop.in
@@ -4,5 +4,5 @@ Encoding=UTF-8
 _Name=Mount devices
 _Comment=Shows all mountable devices and (un)mounts them on request.
 Icon=xfce-mount
-X-XFCE-Exec=@PLUGIN_PATH@/xfce4-mount-plugin
-
+X-XFCE-Internal=FALSE
+X-XFCE-Module=mount


More information about the Xfce4-commits mailing list