git: 093529f53cfa - main - graphics/diplib: drop VSX requirement

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

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

commit 093529f53cfae44b45d3ff0e3a204445a917b102
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2026-09-03 08:24:29 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2026-09-11 12:49:16 +0000

    graphics/diplib: drop VSX requirement
    
    Merge upstream eigen patches to allow building on G5.
---
 graphics/diplib/Makefile                           |  2 +-
 .../files/patch-dependencies_eigen3_Eigen_Core     | 11 +++++++++++
 ...en3_Eigen_src_Core_arch_AltiVec_MathFunctions.h | 23 ++++++++++++++++++++++
 ...eigen3_Eigen_src_Core_arch_AltiVec_PacketMath.h | 15 ++++++++++++++
 4 files changed, 50 insertions(+), 1 deletion(-)

diff --git a/graphics/diplib/Makefile b/graphics/diplib/Makefile
index 1ff92401c233..f957b6fab0bc 100644
--- a/graphics/diplib/Makefile
+++ b/graphics/diplib/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	diplib
 DISTVERSION=	3.6.1
+PORTREVISION=	1
 CATEGORIES=	graphics
 
 MAINTAINER=	yuri@FreeBSD.org
@@ -20,7 +21,6 @@ USE_LDCONFIG=	yes
 USE_GITHUB=	yes
 GH_ACCOUNT=	DIPlib
 
-CXXFLAGS_powerpc64=	-mvsx
 CMAKE_OFF=	DIP_BUILD_PYDIP \
 		DIP_BUILD_EXAMPLES
 CMAKE_TESTING_ON=	DIP_ENABLE_DOCTEST
diff --git a/graphics/diplib/files/patch-dependencies_eigen3_Eigen_Core b/graphics/diplib/files/patch-dependencies_eigen3_Eigen_Core
new file mode 100644
index 000000000000..6cbc25d5a19c
--- /dev/null
+++ b/graphics/diplib/files/patch-dependencies_eigen3_Eigen_Core
@@ -0,0 +1,11 @@
+--- dependencies/eigen3/Eigen/Core.orig	2026-06-27 21:12:34 UTC
++++ dependencies/eigen3/Eigen/Core	2026-09-02 17:05:45 UTC
+@@ -347,7 +347,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/graphics/diplib/files/patch-dependencies_eigen3_Eigen_src_Core_arch_AltiVec_MathFunctions.h b/graphics/diplib/files/patch-dependencies_eigen3_Eigen_src_Core_arch_AltiVec_MathFunctions.h
new file mode 100644
index 000000000000..a06e8acfb99f
--- /dev/null
+++ b/graphics/diplib/files/patch-dependencies_eigen3_Eigen_src_Core_arch_AltiVec_MathFunctions.h
@@ -0,0 +1,23 @@
+--- dependencies/eigen3/Eigen/src/Core/arch/AltiVec/MathFunctions.h.orig	2026-06-27 21:12:34 UTC
++++ dependencies/eigen3/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/graphics/diplib/files/patch-dependencies_eigen3_Eigen_src_Core_arch_AltiVec_PacketMath.h b/graphics/diplib/files/patch-dependencies_eigen3_Eigen_src_Core_arch_AltiVec_PacketMath.h
new file mode 100644
index 000000000000..6f788c6053a8
--- /dev/null
+++ b/graphics/diplib/files/patch-dependencies_eigen3_Eigen_src_Core_arch_AltiVec_PacketMath.h
@@ -0,0 +1,15 @@
+--- dependencies/eigen3/Eigen/src/Core/arch/AltiVec/PacketMath.h.orig	2026-06-27 21:12:34 UTC
++++ dependencies/eigen3/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);