|
root / base / xfe / patches / 0001-pkg-format-hammerhead-fallback.patch
0001-pkg-format-hammerhead-fallback.patch Diff 41 lines 1.3 KB
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From: Chris Tusa <chris.tusa@leafscale.com>
Subject: pkg_format/OTHER_PKG: declare on non-Linux/FreeBSD (Hammerhead)

Both pkg_format (main.cpp) and the OTHER_PKG constant it's
initialized to (xfedefs.h) are gated behind #if defined(__FreeBSD__)
or #if defined(linux) (used later, unconditionally, to seed the
"package_format" registry entry read by Xfe's open-with/install-package
UI). GCC on Hammerhead (illumos derivative) predefines neither macro,
so neither the constant nor the variable exist and the
writeUnsignedEntry(..., pkg_format) call fails to compile. Add a
Hammerhead/generic-illumos fallback in both files that just defaults
to OTHER_PKG (we have no deb/rpm-equivalent to autodetect and don't
want one guessed).

diff --git a/src/xfedefs.h b/src/xfedefs.h
--- a/src/xfedefs.h	2026-02-08 05:02:51.000000000 -0600
+++ b/src/xfedefs.h	2026-07-22 20:50:35.798811328 -0500
@@ -426,3 +426,7 @@
 #define OTHER_PKG    2
 
 #endif
+
+#if !defined(__FreeBSD__) && !defined(linux)
+#define OTHER_PKG    2
+#endif

diff --git a/src/main.cpp b/src/main.cpp
--- a/src/main.cpp	2026-01-17 10:07:41.000000000 -0600
+++ b/src/main.cpp	2026-07-22 20:50:35.798910014 -0500
@@ -423,6 +423,10 @@
     }
 #endif
 
+#if !defined(__FreeBSD__) && !defined(linux)
+    FXuint pkg_format = OTHER_PKG;
+#endif
+
     // Parse basic arguments
     for (i = 1; i < argc; ++i)
     {