mirror of
https://github.com/ApfelTeeSaft/OpenRoyale.git
synced 2026-08-26 19:33:32 +00:00
34 lines
1.5 KiB
Bash
34 lines
1.5 KiB
Bash
#!/usr/bin/env bash
|
|
# fetch_fmod.sh - stage the official FMOD Android SDK (user-licensed) for arm64 replacement.
|
|
#
|
|
# FMOD is proprietary and REQUIRES a (free) fmod.com developer account; its download links are
|
|
# account-gated, so this script cannot silently pull it. Provide one of:
|
|
# FMOD_ZIP=/path/to/fmodstudioapi<version>android.tar.gz ./fetch_fmod.sh
|
|
# or drop the extracted 'api/core/lib/arm64-v8a/libfmod.so' into native/third_party/fmod/ yourself.
|
|
#
|
|
# We deliberately do NOT fetch FMOD from unofficial mirrors (license + integrity).
|
|
set -euo pipefail
|
|
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
PROJ="$(cd "$HERE/../.." && pwd)"
|
|
DEST="$PROJ/native/third_party/fmod"
|
|
mkdir -p "$DEST"
|
|
|
|
if [ -z "${FMOD_ZIP:-}" ]; then
|
|
cat <<EOF
|
|
[!] No FMOD_ZIP provided.
|
|
1) Create a free account at https://www.fmod.com and download "FMOD Engine" for Android.
|
|
2) Re-run: FMOD_ZIP=/path/to/fmodstudioapiXXXandroid.tar.gz $0
|
|
Fallback: build native/compatibility/fmod_shim (open backend) - see SHARED_LIBRARY_PORTING_PLAN.md.
|
|
EOF
|
|
exit 2
|
|
fi
|
|
tmp="$(mktemp -d)"; tar -xf "$FMOD_ZIP" -C "$tmp"
|
|
found="$(find "$tmp" -path '*arm64-v8a/libfmod.so' | head -1)"
|
|
[ -n "$found" ] || { echo "arm64 libfmod.so not found in archive"; exit 3; }
|
|
cp -f "$found" "$DEST/libfmod.so"
|
|
# also copy headers for building the libg glue
|
|
hdr="$(find "$tmp" -type d -name inc -o -type d -name include | head -1)"
|
|
[ -n "$hdr" ] && cp -rf "$hdr" "$DEST/include" || true
|
|
rm -rf "$tmp"
|
|
echo "[+] FMOD arm64 staged at $DEST/libfmod.so"
|