-
Notifications
You must be signed in to change notification settings - Fork 8
/
.travis.yml
62 lines (53 loc) · 2.17 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
sudo: required
dist: trusty
language: c
env:
matrix:
- LUA=5.1 LUANAME=luajit-2.0 LUA_LIB=-lluajit-5.1
- LUA=5.1 LUANAME=lua5.1
- LUA=5.2 LUANAME=lua5.2
- LUA=5.3 LUANAME=lua5.3 LUA_LIB=-llua
before_install:
- if [ -z $LUAINCLUDE ]; then LUAINCLUDE=/usr/include/${LUANAME}; fi
- if [ -z $LUA_LIB ]; then LUA_LIB=-l${LUANAME}; fi
install:
# Travis boilerplate: the apt-get cache might be out of date.
- travis_retry sudo apt-get update -qq
# Do not install recommended packages with apt-get.
- echo 'APT::Install-Recommends "false";' | sudo tee /etc/apt/apt.conf.d/no-recommends
# Install Lua (per env).
# Note that Lua 5.3 is installed manually, because it is not available in Ubuntu Trusty.
# For this we enable LUA_USE_APICHECK to catch errors in Lua API use.
# LuaJIT is also installed manually.
- |
set -ev
if [[ "$LUA" == "5.3" ]]; then
travis_retry wget http://www.lua.org/ftp/lua-5.3.3.tar.gz -O lua.tar.gz
tar -xvzf lua.tar.gz
(cd lua-5.3.3/src \
&& make SYSCFLAGS="-DLUA_USE_LINUX -ULUA_COMPAT_5_2 -DLUA_USE_APICHECK" SYSLIBS="-Wl,-E -ldl -lreadline" LUA_A=liblua.so MYCFLAGS="-fPIC" RANLIB=: AR="compile() { gcc -shared -o \"\$\$@\" -ldl -lm ; } ; compile" liblua.so \
&& cd .. \
&& sudo make INSTALL_TOP=/usr/ INSTALL_INC=${LUAINCLUDE} TO_LIB=liblua.so linux install)
( \
echo Name: Lua; \
echo Description:; \
echo Version: 5.3.3; \
echo Cflags: -I${LUAINCLUDE}; \
echo Libs: -llua; \
echo INSTALL_CMOD=$(pwd)/lua-5.3.3/src \
) | sudo tee /usr/lib/pkgconfig/lua5.3.pc
elif [[ "$LUANAME" == "luajit-2.0" ]]; then
sudo apt-get install -y libluajit-5.1-dev luajit
# "Create" /usr/bin/lua if needed (Yup, this is a bad hack)
if [ ! -e "/usr/bin/lua" ]; then sudo ln -s /usr/bin/luajit /usr/bin/lua; fi
else
sudo apt-get install -y lib${LUANAME}-dev ${LUANAME}
fi
script:
# Build everything
- mkdir build
- (cd build && ../autogen.sh && make)
# Run tests
- (cd build && ../autogen.sh && make check)
# Run distcheck to check for missing files in tarballs
- (cd build && ../autogen.sh && make distcheck)