[evolution-data-server] Change the installation path for E-D-S backends.



commit 1c226b2633f19e407b51b1736f040ec3ceeb2b68
Author: Matthew Barnes <mbarnes redhat com>
Date:   Thu Jan 6 11:20:17 2011 -0500

    Change the installation path for E-D-S backends.
    
    Address book and calendar backend modules are now split into different
    installation directories so the D-Bus factory processes will only load
    relevant backend modules.
    
    This changes some pkg-config details for third-party backend modules.
    
    Instead of querying the backend directory with:
    
      pkg-config --variable=extensiondir evolution-data-server-1.2
    
    you must query the directory for address book backends with:
    
      pkg-config --variable=backenddir libedata-book-1.2
    
    and the directory for calendar backends with:
    
      pkg-config --variable=backenddir libedata-cal-1.2

 NEWS                                               |   21 +++++++++
 addressbook/backends/file/Makefile.am              |    2 +-
 addressbook/backends/google/Makefile.am            |    2 +-
 addressbook/backends/groupwise/Makefile.am         |    2 +-
 addressbook/backends/ldap/Makefile.am              |    2 +-
 addressbook/backends/vcf/Makefile.am               |    2 +-
 addressbook/backends/webdav/Makefile.am            |    2 +-
 addressbook/libedata-book/Makefile.am              |    1 +
 addressbook/libedata-book/e-data-book-factory.c    |    6 ++-
 addressbook/libedata-book/libedata-book.pc.in      |    1 +
 calendar/backends/caldav/Makefile.am               |    2 +-
 calendar/backends/contacts/Makefile.am             |    2 +-
 calendar/backends/file/Makefile.am                 |    2 +-
 calendar/backends/groupwise/Makefile.am            |    2 +-
 calendar/backends/http/Makefile.am                 |    2 +-
 calendar/backends/weather/Makefile.am              |    2 +-
 calendar/libedata-cal/Makefile.am                  |    1 +
 calendar/libedata-cal/e-data-cal-factory.c         |    6 ++-
 calendar/libedata-cal/libedata-cal.pc.in           |    1 +
 configure.ac                                       |   19 +++++---
 .../libebackend/tmpl/e-data-server-module.sgml     |    4 +-
 evolution-data-server.pc.in                        |    1 -
 libebackend/Makefile.am                            |    1 -
 libebackend/e-data-server-module.c                 |   46 +++++++++-----------
 libebackend/e-data-server-module.h                 |   21 ++++++---
 25 files changed, 95 insertions(+), 58 deletions(-)
---
diff --git a/NEWS b/NEWS
index dbb9ff8..19bde2b 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,24 @@
+(NEWS blurb for 2.91.5.  Put this above the bug fixes and such.)
+
+Address book and calendar backend modules are now split into different
+installation directories so the D-Bus factory processes will only load
+relevant backend modules.
+
+This changes some pkg-config details for third-party backend modules.
+
+Instead of querying the backend directory with:
+
+  pkg-config --variable=extensiondir evolution-data-server-1.2
+
+you must query the directory for address book backends with:
+
+  pkg-config --variable=backenddir libedata-book-1.2
+
+and the directory for calendar backends with:
+
+  pkg-config --variable=backenddir libedata-cal-1.2
+
+
 Evolution-Data-Server 2.91.4 2010-12-20
 ---------------------------------------
 
diff --git a/addressbook/backends/file/Makefile.am b/addressbook/backends/file/Makefile.am
index 7e1eea0..08cf58f 100644
--- a/addressbook/backends/file/Makefile.am
+++ b/addressbook/backends/file/Makefile.am
@@ -1,4 +1,4 @@
-extension_LTLIBRARIES = libebookbackendfile.la
+ebook_backend_LTLIBRARIES = libebookbackendfile.la
 
 libebookbackendfile_la_CPPFLAGS = \
 	$(AM_CPPFLAGS)					\
diff --git a/addressbook/backends/google/Makefile.am b/addressbook/backends/google/Makefile.am
index 3e903a7..581e662 100644
--- a/addressbook/backends/google/Makefile.am
+++ b/addressbook/backends/google/Makefile.am
@@ -1,4 +1,4 @@
-extension_LTLIBRARIES = libebookbackendgoogle.la
+ebook_backend_LTLIBRARIES = libebookbackendgoogle.la
 
 libebookbackendgoogle_la_CPPFLAGS = \
 	$(AM_CPPFLAGS)					\
