1
0
mirror of git://projects.qi-hardware.com/openwrt-packages.git synced 2024-11-19 14:34:59 +02:00
openwrt-packages/gjay/patches/0004-Don-t-build-against-or-require-dbus-glib-unless-buil.patch

150 lines
3.9 KiB
Diff
Raw Normal View History

From e812bd02096d2cd4ee8a61210d6363da227a48fa Mon Sep 17 00:00:00 2001
From: Joshua Judson Rosen <rozzin@geekspace.com>
Date: Tue, 26 Apr 2011 22:35:44 -0400
Subject: [PATCH 04/17] Don't build against (or require) dbus-glib unless building something that needs it.
---
config.h.in | 3 +++
configure.ac | 11 ++++++++++-
dbus.c | 7 +++++++
gjay.c | 8 ++++++++
gjay.h | 7 +++++++
5 files changed, 35 insertions(+), 1 deletions(-)
diff --git a/config.h.in b/config.h.in
index 17decf1..8833d6c 100644
--- a/config.h.in
+++ b/config.h.in
@@ -88,5 +88,8 @@
/* Enable Audacious music player */
#undef WITH_AUDCLIENT
+/* Build with dbus-glib */
+#undef WITH_DBUSGLIB
+
/* Enable mpd music player */
#undef WITH_MPDCLIENT
diff --git a/configure.ac b/configure.ac
index bfe7ca4..62273bd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8,12 +8,16 @@ AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([1.10])
dnl Options
+# Don't require D-Bus unless building a component that needs it:
+enable_dbus=no
+
AC_SUBST([WITH_MPDCLIENT])
AC_ARG_ENABLE([mpdclient],
AS_HELP_STRING([--disable-mpdclient], [Disable mpd client (enabled by default)]),
[enable_mpdclient=$enableval],
[enable_mpdclient="yes"])
if test "$enable_mpdclient" = "yes"; then
+ enable_dbus=yes
AC_DEFINE([WITH_MPDCLIENT], [1], [Enable mpd music player])
PKG_CHECK_MODULES([MPDCLIENT], [libmpdclient])
fi
@@ -24,6 +28,7 @@ AC_ARG_ENABLE([audclient],
[enable_audclient=$enableval],
[enable_audclient="yes"])
if test "$enable_audclient" = "yes"; then
+ enable_dbus=yes
AC_DEFINE([WITH_AUDCLIENT], [1], [Enable Audacious music player])
PKG_CHECK_MODULES([AUDACIOUS], [audacious])
fi
@@ -39,7 +44,11 @@ AM_GNU_GETTEXT_VERSION([0.18.1])
# Checks for libraries.
AM_PATH_GTK_2_0
-PKG_CHECK_MODULES([DBUS_GLIB], [dbus-glib-1])
+
+if test "$enable_dbus" = "yes"; then
+ AC_DEFINE([WITH_DBUSGLIB], [1], [Build with dbus-glib])
+ PKG_CHECK_MODULES([DBUS_GLIB], [dbus-glib-1])
+fi
AX_PATH_GSL
dnl AC_CHECK_LIB([audclient], [audacious_remote_playlist])
diff --git a/dbus.c b/dbus.c
index 48a6453..81258ad 100644
--- a/dbus.c
+++ b/dbus.c
@@ -17,6 +17,12 @@
* with this program; if not, see <http://www.gnu.org/licenses/>.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef WITH_DBUSGLIB
+
#include <dbus/dbus-glib.h>
#include "gjay.h"
#include "dbus.h"
@@ -62,3 +68,4 @@ gjay_dbus_is_running(const char *appname)
return running;
}
+#endif /* WITH_DBUSGLIB */
diff --git a/gjay.c b/gjay.c
index 547b72c..205065e 100644
--- a/gjay.c
+++ b/gjay.c
@@ -45,7 +45,11 @@
#include <string.h>
#include <ctype.h>
#include "gjay.h"
+
+#ifdef WITH_DBUSGLIB
#include "dbus.h"
+#endif /* WITH_DBUSGLIB */
+
#include "analysis.h"
#include "ipc.h"
#include "playlist.h"
@@ -468,7 +472,11 @@ static void run_as_ui(int argc, char *argv[] )
player_init();
make_app_ui();
gtk_widget_show_all(gjay->main_window);
+
+#ifdef WITH_DBUSGLIB
gjay->connection = gjay_dbus_connection();
+#endif /* WITH_DBUSGLIB */
+
gjay->message_window = make_message_window();
g_log_set_handler(NULL,
G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION,
diff --git a/gjay.h b/gjay.h
index 78f5180..89a0881 100644
--- a/gjay.h
+++ b/gjay.h
@@ -32,7 +32,10 @@
#include <assert.h>
#include <limits.h>
#include <math.h>
+
+#ifdef WITH_DBUSGLIB
#include <dbus/dbus-glib.h>
+#endif /* WITH_DBUSGLIB */
typedef struct _GjayApp GjayApp;
extern GjayApp *gjay;
@@ -77,8 +80,12 @@ gchar * parent_dir ( const char * path );
struct _GjayApp {
GjayPrefs *prefs;
/* Player connections/handles */
+
+#ifdef WITH_DBUSGLIB
DBusGConnection *connection;
DBusGProxy *player_proxy;
+#endif /* WITH_DBUSGLIB */
+
#ifdef WITH_MPDCLIENT
struct mpd_connection *mpdclient_connection;
#endif /* WITH_MPDCLIENT */
--
1.7.2.5