Blame .travis.yml

Packit 437b5e
language: c
Packit 437b5e
Packit 437b5e
env:
Packit 437b5e
  global:
Packit 437b5e
    - _COMPILE="libtool --mode=compile --tag=CC gcc"
Packit 437b5e
    - _CFLAGS="-O2 -Wall -DLUA_COMPAT_ALL -DLUA_COMPAT_5_2 -DLUA_USE_LINUX"
Packit 437b5e
    - _INSTALL="libtool --mode=install install -p"
Packit 437b5e
    - _LINK="libtool --mode=link --tag=CC gcc"
Packit 437b5e
    - _LIBS="-lm -Wl,-E -ldl -lreadline"
Packit 437b5e
Packit 437b5e
    - prefix=/usr/local
Packit 437b5e
    - bindir=$prefix/bin
Packit 437b5e
    - incdir=$prefix/include
Packit 437b5e
    - libdir=$prefix/lib
Packit 437b5e
Packit 437b5e
    - _inst=$TRAVIS_BUILD_DIR/_inst
Packit 437b5e
    - luadir=$_inst/share/lua
Packit 437b5e
    - luaexecdir=$_inst/lib/lua
Packit 437b5e
  matrix:
Packit 437b5e
    - LUA=lua5.3
Packit 437b5e
    - LUA=lua5.2
Packit 437b5e
    - LUA=lua5.1
Packit 437b5e
    - LUA=luajit
Packit 437b5e
Packit 437b5e
Packit 437b5e
before_install:
Packit 437b5e
  # Put back the links for libyaml, which are missing on recent Travis VMs
Packit 437b5e
  - test -f /usr/lib/libyaml.so ||
Packit 437b5e
    sudo find /usr/lib -name 'libyaml*' -exec ln -s {} /usr/lib \;
Packit 437b5e
  - sudo apt-get install help2man
Packit 437b5e
Packit 437b5e
  # Fetch Lua sources.
Packit 437b5e
  - cd $TRAVIS_BUILD_DIR
Packit 437b5e
  - 'if test lua5.3 = "$LUA"; then
Packit 437b5e
      curl http://www.lua.org/ftp/lua-5.3.0.tar.gz | tar xz;
Packit 437b5e
      cd lua-5.3.0;
Packit 437b5e
    fi'
Packit 437b5e
  - 'if test lua5.2 = "$LUA"; then
Packit 437b5e
      curl http://www.lua.org/ftp/lua-5.2.3.tar.gz | tar xz;
Packit 437b5e
      cd lua-5.2.3;
Packit 437b5e
    fi'
Packit 437b5e
  - 'if test lua5.1 = "$LUA"; then
Packit 437b5e
      curl http://www.lua.org/ftp/lua-5.1.5.tar.gz | tar xz;
Packit 437b5e
      cd lua-5.1.5;
Packit 437b5e
    fi'
Packit 437b5e
Packit 437b5e
  # Unpack, compile and install Lua.
Packit 437b5e
  - 'if test luajit = "$LUA"; then
Packit 437b5e
      curl http://luajit.org/download/LuaJIT-2.0.3.tar.gz | tar xz;
Packit 437b5e
      cd LuaJIT-2.0.3;
Packit 437b5e
      make && sudo make install;
Packit 437b5e
      for header in lua.h luaconf.h lualib.h lauxlib.h luajit.h lua.hpp; do
Packit 437b5e
        if test -f /usr/local/include/luajit-2.0/$header; then
Packit 437b5e
          sudo ln -s /usr/local/include/luajit-2.0/$header /usr/local/include/$header;
Packit 437b5e
        fi;
Packit 437b5e
      done;
Packit 437b5e
    else
