add Linux build and launch support
This commit is contained in:
parent
4e743de39a
commit
d3f8c801ce
2 changed files with 102 additions and 0 deletions
48
scripts/bootstrap-linux.sh
Executable file
48
scripts/bootstrap-linux.sh
Executable file
|
|
@ -0,0 +1,48 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
cd "$repo_root"
|
||||
|
||||
missing=()
|
||||
|
||||
require_cmd() {
|
||||
local name="$1"
|
||||
if ! command -v "$name" >/dev/null 2>&1; then
|
||||
missing+=("$name")
|
||||
fi
|
||||
}
|
||||
|
||||
echo "Syncing submodule URLs..."
|
||||
git submodule sync --recursive
|
||||
|
||||
echo "Initializing submodules..."
|
||||
jobs="$(nproc 2>/dev/null || echo 4)"
|
||||
git submodule update --init --recursive --jobs "$jobs"
|
||||
|
||||
require_cmd git
|
||||
require_cmd cmake
|
||||
require_cmd ninja
|
||||
require_cmd pkg-config
|
||||
require_cmd clang-20
|
||||
require_cmd clang++-20
|
||||
require_cmd ld.lld-20
|
||||
|
||||
if [[ ! -f third_party/rexglue-sdk/CMakeLists.txt ]]; then
|
||||
echo "Missing third_party/rexglue-sdk/CMakeLists.txt after submodule init." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ((${#missing[@]})); then
|
||||
echo
|
||||
echo "Missing required build tools: ${missing[*]}" >&2
|
||||
echo "On Ubuntu 24.04, install the core toolchain and Linux headers with:" >&2
|
||||
echo " sudo apt install git cmake ninja-build clang-20 lld-20 pkg-config build-essential libgtk-3-dev libx11-xcb-dev libvulkan-dev libasound2-dev libpulse-dev libpipewire-0.3-dev libudev-dev" >&2
|
||||
echo "If clang-20 is unavailable from Ubuntu apt, install it from https://apt.llvm.org/." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "Bootstrap checks passed."
|
||||
echo "Configure with:"
|
||||
echo " cmake --preset linux-relwithdebinfo -DSKATE3_GAME_DATA_ROOT=\"\$PWD/game\""
|
||||
54
scripts/run-linux.sh
Executable file
54
scripts/run-linux.sh
Executable file
|
|
@ -0,0 +1,54 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
build_dir="$repo_root/out/build/linux-relwithdebinfo"
|
||||
rexglue_lib_dir="$repo_root/third_party/rexglue-sdk/out/linux-amd64"
|
||||
game_dir="${SKATE3_GAME_DATA_ROOT:-$repo_root/game}"
|
||||
exe="$build_dir/skate3"
|
||||
|
||||
if [[ ! -x "$exe" ]]; then
|
||||
echo "Missing executable: $exe" >&2
|
||||
echo "Build it with:" >&2
|
||||
echo " cmake --build --preset linux-relwithdebinfo --parallel" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -d "$rexglue_lib_dir" ]]; then
|
||||
echo "Missing rexglue runtime library directory: $rexglue_lib_dir" >&2
|
||||
echo "Build rexglue with:" >&2
|
||||
echo " cmake --build --preset linux-relwithdebinfo --target generate-all --parallel" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export LD_LIBRARY_PATH="$rexglue_lib_dir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
|
||||
|
||||
has_game_root_arg=0
|
||||
has_input_backend_arg=0
|
||||
has_mnk_mode_arg=0
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
--game_data_root|--game_data_root=*)
|
||||
has_game_root_arg=1
|
||||
;;
|
||||
--input_backend|--input_backend=*)
|
||||
has_input_backend_arg=1
|
||||
;;
|
||||
--mnk_mode|--no-mnk_mode)
|
||||
has_mnk_mode_arg=1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
default_args=()
|
||||
if [[ "$has_game_root_arg" -eq 0 ]]; then
|
||||
default_args+=(--game_data_root="$game_dir")
|
||||
fi
|
||||
if [[ "$has_input_backend_arg" -eq 0 ]]; then
|
||||
default_args+=(--input_backend=sdl)
|
||||
fi
|
||||
if [[ "$has_mnk_mode_arg" -eq 0 && "${SKATE3_MNK:-0}" == "1" ]]; then
|
||||
default_args+=(--mnk_mode)
|
||||
fi
|
||||
|
||||
exec "$exe" "${default_args[@]}" "$@"
|
||||
Loading…
Add table
Reference in a new issue