Package: ical2html
Version: 2.1-1
Severity: normal
Tags: patch

Dear Maintainer,

Initial plans has been started for transitioning to libical 2.0.0
(currently stuck in NEW).

Your package fails to build from source with the new version.
Please see attached patches which are on top of the ical2html
git packaging repo. (Please replace the bug report number in the
first commit message with whatever number this bug report gets
and replace the third/last patch with a fresh "gbp dch --auto"
run.)

(See also #797074 if you're interested in current transition planning.)

Regards,
Andreas Henriksson
>From 2589e7ef569e5511a2df08b2ffaf681e7abd0c94 Mon Sep 17 00:00:00 2001
From: Andreas Henriksson <[email protected]>
Date: Mon, 25 Apr 2016 14:54:49 +0200
Subject: [PATCH 1/3] Add debian/patches/icalerror_errors_are_fatal.patch

- fixes build against libical >= 2.0.0

Git-Dch: Full
Closes: #-1
---
 debian/patches/icalerror_errors_are_fatal.patch | 48 +++++++++++++++++++++++++
 debian/patches/series                           |  1 +
 2 files changed, 49 insertions(+)
 create mode 100644 debian/patches/icalerror_errors_are_fatal.patch

diff --git a/debian/patches/icalerror_errors_are_fatal.patch b/debian/patches/icalerror_errors_are_fatal.patch
new file mode 100644
index 0000000..60dc962
--- /dev/null
+++ b/debian/patches/icalerror_errors_are_fatal.patch
@@ -0,0 +1,48 @@
+Fix build against libical 2.0.0
+
+Global variable was changed to a setter/getter function, also use
+helper to clear errno everywhere.
+
+See https://github.com/libical/libical/commit/6e5534a979b3ab4d28e5a3
+
+This breaks building on libical < 2.0.0 as the ICAL_CHECK_VERSION
+was not included in the 2.0.0 release. Maybe it can be used in
+the future.
+
+--- a/ical2html.c
++++ b/ical2html.c
+@@ -474,7 +474,7 @@
+   int starts_on_monday = 0;
+ 
+   /* We handle errors ourselves */
+-  icalerror_errors_are_fatal = 0;
++  icalerror_set_errors_are_fatal(0);
+   icalerror_clear_errno();
+ 
+   /* icaltimezone_set_tzid_prefix("/kde.org/Olson_20080523_1/"); */
+--- a/icalfilter.c
++++ b/icalfilter.c
+@@ -97,8 +97,8 @@
+   icalproperty *p;
+ 
+   /* We handle errors ourselves */
+-  icalerror_errors_are_fatal = 0;
+-  icalerrno = 0;
++  icalerror_set_errors_are_fatal(0);
++  icalerror_clear_errno();
+ 
+   /* Read commandline */
+   while ((c = getopt_long(argc, argv, OPTIONS, options, NULL)) != -1) {
+--- a/icalmerge.c
++++ b/icalmerge.c
+@@ -258,8 +258,8 @@
+   icalcomponent *newset;
+ 
+   /* We handle errors ourselves */
+-  icalerror_errors_are_fatal = 0;
+-  icalerrno = 0;
++  icalerror_set_errors_are_fatal(0);
++  icalerror_clear_errno();
+ 
+   /* Read commandline */
+   while ((c = getopt_long(argc, argv, OPTIONS, options, NULL)) != -1) {
diff --git a/debian/patches/series b/debian/patches/series
index 5519355..894d2d2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 1001_week_starts_monday.patch
+icalerror_errors_are_fatal.patch
-- 
2.8.0.rc3

>From ff6fbf71c1976b1b9be5d31bdcc64406aa03c116 Mon Sep 17 00:00:00 2001
From: Andreas Henriksson <[email protected]>
Date: Mon, 25 Apr 2016 14:55:31 +0200
Subject: [PATCH 2/3] debian/rules: bump libical-dev build-dependency to >=
 2.0.0

- see previously added patch header.

Git-Dch: Full
---
 debian/control | 2 +-
 debian/rules   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/debian/control b/debian/control
index bb02a15..3e1e6bf 100644
--- a/debian/control
+++ b/debian/control
@@ -9,7 +9,7 @@ Build-Depends: cdbs (>= 0.4.123~),
  autoconf,
  debhelper,
  dh-buildinfo,
- libical-dev,
+ libical-dev (>= 2.0.0),
  help2man
 Vcs-Git: git://git.debian.org/git/collab-maint/ical2html.git
 Vcs-Browser: http://git.debian.org/?p=collab-maint/ical2html.git
diff --git a/debian/rules b/debian/rules
index c5abf4f..737e32a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -37,7 +37,7 @@ DEB_UPSTREAM_TARBALL_MD5 = bf0bb0e590aef266694b66a741d86191
 CDBS_BUILD_DEPENDS_rules_debhelper_v9 = debhelper
 
 # Needed by upstream build process
-CDBS_BUILD_DEPENDS += , libical-dev
+CDBS_BUILD_DEPENDS += , libical-dev (>= 2.0.0)
 
 DEB_UPSTREAM_CRUFT_MOVE = Makefile.in aclocal.m4 missing depcomp install-sh configure config.h.in
 
-- 
2.8.0.rc3

>From 5f918eea2a1befc5cc1a77302436fe8c299902c6 Mon Sep 17 00:00:00 2001
From: Andreas Henriksson <[email protected]>
Date: Mon, 25 Apr 2016 14:57:07 +0200
Subject: [PATCH 3/3] Update debian/changelog

---
 debian/changelog | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 779fb1a..9c77356 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,14 @@
+ical2html (2.1-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Add debian/patches/icalerror_errors_are_fatal.patch
+    - fixes build against libical >= 2.0.0
+    Closes: #-1
+  * debian/rules: bump libical-dev build-dependency to >= 2.0.0
+    - see previously added patch header.
+
+ -- Andreas Henriksson <[email protected]>  Mon, 25 Apr 2016 14:56:07 +0200
+
 ical2html (2.1-1) unstable; urgency=medium
 
   [ upstream ]
-- 
2.8.0.rc3

Reply via email to