1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
|
language: c
addons:
apt:
packages:
- help2man
env:
global:
- LUAJIT_DIR=luajit-2.0
- LUAJIT_VER=2.0.4
- LUA53_VER=5.3.2
- LUAROCKS_VER=2.2.2
- _COMPILE="libtool --mode=compile --tag=CC gcc"
- _CFLAGS="-O2 -Wall -DLUA_COMPAT_ALL -DLUA_COMPAT_5_2 -DLUA_USE_LINUX"
- _INSTALL="libtool --mode=install install -p"
- _LINK="libtool --mode=link --tag=CC gcc"
- _LIBS="-lm -Wl,-E -ldl -lreadline"
- prefix=/usr/local
- bindir=$prefix/bin
- incdir=$prefix/include
- libdir=$prefix/lib
- _inst=$TRAVIS_BUILD_DIR/_inst
- luadir=$_inst/share/lua
- luaexecdir=$_inst/lib/lua
matrix:
- LUA=lua5.3
- LUA=lua5.2
- LUA=lua5.1
- LUA=luajit
sudo: required
before_install:
# Put back the links for libyaml, which are missing on recent Travis VMs
- test -f /usr/lib/libyaml.so ||
sudo find /usr/lib -name 'libyaml*' -exec ln -s {} /usr/lib \;
# Fetch Lua sources.
- cd $TRAVIS_BUILD_DIR
- 'if test lua5.3 = "$LUA"; then
curl http://www.lua.org/ftp/lua-$LUA53_VER.tar.gz | tar xz;
cd lua-$LUA53_VER;
fi'
- 'if test lua5.2 = "$LUA"; then
curl http://www.lua.org/ftp/lua-5.2.4.tar.gz | tar xz;
cd lua-5.2.4;
fi'
- 'if test lua5.1 = "$LUA"; then
curl http://www.lua.org/ftp/lua-5.1.5.tar.gz | tar xz;
cd lua-5.1.5;
fi'
# Unpack, compile and install Lua.
- 'if test luajit = "$LUA"; then
curl http://luajit.org/download/LuaJIT-$LUAJIT_VER.tar.gz | tar xz;
cd LuaJIT-$LUAJIT_VER;
make && sudo make install;
for header in lua.h luaconf.h lualib.h lauxlib.h luajit.h lua.hpp; do
if test -f /usr/local/include/$LUAJIT_DIR/$header; then
sudo ln -s /usr/local/include/$LUAJIT_DIR/$header /usr/local/include/$header;
fi;
done;
else
for src in src/*.c; do
test src/lua.c = "$src" || test src/luac.c = "$src" || eval $_COMPILE $_CFLAGS -c $src;
done;
eval $_LINK -o lib$LUA.la -version-info 0:0:0 -rpath $libdir *.lo;
sudo mkdir -p $libdir;
eval sudo $_INSTALL lib$LUA.la $libdir/lib$LUA.la;
eval $_COMPILE $_CFLAGS -c src/lua.c;
eval $_LINK -static -o $LUA lua.lo lib$LUA.la $_LIBS;
sudo mkdir -p $bindir;
eval sudo $_INSTALL $LUA $bindir/$LUA;
sudo mkdir -p $incdir;
for header in lua.h luaconf.h lualib.h lauxlib.h lua.hpp; do
if test -f src/$header; then
eval sudo $_INSTALL src/$header $incdir/$header;
fi;
done;
fi'
# Fetch LuaRocks.
- cd $TRAVIS_BUILD_DIR
- 'git clone https://github.com/keplerproject/luarocks.git luarocks-$LUAROCKS_VER'
- cd luarocks-$LUAROCKS_VER
- git checkout v$LUAROCKS_VER
# Compile and install luarocks.
- if test luajit = "$LUA"; then
./configure --lua-suffix=jit;
else
./configure;
fi
- 'make build && sudo make install'
# Tidy up file droppings.
- cd $TRAVIS_BUILD_DIR
- rm -rf lua-$LUA53_VER lua-5.2.4 lua-5.1.5 LuaJIT-$LUAJIT_VER luarocks-$LUAROCKS_VER
install:
# Use Lua 5.3 compatible rocks, where available.
- 'for rock in ansicolors ldoc specl""; do
if test -z "$rock"; then break; fi;
if luarocks list | grep "^$rock$" >/dev/null; then continue; fi;
sudo luarocks install --server=http://rocks.moonscript.org/manifests/gvvaughan $rock;
done'
# Fudge timestamps on release branches.
- 'if test -f configure; then
test -f aclocal.m4 && touch aclocal.m4;
sleep 1; touch Makefile.in;
sleep 1; test -f config.h.in && touch config.h.in;
sleep 1; touch configure;
fi'
# Build from rockspec, forcing uninstall of older luarocks installed
# above when testing the git rockspec, both for enforcing backwards
# compatibility by default, and for ease of maintenance.
- if test -f 'lcurses-9.0.0-1.rockspec'; then
sudo luarocks make 'lcurses-9.0.0-1.rockspec' LUA="$LUA";
else
sudo luarocks make --force 'lcurses-git-1.rockspec' LUA="$LUA";
fi
# Clean up files created by root
- sudo git clean -dfx
- sudo rm -rf slingshot /tmp/ldoc
script:
# Reconfigure for in-tree test install.
- test -f configure || ./bootstrap --verbose
- ./configure --prefix="$_inst" --disable-silent-rules LUA="$LUA"
# Verify luarocks installation.
- make installcheck || make installcheck V=1
# Verify local build.
- make
- make check || make check V=1
# Verify configured installation.
- make install prefix="$_inst" luadir="$luadir" luaexecdir="$luaexecdir"
- LUA_PATH="$luadir/?.lua;$luadir/?/init.lua;;"
LUA_CPATH="$luaexecdir/?.so;;"
make installcheck V=1
# Run sanity checks on CI server, ignoring buggy automakes.
after_success:
- '{ _assign="=";
if grep local-checks-to-skip build-aux/sanity-cfg.mk >/dev/null; then
_assign="+=";
fi;
printf "local-checks-to-skip %s sc_vulnerable_makefile_CVE-2012-3386\n" "$_assign";
} >> build-aux/sanity-cfg.mk'
- 'make syntax-check || : this will usually fail on the release branch'
notifications:
slack: aspirinc:JyWeNrIdS0J5nf2Pn2BS1cih
|