[evolution-data-server/openismus-work-master: 10/23] Remove libedataserverui and make google backend optional



commit 8204a0eed57f20ee1ef5b1cee4c48e00b6dcf3e1
Author: Tristan Van Berkom <tristanvb openismus com>
Date:   Wed Dec 5 15:56:07 2012 +0900

    Remove libedataserverui and make google backend optional
    
    This patch removes libedataserverui (which is planned to be folded
    into evolution proper) and only builds the google backend gdata is
    present and the build has been configured to build google (enabled
    by default). Based on Patrick Ohly's patch on bgo #686688.
    
    Conflicts:
    
    	addressbook/backends/Makefile.am
    	configure.ac
    	docs/reference/libedataserverui/libedataserverui-docs.sgml
    	docs/reference/libedataserverui/libedataserverui-sections.txt
    	libedataserverui/Makefile.am
    	libedataserverui/e-book-auth-util.h
    	libedataserverui/e-categories-editor.c
    	libedataserverui/e-categories-editor.h
    	libedataserverui/e-category-editor.c
    	libedataserverui/e-cell-renderer-color.c
    	libedataserverui/e-client-utils.c
    	libedataserverui/e-client-utils.h
    	libedataserverui/e-name-selector-dialog.c
    	libedataserverui/e-name-selector-dialog.h
    	libedataserverui/e-name-selector-entry.c
    	libedataserverui/e-name-selector-list.c
    	libedataserverui/e-name-selector.c
    	libedataserverui/e-passwords-win32.c
    	libedataserverui/e-passwords.c
    	libedataserverui/e-source-selector-dialog.c
    	tests/Makefile.am
    	tests/libedataserverui/Makefile.am
    	tests/libedataserverui/evolution-source-viewer.c
    	tests/libedataserverui/test-category-completion.c
    	tests/libedataserverui/test-contact-store.c
    	tests/libedataserverui/test-source-selector.c

 addressbook/backends/Makefile.am                   |    8 ++-
 configure.ac                                       |   30 +++---
 libedataserver/e-source-registry.c                 |   16 +++
 libedataserverui/Makefile.am                       |  113 --------------------
 .../evolution-addressbook-factory.c                |    4 +-
 .../evolution-calendar-factory.c                   |    4 +-
 .../evolution-source-registry.c                    |    4 +-
 tests/libedataserverui/Makefile.am                 |   57 ----------
 8 files changed, 45 insertions(+), 191 deletions(-)
---
diff --git a/addressbook/backends/Makefile.am b/addressbook/backends/Makefile.am
index f98bd2e..fe72ec0 100644
--- a/addressbook/backends/Makefile.am
+++ b/addressbook/backends/Makefile.am
@@ -4,6 +4,12 @@ else
 LDAP_SUBDIR =
 endif
 
-SUBDIRS = file $(LDAP_SUBDIR) google webdav
+if HAVE_GOOGLE
+GOOGLE_SUBDIR = google
+else
+GOOGLE_SUBDIR = 
+endif
+
+SUBDIRS = file $(LDAP_SUBDIR) $(GOOGLE_SUBDIR) webdav
 
 -include $(top_srcdir)/git.mk
diff --git a/configure.ac b/configure.ac
index fd9f1f4..eed24c1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -105,10 +105,6 @@ LIBEDATASERVER_CURRENT=17
 LIBEDATASERVER_REVISION=0
 LIBEDATASERVER_AGE=0
 
-LIBEDATASERVERUI_CURRENT=5
-LIBEDATASERVERUI_REVISION=0
-LIBEDATASERVERUI_AGE=0
-
 LIBECAL_CURRENT=15
 LIBECAL_REVISION=0
 LIBECAL_AGE=0
@@ -143,9 +139,6 @@ AC_SUBST(EDS_MICRO_VERSION)
 AC_SUBST(LIBEDATASERVER_CURRENT)
 AC_SUBST(LIBEDATASERVER_REVISION)
 AC_SUBST(LIBEDATASERVER_AGE)
-AC_SUBST(LIBEDATASERVERUI_CURRENT)
-AC_SUBST(LIBEDATASERVERUI_REVISION)
-AC_SUBST(LIBEDATASERVERUI_AGE)
 AC_SUBST(LIBECAL_CURRENT)
 AC_SUBST(LIBECAL_REVISION)
 AC_SUBST(LIBECAL_AGE)
