aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-01-13 20:05:02 +0800
committerGitHub <noreply@github.com>2017-01-13 20:05:02 +0800
commit60cc1668517f56ce6ca8225555472e7a27eab8b0 (patch)
tree8eac35131efc4beeee921356052375233edd7102 /scripts
parent822622cf5bf23e79a6e2292cb837d1a39ca1c419 (diff)
parente22672b7c739dde9f37a919e63245abda4b1fc89 (diff)
downloaddexon-solidity-60cc1668517f56ce6ca8225555472e7a27eab8b0.tar.gz
dexon-solidity-60cc1668517f56ce6ca8225555472e7a27eab8b0.tar.zst
dexon-solidity-60cc1668517f56ce6ca8225555472e7a27eab8b0.zip
Merge pull request #1561 from ethereum/develop
Merge develop into release for 0.4.8
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/create_source_tarball.sh34
-rwxr-xr-xscripts/install_cmake.sh37
2 files changed, 71 insertions, 0 deletions
diff --git a/scripts/create_source_tarball.sh b/scripts/create_source_tarball.sh
new file mode 100755
index 00000000..1f78e12c
--- /dev/null
+++ b/scripts/create_source_tarball.sh
@@ -0,0 +1,34 @@
+#!/usr/bin/env sh
+#
+
+set -e
+
+REPO_ROOT="$(dirname "$0")"/..
+(
+ cd "$REPO_ROOT"
+ version=$(grep -oP "PROJECT_VERSION \"?\K[0-9.]+(?=\")"? CMakeLists.txt)
+ commithash=$(git rev-parse --short=8 HEAD)
+ commitdate=$(git show --format=%ci HEAD | head -n 1 | cut - -b1-10 | sed -e 's/-0?/./' | sed -e 's/-0?/./')
+
+ # file exists and has zero size -> not a prerelease
+ if [ -e prerelease.txt -a ! -s prerelease.txt ]
+ then
+ versionstring="$version"
+ else
+ versionstring="$version-develop-$commitdate-$commithash"
+ fi
+
+ TEMPDIR=$(mktemp -d)
+ SOLDIR="$TEMPDIR/solidity_$versionstring/"
+ mkdir "$SOLDIR"
+ # Store the current source
+ git checkout-index -a --prefix="$SOLDIR"
+ git submodule foreach 'git checkout-index -a --prefix="'"$SOLDIR"'/$path/"'
+ # Store the commit hash
+ echo "$commithash" > "$SOLDIR/commit_hash.txt"
+ # Add dependencies
+ mkdir -p "$SOLDIR/deps/downloads/" 2>/dev/null || true
+ wget -O "$SOLDIR/deps/downloads/jsoncpp-1.7.7.tar.gz" https://github.com/open-source-parsers/jsoncpp/archive/1.7.7.tar.gz
+ tar czf "$REPO_ROOT/solidity_$versionstring.tar.gz" -C "$TEMPDIR" "solidity_$versionstring"
+ rm -r "$TEMPDIR"
+)
diff --git a/scripts/install_cmake.sh b/scripts/install_cmake.sh
new file mode 100755
index 00000000..00d013b9
--- /dev/null
+++ b/scripts/install_cmake.sh
@@ -0,0 +1,37 @@
+#!/usr/bin/env sh
+
+# This script downloads the CMake binary and installs it in ~/.local directory
+# (the cmake executable will be in ~/.local/bin).
+# This is mostly suitable for CIs, not end users.
+
+set -e
+
+VERSION=3.7.1
+PREFIX=~/.local
+
+OS=$(uname -s)
+case $OS in
+Linux) SHA256=7b4b7a1d9f314f45722899c0521c261e4bfab4a6b532609e37fef391da6bade2;;
+Darwin) SHA256=1851d1448964893fdc5a8c05863326119f397a3790e0c84c40b83499c7960267;;
+esac
+
+
+BIN=$PREFIX/bin
+
+if test -f $BIN/cmake && ($BIN/cmake --version | grep -q "$VERSION"); then
+ echo "CMake $VERSION already installed in $BIN"
+else
+ FILE=cmake-$VERSION-$OS-x86_64.tar.gz
+ URL=https://cmake.org/files/v3.7/$FILE
+ ERROR=0
+ TMPFILE=$(mktemp --tmpdir cmake-$VERSION-$OS-x86_64.XXXXXXXX.tar.gz)
+ echo "Downloading CMake ($URL)..."
+ wget "$URL" -O "$TMPFILE" -nv
+ if ! (shasum -a256 "$TMPFILE" | grep -q "$SHA256"); then
+ echo "Checksum mismatch ($TMPFILE)"
+ exit 1
+ fi
+ mkdir -p "$PREFIX"
+ tar xzf "$TMPFILE" -C "$PREFIX" --strip 1
+ rm $TMPFILE
+fi