Subject: [PATCH] community/qt5-qtlocation: enable QML bindings

From: Bart Ribbers <[email-masked]>
Date: Sat, 7 Sep 2019 18:10:31 +0200

Mapbox has some GNUisms and doesn't realize our system doesn't use glibc (as it just checks if our system is glibc).
Since our platform isn't android, win32, darwin or qnx either, we need to add our own target and define that while running qmake
---
I'm not sure this is the right approach, I rather have qmake check if "__GLIBC__" is defined (as it won't be on any of those targets that need that file), but I'm not sure how to do that. 

 community/qt5-qtlocation/APKBUILD        | 12 +++++++-----
 community/qt5-qtlocation/fix-build.patch | 13 +++++++++++++
 2 files changed, 20 insertions(+), 5 deletions(-)
 create mode 100644 community/qt5-qtlocation/fix-build.patch

diff --git a/community/qt5-qtlocation/APKBUILD b/community/qt5-qtlocation/APKBUILD
index aa820510ca..3c38c544d6 100644
--- a/community/qt5-qtlocation/APKBUILD
+++ b/community/qt5-qtlocation/APKBUILD
@@ -7,20 +7,21 @@ _ver=${pkgver/_/-}
 _ver=${_ver/beta0/beta}
 _ver=${_ver/rc0/rc}
 _V=${_ver/rc/RC}
-pkgrel=0
+pkgrel=1
 pkgdesc="Qt5 - Location component"
 url="http://qt-project.org/"
 arch="all"
 license="LGPL-2.0 with exceptions or GPL-3.0 with exceptions"
 options="!check" # upstream does not provide check
-makedepends="qt5-qtbase-dev"
+makedepends="qt5-qtbase-dev qt5-qtdeclarative-dev icu-dev"
 subpackages="$pkgname-dev"
 
 case $pkgver in
 *_beta*|*_rc*) _rel=development_releases;;
 *) _rel=official_releases;;
 esac
-source="http://download.qt-project.org/$_rel/qt/${pkgver%.*}/$_ver/submodules/$_pkgname-$_V.tar.xz"
+source="http://download.qt-project.org/$_rel/qt/${pkgver%.*}/$_ver/submodules/$_pkgname-$_V.tar.xz
+	fix-build.patch"
 
 builddir="$srcdir"/$_pkgname-${_V%-*}
 
@@ -32,7 +33,7 @@ prepare() {
 
 build() {
 	cd "$builddir"/build
-	qmake-qt5 ..
+	qmake-qt5 "CONFIG+=posix" ..
 	make
 }
 
@@ -40,4 +41,5 @@ package() {
 	cd "$builddir"/build
 	make INSTALL_ROOT="$pkgdir" install
 }
-sha512sums="b03380feb2e6767dabb0a75f9234c52a9adc580d53b692c356b04293195f6cdd49d9c7e8eb91404b5a7e4c7507498078dd8f41de014330d35f0e99e034b8cf3a  qtlocation-everywhere-src-5.12.4.tar.xz"
+sha512sums="b03380feb2e6767dabb0a75f9234c52a9adc580d53b692c356b04293195f6cdd49d9c7e8eb91404b5a7e4c7507498078dd8f41de014330d35f0e99e034b8cf3a  qtlocation-everywhere-src-5.12.4.tar.xz
+eb19b97909b64a82d75732872573b25c626c924aec93dbbe9b1b27fd72354149aa0c4e2d3727a5a2519a7bee39cb6af60761ad40e29b4e7adeb89a300a710505  fix-build.patch"
diff --git a/community/qt5-qtlocation/fix-build.patch b/community/qt5-qtlocation/fix-build.patch
new file mode 100644
index 0000000000..65131f4739
--- /dev/null
+++ b/community/qt5-qtlocation/fix-build.patch
@@ -0,0 +1,13 @@
+diff --git a/src/3rdparty/mapbox-gl-native/mapbox-gl-native.pro b/src/3rdparty/mapbox-gl-native/mapbox-gl-native.pro
+index ed974db..265fe96 100644
+--- a/src/3rdparty/mapbox-gl-native/mapbox-gl-native.pro
++++ b/src/3rdparty/mapbox-gl-native/mapbox-gl-native.pro
+@@ -21,7 +21,7 @@ QMAKE_CXXFLAGS += \
+     -fvisibility-inlines-hidden \
+     -fvisibility=hidden
+ 
+-android|win32|darwin|qnx {
++android|win32|darwin|qnx|posix {
+     SOURCES += \
+         platform/qt/src/thread.cpp
+ } else {
-- 
2.23.0