Mercurial
comparison infinite_canvas/run_native.sh @ 276:b55c22cff335
Add interactive infinite canvas prototype
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Mon, 17 Aug 2026 16:57:56 -0700 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 274:c9be578316a6 | 276:b55c22cff335 |
|---|---|
| 1 #!/usr/bin/env bash | |
| 2 set -eu | |
| 3 | |
| 4 RUNFILES_ROOT="${RUNFILES_DIR:-$0.runfiles}" | |
| 5 APP="$(find "$RUNFILES_ROOT" -path '*/infinite_canvas/dev_bin' -o -path '*/infinite_canvas/app_bin' | head -1)" | |
| 6 ICU="$(find "$RUNFILES_ROOT" -path '*/Resources/icudtl.dat' | head -1)" | |
| 7 SOLIB="$(find "$RUNFILES_ROOT" -name 'libinfinite_Ucanvas_Slibcanvas.so' | head -1)" | |
| 8 | |
| 9 if [[ -z "$APP" || -z "$ICU" ]]; then | |
| 10 echo "Could not locate the native canvas or CEF runtime." >&2 | |
| 11 exit 1 | |
| 12 fi | |
| 13 | |
| 14 CEF_ROOT="$(dirname "$(dirname "$(realpath "$ICU")")")" | |
| 15 APP="$(realpath "$APP")" | |
| 16 RUNTIME_ROOT="$(dirname "$APP")" | |
| 17 CACHE_ROOT="${INFINITE_CANVAS_CEF_CACHE:-${XDG_CACHE_HOME:-$HOME/.cache}/zenbu/infinite-canvas/cef-151/cache}" | |
| 18 mkdir -p "$CACHE_ROOT" | |
| 19 | |
| 20 if [[ ! -f "$RUNTIME_ROOT/icudtl.dat" ]]; then | |
| 21 cp -al "$CEF_ROOT/Release/." "$RUNTIME_ROOT/" 2>/dev/null || | |
| 22 cp -a "$CEF_ROOT/Release/." "$RUNTIME_ROOT/" | |
| 23 cp -al "$CEF_ROOT/Resources/." "$RUNTIME_ROOT/" 2>/dev/null || | |
| 24 cp -a "$CEF_ROOT/Resources/." "$RUNTIME_ROOT/" | |
| 25 cp -f "$CEF_ROOT/LICENSE.txt" "$RUNTIME_ROOT/CEF-LICENSE.txt" | |
| 26 cp -f "$CEF_ROOT/CREDITS.html" "$RUNTIME_ROOT/CEF-CREDITS.html" | |
| 27 fi | |
| 28 | |
| 29 if [[ -n "$SOLIB" ]]; then | |
| 30 export LD_LIBRARY_PATH="$RUNTIME_ROOT:$(dirname "$SOLIB")${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" | |
| 31 fi | |
| 32 export INFINITE_CANVAS_CEF_CACHE="$CACHE_ROOT" | |
| 33 exec "$APP" "$@" |