#!/bin/bash ROOT=$(dirname "$0") if [ ! -e "$ROOT"/third_party ]; then # Potentially run from a different folder before packaging. ROOT=$(dirname "$ROOT") fi if [ ! -e "$ROOT"/third_party ]; then echo "Unable to find third_party sources!" 1>&2 exit 1 fi ROOT=$(realpath "$ROOT") TMP=$(mktemp -d) trap "rm -rf $TMP" EXIT set -x set -e cd $TMP # Check out and install gyp locally git clone https://chromium.googlesource.com/external/gyp gyp_new rm -rf "$ROOT"/third_party/gyp mv gyp_new/pylib/gyp "$ROOT"/third_party/gyp rm -rf gyp_new # Check out and install jsmn locally git clone https://github.com/zserge/jsmn jsmn_new rm -rf "$ROOT"/third_party/jsmn mkdir "$ROOT"/third_party/jsmn cp -R jsmn_new/* "$ROOT"/third_party/jsmn rm -rf jsmn_new # Check out and install stringencoders locally # NOTE: this is new for v3.2 git clone https://github.com/client9/stringencoders.git stringencoders_git ( cd stringencoders_git ./bootstrap.sh ./configure cd src make modp_b64_data.h make modp_b64.c cd .. ./configure --with-b64wchars='-_=' cd src make modp_b64w_data.h make modp_b64w.c cd .. mkdir -p "$ROOT"/third_party/stringencoders/src cp src/modp_b64.c "$ROOT"/third_party/stringencoders/src/modp_b64.cpp cp src/modp_b64.h src/modp_b64_data.h "$ROOT"/third_party/stringencoders/src/ cp src/modp_b64w.c "$ROOT"/third_party/stringencoders/src/modp_b64w.cpp cp src/modp_b64w.h src/modp_b64w_data.h "$ROOT"/third_party/stringencoders/src/ cp src/extern_c_begin.h "$ROOT"/third_party/stringencoders/src/ cp src/extern_c_end.h "$ROOT"/third_party/stringencoders/src/ cp src/modp_stdint.h "$ROOT"/third_party/stringencoders/src/ >"$ROOT"/third_party/stringencoders/src/config.h ) # Check out and install googletest and googlemock locally # NOTE: this is new for v3.2 git clone https://github.com/google/googletest.git googletest_git (cd googletest_git && git checkout release-1.8.0) rm -rf "$ROOT"/third_party/gmock rm -rf "$ROOT"/third_party/googletest mv googletest_git "$ROOT"/third_party/googletest # Check out and install protobuf locally # NOTE: the tarball is fetched from a different location for v3.2 wget https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz tar xzf protobuf-2.5.0.tar.gz (cd protobuf-2.5.0 && ./configure) rm -rf "$ROOT"/third_party/protobuf mv protobuf-2.5.0 "$ROOT"/third_party/protobuf