From 36096d5c1ba9a9e52a04e7d412b13e2dfc35fe0c Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Thu, 19 Apr 2012 10:06:24 +0200 Subject: [PATCH] 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.in.in | 5 +++- panel-plugin/Makefile.am | 46 ++++++++++++++---------------------- panel-plugin/places.c | 2 +- panel-plugin/places.desktop.in | 7 +++++ panel-plugin/places.desktop.in.in | 7 ----- po/POTFILES.in | 2 +- 6 files changed, 31 insertions(+), 38 deletions(-) create mode 100644 panel-plugin/places.desktop.in delete mode 100644 panel-plugin/places.desktop.in.in diff --git a/configure.in.in b/configure.in.in index 8968075..dca7711 100644 --- a/configure.in.in +++ b/configure.in.in @@ -17,9 +17,12 @@ dnl check for basic programs AC_PROG_CC() AM_PROG_CC_C_O AC_PROG_INSTALL() -AC_PROG_LIBTOOL() AC_PROG_INTLTOOL() +dnl Initialize libtool +LT_PREREQ([2.2.6]) +LT_INIT([disable-static]) + dnl check for required packages XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.22.0]) XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.22.0]) diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am index f3f6fb5..64c85ef 100644 --- a/panel-plugin/Makefile.am +++ b/panel-plugin/Makefile.am @@ -17,19 +17,18 @@ xfce4_popup_places_LDADD = \ -plugindir = $(libexecdir)/xfce4/panel-plugins +plugindir = $(libdir)/xfce4/panel/plugins -plugin_PROGRAMS = \ - xfce4-places-plugin +plugin_LTLIBRARIES = libplaces.la if HAVE_LIBNOTIFY -xfce4_places_plugin_notify_sources = \ +libplaces_la_notify_sources = \ model_volumes_notify.c \ model_volumes_notify.h endif -xfce4_places_plugin_SOURCES = \ - $(xfce4_places_plugin_notify_sources) \ +libplaces_la_SOURCES = \ + $(libplaces_la_notify_sources) \ places.c \ places.h \ support.c \ @@ -51,7 +50,7 @@ xfce4_places_plugin_SOURCES = \ -xfce4_places_plugin_CFLAGS = \ +libplaces_la_CFLAGS = \ -I$(top_builddir) \ -I$(top_srcdir) \ -DPACKAGE_LOCALE_DIR=\"$(localedir)\" \ @@ -68,7 +67,7 @@ xfce4_places_plugin_CFLAGS = \ $(EXO_CFLAGS) \ $(PLATFORM_CFLAGS) -xfce4_places_plugin_LDADD = \ +libplaces_la_LIBADD = \ $(GIO_LIBS) \ $(GIO_UNIX_LIBS) \ $(GLIB_LIBS) \ @@ -83,32 +82,23 @@ xfce4_places_plugin_LDADD = \ $(LIBX11_LIBS) \ $(EXO_LIBS) +libplaces_la_LDFLAGS = \ + -avoid-version \ + -module \ + -no-undefined \ + -export-symbols-regex '^xfce_panel_module_(preinit|init|construct)' \ + $(PLATFORM_LDFLAGS) # # Desktop file # -desktopdir = \ - $(datadir)/xfce4/panel-plugins - -desktop_in_in_files = \ - places.desktop.in.in - -desktop_in_files = \ - $(desktop_in_in_files:.desktop.in.in=.desktop.in) - -%.desktop.in: %.desktop.in.in - sed -e "s,\@libexecdir\@,$(libexecdir),g" < $< > $@ - -desktop_DATA = \ - $(desktop_in_files:.desktop.in=.desktop) - +desktopdir = $(datadir)/xfce4/panel/plugins +desktop_in_files = places.desktop.in +desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) @INTLTOOL_DESKTOP_RULE@ -EXTRA_DIST = \ - $(desktop_in_in_files) +EXTRA_DIST = $(desktop_in_files) -CLEANFILES = \ - $(desktop_in_files) \ - $(desktop_DATA) +CLEANFILES = $(desktop_DATA) # vi:set ts=8 sw=8 noet ai nocindent syntax=automake: diff --git a/panel-plugin/places.c b/panel-plugin/places.c index 4fe3557..9eed61e 100644 --- a/panel-plugin/places.c +++ b/panel-plugin/places.c @@ -68,6 +68,6 @@ places_construct(XfcePanelPlugin *plugin) DBG("done"); } -XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL(places_construct); +XFCE_PANEL_PLUGIN_REGISTER(places_construct); /* vim: set ai et tabstop=4: */ diff --git a/panel-plugin/places.desktop.in b/panel-plugin/places.desktop.in new file mode 100644 index 0000000..772cef8 --- /dev/null +++ b/panel-plugin/places.desktop.in @@ -0,0 +1,7 @@ +[Xfce Panel] +Type=X-XFCE-PanelPlugin +_Name=Places +_Comment=Access folders, documents, and removable media +Icon=file-manager +X-XFCE-Module=places +X-XFCE-Unique=FALSE diff --git a/panel-plugin/places.desktop.in.in b/panel-plugin/places.desktop.in.in deleted file mode 100644 index b506237..0000000 --- a/panel-plugin/places.desktop.in.in +++ /dev/null @@ -1,7 +0,0 @@ -[Xfce Panel] -Type=X-XFCE-PanelPlugin -_Name=Places -_Comment=Access folders, documents, and removable media -Icon=file-manager -X-XFCE-Exec=@libexecdir@/xfce4/panel-plugins/xfce4-places-plugin - diff --git a/po/POTFILES.in b/po/POTFILES.in index b7b58c6..34c349f 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,6 +1,6 @@ panel-plugin/places.c panel-plugin/places.h -panel-plugin/places.desktop.in.in +panel-plugin/places.desktop.in panel-plugin/model.c panel-plugin/model.h panel-plugin/model_system.c -- 1.7.6