aboutsummaryrefslogtreecommitdiff
path: root/build-native.sh
diff options
context:
space:
mode:
authorSulfurNitride <SulfurNitride@users.noreply.github.com>2026-02-14 15:40:33 -0600
committerSulfurNitride <SulfurNitride@users.noreply.github.com>2026-02-14 15:40:33 -0600
commit6410929e17d642618f284d5c97d457f1ac653e6e (patch)
tree5c0ee09e04f38a2dd70f1734d25c74e0b8ae5d43 /build-native.sh
parent817e8f5cd26739c69d930d21cd9dc4c0b6e4984e (diff)
Migrate data paths to ~/.local/share/fluorine/, add native build, fix %command% and system Proton scanning
- All data paths migrated from ~/.var/app/com.fluorine.manager/ to ~/.local/share/fluorine/ so native and Flatpak builds share the same instances, plugins, and configs - New fluorinepaths.h/.cpp with fluorineDataDir() helper and one-time migration from old path (writes MOVED.txt breadcrumb) - New libs/nak/src/paths.rs as Rust equivalent (data_dir()) - Strip %command% tokens from launch wrapper in protonlauncher.cpp - Always scan /usr/share/steam/compatibilitytools.d/ for system Proton packages (Arch installs Proton there); add Flatpak filesystem permission - Native build (build-native.sh) installs to ~/.local/share/fluorine/ with desktop entry and ~/.local/bin symlink instead of portable zip - build-flatpak.sh wrapper for Flatpak builds - Fix container locale (LANG=C.UTF-8) for AutoUic warnings - Fix prefixExists() to handle both compatdata and pfx directory layouts - Fix globalInstancesRootPath() to use fluorineDataDir() on Linux - Fix umu-run Flatpak lookup to use fluorineDataDir() - Update README with build instructions and Arch dependency list Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'build-native.sh')
-rwxr-xr-xbuild-native.sh78
1 files changed, 78 insertions, 0 deletions
diff --git a/build-native.sh b/build-native.sh
new file mode 100755
index 0000000..32dccab
--- /dev/null
+++ b/build-native.sh
@@ -0,0 +1,78 @@
+#!/usr/bin/env bash
+# build-native.sh — Build and install Fluorine Manager natively (non-Flatpak).
+# Uses a container to compile, then installs to ~/.local/share/fluorine/.
+# Override container engine with CONTAINER_ENGINE=docker.
+set -euo pipefail
+
+SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
+IMAGE_NAME="fluorine-builder"
+CONTAINER_ENGINE="${CONTAINER_ENGINE:-podman}"
+INSTALL_DIR="${HOME}/.local/share/fluorine"
+STAGING="${SCRIPT_DIR}/build-container/staging"
+
+# ── Build the container image if it doesn't exist ──
+if ! ${CONTAINER_ENGINE} image exists "${IMAGE_NAME}" 2>/dev/null; then
+ echo "Building ${IMAGE_NAME} image (one-time)..."
+ ${CONTAINER_ENGINE} build -t "${IMAGE_NAME}" -f "${SCRIPT_DIR}/docker/Dockerfile" "${SCRIPT_DIR}/docker"
+fi
+
+# ── Ensure build dir exists (Podman needs it before mounting) ──
+mkdir -p "${SCRIPT_DIR}/build-container"
+
+# ── Run the build inside the container ──
+echo "Building Fluorine Manager inside container..."
+${CONTAINER_ENGINE} run --rm \
+ -v "${SCRIPT_DIR}:/src:Z" \
+ -v "${SCRIPT_DIR}/build-container:/src/build:Z" \
+ -w /src \
+ "${IMAGE_NAME}" \
+ bash docker/build-inner.sh
+
+if [ ! -d "${STAGING}" ]; then
+ echo "ERROR: Staging directory not found at ${STAGING}"
+ exit 1
+fi
+
+# ── Install to ~/.local/share/fluorine/ ──
+echo ""
+echo "Installing to ${INSTALL_DIR}/ ..."
+mkdir -p "${INSTALL_DIR}"
+
+# Remove dangling symlinks left by the Flatpak wrapper (they point to /app/
+# which doesn't exist outside the sandbox) and stale symlinks that conflict
+# with directories from the staging area.
+find "${INSTALL_DIR}" -maxdepth 3 -type l ! -exec test -e {} \; -delete 2>/dev/null || true
+for d in plugins/libs plugins/dlls plugins/data; do
+ [ -L "${INSTALL_DIR}/${d}" ] && rm -f "${INSTALL_DIR}/${d}"
+done
+
+# Copy all files, preserving structure. Existing user data (Prefix/, logs/,
+# config/, instances) won't be touched because they're in subdirs that the
+# staging area doesn't contain.
+cp -af "${STAGING}/." "${INSTALL_DIR}/"
+
+# ── Desktop entry ──
+DESKTOP_DIR="${HOME}/.local/share/applications"
+mkdir -p "${DESKTOP_DIR}"
+cat > "${DESKTOP_DIR}/fluorine-manager.desktop" <<EOF
+[Desktop Entry]
+Type=Application
+Name=Fluorine Manager
+Comment=Mod Organizer 2 for Linux
+Exec=${INSTALL_DIR}/fluorine-manager
+Icon=fluorine-manager
+Terminal=false
+Categories=Game;
+EOF
+
+# ── Symlink into ~/.local/bin for PATH access ──
+BIN_DIR="${HOME}/.local/bin"
+mkdir -p "${BIN_DIR}"
+ln -sf "${INSTALL_DIR}/fluorine-manager" "${BIN_DIR}/fluorine-manager"
+
+echo ""
+echo "=== Installed ==="
+du -sh "${INSTALL_DIR}"/*/ "${INSTALL_DIR}"/ModOrganizer-core 2>/dev/null | sort -rh
+echo ""
+echo "Fluorine Manager installed to: ${INSTALL_DIR}/"
+echo "Run with: fluorine-manager (or find it in your app launcher)"