Merge pull request #1118 from lethosor/travis-lua53

Travis: Lua 5.3
develop
Lethosor 2017-06-22 11:51:28 -04:00 committed by GitHub
commit 55871ad89e
2 changed files with 62 additions and 3 deletions

@ -1,9 +1,12 @@
sudo: false sudo: false
language: cpp language: cpp
cache:
pip: true
directories:
- $HOME/lua53
addons: addons:
apt: apt:
packages: &default_packages packages: &default_packages
- lua5.2
- libxml-libxml-perl - libxml-libxml-perl
- libxml-libxslt-perl - libxml-libxslt-perl
- zlib1g-dev:i386 - zlib1g-dev:i386
@ -19,8 +22,10 @@ matrix:
- gcc-4.8-multilib - gcc-4.8-multilib
- g++-4.8-multilib - g++-4.8-multilib
before_install: before_install:
pip install --user "sphinx==1.4" "requests[security]" - pip install --user "sphinx==1.4" "requests[security]"
- sh travis/build-lua.sh
script: script:
- export PATH="$PATH:$HOME/lua53/bin"
- git tag tmp-travis-build - git tag tmp-travis-build
- sh travis/git-info.sh - sh travis/git-info.sh
- sphinx-build -qW -j3 . docs/html - sphinx-build -qW -j3 . docs/html
@ -28,7 +33,7 @@ script:
- python travis/lint.py - python travis/lint.py
- python travis/authors-rst.py - python travis/authors-rst.py
- python travis/script-docs.py - python travis/script-docs.py
- python travis/script-syntax.py --ext=lua --cmd="luac5.2 -p" || true - python travis/script-syntax.py --ext=lua --cmd="luac5.3 -p"
- python travis/script-syntax.py --ext=rb --cmd="ruby -c" - python travis/script-syntax.py --ext=rb --cmd="ruby -c"
- mkdir build-travis - mkdir build-travis
- cd build-travis - cd build-travis

@ -0,0 +1,54 @@
#!/bin/sh
set -e
LUA_ROOT="$HOME/lua53"
LUA_URL="http://www.lua.org/ftp/lua-5.3.3.tar.gz"
LUA_TAR=$(basename "$LUA_URL")
LUA_DIR="$LUA_ROOT/${LUA_TAR%.tar.*}"
LUA_SHA1="a0341bc3d1415b814cc738b2ec01ae56045d64ef"
echo LUA_ROOT $LUA_ROOT
echo LUA_TAR $LUA_TAR
echo LUA_DIR $LUA_DIR
sha1() {
python -c 'import hashlib, sys; print(hashlib.sha1(open(sys.argv[1],"rb").read()).hexdigest())' "$1"
}
download() {
echo "Downloading $LUA_URL"
wget -O "$LUA_ROOT/$LUA_TAR" "$LUA_URL"
tar xvf "$LUA_ROOT/$LUA_TAR"
}
build() {
cd "$LUA_DIR/src"
make generic
}
main() {
mkdir -p "$LUA_ROOT"
cd "$LUA_ROOT"
mkdir -p bin
if [ "$(sha1 "$LUA_ROOT/$LUA_TAR" 2>/dev/null)" != "$LUA_SHA1" ]; then
download
build
else
echo "Already downloaded"
if [ -x "$LUA_DIR/src/luac" ]; then
echo "Already built"
else
build
fi
fi
echo "Linking"
ln -sf "$LUA_DIR/src/lua" "$LUA_ROOT/bin/lua5.3"
ln -sf "$LUA_DIR/src/luac" "$LUA_ROOT/bin/luac5.3"
echo "Done"
}
main