Packit 437b5e
      for src in src/*.c; do
Packit 437b5e
        test src/lua.c = "$src" || test src/luac.c = "$src" || eval $_COMPILE $_CFLAGS -c $src;
Packit 437b5e
      done;
Packit 437b5e
      eval $_LINK -o lib$LUA.la -version-info 0:0:0 -rpath $libdir *.lo;
Packit 437b5e
      sudo mkdir -p $libdir;
Packit 437b5e
      eval sudo $_INSTALL lib$LUA.la $libdir/lib$LUA.la;
Packit 437b5e
Packit 437b5e
      eval $_COMPILE $_CFLAGS -c src/lua.c;
Packit 437b5e
      eval $_LINK -static -o $LUA lua.lo lib$LUA.la $_LIBS;
Packit 437b5e
      sudo mkdir -p $bindir;
Packit 437b5e
      eval sudo $_INSTALL $LUA $bindir/$LUA;
Packit 437b5e
Packit 437b5e
      sudo mkdir -p $incdir;
Packit 437b5e
      for header in lua.h luaconf.h lualib.h lauxlib.h lua.hpp; do
Packit 437b5e
        if test -f src/$header; then
Packit 437b5e
          eval sudo $_INSTALL src/$header $incdir/$header;
Packit 437b5e
        fi;
Packit 437b5e
      done;
Packit 437b5e
    fi'
Packit 437b5e
Packit 437b5e
  # Fetch LuaRocks.
Packit 437b5e
  - cd $TRAVIS_BUILD_DIR
Packit 437b5e
  - 'git clone https://github.com/keplerproject/luarocks.git luarocks-2.2.0'
Packit 437b5e
  - cd luarocks-2.2.0
Packit 437b5e
  - git checkout v2.2.0
Packit 437b5e
Packit 437b5e
  # Compile and install luarocks.
Packit 437b5e
  - if test luajit = "$LUA"; then
Packit 437b5e
      ./configure --lua-suffix=jit;
Packit 437b5e
    else
Packit 437b5e
      ./configure;
Packit 437b5e
    fi
Packit 437b5e
  - 'make build && sudo make install'
Packit 437b5e
Packit 437b5e
  # Tidy up file droppings.
Packit 437b5e
  - cd $TRAVIS_BUILD_DIR
Packit 437b5e
  - rm -rf lua-5.3.0 lua-5.2.3 lua-5.1.5 LuaJIT-2.0.3 luarocks-2.2.0
Packit 437b5e
Packit 437b5e
Packit 437b5e
install:
Packit 437b5e
  # Use Lua 5.3 compatible rocks, where available.
Packit 437b5e
  - 'for rock in ansicolors ldoc specl""; do
Packit 437b5e
       if test -z "$rock"; then break; fi;
Packit 437b5e
       if luarocks list | grep "^$rock$" >/dev/null; then continue; fi;
Packit 437b5e
       sudo luarocks install --server=http://rocks.moonscript.org/manifests/gvvaughan $rock;
Packit 437b5e
    done'
Packit 437b5e
Packit 437b5e
  # Fudge timestamps on release branches.
Packit 437b5e
  - 'if test -f configure; then
Packit 437b5e
      test -f aclocal.m4 && touch aclocal.m4;
Packit 437b5e
      sleep 1; touch Makefile.in;
Packit 437b5e
      sleep 1; test -f config.h.in && touch config.h.in;
Packit 437b5e
      sleep 1; touch configure;
Packit 437b5e
    fi'
Packit 437b5e
Packit 437b5e
  # Build from rockspec.
Packit 437b5e
  - export ROCKSPEC=luaposix-33.3.1-1.rockspec
Packit 437b5e
  - 'test -f "$ROCKSPEC" || ROCKSPEC=luaposix-git-1.rockspec'
Packit 437b5e
  - sudo luarocks make $ROCKSPEC LUA="$LUA"
Packit 437b5e
Packit 437b5e
  # Clean up files created by root
Packit 437b5e
  - sudo git clean -dfx
Packit 437b5e
  - sudo rm -rf slingshot /tmp/ldoc
Packit 437b5e
Packit 437b5e
Packit 437b5e
script:
Packit 437b5e
  # Reconfigure for in-tree test install.
Packit 437b5e
  - test -f configure || ./bootstrap --verbose
Packit 437b5e
  - ./configure --prefix="$_inst" --disable-silent-rules LUA="$LUA"
Packit 437b5e
Packit 437b5e
  # Verify luarocks installation.
Packit 437b5e
  - make installcheck || make installcheck V=1
Packit 437b5e
Packit 437b5e
  # Verify local build.
Packit 437b5e
  - make
Packit 437b5e
  - make check || make check V=1
Packit 437b5e
Packit 437b5e
  # Verify configured installation.
Packit 437b5e
  - make install prefix="$_inst" luadir="$luadir" luaexecdir="$luaexecdir"
Packit 437b5e
  - LUA_PATH="$luadir/?.lua;$luadir/?/init.lua;;"
Packit 437b5e
    LUA_CPATH="$luaexecdir/?.so;;"
Packit 437b5e
    make installcheck V=1
Packit 437b5e
Packit 437b5e
Packit 437b5e
# Run sanity checks on CI server, ignoring buggy automakes.
Packit 437b5e
after_success:
Packit 437b5e
  - '{ _assign="=";
Packit 437b5e
       if grep local-checks-to-skip build-aux/sanity-cfg.mk >/dev/null; then
Packit 437b5e
         _assign="+=";
Packit 437b5e
       fi;
Packit 437b5e
       printf "local-checks-to-skip %s sc_vulnerable_makefile_CVE-2012-3386\n" "$_assign";
Packit 437b5e
     } >> build-aux/sanity-cfg.mk'
Packit 437b5e
  - 'make syntax-check || : this will usually fail on the release branch'
Packit 437b5e
Packit 437b5e
notifications:
Packit 437b5e
  slack: aspirinc:JyWeNrIdS0J5nf2Pn2BS1cih