git: abdfb41c181b - main - devel/gengetopt: Fix build with llvm16

From: Muhammad Moinur Rahman <bofh_at_FreeBSD.org>
Date: Sat, 24 Jun 2023 04:38:00 UTC
The branch main has been updated by bofh:

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

commit abdfb41c181ba23a31c71860076c8815c98a93d3
Author:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
AuthorDate: 2023-06-24 00:36:01 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2023-06-24 04:37:51 +0000

    devel/gengetopt: Fix build with llvm16
    
    - Pet portclippy
    - Adopt port
    
    Sponsored by:   The FreeBSD Foundation
---
 devel/gengetopt/Makefile | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/devel/gengetopt/Makefile b/devel/gengetopt/Makefile
index cf04c959d9af..1d1f56bad4df 100644
--- a/devel/gengetopt/Makefile
+++ b/devel/gengetopt/Makefile
@@ -3,7 +3,7 @@ PORTVERSION=	2.23
 CATEGORIES=	devel
 MASTER_SITES=	GNU
 
-MAINTAINER=	ports@FreeBSD.org
+MAINTAINER=	bofh@FreeBSD.org
 COMMENT=	Tool for generating a C function which parses command line arguments
 WWW=		https://www.gnu.org/software/gengetopt/
 
@@ -13,22 +13,31 @@ LICENSE_FILE=	${WRKSRC}/COPYING
 USES=		makeinfo tar:xz
 
 GNU_CONFIGURE=	yes
+
 MAKE_JOBS_UNSAFE=yes
 
 CFLAGS+=	-D_GL_SYSTEM_GETOPT
 
 INSTALL_WRKSRC=	${WRKSRC}/src
 
+INFO=		gengetopt
 PORTDOCS=	*
 PORTEXAMPLES=	*
-INFO=		gengetopt
+
+OPTIONS_DEFINE=	DOCS EXAMPLES
 
 DOC_EXAMPLES=	README.example cmdline1.c cmdline1.h cmdline2.c cmdline2.h \
 		main1.cc main2.c multiple_example.c sample1.ggo sample2.ggo
 TESTS_EXAMPLES=	test_manual_help.c test_manual_help_cmd.c \
 		test_manual_help_cmd.ggo test_manual_help_cmd.h
 
-OPTIONS_DEFINE=	DOCS EXAMPLES
+.include <bsd.port.options.mk>
+
+post-patch:
+.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1400091
+	@${REINPLACE_CMD} -e 's|std::unary_function|std::__unary_function|' \
+		${WRKSRC}/src/gm_utils.h
+.endif
 
 post-install:
 	${INSTALL_MAN} ${WRKSRC}/doc/${PORTNAME}.1 \