|
root / base / xfe
xfe Plain Text 151 lines 5.8 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
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#!/bin/sh
# Build script for Xfe 2.1.8 (autotools, Template A + CXXFLAGS - C++ port).
# Consumes fox-toolkit via pkg-config (fox.pc, installed to $PREFIX by
# base/fox-toolkit). startup-notification is not ported, so it's disabled.
set -e

PORTDIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)

cd "$SRCDIR"

for p in "$PORTDIR"/patches/*.patch; do
    [ -f "$p" ] || continue
    echo "==> Applying patch: $(basename "$p")"
    patch -p1 < "$p"
done

# MANDATORY libtool fix - see Template A.
if [ -f configure ]; then
    sed -i -E 's/(kopensolaris\*-gnu)([^)]*\))/\1 | hammerhead*\2/' configure
fi

export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig:$PREFIX/share/pkgconfig:/usr/lib/pkgconfig:$PKG_CONFIG_PATH"
# Xfe's configure finds FOX via `pkg-config fox` (fox.pc) and also probes
# fox-config as a fallback - make sure both resolve under $PREFIX.
export PATH="$PREFIX/bin:$PATH"
export CFLAGS="${CFLAGS} -I$PREFIX/include -D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS"
export CXXFLAGS="${CXXFLAGS} -I$PREFIX/include -I$PREFIX/include/fox-1.6 -D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS"
export LDFLAGS="${LDFLAGS} -L$PREFIX/lib -R$PREFIX/lib"

./configure \
    --prefix="$PREFIX" \
    --build="$BUILD_TRIPLE" \
    --host="$BUILD_TRIPLE" \
    --sysconfdir="$SYSCONFDIR" \
    --disable-static

# GOTCHA: --disable-nls (tried first) has a bad side effect - it makes
# configure skip probing MSGFMT entirely and hardcode it to ":", which
# ALSO breaks `xfe.desktop: xfe.desktop.in` (Makefile.am's rule is
# literally `$(MSGFMT) --desktop -d po --template $< -o $@` - msgfmt has
# a `--desktop` mode used for both translation AND desktop-file
# generation). msgfmt itself IS present on Hammerhead and works fine;
# it's msgmerge (used only inside po/'s own stamp-po recipe, to refresh
# each lang's .po against the .pot before compiling it to .gmo) that's
# missing from our gettext install. So: leave NLS enabled (MSGFMT stays
# real) and instead drop `po` out of SUBDIRS post-configure, skipping
# recursion into the one directory that actually needs msgmerge - the
# top-level `xfe.desktop` rule doesn't need po/ built, it reads the raw
# .po files directly.
sed -i -E 's/^(SUBDIRS[[:space:]]*=[[:space:]]*)po /\1/' Makefile

# GOTCHA #2: turns out moot - Hammerhead's /usr/bin/msgfmt is itself
# non-functional (`msgfmt --version` -> "Cannot open file --version",
# i.e. not real GNU gettext), so configure's own functional probe
# resolves MSGFMT to ":" regardless of NLS/SUBDIRS. Not something to fix
# from this port (system gettext bug, not in scope for xfe/mupdf/neovim/
# XNEdit) - work around it here: since we have no translations to merge
# anyway (po/ excluded above), `msgfmt --desktop`/`--xml` on an
# untranslated build is equivalent to a plain copy of the .in template.
sed -i -E 's#\$\(MSGFMT\) --(desktop|xml) -d \$\(top_srcdir\)/po --template \$< -o \$@#cp $< $@#' Makefile

gmake -j${JOBS:-1}
gmake install DESTDIR="$PKGDIR"
# Xfe - X File Explorer, a lightweight file manager built on FOX
# https://sourceforge.net/projects/xfe/

[package]
name = "xfe"
version = "2.1.8"
release = 1
description = "X File Explorer - lightweight file manager (FOX toolkit)"
url = "https://sourceforge.net/projects/xfe/"
license = "GPL-2.0-or-later"
maintainer = "Chris Tusa <chris.tusa@leafscale.com>"
arch = "x86_64"

[dependencies]
runtime = ["fox-toolkit", "libX11", "libXft", "freetype", "fontconfig"]
build = ["fox-toolkit", "libX11", "libXft", "freetype", "fontconfig"]

[[source]]
file = "xfe-2.1.8.tar.xz"
urls = ["https://sourceforge.net/projects/xfe/files/xfe/2.1.8/xfe-2.1.8.tar.xz/download"]
checksum = "f539dd333296d91bd318ba62403bc7bee4069262df23f518e4453c80273b82be"

[build]
parallel = true
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)
     {
From: Chris Tusa <chris.tusa@leafscale.com>
Subject: st/st.c: openpty() header include for Hammerhead

The bundled st (simple terminal) code's openpty() include is gated on
__linux / BSD-family / __APPLE__ macros only. GCC on Hammerhead
(illumos derivative) predefines none of these, so <libutil.h> (the
header illumos itself ships openpty() in - confirmed present at
/usr/include/libutil.h) never gets included and openpty() is an
implicit (and, under GCC14, error-level) declaration. Add a fallback
#else including the same illumos-native libutil.h.

diff --git a/st/st.c b/st/st.c
--- a/st/st.c	2026-01-17 10:07:39.000000000 -0600
+++ b/st/st.c	2026-07-22 20:52:24.005607327 -0500
@@ -31,6 +31,8 @@
 #include <util.h>
 #elif defined(__FreeBSD__) || defined(__DragonFly__)
 #include <libutil.h>
+#else
+#include <libutil.h>
 #endif
 
 /* Arbitrary sizes */