git: 30ff65301551 - main - math/p5-Text-AsciiTeX: fix build with -fno-common

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Mon, 17 Apr 2023 09:30:35 UTC
The branch main has been updated by fuz:

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

commit 30ff65301551958684cf424fb40a7021e2e4fbd7
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2023-04-16 15:13:20 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-04-17 09:27:26 +0000

    math/p5-Text-AsciiTeX: fix build with -fno-common
    
    Turn a variable definition in a header file into a declaration and
    move the definition to a source file.  This fixes the build on
    FreeBSD 13+.
    
    Approved by:    portmgr (build fix blanket)
---
 math/p5-Text-AsciiTeX/Makefile                                 |  5 +----
 math/p5-Text-AsciiTeX/files/patch-src_asciitex_asciiTeX.c      | 10 ++++++++++
 .../files/patch-src_asciitex_asciiTeX__struct.h                |  9 +++++++++
 3 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/math/p5-Text-AsciiTeX/Makefile b/math/p5-Text-AsciiTeX/Makefile
index 691ce548fa96..965ece1af536 100644
--- a/math/p5-Text-AsciiTeX/Makefile
+++ b/math/p5-Text-AsciiTeX/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	Text-AsciiTeX
 PORTVERSION=	0.05
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	math perl5
 MASTER_SITES=	CPAN
 PKGNAMEPREFIX=	p5-
@@ -9,9 +9,6 @@ MAINTAINER=	perl@FreeBSD.org
 COMMENT=	Convert (La)TeX formulas to ASCII art
 WWW=		https://metacpan.org/release/Text-AsciiTeX
 
-BROKEN_FreeBSD_13=	error: duplicate symbol: SYNTAX_ERR_FLAG
-BROKEN_FreeBSD_14=	error: duplicate symbol: SYNTAX_ERR_FLAG
-
 LICENSE=	ART10 GPLv1+
 LICENSE_COMB=	dual
 
diff --git a/math/p5-Text-AsciiTeX/files/patch-src_asciitex_asciiTeX.c b/math/p5-Text-AsciiTeX/files/patch-src_asciitex_asciiTeX.c
new file mode 100644
index 000000000000..32053fdb8d10
--- /dev/null
+++ b/math/p5-Text-AsciiTeX/files/patch-src_asciitex_asciiTeX.c
@@ -0,0 +1,10 @@
+--- src/asciitex/asciiTeX.c.orig	2023-04-16 15:12:02 UTC
++++ src/asciitex/asciiTeX.c
+@@ -38,6 +38,7 @@
+ #include "dim.h"
+ #include "utils.h"
+ 
++STAT SYNTAX_ERR_FLAG;
+ char ** messages;
+ int Nmes;
+ int Nall;
diff --git a/math/p5-Text-AsciiTeX/files/patch-src_asciitex_asciiTeX__struct.h b/math/p5-Text-AsciiTeX/files/patch-src_asciitex_asciiTeX__struct.h
new file mode 100644
index 000000000000..519eec7a3bcc
--- /dev/null
+++ b/math/p5-Text-AsciiTeX/files/patch-src_asciitex_asciiTeX__struct.h
@@ -0,0 +1,9 @@
+--- src/asciitex/asciiTeX_struct.h.orig	2023-04-16 15:11:41 UTC
++++ src/asciitex/asciiTeX_struct.h
+@@ -56,5 +56,5 @@ struct Tgraph {			/* the order of fields is important-
+ };
+ 
+ typedef enum {S_NOERR, S_WARN, S_ERR} STAT;
+-STAT SYNTAX_ERR_FLAG;
++extern STAT SYNTAX_ERR_FLAG;
+ #endif