compile_wasuro.sh¶
Pulls the Wasuro WASM runtime Pascal sources into the build tree.
Overview¶
compile_wasuro.sh fetches the Wasuro WebAssembly runtime from its Git repository using a sparse checkout (only the src/wasm subtree) and copies the Pascal source files into the local wasuro/ directory. This makes the Wasuro units available to the FPC compiler via -Fu include paths during compile_sources.sh.
Prerequisites¶
gitmust be available and able to reachhttps://gitea.spexeah.com/Spexeah/Wasuro.git.- The
findandcputilities must be available.
Inputs¶
| Source | Description |
|---|---|
| Wasuro Git repository | Cloned (sparse, depth 1) from the develop branch. |
Outputs¶
| File | Description |
|---|---|
wasuro/*.pas |
Pascal source files for the WASM runtime, ready for inclusion in the FPC build. |
Behavior¶
- Cache check: If
.pasfiles already exist inwasuro/, the script prints a message and exits immediately, skipping the network fetch. - Sparse clone: Clones the Wasuro repository into
/tmp/wasurowith--depth 1,--filter=blob:none, and--sparse, then sets the sparse-checkout tosrc/wasm. - Copy: Copies the contents of the cloned
src/wasm/directory intowasuro/. - Cleanup: Removes the temporary clone from
/tmp. - Reports the number of Pascal files copied.
Notes¶
- The sparse checkout minimizes download size by fetching only the
src/wasmsubtree. - Once
wasuro/is populated, subsequent builds reuse the cached files without re-cloning. To force a fresh pull, delete thewasuro/directory. - The script uses
set -e, so any failure (network error, git error) aborts the build.