2016-06-18 18:28:08 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
if [ ! -f "build/env.sh" ]; then
|
|
|
|
echo "$0 must be run from the root of the repository."
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
2016-07-20 06:42:19 +00:00
|
|
|
# Create workspace (if necessary) and dump all dependencies to it
|
|
|
|
ROOT=$PWD
|
|
|
|
WS1="$ROOT/build/_workspace/deps"
|
|
|
|
WS2="$ROOT/build/_workspace/project"
|
|
|
|
|
|
|
|
# expose all vendored packages
|
|
|
|
if [ ! -d "$WS1/src" ]; then
|
|
|
|
mkdir -p "$WS1"
|
|
|
|
cd "$WS1"
|
2016-09-11 11:44:14 +00:00
|
|
|
ln -s "$ROOT/vendor" src
|
2016-07-20 06:42:19 +00:00
|
|
|
cd "$ROOT"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# expose project itself
|
|
|
|
PROJECTDIR="$WS2/src/github.com/status-im"
|
|
|
|
if [ ! -L "$PROJECTDIR/status-go" ]; then
|
|
|
|
mkdir -p "$PROJECTDIR"
|
|
|
|
cd "$PROJECTDIR"
|
|
|
|
ln -s "$ROOT" status-go
|
2016-06-18 18:28:08 +00:00
|
|
|
cd "$root"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Set up the environment to use the workspace.
|
2016-07-20 06:42:19 +00:00
|
|
|
GOPATH="$WS1:$WS2"
|
2016-06-18 18:28:08 +00:00
|
|
|
GOBIN="$PWD/build/bin"
|
|
|
|
export GOPATH GOBIN
|
|
|
|
|
|
|
|
# Run the command inside the workspace.
|
2016-07-20 06:42:19 +00:00
|
|
|
cd "$PROJECTDIR/status-go"
|
|
|
|
|
|
|
|
# Linker options
|
|
|
|
export CGO_CFLAGS="-I/$JAVA_HOME/include -I/$JAVA_HOME/include/darwin"
|
2016-06-18 18:28:08 +00:00
|
|
|
|
|
|
|
# Launch the arguments with the configured environment.
|
2016-06-22 09:17:51 +00:00
|
|
|
exec "$@"
|
2016-07-20 06:42:19 +00:00
|
|
|
|