Skip to content

Commit b047f76

Browse files
committed
travis: use hererocks instead of manual lua compilation.
* .travis.yml: Simplify with hererocks. Signed-off-by: Gary V. Vaughan <gary@gnu.org>
1 parent d042f77 commit b047f76

1 file changed

Lines changed: 19 additions & 121 deletions

File tree

.travis.yml

Lines changed: 19 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -1,140 +1,38 @@
1-
language: c
2-
3-
addons:
4-
apt:
5-
packages:
6-
- help2man
1+
language: python
2+
sudo: required
73

84
env:
95
global:
10-
- _VERSION=1.0.1
11-
12-
- LUAJIT_DIR=luajit-2.0
13-
- LUAJIT_VER=2.0.4
14-
- LUA53_VER=5.3.2
15-
- LUAROCKS_VER=2.2.2
6+
- _VERSION=1.0
167

17-
- _COMPILE="libtool --mode=compile --tag=CC gcc"
18-
- _CFLAGS="-O2 -Wall -DLUA_COMPAT_ALL -DLUA_COMPAT_5_2 -DLUA_USE_LINUX"
19-
- _INSTALL="libtool --mode=install install -p"
20-
- _LINK="libtool --mode=link --tag=CC gcc"
21-
- _LIBS="-lm -Wl,-E -ldl -lreadline"
22-
23-
- prefix=/usr/local
24-
- bindir=$prefix/bin
25-
- incdir=$prefix/include
26-
- libdir=$prefix/lib
27-
28-
- _inst=$TRAVIS_BUILD_DIR/_inst
29-
- luadir=$_inst/share/lua
30-
- luaexecdir=$_inst/lib/lua
318
matrix:
32-
- LUA=lua5.3
33-
- LUA=lua5.2
34-
- LUA=lua5.1
35-
- LUA=luajit
36-
37-
sudo: required
38-
9+
- LUA="lua=5.3"
10+
- LUA="lua=5.2"
11+
- LUA="lua=5.1"
12+
- LUA="luajit=2.1"
13+
- LUA="luajit=2.0"
3914

4015
before_install:
4116
# Put back the links for libyaml, which are missing on recent Travis VMs
4217
- test -f /usr/lib/libyaml.so ||
4318
sudo find /usr/lib -name 'libyaml*' -exec ln -s {} /usr/lib \;
4419

45-
# Fetch Lua sources.
46-
- cd $TRAVIS_BUILD_DIR
47-
- 'if test lua5.3 = "$LUA"; then
48-
curl http://www.lua.org/ftp/lua-$LUA53_VER.tar.gz | tar xz;
49-
cd lua-$LUA53_VER;
50-
fi'
51-
- 'if test lua5.2 = "$LUA"; then
52-
curl http://www.lua.org/ftp/lua-5.2.4.tar.gz | tar xz;
53-
cd lua-5.2.4;
54-
fi'
55-
- 'if test lua5.1 = "$LUA"; then
56-
curl http://www.lua.org/ftp/lua-5.1.5.tar.gz | tar xz;
57-
cd lua-5.1.5;
58-
fi'
59-
60-
# Unpack, compile and install Lua.
61-
- 'if test luajit = "$LUA"; then
62-
curl http://luajit.org/download/LuaJIT-$LUAJIT_VER.tar.gz | tar xz;
63-
cd LuaJIT-$LUAJIT_VER;
64-
make && sudo make install;
65-
for header in lua.h luaconf.h lualib.h lauxlib.h luajit.h lua.hpp; do
66-
if test -f /usr/local/include/$LUAJIT_DIR/$header; then
67-
sudo ln -s /usr/local/include/$LUAJIT_DIR/$header /usr/local/include/$header;
68-
fi;
69-
done;
70-
else
71-
for src in src/*.c; do
72-
test src/lua.c = "$src" || test src/luac.c = "$src" || eval $_COMPILE $_CFLAGS -c $src;
73-
done;
74-
eval $_LINK -o lib$LUA.la -version-info 0:0:0 -rpath $libdir *.lo;
75-
sudo mkdir -p $libdir;
76-
eval sudo $_INSTALL lib$LUA.la $libdir/lib$LUA.la;
77-
78-
eval $_COMPILE $_CFLAGS -c src/lua.c;
79-
eval $_LINK -static -o $LUA lua.lo lib$LUA.la $_LIBS;
80-
sudo mkdir -p $bindir;
81-
eval sudo $_INSTALL $LUA $bindir/$LUA;
82-
83-
sudo mkdir -p $incdir;
84-
for header in lua.h luaconf.h lualib.h lauxlib.h lua.hpp; do
85-
if test -f src/$header; then
86-
eval sudo $_INSTALL src/$header $incdir/$header;
87-
fi;
88-
done;
89-
fi'
90-
91-
# Fetch LuaRocks.
92-
- cd $TRAVIS_BUILD_DIR
93-
- 'git clone https://github.com/keplerproject/luarocks.git luarocks-$LUAROCKS_VER'
94-
- cd luarocks-$LUAROCKS_VER
95-
- git checkout v$LUAROCKS_VER
96-
97-
# Compile and install luarocks.
98-
- if test luajit = "$LUA"; then
99-
./configure --lua-suffix=jit;
100-
else
101-
./configure;
102-
fi
103-
- 'make build && sudo make install'
104-
105-
# Tidy up file droppings.
106-
- cd $TRAVIS_BUILD_DIR
107-
- rm -rf lua-$LUA53_VER lua-5.2.4 lua-5.1.5 LuaJIT-$LUAJIT_VER luarocks-$LUAROCKS_VER
108-
20+
- pip install hererocks
21+
- hererocks here -r^ --$LUA
22+
- export PATH=$PWD/here/bin:$PATH
10923

11024
install:
111-
# Use Lua 5.3 compatible rocks, where available.
112-
- 'for rock in ansicolors ldoc specl""; do
113-
if test -z "$rock"; then break; fi;
114-
if luarocks list | grep "^$rock$" >/dev/null; then continue; fi;
115-
sudo luarocks install --server=http://rocks.moonscript.org/manifests/gvvaughan $rock;
116-
done'
117-
118-
- make
119-
120-
# Build from rockspec, forcing uninstall of older luarocks installed
121-
# above when testing the git rockspec, both for enforcing backwards
122-
# compatibility by default, and for ease of maintenance.
123-
- if test -f "std.prototype-$_VERSION-1.rockspec"; then
124-
sudo luarocks make "std.prototype-$_VERSION-1.rockspec" LUA="$LUA";
125-
else
126-
sudo luarocks make 'std.prototype-git-1.rockspec' LUA="$LUA";
127-
fi
128-
129-
# Clean up files created by root
130-
- sudo git clean -dfx
131-
- sudo rm -rf /tmp/ldoc
132-
25+
- luarocks install --server=http://rocks.moonscript.org/manifests/gvvaughan ldoc
26+
- luarocks install ansicolors
27+
- luarocks install specl
13328

13429
script:
135-
# Verify local build.
136-
- make check LUA=$LUA
30+
- make
31+
- luarocks make
32+
- make check SPECL_OPTS='--vfreport'
13733

34+
after_success:
35+
- luacov-coveralls --verbose
13836

13937
notifications:
14038
slack: aspirinc:JyWeNrIdS0J5nf2Pn2BS1cih

0 commit comments

Comments
 (0)