Re: [SyncEvolution] [Patch] Fails to build with libical 3.0.0

2017-12-14 Thread Patrick Ohly
On Thu, 2017-12-14 at 15:59 +0100, Patrick Ohly wrote:
> On Thu, 2017-11-16 at 12:45 +0100, Milan Crha wrote:
> > -   itime = icaltime_from_timet (now, 0);
> > +   itime = icaltime_from_timet_with_zone (now, 0,
> > NULL);
> 
> Upstream replaced icaltime_from_timed(x, 0)
> with
> icaltime_from_timet_with_zone(x, 0, icaltimezone_get_utc_timezone()).
> Is that perhaps also what should be done in SyncEvolution?

No, internally icaltime_from_timed(x, 0) was implemented as
icaltime_from_timet_with_zone(x, 0, NULL), just like your patch does, s
 that should be fine.

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.


___
SyncEvolution mailing list
SyncEvolution@syncevolution.org
https://lists.syncevolution.org/mailman/listinfo/syncevolution

Re: [SyncEvolution] [Patch] Fails to build with libical 3.0.0

2017-12-14 Thread Patrick Ohly
On Thu, 2017-11-16 at 12:45 +0100, Milan Crha wrote:
> - itime = icaltime_from_timet (now, 0);
> + itime = icaltime_from_timet_with_zone (now, 0,
> NULL);

Upstream replaced icaltime_from_timed(x, 0) with
icaltime_from_timet_with_zone(x, 0, icaltimezone_get_utc_timezone()).
Is that perhaps also what should be done in SyncEvolution? I haven't
tested whether it makes a difference yet.

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.


___
SyncEvolution mailing list
SyncEvolution@syncevolution.org
https://lists.syncevolution.org/mailman/listinfo/syncevolution


Re: [SyncEvolution] [Patch] Fails to build with libical 3.0.0

2017-12-11 Thread Patrick Ohly
On Thu, 2017-11-16 at 12:45 +0100, Milan Crha wrote:
>   Hi,
> syncevolution 1.5.2 fails to build with libical 3.0.0.
> I attached a patch which makes it build. Let me know if anything is
> wrong, please.

I've not forgotten about this. Thanks for the patch, I'll try it with
libical 3.0. The actual upstream patch inevitably will have to be more
complex (= more ifdefs), because SyncEvolution still needs to compile
for distros with older libical versions.

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.


___
SyncEvolution mailing list
SyncEvolution@syncevolution.org
https://lists.syncevolution.org/mailman/listinfo/syncevolution


[SyncEvolution] [Patch] Fails to build with libical 3.0.0

2017-11-16 Thread Milan Crha
Hi,
syncevolution 1.5.2 fails to build with libical 3.0.0.
I attached a patch which makes it build. Let me know if anything is
wrong, please.
Thanks and bye,
Milandiff -up syncevolution-1.5.2/src/backends/webdav/CalDAVSource.cpp.libical3 syncevolution-1.5.2/src/backends/webdav/CalDAVSource.cpp
--- syncevolution-1.5.2/src/backends/webdav/CalDAVSource.cpp.libical3	2017-11-16 12:21:40.808664704 +0100
+++ syncevolution-1.5.2/src/backends/webdav/CalDAVSource.cpp	2017-11-16 12:22:16.277664214 +0100
@@ -721,8 +721,8 @@ SubSyncSource::SubItemResult CalDAVSourc
 eptr fullcal = event.m_calendar;
 loadItem(event);
 event.m_sequence++;