@@ -371,10 +364,8 @@ dnl ***********************************
 PKG_CHECK_MODULES(GNOME_PLATFORM,
 	[gio-2.0 >= glib_minimum_version
 	gmodule-2.0 >= glib_minimum_version
-	gtk+-3.0 >= gdk_minimum_version
 	libxml-2.0 >= libxml_minimum_version
-	libsoup-2.4 >= libsoup_minimum_version
-	libgdata >= libgdata_minimum_version])
+	libsoup-2.4 >= libsoup_minimum_version])
 
 if test x$os_win32 = xno; then
 	PKG_CHECK_MODULES(GIO_UNIX, [gio-unix-2.0])
@@ -1364,10 +1355,20 @@ dnl Google flags
 dnl ******************************
 LIBGDATA_REQUIRED=libgdata_minimum_version
 AC_SUBST(LIBGDATA_REQUIRED)
-
-EVO_SET_COMPILE_FLAGS(GDATA, libgdata)
-AC_SUBST(GDATA_CFLAGS)
-AC_SUBST(GDATA_LIBS)
+AC_ARG_ENABLE([google],
+	[AS_HELP_STRING([--enable-google],
+	[enable Google Contacts support (default=yes)])],
+	[enable_google=$enableval], [enable_google=yes])
+AC_MSG_CHECKING([if Google Contacts support is enabled])
+AC_MSG_RESULT([$enable_google])
+if test "x$enable_google" = xyes; then
+	EVO_SET_COMPILE_FLAGS(GDATA, libgdata)
+	AC_SUBST(GDATA_CFLAGS)
+	AC_SUBST(GDATA_LIBS)
+
+	AC_DEFINE(HAVE_GOOGLE, 1, [Define to 1 if you have the google-1.0 package.])
+fi
+AM_CONDITIONAL(HAVE_GOOGLE, [test x$enable_google = xyes])
 
 dnl ******************************
 dnl Groupwise flags
@@ -1670,6 +1671,7 @@ echo "
 	Introspection:		$enable_introspection
 	Vala bindings:		$enable_vala_bindings
 	GNOME Online Accounts	$enable_goa
+	Google Contacts		$enable_google
 	Code coverage (gcov):	$enable_code_coverage
 	Strict building:	$enable_strict
 "
diff --git a/libedataserver/e-source-registry.c b/libedataserver/e-source-registry.c
index 93ae50b..e7b0a60 100644
--- a/libedataserver/e-source-registry.c
+++ b/libedataserver/e-source-registry.c
@@ -44,10 +44,12 @@
 #include <glib/gstdio.h>
 #include <glib/gi18n-lib.h>
 
+#ifdef ENABLE_AUTHENTICATION
 /* XXX Yeah, yeah... */
 #define GCR_API_SUBJECT_TO_CHANGE
 
 #include <gcr/gcr-base.h>
+#endif
 
 /* Private D-Bus classes. */
 #include <e-dbus-source.h>
@@ -124,7 +126,9 @@ struct _AuthContext {
 	GCancellable *cancellable;
 	GMainLoop *main_loop;
 	ESourceAuthenticationResult auth_result;
+#ifdef ENABLE_AUTHENTICATION
 	GcrSecretExchange *secret_exchange;
+#endif
 	gboolean authenticating;
 	gboolean success;
 	GError **error;
@@ -204,6 +208,7 @@ async_context_free (AsyncContext *async_context)
 	g_slice_free (AsyncContext, async_context);
 }
 
+#ifdef ENABLE_AUTHENTICATION
 static void
 auth_context_free (AuthContext *auth_context)
 {
@@ -224,6 +229,7 @@ auth_context_free (AuthContext *auth_context)
 
 	g_slice_free (AuthContext, auth_context);
 }
+#endif
 
 static CreateContext *
 create_context_new (void)
@@ -1448,6 +1454,7 @@ source_registry_authenticate_thread (GSimpleAsyncResult *simple,
 		g_simple_async_result_take_error (simple, error);
 }
 
+#ifdef ENABLE_AUTHENTICATION
 /* Helper for e_source_registry_authenticate_sync() */
 static gboolean
 source_registry_authenticate_respond_cb (AuthContext *auth_context)
