public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/gnokii] rawhide: Fix build with libical 4
@ 2026-11-03 22:16 Michel Lind
  0 siblings, 0 replies; only message in thread
From: Michel Lind @ 2026-11-03 22:16 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/gnokii
            Branch : rawhide
            Commit : 0d0843a07c42c3bd12e233536c81363459b87409
            Author : Michel Lind <salimma@fedoraproject.org>
            Date   : 2026-11-03T22:14:35+00:00
            Stats  : +90/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/gnokii/c/0d0843a07c42c3bd12e233536c81363459b87409?branch=rawhide

            Log:
            Fix build with libical 4

libical 4 changed the APIs gnokii's vCalendar code uses:

- icalrecurrencetype_from_string() was replaced by the reference
  counted icalrecurrencetype_new_from_string(); the RRULE property
  takes its own reference, so drop ours after adding it
- icalproperty_get_rrule() now returns a pointer owned by the property
  instead of a struct
- icaltime_add() was renamed to icalduration_extend()
- icalcomponent_vanew() is now marked as needing a NULL sentinel;
  the plain 0 terminators are not safe for a variadic pointer list
  on 64-bit platforms

The changes are conditional on ICAL_MAJOR_VERSION >= 4, so it still
builds with libical 3. Not upstreamed: upstream is dead (no release
since 2011).

Tested with local mock builds (rawhide, aarch64, --postinst): 0.6.31-48
fails in common/vcal.c against libical 4.0.7 from
f46-build-side-158330; 0.6.31-49 builds and installs against both
stock libical 3 and libical 4.0.7, with the same compiler warnings as
0.6.31-48 against libical 3.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Michel Lind <salimma@fedoraproject.org>

---
diff --git a/gnokii-0.6.31-libical4.patch b/gnokii-0.6.31-libical4.patch
new file mode 100644
index 0000000..dfdbc35
--- /dev/null
+++ b/gnokii-0.6.31-libical4.patch
@@ -0,0 +1,81 @@
+--- a/common/vcal.c
++++ b/common/vcal.c
+@@ -136,7 +136,7 @@
+ 	vevent = icalcomponent_vanew(ICAL_VEVENT_COMPONENT,
+ 				     icalproperty_new_uid(compuid),
+ 				     icalproperty_new_categories("GNOKII"),
+-				     0);
++				     NULL);
+ 	if (!vevent) {
+ 		dprintf("ERROR in icalcomponent_vanew() creating VEVENT\n");
+ 		return NULL;
+@@ -224,7 +224,19 @@
+ 			snprintf(rrule, sizeof(rrule), "FREQ=%s;INTERVAL=%d", freq, interval);
+ 		else
+ 			snprintf(rrule, sizeof(rrule), "FREQ=%s;COUNT=%d;INTERVAL=%d", freq, calnote->occurrences, interval);
++#if ICAL_MAJOR_VERSION >= 4
++		{
++			/* the property takes its own reference */
++			struct icalrecurrencetype *recur = icalrecurrencetype_new_from_string(rrule);
++
++			if (recur) {
++				icalcomponent_add_property(vevent, icalproperty_new_rrule(recur));
++				icalrecurrencetype_unref(recur);
++			}
++		}
++#else
+ 		icalcomponent_add_property(vevent, icalproperty_new_rrule(icalrecurrencetype_from_string(rrule)));
++#endif
+ 	}
+ norecurrence:
+ 
+@@ -258,7 +270,7 @@
+ 				    icalproperty_new_version("2.0"),
+ 				    icalproperty_new_prodid(get_prodid()),
+ 				    vevent,
+-				    0);
++				    NULL);
+ 
+ 	if (pIcal) {
+ 		char *icalstrbuf = NULL;
+@@ -495,7 +507,11 @@
+ 					}
+ 					if (!(icaldurationtype_is_bad_duration(trigger_value.duration) ||
+ 							icaldurationtype_is_null_duration(trigger_value.duration))) {
++#if ICAL_MAJOR_VERSION >= 4
++						alarm_start = icalduration_extend(alarm_start, trigger_value.duration);
++#else
+ 						alarm_start = icaltime_add(alarm_start, trigger_value.duration);
++#endif
+ 					}
+ 					calnote->alarm.enabled = 1;
+ 					calnote->alarm.timestamp.year = alarm_start.year;
+@@ -514,8 +530,17 @@
+ 
+ 		/* recurrence */
+ 		rrule = icalcomponent_get_first_property(compresult, ICAL_RRULE_PROPERTY);
++#if ICAL_MAJOR_VERSION >= 4
++		if (rrule && !icalproperty_get_rrule(rrule))
++			rrule = NULL;
++#endif
+ 		if (rrule) {
++#if ICAL_MAJOR_VERSION >= 4
++			/* borrowed from the property; only scalar fields are read */
++			recur = *icalproperty_get_rrule(rrule);
++#else
+ 			recur = icalproperty_get_rrule(rrule);
++#endif
+ 			calnote->occurrences = recur.count;
+ 			switch (recur.freq) {
+ 			case ICAL_SECONDLY_RECURRENCE:
+@@ -666,8 +691,8 @@
+ 							icalproperty_new_categories("GNOKII"),
+ 							icalproperty_new_priority(ctodo->priority),
+ 							icalproperty_new_summary(ctodo->text),
+-							0),
+-				    0);
++							NULL),
++				    NULL);
+ 
+ 	if (pIcal) {
+ 		char *icalstrbuf = NULL;

diff --git a/gnokii.spec b/gnokii.spec
index 7877610..3952afa 100644
--- a/gnokii.spec
+++ b/gnokii.spec
@@ -3,7 +3,7 @@
 
 Name:           gnokii
 Version:        0.6.31
-Release:        48%{?dist}
+Release:        49%{?dist}
 Summary:        Linux/Unix tool suite for various mobile phones
 
 License:        GPL-2.0-or-later
@@ -23,6 +23,10 @@ Patch2:         %{name}-0.6.31-sqlite3.patch
 Patch3:         %{name}-0.6.31-gcc5.patch
 Patch4:         %{name}-0.6.31-gcc7.patch
 Patch5: gnokii-configure-c99.patch
+# Build with libical 4 (renamed/refcounted recurrence and time APIs,
+# NULL sentinels for icalcomponent_vanew)
+# Not upstreamed: upstream is dead (no release since 2011, project site gone)
+Patch6:         %{name}-0.6.31-libical4.patch
 
 BuildRequires:  gcc
 BuildRequires:  flex
@@ -119,6 +123,7 @@ Requires:       pkgconfig
 %patch -P3 -p1
 %patch -P4 -p1
 %patch -P5 -p1
+%patch -P6 -p1
 install -pm 644 %{SOURCE5} smsd2mail.sh
 install -pm 644 %{SOURCE6} README.smsd2mail
 
@@ -253,6 +258,9 @@ install -m0644 -D gnokii-smsd.sysusers.conf %{buildroot}%{_sysusersdir}/gnokii-s
 %{_libdir}/pkgconfig/xgnokii.pc
 
 %changelog
+* Tue Nov 03 2026 Michel Lind <salimma@fedoraproject.org> - 0.6.31-49
+- Fix build with libical 4
+
 * Thu Jul 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.31-48
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-03 22:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-03 22:16 [rpms/gnokii] rawhide: Fix build with libical 4 Michel Lind

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox