summaryrefslogtreecommitdiff
path: root/scripts/project_init.sh
blob: 549e146fa19f5706e51ccecc20557eb4278dc2e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh
# Fetch minimal third-party dependencies

set -e

echo "Initializing demo64k dependencies..."

mkdir -p third_party

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 wgpu-native (system install)
if command -v brew >/dev/null 2>&1; then
  if ! brew list wgpu-native >/dev/null 2>&1; then
    echo "Warning: wgpu-native not found via brew. Installing..."
    brew install wgpu-native
  else
    echo "wgpu-native found (via brew)."
  fi
else
  echo "Warning: Homebrew not found. Ensure wgpu-native is installed manually."
fi

echo "Done."