Files
ppsspp/.github/checkout-submodules.sh
T
Henrik RydgårdandClaude Opus 5.5 b0d2f8c92b CI: Check out only the FFmpeg sources, not the prebuilt libraries
Every build compiles FFmpeg now, so the per-platform library paths are gone, and
the Alpine job no longer builds it with the old script.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 22:27:53 +01:00

28 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# Checks out the submodules like actions/checkout's "submodules: recursive" does, except that of
# FFmpeg, which also holds prebuilt libraries for every platform (1.5 GB), only the library sources
# the build compiles (see ext/ffmpeg-build) are fetched. Any arguments are more sparse checkout
# patterns relative to ffmpeg/, like /linux/x86_64/.
#
# Run from the repository root, after a checkout without submodules:
# .github/checkout-submodules.sh
set -e
# On Windows, keep Git Bash from turning the patterns into Windows paths on the way to git.exe.
export MSYS_NO_PATHCONV=1
export MSYS2_ARG_CONV_EXCL='*'
others=$(git config -f .gitmodules --get-regexp '^submodule\..*\.path$' | awk '$2 != "ffmpeg" {print $2}')
git submodule update --init --recursive --depth 1 --jobs 8 -- $others
# A partial clone, so only the blobs the sparse checkout needs get downloaded.
sha=$(git rev-parse HEAD:ffmpeg)
url=$(git config -f .gitmodules submodule.ffmpeg.url)
git -C ffmpeg init -q
git -C ffmpeg remote add origin "$url"
git -C ffmpeg sparse-checkout set --no-cone '/lib*/**/*.[ch]' '/compat/**' "$@"
git -C ffmpeg fetch -q --depth 1 --filter=blob:none origin "$sha"
git -C ffmpeg checkout -q FETCH_HEAD
du -sh ffmpeg