#!/usr/bin/env bash set -e set -o pipefail CONFIG_FILE=$1 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.8.1 LIBPNG_VERSION=1.6.16 LIBJPEG_VERSION=v9a OPENSSL_VERSION=1.0.1l LIBCURL_VERSION=7.40.0 LIBUV_VERSION=1.4.0 ZLIB_VERSION=system BOOST_VERSION=1.57.0 NUNICODE_VERSION=1.5.1 LIBZIP_VERSION=0.11.2 ;; *) GLFW_VERSION=e1ae9af5 SQLITE_VERSION=3.8.8.1 LIBPNG_VERSION=1.6.16 LIBJPEG_VERSION=v9a LIBCURL_VERSION=system LIBUV_VERSION=0.10.28 ZLIB_VERSION=system BOOST_VERSION=system NUNICODE_VERSION=1.5.1 LIBZIP_VERSION=0.11.2 ;; esac function abort { >&2 echo -e "\033[1m\033[31m$1\033[0m"; exit 1; } if [ -z ${CONFIG_FILE} ]; then abort 'You need to specify an output path for the configuration file' fi if [[ ${MASON_PLATFORM} = 'android' && -z ${MASON_ANDROID_ABI} ]]; then abort 'You need to specify an ABI for android platforms' fi echo -n "MASON_PLATFORM=${MASON_PLATFORM} " if [ ${MASON_PLATFORM} = 'android' ]; then echo -n "MASON_ANDROID_ABI=${MASON_ANDROID_ABI} " ; fi echo $0 $@ PYTHON=`which python || abort 'Cannot find python'` >&2 echo -en "\033[1m\033[32m* Using " >&2 ${PYTHON} --version >&2 echo -en "\033[0m"; PKG_CONFIG=`which pkg-config || abort 'Cannot find pkg-config'` >&2 echo -en "\033[1m\033[32m* Using pkg-config " >&2 ${PKG_CONFIG} --version >&2 echo -en "\033[0m"; function quote_flags { ${PYTHON} -c "import sys, re; print filter(None, re.split('(? ${CONFIG_FILE} cat ${CONFIG_FILE}