diff --git a/configure.ac b/configure.ac index 0dee0dd9b..d48801254 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 00a15b746..fd0e925fa 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 9769104c4..33a7a54cd 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 2690f08a4..5221b58f8 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 05c8457a8..a585cf8c0 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)