#!/usr/bin/env bash set -e set -o pipefail CONFIG_FILE=${1:-config.gypi} if [ `uname -s` = 'Darwin' ]; then MASON_PLATFORM=${MASON_PLATFORM:-osx} fi function finish { >&2 echo -en "\033[0m"; } trap finish EXIT # Install mason . ./scripts/local_mason.sh case ${MASON_PLATFORM} in 'ios') SQLITE_VERSION=system LIBUV_VERSION=0.10.28 ZLIB_VERSION=system BOOST_VERSION=system ;; 'android') SQLITE_VERSION=3.8.6 LIBPNG_VERSION=1.6.13 LIBJPEG_VERSION=v8d OPENSSL_VERSION=1.0.1i LIBCURL_VERSION=7.38.0 LIBUV_VERSION=0.11.29 ZLIB_VERSION=system BOOST_VERSION=1.57.0 NUNICODE_VERSION=1.5.1 LIBZIP_VERSION=0.11.2 ;; *) GLFW_VERSION=e1ae9af5 SQLITE_VERSION=system LIBPNG_VERSION=1.6.13 LIBJPEG_VERSION=v8d LIBCURL_VERSION=system LIBUV_VERSION=0.10.28 ZLIB_VERSION=system BOOST_VERSION=system NUNICODE_VERSION=1.5.1 ;; esac function abort { >&2 echo -e "\033[1m\033[31m$1\033[0m"; exit 1; } PYTHON=`which python || abort 'Cannot find python'` >&2 echo -en "\033[1m\033[32m* Using " >&2 ${PYTHON} --version >&2 echo -en "\033[0m"; function quote_flags { ${PYTHON} -c "import sys, re; print filter(None, re.split('(? ${CONFIG_FILE} cat ${CONFIG_FILE}