[Xfce4-commits] <xfce4-mixer:gber/improvements> Modernize build system and build panel plugin as a module

Guido Berhoerster noreply at xfce.org
Fri Sep 21 17:18:06 CEST 2012


Updating branch refs/heads/gber/improvements
         to 294b8fcd8e786ae870cd20b9f28daf19fd70c735 (commit)
       from 2df866c1df3f06834884533dac33f6eb2d966d3d (commit)

commit 294b8fcd8e786ae870cd20b9f28daf19fd70c735
Author: Guido Berhoerster <guido+xfce at berhoerster.name>
Date:   Fri Sep 21 12:00:36 2012 +0200

    Modernize build system and build panel plugin as a module
    
    Modernize configure.in.in.
    Build the plugin as a module.
    Remove unnecessary trickery with desktop file substitutions.
    
    --HG--
    rename : panel-plugin/xfce4-mixer-plugin.desktop.in.in => panel-plugin/mixer.desktop.in
    rename : xfce4-mixer/xfce4-mixer.desktop.in.in => xfce4-mixer/xfce4-mixer.desktop.in

 AUTHORS                                            |    1 +
 NEWS                                               |    1 +
 autogen.sh                                         |   30 +++++++++++++-
 configure.in.in                                    |   18 ++++----
 panel-plugin/Makefile.am                           |   42 ++++++++------------
 ...mixer-plugin.desktop.in.in => mixer.desktop.in} |    3 +-
 panel-plugin/xfce-mixer-plugin.c                   |    2 +-
 xfce4-mixer/Makefile.am                            |   19 +-------
 ...-mixer.desktop.in.in => xfce4-mixer.desktop.in} |    0
 9 files changed, 62 insertions(+), 54 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index c40ddc1..14d2553 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1 +1,2 @@
 Jannis Pohlmann <jannis at xfce.org>
