From d3340fe9ae39853114555711f5376929344b2f0d Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 26 Aug 2017 11:51:03 -0700 Subject: build.sh: make Qt private headers available if missing This is based on a script that Lubomir worked on and sent to the mailing list. Suggested-by: Lubomir I. Ivanov Signed-off-by: Dirk Hohndel --- scripts/build.sh | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/scripts/build.sh b/scripts/build.sh index e25d2c55c..d1f7b1fad 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -139,6 +139,41 @@ else QMAKE=qmake fi +# on Debian and Ubuntu based systems, the private QtLocation and +# QtPositioning headers aren't bundled. Download them if necessary. +if [ $PLATFORM = Linux ] ; then + QT_HEADERS_PATH=`$QMAKE -query QT_INSTALL_HEADERS` + QT_VERSION=`$QMAKE -v | grep "Qt" | cut -d" " -f4` + + if [ ! -d "$QT_HEADERS_PATH/QtLocation/$qt_version/QtLocation/private" ] && + [ ! -d $INSTALL_ROOT/include/QtLocation/private ] ; then + echo "Missing private Qt headers for $qt_version; downloading them..." + + QTLOC_GIT=./qtlocation_git + QTLOC_PRIVATE=$INSTALL_ROOT/include/QtLocation/private + QTPOS_PRIVATE=$INSTALL_ROOT/include/QtPositioning/private + + rm -rf $QTLOC_GIT > /dev/null 2>&1 + rm -rf $INSTALL_ROOT/include/QtLocation > /dev/null 2>&1 + rm -rf $INSTALL_ROOT/include/QtPositioning > /dev/null 2>&1 + + git clone --branch v$QT_VERSION git://code.qt.io/qt/qtlocation.git --depth=1 $QTLOC_GIT + + mkdir -p $QTLOC_PRIVATE + cd $QTLOC_GIT/src/location + find -name '*_p.h' | xargs cp -t $QTLOC_PRIVATE + cd $SRC + + mkdir -p $QTPOS_PRIVATE + cd $QTLOC_GIT/src/positioning + find -name '*_p.h' | xargs cp -t $QTPOS_PRIVATE + cd $SRC + + echo "* cleanup..." + rm -rf $QTLOC_GIT > /dev/null 2>&1 + fi +fi + # set up the right file name extensions if [ $PLATFORM = Darwin ] ; then SH_LIB_EXT=dylib @@ -451,7 +486,7 @@ git checkout master git pull --rebase mkdir -p build cd build -$QMAKE ../googlemaps.pro +$QMAKE "INCLUDEPATH=$INSTALL_ROOT/include" ../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 -- cgit v1.2.3-70-g09d2