git: 6b82b9945652 - main - www/elinks: fix detection of execinfo

From: Baptiste Daroussin <bapt_at_FreeBSD.org>
Date: Wed, 16 Nov 2022 15:34:51 UTC
The branch main has been updated by bapt:

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

commit 6b82b9945652f28f4245dd2e2662af401cda0534
Author:     Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2022-11-16 15:30:51 +0000
Commit:     Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2022-11-16 15:34:49 +0000

    www/elinks: fix detection of execinfo
    
    When moving from autotools to autotools to meson, the check from
    the execinfo header was lost, readd this test.
    
    When execinfo is not detected, the replacement code instead of error
    is an abusive end less loop, while here patch out this part [1].
    
    Note that upstream merge the removal of the code.
    
    While here remove a useless macro which wasn't functional anyway due to
    a typo
    
    PR:     267794 [1]
    Submitted by:   Dustin Marquess <jailbird@fdf.net> [1]
---
 www/elinks/Makefile                     |  2 +-
 www/elinks/files/patch-meson.build      | 11 +++++++++++
 www/elinks/files/patch-src_util_error.c | 29 +++++++++++++++++++++++++++++
 3 files changed, 41 insertions(+), 1 deletion(-)

diff --git a/www/elinks/Makefile b/www/elinks/Makefile
index 30b5c821a985..320097115d5d 100644
--- a/www/elinks/Makefile
+++ b/www/elinks/Makefile
@@ -1,6 +1,7 @@
 PORTNAME=	elinks
 DISTVERSIONPREFIX=	v
 DISTVERSION=	0.15.1
+PORTREVISION=	1
 CATEGORIES=	www
 
 MAINTAINER=	jailbird@fdf.net
@@ -17,7 +18,6 @@ USE_GITHUB=	yes
 GH_ACCOUNT=	rkd77
 
 LIBS+=		-lexecinfo
-CONIGURE_ENV=	PYTHON_PATH="${PYTHON_CMD}"
 MESON_ARGS=	-Dgpm=false -Dperl=true
 
 OPTIONS_DEFINE=		256COLORS 88COLORS TRUECOLORS BITTORRENT BROTLI EXMODE \
diff --git a/www/elinks/files/patch-meson.build b/www/elinks/files/patch-meson.build
index dd8549a15b67..77b35a8981b2 100644
--- a/www/elinks/files/patch-meson.build
+++ b/www/elinks/files/patch-meson.build
@@ -11,3 +11,14 @@
  
  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')
+     conf_data.set('HAVE_FCNTL_H', 1)
++endif
++
++if compiler.has_header('execinfo.h')
++    conf_data.set('HAVE_EXECINFO_H', 1)
+ endif
+ 
+ if compiler.has_header('libgen.h')
diff --git a/www/elinks/files/patch-src_util_error.c b/www/elinks/files/patch-src_util_error.c
new file mode 100644
index 000000000000..30424736bf20
--- /dev/null
+++ b/www/elinks/files/patch-src_util_error.c
@@ -0,0 +1,29 @@
+--- 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);
+ }