-lastmodtime = icaltime_from_timet(event.m_lastmodtime, false);
-lastmodtime.is_utc = 1;
+lastmodtime = icaltime_from_timet_with_zone(event.m_lastmodtime, false, NULL);
+lastmodtime.zone = icaltimezone_get_utc_timezone();
 event.m_calendar = fullcal;
 for (icalcomponent *comp = icalcomponent_get_first_component(event.m_calendar, ICAL_VEVENT_COMPONENT);
  comp;
diff -up syncevolution-1.5.2/src/syncevo/icaltz-util.c.libical3 syncevolution-1.5.2/src/syncevo/icaltz-util.c
--- syncevolution-1.5.2/src/syncevo/icaltz-util.c.libical3	2017-11-16 12:22:43.408663839 +0100
+++ syncevolution-1.5.2/src/syncevo/icaltz-util.c	2017-11-16 12:23:37.109663096 +0100
@@ -224,7 +224,7 @@ find_transidx (time_t *transitions, ttin
 	struct icaltimetype itime;
 
 	now = time (NULL);
-	itime = icaltime_from_timet (now, 0);
+	itime = icaltime_from_timet_with_zone (now, 0, NULL);
 	itime.month = itime.day = 1;
 	itime.hour = itime.minute = itime.second = 0;
 	year_start = icaltime_as_timet(itime);
@@ -304,13 +304,13 @@ adjust_dtstart_day_to_rrule (icalcompone
 	icalrecur_iterator *iter;
 
 	now = time (NULL);
-	itime = icaltime_from_timet (now, 0);
+	itime = icaltime_from_timet_with_zone (now, 0, NULL);
 	itime.month = itime.day = 1;
 	itime.hour = itime.minute = itime.second = 0;
 	year_start = icaltime_as_timet(itime);
 
 	comp_start = icalcomponent_get_dtstart (comp);
-	start = icaltime_from_timet (year_start, 0);
+	start = icaltime_from_timet_with_zone (year_start, 0, NULL);
 
 	iter = icalrecur_iterator_new (rule, start);
 	iter_start = icalrecur_iterator_next (iter);
@@ -478,7 +478,7 @@ icaltzutil_fetch_timezone (const char *l
 			trans = transitions [stdidx] + types [zp_idx].gmtoff;
 		else
 			trans = types [zp_idx].gmtoff;
-		icaltime = icaltime_from_timet (trans, 0);
+		icaltime = icaltime_from_timet_with_zone (trans, 0, NULL);
 		dtstart = icaltime;
 		dtstart.year = 1970;
 		dtstart.minute = dtstart.second = 0;
@@ -520,7 +520,7 @@ icaltzutil_fetch_timezone (const char *l
 			trans = transitions [dstidx] + types [zp_idx].gmtoff;
 		else
 			trans = types [zp_idx].gmtoff;
-		icaltime = icaltime_from_timet (trans, 0);
+		icaltime = icaltime_from_timet_with_zone (trans, 0, NULL);
 		dtstart = icaltime;
 		dtstart.year = 1970;
 		dtstart.minute = dtstart.second = 0;
diff -up syncevolution-1.5.2/src/synthesis/configure.in.libical3 syncevolution-1.5.2/src/synthesis/configure.in
--- syncevolution-1.5.2/src/synthesis/configure.in.libical3	2016-10-06 16:40:43.0 +0200
+++ syncevolution-1.5.2/src/synthesis/configure.in	2017-11-16 12:06:02.169677684 +0100
@@ -101,9 +101,14 @@ AC_ARG_ENABLE(libical,
 if test "$enable_libical" == "yes"; then
PKG_CHECK_MODULES(LIBICAL, libical,
  [AC_DEFINE(HAVE_LIBICAL, 1, "libical available")
-  PKG_CHECK_MODULES(LIBICAL2, libical >= 2,
-[AC_DEFINE(USE_ICALTZUTIL_SET_EXACT_VTIMEZONES_SUPPORT, 1, "Use icaltzutil_set_exact_vtimezones_support() to enable interoperable timezone definitions.")],
-[true])],
+  PKG_CHECK_MODULES(LIBICAL3, libical >= 3,
+[have_libical3="yes"],
+[have_libical3="no"])
+  if test "$have_libical3" == "no"; then
+  PKG_CHECK_MODULES(LIBICAL2, libical >= 2,
+[AC_DEFINE(USE_ICALTZUTIL_SET_EXACT_VTIMEZONES_SUPPORT, 1, "Use icaltzutil_set_exact_vtimezones_support() to enable interoperable timezone definitions.")],
+[true])
+  fi],
  [AC_ERROR([libical not found, required for --enable-libical])])
 fi
 
diff -up syncevolution-1.5.2/src/synthesis/src/platform_adapters/linux/platform_timezones.cpp.libical3 syncevolution-1.5.2/src/synthesis/src/platform_adapters/linux/platform_timezones.cpp
--- syncevolution-1.5.2/src/synthesis/src/platform_adapters/linux/platform_timezones.cpp.libical3	2016-10-06 16:40:43.0 +0200
+++ syncevolution-1.5.2/src/synthesis/src/platform_adapters/linux/platf