Put versions of packages downloaded by scripts in variables to reduce duplication

This commit is contained in:
Kamil Śliwak 2021-09-24 14:37:51 +02:00
parent 55467c1cca
commit 67041fb37f
3 changed files with 28 additions and 19 deletions

View File

@ -48,23 +48,28 @@ then
./scripts/install_obsolete_jsoncpp_1_7_4.sh ./scripts/install_obsolete_jsoncpp_1_7_4.sh
# z3 # z3
z3_version="z3-4.8.12" z3_version="4.8.12"
osx_version="osx-10.15.7" z3_dir="z3-${z3_version}-x64-osx-10.15.7"
wget "https://github.com/Z3Prover/z3/releases/download/$z3_version/$z3_version-x64-$osx_version.zip" z3_package="${z3_dir}.zip"
unzip "$z3_version-x64-$osx_version.zip" wget "https://github.com/Z3Prover/z3/releases/download/z3-${z3_version}/${z3_package}"
rm -f "$z3_version-x64-$osx_version.zip" unzip "$z3_package"
cp "$z3_version-x64-$osx_version/bin/libz3.a" /usr/local/lib rm -f "$z3_package"
cp "$z3_version-x64-$osx_version/bin/z3" /usr/local/bin cp "${z3_dir}/bin/libz3.a" /usr/local/lib
cp "$z3_version-x64-$osx_version"/include/* /usr/local/include cp "${z3_dir}/bin/z3" /usr/local/bin
rm -rf "$z3_version-x64-$osx_version" cp "${z3_dir}/include/"* /usr/local/include
rm -rf "$z3_dir"
# evmone # evmone
wget https://github.com/ethereum/evmone/releases/download/v0.8.0/evmone-0.8.0-darwin-x86_64.tar.gz evmone_version="0.8.0"
tar xzpf evmone-0.8.0-darwin-x86_64.tar.gz -C /usr/local evmone_package="evmone-${evmone_version}-darwin-x86_64.tar.gz"
rm -f evmone-0.8.0-darwin-x86_64.tar.gz wget "https://github.com/ethereum/evmone/releases/download/v${evmone_version}/${evmone_package}"
tar xzpf "$evmone_package" -C /usr/local
rm -f "$evmone_package"
# hera # hera
wget https://github.com/ewasm/hera/releases/download/v0.5.0/hera-0.5.0-darwin-x86_64.tar.gz hera_version="0.5.0"
tar xzpf hera-0.5.0-darwin-x86_64.tar.gz -C /usr/local hera_package="hera-${hera_version}-darwin-x86_64.tar.gz"
rm -f hera-0.5.0-darwin-x86_64.tar.gz wget "https://github.com/ewasm/hera/releases/download/v${hera_version}/${hera_package}"
tar xzpf "$hera_package" -C /usr/local
rm -f "$hera_package"
fi fi

View File

@ -31,7 +31,9 @@ REPO_ROOT="$(dirname "$0")"/..
fi fi
# Add dependencies # Add dependencies
mkdir -p "$SOLDIR/deps/downloads/" 2>/dev/null || true mkdir -p "$SOLDIR/deps/downloads/" 2>/dev/null || true
wget -O "$SOLDIR/deps/downloads/jsoncpp-1.9.3.tar.gz" https://github.com/open-source-parsers/jsoncpp/archive/1.9.3.tar.gz jsoncpp_version="1.9.3"
jsoncpp_package_path="$SOLDIR/deps/downloads/jsoncpp-${jsoncpp_version}.tar.gz"
wget -O "$jsoncpp_package_path" "https://github.com/open-source-parsers/jsoncpp/archive/${jsoncpp_version}.tar.gz"
mkdir -p "$REPO_ROOT/upload" mkdir -p "$REPO_ROOT/upload"
tar --owner 0 --group 0 -czf "$REPO_ROOT/upload/solidity_$versionstring.tar.gz" -C "$TEMPDIR" "solidity_$versionstring" tar --owner 0 --group 0 -czf "$REPO_ROOT/upload/solidity_$versionstring.tar.gz" -C "$TEMPDIR" "solidity_$versionstring"
rm -r "$TEMPDIR" rm -r "$TEMPDIR"

View File

@ -4,9 +4,11 @@ set -eu
TEMPDIR=$(mktemp -d) TEMPDIR=$(mktemp -d)
( (
cd "$TEMPDIR" cd "$TEMPDIR"
wget https://github.com/open-source-parsers/jsoncpp/archive/1.7.4.tar.gz jsoncpp_version="1.7.4"
tar xvzf "1.7.4.tar.gz" jsoncpp_package="jsoncpp-${jsoncpp_version}.tar.gz"
cd "jsoncpp-1.7.4" wget -O "$jsoncpp_package" https://github.com/open-source-parsers/jsoncpp/archive/${jsoncpp_version}.tar.gz
tar xvzf "$jsoncpp_package"
cd "jsoncpp-${jsoncpp_version}"
mkdir -p build mkdir -p build
cd build cd build
cmake -DARCHIVE_INSTALL_DIR=. -G "Unix Makefiles" .. cmake -DARCHIVE_INSTALL_DIR=. -G "Unix Makefiles" ..