carbonyl/scripts/runtime-pull.sh
2023-02-14 05:42:13 +01:00

32 lines
714 B
Bash
Executable File

#!/usr/bin/env bash
export CARBONYL_ROOT=$(cd $(dirname -- "$0") && dirname -- $(pwd))
cd "$CARBONYL_ROOT"
source "scripts/env.sh"
echo "Computing Chromium patches sha.."
sha="$(scripts/runtime-hash.sh)"
triple="$(scripts/platform-triple.sh "$@")"
if [ ! -f "build/pre-built/$triple.tgz" ]; then
url="https://carbonyl.fathy.fr/runtime/$sha/$triple.tgz"
echo "Downloading pre-built binaries from $url"
mkdir -p build/pre-built
if ! curl --silent --fail --output "build/pre-built/$triple.tgz" "$url"; then
echo "Pre-built binaries not available"
exit 1
fi
fi
echo "Pre-build binaries available, extracting.."
cd build/pre-built
rm -rf "$triple"
tar -xvzf "$triple.tgz"