git: c96075994621 - main - print/scribus-devel: fix build with llvm16 while keeping compatibility with older llvm

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Tue, 15 Aug 2023 23:20:39 UTC
The branch main has been updated by pkubaj:

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

commit c960759946217abeef45e5f39e7b224d69812730
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2023-08-15 23:19:31 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2023-08-15 23:19:31 +0000

    print/scribus-devel: fix build with llvm16 while keeping compatibility with older llvm
    
    Previous fix broke llvm < 16.
    
    PR:     273140
---
 print/scribus-devel/Makefile                               |  9 ++++++++-
 .../scribus-devel/files/patch-scribus_desaxe_digester.cpp  | 14 --------------
 2 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/print/scribus-devel/Makefile b/print/scribus-devel/Makefile
index feae31864363..aad5a04d62c5 100644
--- a/print/scribus-devel/Makefile
+++ b/print/scribus-devel/Makefile
@@ -50,6 +50,8 @@ CMAKE_ARGS+=	-DWANT_HUNSPELL=YES \
 
 OPTIONS_DEFINE=	DOCS
 
+.include <bsd.port.pre.mk>
+
 # Patch sources to force using include files installed by graphics/podofo09
 post-patch:
 	@${REINPLACE_CMD} -e '/^[\t ]*#include/s|podofo/podofo.h|podofo09/podofo.h|' \
@@ -58,9 +60,14 @@ post-patch:
 		${WRKSRC}/scribus/imagedataloaders/scimgdataloader_pdf.cpp \
 		${WRKSRC}/scribus/pdflib_core.h \
 		${WRKSRC}/scribus/pdf_analyzer.h
+.if ${COMPILER_TYPE} == clang && ${COMPILER_VERSION} >= 160
+	@${REINPLACE_CMD} -e 's|std::unary_function|std::__unary_function|' \
+		${WRKSRC}/scribus/desaxe/digester.cpp
+.endif
+
 
 post-install:
 		${LN} -sf ../share/icons/1_5_1/scribus.png \
 			${STAGEDIR}${PREFIX}/share/pixmaps/
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/print/scribus-devel/files/patch-scribus_desaxe_digester.cpp b/print/scribus-devel/files/patch-scribus_desaxe_digester.cpp
deleted file mode 100644
index db186823e4bd..000000000000
--- a/print/scribus-devel/files/patch-scribus_desaxe_digester.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
---- scribus/desaxe/digester.cpp.orig	2023-07-31 21:07:27 UTC
-+++ scribus/desaxe/digester.cpp
-@@ -448,7 +448,11 @@ automata::NFA<nfa_state_t, token_t>* RuleState::create
- 	return nfa;
- }
- 
-+#if __cplusplus >= 201703L // ISO C++ 2017 or newer.
-+struct CreateDFAState : public std::__unary_function <std::set<nfa_state_t>, dfa_state_t> {
-+#else
- struct CreateDFAState : public std::unary_function <std::set<nfa_state_t>, dfa_state_t> {
-+#endif
- 
- 	CreateDFAState(const std::vector<rule_t>& rules, const std::vector<nfa_state_t>& accepting) 
- 	: n(0), rules_(rules), accepting_(accepting)