forked from inferno-os/inferno-os
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall-sdl3.sh
More file actions
executable file
·54 lines (45 loc) · 1.39 KB
/
install-sdl3.sh
File metadata and controls
executable file
·54 lines (45 loc) · 1.39 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
#!/bin/bash
#
# Install SDL3 from source for Linux
# Requires: sudo, cmake, ninja-build, git
#
set -e
echo "=== Installing SDL3 build dependencies ==="
sudo apt-get install -y cmake ninja-build git \
libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxss-dev \
libwayland-dev libxkbcommon-dev libegl-dev libgles-dev \
libxtst-dev libdrm-dev libgbm-dev
echo ""
echo "=== Building SDL3 from source ==="
BUILDDIR="/tmp/sdl3-build-$$"
mkdir -p "$BUILDDIR"
cd "$BUILDDIR"
# Pin to a specific release for reproducible builds
SDL3_TAG="release-3.4.4"
SDL3_COMMIT="5848e584a1b606de26e3dbd1c7e4ecbc34f807a6"
git clone --depth 1 --branch "$SDL3_TAG" https://github.com/libsdl-org/SDL.git
cd SDL
# Verify we got the expected commit
ACTUAL_COMMIT=$(git rev-parse HEAD)
if [ "$ACTUAL_COMMIT" != "$SDL3_COMMIT" ]; then
echo "ERROR: SDL3 commit mismatch (expected $SDL3_COMMIT, got $ACTUAL_COMMIT)"
exit 1
fi
cmake -B build -G Ninja -DCMAKE_INSTALL_PREFIX=/usr/local
ninja -C build
echo ""
echo "=== Installing SDL3 ==="
sudo ninja -C build install
sudo ldconfig
echo ""
echo "=== Verifying ==="
pkg-config --modversion sdl3 && echo "SDL3 installed successfully" || echo "WARNING: pkg-config can't find sdl3"
# Cleanup
rm -rf "$BUILDDIR"
ARCH=$(uname -m)
echo ""
if [ "$ARCH" = "aarch64" ]; then
echo "Done. Now run: ./build-linux-arm64.sh"
else
echo "Done. Now run: ./build-linux-amd64.sh"
fi