[gnome-online-accounts] build: Don't require Telepathy when built with --disable-telepathy



commit c717105eaee1ef5b3d3181a572b813c8db24c518
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Jan 5 15:52:36 2016 -0800

    build: Don't require Telepathy when built with --disable-telepathy
    
    Currently the --disable-telepathy switch only removes the Telepathy
    account provider from the list, but not the dependencies. We should
    remove the (then unused) Telepathy dependency too.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=760189

 Makefile.am                |    2 +
 configure.ac               |   73 +++++++++++++++++++++++---------------------
 src/daemon/Makefile.am     |    5 +++
 src/daemon/main.c          |   10 ++++++
 src/goabackend/Makefile.am |    9 ++++-
 src/goabackend/goautils.c  |    5 +++
 6 files changed, 67 insertions(+), 37 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index c3d004b..3c461ef 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,8 +4,10 @@ NULL =
 SUBDIRS = data
 
 if BUILD_BACKEND
+if BUILD_TELEPATHY
 SUBDIRS += telepathy-account-widgets
 endif
+endif
 
 SUBDIRS += src
 
diff --git a/configure.ac b/configure.ac
index 194cbde..f1ae0e2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -92,6 +92,18 @@ AC_SUBST(GLIB_LIBS)
 GOBJECT_INTROSPECTION_CHECK([0.6.2])
 VAPIGEN_CHECK()
 
