summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2013-11-26 02:12:24 -0800
committerPatrick Ohly <patrick.ohly@intel.com>2013-11-26 17:03:02 +0100
commit06e7d0946f706a5639501ed909788888e0eec1ac (patch)
treec7432ce8e41d4f8c743481cbc354f51ebf616ecd
parent5e46710ea9bb52a756359cdb9695480f424770f2 (diff)
compatibility hack: support libical.so.1
libical 1.0 changed the library name to libical.so.1, causing dependency problems becaus syncevolution.org binaries required libical.so.0. It turned out that the relevant parts of the API and ABI had not changed, so simply allowing both versions of the library is sufficient. In addition, a detection of libical.so.1 gets added, just in case.
-rw-r--r--Makefile.am2
-rw-r--r--src/syncevo/eds_abi_wrapper.cpp10
-rw-r--r--src/syncevo/eds_abi_wrapper.h5
3 files changed, 14 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am
index ed83c926..b5d6e5f9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -149,7 +149,7 @@ else
REQUIRES_deb_neon =
endif
if ENABLE_ICAL
-REQUIRES_deb_ical = , libical0
+REQUIRES_deb_ical = , libical0 | libical1
endif
VERSION_deb = 1:$(STABLE_VERSION)$(VERSION)
VERSION_rpm = `echo $(VERSION) | sed -e s/-/_/g`
diff --git a/src/syncevo/eds_abi_wrapper.cpp b/src/syncevo/eds_abi_wrapper.cpp
index 0f4628c7..3a0bd931 100644
--- a/src/syncevo/eds_abi_wrapper.cpp
+++ b/src/syncevo/eds_abi_wrapper.cpp
@@ -165,6 +165,7 @@ void *findSymbols(const char *libname, int minver, int maxver,
int EDSAbiHaveEbook, EDSAbiHaveEcal, EDSAbiHaveEdataserver;
int EDSAbiHaveIcal;
+int EDSAbiHaveIcal1;
int SyncEvoHaveLibbluetooth;
extern "C" void EDSAbiWrapperInit()
@@ -307,7 +308,11 @@ extern "C" void EDSAbiWrapperInit()
&EDSAbiWrapperSingleton.icaltimezone_new, "icaltimezone_new", \
&EDSAbiWrapperSingleton.icaltimezone_set_component, "icaltimezone_set_component",
+ // icalparameter_new_scheduleagent was added in libical.so.1. We
+ // use it only to detect the libical 1.0 ABI. This works because
+ // all methods in EDS_ABI_WRAPPER_ICAL_R are considered optional.
#define EDS_ABI_WRAPPER_ICAL_R \
+ &EDSAbiWrapperSingleton.icalparameter_new_scheduleagent, "icalparameter_new_scheduleagent", \
&EDSAbiWrapperSingleton.icalcomponent_as_ical_string_r, "icalcomponent_as_ical_string_r", \
&EDSAbiWrapperSingleton.icaltime_as_ical_string_r, "icaltime_as_ical_string_r", \
&EDSAbiWrapperSingleton.icalproperty_get_value_as_string_r, "icalproperty_get_value_as_string_r",
@@ -354,17 +359,18 @@ extern "C" void EDSAbiWrapperInit()
// libecal not found above (or not enabled), but libical
// might still be available, so check for it separately
ecalhandle =
- findSymbols("libical.so", 0, 0,
+ findSymbols("libical.so", 0, 1,
FIND_SYMBOLS_NEED_ALL, NULL,
EDS_ABI_WRAPPER_ICAL_BASE
(void *)0);
ecalhandle =
- findSymbols("libical.so", 0, 0,
+ findSymbols("libical.so", 0, 1,
0, NULL,
EDS_ABI_WRAPPER_ICAL_R
(void *)0);
}
EDSAbiHaveIcal = EDSAbiWrapperSingleton.icalcomponent_add_component != 0;
+ EDSAbiHaveIcal1 = EDSAbiWrapperSingleton.icalparameter_new_scheduleagent != 0;
# endif // ENABLE_ICAL
# ifdef ENABLE_BLUETOOTH
diff --git a/src/syncevo/eds_abi_wrapper.h b/src/syncevo/eds_abi_wrapper.h
index bdf1595e..d9d14ddd 100644
--- a/src/syncevo/eds_abi_wrapper.h
+++ b/src/syncevo/eds_abi_wrapper.h
@@ -98,6 +98,7 @@ extern "C" {
/** libebook, libecal, libedataserver available (currently checks for e_book_new/e_cal_new/e_source_group_peek_sources) */
extern int EDSAbiHaveEbook, EDSAbiHaveEcal, EDSAbiHaveEdataserver;
extern int EDSAbiHaveIcal;
+extern int EDSAbiHaveIcal1; // libical.so.1
/** libbluetooth available (checks sdp_connect()) */
extern int SyncEvoHaveLibbluetooth;
@@ -251,6 +252,10 @@ struct EDSAbiWrapper {
icaltimezone *(*icaltimezone_new) (void);
int (*icaltimezone_set_component) (icaltimezone *zone, icalcomponent *comp);
+ // Optional, added in libical.so.1. Can't be called be like this,
+ // we merely check for the method to detect the ABI.
+ void (*icalparameter_new_scheduleagent)(void);
+
// optional variants which allocate the returned string for us
const char* (*icaltime_as_ical_string_r) (const struct icaltimetype tt);
char* (*icalcomponent_as_ical_string_r) (icalcomponent* component);