On 2019/03/06 20:26, Mikolaj Kucharski wrote:
> Hi Frederic,
> 
> On Wed, Mar 06, 2019 at 08:22:37PM +0100, Frederic Culot wrote:
> > Hi Mikolaj,
> > 
> > and sorry for my late reply.
> > Unfortunately I do not have access to an OpenBSD box anymore, so I could
> > not give you any relevant feedback on your update, sorry for that.
> > I see I am still mentioned as the maitainer for calcurse, but I already
> > said to one of the previous committer that I was not the good person to
> > maintain this port, so it might be better to switch to a new maintainer.
> 
> Sure, no problem. I can remove you as a maintainer in my diff. New
> patch below without any maintainer.

I've committed the maintainer change, wantlib sync, https HOMEPAGE parts.

> My initial email with detailed information about calcurse update here:
> 
>       https://marc.info/?l=openbsd-ports&m=155136072617184&w=2

:: In terms of patches which are dropped:
:: 
:: - KEY_ENTER patch, upstream commit 6cd67311e30c2dc3c138f339b536679ad1a8d5f4
:: - DAY_HEADING_DEFAULT patch, upstream commit 
0bbe802002c660dd9d555d557ce8daa7c5d681b9
:: - calcurse-caldav already has `/usr/bin/env python3` shebang line
:: - notify.c patch, upstream commit 30f411257ad3bc233184c08b846a2980a9c5d1f0
:: - utils.c, upstream migrated functions from long to time_t

Now there is a mixture of long and time_t all over the place and I don't
have a warm fuzzy feeling that it's correct. It's a lot easier to spot
these problems now we're building with clang, and the compiler agrees
with me that there are problems (some of them new since the patched
4.3.0):


------
cc -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I..  
-DDOCDIR=\"/usr/local/share/doc/calcurse\" -I/usr/local/include -std=c99 
-pedantic -D_POSIX_C_SOURCE=200809L -O2 -pipe -Wall -MT day.o -MD -MP -MF 
.deps/day.Tpo -c -o day.o day.c
day.c:690:4: warning: incompatible pointer types passing 'time_t *' (aka 'long 
long *') to parameter of type 'long *' [-Wincompatible-pointer-types]
                        &until)
                        ^~~~~~
./calcurse.h:1206:37: note: passing argument to parameter here
long overflow_add(long, long, long *);
                                    ^
day.c:707:4: warning: incompatible pointer types passing 'time_t *' (aka 'long 
long *') to parameter of type 'long *' [-Wincompatible-pointer-types]
                        &until)
                        ^~~~~~
./calcurse.h:1206:37: note: passing argument to parameter here
long overflow_add(long, long, long *);
                                    ^
2 warnings generated.
------
cc -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I..  
-DDOCDIR=\"/usr/local/share/doc/calcurse\" -I/usr/local/include -std=c99 
-pedantic -D_POSIX_C_SOURCE=200809L -O2 -pipe -Wall -MT utils.o -MD -MP -MF 
.deps/utils.Tpo -c -o utils.o utils.c
utils.c:1030:30: warning: incompatible pointer types passing 'time_t *' (aka 
'long long *') to parameter of type 'long *' [-Wincompatible-pointer-types]
                if (overflow_add(start, p, &start))
                                           ^~~~~~
./calcurse.h:1206:37: note: passing argument to parameter here
long overflow_add(long, long, long *);
                                    ^
utils.c:1253:30: warning: incompatible pointer types passing 'time_t *' (aka 
'long long *') to parameter of type 'long *' [-Wincompatible-pointer-types]
                if (overflow_add(*ts, dur, &sec))
                                           ^~~~
./calcurse.h:1206:37: note: passing argument to parameter here
long overflow_add(long, long, long *);
                                    ^
2 warnings generated.
------


The portable way to fix this is to use time_t for time values everywhere
and when printing with printf, use a long long format, and cast the
variable to 64-bit. e.g. << printf("%lld", (long long)timevar); >>

It needs testing with use of as many features as possible on a 32-bit
arch with 64-bit time_t (OpenBSD and afaik NetBSD do for all arches -
most other OS still use 32-bit time_t for i386 even if they have 64-bit
for newer arches like arm).

Here's the diff to bring back your update on top of what I already
committed.



Index: Makefile
===================================================================
RCS file: /cvs/ports/productivity/calcurse/Makefile,v
retrieving revision 1.28
diff -u -p -r1.28 Makefile
--- Makefile    6 Mar 2019 21:24:37 -0000       1.28
+++ Makefile    6 Mar 2019 21:29:14 -0000
@@ -1,9 +1,8 @@
 # $OpenBSD: Makefile,v 1.28 2019/03/06 21:24:37 sthen Exp $
 
 COMMENT=       text-based calendar and scheduling application
 
