diff options
Diffstat (limited to 'packaging')
-rwxr-xr-x | packaging/android/build.sh | 138 |
1 files changed, 44 insertions, 94 deletions
diff --git a/packaging/android/build.sh b/packaging/android/build.sh index ecad191bc..42c0aed94 100755 --- a/packaging/android/build.sh +++ b/packaging/android/build.sh @@ -110,14 +110,7 @@ else fi # Which versions are we building against? -SQLITE_VERSION=3190200 -LIBXML2_VERSION=2.9.4 -LIBXSLT_VERSION=1.1.29 -LIBZIP_VERSION=1.1.3 -LIBGIT2_VERSION=0.26.0 -LIBUSB_VERSION=1.0.20 OPENSSL_VERSION=1.0.2l -LIBFTDI_VERSION=1.3 if [ "$ARCH" = "arm" ] ; then QT_ARCH=armv7 @@ -164,62 +157,48 @@ else export JAVA_HOME=/usr fi +# find qmake +QMAKE=$QT5_ANDROID/android_armv7/bin/qmake +$QMAKE -query + # build google maps plugin -if [ ! -e googlemaps ] ; then - git clone https://github.com/Subsurface-divelog/googlemaps.git -else - pushd googlemaps - git checkout master - git pull --rebase - popd -fi +${SUBSURFACE_SOURCE}/scripts/get-dep-lib.sh singleAndroid . googlemaps # find qmake QMAKE=$QT5_ANDROID/android_armv7/bin/qmake $QMAKE -query QT_PLUGINS_PATH=$($QMAKE -query QT_INSTALL_PLUGINS) GOOGLEMAPS_BIN=libqtgeoservices_googlemaps.so if [ ! -e "$QT_PLUGINS_PATH"/geoservices/$GOOGLEMAPS_BIN ] || [ googlemaps/.git/HEAD -nt "$QT_PLUGINS_PATH"/geoservices/$GOOGLEMAPS_BIN ] ; then - mkdir -p googlemaps-build-"$ARCH" - pushd googlemaps-build-"$ARCH" - $QMAKE ../googlemaps/googlemaps.pro - # on Travis the compiler doesn't support c++1z, yet qmake adds that flag; - # since things compile fine with c++11, let's just hack that away - # similarly, don't use -Wdata-time - sed -i.bak -e 's/std=c++1z/std=c++11/g ; s/-Wdate-time//' Makefile - make -j4 - $QMAKE -install qinstall -exe $GOOGLEMAPS_BIN "$QT_PLUGINS_PATH"/geoservices/$GOOGLEMAPS_BIN - popd -fi - -if [ ! -e sqlite-autoconf-${SQLITE_VERSION}.tar.gz ] ; then - wget http://www.sqlite.org/2017/sqlite-autoconf-${SQLITE_VERSION}.tar.gz -fi -if [ ! -e sqlite-autoconf-${SQLITE_VERSION} ] ; then - tar -zxf sqlite-autoconf-${SQLITE_VERSION}.tar.gz -fi + mkdir -p googlemaps-build-"$ARCH" + pushd googlemaps-build-"$ARCH" + $QMAKE ../googlemaps/googlemaps.pro + # on Travis the compiler doesn't support c++1z, yet qmake adds that flag; + # since things compile fine with c++11, let's just hack that away + # similarly, don't use -Wdata-time + sed -i.bak -e 's/std=c++1z/std=c++11/g ; s/-Wdate-time//' Makefile + make -j4 + $QMAKE -install qinstall -exe $GOOGLEMAPS_BIN "$QT_PLUGINS_PATH"/geoservices/$GOOGLEMAPS_BIN + popd +fi + +${SUBSURFACE_SOURCE}/scripts/get-dep-lib.sh singleAndroid . sqlite if [ ! -e "$PKG_CONFIG_LIBDIR/sqlite3.pc" ] ; then mkdir -p sqlite-build-"$ARCH" pushd sqlite-build-"$ARCH" - ../sqlite-autoconf-${SQLITE_VERSION}/configure --host=${BUILDCHAIN} --prefix="$PREFIX" --enable-static --disable-shared + ../sqlite/configure --host=${BUILDCHAIN} --prefix="$PREFIX" --enable-static --disable-shared make make install popd fi -if [ ! -e libxml2-${LIBXML2_VERSION}.tar.gz ] ; then - wget http://api.github.com/repos/GNOME/libxml2/tarball/v${LIBXML2_VERSION} -O libxml2-${LIBXML2_VERSION}.tar.gz -fi -if [ ! -e libxml2-${LIBXML2_VERSION} ] ; then - mkdir -p libxml2-${LIBXML2_VERSION} - tar -xzf libxml2-${LIBXML2_VERSION}.tar.gz --strip 1 -C libxml2-${LIBXML2_VERSION} - pushd libxml2-${LIBXML2_VERSION} - autoreconf --install - popd -fi +${SUBSURFACE_SOURCE}/scripts/get-dep-lib.sh singleAndroid . libxml2 +pushd libxml2 +autoreconf --install +popd if [ ! -e "$PKG_CONFIG_LIBDIR/libxml-2.0.pc" ] ; then mkdir -p libxml2-build-"$ARCH" pushd libxml2-build-"$ARCH" - ../libxml2-${LIBXML2_VERSION}/configure --host=${BUILDCHAIN} --prefix="$PREFIX" --without-python --without-iconv --enable-static --disable-shared + ../libxml2/configure --host=${BUILDCHAIN} --prefix="$PREFIX" --without-python --without-iconv --enable-static --disable-shared perl -pi -e 's/runtest\$\(EXEEXT\)//' Makefile perl -pi -e 's/testrecurse\$\(EXEEXT\)//' Makefile make @@ -227,46 +206,32 @@ if [ ! -e "$PKG_CONFIG_LIBDIR/libxml-2.0.pc" ] ; then popd fi -if [ ! -e libxslt-${LIBXSLT_VERSION}.tar.gz ] ; then - wget http://api.github.com/repos/GNOME/libxslt/tarball/v${LIBXSLT_VERSION} -O libxslt-${LIBXSLT_VERSION}.tar.gz -fi -if [ ! -e libxslt-${LIBXSLT_VERSION} ] ; then - mkdir -p libxslt-${LIBXSLT_VERSION} - tar -zxf libxslt-${LIBXSLT_VERSION}.tar.gz --strip 1 -C libxslt-${LIBXSLT_VERSION} - pushd libxslt-${LIBXSLT_VERSION} - autoreconf --install - popd -fi +${SUBSURFACE_SOURCE}/scripts/get-dep-lib.sh singleAndroid . libxslt +pushd libxslt +autoreconf --install +popd if [ ! -e "$PKG_CONFIG_LIBDIR/libxslt.pc" ] ; then mkdir -p libxslt-build-"$ARCH" pushd libxslt-build-"$ARCH" - ../libxslt-${LIBXSLT_VERSION}/configure --host=${BUILDCHAIN} --prefix="$PREFIX" --with-libxml-prefix="$PREFIX" --without-python --without-crypto --enable-static --disable-shared + ../libxslt/configure --host=${BUILDCHAIN} --prefix="$PREFIX" --with-libxml-prefix="$PREFIX" --without-python --without-crypto --enable-static --disable-shared make make install popd fi -if [ ! -e libzip-${LIBZIP_VERSION}.tar.gz ] ; then - wget http://www.nih.at/libzip/libzip-${LIBZIP_VERSION}.tar.gz -fi -if [ ! -e libzip-${LIBZIP_VERSION} ] ; then - tar -zxf libzip-${LIBZIP_VERSION}.tar.gz -fi +${SUBSURFACE_SOURCE}/scripts/get-dep-lib.sh singleAndroid . libzip if [ ! -e "$PKG_CONFIG_LIBDIR/libzip.pc" ] ; then mkdir -p libzip-build-"$ARCH" pushd libzip-build-"$ARCH" - ../libzip-${LIBZIP_VERSION}/configure --host=${BUILDCHAIN} --prefix="$PREFIX" --enable-static --disable-shared + ../libzip/configure --host=${BUILDCHAIN} --prefix="$PREFIX" --enable-static --disable-shared make make install popd fi -if [ ! -e openssl-${OPENSSL_VERSION}.tar.gz ] ; then - wget -O openssl-${OPENSSL_VERSION}.tar.gz http://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz -fi +${SUBSURFACE_SOURCE}/scripts/get-dep-lib.sh singleAndroid . openssl if [ ! -e openssl-build-"$ARCH" ] ; then - tar -zxf openssl-${OPENSSL_VERSION}.tar.gz - mv openssl-${OPENSSL_VERSION} openssl-build-"$ARCH" + mv openssl openssl-build-"$ARCH" fi if [ ! -e "$PKG_CONFIG_LIBDIR/libssl.pc" ] ; then pushd openssl-build-"$ARCH" @@ -288,15 +253,10 @@ if [ ! -e "$PKG_CONFIG_LIBDIR/libssl.pc" ] ; then popd fi -if [ ! -e libgit2-${LIBGIT2_VERSION}.tar.gz ] ; then - wget -O libgit2-${LIBGIT2_VERSION}.tar.gz https://github.com/libgit2/libgit2/archive/v${LIBGIT2_VERSION}.tar.gz -fi -if [ ! -e libgit2-${LIBGIT2_VERSION} ] ; then - tar -zxf libgit2-${LIBGIT2_VERSION}.tar.gz -fi +${SUBSURFACE_SOURCE}/scripts/get-dep-lib.sh singleAndroid . libgit2 if [ ! -e "$PKG_CONFIG_LIBDIR/libgit2.pc" ] ; then # We don't want to find the HTTP_Parser package of the build host by mistake - perl -pi -e 's/FIND_PACKAGE\(HTTP_Parser\)/#FIND_PACKAGE(HTTP_Parser)/' libgit2-${LIBGIT2_VERSION}/CMakeLists.txt + perl -pi -e 's/FIND_PACKAGE\(HTTP_Parser\)/#FIND_PACKAGE(HTTP_Parser)/' libgit2/CMakeLists.txt mkdir -p libgit2-build-"$ARCH" pushd libgit2-build-"$ARCH" cmake \ @@ -310,7 +270,7 @@ if [ ! -e "$PKG_CONFIG_LIBDIR/libgit2.pc" ] ; then -DOPENSSL_CRYPTO_LIBRARY="$PREFIX"/lib/libcrypto.so \ -DOPENSSL_INCLUDE_DIR="$PREFIX"/include/openssl \ -D_OPENSSL_VERSION=${OPENSSL_VERSION} \ - ../libgit2-${LIBGIT2_VERSION}/ + ../libgit2/ make make install # Patch away pkg-config dependency to zlib, its there, i promise @@ -318,20 +278,15 @@ if [ ! -e "$PKG_CONFIG_LIBDIR/libgit2.pc" ] ; then popd fi -if [ ! -e libusb-${LIBUSB_VERSION}.tar.gz ] ; then - wget -O libusb-${LIBUSB_VERSION}.tar.gz https://github.com/libusb/libusb/archive/v${LIBUSB_VERSION}.tar.gz -fi -if [ ! -e libusb-${LIBUSB_VERSION} ] ; then - tar -zxf libusb-${LIBUSB_VERSION}.tar.gz -fi -if ! grep -q libusb_set_android_open_callback libusb-${LIBUSB_VERSION}/libusb/libusb.h ; then +${SUBSURFACE_SOURCE}/scripts/get-dep-lib.sh singleAndroid . libusb +if ! grep -q libusb_set_android_open_callback libusb/libusb/libusb.h ; then # Patch in our libusb callback - pushd libusb-${LIBUSB_VERSION} + pushd libusb patch -p1 < "$SUBSURFACE_SOURCE"/packaging/android/patches/libusb-android.patch popd fi -if [ ! -e libusb-${LIBUSB_VERSION}/configure ] ; then - pushd libusb-${LIBUSB_VERSION} +if [ ! -e libusb/configure ] ; then + pushd libusb mkdir m4 autoreconf -i popd @@ -339,23 +294,18 @@ fi if [ ! -e "$PKG_CONFIG_LIBDIR/libusb-1.0.pc" ] ; then mkdir -p libusb-build-"$ARCH" pushd libusb-build-"$ARCH" - ../libusb-${LIBUSB_VERSION}/configure --host=${BUILDCHAIN} --prefix="$PREFIX" --enable-static --disable-shared --disable-udev --enable-system-log + ../libusb/configure --host=${BUILDCHAIN} --prefix="$PREFIX" --enable-static --disable-shared --disable-udev --enable-system-log # --enable-debug-log make make install popd fi -if [ ! -e libftdi1-${LIBFTDI_VERSION}.tar.bz2 ] ; then - wget -O libftdi1-${LIBFTDI_VERSION}.tar.bz2 http://www.intra2net.com/en/developer/libftdi/download/libftdi1-${LIBFTDI_VERSION}.tar.bz2 -fi -if [ ! -e libftdi1-${LIBFTDI_VERSION} ] ; then - tar -jxf libftdi1-${LIBFTDI_VERSION}.tar.bz2 -fi +${SUBSURFACE_SOURCE}/scripts/get-dep-lib.sh singleAndroid . libftdi1 if [ ! -e "$PKG_CONFIG_LIBDIR/libftdi1.pc" ] && [ "$PLATFORM" != "Darwin" ] ; then mkdir -p libftdi1-build-"$ARCH" pushd libftdi1-build-"$ARCH" - cmake ../libftdi1-${LIBFTDI_VERSION} -DCMAKE_C_COMPILER="$CC" -DCMAKE_INSTALL_PREFIX="$PREFIX" -DCMAKE_PREFIX_PATH="$PREFIX" -DSTATICLIBS=ON -DPYTHON_BINDINGS=OFF -DDOCUMENTATION=OFF -DFTDIPP=OFF -DBUILD_TESTS=OFF -DEXAMPLES=OFF -DFTDI_EEPROM=OFF + cmake ../libftdi1 -DCMAKE_C_COMPILER="$CC" -DCMAKE_INSTALL_PREFIX="$PREFIX" -DCMAKE_PREFIX_PATH="$PREFIX" -DSTATICLIBS=ON -DPYTHON_BINDINGS=OFF -DDOCUMENTATION=OFF -DFTDIPP=OFF -DBUILD_TESTS=OFF -DEXAMPLES=OFF -DFTDI_EEPROM=OFF make make install popd |