forked from luaposix/luaposix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
129 lines (108 loc) · 3.7 KB
/
.travis.yml
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
language: c
env:
global:
- COMPILE="libtool --mode=compile --tag=CC gcc"
- CFLAGS="-O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX"
- INSTALL="libtool --mode=install install -p"
- LINK="libtool --mode=link --tag=CC gcc"
- LIBS="-lm -Wl,-E -ldl -lreadline"
- ROCKSPEC=luaposix-git-1.rockspec
- prefix=/usr/local
- bindir=$prefix/bin
- incdir=$prefix/include
- libdir=$prefix/lib
matrix:
- LUA=lua5.3
- LUA=lua5.2
- LUA=lua5.1
- LUA=luajit
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 \;
- sudo apt-get install help2man
# Fetch Lua sources.
- cd $TRAVIS_BUILD_DIR
- 'if test lua5.3 = "$LUA"; then
curl http://www.lua.org/work/lua-5.3.0-rc1.tar.gz | tar xz;
cd lua-5.3.0;
fi'
- 'if test lua5.2 = "$LUA"; then
curl http://www.lua.org/ftp/lua-5.2.3.tar.gz | tar xz;
cd lua-5.2.3;
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-2.0.3.tar.gz | tar xz;
cd LuaJIT-2.0.3;
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-2.0/$header; then
sudo ln -s /usr/local/include/luajit-2.0/$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-2.2.0'
- cd luarocks-2.2.0
- git checkout v2.2.0
# 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-5.3.0 lua-5.2.3 lua-5.1.5 luarocks-2.2.0
install:
# Use Lua 5.3 compatible rocks, where available.
- 'for rock in 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'
# Initial bootstrap to generate Makefile for rockspecs.
- ./bootstrap
- ./configure LUA="$LUA"
- make rockspecs V=1
|| cat $ROCKSPEC
# Rerun bootstrap automatically from git rockspec.
- sudo luarocks make $ROCKSPEC LUA="$LUA"
- sudo make clean
script:
- make all check 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 || :'
notifications:
slack: aspirinc:JyWeNrIdS0J5nf2Pn2BS1cih