diff --git a/addressbook/backends/groupwise/Makefile.am b/addressbook/backends/groupwise/Makefile.am
index 12bd8d7..3e64da5 100644
--- a/addressbook/backends/groupwise/Makefile.am
+++ b/addressbook/backends/groupwise/Makefile.am
@@ -1,4 +1,4 @@
-extension_LTLIBRARIES = libebookbackendgroupwise.la
+ebook_backend_LTLIBRARIES = libebookbackendgroupwise.la
 
 libebookbackendgroupwise_la_CPPFLAGS = \
 	$(AM_CPPFLAGS)					\
diff --git a/addressbook/backends/ldap/Makefile.am b/addressbook/backends/ldap/Makefile.am
index 48eea41..5b563c6 100644
--- a/addressbook/backends/ldap/Makefile.am
+++ b/addressbook/backends/ldap/Makefile.am
@@ -1,4 +1,4 @@
-extension_LTLIBRARIES = libebookbackendldap.la
+ebook_backend_LTLIBRARIES = libebookbackendldap.la
 
 libebookbackendldap_la_CPPFLAGS = \
 	$(AM_CPPFLAGS)					\
diff --git a/addressbook/backends/vcf/Makefile.am b/addressbook/backends/vcf/Makefile.am
index 9ac71e7..d8159ae 100644
--- a/addressbook/backends/vcf/Makefile.am
+++ b/addressbook/backends/vcf/Makefile.am
@@ -1,4 +1,4 @@
-extension_LTLIBRARIES = libebookbackendvcf.la
+ebook_backend_LTLIBRARIES = libebookbackendvcf.la
 
 libebookbackendvcf_la_CPPFLAGS = \
 	$(AM_CPPFLAGS)					\
diff --git a/addressbook/backends/webdav/Makefile.am b/addressbook/backends/webdav/Makefile.am
index d7f85e9..62636f7 100644
--- a/addressbook/backends/webdav/Makefile.am
+++ b/addressbook/backends/webdav/Makefile.am
@@ -1,4 +1,4 @@
-extension_LTLIBRARIES = libebookbackendwebdav.la
+ebook_backend_LTLIBRARIES = libebookbackendwebdav.la
 
 libebookbackendwebdav_la_CPPFLAGS = \
 	$(AM_CPPFLAGS)					\
diff --git a/addressbook/libedata-book/Makefile.am b/addressbook/libedata-book/Makefile.am
index 997c727..492edb2 100644
--- a/addressbook/libedata-book/Makefile.am
+++ b/addressbook/libedata-book/Makefile.am
@@ -69,6 +69,7 @@ e_addressbook_factory_CPPFLAGS = \
 	$(EVOLUTION_ADDRESSBOOK_CFLAGS)		\
 	-DG_LOG_DOMAIN=\"libedata-book\"	\
 	-DE_PRGNAME=\"e-addressbook-factory\"	\
+	-DBACKENDDIR=\"$(ebook_backenddir)\"	\
 	-I$(top_srcdir)				\
 	-I$(top_srcdir)/addressbook		\
 	-I$(top_srcdir)/addressbook/libegdbus	\
diff --git a/addressbook/libedata-book/e-data-book-factory.c b/addressbook/libedata-book/e-data-book-factory.c
index 737ba8c..37c56fc 100644
--- a/addressbook/libedata-book/e-data-book-factory.c
+++ b/addressbook/libedata-book/e-data-book-factory.c
@@ -411,6 +411,8 @@ remove_data_book_cb (gpointer data_bk, gpointer user_data)
 static void
 e_data_book_factory_init (EDataBookFactory *factory)
 {
+	GError *error = NULL;
+
 	factory->priv = E_DATA_BOOK_FACTORY_GET_PRIVATE (factory);
 
 	factory->priv->gdbus_object = e_gdbus_book_factory_stub_new ();
@@ -433,7 +435,9 @@ e_data_book_factory_init (EDataBookFactory *factory)
 		(GDestroyNotify) g_free,
 		(GDestroyNotify) NULL);
 
-	e_data_server_module_init ();
+	if (!e_data_server_module_init (BACKENDDIR, &error))
+		g_error ("%s", error->message);
+
 	e_data_book_factory_register_backends (factory);
 }
 
diff --git a/addressbook/libedata-book/libedata-book.pc.in b/addressbook/libedata-book/libedata-book.pc.in
index 99eefed..cd346eb 100644
--- a/addressbook/libedata-book/libedata-book.pc.in
+++ b/addressbook/libedata-book/libedata-book.pc.in
@@ -2,6 +2,7 @@ prefix= prefix@
 exec_prefix= exec_prefix@
 libdir= libdir@
 includedir= includedir@
