diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2017-08-26 11:51:03 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-08-26 11:51:53 -0700 |
commit | d3340fe9ae39853114555711f5376929344b2f0d (patch) | |
tree | 841347019c41a3d8e1498d9f884a9de9b986201f | |
parent | 8cd4c73217b36f24b395a6e6a3df5774bd7acce2 (diff) | |
download | subsurface-d3340fe9ae39853114555711f5376929344b2f0d.tar.gz |
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 <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rwxr-xr-x | scripts/build.sh | 37 |
1 files changed, 36 insertions, 1 deletions
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 |