summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2017-12-11 10:33:25 +0100
committerMilan Crha <mcrha@redhat.com>2017-12-11 10:33:25 +0100
commitd45a5b6261c8ec97b0fbde74d8c5212caff6ef2f (patch)
tree0759d39402d328991cf53ea9dedf5c9996c2a2ea
parent02a9138edcb0d190c89740528ee45cea96d14371 (diff)
downloadevolution-data-server-d45a5b6261c8ec97b0fbde74d8c5212caff6ef2f.tar.gz
Bug 791327 - Adapt to gweather_info_new() API change
-rw-r--r--CMakeLists.txt13
-rw-r--r--config.h.in3
-rw-r--r--src/calendar/backends/weather/e-weather-source.c11
3 files changed, 24 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e6f396c29..a9ec83fef 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -731,6 +731,19 @@ add_printable_option(ENABLE_WEATHER "Build the weather calendar backend" ON)
if(ENABLE_WEATHER)
pkg_check_modules_for_option(ENABLE_WEATHER "weather calendar backend" LIBGWEATHER gweather-3.0>=${gweather_minimum_version})
+
+ set(CMAKE_REQUIRED_INCLUDES ${LIBGWEATHER_INCLUDE_DIRS})
+ set(CMAKE_REQUIRED_LIBRARIES ${LIBGWEATHER_LDFLAGS})
+ CHECK_C_SOURCE_COMPILES("#define GWEATHER_I_KNOW_THIS_IS_UNSTABLE
+ #include <libgweather/gweather.h>
+ #undef GWEATHER_I_KNOW_THIS_IS_UNSTABLE
+
+ int main(void) {
+ gweather_info_new (NULL);
+ return 0;
+ }" HAVE_ONE_ARG_GWEATHER_INFO_NEW)
+ unset(CMAKE_REQUIRED_INCLUDES)
+ unset(CMAKE_REQUIRED_LIBRARIES)
endif(ENABLE_WEATHER)
# ******************************
diff --git a/config.h.in b/config.h.in
index 6d4e506ef..7ebf21605 100644
--- a/config.h.in
+++ b/config.h.in
@@ -190,3 +190,6 @@
/* Have libaccounts-glib */
#cmakedefine HAVE_UOA 1
+
+/* gweather_info_new() has only one argument */
+#cmakedefine HAVE_ONE_ARG_GWEATHER_INFO_NEW 1
diff --git a/src/calendar/backends/weather/e-weather-source.c b/src/calendar/backends/weather/e-weather-source.c
index 340aa6e4f..8aada0196 100644
--- a/src/calendar/backends/weather/e-weather-source.c
+++ b/src/calendar/backends/weather/e-weather-source.c
@@ -17,10 +17,12 @@
* Authors: David Trowbridge <trowbrds@cs.colorado.edu>
*/
-#include "e-weather-source.h"
+#include "evolution-data-server-config.h"
#include <string.h>
+#include "e-weather-source.h"
+
#define E_WEATHER_SOURCE_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE \
((obj), E_TYPE_WEATHER_SOURCE, EWeatherSourcePrivate))
@@ -185,8 +187,11 @@ e_weather_source_parse (EWeatherSource *source,
if (source->priv->info == NULL) {
source->priv->info = gweather_info_new (
- source->priv->location,
- GWEATHER_FORECAST_LIST);
+ source->priv->location
+ #ifndef HAVE_ONE_ARG_GWEATHER_INFO_NEW
+ , GWEATHER_FORECAST_LIST
+ #endif
+ );
gweather_info_set_enabled_providers (source->priv->info, GWEATHER_PROVIDER_ALL);
g_signal_connect (
source->priv->info, "updated",