+backenddir= ebook_backenddir@
 datarootdir= datarootdir@
 datadir= datadir@
 
diff --git a/calendar/backends/caldav/Makefile.am b/calendar/backends/caldav/Makefile.am
index d052945..1ae1232 100644
--- a/calendar/backends/caldav/Makefile.am
+++ b/calendar/backends/caldav/Makefile.am
@@ -1,4 +1,4 @@
-extension_LTLIBRARIES = libecalbackendcaldav.la
+ecal_backend_LTLIBRARIES = libecalbackendcaldav.la
 
 libecalbackendcaldav_la_CPPFLAGS = \
 	$(AM_CPPFLAGS)	\
diff --git a/calendar/backends/contacts/Makefile.am b/calendar/backends/contacts/Makefile.am
index c38a7b9..f386ed7 100644
--- a/calendar/backends/contacts/Makefile.am
+++ b/calendar/backends/contacts/Makefile.am
@@ -1,4 +1,4 @@
-extension_LTLIBRARIES = libecalbackendcontacts.la
+ecal_backend_LTLIBRARIES = libecalbackendcontacts.la
 
 libecalbackendcontacts_la_CPPFLAGS = \
 	$(AM_CPPFLAGS)					\
diff --git a/calendar/backends/file/Makefile.am b/calendar/backends/file/Makefile.am
index ed386df..fe79080 100644
--- a/calendar/backends/file/Makefile.am
+++ b/calendar/backends/file/Makefile.am
@@ -1,4 +1,4 @@
-extension_LTLIBRARIES = libecalbackendfile.la
+ecal_backend_LTLIBRARIES = libecalbackendfile.la
 
 libecalbackendfile_la_CPPFLAGS = \
 	$(AM_CPPFLAGS)					\
diff --git a/calendar/backends/groupwise/Makefile.am b/calendar/backends/groupwise/Makefile.am
index 424113e..f03da4c 100644
--- a/calendar/backends/groupwise/Makefile.am
+++ b/calendar/backends/groupwise/Makefile.am
@@ -1,4 +1,4 @@
-extension_LTLIBRARIES = libecalbackendgroupwise.la
+ecal_backend_LTLIBRARIES = libecalbackendgroupwise.la
 
 libecalbackendgroupwise_la_CPPFLAGS = \
 	$(AM_CPPFLAGS)					\
diff --git a/calendar/backends/http/Makefile.am b/calendar/backends/http/Makefile.am
index fd0c97c..3f0be8a 100644
--- a/calendar/backends/http/Makefile.am
+++ b/calendar/backends/http/Makefile.am
@@ -1,4 +1,4 @@
-extension_LTLIBRARIES = libecalbackendhttp.la
+ecal_backend_LTLIBRARIES = libecalbackendhttp.la
 
 libecalbackendhttp_la_CPPFLAGS = \
 	$(AM_CPPFLAGS)					\
diff --git a/calendar/backends/weather/Makefile.am b/calendar/backends/weather/Makefile.am
index dc1cbbb..cd57049 100644
--- a/calendar/backends/weather/Makefile.am
+++ b/calendar/backends/weather/Makefile.am
@@ -1,4 +1,4 @@
-extension_LTLIBRARIES = libecalbackendweather.la
+ecal_backend_LTLIBRARIES = libecalbackendweather.la
 
 libecalbackendweather_la_CPPFLAGS = \
 	$(AM_CPPFLAGS)					\
diff --git a/calendar/libedata-cal/Makefile.am b/calendar/libedata-cal/Makefile.am
index 91d9757..326c27d 100644
--- a/calendar/libedata-cal/Makefile.am
+++ b/calendar/libedata-cal/Makefile.am
@@ -101,6 +101,7 @@ e_calendar_factory_CPPFLAGS = \
 	$(AM_CPPFLAGS)					\
 	-DG_LOG_DOMAIN=\"libedata-cal\"			\
 	-DE_PRGNAME=\"e-calendar-factory\"		\
+	-DBACKENDDIR=\"$(ecal_backenddir)\"		\
 	-DLOCALEDIR=\"$(localedir)\"			\
 	-I$(top_srcdir)					\
 	-I$(top_srcdir)/calendar			\
diff --git a/calendar/libedata-cal/e-data-cal-factory.c b/calendar/libedata-cal/e-data-cal-factory.c
index 76c53dd..4345c85 100644
--- a/calendar/libedata-cal/e-data-cal-factory.c
+++ b/calendar/libedata-cal/e-data-cal-factory.c
@@ -522,6 +522,8 @@ remove_data_cal_cb (gpointer data_cl,
 static void
 e_data_cal_factory_init (EDataCalFactory *factory)
 {
+	GError *error = NULL;
+
 	factory->priv = E_DATA_CAL_FACTORY_GET_PRIVATE (factory);
 
 	factory->priv->gdbus_object = e_gdbus_cal_factory_stub_new ();
@@ -549,7 +551,9 @@ e_data_cal_factory_init (EDataCalFactory *factory)
 		(GDestroyNotify) g_free,
 		(GDestroyNotify) NULL);
 
-	e_data_server_module_init ();
+	if (!e_data_server_module_init (BACKENDDIR, &error))
+		g_error ("%s", error->message);
+
 	e_data_cal_factory_register_backends (factory);
 }
 
