| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 | #!/usr/bin/env /bashset -ev# this script installs a lua / luarocks environment in .travis/lua# this is necessary because travis docker architecture (the fast way)# does not permit sudo, and does not contain a useful lua installation# After this script is finished, you can configure your environment to# use it by sourcing lua_env.shsource ci/travis/platform.sh# The current versions when this script was writtenLUA_VERSION=5.2.4LUAROCKS_VERSION=2.2.2# directory where this script is locatedSCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )# civetweb base dirPROJECT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../.. && pwd )# fetch and unpack lua srccd $SCRIPT_DIRLUA_BASE=lua-$LUA_VERSIONrm -rf $LUA_BASEcurl http://www.lua.org/ftp/$LUA_BASE.tar.gz | tar zx# build luacd $LUA_BASEmake $PLATFORMmake local# mv built lua install to target Lua dirLUA_DIR=$PROJECT_DIR/ci/luarm -rf $LUA_DIRmv $SCRIPT_DIR/$LUA_BASE/install $LUA_DIR# add to path required by luarocks installerexport PATH=$LUA_DIR/bin:$PATH# fetch and unpack luarockscd $SCRIPT_DIRLUAROCKS_BASE=luarocks-$LUAROCKS_VERSIONrm -rf ${LUAROCKS_BASE}LUAROCKS_URL=http://luarocks.org/releases/${LUAROCKS_BASE}.tar.gz# -L because it's a 302 redirectcurl -L $LUAROCKS_URL | tar xzpcd $LUAROCKS_BASE# build luarocks./configure --prefix=$LUA_DIRmake buildmake install# cleanup source dirscd $SCRIPT_DIRrm -rf $LUAROCKS_BASErm -rf $LUA_BASE
 |