]> dgit.raspbian.org Git - solvespace.git/commitdiff
Fix FTBFS on ppc64el: include Eigen before X11 headers
authorAnton Gladky <gladk@debian.org>
Sat, 3 Oct 2026 13:38:15 +0000 (15:38 +0200)
committerAnton Gladky <gladk@debian.org>
Sat, 3 Oct 2026 13:39:29 +0000 (15:39 +0200)
Xlib.h (pulled in via spnav.h) defines the macro Complex, which breaks
Eigen's AltiVec template code in src/platform/guigtk.cpp.

debian/changelog
debian/patches/08-Include-Eigen-before-X11-headers.patch [new file with mode: 0644]
debian/patches/series

index aea836fb9ed0bd8c3301b7a73f4b7dcb8f011954..ea02f8da6c8c39a79d68d4e588a026d9ffd7a514 100644 (file)
@@ -1,3 +1,9 @@
+solvespace (3.2+dfsg-5) UNRELEASED; urgency=medium
+
+  * Include Eigen before X11 headers to fix FTBFS on ppc64el.
+
+ -- Anton Gladky <gladk@debian.org>  Sat, 03 Oct 2026 15:38:15 +0200
+
 solvespace (3.2+dfsg-4) unstable; urgency=medium
 
   * Reupload with libdxfrw tarball (Closes: #1149826)
diff --git a/debian/patches/08-Include-Eigen-before-X11-headers.patch b/debian/patches/08-Include-Eigen-before-X11-headers.patch
new file mode 100644 (file)
index 0000000..0438a23
--- /dev/null
@@ -0,0 +1,33 @@
+Description: Include solvespace.h before spnav.h in the GTK frontend
+ spnav.h includes <X11/Xlib.h>, which does "#define Complex 0". When Eigen
+ is included afterwards, its AltiVec backend (used on ppc64el) fails to
+ compile because it uses "bool Complex" as a template parameter name.
+ Include solvespace.h, and therefore Eigen, before the X11 headers.
+Author: Anton Gladky <gladk@debian.org>
+Forwarded: no
+Last-Update: 2026-10-03
+
+Index: src/platform/guigtk.cpp
+--- a/src/platform/guigtk.cpp
++++ b/src/platform/guigtk.cpp
+@@ -32,6 +32,11 @@
+ #   include <gtkmm/filechoosernative.h>
+ #endif
+ 
++// Include solvespace.h (and thus Eigen) before spnav.h: the latter pulls in
++// <X11/Xlib.h>, which defines macros such as `Complex` that break Eigen's
++// AltiVec template code on ppc64el.
++#include "solvespace.h"
++
+ #if defined(HAVE_SPACEWARE)
+ #   include <spnav.h>
+ #   include <gdk/gdk.h>
+@@ -48,8 +53,6 @@
+ #   endif
+ #endif
+ 
+-#include "solvespace.h"
+-
+ namespace SolveSpace {
+ namespace Platform {
+ 
index cb9afd120c0dba6cf1fbcf5abab5f190ea2547b5..40ee8ceb53f0ce2f85227fb0d13a3483a2939d9b 100644 (file)
@@ -5,3 +5,4 @@
 05-Adjust-extlib-include-path.patch
 06-Build-with-system-mimalloc.patch
 07-Support-Eigen-5.patch
+08-Include-Eigen-before-X11-headers.patch