evolution-data-server: 3.43.2 → 3.43.3

https://gitlab.gnome.org/GNOME/evolution-data-server/-/compare/3.43.2...3.43.3
This commit is contained in:
Jan Tojnar 2022-03-15 20:28:17 +00:00
parent 93ad8bcb6a
commit 6ef351611a
2 changed files with 3 additions and 147 deletions

View File

@ -1,140 +0,0 @@
From 4adf9032fd820414d9ebd12cc746fee1895cc910 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Javier=20Jard=C3=B3n?= <jjardon@gnome.org>
Date: Sat, 8 Jan 2022 15:30:52 +0000
Subject: [PATCH] M!93 - Port to libgweather4
Adds support for linking against gweather4 (pass -DWITH_GWEATHER4=ON).
Co-Authored-By: Jan Tojnar <jtojnar@gmail.com>
Closes https://gitlab.gnome.org/GNOME/evolution-data-server/-/merge_requests/93
---
CMakeLists.txt | 9 ++++++++-
config.h.in | 3 +++
.../backends/weather/e-cal-backend-weather.c | 8 ++++++++
.../backends/weather/e-weather-source.c | 17 +++++++++++++++--
4 files changed, 34 insertions(+), 3 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 234f605be..5182a4792 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -119,6 +119,7 @@ set(sqlite_minimum_version 3.7.17)
# Optional Packages
set(goa_minimum_version 3.8)
set(gweather_minimum_version 3.10)
+set(gweather4_minimum_version 3.91.0)
set(libaccounts_glib_minimum_version 1.4)
set(libsignon_glib_minimum_version 1.8)
set(json_glib_minimum_version 1.0.4)
@@ -755,7 +756,13 @@ endif(NOT have_addrinfo)
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})
+ add_printable_variable(WITH_GWEATHER4 "Use GWeather 4 instead of 3" OFF)
+
+ if(WITH_GWEATHER4)
+ pkg_check_modules_for_option(ENABLE_WEATHER "weather calendar backend" LIBGWEATHER gweather4>=${gweather4_minimum_version})
+ else(WITH_GWEATHER4)
+ pkg_check_modules_for_option(ENABLE_WEATHER "weather calendar backend" LIBGWEATHER gweather-3.0>=${gweather_minimum_version})
+ endif(WITH_GWEATHER4)
set(CMAKE_REQUIRED_INCLUDES ${LIBGWEATHER_INCLUDE_DIRS})
set(CMAKE_REQUIRED_LIBRARIES ${LIBGWEATHER_LDFLAGS})
diff --git a/config.h.in b/config.h.in
index 4e79549ab..c087d2b04 100644
--- a/config.h.in
+++ b/config.h.in
@@ -197,6 +197,9 @@
/* gweather_info_new() has only one argument */
#cmakedefine HAVE_ONE_ARG_GWEATHER_INFO_NEW 1
+/* Defined when linking against gweather4. Cannot just use GWEATHER_CHECK_VERSION because 40.0 made the versions non-monotonic. */
+#cmakedefine WITH_GWEATHER4 1
+
/* evolution-alarm-notify - Define if using Canberra-GTK for sound */
#cmakedefine HAVE_CANBERRA 1
diff --git a/src/calendar/backends/weather/e-cal-backend-weather.c b/src/calendar/backends/weather/e-cal-backend-weather.c
index 72faccd62..c4999671f 100644
--- a/src/calendar/backends/weather/e-cal-backend-weather.c
+++ b/src/calendar/backends/weather/e-cal-backend-weather.c
@@ -464,7 +464,11 @@ create_weather (ECalBackendWeather *cbw,
time_t update_time;
ICalTimezone *update_zone = NULL;
const GWeatherLocation *location;
+ #ifdef WITH_GWEATHER4
+ GTimeZone *w_timezone;
+ #else
const GWeatherTimezone *w_timezone;
+ #endif
gdouble tmin = 0.0, tmax = 0.0, temp = 0.0;
g_return_val_if_fail (E_IS_CAL_BACKEND_WEATHER (cbw), NULL);
@@ -484,7 +488,11 @@ create_weather (ECalBackendWeather *cbw,
/* use timezone of the location to determine date for which this is set */
location = gweather_info_get_location (report);
if (location && (w_timezone = gweather_location_get_timezone ((GWeatherLocation *) location)))
+ #ifdef WITH_GWEATHER4
+ update_zone = i_cal_timezone_get_builtin_timezone (g_time_zone_get_identifier (w_timezone));
+ #else
update_zone = i_cal_timezone_get_builtin_timezone (gweather_timezone_get_tzid ((GWeatherTimezone *) w_timezone));
+ #endif
if (!update_zone)
update_zone = i_cal_timezone_get_utc_timezone ();
diff --git a/src/calendar/backends/weather/e-weather-source.c b/src/calendar/backends/weather/e-weather-source.c
index 3052d034c..031b7a6ad 100644
--- a/src/calendar/backends/weather/e-weather-source.c
+++ b/src/calendar/backends/weather/e-weather-source.c
@@ -39,8 +39,11 @@ weather_source_dispose (GObject *object)
EWeatherSourcePrivate *priv;
priv = E_WEATHER_SOURCE (object)->priv;
+ #ifdef WITH_GWEATHER4
+ g_clear_object (&priv->location);
+ #else
g_clear_pointer (&priv->location, gweather_location_unref);
-
+ #endif
g_clear_object (&priv->info);
/* Chain up to parent's dispose() method. */
@@ -85,7 +88,11 @@ weather_source_find_location_by_coords (GWeatherLocation *start,
gweather_location_get_coords (location, &lat, &lon);
if (lat == latitude && lon == longitude) {
+ #ifdef WITH_GWEATHER4
+ g_object_ref (location);
+ #else
gweather_location_ref (location);
+ #endif
return location;
}
}
@@ -96,7 +103,11 @@ weather_source_find_location_by_coords (GWeatherLocation *start,
result = weather_source_find_location_by_coords (child, latitude, longitude);
if (result) {
+ #ifdef WITH_GWEATHER4
+ g_object_unref (child);
+ #else
gweather_location_unref (child);
+ #endif
return result;
}
}
@@ -159,7 +170,9 @@ e_weather_source_new (const gchar *location)
}
}
-#if GWEATHER_CHECK_VERSION(3, 39, 0)
+#ifdef WITH_GWEATHER4
+ g_object_unref (world);
+#elif GWEATHER_CHECK_VERSION(3, 39, 0)
gweather_location_unref (world);
#endif
g_strfreev (tokens);
--
2.35.1

