meta-agl-core: Centralize qtlocation tweaks 73/28473/3
authorScott Murray <scott.murray@konsulko.com>
Mon, 13 Feb 2023 23:33:31 +0000 (18:33 -0500)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Thu, 16 Feb 2023 13:49:29 +0000 (13:49 +0000)
To avoid issues when combining the meta-agl-ic-container and
meta-agl-demo layers, move the meta-agl-demo qtlocation bbappend to
the pre-existing meta-qt5 dynamic-layers hierarchy in meta-agl-core.
This does have a minor side-effect of enabling more map plugins in
the QtLocation users in the meta-agl-ic-container guests, but seems
more robust overall with respect to future work on binary package
feeds.

Bug-AGL: SPEC-4703

Change-Id: I8244c7ac7a22b25d28da7b8ffbf2454b68bee591
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/28473
Tested-by: Jenkins Job builder account
ci-image-build: Jenkins Job builder account
ci-image-boot-test: Jenkins Job builder account
Reviewed-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtlocation/0001-mapbox-update-API-url-to-match-new-schema.patch [new file with mode: 0644]
meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtlocation_%.bbappend [new file with mode: 0644]
meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtlocation_aglcore.inc [new file with mode: 0644]

diff --git a/meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtlocation/0001-mapbox-update-API-url-to-match-new-schema.patch b/meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtlocation/0001-mapbox-update-API-url-to-match-new-schema.patch
new file mode 100644 (file)
index 0000000..ba8a991
--- /dev/null
@@ -0,0 +1,47 @@
+From 58197439eade86e7efc6fe98116c0092ea429d29 Mon Sep 17 00:00:00 2001
+From: Matt Ranostay <matt.ranostay@konsulko.com>
+Date: Tue, 10 Mar 2020 13:59:58 -0700
+Subject: [PATCH] mapbox: update API url to match new schema
+
+---
+ src/plugins/geoservices/mapbox/qgeotilefetchermapbox.cpp | 7 ++++---
+ src/plugins/geoservices/mapbox/qmapboxcommon.h           | 2 +-
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.cpp b/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.cpp
+index 0b128556..bd2be6b6 100644
+--- a/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.cpp
++++ b/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.cpp
+@@ -88,12 +88,13 @@ QGeoTiledMapReply *QGeoTileFetcherMapbox::getTileImage(const QGeoTileSpec &spec)
+     request.setRawHeader("User-Agent", m_userAgent);
+     request.setUrl(QUrl(mapboxTilesApiPath +
+-                        ((spec.mapId() >= m_mapIds.size()) ? QStringLiteral("mapbox.streets") : m_mapIds[spec.mapId() - 1]) + QLatin1Char('/') +
++                        m_mapIds[m_mapIds.size() - 1] +
++                        QStringLiteral("/tiles/256/") +
+                         QString::number(spec.zoom()) + QLatin1Char('/') +
+                         QString::number(spec.x()) + QLatin1Char('/') +
+                         QString::number(spec.y()) +
+-                        ((m_scaleFactor > 1) ? (QLatin1Char('@') + QString::number(m_scaleFactor) + QLatin1String("x.")) : QLatin1String(".")) +
+-                        m_format + QLatin1Char('?') +
++                        ((m_scaleFactor > 1) ? (QLatin1Char('@') + QString::number(m_scaleFactor) + QLatin1String("x")) : QLatin1String("")) +
++                        QLatin1Char('?') +
+                         QStringLiteral("access_token=") + m_accessToken));
+     QNetworkReply *reply = m_networkManager->get(request);
+diff --git a/src/plugins/geoservices/mapbox/qmapboxcommon.h b/src/plugins/geoservices/mapbox/qmapboxcommon.h
+index e60c4e83..4b2ea98d 100644
+--- a/src/plugins/geoservices/mapbox/qmapboxcommon.h
++++ b/src/plugins/geoservices/mapbox/qmapboxcommon.h
+@@ -46,7 +46,7 @@
+ QT_BEGIN_NAMESPACE
+-static const QString mapboxTilesApiPath = QStringLiteral("http://api.tiles.mapbox.com/v4/");
++static const QString mapboxTilesApiPath = QStringLiteral("https://api.mapbox.com/");
+ // https://www.mapbox.com/api-documentation/#geocoding
+ static const QString mapboxGeocodingApiPath = QStringLiteral("https://api.mapbox.com/geocoding/v5/mapbox.places/");
+-- 
+2.25.0
+
diff --git a/meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtlocation_%.bbappend b/meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtlocation_%.bbappend
new file mode 100644 (file)
index 0000000..a0d8007
--- /dev/null
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', 'qtlocation_aglcore.inc', '', d)}
diff --git a/meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtlocation_aglcore.inc b/meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtlocation_aglcore.inc
new file mode 100644 (file)
index 0000000..60867ae
--- /dev/null
@@ -0,0 +1,14 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/qtlocation:"
+
+SRC_URI += "\
+    file://0001-mapbox-update-API-url-to-match-new-schema.patch \
+    "
+
+# Need to explicitly enable the various plugins
+PACKAGECONFIG += " \
+       geoservices_osm \
+       geoservices_here \
+       geoservices_itemsoverlay \
+       geoservices_mapbox \
+       geoservices_mapboxgl \
+"