git: 5111b40cb9eb - main - databases/mdbtools: Workaround breakage from llvm15

From: Rainer Hurling <rhurlin_at_FreeBSD.org>
Date: Sat, 25 Feb 2023 16:43:21 UTC
The branch main has been updated by rhurlin:

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

commit 5111b40cb9eb3a6b9cea4467145893fd7caa4e86
Author:     Rainer Hurling <rhurlin@FreeBSD.org>
AuthorDate: 2023-02-25 10:53:53 +0000
Commit:     Rainer Hurling <rhurlin@FreeBSD.org>
CommitDate: 2023-02-25 16:42:53 +0000

    databases/mdbtools: Workaround breakage from llvm15
    
    parser.c:1035:9: error: variable 'yynerrs' set but not used [-Werror,-Wunused-but-set-variable]
        int yynerrs = 0;
    
    The parser code is created at build time. llvm15 complains about the not used variable.
    Avoiding llvm15 is just a workaround, until a better solution is around.
    
    Reported by:    pkg-fallout
---
 databases/mdbtools/Makefile | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/databases/mdbtools/Makefile b/databases/mdbtools/Makefile
index fd144aefbed7..3da1f8d445f1 100644
--- a/databases/mdbtools/Makefile
+++ b/databases/mdbtools/Makefile
@@ -18,14 +18,13 @@ RUN_DEPENDS=	bash-completion>=0:shells/bash-completion
 
 USES=		bison cpe gnome iconv:wchar_t libtool pathfix \
 		pkgconfig readline
+CPE_VENDOR=	mdbtools_project
 USE_GNOME=	glib20
 USE_LDCONFIG=	yes
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS=	${ICONV_CONFIGURE_ARG} \
 		--with-unixodbc=${LOCALBASE}
 
-CPE_VENDOR=	mdbtools_project
-
 INSTALL_TARGET=	install-strip
 
 OPTIONS_DEFINE=		DOCS MANPAGES LIBMSWSTR NLS
@@ -41,8 +40,21 @@ NLS_USES=			gettext
 
 DOCS=		AUTHORS HACKING.md NEWS README.md
 
+.include <bsd.port.pre.mk>
+
+.if ${LLVM_DEFAULT} >= 15
+# With LLVM15:  parser.c:1053:9: error:
+# variable 'yynerrs' set but not used [-Werror,-Wunused-but-set-variable]
+BUILD_DEPENDS+=	llvm-config${LLVM_VER}:devel/llvm${LLVM_VER}
+LLVM_VER=	14
+#CMAKE_ARGS+=	-DLLVM_DIR=${LOCALBASE}/llvm${LLVM_VER}/lib/cmake/llvm
+CC=		clang${LLVM_VER}
+CPP=		clang-cpp${LLVM_VER}
+CXX=		clang++${LLVM_VER}
+.endif
+
 post-install-DOCS-on:
 	@${MKDIR} ${STAGEDIR}${DOCSDIR}
 	${INSTALL_DATA} ${DOCS:S,^,${WRKSRC}/,}  ${STAGEDIR}${DOCSDIR}
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>