Description: Update bundled Eigen to version 3.4.0 for ppc64el Altivec fix
 The previous bundled Eigen version was too old and used deprecated
 Altivec intrinsics (vec_lvsl, vec_lvsr, etc.), which fail to compile
 on little-endian PowerPC (ppc64el) with GCC 14+.
 Upstream Eigen resolved these issues in later releases (>= 3.3.9)
 by replacing those intrinsics with endian-agnostic ones (vec_xl, vec_xst).
 
 This patch updates the bundled Eigen tarball extraction logic to use
 Eigen 3.4.0 and adjusts one source file (Cma.cxx) to match the updated
 Eigen API (requires `.toDenseMatrix()` on diagonal expressions).
 
 This fixes FTBFS on ppc64el while remaining compatible with other architectures.
Author: Étienne Mollier <emollier@debian.org>
Bug-Debian: https://bugs.debian.org/1078136

---
The information above should follow the Patch Tagging Guidelines, please
checkout https://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: (upstream|backport|vendor|other), (<patch-url>|commit:<commit-id>)
Bug: <upstream-bugtracker-url>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: (no|not-needed|<patch-forwarded-url>)
Applied-Upstream: <version>, (<commit-url>|commit:<commid-id>)
Reviewed-By: <name and email of someone who approved/reviewed the patch>
Last-Update: 2025-11-13

--- arb-6.0.6.orig/HEADERLIBS/Makefile
+++ arb-6.0.6/HEADERLIBS/Makefile
@@ -4,10 +4,11 @@ all: eigen
 clean:
 	rm -rf eigen/
 
-EIGEN_PATCH=eigen_fix_gcc_610_compile.patch
-
-eigen: eigen.tgz $(EIGEN_PATCH) Makefile
-	tar -zxvf $<
-	patch -p0 < $(EIGEN_PATCH)
+# Unpack newer Eigen 3.4.0 instead of old tarball
+eigen: eigen.tgz Makefile
+	@echo "Unpacking Eigen3...."
+	tar -xzf eigen.tgz
+	mv eigen-* eigen
+	@echo "Using bundled Eigen 3 from HEADERLIBS/eigen"
 	touch eigen/
 
--- arb-6.0.6.orig/Makefile
+++ arb-6.0.6/Makefile
@@ -580,7 +580,7 @@ LIBPATH = -L$(ARBHOME)/lib
 DEST_LIB = lib
 DEST_BIN = bin
 
-CC_INCLUDES  := -I. -I$(ARBHOME)/INCLUDE $(XINCLUDES) $(ARB_GLIB_INCLUDE)
+CC_INCLUDES  := -I$(ARBHOME)/HEADERLIBS/eigen -I. -I$(ARBHOME)/INCLUDE $(XINCLUDES) $(ARB_GLIB_INCLUDE)
 CXX_INCLUDES := $(CC_INCLUDES)
 MAKEDEPENDFLAGS := -- -DARB_OPENGL -DUNIT_TESTS -D__cplusplus -I. -Y$(ARBHOME)/INCLUDE
 
--- arb-6.0.6.orig/RNACMA/Cma.cxx
+++ arb-6.0.6/RNACMA/Cma.cxx
@@ -93,7 +93,7 @@ MatrixXd Cma::computeMutualInformation(V
 
     JointEntropy = computeJointEntropy(seq);
 
-    JointEntropy = JointEntropy + JointEntropy.adjoint() - JointEntropy.diagonal().asDiagonal();
+    JointEntropy = (JointEntropy + JointEntropy.adjoint() - JointEntropy.diagonal().asDiagonal().toDenseMatrix()).eval();
 
     entropy = JointEntropy.diagonal();
 
