git: cd5299ac4798 - main - editors/nvi2: Update to V2.2.1

From: Craig Leres <leres_at_FreeBSD.org>
Date: Mon, 25 Sep 2023 22:39:19 UTC
The branch main has been updated by leres:

URL: https://cgit.FreeBSD.org/ports/commit/?id=cd5299ac4798448925546ac008459d4d97233749

commit cd5299ac4798448925546ac008459d4d97233749
Author:     Craig Leres <leres@FreeBSD.org>
AuthorDate: 2023-09-25 22:38:28 +0000
Commit:     Craig Leres <leres@FreeBSD.org>
CommitDate: 2023-09-25 22:38:28 +0000

    editors/nvi2: Update to V2.2.1
    
        https://github.com/lichray/nvi2/releases/tag/v2.2.1
    
    Changes since V2.2.0:
    
     - Display control chars in altnotation.
    
     - Intuitively jump between troff paragraphs.
    
     - Keep correct count for unprintable character sequences in
       opts_print().
    
     - Do a full reformat when ^L/^R redrawing.
    
     - Fix printing of line number when the 's' command is used with
       the 'c' flag and the number option is set.
    
     - Fix wide buffer growth when expanding filenames.
    
     - Fix segmentation fault when window size changes.
    
     - Fix buffer overflow in ex_comm_search.
    
     - Fix segmentation fault in number increment.
    
     - Fix for terminal state corruption on q from ex-mode.
    
     - Fix core dump when tags file pattern has a trailing '\'.
    
    Reported by:    Zhihao Yuan
---
 editors/nvi2/Makefile                      |  8 ++++--
 editors/nvi2/distinfo                      |  6 ++--
 editors/nvi2/files/patch-CMakeLists.txt    | 10 -------
 editors/nvi2/files/patch-ex_ex__subst.c    | 12 --------
 editors/nvi2/files/patch-vi_v__paragraph.c | 45 ------------------------------
 5 files changed, 9 insertions(+), 72 deletions(-)

diff --git a/editors/nvi2/Makefile b/editors/nvi2/Makefile
index 9240ea4f4994..d680a3b65e6a 100644
--- a/editors/nvi2/Makefile
+++ b/editors/nvi2/Makefile
@@ -1,7 +1,6 @@
 PORTNAME=	nvi2
-PORTVERSION=	2.2.0
+PORTVERSION=	2.2.1
 DISTVERSIONPREFIX=	v
-PORTREVISION=	2
 CATEGORIES=	editors
 
 MAINTAINER=	leres@FreeBSD.org
@@ -35,6 +34,11 @@ PLIST_FILES=	bin/nex \
 		man/man1/nvi.1.gz \
 		man/man1/nview.1.gz
 
+post-patch:
+	${REINPLACE_CMD} -e \
+	    '/-Wall/s/^/add_compile_options(-fcolor-diagnostics)\n/' \
+	    ${WRKSRC}/CMakeLists.txt
+
 do-install:
 	${INSTALL_PROGRAM} ${BUILD_WRKSRC}/nvi ${STAGEDIR}${PREFIX}/bin
 	${LN} ${STAGEDIR}${PREFIX}/bin/nvi ${STAGEDIR}${PREFIX}/bin/nex