View File

@ -45,13 +45,13 @@
stdenv.mkDerivation rec {
pname = "evolution-data-server";
version = "3.43.2";
version = "3.43.3";
outputs = [ "out" "dev" ];
src = fetchurl {
url = "mirror://gnome/sources/evolution-data-server/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
sha256 = "jmV4HGQPoNm0+AEP9Q6Cpo11VTZWrVDZPxMRJ1y7RBw=";
sha256 = "bSt+XXN1l95aDOZVxZj3TTN262CpcqRr+5Q/Gu4HAEE=";
};
patches = [
@ -59,10 +59,6 @@ stdenv.mkDerivation rec {
src = ./fix-paths.patch;
inherit tzdata;
})
# Fix build with gweather4
# https://gitlab.gnome.org/GNOME/evolution-data-server/-/merge_requests/93
./0001-M-93-Port-to-libgweather4.patch
];
prePatch = ''
@ -139,7 +135,7 @@ stdenv.mkDerivation rec {
meta = with lib; {
description = "Unified backend for programs that work with contacts, tasks, and calendar information";
homepage = "https://wiki.gnome.org/Apps/Evolution";
license = licenses.lgpl2;
license = licenses.lgpl2Plus;
maintainers = teams.gnome.members;
platforms = platforms.linux;
};