From 13b485a75f0ed3818c32731279ec48491766ac1b Mon Sep 17 00:00:00 2001 From: sfan5 Date: Wed, 5 Oct 2016 23:06:05 +0200 Subject: [PATCH] Update travis build to new container infrastructure (w/o sudo) --- .travis.yml | 21 +++++++++++++++++---- util/travis/before_install.sh | 20 -------------------- util/travis/script.sh | 13 ++++++++++++- 3 files changed, 29 insertions(+), 25 deletions(-) delete mode 100755 util/travis/before_install.sh diff --git a/.travis.yml b/.travis.yml index 4380e25..7378147 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,12 +5,25 @@ compiler: env: - CXX11=1 - CXX11=0 -before_install: ./util/travis/before_install.sh +sudo: false +addons: + apt: + sources: + - llvm-toolchain-precise-3.8 + - ubuntu-toolchain-r-test + packages: + - cmake + - libgd2-noxpm-dev + - libsqlite3-dev + - p7zip + - g++-6 + - clang-3.8 +before_install: + - # Nothing ever works correctly with precise, use a custom libleveldb build + - wget http://minetest.kitsunemimi.pw/libleveldb-1.18-ubuntu12.04.7z + - 7zr x -olibleveldb libleveldb-1.18-ubuntu12.04.7z script: ./util/travis/script.sh notifications: email: false matrix: fast_finish: true - exclude: - - env: CXX11=1 - compiler: gcc diff --git a/util/travis/before_install.sh b/util/travis/before_install.sh deleted file mode 100755 index eb9b4fe..0000000 --- a/util/travis/before_install.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -e - - -if [ $CC = "clang" ]; then - export PATH="/usr/bin/:$PATH" - sudo sh -c 'echo "deb http://ppa.launchpad.net/eudoxos/llvm-3.1/ubuntu precise main" >> /etc/apt/sources.list' - sudo apt-key adv --keyserver pool.sks-keyservers.net --recv-keys 92DE8183 - sudo apt-get update - sudo apt-get install llvm-3.1 - sudo apt-get install clang -fi - -sudo apt-get update -sudo apt-get install cmake libgd2-noxpm-dev libsqlite3-dev \ - p7zip-full - -# I love how nothing ever works correctly with precise -wget http://minetest.kitsunemimi.pw/libleveldb-1.18-ubuntu12.04.7z -sudo 7z x -o/usr libleveldb-1.18-ubuntu12.04.7z - diff --git a/util/travis/script.sh b/util/travis/script.sh index 03e27b1..1f8889a 100755 --- a/util/travis/script.sh +++ b/util/travis/script.sh @@ -1,6 +1,17 @@ #!/bin/bash -e +CXX=g++-6 +[ $CC == "clang" ] && CXX=clang-3.8 +export CXX + + mkdir -p travisbuild cd travisbuild -cmake -DENABLE_LEVELDB=1 -DUSE_CXX11=$CXX11 .. + +cmake \ + -DENABLE_LEVELDB=1 -DUSE_CXX11=$CXX11 \ + -DLEVELDB_LIBRARY=../libleveldb/lib/libleveldb.so \ + -DLEVELDB_INCLUDE_DIR=../libleveldb/include \ + .. + make -j2