diff --git a/calendar/libedata-cal/libedata-cal.pc.in b/calendar/libedata-cal/libedata-cal.pc.in
index 42fba7a..5a9efa1 100644
--- a/calendar/libedata-cal/libedata-cal.pc.in
+++ b/calendar/libedata-cal/libedata-cal.pc.in
@@ -2,6 +2,7 @@ prefix= prefix@
 exec_prefix= exec_prefix@
 libdir= libdir@
 includedir= includedir@
+backenddir= ecal_backenddir@
 datarootdir= datarootdir@
 datadir= datadir@
 
diff --git a/configure.ac b/configure.ac
index 5e60c8e..7e183b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -97,11 +97,11 @@ LIBECAL_CURRENT=10
 LIBECAL_REVISION=2
 LIBECAL_AGE=2
 
-LIBEDATACAL_CURRENT=10
+LIBEDATACAL_CURRENT=11
 LIBEDATACAL_REVISION=0
 LIBEDATACAL_AGE=0
 
-LIBEDATABOOK_CURRENT=8
+LIBEDATABOOK_CURRENT=9
 LIBEDATABOOK_REVISION=0
 LIBEDATABOOK_AGE=0
 
@@ -113,12 +113,12 @@ LIBEGROUPWISE_CURRENT=13
 LIBEGROUPWISE_REVISION=1
 LIBEGROUPWISE_AGE=0
 
-LIBCAMEL_CURRENT=21
+LIBCAMEL_CURRENT=22
 LIBCAMEL_REVISION=0
 LIBCAMEL_AGE=0
 
-LIBEBACKEND_CURRENT=0
-LIBEBACKEND_REVISION=1
+LIBEBACKEND_CURRENT=1
+LIBEBACKEND_REVISION=0
 LIBEBACKEND_AGE=0
 
 AC_SUBST(EDS_MAJOR_VERSION)
@@ -1373,8 +1373,11 @@ AC_SUBST(privlibdir)
 imagesdir='${datadir}'/pixmaps/evolution-data-server
 AC_SUBST(imagesdir)
 
-extensiondir='${libdir}'/evolution-data-server-$API_VERSION/extensions
-AC_SUBST(extensiondir)
+ebook_backenddir='${libdir}'/evolution-data-server/addressbook-backends
+AC_SUBST(ebook_backenddir)
+
+ecal_backenddir='${libdir}'/evolution-data-server/calendar-backends
+AC_SUBST(ecal_backenddir)
 
 if test "x$use_gweather" = "xyes"; then
 	weatherdatadir="$privdatadir/weather"
@@ -1382,7 +1385,7 @@ if test "x$use_gweather" = "xyes"; then
 fi
 
 dnl separate camel from e-d-s? or should it be under the same spot? same for now.
-camel_providerdir='${libdir}'/evolution-data-server-$API_VERSION/camel-providers
+camel_providerdir='${libdir}'/evolution-data-server/camel-providers
 AC_SUBST(camel_providerdir)
 
 dnl ******************************
diff --git a/docs/reference/libebackend/tmpl/e-data-server-module.sgml b/docs/reference/libebackend/tmpl/e-data-server-module.sgml
index 0f066cf..f13a5be 100644
--- a/docs/reference/libebackend/tmpl/e-data-server-module.sgml
+++ b/docs/reference/libebackend/tmpl/e-data-server-module.sgml
@@ -25,7 +25,9 @@ e-data-server-module
 
 </para>
 
- void: 
+ module_path: 
+ error: 
+ Returns: 
 
 
 <!-- ##### FUNCTION e_data_server_get_extensions_for_type ##### -->
