git: 6636979433e4 - main - www/elinks: update to 0.16.0

From: Fernando Apesteguía <fernape_at_FreeBSD.org>
Date: Sun, 08 Jan 2023 18:38:11 UTC
The branch main has been updated by fernape:

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

commit 6636979433e4b11a3f6bf0ef8242915457c4971b
Author:     Dustin Marquess <jailbird@fdf.net>
AuthorDate: 2023-01-07 16:31:32 +0000
Commit:     Fernando Apesteguía <fernape@FreeBSD.org>
CommitDate: 2023-01-08 18:33:55 +0000

    www/elinks: update to 0.16.0
    
    ChangeLog: https://raw.githubusercontent.com/rkd77/elinks/master/NEWS
    
     * detect xterm on my computer
     * alternative mujs engine for js
     * bump mozjs to 102
     * experimental XHR implementation
     * macros in exmode
     * removed infinite loop, which occurred under BSD
     * optional terminal hyperlinks in dumps
    
    PR:             268664
    Reported by:    jailbird@fdf.net
---
 www/elinks/Makefile                               | 10 +++----
 www/elinks/distinfo                               |  6 ++--
 www/elinks/files/patch-meson.build                | 36 +++++++++++++++++------
 www/elinks/files/patch-src_config_options.c       | 28 ------------------
 www/elinks/files/patch-src_document_renderer.cpp  | 16 ++++++++++
 www/elinks/files/patch-src_document_renderer.h    | 11 +++++++
 www/elinks/files/patch-src_intl_gettext_libintl.h |  4 +--
 www/elinks/files/patch-src_protocol_header.c      | 14 +++++++++
 www/elinks/files/patch-src_protocol_header.h      | 11 +++++++
 www/elinks/files/patch-src_util_error.c           | 29 ------------------
 10 files changed, 88 insertions(+), 77 deletions(-)

diff --git a/www/elinks/Makefile b/www/elinks/Makefile
index e9c840823ab1..3075c2f63981 100644
--- a/www/elinks/Makefile
+++ b/www/elinks/Makefile
@@ -1,7 +1,6 @@
 PORTNAME=	elinks
 DISTVERSIONPREFIX=	v
-DISTVERSION=	0.15.1
-PORTREVISION=	1
+DISTVERSION=	0.16.0
 CATEGORIES=	www
 
 MAINTAINER=	jailbird@fdf.net
@@ -98,15 +97,14 @@ XBELMARKS_MESON_TRUE=	xbel
 TRUECOLORS_MESON_TRUE=	true-color
 
 SPIDERMONKEY_USES=		compiler:c++17-lang sqlite
-SPIDERMONKEY_BUILD_DEPENDS=	${LOCALBASE}/lib/libmozjs-78.so:lang/spidermonkey78 \
+SPIDERMONKEY_BUILD_DEPENDS=	${LOCALBASE}/lib/libmozjs-102.so:lang/spidermonkey102 \
 				${LOCALBASE}/lib/libxml++-5.0.so:textproc/libxml++
-SPIDERMONKEY_RUN_DEPENDS=	js78:lang/spidermonkey78
 SPIDERMONKEY_LIB_DEPENDS=	libnspr4.so:devel/nspr \
 				libxml++-5.0.so:textproc/libxml++
 SPIDERMONKEY_CFLAGS=		-I${LOCALBASE}/include/nspr \
-				-I${LOCALBASE}/include/js-78
+				-I${LOCALBASE}/include/js-102
 SPIDERMONKEY_CXXFLAGS=		-I${LOCALBASE}/include/nspr \
-				-I${LOCALBASE}/include/js-78
+				-I${LOCALBASE}/include/js-102
 SPIDERMONKEY_LDFLAGS=		-L${LOCALBASE}/lib -lnspr4 -lpthread -lm
 SPIDERMONKEY_MESON_ON=		-Dsm-scripting=true -Dspidermonkey=true
 
diff --git a/www/elinks/distinfo b/www/elinks/distinfo
index 1d11b36105a2..ab63d2e5479b 100644
--- a/www/elinks/distinfo
+++ b/www/elinks/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1659262740
-SHA256 (rkd77-elinks-v0.15.1_GH0.tar.gz) = a3ebb14e179fcf97f93874b7771b4b05c1b7fdc704807334e865273d9de8428f
-SIZE (rkd77-elinks-v0.15.1_GH0.tar.gz) = 3860003
+TIMESTAMP = 1671992400
+SHA256 (rkd77-elinks-v0.16.0_GH0.tar.gz) = 5494a73737eeb182fe2333b74e9b6192170f583c7722a0650dcd14ef088b9dfb
+SIZE (rkd77-elinks-v0.16.0_GH0.tar.gz) = 3937345
diff --git a/www/elinks/files/patch-meson.build b/www/elinks/files/patch-meson.build
index 77b35a8981b2..d381c0c3e10d 100644
--- a/www/elinks/files/patch-meson.build
+++ b/www/elinks/files/patch-meson.build
@@ -1,24 +1,42 @@
---- meson.build.orig	2022-07-31 10:16:29 UTC
+--- meson.build.orig	2022-12-25 18:17:02 UTC
 +++ meson.build
 @@ -3,9 +3,7 @@ srcdir = meson.source_root()
  
  srcdir = meson.source_root()
  
