-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathinstall_solc_lllc.sh
executable file
·46 lines (35 loc) · 1.15 KB
/
install_solc_lllc.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env sh
# This script downloads the lllc/solc binaries and installs them in $PREFIX directory
# (the solc/lllc executables will be in $PREFIX/bin). By default $PREFIX is
# ~/.local but can we changes with --prefix <PREFIX> argument.
# This is mostly suitable for CIs, not end users.
set -e
VERSION=0.4.17
if [ "$1" = "--prefix" ]; then
PREFIX="$2"
else
PREFIX=~/.local
fi
SHA256=0f00df61c43215a82db7e9620d9bfaa964c63ff1f745ece62df89a7829ac9f7b
BIN=$PREFIX/bin
if test -f $BIN/lllc && ($BIN/lllc --version | grep -q "$VERSION"); then
echo "CMake $VERSION already installed in $BIN"
else
URL=https://github.com/ethereum/solidity/releases/download/v$VERSION/solidity-ubuntu-trusty.zip
ERROR=0
TMPFILE=$(mktemp --tmpdir solidity-$VERSION-$OS.XXXXXXXX.zip)
echo "Downloading lllc ($URL)..."
curl -L -s "$URL" > "$TMPFILE"
if type -p sha256sum > /dev/null; then
SHASUM="sha256sum"
else
SHASUM="shasum -a256"
fi
if ! ($SHASUM "$TMPFILE" | grep -q "$SHA256"); then
echo "Checksum mismatch ($TMPFILE)"
exit 1
fi
mkdir -p "$PREFIX"
unzip $TMPFILE -d $BIN
rm -rf $TMPFILE
fi