travis: kicking lj-20

This commit is contained in:
Vadim A. Misbakh-Soloviov 2019-06-09 22:02:32 +03:00
parent a76c9fce53
commit fa29fdcbb4
No known key found for this signature in database
GPG Key ID: 6765F46F28E9607E

View File

@ -1,6 +1,5 @@
#! /bin/bash #! /bin/bash
# vim: ft=sh sw=2 ts=2
# vim: ft=bash sw=2 ts=2
# A script for setting up environment for travis-ci testing. # A script for setting up environment for travis-ci testing.
# Sets up Lua and Luarocks. # Sets up Lua and Luarocks.
@ -11,112 +10,99 @@
set -eufo pipefail set -eufo pipefail
LUAJIT_VERSION="2.0.5" LUAJIT_VERSION="2.0.5"
LUAJIT_BASE="LuaJIT-$LUAJIT_VERSION" LUAJIT_BASE="LuaJIT-${LUAJIT_VERSION}"
# shellcheck disable=SC1091
source .travis/platform.sh source .travis/platform.sh
LUA_HOME_DIR=$TRAVIS_BUILD_DIR/install/lua LUA_HOME_DIR="${TRAVIS_BUILD_DIR}/install/lua"
LR_HOME_DIR=$TRAVIS_BUILD_DIR/install/luarocks LR_HOME_DIR="${TRAVIS_BUILD_DIR}/install/luarocks"
mkdir $HOME/.lua mkdir "${HOME}/.lua" -p
LUAJIT="no" LUAJIT="no"
if [ "$PLATFORM" == "macosx" ]; then if [ "${LUA:1:6}" == "luajit" ]; then
if [ "$LUA" == "luajit" ]; then LUAJIT="yes"
LUAJIT="yes"; LJ_BRANCH="${LUA##luajit}"
fi
if [ "$LUA" == "luajit2.0" ]; then
LUAJIT="yes";
fi
if [ "$LUA" == "luajit2.1" ]; then
LUAJIT="yes";
fi;
elif [ "$(expr substr $LUA 1 6)" == "luajit" ]; then
LUAJIT="yes";
fi fi
mkdir -p "$LUA_HOME_DIR" mkdir -p "${LUA_HOME_DIR}"
if [ "$LUAJIT" == "yes" ]; then if [ "${LUAJIT}" == "yes" ]; then
if [ "${LUA}" == "luajit" ]; then
curl -LSs "https://github.com/LuaJIT/LuaJIT/archive/v${LUAJIT_VERSION}.tar.gz" | tar xz
else
git clone https://github.com/LuaJIT/LuaJIT.git -b "${LJ_BRANCH}" "${LUAJIT_BASE}"
fi
if [ "$LUA" == "luajit" ]; then cd "${LUAJIT_BASE}"
curl -LSs https://github.com/LuaJIT/LuaJIT/archive/v$LUAJIT_VERSION.tar.gz | tar xz;
else
git clone https://github.com/LuaJIT/LuaJIT.git $LUAJIT_BASE;
fi
cd $LUAJIT_BASE if [ "${LUA}" == "luajit2.1" ]; then
# force the INSTALL_TNAME to be luajit
perl -i -pe 's/INSTALL_TNAME=.+/INSTALL_TNAME= luajit/' Makefile
fi
if [ "$LUA" == "luajit2.1" ]; then make && make install PREFIX="${LUA_HOME_DIR}"
git checkout v2.1;
# force the INSTALL_TNAME to be luajit
perl -i -pe 's/INSTALL_TNAME=.+/INSTALL_TNAME= luajit/' Makefile
fi
make && make install PREFIX="$LUA_HOME_DIR"
ln -s $LUA_HOME_DIR/bin/luajit $HOME/.lua/luajit
ln -s $LUA_HOME_DIR/bin/luajit $HOME/.lua/lua;
ln -s "${LUA_HOME_DIR}/bin/luajit" "${HOME}/.lua/luajit"
ln -s "${LUA_HOME_DIR}/bin/luajit" "${HOME}/.lua/lua"
else else
if [ "${LUA}" == "lua5.1" ]; then
suff="ftp/lua-5.1.5.tar.gz"
elif [ "${LUA}" == "lua5.2" ]; then
suff="ftp/lua-5.2.4.tar.gz"
elif [ "${LUA}" == "lua5.3" ]; then
suff="ftp/lua-5.3.5.tar.gz"
elif [ "${LUA}" == "lua5.4" ]; then
suff="work/lua-5.4.0-alpha-rc2.tar.gz"
fi
if [ "$LUA" == "lua5.1" ]; then mkdir lua_build -p
suff="ftp/lua-5.1.5.tar.gz" curl -LSs "http://www.lua.org/${suff}" | tar xz -C lua_build --strip-components=1
elif [ "$LUA" == "lua5.2" ]; then cd lua_build
suff="ftp/lua-5.2.4.tar.gz"
elif [ "$LUA" == "lua5.3" ]; then
suff="ftp/lua-5.3.5.tar.gz"
elif [ "$LUA" == "lua5.4" ]; then
suff="work/lua-5.4.0-alpha-rc2.tar.gz"
fi
mkdir lua_build # Build Lua without backwards compatibility for testing
curl -LSs http://www.lua.org/"${suff}" | tar xz -C lua_build --strip-components=1 perl -i -pe 's/-DLUA_COMPAT_(ALL|5_[0-9])//' src/Makefile
cd lua_build make "${PLATFORM}"
make INSTALL_TOP="${LUA_HOME_DIR}" install
# Build Lua without backwards compatibility for testing
perl -i -pe 's/-DLUA_COMPAT_(ALL|5_[0-9])//' src/Makefile
make $PLATFORM
make INSTALL_TOP="$LUA_HOME_DIR" install;
ln -s $LUA_HOME_DIR/bin/lua $HOME/.lua/lua
ln -s $LUA_HOME_DIR/bin/luac $HOME/.lua/luac;
ln -s "${LUA_HOME_DIR}/bin/lua" "${HOME}/.lua/lua"
ln -s "${LUA_HOME_DIR}/bin/luac" "${HOME}/.lua/luac"
fi fi
cd $TRAVIS_BUILD_DIR cd "${TRAVIS_BUILD_DIR}"
lua -v lua -v
LUAROCKS_BASE=luarocks-$LUAROCKS LUAROCKS_BASE=luarocks-$LUAROCKS
curl -LSs https://luarocks.github.io/luarocks/releases/$LUAROCKS_BASE.tar.gz | tar xz curl -LSs https://luarocks.github.io/luarocks/releases/"${LUAROCKS_BASE}".tar.gz | tar xz
cd $LUAROCKS_BASE cd "${LUAROCKS_BASE}"
if [ "$LUA" == "luajit" ]; then if [ "${LUA}" == "luajit" ]; then
export LUA_INCDIR="$LUA_HOME_DIR/include/luajit-2.0" export LUA_INCDIR="${LUA_HOME_DIR}/include/luajit-2.0"
elif [ "$LUA" == "luajit2.0" ]; then elif [ "${LUA}" == "luajit2.0" ]; then
export LUA_INCDIR="$LUA_HOME_DIR/include/luajit-2.0" export LUA_INCDIR="${LUA_HOME_DIR}/include/luajit-2.0"
elif [ "$LUA" == "luajit2.1" ]; then elif [ "${LUA}" == "luajit2.1" ]; then
export LUA_INCDIR="$LUA_HOME_DIR/include/luajit-2.1" export LUA_INCDIR="${LUA_HOME_DIR}/include/luajit-2.1"
fi fi
./configure --with-lua="$LUA_HOME_DIR" --prefix="$LR_HOME_DIR" ./configure --with-lua="${LUA_HOME_DIR}" --prefix="${LR_HOME_DIR}"
make build && make install make build && make install
ln -s $LR_HOME_DIR/bin/luarocks $HOME/.lua/luarocks ln -s "${LR_HOME_DIR}/bin/luarocks" "${HOME}/.lua/luarocks"
cd $TRAVIS_BUILD_DIR cd "${TRAVIS_BUILD_DIR}"
luarocks --version luarocks --version
rm -rf $LUAROCKS_BASE rm -rf "${LUAROCKS_BASE}"
if [ "$LUAJIT" == "yes" ]; then if [ "${LUAJIT}" == "yes" ]; then
rm -rf $LUAJIT_BASE; rm -rf "${LUAJIT_BASE}"
else else
rm -rf lua_build; rm -rf lua_build
fi fi