git: 94d12ee1dfee - main - science/tfel: Fix build with llvm16

From: Muhammad Moinur Rahman <bofh_at_FreeBSD.org>
Date: Wed, 02 Aug 2023 21:18:27 UTC
The branch main has been updated by bofh:

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

commit 94d12ee1dfeebbda4be7236b4858af0762e7b389
Author:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
AuthorDate: 2023-08-02 20:10:22 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2023-08-02 21:18:14 +0000

    science/tfel: Fix build with llvm16
    
    Approved by:    portmgr (blanket)
    Sponsored by:   The FreeBSD Foundation
---
 science/tfel/Makefile | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/science/tfel/Makefile b/science/tfel/Makefile
index 445ee570f8cf..1e6fccf49434 100644
--- a/science/tfel/Makefile
+++ b/science/tfel/Makefile
@@ -41,10 +41,21 @@ CMAKE_ON+=	enable-portable-build
 
 TEST_TARGET=	check
 
+.include <bsd.port.pre.mk>
+
+post-patch:
+.if ${COMPILER_TYPE} == clang && ${COMPILER_VERSION} >= 160
+	@${REINPLACE_CMD} -e 's|std::unary_function|std::__unary_function|' \
+		${WRKSRC}/include/NUMODIS/Math/Utilities.hxx \
+		${WRKSRC}/include/TFEL/Math/General/Abs.hxx
+	@${REINPLACE_CMD} -e 's|std::binary_function|std::__binary_function|' \
+		${WRKSRC}/include/TFEL/Math/General/AbsCompare.hxx
+.endif
+
 post-install:
 	(cd ${STAGEDIR}${PREFIX} && ${PYTHON_CMD} ${PYTHON_LIBDIR}/compileall.py \
 		-d ${PREFIX} -f ${PYTHONPREFIX_SITELIBDIR:S,${PREFIX}/,,})
 	(cd ${STAGEDIR}${PREFIX} && ${PYTHON_CMD} -O ${PYTHON_LIBDIR}/compileall.py \
 		-d ${PREFIX} -f ${PYTHONPREFIX_SITELIBDIR:S,${PREFIX}/,,})
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>