From 102d1b14d0cb28a4b47e070001a2eb05e2e8a967 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Thu, 30 Jul 2015 01:04:46 +0100 Subject: [PATCH 1/4] Check for [g]readelf availability in qt-android helper readelf is not available on OSX, greadelf is available on homebrew --- builds/qt-android/android_build_helper.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/builds/qt-android/android_build_helper.sh b/builds/qt-android/android_build_helper.sh index 7ec89432..a5e4eb50 100644 --- a/builds/qt-android/android_build_helper.sh +++ b/builds/qt-android/android_build_helper.sh @@ -282,7 +282,16 @@ function android_build_verify_so { fi android_build_check_fail - local elfoutput=$(readelf -d ${sofile}) + if command -v readelf >/dev/null 2>&1 ; then + local readelf_bin="readelf" + elif command -v greadelf >/dev/null 2>&1 ; then + local readelf_bin="greadelf" + else + ANDROID_BUILD_FAIL+=("Could not find [g]readelf") + fi + android_build_check_fail + + local elfoutput=$($readelf_bin -d ${sofile}) local soname_regexp='soname: \[([[:alnum:]\.]+)\]' if [[ $elfoutput =~ $soname_regexp ]]; then From 40e2befbbe8297a91832d3a206dc87de9b198169 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Sat, 1 Aug 2015 18:46:32 +0100 Subject: [PATCH 2/4] Update NDK version to r10e, OSX support --- builds/qt-android/ci_build.sh | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/builds/qt-android/ci_build.sh b/builds/qt-android/ci_build.sh index 98d2989a..58a0d263 100755 --- a/builds/qt-android/ci_build.sh +++ b/builds/qt-android/ci_build.sh @@ -1,12 +1,28 @@ #!/usr/bin/env bash -(cd '/tmp' \ - && wget http://dl.google.com/android/ndk/android-ndk-r9-linux-x86_64.tar.bz2 \ - && tar -xf android-ndk-r9-linux-x86_64.tar.bz2 \ - && mv android-ndk-r9 android-ndk) +NDK_VER=android-ndk-r10e -export ANDROID_NDK_ROOT="/tmp/android-ndk" -export TOOLCHAIN_PATH="/tmp/android-ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin" +if [ $TRAVIS_OS_NAME == "linux" ] +then + NDK_PLATFORM=linux-x86_64 +elif [ $TRAVIS_OS_NAME == "osx" ] +then + NDK_PLATFORM=darwin-x86_64 +else + echo "Unsupported platform $TRAVIS_OS_NAME" + exit 1 +fi + +export FILENAME=$NDK_VER-$NDK_PLATFORM.bin + +(cd '/tmp' \ + && wget http://dl.google.com/android/ndk/$FILENAME \ + && chmod a+x $FILENAME \ + && ./$FILENAME &> /dev/null ) || exit 1 +unset FILENAME + +export ANDROID_NDK_ROOT="/tmp/$NDK_VER" +export TOOLCHAIN_PATH="$ANDROID_NDK_ROOT/toolchains/arm-linux-androideabi-4.8/prebuilt/$NDK_PLATFORM/bin" export TOOLCHAIN_NAME="arm-linux-androideabi-4.8" export TOOLCHAIN_HOST="arm-linux-androideabi" export TOOLCHAIN_ARCH="arm" From 20ba66101970142b171b021c8e14f7237590672d Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Sat, 1 Aug 2015 18:53:11 +0100 Subject: [PATCH 3/4] Do not use ldconfig in CI if running on OSX ldconfig is not available on OSX, so Travis CI build fails --- ci_build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci_build.sh b/ci_build.sh index e26f3091..8b206118 100755 --- a/ci_build.sh +++ b/ci_build.sh @@ -5,7 +5,8 @@ if [ $BUILD_TYPE == "default" ]; then # libsodium git clone git://github.com/jedisct1/libsodium.git - ( cd libsodium; ./autogen.sh; ./configure; make check; sudo make install; sudo ldconfig ) + ( cd libsodium; ./autogen.sh; ./configure; make check; sudo make install; + if [ $TRAVIS_OS_NAME != "osx" ] ; then sudo ldconfig ; fi ) # Build and check this project ./autogen.sh && ./configure --with-libsodium=yes && make && make check From 270a1ac5779e81f55345646b6dc4694045b73a36 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Sat, 1 Aug 2015 18:56:11 +0100 Subject: [PATCH 4/4] Add OSX build to travis config. Fixes #1502 --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index be2b04cd..50320cfe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,10 @@ language: c +os: +- linux +- osx + env: - BUILD_TYPE=default - BUILD_TYPE=qt-android