Skip to content

SDL and FreeType/HarfBuzz build themselves the first time a checkout needs them - #206

Merged
fleon merged 2 commits into
mainfrom
deps-on-demand
Nov 22, 2026
Merged

fleon merged 2 commits into
mainfrom
deps-on-demand

Conversation

@fleon

@fleon fleon commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Vendor/ is gitignored, so every fresh clone and worktree starts with no SDL and no text stack. build-shell.sh and check-android.sh then stopped with no SDL for arm64-v8a — run Scripts/build-sdl.sh first, and after that with no FreeType/HarfBuzz … run Vendor/build.sh android first. #204 fixed the same problem for the ASTC encoder.

  • config.sh: ensure_sdl <abi> and ensure_text <abi> build whatever is missing for that ABI and send the build output to stderr. If the build still leaves it missing, they fail and point at that output.
  • For a game's build, SDL also counts as missing when it isn't staged into the game's jniLibs (a cleaned App). build-sdl.sh restages it incrementally. check-android.sh builds the runtime with no game, so it passes --unstaged: it needs SDL built, not staged, and it builds SDL with build-sdl.sh --no-stage, so a standalone clone's check never creates an App folder beside the clone.
  • build-shell.sh and check-android.sh call these helpers in place of their "run X first" checks.
  • Vendor/build.sh takes a single ABI (arm64-v8a or x86_64), so an on-demand build compiles only the one asked for.
  • README: Quick start and "Bring your game to Android" drop the manual steps, and Scripts says what's built on demand.

Checks

  • A fresh Switchlings worktree with this branch as its submodule, and no Vendor/sdl3 or Vendor/out: Android/Scripts/build-shell.sh --debug arm64-v8a built SDL and staged it, built FreeType/HarfBuzz for arm64-v8a, then built AndroidShell and staged 21 libraries.
  • Everything present: ensure_sdl and ensure_text return at once, with no build.
  • libSDL3.so removed from the game's jniLibs: ensure_sdl --unstaged passes, and ensure_sdl restages it in under a second (ninja: no work to do).
  • Scripts/check-android.sh arm64-v8a: all four packages build.
  • A standalone clone with no Vendor/sdl3: check-android.sh built SDL and FreeType/HarfBuzz, and nothing appeared beside the clone.

No visual change.

…needs them

build-shell.sh and check-android.sh stopped with 'run Scripts/build-sdl.sh
first' and 'run Vendor/build.sh android first' whenever the gitignored
Vendor/ was empty, which is every fresh clone and worktree. They now build
what's missing for the ABI asked for (ensure_sdl, ensure_text in config.sh),
and build-shell.sh re-stages SDL into a cleaned App. Vendor/build.sh takes a
single ABI, so an on-demand build compiles only that one.
Comment thread Scripts/check-android.sh Resolved
@claude

claude Bot commented Nov 22, 2026

Copy link
Copy Markdown

Claude review (house rules)
Reviewed 5 files (README.md, Scripts/build-shell.sh, Scripts/check-android.sh, Scripts/config.sh, Vendor/build.sh) against AGENTS.md. Left 1 inline comment.

build-sdl.sh takes --no-stage, which ensure_sdl --unstaged passes: a
standalone clone's check built SDL and then copied it, and SDL's Java, into
an App beside the clone.
@fleon
fleon merged commit e970637 into main Nov 22, 2026
11 checks passed
@fleon
fleon deleted the deps-on-demand branch November 22, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant