diff options
Diffstat (limited to 'src/scripts/ci/travis/install.sh')
-rwxr-xr-x | src/scripts/ci/travis/install.sh | 109 |
1 files changed, 52 insertions, 57 deletions
diff --git a/src/scripts/ci/travis/install.sh b/src/scripts/ci/travis/install.sh index bea57cc82..5e65e12d6 100755 --- a/src/scripts/ci/travis/install.sh +++ b/src/scripts/ci/travis/install.sh @@ -2,41 +2,52 @@ set -ev which shellcheck > /dev/null && shellcheck "$0" # Run shellcheck on this if available -if [ "$BUILD_MODE" = "coverage" ]; then - wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.13.orig.tar.gz - tar -xvf lcov_1.13.orig.tar.gz - make PREFIX="/tmp" -C lcov-1.13/ install - - pip install --user coverage - - pip install --user codecov -fi - -if [ "$BUILD_MODE" = "sonarqube" ]; then - curl -LsS https://sonarqube.com/static/cpp/build-wrapper-linux-x86.zip > build-wrapper-linux-x86.zip - unzip build-wrapper-linux-x86.zip -fi - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get -qq update - if [ "$BUILD_MODE" = "lint" ]; then + if [ "$BUILD_MODE" = "valgrind" ]; then + sudo apt-get install valgrind + + elif [ "$BUILD_MODE" = "cross-win32" ]; then + sudo apt-get install g++-mingw-w64-i686 mingw-w64-i686-dev + + # See https://github.com/travis-ci/travis-ci/issues/6460 + sudo dpkg --add-architecture i386 + sudo apt-get -qq update # have to update again due to adding i386 above + sudo apt-get install wine + + elif [ "${BUILD_MODE:0:5}" = "cross" ]; then + # Need updated qemu + sudo add-apt-repository -y ppa:ubuntu-cloud-archive/kilo-staging + sudo apt-get -qq update + sudo apt-get install qemu + + if [ "$BUILD_MODE" = "cross-arm32" ]; then + sudo apt-get install g++-arm-linux-gnueabihf libc6-dev-armhf-cross + elif [ "$BUILD_MODE" = "cross-arm64" ]; then + sudo apt-get install g++-aarch64-linux-gnu libc6-dev-arm64-cross + elif [ "$BUILD_MODE" = "cross-ppc32" ]; then + sudo apt-get install g++-powerpc-linux-gnu libc6-dev-powerpc-cross + elif [ "$BUILD_MODE" = "cross-ppc64" ]; then + sudo apt-get install g++-powerpc64le-linux-gnu libc6-dev-ppc64el-cross + fi + + elif [ "$BUILD_MODE" = "lint" ]; then pip install --user pylint pip3 install --user pylint - fi - if [ "$BUILD_MODE" = "docs" ]; then - sudo apt-get install doxygen + elif [ "$BUILD_MODE" = "coverage" ]; then + # Need new lcov to handle GCC 4.8 + wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.13.orig.tar.gz + tar -xvf lcov_1.13.orig.tar.gz + make PREFIX="/tmp" -C lcov-1.13/ install + export PATH=/tmp/bin:$PATH - # The version of Sphinx in 14.04 is too old (1.2.2) and does not support - # all C++ features used in the manual. Install python-requests to avoid - # problem in Ubuntu packaged version, see - # http://stackoverflow.com/questions/32779919/no-module-named-for-requests - sudo apt-get remove python-requests python-openssl - sudo pip install requests sphinx pyopenssl - fi + (cd /tmp/bin && ln -s gcov-4.8 gcov) + + pip install --user coverage + pip install --user codecov - if [ "$BUILD_MODE" = "coverage" ]; then sudo apt-get install trousers libtspi-dev # SoftHSMv1 in 14.04 does not work @@ -44,39 +55,23 @@ if [ "$TRAVIS_OS_NAME" = "linux" ]; then wget https://www.randombit.net/softhsm2-trusty-bin.tar.bz2 tar -C / -xvjf softhsm2-trusty-bin.tar.bz2 /tmp/softhsm/bin/softhsm2-util --init-token --free --label test --pin 123456 --so-pin 12345678 - fi - if [ "$BUILD_MODE" = "valgrind" ] || [ "${BUILD_MODE:0:5}" = "cross" ]; then - if [ "$BUILD_MODE" = "valgrind" ]; then - sudo apt-get install valgrind - elif [ "$BUILD_MODE" = "cross-win32" ]; then - sudo apt-get install g++-mingw-w64-i686 mingw-w64-i686-dev - - # See https://github.com/travis-ci/travis-ci/issues/6460 - sudo dpkg --add-architecture i386 - sudo apt-get -qq update # have to update again due to adding i386 above - sudo apt-get install wine - else - - # Need updated qemu - sudo add-apt-repository -y ppa:ubuntu-cloud-archive/kilo-staging - sudo apt-get -qq update - sudo apt-get install qemu - - if [ "$BUILD_MODE" = "cross-arm32" ]; then - sudo apt-get install g++-4.8-arm-linux-gnueabihf libc6-dev-armhf-cross - elif [ "$BUILD_MODE" = "cross-arm64" ]; then - sudo apt-get install g++-4.8-aarch64-linux-gnu libc6-dev-arm64-cross - elif [ "$BUILD_MODE" = "cross-ppc32" ]; then - sudo apt-get install g++-4.8-powerpc-linux-gnu libc6-dev-powerpc-cross - elif [ "$BUILD_MODE" = "cross-ppc64" ]; then - sudo apt-get install g++-4.8-powerpc64le-linux-gnu libc6-dev-ppc64el-cross - fi - fi + elif [ "$BUILD_MODE" = "sonarqube" ]; then + curl -LsS https://sonarqube.com/static/cpp/build-wrapper-linux-x86.zip > build-wrapper-linux-x86.zip + unzip build-wrapper-linux-x86.zip + + elif [ "$BUILD_MODE" = "docs" ]; then + sudo apt-get install doxygen + + # The version of Sphinx in 14.04 is too old (1.2.2) and does not support + # all C++ features used in the manual. Install python-requests to avoid + # problem in Ubuntu packaged version, see + # http://stackoverflow.com/questions/32779919/no-module-named-for-requests + sudo apt-get remove python-requests python-openssl + sudo pip install requests sphinx pyopenssl fi -fi -if [ "$TRAVIS_OS_NAME" = "osx" ]; then +elif [ "$TRAVIS_OS_NAME" = "osx" ]; then # Workaround for https://github.com/Homebrew/homebrew/issues/42553 brew update || brew update |