#!/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 " 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 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 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 (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 #elif defined(__FreeBSD__) || defined(__DragonFly__) #include +#else +#include #endif /* Arbitrary sizes */