diff --git a/evolution-data-server.pc.in b/evolution-data-server.pc.in
index c10806c..22d68e0 100644
--- a/evolution-data-server.pc.in
+++ b/evolution-data-server.pc.in
@@ -3,7 +3,6 @@ exec_prefix= exec_prefix@
 libdir= libdir@
 includedir= includedir@
 privlibdir= privlibdir@
-extensiondir= extensiondir@
 datarootdir= datarootdir@
 datadir= datadir@
 privdatadir= privdatadir@
diff --git a/libebackend/Makefile.am b/libebackend/Makefile.am
index 44296cc..424e6db 100644
--- a/libebackend/Makefile.am
+++ b/libebackend/Makefile.am
@@ -4,7 +4,6 @@ libebackend_1_2_la_CPPFLAGS = \
 	$(AM_CPPFLAGS)						\
 	-I$(top_srcdir)						\
 	-DG_LOG_DOMAIN=\"e-data-server\"			\
-	-DE_DATA_SERVER_EXTENSIONDIR=\"$(extensiondir)\"	\
 	$(DB_CFLAGS)						\
 	$(E_BACKEND_CFLAGS)
 
diff --git a/libebackend/e-data-server-module.c b/libebackend/e-data-server-module.c
index 52fb35b..d5739ee 100644
--- a/libebackend/e-data-server-module.c
+++ b/libebackend/e-data-server-module.c
@@ -182,42 +182,38 @@ e_data_server_module_load_file (const gchar *filename)
 	}
 }
 
-static void
-load_module_dir (const gchar *dirname)
+gboolean
+e_data_server_module_init (const gchar *module_path,
+                           GError **error)
 {
+	static gboolean initialized = FALSE;
+	const gchar *name;
 	GDir *dir;
 
-	dir = g_dir_open (dirname, 0, NULL);
+	if (initialized)
+		return TRUE;
+
+	g_return_val_if_fail (module_path != NULL, FALSE);
 
-	if (dir) {
-		const gchar *name;
+	dir = g_dir_open (module_path, 0, error);
+	if (dir == NULL)
+		return FALSE;
 
-		while ((name = g_dir_read_name (dir))) {
-			if (g_str_has_suffix (name, "." G_MODULE_SUFFIX)) {
-				gchar *filename;
+	while ((name = g_dir_read_name (dir))) {
+		if (g_str_has_suffix (name, "." G_MODULE_SUFFIX)) {
+			gchar *filename;
 
-				filename = g_build_filename (dirname,
-							     name,
-							     NULL);
-				e_data_server_module_load_file (filename);
-				g_free (filename);
-			}
+			filename = g_build_filename (module_path, name, NULL);
+			e_data_server_module_load_file (filename);
+			g_free (filename);
 		}
-
-		g_dir_close (dir);
 	}
-}
 
-void
-e_data_server_module_init (void)
-{
-	static gboolean initialized = FALSE;
+	g_dir_close (dir);
 
-	if (!initialized) {
-		initialized = TRUE;
+	initialized = TRUE;
 
-		load_module_dir (E_DATA_SERVER_EXTENSIONDIR);
-	}
+	return TRUE;
 }
 
 GList *
diff --git a/libebackend/e-data-server-module.h b/libebackend/e-data-server-module.h
index a7e9c4a..7220cde 100644
--- a/libebackend/e-data-server-module.h
+++ b/libebackend/e-data-server-module.h
@@ -27,20 +27,25 @@
 
 G_BEGIN_DECLS
 
-void   e_data_server_module_init             (void);
-GList *e_data_server_get_extensions_for_type (GType type);
-void   e_data_server_extension_list_free     (GList *list);
-void   e_data_server_module_remove_unused    (void);
+gboolean	e_data_server_module_init	(const gchar *module_path,
+						 GError **error);
+GList *		e_data_server_get_extensions_for_type
+						(GType type);
+void		e_data_server_extension_list_free
+						(GList *list);
+void		e_data_server_module_remove_unused
+						(void);
 
 /* Add a type to the module interface - allows EDS to add its own modules
  * without putting them in separate shared libraries */
-void   e_data_server_module_add_type         (GType  type);
+void		e_data_server_module_add_type	(GType  type);
 
 /* The following three functions should exist in modules that are
    written to be dynamically loaded */
-void                 eds_module_initialize (GTypeModule *module);
-void                 eds_module_shutdown   (void);
-void                 eds_module_list_types (const GType **types, gint *num_types);
+void		eds_module_initialize		(GTypeModule *module);
+void		eds_module_shutdown		(void);
+void		eds_module_list_types		(const GType **types,
+						 gint *num_types);
 
 G_END_DECLS
 



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