Breeze builds and runs with no raylib anywhere, on Ziran 7fbc8152 and Kryon b5a61b37, with plot, entity, apps, css and game2d pinned to that Kryon, so the lock has one Kryon and no raylib package. - Linux and Windows run on Kryon's SDL2 and Cairo desktop host; WebP decodes with the linked libwebp (KRYON_WEBP_LINKED). - Android owns its NativeActivity loop on Kryon's android_runtime: Pixmap on the activity's surface, android_touch input and Android's typefaces, paced to the app's frame target. The CMake build drops breeze_raylib, GLES and the raylib link wraps, and links Kryon's fopen wrapper. - The browser reaches Kryon's canvas modules directly. - Audio is Ziran's std audio: its mixer, the SDL, AAudio and OpenSL ES sinks, the WAV, MP3 and Vorbis decoders and the audio package's Opus. The MP3 and Vorbis archives come from Ziran's own codec recipes. The browser keeps Kryon's Web Audio. - Host modules choose the desktop host, Android, the canvas or, for native tests that select none, a headless host with no window, input or audio device. host_keys.zi and text_input_host.zi replace raylib_host.zi and raylib_text_input.zi; the log is one implementation, with logcat on Android and the C runtime's open flags on Windows. - The Makefile, Click packaging, CI and release workflows build no raylib. - Tests: radio, app log, asset files, DPI, legacy sessions, sync recovery and the Android JNI bridge run without raylib stubs; voice playback is a Ziran test of real Ogg Opus narration through Ziran's mixer. Tests that only exercised raylib internals are removed. - AppsControllerSha256 is the controller built from Apps b96d9afe on this graph. Local tests: Linux desktop window, Habits UI and the Ziran and native tests above pass on a private Xvfb; the Android debug APK runs on a Pixel 4a; the Windows package runs under Wine on a private Xvfb. Co-Authored-By: Claude Opus 5.5 <[email protected]>
147 lines
5.3 KiB
Bash
147 lines
5.3 KiB
Bash
#!/bin/sh
|
|
# Fetch the dependencies pinned in ziran.lock and link each checkout under
|
|
# build/packages/<name>. The Ziran package tool comes from the toolchain commit
|
|
# in the same lock, so a fresh clone needs only git, make, and a C compiler.
|
|
#
|
|
# Sources already on disk are used before the network: set
|
|
# ZIRAN_PACKAGE_SOURCES to a directory of checkouts, or build from F-Droid,
|
|
# whose srclibs in ../srclib are found automatically. Each must contain the
|
|
# locked commit; see scripts/seed-package-sources.py.
|
|
#
|
|
# sh scripts/packages.sh # use ziran.local.toml overrides if present
|
|
# sh scripts/packages.sh --locked # release/CI: exact lock, no overrides
|
|
# sh scripts/packages.sh --offline # use only the package cache
|
|
set -eu
|
|
|
|
root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
|
cd "$root"
|
|
|
|
# Builds started together share build/ziran-bootstrap and build/packages.
|
|
# One run at a time: a concurrent relink once followed another run's fresh
|
|
# links and planted self-links inside every package checkout.
|
|
if [ -z "${PACKAGES_LOCK_HELD:-}" ] && command -v flock >/dev/null 2>&1; then
|
|
mkdir -p build
|
|
PACKAGES_LOCK_HELD=1 exec flock build/packages.lock sh "$root/scripts/packages.sh" "$@"
|
|
fi
|
|
|
|
flags=""
|
|
for argument in "$@"; do
|
|
case "$argument" in
|
|
--locked|--offline) flags="$flags $argument" ;;
|
|
*) echo "usage: sh scripts/packages.sh [--locked] [--offline]" >&2; exit 2 ;;
|
|
esac
|
|
done
|
|
|
|
# Ziran's Makefile is GNU make; on the BSDs that is gmake, not make.
|
|
gnu_make=$(command -v gmake || command -v make)
|
|
|
|
toolchain_field() {
|
|
python3 -c 'import json, sys; print(json.load(open("ziran.lock"))["toolchain"][sys.argv[1]])' "$1"
|
|
}
|
|
|
|
tool_url=$(toolchain_field url)
|
|
tool_commit=$(toolchain_field commit)
|
|
bootstrap="$root/build/ziran-bootstrap"
|
|
ziran=${ZIRAN:-"$bootstrap/build/bin/ziran"}
|
|
|
|
python3 scripts/seed-package-sources.py
|
|
tool_cache="${XDG_CACHE_HOME:-$HOME/.cache}/ziran/sources/$(python3 -c 'import hashlib, sys; print("p" + hashlib.sha256(f"{sys.argv[1]}\n{sys.argv[2]}".encode()).hexdigest()[:16])' "$tool_url" "$tool_commit")"
|
|
|
|
if [ -z "${ZIRAN:-}" ]; then
|
|
current=$(git -C "$bootstrap" rev-parse HEAD 2>/dev/null || true)
|
|
if [ "$current" != "$tool_commit" ]; then
|
|
case " $flags " in
|
|
*" --offline "*)
|
|
echo "packages: Ziran $tool_commit is not bootstrapped" >&2
|
|
exit 1 ;;
|
|
esac
|
|
rm -rf "$bootstrap"
|
|
if [ -d "$tool_cache" ]; then
|
|
git clone -q --no-checkout "$tool_cache" "$bootstrap"
|
|
git -C "$bootstrap" checkout -q --detach "$tool_commit"
|
|
else
|
|
mkdir -p "$bootstrap"
|
|
git -C "$bootstrap" init -q
|
|
git -C "$bootstrap" fetch -q --depth 1 "$tool_url" "$tool_commit"
|
|
git -C "$bootstrap" checkout -q --detach FETCH_HEAD
|
|
fi
|
|
fi
|
|
if [ ! -x "$ziran" ]; then
|
|
env -u DISPLAY -u WAYLAND_DISPLAY "$gnu_make" -C "$bootstrap" -s all >&2
|
|
fi
|
|
fi
|
|
|
|
# shellcheck disable=SC2086
|
|
"$ziran" fetch $flags
|
|
|
|
links="$root/build/packages"
|
|
staging="$links.tmp"
|
|
rm -rf "$staging"
|
|
mkdir -p "$staging"
|
|
|
|
# Resolve the complete requested set in one validated graph. JSON keeps paths
|
|
# containing spaces, quotes or newlines intact; validate every row before links.
|
|
# shellcheck disable=SC2086
|
|
python3 - "$ziran" "$staging" $flags <<'PY'
|
|
import json
|
|
import os
|
|
from pathlib import Path
|
|
import subprocess
|
|
import sys
|
|
|
|
packages = [
|
|
("ziran", "ziran"),
|
|
("kryon", "kryon"),
|
|
("css", "css"),
|
|
("oqs", "oqs"),
|
|
("libwebp", "libwebp"),
|
|
# Kryon's image decoders and their pinned native source packages.
|
|
("webp", "webp"),
|
|
("image-codec", "image-codec"),
|
|
("avif", "avif"),
|
|
("libavif", "libavif"),
|
|
("libaom", "libaom"),
|
|
# Kryon's Ogg Opus decoder and its pinned native source packages.
|
|
("audio", "audio"),
|
|
("libopus", "libopus"),
|
|
("libsamplerate", "libsamplerate"),
|
|
("game2d", "game2d"),
|
|
("qrcode", "qrcode"),
|
|
("plot", "plot"),
|
|
("mingcute", "mingcute"),
|
|
("entity", "entity"),
|
|
("apps", "apps"),
|
|
("crypto", "crypto"),
|
|
("mesh-client", "mesh_client"),
|
|
("practices", "practices"),
|
|
("sqlite", "sqlite"),
|
|
("curl", "curl"),
|
|
("liboqs", "liboqs"),
|
|
("monocypher", "monocypher"),
|
|
("rini", "rini"),
|
|
]
|
|
command = [sys.argv[1], "pkg", "paths", *(selector for _, selector in packages), *sys.argv[3:]]
|
|
result = subprocess.run(command, stdout=subprocess.PIPE, text=True)
|
|
if result.returncode != 0:
|
|
raise SystemExit(result.returncode)
|
|
try:
|
|
rows = json.loads(result.stdout)
|
|
except ValueError:
|
|
raise SystemExit("packages: invalid batch path response")
|
|
if not isinstance(rows, list) or len(rows) != len(packages):
|
|
raise SystemExit("packages: incomplete batch path response")
|
|
for (name, selector), row in zip(packages, rows):
|
|
if (not isinstance(row, dict) or set(row) != {"selector", "path"} or
|
|
row["selector"] != selector or not isinstance(row["path"], str) or
|
|
"\0" in row["path"] or not Path(row["path"]).is_absolute()):
|
|
raise SystemExit("packages: invalid batch path for " + name)
|
|
if not Path(row["path"]).is_dir():
|
|
raise SystemExit("packages: no checkout for " + name)
|
|
for (name, _), row in zip(packages, rows):
|
|
os.symlink(row["path"], Path(sys.argv[2]) / name)
|
|
PY
|
|
|
|
rm -rf "$links"
|
|
mv "$staging" "$links"
|
|
printf '%s\n' "$tool_commit" > "$links/.complete"
|