io.elementary.calendar: update to 6.1.2.

* use libsoup3
This commit is contained in:
Michal Vasilek 2022-12-15 21:21:27 +01:00
parent 3c32cd7bb5
commit 1cd3aedba8
2 changed files with 142 additions and 5 deletions

View File

@ -0,0 +1,137 @@
From 62c20e5786accd68b96c423b04e32c043e726cac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Corentin=20No=C3=ABl?= <tintou@noel.tf>
Date: Sun, 7 Aug 2022 21:18:35 +0200
Subject: [PATCH] Add support for Evolution Data Server 3.46
EDS 3.46 has switched to libsoup-3
Co-authored-by: Bobby Rong <rjl931189261@126.com>
---
meson.build | 10 ++++++++--
plugins/CalDAV/CalDAVBackend.vala | 12 ++++++++++++
plugins/Google/GoogleBackend.vala | 26 ++++++++++++++++++++++++++
3 files changed, 46 insertions(+), 2 deletions(-)
diff --git a/meson.build b/meson.build
index ff7a2d0f9..703a9686d 100644
--- a/meson.build
+++ b/meson.build
@@ -28,14 +28,20 @@ gtk_dep = dependency('gtk+-3.0', version: '>=3.22')
handy_dep = dependency('libhandy-1', version: '>=0.90.0')
libedataserver_dep = dependency('libedataserver-1.2', version: '>=3.8.0')
libedataserverui_dep = dependency('libedataserverui-1.2', version: '>=3.8.0')
-libsoup_dep = dependency('libsoup-2.4')
+if (libedataserver_dep.version().version_compare ('>=3.46'))
+ libsoup_dep = []
+ geocode_glib_dep = dependency('geocode-glib-2.0')
+ add_project_arguments('--define', 'HAS_EDS_3_46', language: 'vala')
+else
+ geocode_glib_dep = dependency('geocode-glib-1.0')
+ libsoup_dep = dependency('libsoup-2.4')
+endif
gmodule_dep = dependency('gmodule-2.0')
champlain_dep = dependency('champlain-0.12')
champlain_gtk_dep = dependency('champlain-gtk-0.12')
clutter_dep = dependency('clutter-1.0')
clutter_gtk_dep = dependency('clutter-gtk-1.0')
folks_dep = dependency('folks')
-geocode_glib_dep = dependency('geocode-glib-1.0')
gclue_dep = dependency('libgeoclue-2.0')
libecal_dep = dependency('libecal-2.0')
libical_dep = dependency('libical-glib')
diff --git a/plugins/CalDAV/CalDAVBackend.vala b/plugins/CalDAV/CalDAVBackend.vala
index e1f6fde53..e4f5e0f5c 100644
--- a/plugins/CalDAV/CalDAVBackend.vala
+++ b/plugins/CalDAV/CalDAVBackend.vala
@@ -73,7 +73,11 @@ public class Maya.CalDavBackend : GLib.Object, Maya.Backend {
collection.add (url_entry);
if (to_edit != null) {
E.SourceWebdav webdav = (E.SourceWebdav)to_edit.get_extension (E.SOURCE_EXTENSION_WEBDAV_BACKEND);
+#if HAS_EDS_3_46
+ var uri = webdav.dup_uri ();
+#else
var uri = webdav.dup_soup_uri ();
+#endif
if (uri.get_port () != 80) {
((Gtk.Entry)url_entry.widget).text = "%s://%s:%u%s".printf (uri.get_scheme (), uri.get_host (), uri.get_port (), uri.get_path ());
} else {
@@ -147,7 +151,11 @@ public class Maya.CalDavBackend : GLib.Object, Maya.Backend {
foreach (var widget in widgets) {
switch (widget.ref_name) {
case "url_entry":
+#if HAS_EDS_3_46
+ webdav.uri = GLib.Uri.parse (((Gtk.Entry)widget.widget).text, GLib.UriFlags.NONE);
+#else
webdav.soup_uri = new Soup.URI (((Gtk.Entry)widget.widget).text);
+#endif
break;
case "user_entry":
auth.user = ((Gtk.Entry)widget.widget).text;
@@ -190,7 +198,11 @@ public class Maya.CalDavBackend : GLib.Object, Maya.Backend {
foreach (var widget in widgets) {
switch (widget.ref_name) {
case "url_entry":
+#if HAS_EDS_3_46
+ webdav.uri = GLib.Uri.parse (((Gtk.Entry)widget.widget).text, GLib.UriFlags.NONE);
+#else
webdav.soup_uri = new Soup.URI (((Gtk.Entry)widget.widget).text);
+#endif
break;
case "user_entry":
auth.user = ((Gtk.Entry)widget.widget).text;
diff --git a/plugins/Google/GoogleBackend.vala b/plugins/Google/GoogleBackend.vala
index 2f9fa3f2b..3f77bd13b 100644
--- a/plugins/Google/GoogleBackend.vala
+++ b/plugins/Google/GoogleBackend.vala
@@ -83,12 +83,25 @@ public class Maya.GoogleBackend : GLib.Object, Maya.Backend {
}
auth.user = decoded_user;
+#if HAS_EDS_3_46
+ webdav.uri = GLib.Uri.build (
+ GLib.UriFlags.NONE,
+ "https",
+ null,
+ "www.google.com",
+ -1,
+ "/calendar/dav/%s/events".printf (decoded_user),
+ null,
+ null
+ );
+#else
var soup_uri = new Soup.URI (null);
soup_uri.set_host ("www.google.com");
soup_uri.set_scheme ("https");
soup_uri.set_user (decoded_user);
soup_uri.set_path ("/calendar/dav/%s/events".printf (decoded_user));
webdav.soup_uri = soup_uri;
+#endif
break;
case "keep_copy":
offline.set_stay_synchronized (((Gtk.CheckButton)widget.widget).active);
@@ -128,12 +141,25 @@ public class Maya.GoogleBackend : GLib.Object, Maya.Backend {
}
auth.user = decoded_user;
+#if HAS_EDS_3_46
+ webdav.uri = GLib.Uri.build (
+ GLib.UriFlags.NONE,
+ "https",
+ null,
+ "www.google.com",
+ -1,
+ "/calendar/dav/%s/events".printf (decoded_user),
+ null,
+ null
+ );
+#else
var soup_uri = new Soup.URI (null);
soup_uri.set_host ("www.google.com");
soup_uri.set_scheme ("https");
soup_uri.set_user (decoded_user);
soup_uri.set_path ("/calendar/dav/%s/events".printf (decoded_user));
webdav.soup_uri = soup_uri;
+#endif
break;
case "keep_copy":
offline.set_stay_synchronized (((Gtk.CheckButton)widget.widget).active);

View File

@ -1,20 +1,20 @@
# Template file for 'io.elementary.calendar'
pkgname=io.elementary.calendar
version=6.1.0
revision=2
version=6.1.2
revision=1
build_style=meson
build_helper="gir"
hostmakedepends="gettext pkg-config vala desktop-file-utils AppStream
glib-devel evolution-data-server-devel"
makedepends="granite-devel libglib-devel gtk+3-devel libgee08-devel
libchamplain-devel clutter-devel evolution-data-server-devel libhandy1-devel
folks-devel geocode-glib-libsoup2-devel geoclue2-devel libical-devel libnotify-devel"
folks-devel geocode-glib-devel geoclue2-devel libical-devel libnotify-devel"
short_desc="Desktop calendar app designed for elementary OS"
maintainer="Cameron Nemo <cam@nohom.org>"
license="GPL-3.0-only"
homepage="https://github.com/elementary/calendar"
distfiles="https://github.com/elementary/calendar/archive/refs/tags/${version}.tar.gz"
checksum=3cb4ba6f4d9fa6addfbe39b58cea282c0f0c6f139c49214c05e52adf457d949d
checksum=4051f4d190d2144054c3fb637e53281850a7db858771d73adf157c914dba8f31
libio.elementary.calendar_package() {
short_desc+=" - library"
@ -26,7 +26,7 @@ libio.elementary.calendar_package() {
libio.elementary.calendar-devel_package() {
short_desc+=" - library development files"
depends="libio.elementary.calendar>=${version} evolution-data-server-devel
granite-devel gtk+3-devel libglib-devel libical-devel libsoup-devel
granite-devel gtk+3-devel libglib-devel libical-devel libsoup3-devel
libhandy1-devel"
pkg_install() {
vmove "usr/lib/*.so"