view infinite_canvas/run_native.sh @ 279:b3b547563ec7

Add Google connector service and agent wiki Implement the C/Seobeo Google Drive and Gmail connector with encrypted OAuth storage, Zenbu authentication, browser testing, AI tool discovery, chunked HTTP decoding, and Bazel coverage. Consolidate repository guidance into progressive wiki documentation and enforce arena-first allocation for new first-party C code. Co-authored-by: Copilot <[email protected]> Copilot-Session: 84c338fd-0939-4bb3-b7f3-1062eb213e5d
author MrJuneJune <me@mrjunejune.com>
date Mon, 17 Aug 2026 22:22:36 -0700
parents b55c22cff335
children
line wrap: on
line source

#!/usr/bin/env bash
set -eu

RUNFILES_ROOT="${RUNFILES_DIR:-$0.runfiles}"
APP="$(find "$RUNFILES_ROOT" -path '*/infinite_canvas/dev_bin' -o -path '*/infinite_canvas/app_bin' | head -1)"
ICU="$(find "$RUNFILES_ROOT" -path '*/Resources/icudtl.dat' | head -1)"
SOLIB="$(find "$RUNFILES_ROOT" -name 'libinfinite_Ucanvas_Slibcanvas.so' | head -1)"

if [[ -z "$APP" || -z "$ICU" ]]; then
  echo "Could not locate the native canvas or CEF runtime." >&2
  exit 1
fi

CEF_ROOT="$(dirname "$(dirname "$(realpath "$ICU")")")"
APP="$(realpath "$APP")"
RUNTIME_ROOT="$(dirname "$APP")"
CACHE_ROOT="${INFINITE_CANVAS_CEF_CACHE:-${XDG_CACHE_HOME:-$HOME/.cache}/zenbu/infinite-canvas/cef-151/cache}"
mkdir -p "$CACHE_ROOT"

if [[ ! -f "$RUNTIME_ROOT/icudtl.dat" ]]; then
  cp -al "$CEF_ROOT/Release/." "$RUNTIME_ROOT/" 2>/dev/null ||
    cp -a "$CEF_ROOT/Release/." "$RUNTIME_ROOT/"
  cp -al "$CEF_ROOT/Resources/." "$RUNTIME_ROOT/" 2>/dev/null ||
    cp -a "$CEF_ROOT/Resources/." "$RUNTIME_ROOT/"
  cp -f "$CEF_ROOT/LICENSE.txt" "$RUNTIME_ROOT/CEF-LICENSE.txt"
  cp -f "$CEF_ROOT/CREDITS.html" "$RUNTIME_ROOT/CEF-CREDITS.html"
fi

if [[ -n "$SOLIB" ]]; then
  export LD_LIBRARY_PATH="$RUNTIME_ROOT:$(dirname "$SOLIB")${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
fi
export INFINITE_CANVAS_CEF_CACHE="$CACHE_ROOT"
exec "$APP" "$@"