Source release v3.2.1 - third_party build script.

Add script to install third_party directories.

Run install_third_party.sh to copy the needed kits from the network
and install them into third_party.

This can be customized to meet your needs, or you may choose to refer
to directories that are already available in your development
environment.
This commit is contained in:
Gene Morgan
2017-02-01 17:04:09 -08:00
parent 2fde891c01
commit e49ddf383a

77
install_third_party.sh Executable file
View File

@@ -0,0 +1,77 @@
#!/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