forked from sudip-mondal-2002/Amplitron
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_dependencies.sh
More file actions
executable file
·113 lines (99 loc) · 3.85 KB
/
Copy pathsetup_dependencies.sh
File metadata and controls
executable file
·113 lines (99 loc) · 3.85 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/bin/bash
# setup_dependencies.sh - Fetches and sets up external dependencies for Guitar Amp Simulator
# Run this script once before building the project.
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
EXTERNAL_DIR="$PROJECT_ROOT/external"
echo "=== Guitar Amp Simulator - Dependency Setup ==="
echo "Project root: $PROJECT_ROOT"
mkdir -p "$EXTERNAL_DIR"
# --- Dear ImGui ---
IMGUI_DIR="$EXTERNAL_DIR/imgui"
IMGUI_VERSION="v1.90.1"
if [ ! -d "$IMGUI_DIR" ]; then
echo ""
echo "Fetching Dear ImGui $IMGUI_VERSION..."
git clone --depth 1 --branch "$IMGUI_VERSION" https://github.com/ocornut/imgui.git "$IMGUI_DIR"
echo "Dear ImGui fetched successfully."
else
echo "Dear ImGui already present, skipping."
fi
# --- kiss_fft (BSD-3-Clause) ---
KISS_FFT_DIR="$EXTERNAL_DIR/kiss_fft"
if [ ! -f "$KISS_FFT_DIR/kiss_fft.c" ]; then
echo ""
echo "Fetching kiss_fft..."
mkdir -p "$KISS_FFT_DIR"
curl -fsSL -o "$KISS_FFT_DIR/kiss_fft.h" https://raw.githubusercontent.com/mborgerding/kissfft/master/kiss_fft.h
curl -fsSL -o "$KISS_FFT_DIR/kiss_fft.c" https://raw.githubusercontent.com/mborgerding/kissfft/master/kiss_fft.c
curl -fsSL -o "$KISS_FFT_DIR/_kiss_fft_guts.h" https://raw.githubusercontent.com/mborgerding/kissfft/master/_kiss_fft_guts.h
curl -fsSL -o "$KISS_FFT_DIR/kiss_fft_log.h" https://raw.githubusercontent.com/mborgerding/kissfft/master/kiss_fft_log.h
echo "kiss_fft fetched successfully."
else
echo "kiss_fft already present, skipping."
fi
# --- dr_wav (single-header WAV library) ---
if [ ! -f "$EXTERNAL_DIR/dr_wav.h" ]; then
echo ""
echo "Fetching dr_wav.h..."
curl -fsSL -o "$EXTERNAL_DIR/dr_wav.h" https://raw.githubusercontent.com/mackron/dr_libs/master/dr_wav.h
echo "dr_wav.h fetched successfully."
else
echo "dr_wav.h already present, skipping."
fi
# --- nanosvg (single-header SVG rasterizer) ---
if [ ! -f "$EXTERNAL_DIR/nanosvg.h" ]; then
echo ""
echo "Fetching nanosvg..."
curl -fsSL -o "$EXTERNAL_DIR/nanosvg.h" https://raw.githubusercontent.com/memononen/nanosvg/master/src/nanosvg.h
curl -fsSL -o "$EXTERNAL_DIR/nanosvgrast.h" https://raw.githubusercontent.com/memononen/nanosvg/master/src/nanosvgrast.h
echo "nanosvg fetched successfully."
else
echo "nanosvg already present, skipping."
fi
# --- Install system dependencies ---
echo ""
echo "Checking system dependencies..."
install_deps() {
if command -v apt-get &> /dev/null; then
echo "Detected Debian/Ubuntu. Installing dependencies..."
sudo apt-get update
sudo apt-get install -y \
build-essential cmake pkg-config \
libportaudio2 portaudio19-dev \
libsdl2-dev \
libgl1-mesa-dev \
libjack-jackd2-dev
elif command -v dnf &> /dev/null; then
echo "Detected Fedora/RHEL. Installing dependencies..."
sudo dnf install -y \
gcc-c++ cmake pkg-config \
portaudio-devel \
SDL2-devel \
mesa-libGL-devel
elif command -v pacman &> /dev/null; then
echo "Detected Arch Linux. Installing dependencies..."
sudo pacman -S --noconfirm \
base-devel cmake pkg-config \
portaudio \
sdl2 \
mesa
elif command -v brew &> /dev/null; then
echo "Detected macOS with Homebrew. Installing dependencies..."
brew update
brew install cmake portaudio rtmidi sdl2 pkg-config
else
echo "WARNING: Could not detect package manager."
echo "Please install manually: cmake, portaudio, sdl2, opengl dev headers"
fi
}
read -p "Install system dependencies? [y/N] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
install_deps
fi
echo ""
echo "=== Setup Complete ==="
echo "Build with:"
echo " mkdir -p build && cd build && cmake .. && make -j\$(nproc)"