--txt = run_command('git', '--git-dir=' + srcdir + '/.git', 'rev-parse', 'HEAD').stdout().strip()
--dirty = run_command(srcdir + '/git-dirty.sh').stdout().strip()
+-txt = run_command('git', '--git-dir=' + srcdir + '/.git', 'rev-parse', 'HEAD', check:false).stdout().strip()
+-dirty = run_command(srcdir + '/git-dirty.sh', check:false).stdout().strip()
 -add_global_arguments('-DBUILD_ID="' + txt + dirty + '"', language : 'c')
 +add_global_arguments('-DBUILD_ID="\\0"', language : 'c')
  
  conf_data = configuration_data()
  conf_data.set('VERSION', meson.project_version())
-@@ -158,6 +156,10 @@ if compiler.has_header('fcntl.h')
- 
- if compiler.has_header('fcntl.h')
+@@ -171,6 +169,10 @@ endif
      conf_data.set('HAVE_FCNTL_H', 1)
-+endif
-+
+ endif
+ 
 +if compiler.has_header('execinfo.h')
 +    conf_data.set('HAVE_EXECINFO_H', 1)
++endif
++
+ if compiler.has_header('libgen.h')
+     conf_data.set('HAVE_LIBGEN_H', 1)
+ endif
+@@ -838,7 +840,7 @@ endif
+     conf_data.set('HAVE_ICONV', 1)
+ endif
+ 
+-if conf_data.get('CONFIG_OS_DOS') or compiler.has_function('alloca', prefix: '#include <alloca.h>')
++if conf_data.get('CONFIG_OS_DOS') or compiler.has_function('alloca', prefix: '#include <stdlib.h>')
+     conf_data.set('HAVE_ALLOCA', 1)
+ endif
+ 
+@@ -854,7 +856,7 @@ endif
+     conf_data.set('HAVE_GNUTLS_CERTIFICATE_SET_X509_SYSTEM_TRUST', 1)
+ endif
+ 
+-if compiler.has_function('mkstemps', prefix: '#include <stdlib.h>', args: '-D_GNU_SOURCE')
++if compiler.has_function('mkstemps', prefix: '#include <unistd.h>')
+     conf_data.set('HAVE_MKSTEMPS', 1)
  endif
  
