git: 678f8c187609 - main - irc/bitchx: Fix build with llvm16

From: Muhammad Moinur Rahman <bofh_at_FreeBSD.org>
Date: Thu, 20 Jul 2023 17:43:26 UTC
The branch main has been updated by bofh:

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

commit 678f8c1876091fe03c0fca32a84b8c40a25d2e55
Author:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
AuthorDate: 2023-07-20 14:52:58 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2023-07-20 17:42:36 +0000

    irc/bitchx: Fix build with llvm16
    
    - Pet portclippy
    - STRIP files as required
    - Replace @exec with @rmtry
    
    Sponsored by:   The FreeBSD Foundation
---
 irc/bitchx/Makefile  | 38 ++++++++++++++++++++++++--------------
 irc/bitchx/pkg-plist |  2 +-
 2 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/irc/bitchx/Makefile b/irc/bitchx/Makefile
index cb75f006c146..45c71ac286d5 100644
--- a/irc/bitchx/Makefile
+++ b/irc/bitchx/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	bitchx
 PORTVERSION=	1.2.1
-PORTREVISION=	2
+PORTREVISION=	3
 PORTEPOCH=	1
 CATEGORIES+=	irc
 MASTER_SITES=	SF/${PORTNAME}/ircii-pana/${PORTNAME}-${DISTVERSION}
@@ -13,40 +13,45 @@ LICENSE=	BSD3CLAUSE
 LICENSE_FILE=	${WRKSRC}/COPYRIGHT
 
 USES=		cpe gmake ncurses
+
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS+=--exec-prefix="${PREFIX}/share" \
 		--bindir="${PREFIX}/bin" \
 		--datadir="${PREFIX}/share" \
 		--libdir="${PREFIX}/share"
 
+MAKE_JOBS_UNSAFE=	yes
+
 CONFLICTS_INSTALL?=	zh-bitchx
 
-OPTIONS_SUB=	yes
+DATADIR=	${PREFIX}/share/bx
+DOCSDIR=	${PREFIX}/share/bx/help
 
 PLIST_SUB+=	DISTVERSION=${DISTVERSION}
-DOCSDIR=	${PREFIX}/share/bx/help
 PORTDOCS=	*
-DATADIR=	${PREFIX}/share/bx
-
-MAKE_JOBS_UNSAFE=	yes
 
 OPTIONS_DEFINE=	DOCS LANG_HE IPV6 LATIN PLUGINS SSL TOGGLES
 OPTIONS_DEFAULT=	PLUGINS SSL
+OPTIONS_SUB=	yes
 
 LATIN_DESC=	Recommended for ISO-8859-1 display
 PLUGINS_DESC=	Build a handful of BitchX plugins
 TOGGLES_DESC=	Disable annoyance toggles
 
 IPV6_CONFIGURE_ENABLE=	ipv6
-
-SSL_CONFIGURE_WITH=	ssl="${OPENSSLBASE}"
-SSL_USES=		ssl
-
 PLUGINS_CONFIGURE_WITH=	plugins="${PLUGIN_LIST:C/\$$/,/g}"
+SSL_USES=		ssl
+SSL_CONFIGURE_WITH=	ssl="${OPENSSLBASE}"
 
 PLUGIN_LIST=	abot acro arcfour autocycle blowfish cavlink cdrom encrypt \
 		europa fserv hint nap nicklist pkga possum qbx qmail wavplay
 
+.include <bsd.port.options.mk>
+
+.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1400091
+CFLAGS+=	-Wno-error=incompatible-function-pointer-types
+.endif
+
 post-patch:
 	${REINPLACE_CMD} -e 's|bzip2|true|g' ${WRKSRC}/Makefile.in
 	${REINPLACE_CMD} -e 's|SSLeay|ERR_get_error|' ${WRKSRC}/configure
@@ -55,14 +60,14 @@ post-patch-DOCS-on:
 	@${MKDIR} ${STAGEDIR}${DOCSDIR}
 	cd ${WRKSRC}/bitchx-docs && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}
 
-post-patch-LATIN-on:
-	${REINPLACE_CMD} -e 's|#undef LATIN1|#define LATIN1|' \
-		${WRKSRC}/include/config.h
-
 post-patch-LANG_HE-on:
 	${REINPLACE_CMD} -e 's|#undef WANT_HEBREW|#define WANT_HEBREW|' \
 		${WRKSRC}/include/config.h
 
+post-patch-LATIN-on:
+	${REINPLACE_CMD} -e 's|#undef LATIN1|#define LATIN1|' \
+		${WRKSRC}/include/config.h
+
 post-patch-TOGGLES-on:
 	${REINPLACE_CMD} -e 's|DEFAULT_AUTO_AWAY ON|DEFAULT_AUTO_AWAY OFF|' \
 		${WRKSRC}/include/config.h
@@ -71,4 +76,9 @@ post-patch-TOGGLES-on:
 	${REINPLACE_CMD} -e 's|DEFAULT_AUTO_REJOIN ON|DEFAULT_AUTO_REJOIN OFF|' \
 		${WRKSRC}/include/config.h
 
+post-stage:
+	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/*
+	${STRIP_CMD} ${STAGEDIR}${PREFIX}/share/bx/plugins/*.so
+	${STRIP_CMD} ${STAGEDIR}${PREFIX}/share/bx/wserv
+
 .include <bsd.port.mk>
diff --git a/irc/bitchx/pkg-plist b/irc/bitchx/pkg-plist
index c3bed8d5e068..d90c66f1e53e 100644
--- a/irc/bitchx/pkg-plist
+++ b/irc/bitchx/pkg-plist
@@ -1,4 +1,3 @@
-@unexec if [ -f %D/%%DATADIR%%/script/bxglobal.old ]; then rm -f %D/share/bx/script/bxglobal.old; fi
 bin/BitchX
 bin/BitchX-%%DISTVERSION%%
 bin/scr-bx
@@ -76,3 +75,4 @@ man/man1/BitchX.1.gz
 %%DATADIR%%/translation/UNITED_KINGDOM
 %%DATADIR%%/translation/UNITED_KINGDOM_COM
 %%DATADIR%%/wserv
+@rmtry %%DATADIR%%/script/bxglobal.old