git: efce6b376fbf - main - cad/brlcad: drop VSX requirement on powerpc64

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Fri, 11 Sep 2026 12:50:26 UTC
The branch main has been updated by pkubaj:

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

commit efce6b376fbf93fcbee542f47dcea038080171ef
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2026-09-04 13:45:09 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2026-09-11 12:49:29 +0000

    cad/brlcad: drop VSX requirement on powerpc64
    
    Merge upstream eigen patches to drop VSX requirement on powerpc64
    and build on G5.
---
 cad/brlcad/Makefile                                |  2 +-
 cad/brlcad/files/patch-src_other_Eigen_Eigen_Core  | 11 +++++++++++
 ...gen_Eigen_src_Core_arch_AltiVec_MathFunctions.h | 23 ++++++++++++++++++++++
 ..._Eigen_Eigen_src_Core_arch_AltiVec_PacketMath.h | 15 ++++++++++++++
 4 files changed, 50 insertions(+), 1 deletion(-)

diff --git a/cad/brlcad/Makefile b/cad/brlcad/Makefile
index 414f0a16ec35..dd926475ec3a 100644
--- a/cad/brlcad/Makefile
+++ b/cad/brlcad/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	brlcad
 PORTVERSION=	7.32.6
+PORTREVISION=	1
 CATEGORIES=	cad
 MASTER_SITES=	https://github.com/BRL-CAD/brlcad/releases/download/rel-${PORTVERSION:S/./-/g}/
 
@@ -27,7 +28,6 @@ USE_XORG=	ice sm x11 xau xcb xdamage xdmcp xext xfixes xft xi \
 
 CMAKE_OFF=	BRLCAD_ENABLE_STRICT
 CMAKE_INSTALL_PREFIX=	${PREFIX}/${PORTNAME}
-CXXFLAGS_powerpc64=	-mvsx
 
 TEST_TARGET=	check
 
diff --git a/cad/brlcad/files/patch-src_other_Eigen_Eigen_Core b/cad/brlcad/files/patch-src_other_Eigen_Eigen_Core
new file mode 100644
index 000000000000..cdc51eddf4dd
--- /dev/null
+++ b/cad/brlcad/files/patch-src_other_Eigen_Eigen_Core
@@ -0,0 +1,11 @@
+--- src/other/Eigen/Eigen/Core.orig	2022-05-09 03:00:08 UTC
++++ src/other/Eigen/Eigen/Core	2026-09-02 17:05:45 UTC
+@@ -346,7 +346,7 @@
+ #include "src/Core/CoreIterators.h"
+ #include "src/Core/ConditionEstimator.h"
+ 
+-#if defined(EIGEN_VECTORIZE_ALTIVEC) || defined(EIGEN_VECTORIZE_VSX)
++#if defined(EIGEN_VECTORIZE_VSX)
+   #include "src/Core/arch/AltiVec/MatrixProduct.h"
+ #elif defined EIGEN_VECTORIZE_NEON
+   #include "src/Core/arch/NEON/GeneralBlockPanelKernel.h"
diff --git a/cad/brlcad/files/patch-src_other_Eigen_Eigen_src_Core_arch_AltiVec_MathFunctions.h b/cad/brlcad/files/patch-src_other_Eigen_Eigen_src_Core_arch_AltiVec_MathFunctions.h
new file mode 100644
index 000000000000..bb919f464cc1
--- /dev/null
+++ b/cad/brlcad/files/patch-src_other_Eigen_Eigen_src_Core_arch_AltiVec_MathFunctions.h
@@ -0,0 +1,23 @@
+--- src/other/Eigen/Eigen/src/Core/arch/AltiVec/MathFunctions.h.orig	2022-05-09 03:00:08 UTC
++++ src/other/Eigen/Eigen/src/Core/arch/AltiVec/MathFunctions.h	2026-09-02 17:05:45 UTC
+@@ -76,6 +76,20 @@
+ }
+ #endif
+ 
++#ifndef __VSX__
++template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED
++Packet4f psqrt<Packet4f>(const Packet4f& x)
++{
++  EIGEN_ALIGN16 float a[4];
++  pstore(a, x);
++  a[0] = numext::sqrt(a[0]);
++  a[1] = numext::sqrt(a[1]);
++  a[2] = numext::sqrt(a[2]);
++  a[3] = numext::sqrt(a[3]);
++  return pload<Packet4f>(a);
++}
++#endif
++
+ // Hyperbolic Tangent function.
+ template <>
+ EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet4f
diff --git a/cad/brlcad/files/patch-src_other_Eigen_Eigen_src_Core_arch_AltiVec_PacketMath.h b/cad/brlcad/files/patch-src_other_Eigen_Eigen_src_Core_arch_AltiVec_PacketMath.h
new file mode 100644
index 000000000000..a1a2cea58b39
--- /dev/null
+++ b/cad/brlcad/files/patch-src_other_Eigen_Eigen_src_Core_arch_AltiVec_PacketMath.h
@@ -0,0 +1,15 @@
+--- src/other/Eigen/Eigen/src/Core/arch/AltiVec/PacketMath.h.orig	2022-05-09 03:00:08 UTC
++++ src/other/Eigen/Eigen/src/Core/arch/AltiVec/PacketMath.h	2026-09-02 17:05:45 UTC
+@@ -1340,9 +1340,11 @@
+ template<> EIGEN_STRONG_INLINE Packet8bf psub<Packet8bf>(const Packet8bf& a, const Packet8bf& b) {
+   BF16_TO_F32_BINARY_OP_WRAPPER(psub<Packet4f>, a, b);
+ }
++
++template<> Packet4f psqrt<Packet4f>(const Packet4f& x);
+ 
+ template<> EIGEN_STRONG_INLINE Packet8bf psqrt<Packet8bf> (const Packet8bf& a){
+-  BF16_TO_F32_UNARY_OP_WRAPPER(vec_sqrt, a);
++  BF16_TO_F32_UNARY_OP_WRAPPER(psqrt<Packet4f>, a);
+ }
+ template<> EIGEN_STRONG_INLINE Packet8bf prsqrt<Packet8bf> (const Packet8bf& a){
+   BF16_TO_F32_UNARY_OP_WRAPPER(prsqrt<Packet4f>, a);