[Xfce4-commits] [apps/xfdashboard] 02/02: Add compile-time checked support for xfconf version 4.12.x (called legacy here) and xfconf 4.13.x.
noreply at xfce.org
noreply at xfce.org
Fri Sep 15 11:01:22 CEST 2017
This is an automated email from the git hooks/post-receive script.
n o m a d p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository apps/xfdashboard.
commit 2bbd63888036782f5fb84519eb1f4d7f643391ed
Author: Stephan Haller <nomad at froevel.de>
Date: Fri Sep 15 10:57:58 2017 +0200
Add compile-time checked support for xfconf version 4.12.x (called legacy here) and xfconf 4.13.x.
When using newer xfconf 4.13.x string arrays could not be retrieved anymore via a GPtrArray provided by dbus-glib but native GPtrArray gtype can be used. That means in addition that - when using xfconf 4.13.x - we can get rid of dbus-glib. So make dbus-glib optional and check for it only if xfconf 4.12.x was found and used in configure script
Thanks to Olivier Duchateau for the initial patch.
Fixes bug #13824
---
configure.ac.in | 54 ++++++++++++++++++++++++++++---------
libxfdashboard/Makefile.am | 10 +++++--
libxfdashboard/libxfdashboard.pc.in | 2 +-
libxfdashboard/utils.c | 6 +++++
4 files changed, 56 insertions(+), 16 deletions(-)
diff --git a/configure.ac.in b/configure.ac.in
index 1ec9fe9..c74fb59 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -22,7 +22,8 @@ m4_define([clutter_minimum_version], [1.12.0])
m4_define([glib_minimum_version], [2.32])
m4_define([gio_minimum_version], [2.32])
m4_define([garcon_minimum_version], [0.2.0])
-m4_define([xfconf_minimum_version], [4.10.0])
+m4_define([xfconf_minimum_version], [4.13.0])
+m4_define([xfconf_legacy_minimum_version], [4.10.0])
m4_define([dbus_glib_minimum_version], [0.98])
m4_define([xcomposite_minimum_version], [0.2])
m4_define([intltool_minimum_version], [0.35])
@@ -200,17 +201,13 @@ AC_SUBST(HAVE_XINERAMA)
dnl ***********************************
dnl *** Check for required packages ***
dnl ***********************************
-XDT_CHECK_PACKAGE([LIBWNCK], [libwnck-3.0], [wnck_minimum_version])
-XDT_CHECK_PACKAGE([CLUTTER_COGL], [clutter-cogl-1.0], [clutter_minimum_version])
-XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [gtk_minimum_version])
-XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [glib_minimum_version])
-XDT_CHECK_PACKAGE([GIO], [gio-2.0], [gio_minimum_version])
-XDT_CHECK_PACKAGE([GIO_UNIX], [gio-unix-2.0], [gio_minimum_version])
-XDT_CHECK_PACKAGE([GARCON], [garcon-1], [garcon_minimum_version])
-XDT_CHECK_PACKAGE([LIBXFCONF], [libxfconf-0], [xfconf_minimum_version])
-XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0],[libxfce4util_minimum_version])
-XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2],[libxfce4ui_minimum_version])
-XDT_CHECK_PACKAGE([DBUS_GLIB], [dbus-glib-1], [dbus_glib_minimum_version], [
+XFDASHBOARD_REQUIRES=""
+
+XDT_CHECK_PACKAGE([LIBWNCK], [libwnck-3.0], [wnck_minimum_version], [XFDASHBOARD_REQUIRES="$XFDASHBOARD_REQUIRES libwnck-3.0"])
+XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [gtk_minimum_version], [XFDASHBOARD_REQUIRES="$XFDASHBOARD_REQUIRES gtk+-3.0"])
+XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [glib_minimum_version], [
+ XFDASHBOARD_REQUIRES="$XFDASHBOARD_REQUIRES glib-2.0"
+
XDT_PROG_PKG_CONFIG()
GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
@@ -218,6 +215,28 @@ XDT_CHECK_PACKAGE([DBUS_GLIB], [dbus-glib-1], [dbus_glib_minimum_version], [
GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
AC_SUBST(GLIB_GENMARSHAL)])
+XDT_CHECK_PACKAGE([GIO], [gio-2.0], [gio_minimum_version], [XFDASHBOARD_REQUIRES="$XFDASHBOARD_REQUIRES gio-2.0"])
+XDT_CHECK_PACKAGE([GIO_UNIX], [gio-unix-2.0], [gio_minimum_version], [XFDASHBOARD_REQUIRES="$XFDASHBOARD_REQUIRES gio-unix-2.0"])
+XDT_CHECK_PACKAGE([GARCON], [garcon-1], [garcon_minimum_version], [XFDASHBOARD_REQUIRES="$XFDASHBOARD_REQUIRES garcon-1"])
+XDT_CHECK_PACKAGE([LIBXFCONF], [libxfconf-0], [xfconf_minimum_version], [XFDASHBOARD_REQUIRES="$XFDASHBOARD_REQUIRES libxfconf-0"], [
+ XDT_CHECK_PACKAGE([LIBXFCONF], [libxfconf-0], [xfconf_legacy_minimum_version], [
+ XFDASHBOARD_REQUIRES="$XFDASHBOARD_REQUIRES libxfconf-0"
+
+ XDT_CHECK_PACKAGE([DBUS_GLIB], [dbus-glib-1], [dbus_glib_minimum_version], [
+ ac_dbus_glib=yes
+ XFDASHBOARD_REQUIRES="$XFDASHBOARD_REQUIRES dbus-glib-1"],
+ [ac_dbus_glib=no])
+ AC_DEFINE([XFCONF_LEGACY], [], [Use xfconf < 4.13 to obtain array type])])
+ ])
+XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0],[libxfce4util_minimum_version], [XFDASHBOARD_REQUIRES="$XFDASHBOARD_REQUIRES libxfce4util-1.0"])
+XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2],[libxfce4ui_minimum_version], [XFDASHBOARD_REQUIRES="$XFDASHBOARD_REQUIRES libxfce4ui-2"])
+AM_CONDITIONAL([DBUS_GLIB], [test x"$ac_dbus_glib" = x"yes"])
+
+dnl **********************************************
+dnl *** Check for Clutter and its backend: GDK ***
+dnl **********************************************
+XDT_CHECK_PACKAGE([CLUTTER], [clutter-1.0], [clutter_minimum_version], [XFDASHBOARD_REQUIRES="$XFDASHBOARD_REQUIRES clutter-1.0 clutter-gdk-1.0"])
+XDT_CHECK_PACKAGE([CLUTTER_COGL], [clutter-cogl-1.0], [clutter_minimum_version], [XFDASHBOARD_REQUIRES="$XFDASHBOARD_REQUIRES clutter-cogl-1.0"])
dnl **********************************************
dnl *** Check for Clutter and its backend: GDK ***
@@ -282,6 +301,11 @@ AC_MSG_CHECKING([PLATFORM_LDFLAGS])
AC_MSG_RESULT([$PLATFORM_LDFLAGS])
AC_SUBST([PLATFORM_LDFLAGS])
+dnl **************************************
+dnl *** Substitue package requirements ***
+dnl **************************************
+AC_SUBST(XFDASHBOARD_REQUIRES)
+
AC_OUTPUT([
Makefile
data/Makefile
@@ -341,10 +365,14 @@ echo " glib: $GLIB_VERSION"
echo " gio: $GIO_VERSION"
echo " gio-unix: $GIO_UNIX_VERSION"
echo " garcon: $GARCON_VERSION"
-echo " libxconf: $LIBXFCONF_VERSION"
echo " libxfce4ui: $LIBXFCE4UI_VERSION"
echo " libxfce4util: $LIBXFCE4UTIL_VERSION"
+if test "x$ac_dbus_glib" = "xyes" ; then
+echo " libxconf: $LIBXFCONF_VERSION (legacy)"
echo " dbus-glib: $DBUS_GLIB_VERSION"
+else
+echo " libxconf: $LIBXFCONF_VERSION"
+fi
echo
echo "Tools used:"
echo " glib-genmarshal: $GLIB_GENMARSHAL"
diff --git a/libxfdashboard/Makefile.am b/libxfdashboard/Makefile.am
index 9f43a60..01400d5 100644
--- a/libxfdashboard/Makefile.am
+++ b/libxfdashboard/Makefile.am
@@ -184,7 +184,6 @@ libxfdashboard_la_CFLAGS = \
$(LIBXFCONF_CFLAGS) \
$(LIBXFCE4UTIL_CFLAGS) \
$(LIBXFCE4UI_CFLAGS) \
- $(DBUS_GLIB_CFLAGS) \
$(PLATFORM_CFLAGS)
libxfdashboard_la_LIBADD = \
@@ -198,9 +197,16 @@ libxfdashboard_la_LIBADD = \
$(LIBXFCONF_LIBS) \
$(LIBXFCE4UTIL_LIBS) \
$(LIBXFCE4UI_LIBS) \
- $(DBUS_GLIB_LIBS) \
$(LIBM)
+if DBUS_GLIB
+libxfdashboard_la_CFLAGS += \
+ $(DBUS_GLIB_CFLAGS)
+
+libxfdashboard_la_LIBADD += \
+ $(DBUS_GLIB_LIBS)
+endif
+
libxfdashboard_la_LDFLAGS = \
-export-dynamic \
-version-info $(LIBXFDASHBOARD_VERINFO) \
diff --git a/libxfdashboard/libxfdashboard.pc.in b/libxfdashboard/libxfdashboard.pc.in
index a55fec9..a40006e 100644
--- a/libxfdashboard/libxfdashboard.pc.in
+++ b/libxfdashboard/libxfdashboard.pc.in
@@ -5,7 +5,7 @@ includedir=@includedir@
Name: @PACKAGE_TARNAME@
Description: Library for xfdashboard
-Requires: libwnck-3.0 clutter-1.0 clutter-cogl-1.0 gtk+-3.0 glib-2.0 gio-2.0 gio-unix-2.0 garcon-1 libxfconf-0 libxfce4util-1.0 libxfce4ui-2 dbus-glib-1
+Requires: @XFDASHBOARD_REQUIRES@
Version: @PACKAGE_VERSION@
Libs: -L${libdir} -lxfdashboard
Cflags: -I${includedir}/xfdashboard
diff --git a/libxfdashboard/utils.c b/libxfdashboard/utils.c
index c1b8e85..6f152d4 100644
--- a/libxfdashboard/utils.c
+++ b/libxfdashboard/utils.c
@@ -39,7 +39,9 @@
#include <glib/gi18n-lib.h>
#include <clutter/clutter.h>
#include <gtk/gtk.h>
+#ifdef XFCONF_LEGACY
#include <dbus/dbus-glib.h>
+#endif
#include <gio/gdesktopappinfo.h>
#include <libxfdashboard/stage.h>
@@ -58,7 +60,11 @@ GType xfdashboard_pointer_array_get_type(void)
if(g_once_init_enter(&type__volatile))
{
+#ifdef XFCONF_LEGACY
type=dbus_g_type_get_collection("GPtrArray", G_TYPE_VALUE);
+#else
+ type=G_TYPE_PTR_ARRAY;
+#endif
g_once_init_leave(&type__volatile, type);
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list