[gnome-shell] build: Make folks optional



commit 77242cfec06aa72ed136c7b48ef1c6d2ee8e682f
Author: Colin Walters <walters verbum org>
Date:   Tue Jun 19 15:15:02 2012 -0400

    build: Make folks optional
    
    The dependency chain spirals out from folks->zeitgeist->xapian...and
    I'm really not interested in pulling in all of that into the core
    shell.
    
    There is work on splitting out contact search into gnome-contacts; I'd
    add a bug link but Bugzilla is down.

 configure.ac         |   16 +++++++++++++++-
 js/Makefile.am       |    1 +
 js/misc/config.js.in |    2 ++
 js/ui/overview.js    |    6 ++++--
 src/Makefile.am      |   14 +++++++++++---
 5 files changed, 33 insertions(+), 6 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 0dee0dd..d488012 100644
--- a/configure.ac
+++ b/configure.ac
@@ -77,12 +77,26 @@ STARTUP_NOTIFICATION_MIN_VERSION=0.11
 GCR_MIN_VERSION=3.3.90
 GNOME_DESKTOP_REQUIRED_VERSION=3.5.1
 
+AC_ARG_WITH(folks,
+            AS_HELP_STRING([--with-folks],
+                           [Enable folks support]),
+            [with_folks=$withval], [with_folks=yes])
+
+if test x${with_folks} = xyes; then
+  FOLKS_REQUIREMENT="folks >= $FOLKS_MIN_VERSION"
+  AC_DEFINE([HAVE_FOLKS], [1], [folks support])
+  AC_SUBST([HAVE_FOLKS],[1])
+else
+  FOLKS_REQUIREMENT=
+fi
+AM_CONDITIONAL(BUILD_WITH_FOLKS, test x${with_folks} = xyes)
+
 # Collect more than 20 libraries for a prize!
 PKG_CHECK_MODULES(GNOME_SHELL, gio-unix-2.0 >= $GIO_MIN_VERSION
 			       libxml-2.0
                                gtk+-3.0 >= $GTK_MIN_VERSION
                                atk-bridge-2.0
-                               folks >= $FOLKS_MIN_VERSION
+			       $FOLKS_REQUIREMENT
                                libmutter >= $MUTTER_MIN_VERSION
                                gjs-internals-1.0 >= $GJS_MIN_VERSION
 			       libgnome-menu-3.0 $recorder_modules
diff --git a/js/Makefile.am b/js/Makefile.am
index 00a15b7..fd0e925 100644
--- a/js/Makefile.am
+++ b/js/Makefile.am
@@ -6,6 +6,7 @@ misc/config.js: misc/config.js.in Makefile
 	[ -d $(@D) ] || $(mkdir_p) $(@D) ; \
 	sed -e "s|[ ]PACKAGE_NAME@|$(PACKAGE_NAME)|g" \
 	    -e "s|[ ]PACKAGE_VERSION@|$(PACKAGE_VERSION)|g" \
+	    -e "s|[ ]HAVE_FOLKS@|$(HAVE_FOLKS)|g" \
 	    -e "s|[ ]HAVE_BLUETOOTH@|$(HAVE_BLUETOOTH)|g" \
 	    -e "s|[ ]GETTEXT_PACKAGE@|$(GETTEXT_PACKAGE)|g" \
 	    -e "s|[ ]datadir@|$(datadir)|g" \
diff --git a/js/misc/config.js.in b/js/misc/config.js.in
index 9769104..33a7a54 100644
--- a/js/misc/config.js.in
+++ b/js/misc/config.js.in
@@ -6,6 +6,8 @@ const PACKAGE_NAME = '@PACKAGE_NAME@';
 const PACKAGE_VERSION = '@PACKAGE_VERSION@';
 /* 1 if gnome-bluetooth is available, 0 otherwise */
 const HAVE_BLUETOOTH = @HAVE_BLUETOOTH@;
+/* 1 if folks is available, 0 otherwise */
+const HAVE_FOLKS = @HAVE_FOLKS@;
 /* gettext package */
 const GETTEXT_PACKAGE = '@GETTEXT_PACKAGE@';
 /* locale dir */
diff --git a/js/ui/overview.js b/js/ui/overview.js
index 2690f08..5221b58 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -1,6 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 const Clutter = imports.gi.Clutter;
+const Config = imports.misc.config;
 const Gtk = imports.gi.Gtk;
 const Meta = imports.gi.Meta;
 const Mainloop = imports.mainloop;
@@ -11,7 +12,7 @@ const Shell = imports.gi.Shell;
 const Gdk = imports.gi.Gdk;
 
 const AppDisplay = imports.ui.appDisplay;
-const ContactDisplay = imports.ui.contactDisplay;
+const ContactDisplay = Config.HAVE_FOLKS ? imports.ui.contactDisplay : null;
 const Dash = imports.ui.dash;
 const DND = imports.ui.dnd;
 const Main = imports.ui.main;
@@ -207,7 +208,8 @@ const Overview = new Lang.Class({
         this.addSearchProvider(new AppDisplay.AppSearchProvider());
         this.addSearchProvider(new AppDisplay.SettingsSearchProvider());
         this.addSearchProvider(new PlaceDisplay.PlaceSearchProvider());
-        this.addSearchProvider(new ContactDisplay.ContactSearchProvider());
+        if (ContactDisplay != null)
+            this.addSearchProvider(new ContactDisplay.ContactSearchProvider());
 
         // Load remote search providers provided by applications
         RemoteSearch.loadRemoteSearchProviders(Lang.bind(this, this.addSearchProvider));
diff --git a/src/Makefile.am b/src/Makefile.am
index 05c8457..a585cf8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -109,7 +109,6 @@ shell_public_headers_h =		\
 	shell-app.h			\
 	shell-app-system.h		\
 	shell-app-usage.h		\
-	shell-contact-system.h	\
 	shell-embedded-window.h		\
 	shell-generic-container.h	\
 	shell-gtk-embed.h		\
@@ -132,6 +131,10 @@ shell_public_headers_h =		\
 	shell-wm.h			\
 	shell-xfixes-cursor.h
 
+if BUILD_WITH_FOLKS
+shell_public_headers_h += shell-contact-system.h
+endif
+
 shell_private_sources = \
 	gactionmuxer.h			\
 	gactionmuxer.c			\
@@ -155,7 +158,6 @@ libgnome_shell_la_SOURCES =		\
 	shell-app.c			\
 	shell-app-system.c		\
 	shell-app-usage.c		\
-	shell-contact-system.c	\
 	shell-embedded-window.c		\
 	shell-generic-container.c	\
 	shell-gtk-embed.c		\
@@ -185,6 +187,9 @@ libgnome_shell_la_SOURCES =		\
 	shell-xfixes-cursor.c		\
 	$(NULL)
 
+if BUILD_WITH_FOLKS
+libgnome_shell_la_SOURCES += shell-contact-system.c
+endif
 
 libgnome_shell_la_gir_sources = \
 	$(filter-out %-private.h $(shell_private_sources), $(shell_public_headers_h) $(libgnome_shell_la_SOURCES))
@@ -301,7 +306,10 @@ libgnome_shell_la_LIBADD =		\
 libgnome_shell_la_CPPFLAGS = $(gnome_shell_cflags)
 
 Shell-0.1.gir: libgnome-shell.la St-1.0.gir
-Shell_0_1_gir_INCLUDES = Clutter-1.0 ClutterX11-1.0 Meta-3.0 TelepathyGLib-0.12 TelepathyLogger-0.2 Soup-2.4 GMenu-3.0 NetworkManager-1.0 NMClient-1.0 Folks-0.6
+Shell_0_1_gir_INCLUDES = Clutter-1.0 ClutterX11-1.0 Meta-3.0 TelepathyGLib-0.12 TelepathyLogger-0.2 Soup-2.4 GMenu-3.0 NetworkManager-1.0 NMClient-1.0
+if BUILD_WITH_FOLKS
+Shell_0_1_gir_INCLUDES += Folks-0.6
+endif
 Shell_0_1_gir_CFLAGS = $(libgnome_shell_la_CPPFLAGS) -I $(srcdir)
 Shell_0_1_gir_LIBS = libgnome-shell.la
 Shell_0_1_gir_FILES = $(libgnome_shell_la_gir_sources)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]