19 lines
933 B
Bash
Executable File
19 lines
933 B
Bash
Executable File
#!/bin/sh
|
|
# Optional: install build tools inside work/, leaving the user's shell unchanged.
|
|
set -eu
|
|
cd "$(dirname "$0")/.."
|
|
mkdir -p work/toolchain
|
|
curl --fail --location https://sh.rustup.rs -o work/toolchain/rustup-init.sh
|
|
export CARGO_HOME="$PWD/work/toolchain/cargo"
|
|
export RUSTUP_HOME="$PWD/work/toolchain/rustup"
|
|
sh work/toolchain/rustup-init.sh -y --profile minimal --no-modify-path
|
|
"$CARGO_HOME/bin/rustup" component add rustfmt clippy
|
|
case "$(uname -s)-$(uname -m)" in
|
|
Darwin-*) archive="protoc-31.1-osx-universal_binary.zip" ;;
|
|
Linux-x86_64) archive="protoc-31.1-linux-x86_64.zip" ;;
|
|
Linux-aarch64) archive="protoc-31.1-linux-aarch_64.zip" ;;
|
|
*) printf '%s\n' 'Install protoc for this platform manually.'; exit 1 ;;
|
|
esac
|
|
curl --fail --location "https://github.com/protocolbuffers/protobuf/releases/download/v31.1/$archive" -o work/toolchain/protoc.zip
|
|
unzip -q -o work/toolchain/protoc.zip -d work/toolchain/protoc
|