From b5426178a0efa9c7fe16ffa2d8fe31ff92133c29 Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Tue, 17 Apr 2012 21:21:59 +0200 Subject: [PATCH] Build 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.in.in | 7 +++- panel-plugin/Makefile.am | 42 +++++++++------------- panel-plugin/xfce4-orageclock-plugin.c | 2 +- panel-plugin/xfce4-orageclock-plugin.desktop.in | 4 +- po/POTFILES.in | 2 +- 5 files changed, 26 insertions(+), 31 deletions(-) diff --git a/configure.in.in b/configure.in.in index 061f7c4..792524f 100644 --- a/configure.in.in +++ b/configure.in.in @@ -49,12 +49,15 @@ dnl Check for basic programs AC_PROG_CC() AC_PROG_INSTALL() AC_PROG_INTLTOOL([intltool_minimum_version], [no-xml]) -AC_PROG_LIBTOOL() AC_PROG_YACC() AC_PROG_LN_S() AM_PROG_LEX() 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() AC_CHECK_HEADERS([assert.h errno.h pthread.h stdint.h time.h sys/types.h unistd.h wctype.h]) diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am index cb20d72..f51ec7a 100644 --- a/panel-plugin/Makefile.am +++ b/panel-plugin/Makefile.am @@ -1,19 +1,26 @@ if HAVE_LIBXFCE4PANEL -plugin_PROGRAMS = xfce4-orageclock-plugin +plugin_LTLIBRARIES = orageclock.la endif -plugindir = $(libexecdir)/xfce4/panel-plugins +plugindir = $(libdir)/xfce4/panel/plugins -xfce4_orageclock_plugin_CFLAGS = \ +orageclock_la_CFLAGS = \ -DPACKAGE_DATA_DIR=\"$(datadir)\" \ -DPACKAGE_LOCALE_DIR=\"$(localedir)\" \ @LIBXFCE4PANEL_CFLAGS@ -xfce4_orageclock_plugin_LDFLAGS = \ +orageclock_la_LDFLAGS = \ + -avoid-version \ + -module \ + -no-undefined \ + -export-symbols-regex '^xfce_panel_module_(preinit|init|construct)' \ + $(PLATFORM_LDFLAGS) + +orageclock_la_LIBADD = \ @LIBXFCE4PANEL_LIBS@ \ -lX11 -xfce4_orageclock_plugin_SOURCES = \ +orageclock_la_SOURCES = \ oc_config.c \ timezone_selection.c \ timezone_selection.h \ @@ -25,33 +32,18 @@ xfce4_orageclock_plugin_SOURCES = \ ../src/functions.h if HAVE_CYGWIN -xfce4_orageclock_plugin_LDFLAGS += \ +orageclock_la_LDFLAGS += \ -no-undefined endif # .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 .desktop.in.in file. -# -desktop_in_in_files = xfce4-orageclock-plugin.desktop.in.in -desktop_in_files = $(desktop_in_in_files:.desktop.in.in=.desktop.in) +desktop_in_files = xfce4-orageclock-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 = \ - $(desktop_in_in_files) - -DISTCLEANFILES = \ - $(desktop_DATA) $(desktop_in_files) - -# get full path into .desktop file -#%.desktop.in: %.desktop.in.in -xfce4-orageclock-plugin.desktop.in: xfce4-orageclock-plugin.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/xfce4-orageclock-plugin.c b/panel-plugin/xfce4-orageclock-plugin.c index 4a6ad8f..36a76ba 100644 --- a/panel-plugin/xfce4-orageclock-plugin.c +++ b/panel-plugin/xfce4-orageclock-plugin.c @@ -740,5 +740,5 @@ static void oc_construct(XfcePanelPlugin *plugin) /* Register with the panel */ -XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL(oc_construct); +XFCE_PANEL_PLUGIN_REGISTER(oc_construct); diff --git a/panel-plugin/xfce4-orageclock-plugin.desktop.in b/panel-plugin/xfce4-orageclock-plugin.desktop.in index 7220138..c4ec6bb 100644 --- a/panel-plugin/xfce4-orageclock-plugin.desktop.in +++ b/panel-plugin/xfce4-orageclock-plugin.desktop.in @@ -3,5 +3,5 @@ Type=X-XFCE-PanelPlugin _Name=Orage Panel Clock _Comment=Show time and date? Icon=xfce-schedule -X-XFCE-Exec=@PLUGIN_PATH@/xfce4-orageclock-plugin - +X-XFCE-Module=orageclock +X-XFCE-Internal=FALSE diff --git a/po/POTFILES.in b/po/POTFILES.in index eec11c0..240f7f3 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -29,6 +29,6 @@ src/tray_icon.c src/tz_zoneinfo_read.c # files added by intltool-prepare. -panel-plugin/xfce4-orageclock-plugin.desktop.in.in +panel-plugin/xfce4-orageclock-plugin.desktop.in plugin/xfce-xfcalendar-settings.desktop.in xfcalendar.desktop.in -- 1.7.6