Add Solidity compiler to solana installer (#31184)

Co-authored-by: mvines <mvines@gmail.com>
This commit is contained in:
Sean Young 2023-05-03 15:10:00 +01:00 committed by GitHub
parent 7cf50e60fc
commit 1438d9ef08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 34 additions and 0 deletions

View File

@ -165,6 +165,40 @@ if [[ -z "$validatorOnly" ]]; then
cp -a sdk/sbf/* "$installDir"/bin/sdk/sbf
fi
# Add Solidity Compiler
if [[ -z "$validatorOnly" ]]; then
base="https://github.com/hyperledger/solang/releases/download"
version="v0.2.3"
curlopt="-sSfL --retry 5 --retry-delay 2 --retry-connrefused"
case $(uname -s) in
"Linux")
if [[ $(uname -m) == "x86_64" ]]; then
arch="x86-64"
else
arch="arm64"
fi
# shellcheck disable=SC2086
curl $curlopt -o "$installDir/bin/solang" $base/$version/solang-linux-$arch
chmod 755 "$installDir/bin/solang"
;;
"Darwin")
if [[ $(uname -m) == "x86_64" ]]; then
arch="intel"
else
arch="arm"
fi
# shellcheck disable=SC2086
curl $curlopt -o "$installDir/bin/solang" $base/$version/solang-mac-$arch
chmod 755 "$installDir/bin/solang"
;;
*)
# shellcheck disable=SC2086
curl $curlopt -o "$installDir/bin/solang.exe" $base/$version/solang.exe
;;
esac
fi
(
set -x
# deps dir can be empty