[packages/orage] Rel 2
arekm
arekm at pld-linux.org
Sat Aug 22 16:33:33 CEST 2026
commit ba168487b62142c33e576f5683f50392495472c5
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Sat Aug 22 16:33:19 2026 +0200
Rel 2
libical3.patch | 59 ----
orage-libical4.patch | 762 +++++++++++++++++++++++++++++++++++++++++++++++++++
orage.spec | 17 +-
3 files changed, 770 insertions(+), 68 deletions(-)
---
diff --git a/orage.spec b/orage.spec
index abd3555..e51161f 100644
--- a/orage.spec
+++ b/orage.spec
@@ -1,32 +1,30 @@
-%define xfce_version 4.16.0
+%define xfce_version 4.20.0
Summary: Calendar for Xfce
Summary(pl.UTF-8): Kalendarz dla Xfce
Name: orage
Version: 4.20.3
-Release: 1
+Release: 2
License: GPL v2+
Group: X11/Applications
Source0: https://archive.xfce.org/src/apps/orage/4.20/%{name}-%{version}.tar.bz2
# Source0-md5: bf7dd089bf20f0d060f9a6f6fa759c49
-Patch0: libical3.patch
+Patch0: orage-libical4.patch
URL: https://www.xfce.org/projects/orage
-BuildRequires: dbus-glib-devel
BuildRequires: gettext-tools
-BuildRequires: glib2-devel >= 1:2.58.4
+BuildRequires: glib2-devel >= 1:2.58.0
BuildRequires: gtk+3-devel >= 3.24.0
BuildRequires: libical-devel >= 3.0
BuildRequires: libnotify-devel >= 0.7.0
BuildRequires: libxfce4ui-devel >= %{xfce_version}
BuildRequires: libxfce4util-devel >= %{xfce_version}
BuildRequires: pkgconfig
-BuildRequires: popt-devel
BuildRequires: rpmbuild(macros) >= 1.601
BuildRequires: xfce4-dev-tools >= %{xfce_version}
-BuildRequires: xfce4-panel-devel >= %{xfce_version}
+BuildRequires: xorg-lib-libX11-devel
Requires: desktop-file-utils
Requires: gtk-update-icon-cache
Requires: hicolor-icon-theme >= 0.12-4
-Obsoletes: xfcalendar
+Obsoletes: xfcalendar < 4.3.90.1
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
@@ -43,7 +41,7 @@ zarządzania starymi spotkaniami.
%prep
%setup -q
-#%%patch0 -p1
+%patch -P0 -p1
%build
%configure \
@@ -73,6 +71,7 @@ rm -rf $RPM_BUILD_ROOT
%postun
%update_icon_cache hicolor
+%update_desktop_database_postun
%files -f %{name}.lang
%defattr(644,root,root,755)
diff --git a/libical3.patch b/libical3.patch
deleted file mode 100644
index af962b3..0000000
--- a/libical3.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-diff -up orage-4.12.1/src/ical-code.c.libical-3.0 orage-4.12.1/src/ical-code.c
---- orage-4.12.1/src/ical-code.c.libical-3.0 2017-11-14 08:41:30.917375493 +0100
-+++ orage-4.12.1/src/ical-code.c 2017-11-14 08:41:56.823375135 +0100
-@@ -129,7 +129,6 @@ static struct icaltimetype ical_get_curr
- && (strcmp(g_par.local_timezone, "floating") != 0))
- ctime = icaltime_current_time_with_zone(local_icaltimezone);
- else { / * use floating time * /
-- ctime.is_utc = 0;
- ctime.is_date = 0;
- ctime.is_daylight = 0;
- ctime.zone = NULL;
-@@ -2579,7 +2578,6 @@ static struct icaltimetype count_first_a
- * when counting alarm time. */
- if (rel == ICAL_RELATED_START) {
- per.stime.is_date = 0;
-- per.stime.is_utc = 1;
- per.stime.is_daylight = 0;
- per.stime.zone = utc_icaltimezone;
- per.stime.hour = 0;
-@@ -2588,7 +2586,6 @@ static struct icaltimetype count_first_a
- }
- else {
- per.etime.is_date = 0;
-- per.etime.is_utc = 1;
- per.etime.is_daylight = 0;
- per.etime.zone = utc_icaltimezone;
- per.etime.hour = 0;
-@@ -2613,7 +2610,6 @@ static struct icaltimetype count_next_al
- /* HACK: convert to UTC time so that we can use time arithmetic
- * when counting alarm time. */
- start_time.is_date = 0;
-- start_time.is_utc = 1;
- start_time.is_daylight = 0;
- start_time.zone = utc_icaltimezone;
- start_time.hour = 0;
-@@ -2768,7 +2764,6 @@ static alarm_struct *process_alarm_trigg
- */
- if (icaltime_is_date(per.stime)) {
- if (local_icaltimezone != utc_icaltimezone) {
-- next_alarm_time.is_utc = 0;
- next_alarm_time.is_daylight = 0;
- next_alarm_time.zone = local_icaltimezone;
- }
-@@ -2850,7 +2845,6 @@ orage_message(120, P_N "Alarm rec loop n
- */
- if (icaltime_is_date(per.stime)) {
- if (local_icaltimezone != utc_icaltimezone) {
-- next_alarm_time.is_utc = 0;
- next_alarm_time.is_daylight = 0;
- next_alarm_time.zone = local_icaltimezone;
- }
-@@ -2944,7 +2938,6 @@ orage_message(120, P_N "*****After loop
- */
- if (icaltime_is_date(per.stime)) {
- if (local_icaltimezone != utc_icaltimezone) {
-- next_alarm_time.is_utc = 0;
- next_alarm_time.is_daylight = 0;
- next_alarm_time.zone = local_icaltimezone;
- }
diff --git a/orage-libical4.patch b/orage-libical4.patch
new file mode 100644
index 0000000..c3a6701
--- /dev/null
+++ b/orage-libical4.patch
@@ -0,0 +1,762 @@
+diff -urN --no-dereference orage-4.20.3.orig/configure orage-4.20.3/configure
+--- orage-4.20.3.orig/configure 2026-03-27 08:18:10.000000000 +0100
++++ orage-4.20.3/configure 2026-08-22 16:27:45.946682450 +0200
+@@ -19323,6 +19323,13 @@
+ fi
+
+
++# libical 4.0 split the storage functions (icalset_*) into their own
++# pkg-config module; libical 3.0 still ships them in libical.pc.
++if $PKG_CONFIG --exists "libicalss" >/dev/null 2>&1; then
++ LIBICAL_CFLAGS="$LIBICAL_CFLAGS `$PKG_CONFIG --cflags libicalss`"
++ LIBICAL_LIBS="$LIBICAL_LIBS `$PKG_CONFIG --libs libicalss`"
++fi
++
+ if test "$LIBICAL_VERSION" = "3.0.15"; then
+ as_fn_error $? "\"unsupported libical version $LIBICAL_VERSION, see https://gitlab.xfce.org/apps/orage/-/issues/20\"" "$LINENO" 5
+ fi
+diff -urN --no-dereference orage-4.20.3.orig/configure.ac orage-4.20.3/configure.ac
+--- orage-4.20.3.orig/configure.ac 2026-03-27 08:16:55.000000000 +0100
++++ orage-4.20.3/configure.ac 2026-08-22 16:27:45.944196146 +0200
+@@ -88,6 +88,13 @@
+ XDT_CHECK_PACKAGE([LIBICAL], [libical], [libical_minimum_version])
+ XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2], [xfce_minimum_version])
+
++# libical 4.0 split the storage functions (icalset_*) into their own
++# pkg-config module; libical 3.0 still ships them in libical.pc.
++if $PKG_CONFIG --exists "libicalss" >/dev/null 2>&1; then
++ LIBICAL_CFLAGS="$LIBICAL_CFLAGS `$PKG_CONFIG --cflags libicalss`"
++ LIBICAL_LIBS="$LIBICAL_LIBS `$PKG_CONFIG --libs libicalss`"
++fi
++
+ if test "$LIBICAL_VERSION" = "3.0.15"; then
+ AC_MSG_ERROR(["unsupported libical version $LIBICAL_VERSION, see https://gitlab.xfce.org/apps/orage/-/issues/20"])
+ fi
+diff -urN --no-dereference orage-4.20.3.orig/src/ical-archive.c orage-4.20.3/src/ical-archive.c
+--- orage-4.20.3.orig/src/ical-archive.c 2026-03-27 08:15:22.000000000 +0100
++++ orage-4.20.3/src/ical-archive.c 2026-08-22 16:24:38.898537395 +0200
+@@ -118,7 +118,7 @@
+ icalcomponent *d;
+
+ /* Add to the archive file */
+- d = icalcomponent_new_clone(e);
++ d = icalcomponent_clone(e);
+ icalcomponent_add_component(ic_aical, d);
+
+ /* Remove from the main file */
+@@ -129,7 +129,7 @@
+ const gint threshold_months)
+ {
+ struct icaltimetype sdate, edate, nsdate, nedate;
+- struct icalrecurrencetype rrule;
++ orage_rrule rrule;
+ struct icaldurationtype duration;
+ icalrecur_iterator* ri;
+ gchar *stz_loc = NULL, *etz_loc = NULL;
+@@ -158,7 +158,7 @@
+ if (pdtend) { /* we have DTEND, so we need to adjust it. */
+ etz_loc = ic_get_char_timezone(pdtend);
+ edate = ic_convert_to_timezone(edate, pdtend);
+- duration = icaltime_subtract(edate, sdate);
++ duration = icalduration_from_times(edate, sdate);
+ upd_edate = TRUE;
+ }
+ else {
+@@ -166,7 +166,7 @@
+ if (p) /* we have DURATION, which does not need changes */
+ duration = icalproperty_get_duration(p);
+ else /* neither duration, nor dtend, assume dtend=dtstart */
+- duration = icaltime_subtract(edate, sdate);
++ duration = icalduration_from_times(edate, sdate);
+ }
+ p_orig = icalcomponent_get_first_property(e, ICAL_X_PROPERTY);
+ while (p_orig) {
+@@ -217,11 +217,11 @@
+
+ /* We must do a loop for finding the first occurence after the threshold */
+ for (nsdate = icalrecur_iterator_next(ri),
+- nedate = icaltime_add(nsdate, duration);
++ nedate = icalduration_extend(nsdate, duration);
+ !icaltime_is_null_time(nsdate)
+ && (nedate.year*12 + nedate.month) < threshold_months;
+ nsdate = icalrecur_iterator_next(ri),
+- nedate = icaltime_add(nsdate, duration)){
++ nedate = icalduration_extend(nsdate, duration)){
+ }
+ icalrecur_iterator_free(ri);
+
+@@ -409,7 +409,7 @@
+ c != 0;
+ c = icalcomponent_get_next_component(ic_aical, ICAL_ANY_COMPONENT)) {
+ /* Add to the base file */
+- d = icalcomponent_new_clone(c);
++ d = icalcomponent_clone(c);
+ icalcomponent_add_component(ic_ical, d);
+ }
+ xfical_archive_close();
+@@ -443,7 +443,7 @@
+ text = icalcomponent_get_uid(c);
+ if (strcmp(text, ical_uid) == 0) { /* we found our uid (=event) */
+ /* Add to the base file */
+- d = icalcomponent_new_clone(c);
++ d = icalcomponent_clone(c);
+ icalcomponent_add_component(ic_ical, d);
+ /* Remove from the archive file */
+ icalcomponent_remove_component(ic_aical, c);
+diff -urN --no-dereference orage-4.20.3.orig/src/ical-code.c orage-4.20.3/src/ical-code.c
+--- orage-4.20.3.orig/src/ical-code.c 2026-03-27 08:15:22.000000000 +0100
++++ orage-4.20.3/src/ical-code.c 2026-08-22 16:26:28.784736947 +0200
+@@ -282,7 +282,7 @@
+ icalset_add_component(*p_fical, *p_ical);
+ #if 0
+ icalset_add_component(*p_fical
+- , icalcomponent_new_clone(*p_ical));
++ , icalcomponent_clone(*p_ical));
+
+ *p_ical = icalset_get_first_component(*p_fical);
+ #endif
+@@ -554,16 +554,16 @@
+ per.etime = convert_to_local_timezone(per.etime, p);
+ else
+ per.etime = ic_convert_to_timezone(per.etime, p);
+- per.duration = icaltime_subtract(per.etime, per.stime);
++ per.duration = icalduration_from_times(per.etime, per.stime);
+ if (icaltime_is_date(per.stime)
+- && icaldurationtype_as_int(per.duration) != 0) {
++ && icaldurationtype_as_seconds(per.duration) != 0) {
+ /* need to subtract 1 day.
+ * read explanation from appt_add_internal: appt->endtime processing */
+- duration_tmp = icaldurationtype_from_int(60*60*24);
+- dur_int = icaldurationtype_as_int(per.duration);
+- dur_int -= icaldurationtype_as_int(duration_tmp);
+- per.duration = icaldurationtype_from_int(dur_int);
+- per.etime = icaltime_add(per.stime, per.duration);
++ duration_tmp = icaldurationtype_from_seconds(60*60*24);
++ dur_int = icaldurationtype_as_seconds(per.duration);
++ dur_int -= icaldurationtype_as_seconds(duration_tmp);
++ per.duration = icaldurationtype_from_seconds(dur_int);
++ per.etime = icalduration_extend(per.stime, per.duration);
+ }
+
+ }
+@@ -571,7 +571,7 @@
+ p = icalcomponent_get_first_property(c, ICAL_DURATION_PROPERTY);
+ if (p != NULL) {
+ per.duration = icalproperty_get_duration(p);
+- per.etime = icaltime_add(per.stime, per.duration);
++ per.etime = icalduration_extend(per.stime, per.duration);
+ }
+ else {
+ per.etime = per.stime;
+@@ -717,8 +717,8 @@
+
+ if (appt->use_duration) {
+ stime = icaltimetype_from_gdatetime (appt->starttime, appt->allDay);
+- duration = icaldurationtype_from_int(appt->duration);
+- etime = icaltime_add(stime, duration);
++ duration = icaldurationtype_from_seconds(appt->duration);
++ etime = icalduration_extend(stime, duration);
+ text = icaltime_as_ical_string(etime);
+ orage_gdatetime_unref (appt->endtime);
+ appt->endtime = orage_icaltime_to_gdatetime (text);
+@@ -739,8 +739,8 @@
+ etime = convert_to_zone (etime, appt->end_tz_loc);
+ etime = icaltime_convert_to_zone (etime, local_icaltimezone);
+
+- duration = icaltime_subtract (etime, stime);
+- appt->duration = icaldurationtype_as_int (duration);
++ duration = icalduration_from_times (etime, stime);
++ appt->duration = icaldurationtype_as_seconds (duration);
+ return icaltime_compare (stime, etime);
+ }
+ }
+@@ -905,7 +905,7 @@
+ , icalproperty_new_repeat(appt->soundrepeat_cnt));
+ icalcomponent_add_property(ialarm
+ , icalproperty_new_duration(
+- icaldurationtype_from_int(appt->soundrepeat_len)));
++ icaldurationtype_from_seconds(appt->soundrepeat_len)));
+ }
+ icalattach_unref(attach);
+ }
+@@ -1005,9 +1005,9 @@
+ duration = appt->alarmtime;
+ trg.time = icaltime_null_time();
+ if (appt->alarm_before)
+- trg.duration = icaldurationtype_from_int(-duration);
++ trg.duration = icaldurationtype_from_seconds(-duration);
+ else /* alarm happens after */
+- trg.duration = icaldurationtype_from_int(duration);
++ trg.duration = icaldurationtype_from_seconds(duration);
+
+ /********** DISPLAY **********/
+ if (appt->display_alarm_orage || appt->display_alarm_notify) {
+@@ -1080,7 +1080,7 @@
+ icalcomponent *icmp)
+ {
+ gchar recur_str[1001], *recur_p, *recur_p2;
+- struct icalrecurrencetype rrule;
++ orage_rrule rrule;
+ struct icaltimetype wtime;
+ gchar *byday_a[] = {"MO", "TU", "WE", "TH", "FR", "SA", "SU"};
+ const char *text;
+@@ -1115,7 +1115,6 @@
+ break;
+ default:
+ g_warning ("%s: Unsupported freq", G_STRFUNC);
+- icalrecurrencetype_clear(&rrule);
+ }
+ if (add_interval) { /* not default, need to insert it */
+ recur_p += g_sprintf(recur_p, ";INTERVAL=%d", appt->interval);
+@@ -1220,8 +1219,9 @@
+ break;
+ }
+
+- rrule = icalrecurrencetype_from_string(recur_str);
++ rrule = ORAGE_RRULE_FROM_STRING(recur_str);
+ icalcomponent_add_property(icmp, icalproperty_new_rrule(rrule));
++ ORAGE_RRULE_UNREF(rrule);
+ if (appt->type == XFICAL_TYPE_TODO) {
+ if (appt->recur_todo_base_start)
+ icalcomponent_add_property(icmp
+@@ -1282,7 +1282,7 @@
+ }
+ else if (appt->use_duration) {
+ /* both event and todo can have duration */
+- duration = icaldurationtype_from_int(appt->duration);
++ duration = icaldurationtype_from_seconds(appt->duration);
+ icalcomponent_add_property(icmp
+ , icalproperty_new_duration(duration));
+ }
+@@ -1293,8 +1293,8 @@
+ /* need to add 1 day. For example:
+ * DTSTART=20070221 & DTEND=20070223
+ * means only 21 and 22 February */
+- duration = icaldurationtype_from_int(60*60*24);
+- wtime = icaltime_add(wtime, duration);
++ duration = icaldurationtype_from_seconds(60*60*24);
++ wtime = icalduration_extend(wtime, duration);
+ }
+ else if ORAGE_STR_EXISTS(appt->end_tz_loc) {
+ /* Null == floating => no special action needed */
+@@ -1490,7 +1490,7 @@
+ if (p) {
+ trg = icalproperty_get_trigger(p);
+ if (icaltime_is_null_time(trg.time)) {
+- appt->alarmtime = icaldurationtype_as_int(trg.duration);
++ appt->alarmtime = icaldurationtype_as_seconds(trg.duration);
+ if (appt->alarmtime < 0) { /* before */
+ appt->alarmtime *= -1;
+ appt->alarm_before = TRUE;
+@@ -1599,7 +1599,7 @@
+ p = icalcomponent_get_first_property(ca, ICAL_DURATION_PROPERTY);
+ if (p) {
+ duration = icalproperty_get_duration(p);
+- appt->soundrepeat_len = icaldurationtype_as_int(duration);
++ appt->soundrepeat_len = icaldurationtype_as_seconds(duration);
+ }
+ }
+ }
+@@ -1733,13 +1733,15 @@
+ xfical_appt *appt,
+ icalproperty *p)
+ {
+- struct icalrecurrencetype rrule;
+- int i, cnt, day;
++ orage_rrule rrule;
++ const struct icalrecurrencetype *rp;
++ int i, cnt, day, by_day_cnt;
+ GDateTime *gdt;
+ gint month_day;
+
+ rrule = icalproperty_get_rrule(p);
+- switch (rrule.freq) {
++ rp = ORAGE_RRULE_PTR(rrule);
++ switch (rp->freq) {
+ case ICAL_DAILY_RECURRENCE:
+ appt->freq = XFICAL_FREQ_DAILY;
+ break;
+@@ -1748,9 +1750,9 @@
+ break;
+ case ICAL_MONTHLY_RECURRENCE:
+ appt->freq = XFICAL_FREQ_MONTHLY;
+- month_day = rrule.by_month_day[0];
+- if (month_day != ICAL_RECURRENCE_ARRAY_MAX)
++ if (orage_rrule_by_size (rp, ORAGE_RRULE_BY_MONTH_DAY) > 0)
+ {
++ month_day = orage_rrule_by (rp, ORAGE_RRULE_BY_MONTH_DAY, 0);
+ if (month_day > 0)
+ {
+ appt->recur_month_type = XFICAL_RECUR_MONTH_TYPE_BEGIN;
+@@ -1762,16 +1764,18 @@
+ appt->recur_month_days = -1 * month_day;
+ }
+ }
+- else if (rrule.by_day[0] != ICAL_RECURRENCE_ARRAY_MAX)
++ else if (orage_rrule_by_size (rp, ORAGE_RRULE_BY_DAY) > 0)
+ {
++ const short by_day = orage_rrule_by (rp, ORAGE_RRULE_BY_DAY, 0);
++
+ appt->recur_month_type = XFICAL_RECUR_MONTH_TYPE_EVERY;
+
+- cnt = icalrecurrencetype_day_position (rrule.by_day[0]);
++ cnt = icalrecurrencetype_day_position (by_day);
+
+ appt->recur_week_sel =
+ cnt < 0 ? XFICAL_RECUR_MONTH_WEEK_LAST : cnt - 1;
+ appt->recur_day_sel =
+- orage_recurrence_type_to_day_of_week (rrule.by_day[0]);
++ orage_recurrence_type_to_day_of_week (by_day);
+ }
+ else
+ g_critical ("%s: unknown weekday for %s", G_STRFUNC, appt->uid);
+@@ -1780,14 +1784,23 @@
+ case ICAL_YEARLY_RECURRENCE:
+ appt->freq = XFICAL_FREQ_YEARLY;
+
+- cnt = icalrecurrencetype_day_position (rrule.by_day[0]);
++ if (orage_rrule_by_size (rp, ORAGE_RRULE_BY_DAY) > 0)
++ {
++ const short by_day = orage_rrule_by (rp, ORAGE_RRULE_BY_DAY, 0);
++
++ cnt = icalrecurrencetype_day_position (by_day);
+
+- appt->recur_week_sel =
+- cnt < 0 ? XFICAL_RECUR_MONTH_WEEK_LAST : cnt - 1;
+- appt->recur_day_sel =
+- orage_recurrence_type_to_day_of_week (rrule.by_day[0]);
+- appt->recur_month_sel =
+- icalrecurrencetype_month_month (rrule.by_month[0]) - 1;
++ appt->recur_week_sel =
++ cnt < 0 ? XFICAL_RECUR_MONTH_WEEK_LAST : cnt - 1;
++ appt->recur_day_sel =
++ orage_recurrence_type_to_day_of_week (by_day);
++ }
++
++ if (orage_rrule_by_size (rp, ORAGE_RRULE_BY_MONTH) > 0)
++ {
++ appt->recur_month_sel = icalrecurrencetype_month_month (
++ orage_rrule_by (rp, ORAGE_RRULE_BY_MONTH, 0)) - 1;
++ }
+ break;
+ case ICAL_HOURLY_RECURRENCE:
+ appt->freq = XFICAL_FREQ_HOURLY;
+@@ -1796,12 +1809,12 @@
+ appt->freq = XFICAL_FREQ_NONE;
+ break;
+ }
+- if ((appt->recur_count = rrule.count))
++ if ((appt->recur_count = rp->count))
+ appt->recur_limit = XFICAL_RECUR_COUNT;
+- else if(! icaltime_is_null_time(rrule.until)) {
++ else if(! icaltime_is_null_time(rp->until)) {
+ const char *text;
+
+- text = icaltime_as_ical_string (rrule.until);
++ text = icaltime_as_ical_string (rp->until);
+ gdt = orage_icaltime_to_gdatetime (text);
+ if (gdt)
+ {
+@@ -1812,12 +1825,15 @@
+ else
+ appt->recur_limit = XFICAL_RECUR_NO_LIMIT;
+ }
+- if (rrule.by_day[0] != ICAL_RECURRENCE_ARRAY_MAX) {
++ by_day_cnt = orage_rrule_by_size (rp, ORAGE_RRULE_BY_DAY);
++ if (by_day_cnt > 0) {
+ for (i=0; i <= 6; i++)
+ appt->recur_byday[i] = FALSE;
+- for (i=0; i <= 6 && rrule.by_day[i] != ICAL_RECURRENCE_ARRAY_MAX; i++) {
+- cnt = (int)floor((double)(rrule.by_day[i]/8));
+- day = abs(rrule.by_day[i]-8*cnt);
++ for (i=0; i <= 6 && i < by_day_cnt; i++) {
++ const short by_day = orage_rrule_by (rp, ORAGE_RRULE_BY_DAY, i);
++
++ cnt = (int)floor((double)(by_day/8));
++ day = abs(by_day-8*cnt);
+ switch (day) {
+ case ICAL_MONDAY_WEEKDAY:
+ appt->recur_byday[0] = TRUE;
+@@ -1844,12 +1860,12 @@
+ break;
+ default:
+ g_critical ("%s: unknown weekday %s: %d/%d (%x)", G_STRFUNC,
+- appt->uid, rrule.by_day[i], i, rrule.by_day[i]);
++ appt->uid, by_day, i, by_day);
+ break;
+ }
+ }
+ }
+- appt->interval = rrule.interval;
++ appt->interval = rp->interval;
+ }
+
+ static void appt_init(xfical_appt *appt)
+@@ -1980,7 +1996,7 @@
+ appt->use_duration = TRUE;
+ appt->use_due_time = TRUE;
+ duration = icalproperty_get_duration(p);
+- appt->duration = icaldurationtype_as_int(duration);
++ appt->duration = icaldurationtype_as_seconds(duration);
+ break;
+ case ICAL_RRULE_PROPERTY:
+ ical_appt_get_rrule_internal(c, appt, p);
+@@ -2086,22 +2102,22 @@
+
+ /* need to set missing endtime or duration */
+ if (appt->use_duration) {
+- etime = icaltime_add(stime, duration);
++ etime = icalduration_extend(stime, duration);
+ text = icaltime_as_ical_string(etime);
+ orage_gdatetime_unref (appt->endtime);
+ appt->endtime = orage_icaltime_to_gdatetime (text);
+ appt->end_tz_loc = appt->start_tz_loc;
+ }
+ else {
+- duration = icaltime_subtract(eltime, sltime);
+- appt->duration = icaldurationtype_as_int(duration);
++ duration = icalduration_from_times(eltime, sltime);
++ appt->duration = icaldurationtype_as_seconds(duration);
+ if (appt->allDay && appt->duration) {
+ /* need to subtract 1 day.
+ * read explanation from appt_add_internal: appt.endtime processing */
+- duration_tmp = icaldurationtype_from_int(60*60*24);
+- appt->duration -= icaldurationtype_as_int(duration_tmp);
+- duration = icaldurationtype_from_int(appt->duration);
+- etime = icaltime_add(stime, duration);
++ duration_tmp = icaldurationtype_from_seconds(60*60*24);
++ appt->duration -= icaldurationtype_as_seconds(duration_tmp);
++ duration = icaldurationtype_from_seconds(appt->duration);
++ etime = icalduration_extend(stime, duration);
+ text = icaltime_as_ical_string(etime);
+ orage_gdatetime_unref (appt->endtime);
+ appt->endtime = orage_icaltime_to_gdatetime (text);
+@@ -2397,7 +2413,7 @@
+ text = (char *)icalproperty_get_value_as_string(p);
+ if (!strcmp(text, "COMPLETED")) {/* use completed time */
+ per->stime = per->ctime;
+- per->etime = icaltime_add(per->stime, per->duration);
++ per->etime = icalduration_extend(per->stime, per->duration);
+ }
+ break; /* for loop done */
+ }
+@@ -2433,9 +2449,9 @@
+ }
+ }
+ if (rel == ICAL_RELATED_END)
+- alarm_time = icaltime_add(per.etime, dur);
++ alarm_time = icalduration_extend(per.etime, dur);
+ else /* default is ICAL_RELATED_START */
+- alarm_time = icaltime_add(per.stime, dur);
++ alarm_time = icalduration_extend(per.stime, dur);
+ return(alarm_time);
+ }
+
+@@ -2455,7 +2471,7 @@
+ start_time.minute = 0;
+ start_time.second = 0;
+ }
+- alarm_time = icaltime_add(start_time, dur);
++ alarm_time = icalduration_extend(start_time, dur);
+ return(alarm_time);
+ }
+
+@@ -2557,7 +2573,7 @@
+ struct icaltriggertype trg;
+ icalparameter *trg_related_par;
+ icalparameter_related rel;
+- struct icalrecurrencetype rrule;
++ orage_rrule rrule;
+ icalrecur_iterator* ri;
+ xfical_period per;
+ struct icaltimetype next_alarm_time, next_start_time, next_end_time,
+@@ -2585,7 +2601,7 @@
+ rel = ICAL_RELATED_START;
+ per = ic_get_period(c, TRUE);
+ next_alarm_time = count_first_alarm_time(per, trg.duration, rel);
+- alarm_start_diff = icaltime_subtract(next_alarm_time, per.stime);
++ alarm_start_diff = icalduration_from_times(next_alarm_time, per.stime);
+ /* Due to the hack in date time calculation in count_first_alarm_time,
+ we need to set next_alarm_time to local timezone so that
+ icaltime_compare works. Fix for Bug 8525
+@@ -2628,7 +2644,7 @@
+ rrule = icalproperty_get_rrule(p);
+ set_todo_times(c, &per); /* may change per.stime to be per.ctime */
+ next_alarm_time = count_first_alarm_time(per, trg.duration, rel);
+- alarm_start_diff = icaltime_subtract(next_alarm_time, per.stime);
++ alarm_start_diff = icalduration_from_times(next_alarm_time, per.stime);
+ ri = icalrecur_iterator_new(rrule, per.stime);
+ for (next_start_time = icalrecur_iterator_next(ri),
+ next_alarm_time = count_next_alarm_time(next_start_time
+@@ -2706,7 +2722,7 @@
+ }
+
+ /* we still need to convert it from start time to alarm time */
+- rdate_alarm_time = icaltime_add(rdate_period.time, alarm_start_diff);
++ rdate_alarm_time = icalduration_extend(rdate_period.time, alarm_start_diff);
+ if (icaltime_compare(cur_time, rdate_alarm_time) <= 0) {
+ /* this alarm is still active */
+ /* save the iterator since excluded check changes it */
+@@ -2754,8 +2770,8 @@
+ else
+ alarm_start_diff.is_neg = 1;
+
+- next_start_time = icaltime_add(next_alarm_time, alarm_start_diff);
+- next_end_time = icaltime_add(next_start_time, per.duration);
++ next_start_time = icalduration_extend(next_alarm_time, alarm_start_diff);
++ next_end_time = icalduration_extend(next_start_time, per.duration);
+ tmp1 = icaltime_to_i18_time (
+ icaltime_as_ical_string(next_start_time));
+ tmp2 = icaltime_to_i18_time (
+@@ -2869,7 +2885,7 @@
+ p = icalcomponent_get_first_property(ca, ICAL_DURATION_PROPERTY);
+ if (p) {
+ duration = icalproperty_get_duration(p);
+- new_alarm->repeat_delay = icaldurationtype_as_int(duration);
++ new_alarm->repeat_delay = icaldurationtype_as_seconds(duration);
+ }
+ }
+ else if (act == ICAL_ACTION_PROCEDURE) {
+@@ -3035,7 +3051,7 @@
+ gboolean recurrent_date_found=FALSE;
+ char *uid;
+ xfical_appt *appt;
+- struct icalrecurrencetype rrule;
++ orage_rrule rrule;
+ icalrecur_iterator* ri;
+ icalcomponent_kind ikind = ICAL_VEVENT_COMPONENT;
+ const gchar *start_str;
+@@ -3090,7 +3106,7 @@
+ rrule = icalproperty_get_rrule(p);
+ ri = icalrecur_iterator_new(rrule, per.stime);
+ for (nsdate = icalrecur_iterator_next(ri),
+- nedate = icaltime_add(nsdate, per.duration);
++ nedate = icalduration_extend(nsdate, per.duration);
+ !icaltime_is_null_time(nsdate)
+ && ((type == XFICAL_TYPE_TODO
+ && local_compare(nsdate, per.ctime) <= 0)
+@@ -3099,7 +3115,7 @@
+ || icalproperty_recurrence_is_excluded(c
+ , &per.stime, &nsdate));
+ nsdate = icalrecur_iterator_next(ri),
+- nedate = icaltime_add(nsdate, per.duration)) {}
++ nedate = icalduration_extend(nsdate, per.duration)) {}
+ icalrecur_iterator_free(ri);
+ if (type == XFICAL_TYPE_TODO) {
+ if (!icaltime_is_null_time(nsdate)) {
+@@ -3225,7 +3241,7 @@
+ /* note that this not understand timezones, but gets always raw time,
+ * which we need to convert to correct timezone */
+ static void mark_calendar (G_GNUC_UNUSED icalcomponent *c,
+- icaltime_span *span,
++ ORAGE_ICAL_SPAN_CONST icaltime_span *span,
+ void *data)
+ {
+ struct icaltimetype sdate, edate;
+@@ -3293,7 +3309,7 @@
+ {
+ xfical_period per;
+ struct icaltimetype nsdate, nedate;
+- struct icalrecurrencetype rrule;
++ orage_rrule rrule;
+ icalrecur_iterator* ri;
+ icalproperty *p = NULL;
+ gboolean marked;
+@@ -3358,11 +3374,11 @@
+ rrule = icalproperty_get_rrule(p);
+ ri = icalrecur_iterator_new(rrule, per.stime);
+ for (nsdate = icalrecur_iterator_next(ri),
+- nedate = icaltime_add(nsdate, per.duration);
++ nedate = icalduration_extend(nsdate, per.duration);
+ !icaltime_is_null_time(nsdate)
+ && (nsdate.year*12+nsdate.month) <= (int)(year*12+month);
+ nsdate = icalrecur_iterator_next(ri),
+- nedate = icaltime_add(nsdate, per.duration)) {
++ nedate = icalduration_extend(nsdate, per.duration)) {
+ if (!icalproperty_recurrence_is_excluded(c, &per.stime
+ , &nsdate))
+ (void)xfical_mark_calendar_days (gtkcal, year, month,
+@@ -3407,7 +3423,7 @@
+ }
+ icalrecur_iterator_free(ri);
+ if (!icaltime_is_null_time(nsdate)) {
+- nedate = icaltime_add(nsdate, per.duration);
++ nedate = icalduration_extend(nsdate, per.duration);
+ (void)xfical_mark_calendar_days (gtkcal, year, month,
+ nedate.year, nedate.month,
+ nedate.day, nedate.year,
+@@ -3475,7 +3491,9 @@
+
+ /* note that this not understand timezones, but gets always raw time,
+ * which we need to convert to correct timezone */
+-static void add_appt_to_list(icalcomponent *c, icaltime_span *span , void *data)
++static void add_appt_to_list(icalcomponent *c,
++ ORAGE_ICAL_SPAN_CONST icaltime_span *span,
++ void *data)
+ {
+ xfical_appt *appt;
+ struct icaltimetype sdate, edate;
+@@ -3620,7 +3638,7 @@
+ data1.orig_start_hour = start.hour;
+ /* FIXME: hack to fix year to be newer than 1970 based on BUG 9507 */
+ if (start.year < 1970) {
+- c2 = icalcomponent_new_clone(c);
++ c2 = icalcomponent_clone(c);
+ p = icalcomponent_get_first_property(c2, ICAL_DTSTART_PROPERTY);
+ start = icalproperty_get_dtstart(p);
+ g_debug ("%s: Adjusting temporarily old DTSTART time %d", G_STRFUNC,
+diff -urN --no-dereference orage-4.20.3.orig/src/ical-expimp.c orage-4.20.3/src/ical-expimp.c
+--- orage-4.20.3.orig/src/ical-expimp.c 2026-03-27 08:15:22.000000000 +0100
++++ orage-4.20.3/src/ical-expimp.c 2026-08-22 16:24:38.927254313 +0200
+@@ -71,7 +71,7 @@
+ icalcomponent *ca;
+ char *uid;
+
+- ca = icalcomponent_new_clone(c);
++ ca = icalcomponent_clone(c);
+ if (icalcomponent_get_uid(ca) == NULL) {
+ uid = ic_generate_uid();
+ icalcomponent_add_property(ca, icalproperty_new_uid(uid));
+@@ -327,7 +327,7 @@
+ c = icalcomponent_get_next_component(base, ICAL_ANY_COMPONENT)) {
+ uid_ical = (char *)icalcomponent_get_uid(c);
+ if (strcmp(uid_int, uid_ical) == 0) { /* we found our uid */
+- d = icalcomponent_new_clone(c);
++ d = icalcomponent_clone(c);
+ icalcomponent_add_component(x_ical, d);
+ key_found = TRUE;
+ }
+diff -urN --no-dereference orage-4.20.3.orig/src/ical-internal.h orage-4.20.3/src/ical-internal.h
+--- orage-4.20.3.orig/src/ical-internal.h 2026-03-27 08:15:22.000000000 +0100
++++ orage-4.20.3/src/ical-internal.h 2026-08-22 16:26:27.907811916 +0200
+@@ -23,6 +23,130 @@
+ #ifndef __ICAL_INTERNAL_H__
+ #define __ICAL_INTERNAL_H__
+
++/* libical 4.0 renamed several calls and turned icalrecurrencetype into a
++ * refcounted object whose BY parts are sized vectors instead of fixed arrays
++ * terminated by ICAL_RECURRENCE_ARRAY_MAX. Orage still supports libical 3.0,
++ * so both spellings are needed. */
++#if ICAL_CHECK_VERSION(4, 0, 0)
++
++typedef struct icalrecurrencetype *orage_rrule;
++
++#define ORAGE_RRULE_PTR(rrule) (rrule)
++#define ORAGE_RRULE_FROM_STRING(str) icalrecurrencetype_new_from_string (str)
++/* icalproperty_new_rrule() takes a reference of its own. */
++#define ORAGE_RRULE_UNREF(rrule) icalrecurrencetype_unref (rrule)
++
++#else
++
++typedef struct icalrecurrencetype orage_rrule;
++
++#define ORAGE_RRULE_PTR(rrule) (&(rrule))
++#define ORAGE_RRULE_FROM_STRING(str) icalrecurrencetype_from_string (str)
++#define ORAGE_RRULE_UNREF(rrule) ((void)0)
++
++#define icalcomponent_clone icalcomponent_new_clone
++#define icaldurationtype_as_seconds icaldurationtype_as_int
++#define icaldurationtype_from_seconds icaldurationtype_from_int
++#define icalduration_extend icaltime_add
++#define icalduration_from_times icaltime_subtract
++
++#endif
++
++/* libical 4.0 const-qualified the span handed to the
++ * icalcomponent_foreach_recurrence() callback. */
++#if ICAL_CHECK_VERSION(4, 0, 0)
++#define ORAGE_ICAL_SPAN_CONST const
++#else
++#define ORAGE_ICAL_SPAN_CONST
++#endif
++
++typedef enum
++{
++ ORAGE_RRULE_BY_MONTH,
++ ORAGE_RRULE_BY_MONTH_DAY,
++ ORAGE_RRULE_BY_DAY
++} orage_rrule_by_part;
++
++#if ICAL_CHECK_VERSION(4, 0, 0)
++
++static inline icalrecurrencetype_byrule orage_rrule_byrule (
++ orage_rrule_by_part part)
++{
++ switch (part)
++ {
++ case ORAGE_RRULE_BY_MONTH: return ICAL_BY_MONTH;
++ case ORAGE_RRULE_BY_MONTH_DAY: return ICAL_BY_MONTH_DAY;
++ case ORAGE_RRULE_BY_DAY: return ICAL_BY_DAY;
++ default: return ICAL_BYRULE_NO_CONTRACTION;
++ }
++}
++
++static inline int orage_rrule_by_size (const struct icalrecurrencetype *rrule,
++ orage_rrule_by_part part)
++{
++ const icalrecurrencetype_byrule byrule = orage_rrule_byrule (part);
++
++ return (byrule == ICAL_BYRULE_NO_CONTRACTION) ? 0 : rrule->by[byrule].size;
++}
++
++static inline short orage_rrule_by (const struct icalrecurrencetype *rrule,
++ orage_rrule_by_part part, int i)
++{
++ const icalrecurrencetype_byrule byrule = orage_rrule_byrule (part);
++
++ return (byrule == ICAL_BYRULE_NO_CONTRACTION)
++ ? 0 : rrule->by[byrule].data[i];
++}
++
++#else
++
++static inline const short *orage_rrule_by_array (
++ const struct icalrecurrencetype *rrule, orage_rrule_by_part part,
++ int *size)
++{
++ switch (part)
++ {
++ case ORAGE_RRULE_BY_MONTH:
++ *size = ICAL_BY_MONTH_SIZE;
++ return rrule->by_month;
++
++ case ORAGE_RRULE_BY_MONTH_DAY:
++ *size = ICAL_BY_MONTHDAY_SIZE;
++ return rrule->by_month_day;
++
++ case ORAGE_RRULE_BY_DAY:
++ *size = ICAL_BY_DAY_SIZE;
++ return rrule->by_day;
++
++ default:
++ *size = 0;
++ return NULL;
++ }
++}
++
++static inline int orage_rrule_by_size (const struct icalrecurrencetype *rrule,
++ orage_rrule_by_part part)
++{
++ int size, i;
++ const short *by = orage_rrule_by_array (rrule, part, &size);
++
++ for (i = 0; i < size && by[i] != ICAL_RECURRENCE_ARRAY_MAX; i++)
++ ;
++
++ return i;
++}
++
++static inline short orage_rrule_by (const struct icalrecurrencetype *rrule,
++ orage_rrule_by_part part, int i)
++{
++ int size;
++ const short *by = orage_rrule_by_array (rrule, part, &size);
++
++ return (by == NULL) ? 0 : by[i];
++}
++
++#endif
++
+ typedef struct
+ {
+ struct icaltimetype stime; /* start time */
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/orage.git/commitdiff/ba168487b62142c33e576f5683f50392495472c5
More information about the pld-cvs-commit
mailing list