-DISTNAME=      calcurse-4.3.0
-REVISION=      3
+DISTNAME=      calcurse-4.4.0
 EPOCH=         0
 
 CATEGORIES=    productivity
@@ -27,5 +26,7 @@ MODPY_VERSION=        ${MODPY_DEFAULT_VERSION_3
 
 CONFIGURE_STYLE=gnu
 CONFIGURE_ARGS=        --without-asciidoc
+
+USE_GMAKE=     Yes
 
 .include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/productivity/calcurse/distinfo,v
retrieving revision 1.18
diff -u -p -r1.18 distinfo
--- distinfo    12 Nov 2017 14:01:26 -0000      1.18
+++ distinfo    6 Mar 2019 21:29:14 -0000
@@ -1,2 +1,2 @@
-SHA256 (calcurse-4.3.0.tar.gz) = MezD3Anh5WFQK0yU+WXtaxZ8A+lBhDjEp61brSx4X5o=
-SIZE (calcurse-4.3.0.tar.gz) = 597490
+SHA256 (calcurse-4.4.0.tar.gz) = 7cvJ283+OrpDrHC41olfsP9KNk34l2LRyjBToUzsgm8=
+SIZE (calcurse-4.4.0.tar.gz) = 620263
Index: patches/patch-contrib_caldav_calcurse-caldav
===================================================================
RCS file: patches/patch-contrib_caldav_calcurse-caldav
diff -N patches/patch-contrib_caldav_calcurse-caldav
--- patches/patch-contrib_caldav_calcurse-caldav        12 Nov 2017 14:01:26 
-0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,11 +0,0 @@
-$OpenBSD: patch-contrib_caldav_calcurse-caldav,v 1.1 2017/11/12 14:01:26 
fcambus Exp $
-
-Index: contrib/caldav/calcurse-caldav
---- contrib/caldav/calcurse-caldav.orig
-+++ contrib/caldav/calcurse-caldav
-@@ -1,4 +1,4 @@
--#!/usr/bin/python3
-+#!/usr/bin/env python3
- 
- import argparse
- import base64
Index: patches/patch-src_args_c
===================================================================
RCS file: /cvs/ports/productivity/calcurse/patches/patch-src_args_c,v
retrieving revision 1.3
diff -u -p -r1.3 patch-src_args_c
--- patches/patch-src_args_c    6 Mar 2019 21:24:37 -0000       1.3
+++ patches/patch-src_args_c    6 Mar 2019 21:29:14 -0000
@@ -1,11 +1,12 @@
-$OpenBSD: patch-src_args_c,v 1.3 2019/03/06 21:24:37 sthen Exp $
+$OpenBSD: patch-src_args_c,v 1.2 2016/04/28 14:26:13 ajacoutot Exp $
 
 calcurse uses long for times all over the place; dirty fix for 32-bit
 arch with 64-bit time_t
 
---- src/args.c.orig    Sun Mar 27 12:26:18 2016
-+++ src/args.c Thu Apr 28 16:23:45 2016
-@@ -225,10 +225,11 @@ static void next_arg(void)
+Index: src/args.c
+--- src/args.c.orig
++++ src/args.c
+@@ -248,10 +248,11 @@ static void next_arg(void)
  /*
   * Print the date on stdout.
   */
Index: patches/patch-src_calcurse_h
===================================================================
RCS file: patches/patch-src_calcurse_h
diff -N patches/patch-src_calcurse_h
--- patches/patch-src_calcurse_h        1 Feb 2019 22:56:46 -0000       1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,17 +0,0 @@
-$OpenBSD: patch-src_calcurse_h,v 1.2 2019/02/01 22:56:46 sthen Exp $
-
-Fix date display in calendar, the %-* format string is a GNU libc
-extension which is not supported by strftime(3) on OpenBSD.
-
-Index: src/calcurse.h
---- src/calcurse.h.orig
-+++ src/calcurse.h
-@@ -302,7 +302,7 @@ enum datefmt {
-     (datefmt == DATEFMT_YYYYMMDD ? _("yyyy/mm/dd") : _("yyyy-mm-dd"))))
- 
- /* Day heading default format. */
--#define DAY_HEADING_DEFAULT "%B %-d, %Y"
-+#define DAY_HEADING_DEFAULT "%B %d, %Y"
- 
- struct date {
-       unsigned dd;
Index: patches/patch-src_getstring_c
===================================================================
RCS file: patches/patch-src_getstring_c
diff -N patches/patch-src_getstring_c
--- patches/patch-src_getstring_c       19 Oct 2018 14:19:59 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,19 +0,0 @@
-$OpenBSD: patch-src_getstring_c,v 1.1 2018/10/19 14:19:59 naddy Exp $
-
-In some cases (e.g., TERM=pccon0) wgetch(3) can return KEY_ENTER
-instead of '\n' when the return key is pressed, causing getstring()
-to fail.
-
-Index: src/getstring.c
---- src/getstring.c.orig
-+++ src/getstring.c
-@@ -191,7 +191,8 @@ enum getstr getstring(WINDOW * win, char *str, int l, 
-               getstr_print(win, x, y, &st);
-               wins_doupdate();
- 
--              if ((ch = wgetch(win)) == '\n')
-+              ch = wgetch(win);
-+              if ((ch == '\n') || (ch == KEY_ENTER))
-                       break;
-               switch (ch) {
-               case KEY_BACKSPACE:     /* delete one character */
Index: patches/patch-src_notify_c
===================================================================
RCS file: patches/patch-src_notify_c
diff -N patches/patch-src_notify_c
--- patches/patch-src_notify_c  4 Feb 2019 17:44:43 -0000       1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,55 +0,0 @@
-$OpenBSD: patch-src_notify_c,v 1.1 2019/02/04 17:44:43 sthen Exp $
-
-From 30f411257ad3bc233184c08b846a2980a9c5d1f0 Mon Sep 17 00:00:00 2001
-From: Lukas Fleischer <lfleisc...@calcurse.org>
-Date: Sun, 3 Jun 2018 10:26:24 +0200
-Subject: [PATCH] Do not stop already cancelled notification thread
-
-Add a static state variable to indicate whether the notification thread
-is already running or not. Only start the thread if the notification
-thread is paused. Only stop the thread if the notification thread is
-actually running.
-
-Index: src/notify.c
---- src/notify.c.orig
-+++ src/notify.c
-@@ -55,6 +55,7 @@ static struct notify_vars notify;
- static struct notify_app notify_app;
- static pthread_attr_t detached_thread_attr;
- static pthread_t notify_t_main;
-+static int notify_t_main_running;
- 
- /*
-  * Return the number of seconds before next appointment
-@@ -190,10 +191,12 @@ void notify_free_app(void)
- /* Stop the notify-bar main thread. */
- void notify_stop_main_thread(void)
- {
--      if (notify_t_main) {
--              pthread_cancel(notify_t_main);
--              pthread_join(notify_t_main, NULL);
--      }
-+      if (!notify_t_main_running)
-+              return;
-+
-+      pthread_cancel(notify_t_main);
-+      pthread_join(notify_t_main, NULL);
-+      notify_t_main_running = 0;
- }
- 
- /*
-@@ -549,10 +552,12 @@ int notify_same_recur_item(struct recur_apoint *i)
- /* Launch the notify-bar main thread. */
- void notify_start_main_thread(void)
- {
--      /* Avoid starting the notification bar thread twice. */
--      notify_stop_main_thread();
-+      if (notify_t_main_running)
-+              return;
- 
-       pthread_create(&notify_t_main, NULL, notify_main_thread, NULL);
-+      notify_t_main_running = 1;
-+
-       notify_check_next_app(0);
- }
- 
Index: patches/patch-src_utils_c
===================================================================
RCS file: patches/patch-src_utils_c
diff -N patches/patch-src_utils_c
--- patches/patch-src_utils_c   6 Mar 2019 21:24:37 -0000       1.5
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,55 +0,0 @@
-$OpenBSD: patch-src_utils_c,v 1.5 2019/03/06 21:24:37 sthen Exp $
-
-calcurse uses long for times all over the place; dirty fix for 32-bit
-arch with 64-bit time_t
-
-Index: src/utils.c
---- src/utils.c.orig
-+++ src/utils.c
-@@ -353,17 +353,19 @@ long get_item_time(long date)
-                     get_item_min(date) * MININSEC);
- }
- 
--int get_item_hour(long date)
-+int get_item_hour(long date_l)
- {
-       struct tm lt;
-+      time_t date = date_l;
- 
-       localtime_r((time_t *) & date, &lt);
-       return lt.tm_hour;
- }
- 
--int get_item_min(long date)
-+int get_item_min(long date_l)
- {
-       struct tm lt;
-+      time_t date = date_l;
- 
-       localtime_r((time_t *) & date, &lt);
-       return lt.tm_min;
-@@ -446,10 +448,11 @@ int date_cmp_day(time_t d1, time_t d2)
- }
- 
- /* Return a string containing the date, given a date in seconds. */
--char *date_sec2date_str(long sec, const char *datefmt)
-+char *date_sec2date_str(long sec_l, const char *datefmt)
- {
-       struct tm lt;
-       char *datestr = (char *)mem_calloc(BUFSIZ, sizeof(char));
-+      time_t sec = sec_l;
- 
-       if (sec == 0) {
-               strncpy(datestr, "0", BUFSIZ);
-@@ -462,8 +465,10 @@ char *date_sec2date_str(long sec, const char *datefmt)
- }
- 
- /* Generic function to format date. */
--void date_sec2date_fmt(long sec, const char *fmt, char *datef)
-+void date_sec2date_fmt(long sec_l, const char *fmt, char *datef)
- {
-+      time_t sec = sec_l;
-+
- #if ENABLE_NLS
-       /* TODO: Find a better way to deal with localization and strftime(). */
-       char *locale_old = mem_strdup(setlocale(LC_ALL, NULL));
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/productivity/calcurse/pkg/PLIST,v
retrieving revision 1.10
diff -u -p -r1.10 PLIST
--- pkg/PLIST   28 Apr 2016 14:26:13 -0000      1.10
+++ pkg/PLIST   6 Mar 2019 21:29:14 -0000
@@ -8,23 +8,161 @@ share/doc/calcurse/add.txt
 share/doc/calcurse/config.txt
 share/doc/calcurse/copy-paste.txt
 share/doc/calcurse/credits.txt
+share/doc/calcurse/de/
+share/doc/calcurse/de/add.txt
+share/doc/calcurse/de/config.txt
+share/doc/calcurse/de/copy-paste.txt
+share/doc/calcurse/de/credits.txt
+share/doc/calcurse/de/delete.txt
+share/doc/calcurse/de/displacement.txt
+share/doc/calcurse/de/edit.txt
+share/doc/calcurse/de/enote.txt
+share/doc/calcurse/de/export.txt
+share/doc/calcurse/de/flag.txt
+share/doc/calcurse/de/general.txt
+share/doc/calcurse/de/goto.txt
+share/doc/calcurse/de/import.txt
+share/doc/calcurse/de/intro.txt
+share/doc/calcurse/de/other.txt
+share/doc/calcurse/de/pipe.txt
+share/doc/calcurse/de/priority.txt
+share/doc/calcurse/de/repeat.txt
+share/doc/calcurse/de/save.txt
+share/doc/calcurse/de/tab.txt
+share/doc/calcurse/de/view.txt
+share/doc/calcurse/de/vnote.txt
 share/doc/calcurse/delete.txt
 share/doc/calcurse/displacement.txt
 share/doc/calcurse/edit.txt
 share/doc/calcurse/enote.txt
+share/doc/calcurse/es/
+share/doc/calcurse/es/add.txt
+share/doc/calcurse/es/config.txt
+share/doc/calcurse/es/copy-paste.txt
+share/doc/calcurse/es/credits.txt
+share/doc/calcurse/es/delete.txt
+share/doc/calcurse/es/displacement.txt
+share/doc/calcurse/es/edit.txt
+share/doc/calcurse/es/enote.txt
+share/doc/calcurse/es/export.txt
+share/doc/calcurse/es/flag.txt
+share/doc/calcurse/es/general.txt
+share/doc/calcurse/es/goto.txt
+share/doc/calcurse/es/import.txt
+share/doc/calcurse/es/intro.txt
+share/doc/calcurse/es/other.txt
+share/doc/calcurse/es/pipe.txt
+share/doc/calcurse/es/priority.txt
+share/doc/calcurse/es/repeat.txt
+share/doc/calcurse/es/save.txt
+share/doc/calcurse/es/tab.txt
+share/doc/calcurse/es/view.txt
+share/doc/calcurse/es/vnote.txt
 share/doc/calcurse/export.txt
 share/doc/calcurse/flag.txt
+share/doc/calcurse/fr/
+share/doc/calcurse/fr/add.txt
+share/doc/calcurse/fr/config.txt
+share/doc/calcurse/fr/copy-paste.txt
+share/doc/calcurse/fr/credits.txt
+share/doc/calcurse/fr/delete.txt
+share/doc/calcurse/fr/displacement.txt
+share/doc/calcurse/fr/edit.txt
+share/doc/calcurse/fr/enote.txt
+share/doc/calcurse/fr/export.txt
+share/doc/calcurse/fr/flag.txt
+share/doc/calcurse/fr/general.txt
+share/doc/calcurse/fr/goto.txt
+share/doc/calcurse/fr/import.txt
+share/doc/calcurse/fr/intro.txt
+share/doc/calcurse/fr/other.txt
+share/doc/calcurse/fr/pipe.txt
+share/doc/calcurse/fr/priority.txt
+share/doc/calcurse/fr/repeat.txt
+share/doc/calcurse/fr/save.txt
+share/doc/calcurse/fr/tab.txt
+share/doc/calcurse/fr/view.txt
+share/doc/calcurse/fr/vnote.txt
 share/doc/calcurse/general.txt
 share/doc/calcurse/goto.txt
 share/doc/calcurse/import.txt
 share/doc/calcurse/intro.txt
 share/doc/calcurse/manual.html
 share/doc/calcurse/manual.txt
+share/doc/calcurse/nl/
+share/doc/calcurse/nl/add.txt
+share/doc/calcurse/nl/config.txt
+share/doc/calcurse/nl/copy-paste.txt
+share/doc/calcurse/nl/credits.txt
+share/doc/calcurse/nl/delete.txt
+share/doc/calcurse/nl/displacement.txt
+share/doc/calcurse/nl/edit.txt
+share/doc/calcurse/nl/enote.txt
+share/doc/calcurse/nl/export.txt
+share/doc/calcurse/nl/flag.txt
+share/doc/calcurse/nl/general.txt
+share/doc/calcurse/nl/goto.txt
+share/doc/calcurse/nl/import.txt
+share/doc/calcurse/nl/intro.txt
+share/doc/calcurse/nl/other.txt
+share/doc/calcurse/nl/pipe.txt
+share/doc/calcurse/nl/priority.txt
+share/doc/calcurse/nl/repeat.txt
+share/doc/calcurse/nl/save.txt
+share/doc/calcurse/nl/tab.txt
+share/doc/calcurse/nl/view.txt
+share/doc/calcurse/nl/vnote.txt
 share/doc/calcurse/other.txt
 share/doc/calcurse/pipe.txt
 share/doc/calcurse/priority.txt
+share/doc/calcurse/pt_BR/
+share/doc/calcurse/pt_BR/add.txt
+share/doc/calcurse/pt_BR/config.txt
+share/doc/calcurse/pt_BR/copy-paste.txt
+share/doc/calcurse/pt_BR/credits.txt
+share/doc/calcurse/pt_BR/delete.txt
+share/doc/calcurse/pt_BR/displacement.txt
+share/doc/calcurse/pt_BR/edit.txt
+share/doc/calcurse/pt_BR/enote.txt
+share/doc/calcurse/pt_BR/export.txt
+share/doc/calcurse/pt_BR/flag.txt
+share/doc/calcurse/pt_BR/general.txt
+share/doc/calcurse/pt_BR/goto.txt
+share/doc/calcurse/pt_BR/import.txt
+share/doc/calcurse/pt_BR/intro.txt
+share/doc/calcurse/pt_BR/other.txt
+share/doc/calcurse/pt_BR/pipe.txt
+share/doc/calcurse/pt_BR/priority.txt
+share/doc/calcurse/pt_BR/repeat.txt
+share/doc/calcurse/pt_BR/save.txt
+share/doc/calcurse/pt_BR/tab.txt
+share/doc/calcurse/pt_BR/view.txt
+share/doc/calcurse/pt_BR/vnote.txt
 share/doc/calcurse/reload.txt
 share/doc/calcurse/repeat.txt
+share/doc/calcurse/ru/
+share/doc/calcurse/ru/add.txt
+share/doc/calcurse/ru/config.txt
+share/doc/calcurse/ru/copy-paste.txt
+share/doc/calcurse/ru/credits.txt
+share/doc/calcurse/ru/delete.txt
+share/doc/calcurse/ru/displacement.txt
+share/doc/calcurse/ru/edit.txt
+share/doc/calcurse/ru/enote.txt
+share/doc/calcurse/ru/export.txt
+share/doc/calcurse/ru/flag.txt
+share/doc/calcurse/ru/general.txt
+share/doc/calcurse/ru/goto.txt
+share/doc/calcurse/ru/import.txt
+share/doc/calcurse/ru/intro.txt
+share/doc/calcurse/ru/other.txt
+share/doc/calcurse/ru/pipe.txt
+share/doc/calcurse/ru/priority.txt
+share/doc/calcurse/ru/repeat.txt
+share/doc/calcurse/ru/save.txt
+share/doc/calcurse/ru/tab.txt
+share/doc/calcurse/ru/view.txt
+share/doc/calcurse/ru/vnote.txt
 share/doc/calcurse/save.txt
 share/doc/calcurse/submitting-patches.html
 share/doc/calcurse/tab.txt

Reply via email to