git: 3fc69f53ece7 - main - graphics/opencv: when on POWER9 on powerpc64le, allow setting VSX3 as baseline

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Wed, 21 Jun 2023 11:33:46 UTC
The branch main has been updated by pkubaj:

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

commit 3fc69f53ece7bcd9cb7083fbbce75897f2fdfba7
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2023-06-21 10:19:19 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2023-06-21 11:33:46 +0000

    graphics/opencv: when on POWER9 on powerpc64le, allow setting VSX3 as baseline
    
    Also GCC is necessary because base LLVM 15 fails with:
    UNREACHABLE executed at /usr/src/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp:11135!
    
    LLVM 16 also crashes and it seems 17 has already fixed this issue.
---
 graphics/opencv/Makefile | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/graphics/opencv/Makefile b/graphics/opencv/Makefile
index 889d8c8ff414..e00fa76edfc2 100644
--- a/graphics/opencv/Makefile
+++ b/graphics/opencv/Makefile
@@ -19,7 +19,7 @@ LIB_DEPENDS=	libfreetype.so:print/freetype2 \
 		libharfbuzz.so:print/harfbuzz \
 		libhdf5.so:science/hdf5
 
-USES=		cmake compiler:c++14-lang cpe localbase:ldflags pkgconfig
+USES=		cmake cpe localbase:ldflags pkgconfig
 USE_GITHUB=	yes
 GH_ACCOUNT=	WeChatCV:wechat
 GH_PROJECT=	opencv_contrib:contrib \
@@ -214,6 +214,15 @@ OPENJPEG_LIB_DEPENDS=	libopenjp2.so:graphics/openjpeg
 _IPPICV_i386=		ippicv/ippicv_2020_lnx_ia32_20191018_general.tgz
 _IPPICV_amd64=		ippicv/ippicv_2020_lnx_intel64_20191018_general.tgz
 
+.include <bsd.port.options.mk>
+
+.if ${ARCH} == powerpc64le && defined(MACHINE_CPU) && ${MACHINE_CPU:Mvsx3}
+CMAKE_ARGS+=		-DCPU_BASELINE:STRING="VSX;VSX3;"
+USES+=			compiler:gcc-c++11-lib
+.else
+USES+=			compiler:c++14-lang
+.endif
+
 post-extract:
 	# Handle contrib
 	${MV} ${WRKSRC_contrib} ${WRKSRC}/contrib