@@ -1652,6 +1659,7 @@ source_registry_call_authenticate_for_source (ESourceRegistry *registry,
 
 	return success;
 }
+#endif /* ENABLE_AUTHENTICATION */
 
 /**
  * e_source_registry_authenticate_sync:
@@ -1684,6 +1692,7 @@ e_source_registry_authenticate_sync (ESourceRegistry *registry,
                                      GCancellable *cancellable,
                                      GError **error)
 {
+#ifdef ENABLE_AUTHENTICATION
 	AuthContext *auth_context;
 	GMainContext *main_context;
 	EDBusAuthenticator *dbus_auth;
@@ -1781,6 +1790,13 @@ exit:
 	g_main_context_unref (main_context);
 
 	return success;
+#else
+	g_set_error_literal (error,
+			     G_IO_ERROR, G_IO_ERROR_CANCELLED,
+			     _("Authentication support not enabled in EDS"));
+	return FALSE;
+
+#endif /* ENABLE_AUTHENTICATION */
 }
 
 /**
diff --git a/services/evolution-addressbook-factory/evolution-addressbook-factory.c b/services/evolution-addressbook-factory/evolution-addressbook-factory.c
index ffb69b7..037deaa 100644
--- a/services/evolution-addressbook-factory/evolution-addressbook-factory.c
+++ b/services/evolution-addressbook-factory/evolution-addressbook-factory.c
@@ -21,7 +21,7 @@
 #include <stdlib.h>
 #include <glib/gi18n.h>
 
-#ifdef ENABLE_MAINTAINER_MODE
+#if defined(ENABLE_MAINTAINER_MODE) && defined(HAVE_EDATASERVERUI)
 #include <gtk/gtk.h>
 #endif
 
@@ -92,7 +92,7 @@ main (gint argc,
 	bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
 	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
 
-#ifdef ENABLE_MAINTAINER_MODE
+#if defined(ENABLE_MAINTAINER_MODE) && defined(HAVE_EDATASERVERUI)
 	/* This is only to load gtk-modules, like
 	 * bug-buddy's gnomesegvhandler, if possible */
 	gtk_init_check (&argc, &argv);
diff --git a/services/evolution-calendar-factory/evolution-calendar-factory.c b/services/evolution-calendar-factory/evolution-calendar-factory.c
index a80731b..4d3a9a3 100644
--- a/services/evolution-calendar-factory/evolution-calendar-factory.c
+++ b/services/evolution-calendar-factory/evolution-calendar-factory.c
@@ -21,7 +21,7 @@
 #include <stdlib.h>
 #include <glib/gi18n.h>
 
-#ifdef ENABLE_MAINTAINER_MODE
+#if defined(ENABLE_MAINTAINER_MODE) && defined(HAVE_EDATASERVERUI)
 #include <gtk/gtk.h>
 #endif
 
@@ -96,7 +96,7 @@ main (gint argc,
 	bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
 	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
 
-#ifdef ENABLE_MAINTAINER_MODE
+#if defined(ENABLE_MAINTAINER_MODE) && defined(HAVE_EDATASERVERUI)
 	/* This is only to load gtk-modules, like
 	 * bug-buddy's gnomesegvhandler, if possible. */
 	gtk_init_check (&argc, &argv);
diff --git a/services/evolution-source-registry/evolution-source-registry.c b/services/evolution-source-registry/evolution-source-registry.c
index 6aca836..6fb936b 100644
--- a/services/evolution-source-registry/evolution-source-registry.c
+++ b/services/evolution-source-registry/evolution-source-registry.c
@@ -21,7 +21,7 @@
 #include <stdlib.h>
 #include <glib/gi18n.h>
 
-#ifdef ENABLE_MAINTAINER_MODE
+#if defined(ENABLE_MAINTAINER_MODE) && defined(HAVE_EDATASERVERUI)
 #include <gtk/gtk.h>
 #endif
 
@@ -43,7 +43,7 @@ main (gint argc,
 	bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
 	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
 
-#ifdef ENABLE_MAINTAINER_MODE
+#if defined(ENABLE_MAINTAINER_MODE) && defined(HAVE_EDATASERVERUI)
 	/* This is only to load gtk-modules, like
 	 * bug-buddy's gnomesegvhandler, if possible */
 	gtk_init_check (&argc, &argv);



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