#!/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 ;; *) GLFW_VERSION=e1ae9af5 SQLITE_VERSION=3.8.6 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}