+Guido Berhoerster <guido+xfce at berhoerster.name>
diff --git a/NEWS b/NEWS
index 7bdbf49..6d0998c 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@
 - Fix a potential NULL pointer dereference.
 - Do not try to destroy the mixer window twice after a delete-event
   (bug #8288).
+- Modernize build system and build panel plugin as a module.
 
 
 4.8.0
diff --git a/autogen.sh b/autogen.sh
index 2c644e9..ae2cb53 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -3,6 +3,7 @@
 # vi:set et ai sw=2 sts=2 ts=2: */
 #-
 # Copyright (c) 2009 Jannis Pohlmann <jannis at xfce.org>
+# Copyright (c) 2012 Guido Berhoerster <guido+xfce at berhoerster.name>
 #
 # This program is free software; you can redistribute it and/or 
 # modify it under the terms of the GNU General Public License as
@@ -19,7 +20,32 @@
 # Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 # Boston, MA 02110-1301, USA.
 
-(type xdt-autogen) >/dev/null 2>&1 || {
+# finds the given command in $PATH
+findpath () {
+    if [ $# -ne 1 ] || [ -z "$1" ]; then
+        return 1
+    fi
+
+    _findpath_cmd="$1"
+    oIFS="${IFS}"
+    IFS=:
+    set -- ${PATH}
+    IFS="${oIFS}"
+
+    while [ $# -gt 0 ]; do
+        if [ -x "$1/${_findpath_cmd}" ]; then
+            printf "%s\n" "$1/${_findpath_cmd}"
+            unset _findpath_cmd oIFS
+            return 0
+        fi
+        shift
+    done
+
+    unset _findpath_cmd oIFS
+    return 1
+}
+
+xdt_autogen="$(findpath xdt-autogen)" || {
   cat >&2 <<EOF
 autogen.sh: You don't seem to have the Xfce development tools installed on
             your system, which are required to build this software.
@@ -29,4 +55,4 @@ EOF
   exit 1
 }
 
-XDT_AUTOGEN_REQUIRED_VERSION="4.7.2" exec xdt-autogen $@
+XDT_AUTOGEN_REQUIRED_VERSION="4.7.2" exec "${xdt_autogen}" "$@"
diff --git a/configure.in.in b/configure.in.in
index e043134..d38a06f 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -1,6 +1,7 @@
 # vi:set et ai sw=2 sts=2 ts=2: */
 #-
 # Copyright (c) 2008-2011 Jannis Pohlmann <jannis at xfce.org>
+# Copyright (c) 2012 Guido Berhoerster <guido+xfce at berhoerster.name>
 #
 # This program is free software; you can redistribute it and/or 
 # modify it under the terms of the GNU General Public License as
@@ -26,25 +27,25 @@ m4_define([xfce4_mixer_version_micro], [0])
 m4_define([xfce4_mixer_version_nano],  []) dnl leave this empty to have no nano version
 m4_define([xfce4_mixer_version_build], [r at REVISION@])
 m4_define([xfce4_mixer_version_tag],   [git])
-m4_define([xfce4_mixer_version], [xfce4_mixer_version_major().xfce4_mixer_version_minor().xfce4_mixer_version_micro()ifelse(xfce4_mixer_version_nano(), [], [], [.xfce4_mixer_version_nano()])ifelse(xfce4_mixer_version_tag(), [svn], [xfce4_mixer_version_tag()-xfce4_mixer_version_build()], [xfce4_mixer_version_tag()])])
+m4_define([xfce4_mixer_version], [xfce4_mixer_version_major().xfce4_mixer_version_minor().xfce4_mixer_version_micro()ifelse(xfce4_mixer_version_nano(), [], [], [.xfce4_mixer_version_nano()])ifelse(xfce4_mixer_version_tag(), [git], [xfce4_mixer_version_tag()-xfce4_mixer_version_build()], [xfce4_mixer_version_tag()])])
 
 dnl *******************************************
 dnl *** Debugging support for SVN snapshots ***
 dnl *******************************************
-m4_define([mixer_debug_default], [ifelse(xfce4_mixer_version_tag(), [svn], [full], [minimum])])
+m4_define([mixer_debug_default], [ifelse(xfce4_mixer_version_tag(), [git], [full], [minimum])])
 
 dnl ***************************
 dnl *** Initialize autoconf ***
 dnl ***************************
-AC_COPYRIGHT([Copyright (c) 2008-2011 Jannis Pohlmann <jannis at xfce.org>.])
+AC_COPYRIGHT([Copyright (c) 2008-2011 Jannis Pohlmann <jannis at xfce.org>.
+Copyright (c) 2012 Guido Berhoerster <guido+xfce at berhoerster.name>.])
 AC_INIT([xfce4-mixer], [xfce4_mixer_version], [http://bugzilla.xfce.org/], [xfce4-mixer])
-AC_REVISION([$Id$])
-AC_PREREQ([2.50])
+AC_PREREQ([2.60])
 
 dnl ***************************
 dnl *** Initialize automake ***
 dnl ***************************
-AM_INIT_AUTOMAKE([AC_PACKAGE_TARNAME()], [AC_PACKAGE_VERSION()])
+AM_INIT_AUTOMAKE([1.11 foreign check-news dist-bzip2 silent-rules tar-ustar])
 AM_CONFIG_HEADER([config.h])
 AM_MAINTAINER_MODE()
 
@@ -52,7 +53,6 @@ dnl *******************************
 dnl *** Check for UNIX variants ***
 dnl *******************************
 AC_AIX()
-AC_ISC_POSIX()
 AC_MINIX()
 
 dnl ********************************
@@ -67,8 +67,8 @@ AC_PROG_INTLTOOL()
 dnl **************************
 dnl *** Initialize libtool ***
 dnl **************************
-AC_DISABLE_STATIC()
-AC_PROG_LIBTOOL()
+LT_PREREQ([2.4])
+LT_INIT ([disable-static])
 
 dnl **********************************
 dnl *** Check for standard headers ***
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index 358ea44..2d2bcbd 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -1,20 +1,17 @@
-# $Id$
-#
 # vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
 
-plugindir = $(libexecdir)/xfce4/panel-plugins
+plugindir = $(libdir)/xfce4/panel/plugins
 
-plugin_PROGRAMS =							\
-	xfce4-mixer-plugin
+plugin_LTLIBRARIES = libmixer.la
 
-xfce4_mixer_plugin_SOURCES =						\
+libmixer_la_SOURCES =							\
 	xfce-plugin-dialog.h						\
 	xfce-plugin-dialog.c						\
 	xfce-volume-button.h						\
 	xfce-volume-button.c						\
 	xfce-mixer-plugin.c
 
-xfce4_mixer_plugin_CFLAGS =						\
+libmixer_la_CFLAGS =							\
 	-I$(top_builddir)						\
 	-I$(top_srcdir)							\
 	-DDATADIR=\"$(datadir)\"					\
@@ -28,12 +25,18 @@ xfce4_mixer_plugin_CFLAGS =						\
 	$(LIBXFCE4PANEL_CFLAGS)						\
 	$(GST_PLUGINS_BASE_CFLAGS)
 
-xfce4_mixer_plugin_DEPENDENCIES =					\
+libmixer_la_DEPENDENCIES =						\
 	$(top_builddir)/libxfce4mixer/libxfce4mixer.la
 
-xfce4_mixer_plugin_LDFLAGS =						\
+libmixer_la_LDFLAGS =							\
+	-avoid-version							\
+	-module								\
+	-no-undefined							\
+	-export-symbols-regex '^xfce_panel_module_(preinit|init|construct)' \
 	$(top_builddir)/libxfce4mixer/libxfce4mixer.la			\
-	$(PLATFORM_LDFLAGS)						\
+	$(PLATFORM_LDFLAGS)
+
+libmixer_la_LIBADD =							\
 	$(GLIB_LIBS)							\
 	$(GTK_LIBS)							\
 	$(LIBXFCE4UTIL_LIBS)						\
@@ -43,26 +46,15 @@ xfce4_mixer_plugin_LDFLAGS =						\
 	-lgstaudio-0.10							\
 	-lgstinterfaces-0.10
 
-desktopdir = 								\
-	$(datadir)/xfce4/panel-plugins
-
-desktop_in_in_files = 							\
-	xfce4-mixer-plugin.desktop.in.in
-
-desktop_in_files = 							\
-	$(desktop_in_in_files:.desktop.in.in=.desktop.in)
+desktopdir = $(datadir)/xfce4/panel/plugins
 
-%.desktop.in: %.desktop.in.in
-	sed -e "s,\@libexecdir\@,$(libexecdir),g" < $< > $@
+desktop_in_files = mixer.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)
diff --git a/panel-plugin/xfce4-mixer-plugin.desktop.in.in b/panel-plugin/mixer.desktop.in
similarity index 69%
rename from panel-plugin/xfce4-mixer-plugin.desktop.in.in
rename to panel-plugin/mixer.desktop.in
index e228c05..fb46a41 100644
--- a/panel-plugin/xfce4-mixer-plugin.desktop.in.in
+++ b/panel-plugin/mixer.desktop.in
@@ -3,5 +3,6 @@ Type=X-XFCE-PanelPlugin
 _Name=Mixer
 _Comment=Volume control for your sound card
 Icon=multimedia-volume-control
-X-XFCE-Exec=@libexecdir@/xfce4/panel-plugins/xfce4-mixer-plugin
+X-XFCE-Internal=false
+X-XFCE-Module=mixer
 X-XFCE-Unique=false
diff --git a/panel-plugin/xfce-mixer-plugin.c b/panel-plugin/xfce-mixer-plugin.c
index d56d43f..e2470a0 100644
--- a/panel-plugin/xfce-mixer-plugin.c
+++ b/panel-plugin/xfce-mixer-plugin.c
@@ -113,7 +113,7 @@ static void             xfce_mixer_plugin_set_command       (XfceMixerPlugin  *m
 
 
 /* Register the plugin */
-XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL (xfce_mixer_plugin_construct);
+XFCE_PANEL_PLUGIN_REGISTER (xfce_mixer_plugin_construct);
 
 
 
diff --git a/xfce4-mixer/Makefile.am b/xfce4-mixer/Makefile.am
index a869325..fd17aeb 100644
--- a/xfce4-mixer/Makefile.am
+++ b/xfce4-mixer/Makefile.am
@@ -1,4 +1,3 @@
-# $Id$
 # vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
 
 bin_PROGRAMS =								\
@@ -47,26 +46,14 @@ xfce4_mixer_LDFLAGS = 							\
 	-lgstaudio-0.10							\
 	-lgstinterfaces-0.10
 
-# .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-mixer.desktop.in.in
-desktop_in_files = $(desktop_in_in_files:.desktop.in.in=.desktop.in)
+desktop_in_files = xfce4-mixer.desktop.in
 desktopdir = $(datadir)/applications
 desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
 @INTLTOOL_DESKTOP_RULE@
 
 EXTRA_DIST = 								\
- 	$(desktop_in_in_files)
+ 	$(desktop_in_files)
  
 DISTCLEANFILES =							\
-	$(desktop_DATA) $(desktop_in_files)
+	$(desktop_DATA)
 
-# Get full path into .desktop file
-%.desktop.in: %.desktop.in.in
-	sed -e "s^@PLUGIN_PATH@^$(libexecdir)/applications^" 		\
-		$< > $@
diff --git a/xfce4-mixer/xfce4-mixer.desktop.in.in b/xfce4-mixer/xfce4-mixer.desktop.in
similarity index 100%
rename from xfce4-mixer/xfce4-mixer.desktop.in.in
rename to xfce4-mixer/xfce4-mixer.desktop.in


More information about the Xfce4-commits mailing list