Hi ports@, Here is a diff to update calcurse to 4.5.1 and take maintainership.
Most patches can be dropped as upstream incorporated those changes or fixed the issues we had to patch for. Notably, they are now using time_t for the functions we patched with the exception of arg_print_date() so the patch for this one remains. Comments? OK? Index: Makefile =================================================================== RCS file: /cvs/ports/productivity/calcurse/Makefile,v retrieving revision 1.31 diff -u -p -r1.31 Makefile --- Makefile 12 Jul 2019 20:48:58 -0000 1.31 +++ Makefile 6 Nov 2019 10:01:49 -0000 @@ -2,11 +2,12 @@ COMMENT= text-based calendar and scheduling application -DISTNAME= calcurse-4.3.0 -REVISION= 5 +DISTNAME= calcurse-4.5.1 EPOCH= 0 CATEGORIES= productivity + +MAINTAINER= Frederic Cambus <fcam...@openbsd.org> HOMEPAGE= https://calcurse.org/ 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 Nov 2019 10:01:49 -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.5.1.tar.gz) = UzZXaCTLp9QO7gszITmStDBDaJcu9VapMPOWXpBo8zE= +SIZE (calcurse-4.5.1.tar.gz) = 659272 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 Nov 2019 10:01:49 -0000 @@ -3,9 +3,10 @@ $OpenBSD: patch-src_args_c,v 1.3 2019/03 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 +@@ -251,10 +251,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(¬ify_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, <); - 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, <); - 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 Nov 2019 10:01:49 -0000 @@ -2,6 +2,7 @@ @bin bin/calcurse bin/calcurse-caldav bin/calcurse-upgrade +bin/calcurse-vdir @man man/man1/calcurse.1 share/doc/calcurse/ share/doc/calcurse/add.txt