+# Telepathy
+AC_DEFINE(GOA_TELEPATHY_NAME, ["telepathy"], [ProviderType and extension point name])
+AC_ARG_ENABLE([telepathy],
+              [AS_HELP_STRING([--enable-telepathy],
+              [Enable Telepathy IM provider])],
+              [],
+              [enable_telepathy=yes])
+if test "$enable_telepathy" != "no"; then
+  AC_DEFINE(GOA_TELEPATHY_ENABLED, 1, [Enable Telepathy data provider])
+fi
+AM_CONDITIONAL(BUILD_TELEPATHY, [test x$enable_telepathy != xno])
+
 AC_ARG_ENABLE([backend],
               [AS_HELP_STRING([--enable-backend],
               [Enable goabackend library])],
@@ -130,30 +142,32 @@ if test "$enable_backend" != "no"; then
   AC_SUBST(LIBXML_CFLAGS)
   AC_SUBST(LIBXML_LIBS)
 
-  PKG_CHECK_MODULES(TP, [telepathy-glib])
-  AC_SUBST(TP_CFLAGS)
-  AC_SUBST(TP_LIBS)
-
-  # telepathy-account-widgets
-  prev_top_build_prefix=$ac_top_build_prefix
-  prev_ac_configure_args=$ac_configure_args
-  ac_configure_args="$ac_configure_args --with-cheese=no --disable-gudev"
-  # install the data together with the rest of GOA's data
-  ac_configure_args="$ac_configure_args --with-pkgdatadir=${datadir}/gnome-online-accounts"
-  # GOA ships its icons directly in ${datadir}/icons (usually /usr/share/icons/) and not
-  # in its own data directory
-  ac_configure_args="$ac_configure_args --with-icondir=${datadir}/icons"
-  # Change the name of tpaw's .mo files to avoid conflicts with other packages using tp-aw
-  ac_configure_args="$ac_configure_args --with-gettext-package=gnome-online-accounts-tpaw"
-  # Disable the installation of the GSettings schema to avoid multiple components shipping
-  # the same file. See https://bugzilla.gnome.org/show_bug.cgi?id=706803
-  ac_configure_args="$ac_configure_args --disable-schemas-compile --disable-settings"
-  AX_CONFIG_DIR([telepathy-account-widgets])
-  ac_top_build_prefix=$prev_top_build_prefix
-  ac_configure_args=$prev_ac_configure_args
-
-  export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:"$ac_top_build_prefix"telepathy-account-widgets/
-  PKG_CHECK_MODULES(TPAW, telepathy-account-widgets)
+  if test "$enable_telepathy" != "no"; then
+    PKG_CHECK_MODULES(TP, [telepathy-glib])
+    AC_SUBST(TP_CFLAGS)
+    AC_SUBST(TP_LIBS)
+
+    # telepathy-account-widgets
+    prev_top_build_prefix=$ac_top_build_prefix
+    prev_ac_configure_args=$ac_configure_args
+    ac_configure_args="$ac_configure_args --with-cheese=no --disable-gudev"
+    # install the data together with the rest of GOA's data
+    ac_configure_args="$ac_configure_args --with-pkgdatadir=${datadir}/gnome-online-accounts"
+    # GOA ships its icons directly in ${datadir}/icons (usually /usr/share/icons/) and not
+    # in its own data directory
+    ac_configure_args="$ac_configure_args --with-icondir=${datadir}/icons"
+    # Change the name of tpaw's .mo files to avoid conflicts with other packages using tp-aw
+    ac_configure_args="$ac_configure_args --with-gettext-package=gnome-online-accounts-tpaw"
+    # Disable the installation of the GSettings schema to avoid multiple components shipping
+    # the same file. See https://bugzilla.gnome.org/show_bug.cgi?id=706803
+    ac_configure_args="$ac_configure_args --disable-schemas-compile --disable-settings"
+    AX_CONFIG_DIR([telepathy-account-widgets])
+    ac_top_build_prefix=$prev_top_build_prefix
+    ac_configure_args=$prev_ac_configure_args
+
+    export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:"$ac_top_build_prefix"telepathy-account-widgets/
+    PKG_CHECK_MODULES(TPAW, telepathy-account-widgets)
+  fi
 fi
 
 AC_ARG_ENABLE([inspector],
@@ -331,17 +345,6 @@ if test "$enable_windows_live" != "no"; then
   AC_DEFINE(GOA_WINDOWS_LIVE_ENABLED, 1, [Enable Windows Live data provider])
 fi
 
-# Telepathy
-AC_DEFINE(GOA_TELEPATHY_NAME, ["telepathy"], [ProviderType and extension point name])
-AC_ARG_ENABLE([telepathy],
-              [AS_HELP_STRING([--enable-telepathy],
-              [Enable Telepathy IM provider])],
-              [],
-              [enable_telepathy=yes])
-if test "$enable_telepathy" != "no"; then
-  AC_DEFINE(GOA_TELEPATHY_ENABLED, 1, [Enable Telepathy data provider])
-fi
-
 # Pocket
 AC_DEFINE(GOA_POCKET_NAME, ["pocket"], [ProviderType and extension point name])
 AC_ARG_ENABLE([pocket], [AS_HELP_STRING([--enable-pocket],
diff --git a/src/daemon/Makefile.am b/src/daemon/Makefile.am
index 8f5352f..2c09cdc 100644
--- a/src/daemon/Makefile.am
+++ b/src/daemon/Makefile.am
@@ -29,8 +29,13 @@ goa_daemon_SOURCES =                                                 \
                                main.c                          \
        goadaemontypes.h                                        \
        goadaemon.h             goadaemon.c                     \
+       $(NULL)
+
+if BUILD_TELEPATHY
+goa_daemon_SOURCES +=                                          \
        goatpaccountlinker.h    goatpaccountlinker.c            \
        $(NULL)
+endif
 
 goa_daemon_CFLAGS =                                            \
        $(GLIB_CFLAGS)                                          \
diff --git a/src/daemon/main.c b/src/daemon/main.c
index fd3242e..8a935c5 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -25,7 +25,10 @@
 #include <gio/gio.h>
 
 #include "goadaemon.h"
+
+#ifdef GOA_TELEPATHY_ENABLED
 #include "goatpaccountlinker.h"
+#endif
 
 
 /* ---------------------------------------------------------------------------------------------------- */
@@ -40,7 +43,10 @@ static GOptionEntry opt_entries[] =
   {NULL }
 };
 static GoaDaemon *the_daemon = NULL;
+
+#ifdef GOA_TELEPATHY_ENABLED
 static GoaTpAccountLinker *tp_linker = NULL;
+#endif
 
 static void
 on_bus_acquired (GDBusConnection *connection,
@@ -68,7 +74,9 @@ on_name_acquired (GDBusConnection *connection,
 {
   g_debug ("Acquired the name %s on the session message bus", name);
 
+#ifdef GOA_TELEPATHY_ENABLED
   tp_linker = goa_tp_account_linker_new ();
+#endif
 }
 
 static gboolean
@@ -131,8 +139,10 @@ main (int    argc,
  out:
   if (the_daemon != NULL)
     g_object_unref (the_daemon);
+#ifdef GOA_TELEPATHY_ENABLED
   if (tp_linker != NULL)
     g_object_unref (tp_linker);
+#endif
   if (name_owner_id != 0)
     g_bus_unown_name (name_owner_id);
   if (loop != NULL)
diff --git a/src/goabackend/Makefile.am b/src/goabackend/Makefile.am
index 64a7e99..d383f2e 100644
--- a/src/goabackend/Makefile.am
+++ b/src/goabackend/Makefile.am
@@ -90,8 +90,6 @@ libgoa_backend_1_0_la_SOURCES =                                               \
        goaflickrprovider.h             goaflickrprovider.c             \
        goafoursquareprovider.h         goafoursquareprovider.c         \
        goawindowsliveprovider.h        goawindowsliveprovider.c        \
-       goatelepathyfactory.h           goatelepathyfactory.c           \
-       goatelepathyprovider.h          goatelepathyprovider.c          \
        goapocketprovider.h             goapocketprovider.c             \
        goalastfmprovider.h             goalastfmprovider.c             \
        goautils.h                      goautils.c                      \
@@ -106,6 +104,13 @@ libgoa_backend_1_0_la_SOURCES +=                                   \
        goakerberosprovider.h           goakerberosprovider.c
 endif
 
+if BUILD_TELEPATHY
+libgoa_backend_1_0_la_SOURCES +=                                       \
+       goatelepathyfactory.h           goatelepathyfactory.c           \
+       goatelepathyprovider.h          goatelepathyprovider.c          \
+       $(NULL)
+endif
+
 libgoa_backend_1_0_la_CFLAGS =                                 \
        $(WEBKIT_GTK_CFLAGS)                                    \
        $(JSON_GLIB_CFLAGS)                                     \
diff --git a/src/goabackend/goautils.c b/src/goabackend/goautils.c
index 93578f6..6144276 100644
--- a/src/goabackend/goautils.c
+++ b/src/goabackend/goautils.c
@@ -20,7 +20,10 @@
 
 #include <glib/gi18n-lib.h>
 #include <libsecret/secret.h>
+
+#ifdef GOA_TELEPATHY_ENABLED
 #include <telepathy-glib/telepathy-glib.h>
+#endif
 
 #include "goaprovider.h"
 #include "goautils.h"
@@ -41,6 +44,7 @@ goa_utils_initialize_client_factory (void)
 
   if (g_once_init_enter (&once_init_value))
     {
+#ifdef GOA_TELEPATHY_ENABLED
       TpSimpleClientFactory *factory;
       TpAccountManager *account_manager;
       GQuark account_features[] = {TP_ACCOUNT_FEATURE_ADDRESSING,
@@ -63,6 +67,7 @@ goa_utils_initialize_client_factory (void)
 
       g_object_unref (account_manager);
       g_object_unref (factory);
+#endif
 
       g_once_init_leave (&once_init_value, 1);
     }


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