- if compiler.has_header('libgen.h')
diff --git a/www/elinks/files/patch-src_config_options.c b/www/elinks/files/patch-src_config_options.c
deleted file mode 100644
index b59ebc61f415..000000000000
--- a/www/elinks/files/patch-src_config_options.c
+++ /dev/null
@@ -1,28 +0,0 @@
---- src/config/options.c.orig	2022-07-31 10:16:29 UTC
-+++ src/config/options.c
-@@ -892,6 +892,7 @@ change_hook_ui_double_esc(struct session *ses, struct 
- 	return 0;
- }
- 
-+#ifdef CONFIG_MOUSE
- static int
- change_hook_ui_mouse_disable(struct session *ses, struct option *current, struct option *changed)
- {
-@@ -907,6 +908,7 @@ change_hook_ui_mouse_disable(struct session *ses, stru
- 	}
- 	return 0;
- }
-+#endif
- 
- 
- /** Make option templates visible or invisible in the option manager.
-@@ -984,7 +986,9 @@ static const struct change_hook_info change_hooks[] = 
- 	{ "ui.colors",			change_hook_ui_colors },
- 	{ "ui.double_esc",		change_hook_ui_double_esc },
- 	{ "ui.language",		change_hook_language },
-+#ifdef CONFIG_MOUSE
- 	{ "ui.mouse_disable",	change_hook_ui_mouse_disable },
-+#endif
- 	{ "ui",				change_hook_ui },
- 	{ NULL,				NULL },
- };
diff --git a/www/elinks/files/patch-src_document_renderer.cpp b/www/elinks/files/patch-src_document_renderer.cpp
new file mode 100644
index 000000000000..56bc49fb5991
--- /dev/null
+++ b/www/elinks/files/patch-src_document_renderer.cpp
@@ -0,0 +1,16 @@
+--- src/document/renderer.cpp.orig	2022-12-25 18:17:02 UTC
++++ src/document/renderer.cpp
+@@ -615,11 +615,11 @@ struct conv_table *
+ }
+ 
+ struct conv_table *
+-get_convert_table(char *head, int to_cp,
++get_convert_table(const char *head, int to_cp,
+ 		  int default_cp, int *from_cp,
+ 		  enum cp_status *cp_status, int ignore_server_cp)
+ {
+-	char *part = head;
++	const char *part = head;
+ 	int cp_index = -1;
+ 
+ 	assert(head);
diff --git a/www/elinks/files/patch-src_document_renderer.h b/www/elinks/files/patch-src_document_renderer.h
new file mode 100644
index 000000000000..3f5795e6d245
--- /dev/null
+++ b/www/elinks/files/patch-src_document_renderer.h
@@ -0,0 +1,11 @@
+--- src/document/renderer.h.orig	2022-12-25 18:17:02 UTC
++++ src/document/renderer.h
+@@ -16,7 +16,7 @@ void render_document_frames(struct session *ses, int n
+ 
+ void render_document(struct view_state *, struct document_view *, struct document_options *);
+ void render_document_frames(struct session *ses, int no_cache);
+-struct conv_table *get_convert_table(char *head, int to_cp, int default_cp, int *from_cp, enum cp_status *cp_status, int ignore_server_cp);
++struct conv_table *get_convert_table(const char *head, int to_cp, int default_cp, int *from_cp, enum cp_status *cp_status, int ignore_server_cp);
+ void sort_links(struct document *document);
+ 
+ #ifdef __cplusplus
diff --git a/www/elinks/files/patch-src_intl_gettext_libintl.h b/www/elinks/files/patch-src_intl_gettext_libintl.h
index 827752d8ad8f..0c5d55c9e75b 100644
--- a/www/elinks/files/patch-src_intl_gettext_libintl.h
+++ b/www/elinks/files/patch-src_intl_gettext_libintl.h
@@ -1,4 +1,4 @@
---- src/intl/gettext/libintl.h.orig	2022-07-31 10:16:29 UTC
+--- src/intl/gettext/libintl.h.orig	2022-12-25 18:17:02 UTC
 +++ src/intl/gettext/libintl.h
 @@ -44,7 +44,7 @@ _(const char *msg, struct terminal *term)
  	return (char *)gettext_noop(msg);
@@ -8,4 +8,4 @@
 +static inline const char *
  n_(const char *msg1, const char *msg2, unsigned long int n, struct terminal *term)
  {
- 	return gettext_noop(msg1);
+ 	return (char *)gettext_noop(msg1);
diff --git a/www/elinks/files/patch-src_protocol_header.c b/www/elinks/files/patch-src_protocol_header.c
new file mode 100644
index 000000000000..b0c1c7fcf96d
--- /dev/null
+++ b/www/elinks/files/patch-src_protocol_header.c
@@ -0,0 +1,14 @@
+--- src/protocol/header.c.orig	2022-12-25 18:17:02 UTC
++++ src/protocol/header.c
+@@ -141,9 +141,9 @@ char *
+  * The terms message-header, field-name, start-line, and field-content
+  * are defined in RFC 2616 sections 4.1 and 4.2.  */
+ char *
+-parse_header(char *head, const char *item, char **ptr)
++parse_header(const char *head, const char *item, const char **ptr)
+ {
+-	char *pos = head;
++	const char *pos = head;
+ 
+ 	if (!pos) return NULL;
+ 
diff --git a/www/elinks/files/patch-src_protocol_header.h b/www/elinks/files/patch-src_protocol_header.h
new file mode 100644
index 000000000000..7fcb5a265568
--- /dev/null
+++ b/www/elinks/files/patch-src_protocol_header.h
@@ -0,0 +1,11 @@
+--- src/protocol/header.h.orig	2022-12-25 18:17:02 UTC
++++ src/protocol/header.h
+@@ -13,7 +13,7 @@ enum parse_header_param {
+ 	 * Unknown values should be treated as errors. */
+ };
+ 
+-char *parse_header(char *, const char *, char **);
++char *parse_header(const char *, const char *, const char **);
+ enum parse_header_param parse_header_param(char *, const char *, char **, int);
+ char *get_header_param(char *, const char *);
+ 
diff --git a/www/elinks/files/patch-src_util_error.c b/www/elinks/files/patch-src_util_error.c
deleted file mode 100644
index 30424736bf20..000000000000
--- a/www/elinks/files/patch-src_util_error.c
+++ /dev/null
@@ -1,29 +0,0 @@
---- src/util/error.c.orig	2022-07-31 10:16:29 UTC
-+++ src/util/error.c
-@@ -301,26 +301,6 @@ dump_backtrace(FILE *f, int trouble)
- 		fprintf(f, "[%p] %s\n", stack[i], strings[i]);
- 
- 	free(strings);
--
--#else
--	/* User torturation. */
--	/* You are worried about what you see here? You don't see anything in
--	 * the first place. Also, be assured that we know what are we doing. */
--	/* (We are killing the user, obviously.) */
--
--	/* TODO: Gettextify? Er, better not. More people (translators) could
--	 * find out what are we doing... ;-) --pasky */
--	/* TODO: Be more cruel when in trouble? ;-) --pasky */
--
--	fputs(	"Wheeeeeeeeeee! You played with the config.h by hand, didn't you?\n"
--		"Of _COURSE_ you did! Is that how a nice .. creature behaves like?\n"
--		"Of _COURSE_ it isn't! I feel offended and thus I will revenge now!\n"
--		"You will _suffer_ >:).\n"
--		"\n"
--		"CPU burning sequence initiated...\n", f);
--
--	/* TODO: Include cpuburn.c here. --pasky */
--	while (1);
- #endif
- 	fflush(f);
- }