aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorSulfurNitride <SulfurNitride@users.noreply.github.com>2026-03-11 02:50:50 -0500
committerSulfurNitride <SulfurNitride@users.noreply.github.com>2026-03-11 02:50:50 -0500
commitb1ce38db496c9692bca512e6bd76050ef79f61c2 (patch)
treeb97ab46ec2862f1a406594d21f492cca1b1330ef /build.sh
parent7821fadddc8af8b1a712b0da02e35534996da422 (diff)
FUSE VFS performance, tracked writes fix, remove steam-run, add NixOS flake
- FUSE: disable AUTO_INVAL_DATA, enable readdirplus, 24h TTLs, clone_fd, FUSE_USE_VERSION=312 — cuts game load time from 2:40 to 1:57 - Fix tracked writes going to wrong (lower-priority) mod in both detectManualMoves and syncOverwrite - Remove steam-run entirely (UI, C++, Rust layers) - Build system: default to tarball, add installer/appimage as opt-in modes - Add flake.nix for NixOS — builds from source with Rust crates as separate pure derivations, FHS wrapper, NixOS module with FUSE passthrough Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh43
1 files changed, 34 insertions, 9 deletions
diff --git a/build.sh b/build.sh
index 751a916..dac1aec 100755
--- a/build.sh
+++ b/build.sh
@@ -4,7 +4,11 @@ set -euo pipefail
# Build Fluorine Manager using Docker.
#
# Usage:
-# ./build.sh # Build AppImage + staging dir
+# ./build.sh # Build portable .tar.gz (default)
+# ./build.sh tarball # Build portable .tar.gz only
+# ./build.sh installer # Build self-extracting .bin installer only
+# ./build.sh appimage # Build AppImage (legacy)
+# ./build.sh all # Build tarball + AppImage (if available)
# ./build.sh shell # Drop into the build container for debugging
#
# Prerequisites: Docker or Podman
@@ -25,15 +29,36 @@ CONTAINER_NAME="fluorine-build-$$"
cd "${SCRIPT_DIR}"
-# Build the Docker image if it doesn't exist or Dockerfile changed
+# Determine build mode from first argument
+BUILD_MODE="${1:-tarball}"
+case "${BUILD_MODE}" in
+ tarball|installer|appimage|all|shell) ;;
+ *)
+ echo "Usage: ./build.sh [tarball|installer|appimage|all|shell]"
+ echo ""
+ echo " tarball Build portable .tar.gz"
+ echo " installer Build self-extracting .bin installer"
+ echo " appimage Build AppImage (legacy)"
+ echo " all Build tarball (+ AppImage if available)"
+ echo " shell Drop into build container"
+ exit 1
+ ;;
+esac
+
+# Build the Docker image if it doesn't exist or Dockerfile changed.
+# Pass BUILD_APPIMAGE=1 only when AppImage builds are requested.
echo "=== Ensuring build image is up to date ==="
-${DOCKER} build -t "${IMAGE_NAME}" docker/
+DOCKER_BUILD_ARGS=()
+if [ "${BUILD_MODE}" = "appimage" ] || [ "${BUILD_MODE}" = "all" ]; then
+ DOCKER_BUILD_ARGS+=(--build-arg BUILD_APPIMAGE=1)
+fi
+${DOCKER} build "${DOCKER_BUILD_ARGS[@]}" -t "${IMAGE_NAME}" docker/
# Persistent ccache directory for faster rebuilds.
CCACHE_DIR="${HOME}/.cache/fluorine-ccache"
mkdir -p "${CCACHE_DIR}"
-if [ "${1:-}" = "shell" ]; then
+if [ "${BUILD_MODE}" = "shell" ]; then
echo "=== Dropping into build container shell ==="
exec ${DOCKER} run --rm -it \
-v "${SCRIPT_DIR}:/src:rw" \
@@ -46,11 +71,12 @@ if [ "${1:-}" = "shell" ]; then
bash
fi
-echo "=== Starting build ==="
+echo "=== Starting build (mode: ${BUILD_MODE}) ==="
${DOCKER} run --rm \
-v "${SCRIPT_DIR}:/src:rw" \
-v "${CCACHE_DIR}:/ccache:rw" \
-e CCACHE_DIR=/ccache \
+ -e BUILD_MODE="${BUILD_MODE}" \
-w /src \
--device /dev/fuse \
--cap-add SYS_ADMIN \
@@ -60,7 +86,6 @@ ${DOCKER} run --rm \
echo ""
echo "=== Done ==="
-if ls build/*.AppImage >/dev/null 2>&1; then
- echo "AppImage: $(ls build/*.AppImage)"
-fi
-echo "Staging: build/staging/"
+echo "Build outputs:"
+ls -lh build/fluorine-manager.tar.gz build/fluorine-manager.bin build/*.AppImage 2>/dev/null || echo " (none found)"
+echo "Staging: build/staging/"