Add Windows cross-compilation via MinGW, and fix Docker build permission
build / build (push) Successful in 3m5s

issues on vboxsf-mounted checkouts

New `make dist-win`/`package-win` targets (folded into `dist`/`package`
alongside the renamed `dist-linux`/`package-linux`) cross-compile
systemshock.exe via MinGW, using prebuilt SDL2/SDL2_mixer/GLEW/
fluidsynth-lite baked into the build-image - no Windows machine or Wine
needed to build it, confirmed working and playable on a real Windows
machine. dist-win/ ships DLLs flat alongside the exe plus a new
res/run.bat launcher, packaged into a .zip the same way dist/ becomes a
.tar.gz.

Also fixes three build-image bugs hit while testing on a VirtualBox
vboxsf-mounted checkout: build-engine.sh/docker-entrypoint.sh losing
their execute bit (chmod +x on restrictive source perms), the container
user missing access to /workspace's supplementary vboxsf group, and
cp -a failing on symlink/hard-link creation (vboxsf doesn't support
either) - now falls back to dereferencing copies when detected. Also
adds Docker/zip/etc. prerequisites to the README for both the desktop
and Quest builds.
This commit is contained in:
2026-08-11 05:14:13 +02:00
parent 581af95e7b
commit a2fb95e57b
11 changed files with 457 additions and 47 deletions
+23 -4
View File
@@ -22,9 +22,28 @@ cd "$ENGINE_DIR"
echo "== Wiring up prebuilt SDL2/SDL2_mixer/fluidsynth-lite from the image =="
rm -rf build_ext
mkdir -p build_ext
cp -a /opt/prebuilt/built_sdl build_ext/
cp -a /opt/prebuilt/built_sdl_mixer build_ext/
cp -a /opt/prebuilt/fluidsynth-lite build_ext/
# Some filesystems the repo might be checked out on (e.g. a VirtualBox
# vboxsf shared folder) refuse to create symlinks at all ("Operation not
# permitted"), which plain `cp -a` needs for SDL2/SDL2_mixer's
# libFoo.so -> libFoo.so.N -> libFoo.so.N.M dev-symlink chain. Detect
# that up front, once, and copy real file content instead of recreating
# links if so, rather than failing partway through. `-a` implies
# --preserve=all (which includes hard-link relationships between files,
# not just symlinks - SDL2's install hard-links the two most-specific
# version files together), so --no-preserve=links is needed alongside
# --dereference to avoid that too.
CP_FLAGS=(-a)
if ! ln -s test-target build_ext/.symlink-test 2>/dev/null; then
echo "(destination filesystem doesn't support symlinks - copying real file content instead)"
CP_FLAGS=(-a --dereference --no-preserve=links)
else
rm -f build_ext/.symlink-test
fi
cp "${CP_FLAGS[@]}" /opt/prebuilt/built_sdl build_ext/
cp "${CP_FLAGS[@]}" /opt/prebuilt/built_sdl_mixer build_ext/
cp "${CP_FLAGS[@]}" /opt/prebuilt/fluidsynth-lite build_ext/
echo "== Configuring (CMake, BUNDLED SDL2/SDL2_mixer/FluidSynth) =="
rm -f CMakeCache.txt
@@ -38,7 +57,7 @@ rm -rf "$OUT_DIR"
mkdir -p "$OUT_DIR/lib"
cp systemshock "$OUT_DIR/"
find build_ext/built_sdl/lib build_ext/built_sdl_mixer/lib build_ext/fluidsynth-lite/src \
-name '*.so*' -not -name '*.la' -exec cp -a {} "$OUT_DIR/lib/" \;
-name '*.so*' -not -name '*.la' -exec cp "${CP_FLAGS[@]}" {} "$OUT_DIR/lib/" \;
cp /opt/prebuilt/soundfont/default.sf2 "$OUT_DIR/soundfont.sf2"
echo "== Done =="