upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/docs/linux.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/linux.md')
-rw-r--r--docs/linux.md51
1 files changed, 47 insertions, 4 deletions
diff --git a/docs/linux.md b/docs/linux.md
index 555cb3ed4..b6be52568 100644
--- a/docs/linux.md
+++ b/docs/linux.md
@@ -11,8 +11,8 @@ names; the build lists anything it can't find before it starts.
11 11
12| Piece | On Linux | How it is checked | 12| Piece | On Linux | How it is checked |
13|---|---|---| 13|---|---|---|
14| `make_game.py`: check, shaders, assets, pipelines | Native | CI (`stdlib-tests-linux`, `translator-tests`, `semantic-tests`) | 14| `make_game.py`: check, shaders, assets, pipelines | Native | CI (`linux-python-and-viewer`, `semantic-tests`) |
15| `Build.sh`, `Mods.sh` | Native (`/bin/sh`) | `tests/test_shell_launchers.py`, in the standard-library loop of `stdlib-tests-linux` | 15| `Build.sh`, `Mods.sh` | Native (`/bin/sh`) | `tests/test_shell_launchers.py`, in the standard-library loop of `linux-python-and-viewer` |
16| Shader translator, its tests and the GPU test tools (`vk_harness`, `vk_pipeline_check`, ...) | Native, GCC or Clang | CI (`linux-gpu-tools`: GCC, tests on llvmpipe); Clang builds them too, but no CI job uses it yet | 16| Shader translator, its tests and the GPU test tools (`vk_harness`, `vk_pipeline_check`, ...) | Native, GCC or Clang | CI (`linux-gpu-tools`: GCC, tests on llvmpipe); Clang builds them too, but no CI job uses it yet |
17| `rpf9dump` (asset export) | Native, .NET 8 or newer | CI builds it on Windows only (the `check` job) | 17| `rpf9dump` (asset export) | Native, .NET 8 or newer | CI builds it on Windows only (the `check` job) |
18| `gta6rt`, its shims and their tests | Windows program, under Wine or Proton | Cross-built with clang-cl and xwin; CI runs the Windows build under Wine on pushes to `main` | 18| `gta6rt`, its shims and their tests | Windows program, under Wine or Proton | Cross-built with clang-cl and xwin; CI runs the Windows build under Wine on pushes to `main` |
@@ -40,8 +40,8 @@ sudo apt install git python3 \
40Then, with your own copy of the game already readable on disk: 40Then, with your own copy of the game already readable on disk:
41 41
42```sh 42```sh
43git clone --recursive https://github.com/ubiquitarianism/leonida 43git clone --recursive https://github.com/ProjectLeonida/mandy
44cd leonida 44cd mandy
45./Build.sh --find # list the copies found: the home folder, Downloads, Documents, /mnt, /media/<user>, ... 45./Build.sh --find # list the copies found: the home folder, Downloads, Documents, /mnt, /media/<user>, ...
46./Build.sh --check # check your copy, build nothing 46./Build.sh --check # check your copy, build nothing
47./Build.sh # build into ~/Documents/Leonida 47./Build.sh # build into ~/Documents/Leonida
@@ -84,6 +84,16 @@ Runtime workflow. The stage writes `<out>/gta6rt.sh`, which starts `gta6rt.exe`
84[testing.md](testing.md#the-windows-runtime-on-linux-under-wine-or-proton) has the test runs under Wine and Proton 84[testing.md](testing.md#the-windows-runtime-on-linux-under-wine-or-proton) has the test runs under Wine and Proton
85and what fails there. 85and what fails there.
86 86
87On Apple Silicon, set `LEONIDA_CX_BOTTLE` to the name of an existing CrossOver bottle to use the same launcher:
88
89```sh
90LEONIDA_CX_BOTTLE=Leonida ./gta6rt.sh --dry-run
91```
92
93Run this from the packaged output directory. The launcher uses CrossOver in `/Applications` by default. Set `WINE`
94to the CrossOver `bin/wine` path if the app is installed elsewhere. It enables Rosetta's AVX advertisement by default
95for this mode and honours an explicit `ROSETTA_ADVERTISE_AVX` value.
96
87For XMA2 audio, `runtime/CMakeLists.txt` builds `runtime/xma_decoder` for `x86_64-pc-windows-msvc` when `cargo` is on 97For XMA2 audio, `runtime/CMakeLists.txt` builds `runtime/xma_decoder` for `x86_64-pc-windows-msvc` when `cargo` is on
88`PATH`. Distribution Rust packages typically omit the Windows MSVC standard library, which leaves XMA voices silent 98`PATH`. Distribution Rust packages typically omit the Windows MSVC standard library, which leaves XMA voices silent
89unless you add the `x86_64-pc-windows-msvc` Rust target or pass a prebuilt static library with 99unless you add the `x86_64-pc-windows-msvc` Rust target or pass a prebuilt static library with
@@ -119,3 +129,36 @@ python3 -I tests/test_<name>.py # one standard-
119 129
120[testing.md](testing.md) covers the GPU tests (`scripts/run_gpu_tests.py`), running them on llvmpipe, and choosing 130[testing.md](testing.md) covers the GPU tests (`scripts/run_gpu_tests.py`), running them on llvmpipe, and choosing
121the GPU. 131the GPU.
132
133### Without root (micromamba)
134
135If you cannot install distribution packages (no `sudo`), you can install `llvm-tools` and `spirv-tools` into a
136user-owned folder with [micromamba](https://mamba.readthedocs.io/en/latest/installation/micromamba-installation.html)
137(x86-64 glibc; for ARM64 use `linux-aarch64` from the micromamba guide; musl/Alpine is not natively supported) and let
138CMake fetch its pinned, hash-checked Vulkan headers if the system does not provide them:
139
140```bash
141LEO=$HOME/leonida-tools
142mkdir -p "$LEO/bin" "$LEO/mamba"
143# Note: `latest` is unpinned and downloaded without signature verification; inspect or pin per the micromamba guide.
144curl -fsSLo "$LEO/micromamba.tar.bz2" https://micro.mamba.pm/api/micromamba/linux-64/latest
145tar -xjf "$LEO/micromamba.tar.bz2" -C "$LEO/bin" --strip-components=1 bin/micromamba
146
147export MAMBA_ROOT_PREFIX="$LEO/mamba"
148"$LEO/bin/micromamba" create -y -n leonida -c conda-forge --override-channels "llvm-tools>=21" spirv-tools
149export PATH="$LEO/mamba/envs/leonida/bin:$PATH"
150
151cmake -S runtime -B runtime/build/linux -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLEONIDA_VULKAN_HEADERS_FETCH=ON
152cmake --build runtime/build/linux --parallel "$(nproc)"
153LLVM_MC=llvm-mc LEONIDA_VK_DEVICE="<part of your GPU name>" \
154 python3 -I scripts/run_gpu_tests.py --build runtime/build/linux --work "$LEO/run" --require-pass | tee "$LEO/run.log"
155echo "runner exit: ${PIPESTATUS[0]}"
156```
157
158Notes:
159- `LEONIDA_VK_DEVICE` selects the physical GPU by substring so the runner does not fall back to Mesa's `llvmpipe`.
160- Keep `$LEO` on a filesystem without `noexec` (`findmnt -no OPTIONS "$LEO"`).
161- System prerequisites still needed: a working Vulkan driver/loader (`vulkaninfo --summary`), `cmake`, `ninja`, `g++`
162 (or `clang++`), `python3`, `curl`, `tar`, and `bzip2`.
163- Cleanup: delete `$LEO` and `runtime/build/linux`. micromamba also writes `~/.conda/environments.txt` and
164 `~/.mamba/pkgs/urls.txt` (delete only those files if you already use conda).