diff --git a/editors/nvi2/distinfo b/editors/nvi2/distinfo
index caf8198d36ef..06302bfe8461 100644
--- a/editors/nvi2/distinfo
+++ b/editors/nvi2/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1600161316
-SHA256 (lichray-nvi2-v2.2.0_GH0.tar.gz) = cd668287f55af1e2ccd64e6c0edb504aec41d25a9efe2e505abaa90c3c551455
-SIZE (lichray-nvi2-v2.2.0_GH0.tar.gz) = 439545
+TIMESTAMP = 1695680540
+SHA256 (lichray-nvi2-v2.2.1_GH0.tar.gz) = 9f7c9aef3924c0e39ef96e1aadb8f5d396825b8251addab1290aa866cf3d5af4
+SIZE (lichray-nvi2-v2.2.1_GH0.tar.gz) = 443376
diff --git a/editors/nvi2/files/patch-CMakeLists.txt b/editors/nvi2/files/patch-CMakeLists.txt
deleted file mode 100644
index 06506fde8732..000000000000
--- a/editors/nvi2/files/patch-CMakeLists.txt
+++ /dev/null
@@ -1,10 +0,0 @@
---- CMakeLists.txt.orig	2020-08-17 12:57:48 UTC
-+++ CMakeLists.txt
-@@ -20,7 +20,6 @@ mark_as_advanced(CMAKE_INSTALL_PREFIX)
- option(USE_WIDECHAR "Enable wide character support" ON)
- option(USE_ICONV "Enable iconv support" ON)
- 
--add_compile_options(-fcolor-diagnostics)
- add_compile_options($<$<CONFIG:Debug>:-Wall>)
- add_compile_options($<$<CONFIG:Debug>:-Wno-parentheses>)
- add_compile_options($<$<CONFIG:Debug>:-Wno-uninitialized>)
diff --git a/editors/nvi2/files/patch-ex_ex__subst.c b/editors/nvi2/files/patch-ex_ex__subst.c
deleted file mode 100644
index 6ff00423160c..000000000000
--- a/editors/nvi2/files/patch-ex_ex__subst.c
+++ /dev/null
@@ -1,12 +0,0 @@
---- ex/ex_subst.c.orig	2020-08-01 22:27:51 UTC
-+++ ex/ex_subst.c
-@@ -1194,7 +1194,8 @@ re_tag_conv(SCR *sp, CHAR_T **ptrnp, size_t *plenp, in
- 	for (; len > 0; --len) {
- 		if (p[0] == '\\' && (p[1] == '/' || p[1] == '?')) {
- 			++p;
--			--len;
-+			if (len > 1)
-+				--len;
- 		} else if (STRCHR(L("^.[]$*"), p[0]))
- 			*t++ = '\\';
- 		*t++ = *p++;
diff --git a/editors/nvi2/files/patch-vi_v__paragraph.c b/editors/nvi2/files/patch-vi_v__paragraph.c
deleted file mode 100644
index caa061cb8dfb..000000000000
--- a/editors/nvi2/files/patch-vi_v__paragraph.c
+++ /dev/null
@@ -1,45 +0,0 @@
-From 517d821de7939f74a74bb6a553df0fff425fdead Mon Sep 17 00:00:00 2001
-From: Zhihao Yuan <lichray@gmail.com>
-Date: Tue, 29 Aug 2023 03:50:08 -0500
-Subject: [PATCH] Treat consecutive paragraph indicators as different
- paragraphs (#119)
-
-Consecutive empty lines count toward the same state, so there're
-2x states (to get in and out). ^L and .PP are counted as text,
-hitting those in the text should be treated as getting out of a
-paragraph and then getting in.
-
-Closes: #118
-See also: https://marc.info/?l=openbsd-bugs&m=169100763926909&w=2
----
- vi/v_paragraph.c | 11 ++++++++---
- 1 file changed, 8 insertions(+), 3 deletions(-)
-
-diff --git a/vi/v_paragraph.c b/vi/v_paragraph.c
-index abe8d9cf..2d7f0756 100644
---- vi/v_paragraph.c.orig	2020-08-01 22:27:51 UTC
-+++ vi/v_paragraph.c
-@@ -39,15 +39,20 @@
- 	if (p[0] == '\014') {						\
- 		if (!--cnt)						\
- 			goto found;					\
-+		if (pstate == P_INTEXT && !--cnt)			\
-+			goto found;					\
- 		continue;						\
- 	}								\
- 	if (p[0] != '.' || len < 2)					\
- 		continue;						\
- 	for (lp = VIP(sp)->ps; *lp != '\0'; lp += 2)			\
- 		if (lp[0] == p[1] &&					\
--		    (lp[1] == ' ' && len == 2 || lp[1] == p[2]) &&	\
--		    !--cnt)						\
--			goto found;					\
-+		    (lp[1] == ' ' && len == 2 || lp[1] == p[2])) {	\
-+			if (!--cnt)					\
-+				goto found;				\
-+			if (pstate == P_INTEXT && !--cnt)		\
-+				goto found;				\
-+		}							\
- }
- 
- /*