#!/bin/sh # Fetch minimal third-party dependencies set -e echo "Initializing demo64k dependencies..." mkdir -p third_party if [ ! -f third_party/stb_image_write.h ]; then echo "Fetching stb_image_write.h..." curl -L https://raw.githubusercontent.com/nothings/stb/master/stb_image_write.h \ -o third_party/stb_image_write.h else echo "stb_image_write.h already present." fi if [ ! -f third_party/miniaudio.h ]; then echo "Fetching miniaudio.h..." curl -L https://raw.githubusercontent.com/mackron/miniaudio/master/miniaudio.h -o third_party/miniaudio.h else echo "miniaudio.h already present." fi # glfw3webgpu (helper for GLFW + WebGPU) mkdir -p third_party/glfw3webgpu if [ ! -f third_party/glfw3webgpu/glfw3webgpu.h ]; then echo "Fetching glfw3webgpu..." curl -L https://raw.githubusercontent.com/eliemichel/glfw3webgpu/main/glfw3webgpu.h -o third_party/glfw3webgpu/glfw3webgpu.h curl -L https://raw.githubusercontent.com/eliemichel/glfw3webgpu/main/glfw3webgpu.c -o third_party/glfw3webgpu/glfw3webgpu.c else echo "glfw3webgpu already present." fi # Check for brew dependencies (macOS) if command -v brew >/dev/null 2>&1; then for pkg in wgpu-native glfw; do if ! brew list "$pkg" >/dev/null 2>&1; then echo "Warning: $pkg not found via brew. Installing..." brew install "$pkg" else echo "$pkg found (via brew)." fi done else echo "Warning: Homebrew not found. Ensure wgpu-native and glfw are installed manually." fi echo "Done."