4 # Get the parent directory of where this script is.
5 SOURCE="${BASH_SOURCE[0]}"
6 while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
7 DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )"
9 # Change into that dir because we expect that.
13 GIT_COMMIT="$(git rev-parse --short HEAD)"
14 GIT_DESCRIBE="$(git describe --tags --always)"
15 GIT_IMPORT="github.com/tendermint/abci/version"
17 # Determine the arch/os combos we're building for
18 XC_ARCH=${XC_ARCH:-"386 amd64 arm"}
19 XC_OS=${XC_OS:-"solaris darwin freebsd linux windows"}
21 # Make sure build tools are available.
24 # Get VENDORED dependencies
30 echo "==> Building..."
34 -osarch="!darwin/arm !solaris/amd64 !freebsd/amd64" \
35 -ldflags "-X ${GIT_IMPORT}.GitCommit='${GIT_COMMIT}' -X ${GIT_IMPORT}.GitDescribe='${GIT_DESCRIBE}'" \
36 -output "build/pkg/{{.OS}}_{{.Arch}}/$BINARY" \
37 -tags="${BUILD_TAGS}" \
38 github.com/tendermint/abci/cmd/$BINARY
41 echo "==> Packaging..."
42 for PLATFORM in $(find ./build/pkg -mindepth 1 -maxdepth 1 -type d); do
43 OSARCH=$(basename "${PLATFORM}")
46 pushd "$PLATFORM" >/dev/null 2>&1
47 zip "../${OSARCH}.zip" ./*