From 02c18eb420f695494395dffd5c13ef6f41617fc4 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Wed, 2 Sep 2015 21:08:09 +0200 Subject: Update travis configuration for iOS build Closes #188 --- .travis.yml | 37 ++++++++++++------- src/scripts/ci/after_success.sh | 13 ------- src/scripts/ci/build.sh | 44 ----------------------- src/scripts/ci/install.sh | 11 ------ src/scripts/ci/travis/after_success.sh | 13 +++++++ src/scripts/ci/travis/build.sh | 51 +++++++++++++++++++++++++++ src/scripts/ci/travis/install.sh | 15 ++++++++ src/scripts/ci/travis/install_osx_packages.sh | 8 +++++ 8 files changed, 111 insertions(+), 81 deletions(-) delete mode 100755 src/scripts/ci/after_success.sh delete mode 100755 src/scripts/ci/build.sh delete mode 100755 src/scripts/ci/install.sh create mode 100755 src/scripts/ci/travis/after_success.sh create mode 100755 src/scripts/ci/travis/build.sh create mode 100755 src/scripts/ci/travis/install.sh create mode 100755 src/scripts/ci/travis/install_osx_packages.sh diff --git a/.travis.yml b/.travis.yml index 3044c8dfd..2f268564c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,32 +18,41 @@ os: - linux - osx +osx_image: xcode6.4 + compiler: - clang - gcc env: matrix: - - MODULES="all" BUILD_MODE="shared" - - MODULES="all" BUILD_MODE="static" - - MODULES="all" BUILD_MODE="coverage" - - MODULES="all" BUILD_MODE="sanitizer" + - TARGETOS="desktop" MODULES="all" BUILD_MODE="shared" + - TARGETOS="desktop" MODULES="all" BUILD_MODE="static" + - TARGETOS="desktop" MODULES="all" BUILD_MODE="coverage" + - TARGETOS="desktop" MODULES="all" BUILD_MODE="sanitizer" + + - TARGETOS="desktop" MODULES="min" BUILD_MODE="shared" + - TARGETOS="desktop" MODULES="min" BUILD_MODE="static" - - MODULES="min" BUILD_MODE="shared" - - MODULES="min" BUILD_MODE="static" + - TARGETOS="ios" MODULES="all" BUILD_MODE="shared" + - TARGETOS="ios" MODULES="all" BUILD_MODE="static" matrix: exclude: - os: osx compiler: gcc - compiler: clang - env: MODULES="all" BUILD_MODE="coverage" + env: TARGETOS="desktop" MODULES="all" BUILD_MODE="coverage" - compiler: clang - env: MODULES="all" BUILD_MODE="sanitizer" + env: TARGETOS="desktop" MODULES="all" BUILD_MODE="sanitizer" - compiler: clang - env: MODULES="min" BUILD_MODE="shared" + env: TARGETOS="desktop" MODULES="min" BUILD_MODE="shared" - compiler: clang - env: MODULES="min" BUILD_MODE="static" + env: TARGETOS="desktop" MODULES="min" BUILD_MODE="static" + - os: linux + env: TARGETOS="ios" MODULES="all" BUILD_MODE="shared" + - os: linux + env: TARGETOS="ios" MODULES="all" BUILD_MODE="static" # END BUILD MATRIX cache: @@ -51,13 +60,13 @@ cache: - $HOME/.ccache install: - - ./src/scripts/ci/install.sh + - ./src/scripts/ci/travis/install.sh script: - - if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then ./src/scripts/ci/build.sh ; fi + - if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then ./src/scripts/ci/travis/build.sh ; fi after_success: - - ./src/scripts/ci/after_success.sh + - ./src/scripts/ci/travis/after_success.sh notifications: email: botan-commits@lists.randombit.net @@ -72,6 +81,8 @@ addons: - libssl-dev - libsqlite3-dev - zlib1g-dev + - libbz2-dev + - liblzma-dev coverity_scan: project: diff --git a/src/scripts/ci/after_success.sh b/src/scripts/ci/after_success.sh deleted file mode 100755 index 5cd01b39a..000000000 --- a/src/scripts/ci/after_success.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -set -ev -which shellcheck > /dev/null && shellcheck "$0" # Run shellcheck on this if available - -if [ "$BUILD_MODE" = "coverage" ]; then - GCOV="/usr/bin/gcov-4.8" - /tmp/usr/bin/lcov --gcov-tool "$GCOV" --directory . --capture --output-file coverage.info - /tmp/usr/bin/lcov --gcov-tool "$GCOV" --remove coverage.info 'tests/*' '/usr/*' --output-file coverage.info - /tmp/usr/bin/lcov --gcov-tool "$GCOV" --list coverage.info - - # Assume that $COVERALLS_REPO_TOKEN might not be set (e.g. pull requests) - coveralls-lcov --repo-token="$COVERALLS_REPO_TOKEN" coverage.info -fi diff --git a/src/scripts/ci/build.sh b/src/scripts/ci/build.sh deleted file mode 100755 index 9bf7b0e84..000000000 --- a/src/scripts/ci/build.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -set -ev -which shellcheck > /dev/null && shellcheck "$0" # Run shellcheck on this if available - -if [ "$BUILD_MODE" = "static" ]; then - CFG_FLAGS=(--disable-shared --via-amalgamation) -elif [ "$BUILD_MODE" = "shared" ]; then - CFG_FLAGS=() -elif [ "$BUILD_MODE" = "coverage" ]; then - # lcov gets confused by symlinks - CFG_FLAGS=(--build-mode=coverage --link-method=copy) -elif [ "$BUILD_MODE" = "sanitizer" ]; then - CFG_FLAGS=(--build-mode=sanitizer) -fi - -if [ "$MODULES" = "min" ]; then - CFG_FLAGS+=(--no-autoload --enable-modules=base) -fi - -# Workaround for missing update-alternatives -# https://github.com/travis-ci/travis-ci/issues/3668 -if [ "$CXX" = "g++" ]; then - export CXX="/usr/bin/g++-4.8" -fi - -#enable ccache -if [ "$TRAVIS_OS_NAME" = "linux" ]; then - ccache --max-size=30M - ccache --show-stats - - export CXX="ccache $CXX" -fi - -$CXX --version -./configure.py "${CFG_FLAGS[@]}" --cc="$CC" --cc-bin="$CXX" \ - --with-openssl --with-sqlite --with-zlib \ - --prefix=/tmp/botan-installation -make -j 2 - -if [ "$MODULES" != "min" ]; then - ./botan-test -fi - -make install diff --git a/src/scripts/ci/install.sh b/src/scripts/ci/install.sh deleted file mode 100755 index 364d447bf..000000000 --- a/src/scripts/ci/install.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -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.11.orig.tar.gz - tar -xvf lcov_1.11.orig.tar.gz - export PREFIX="/tmp" - make -C lcov-1.11/ install - gem install coveralls-lcov -fi diff --git a/src/scripts/ci/travis/after_success.sh b/src/scripts/ci/travis/after_success.sh new file mode 100755 index 000000000..5cd01b39a --- /dev/null +++ b/src/scripts/ci/travis/after_success.sh @@ -0,0 +1,13 @@ +#!/bin/sh +set -ev +which shellcheck > /dev/null && shellcheck "$0" # Run shellcheck on this if available + +if [ "$BUILD_MODE" = "coverage" ]; then + GCOV="/usr/bin/gcov-4.8" + /tmp/usr/bin/lcov --gcov-tool "$GCOV" --directory . --capture --output-file coverage.info + /tmp/usr/bin/lcov --gcov-tool "$GCOV" --remove coverage.info 'tests/*' '/usr/*' --output-file coverage.info + /tmp/usr/bin/lcov --gcov-tool "$GCOV" --list coverage.info + + # Assume that $COVERALLS_REPO_TOKEN might not be set (e.g. pull requests) + coveralls-lcov --repo-token="$COVERALLS_REPO_TOKEN" coverage.info +fi diff --git a/src/scripts/ci/travis/build.sh b/src/scripts/ci/travis/build.sh new file mode 100755 index 000000000..8bb8c9380 --- /dev/null +++ b/src/scripts/ci/travis/build.sh @@ -0,0 +1,51 @@ +#!/bin/bash +set -ev +which shellcheck > /dev/null && shellcheck "$0" # Run shellcheck on this if available + +if [ "$BUILD_MODE" = "static" ]; then + CFG_FLAGS=(--disable-shared --via-amalgamation) +elif [ "$BUILD_MODE" = "shared" ]; then + CFG_FLAGS=() +elif [ "$BUILD_MODE" = "coverage" ]; then + # lcov gets confused by symlinks + CFG_FLAGS=(--build-mode=coverage --link-method=copy) +elif [ "$BUILD_MODE" = "sanitizer" ]; then + CFG_FLAGS=(--build-mode=sanitizer) +fi + +if [ "$MODULES" = "min" ]; then + CFG_FLAGS+=(--no-autoload --enable-modules=base) +fi + +# Workaround for missing update-alternatives +# https://github.com/travis-ci/travis-ci/issues/3668 +if [ "$CXX" = "g++" ]; then + export CXX="/usr/bin/g++-4.8" +fi + +#enable ccache +if [ "$TRAVIS_OS_NAME" = "linux" ]; then + ccache --max-size=30M + ccache --show-stats + + export CXX="ccache $CXX" +fi + +if [ "$TARGETOS" = "ios" ]; then + ./configure.py "${CFG_FLAGS[@]}" --cpu=armv7 --cc=clang \ + --cc-abi-flags="-arch armv7 -arch armv7s -stdlib=libc++ --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk/" \ + --prefix=/tmp/botan-installation +else + $CXX --version + ./configure.py "${CFG_FLAGS[@]}" --cc="$CC" --cc-bin="$CXX" \ + --with-bzip2 --with-lzma --with-openssl --with-sqlite --with-zlib \ + --prefix=/tmp/botan-installation +fi + +make -j 2 + +if [ "$MODULES" != "min" ] && [ "$TARGETOS" != "ios" ]; then + ./botan-test +fi + +make install diff --git a/src/scripts/ci/travis/install.sh b/src/scripts/ci/travis/install.sh new file mode 100755 index 000000000..447049f60 --- /dev/null +++ b/src/scripts/ci/travis/install.sh @@ -0,0 +1,15 @@ +#!/bin/sh +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.11.orig.tar.gz + tar -xvf lcov_1.11.orig.tar.gz + export PREFIX="/tmp" + make -C lcov-1.11/ install + gem install coveralls-lcov +fi + +if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$TARGETOS" != "ios" ]; then + ./src/scripts/ci/travis/install_osx_packages.sh +fi diff --git a/src/scripts/ci/travis/install_osx_packages.sh b/src/scripts/ci/travis/install_osx_packages.sh new file mode 100755 index 000000000..1d4a5e001 --- /dev/null +++ b/src/scripts/ci/travis/install_osx_packages.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -ev +which shellcheck > /dev/null && shellcheck "$0" # Run shellcheck on this if available + +# Workaround for https://github.com/Homebrew/homebrew/issues/42553 +brew update || brew update + +brew install xz -- cgit v1.2.3