From e0ac78297cdd877090682ecbb14eb607d2eb0d12 Mon Sep 17 00:00:00 2001 From: Thomas Harning Jr Date: Wed, 13 Apr 2016 00:04:53 -0400 Subject: [PATCH] travis: use hererocks for local install management --- .travis.yml | 111 ++++++++++++++++++++++----------------------- .travis/LICENSE | 21 --------- .travis/platform.sh | 15 ------- .travis/setenv_lua.sh | 3 -- .travis/setup_lua.sh | 122 -------------------------------------------------- 5 files changed, 56 insertions(+), 216 deletions(-) rewrite .travis.yml (64%) delete mode 100644 .travis/LICENSE delete mode 100644 .travis/platform.sh delete mode 100644 .travis/setenv_lua.sh delete mode 100644 .travis/setup_lua.sh diff --git a/.travis.yml b/.travis.yml dissimilarity index 64% index e4400fb..5d4f908 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,55 +1,56 @@ -# Lie about language support for broader support -language: c - -sudo: false - -branches: - only: - - master - - next - - 1.2.x - - 1.1.x - - 1.0.x - -env: - global: - - LUAROCKS=2.2.2 - matrix: - - LPEG=1.0.0-1 LUA=luajit2.1 - - LPEG=1.0.0-1 LUA=luajit2.0 - - LPEG=1.0.0-1 LUA=luajit - - LPEG=1.0.0-1 LUA=lua5.3 - - LPEG=1.0.0-1 LUA=lua5.2 - - LPEG=1.0.0-1 LUA=lua5.1 - - LPEG=0.12.2-1 LUA=luajit2.1 - - LPEG=0.12.2-1 LUA=luajit2.0 - - LPEG=0.12.2-1 LUA=lua5.3 - - LPEG=0.12.2-1 LUA=lua5.2 - - LPEG=0.12.2-1 LUA=lua5.1 - - LPEG=0.10.2-1 LUA=luajit - - LPEG=0.10.2-1 LUA=lua5.2 - - LPEG=0.10.2-1 LUA=lua5.1 - - LPEG=0.9-1 LUA=luajit - - LPEG=0.9-1 LUA=lua5.1 - - LPEG=0.8.1-1 LUA=luajit - - LPEG=0.8.1-1 LUA=lua5.1 - - LPEG=0.7-3 LUA=luajit - - LPEG=0.7-3 LUA=lua5.1 - -branches: - only: - - master - -before_install: - - source .travis/setenv_lua.sh - - luarocks install lunitx - - luarocks install luafilesystem - - luarocks install lpeg $LPEG - -script: - - make LUA_BIN=lua LUNIT_BIN=lunit.sh check - -notifications: - email: - on_success: change - on_failure: always +# Pull in python for access to pip for hererocks +language: python + +sudo: false + +branches: + only: + - master + - next + - 1.2.x + - 1.1.x + - 1.0.x + +env: + global: + - LUAROCKS=2.3.0 + matrix: + - LPEG=1.0.0-1 LUA="luajit 2.1" + - LPEG=1.0.0-1 LUA="luajit 2.0" + - LPEG=1.0.0-1 LUA="lua 5.3" + - LPEG=1.0.0-1 LUA="lua 5.2" + - LPEG=1.0.0-1 LUA="lua 5.1" + - LPEG=0.12.2-1 LUA="luajit 2.1" + - LPEG=0.12.2-1 LUA="luajit 2.0" + - LPEG=0.12.2-1 LUA="lua 5.3" + - LPEG=0.12.2-1 LUA="lua 5.2" + - LPEG=0.12.2-1 LUA="lua 5.1" + - LPEG=0.10.2-1 LUA="luajit 2.0" + - LPEG=0.10.2-1 LUA="lua 5.2" + - LPEG=0.10.2-1 LUA="lua 5.1" + - LPEG=0.9-1 LUA="luajit 2.0" + - LPEG=0.9-1 LUA="lua 5.1" + - LPEG=0.8.1-1 LUA="luajit 2.0" + - LPEG=0.8.1-1 LUA="lua 5.1" + - LPEG=0.7-3 LUA="luajit 2.0" + - LPEG=0.7-3 LUA="lua 5.1" + +branches: + only: + - master + +before_install: + - pip install hererocks + - hererocks here -r $LUAROCKS --$LUA + - export PATH=$(pwd)/here/bin:$PATH + - luarocks install lunitx + - luarocks install luafilesystem + - luarocks install lpeg $LPEG + +script: + - make LUA_BIN=lua LUNIT_BIN=lunit.sh check + +notifications: + email: + on_success: change + on_failure: always diff --git a/.travis/LICENSE b/.travis/LICENSE deleted file mode 100644 index 4d43160..0000000 --- a/.travis/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Alexey Melnichuk - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/.travis/platform.sh b/.travis/platform.sh deleted file mode 100644 index 7259a7d..0000000 --- a/.travis/platform.sh +++ /dev/null @@ -1,15 +0,0 @@ -if [ -z "${PLATFORM:-}" ]; then - PLATFORM=$TRAVIS_OS_NAME; -fi - -if [ "$PLATFORM" == "osx" ]; then - PLATFORM="macosx"; -fi - -if [ -z "$PLATFORM" ]; then - if [ "$(uname)" == "Linux" ]; then - PLATFORM="linux"; - else - PLATFORM="macosx"; - fi; -fi diff --git a/.travis/setenv_lua.sh b/.travis/setenv_lua.sh deleted file mode 100644 index 8d8c825..0000000 --- a/.travis/setenv_lua.sh +++ /dev/null @@ -1,3 +0,0 @@ -export PATH=${PATH}:$HOME/.lua:$HOME/.local/bin:${TRAVIS_BUILD_DIR}/install/luarocks/bin -bash .travis/setup_lua.sh -eval `$HOME/.lua/luarocks path` diff --git a/.travis/setup_lua.sh b/.travis/setup_lua.sh deleted file mode 100644 index 6dcc0c6..0000000 --- a/.travis/setup_lua.sh +++ /dev/null @@ -1,122 +0,0 @@ -#! /bin/bash - -# A script for setting up environment for travis-ci testing. -# Sets up Lua and Luarocks. -# LUA must be "lua5.1", "lua5.2" or "luajit". -# luajit2.0 - master v2.0 -# luajit2.1 - master v2.1 - -set -eufo pipefail - -LUAJIT_VERSION="2.0.4" -LUAJIT_BASE="LuaJIT-$LUAJIT_VERSION" - -source .travis/platform.sh - -LUA_HOME_DIR=$TRAVIS_BUILD_DIR/install/lua - -LR_HOME_DIR=$TRAVIS_BUILD_DIR/install/luarocks - -mkdir $HOME/.lua - -LUAJIT="no" - -if [ "$PLATFORM" == "macosx" ]; then - if [ "$LUA" == "luajit" ]; then - LUAJIT="yes"; - 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 - -mkdir -p "$LUA_HOME_DIR" - -if [ "$LUAJIT" == "yes" ]; then - - if [ "$LUA" == "luajit" ]; then - curl --location 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 - 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; - -else - - if [ "$LUA" == "lua5.1" ]; then - curl http://www.lua.org/ftp/lua-5.1.5.tar.gz | tar xz - cd lua-5.1.5; - elif [ "$LUA" == "lua5.2" ]; then - curl http://www.lua.org/ftp/lua-5.2.4.tar.gz | tar xz - cd lua-5.2.4; - elif [ "$LUA" == "lua5.3" ]; then - curl http://www.lua.org/ftp/lua-5.3.2.tar.gz | tar xz - cd lua-5.3.2; - fi - - # Build Lua without backwards compatibility for testing - perl -i -pe 's/-DLUA_COMPAT_(ALL|5_2)//' 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; - -fi - -cd $TRAVIS_BUILD_DIR - -lua -v - -LUAROCKS_BASE=luarocks-$LUAROCKS - -curl --location http://luarocks.org/releases/$LUAROCKS_BASE.tar.gz | tar xz - -cd $LUAROCKS_BASE - -if [ "$LUA" == "luajit" ]; then - ./configure --lua-suffix=jit --with-lua-include="$LUA_HOME_DIR/include/luajit-2.0" --prefix="$LR_HOME_DIR"; -elif [ "$LUA" == "luajit2.0" ]; then - ./configure --lua-suffix=jit --with-lua-include="$LUA_HOME_DIR/include/luajit-2.0" --prefix="$LR_HOME_DIR"; -elif [ "$LUA" == "luajit2.1" ]; then - ./configure --lua-suffix=jit --with-lua-include="$LUA_HOME_DIR/include/luajit-2.1" --prefix="$LR_HOME_DIR"; -else - ./configure --with-lua="$LUA_HOME_DIR" --prefix="$LR_HOME_DIR" -fi - -make build && make install - -ln -s $LR_HOME_DIR/bin/luarocks $HOME/.lua/luarocks - -cd $TRAVIS_BUILD_DIR - -luarocks --version - -rm -rf $LUAROCKS_BASE - -if [ "$LUAJIT" == "yes" ]; then - rm -rf $LUAJIT_BASE; -elif [ "$LUA" == "lua5.1" ]; then - rm -rf lua-5.1.5; -elif [ "$LUA" == "lua5.2" ]; then - rm -rf lua-5.2.4; -elif [ "$LUA" == "lua5.3" ]; then - rm -rf lua-5.3.2; -fi -- 2.11.4.GIT