From a8c47cb75dd0246e5386f28592c88dc5951a8351 Mon Sep 17 00:00:00 2001 From: Anton Lundin Date: Mon, 14 May 2018 21:56:54 +0200 Subject: android-build: Build googlemaps plugin same way as others This reworks the googlemaps build to be more like the other builds, with the same pattern and way of detecting what we need to do, and when we need to rebuild it. Signed-off-by: Anton Lundin --- packaging/android/build.sh | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/packaging/android/build.sh b/packaging/android/build.sh index e5c10562e..fc4845196 100755 --- a/packaging/android/build.sh +++ b/packaging/android/build.sh @@ -164,30 +164,32 @@ 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 -cd googlemaps -git checkout master -git pull --rebase -mkdir -p build-"$ARCH" -cd build-"$ARCH" -$QMAKE ../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 -QT_PLUGINS_PATH=`$QMAKE -query QT_INSTALL_PLUGINS` +# find qmake +QMAKE=$QT5_ANDROID/android_armv7/bin/qmake +$QMAKE -query +QT_PLUGINS_PATH=$($QMAKE -query QT_INSTALL_PLUGINS) GOOGLEMAPS_BIN=libqtgeoservices_googlemaps.so -$QMAKE -install qinstall -exe $GOOGLEMAPS_BIN $QT_PLUGINS_PATH/geoservices/$GOOGLEMAPS_BIN -cd ../../ +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 -- cgit v1.2.3-70-g09d2