git: 2b636272ac98 - main - games/chessx: Fix build with llvm16

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

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

commit 2b636272ac985fcc3b294a05e6caf87d5a642c52
Author:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
AuthorDate: 2023-07-21 16:14:10 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2023-07-21 17:20:03 +0000

    games/chessx: Fix build with llvm16
    
    Approved by:    portmgr (blanket)
    Sponsored by:   The FreeBSD Foundation
---
 games/chessx/Makefile | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/games/chessx/Makefile b/games/chessx/Makefile
index 7ea3139d624b..40234def862d 100644
--- a/games/chessx/Makefile
+++ b/games/chessx/Makefile
@@ -31,6 +31,14 @@ STOCKFISH_DESC=	Install Stockfish Chess Engine
 CRAFTY_RUN_DEPENDS=	crafty:games/crafty
 STOCKFISH_RUN_DEPENDS=	stockfish:games/stockfish
 
+.include <bsd.port.pre.mk>
+
+post-patch:
+.if ${COMPILER_TYPE} == clang && ${COMPILER_VERSION} >= 160
+	@${REINPLACE_CMD} -e 's|std::binary_function|std::__binary_function|' \
+		${WRKSRC}/src/database/polyglotdatabase.cpp
+.endif
+
 post-configure:
 	( cd ${BUILD_WRKSRC} && ${LRELEASE} ${WRKSRC}/${PORTNAME}.pro )
 
@@ -40,4 +48,4 @@ post-install:
 	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/chessx
 	${FIND} ${STAGEDIR}${PREFIX} -name 'ecp.????????' -delete
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>