Add agl-demo-preload feature 41/19041/3
authorScott Murray <scott.murray@konsulko.com>
Tue, 4 Dec 2018 22:31:48 +0000 (17:31 -0500)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Thu, 20 Dec 2018 21:10:18 +0000 (21:10 +0000)
Add a feature to preload the maps for the navigation app and the API key
for the POI app.  The intent is to allow building an image that works
"out of the box" without manually installing things.  The selection of
UK or Japan maps can be controlled by setting the variable
DEMO_MAPS_LOCALE to either "uk" (default) or "jp" in local.conf or
site.conf.  The POI API key should be set in one of those locations with
the variable POIAPP_API_KEY (default value is an empty string).

Change-Id: I25537935ddac740090f2121d0a83305c746185b0
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
recipes-demo-hmi/navigation/navigation-maps-jp_1.0.bb [new file with mode: 0755]
recipes-demo-hmi/navigation/navigation-maps-uk_1.0.bb [new file with mode: 0755]
recipes-demo-hmi/navigation/navigation-maps.inc [new file with mode: 0755]
recipes-demo-hmi/navigation/poiapp-api-key_1.0.bb [new file with mode: 0755]
recipes-platform/packagegroups/packagegroup-agl-demo-platform.bb
templates/feature/agl-demo-preload/50_local.conf.inc [new file with mode: 0644]

diff --git a/recipes-demo-hmi/navigation/navigation-maps-jp_1.0.bb b/recipes-demo-hmi/navigation/navigation-maps-jp_1.0.bb
new file mode 100755 (executable)
index 0000000..27979b3
--- /dev/null
@@ -0,0 +1,14 @@
+SUMMARY = "AGL Reference Navigation application Japan maps"
+DESCRIPTION = "Preload the Japanese maps for the AGL Navigation application."
+HOMEPAGE = "http://agl.wismobi.com/"
+SECTION = "apps"
+LICENSE = "Proprietary"
+LIC_FILES_CHKSUM="file://${COMMON_LICENSE_DIR}/Proprietary;md5=0557f9d92cf58f2ccdd50f62f8ac0b28"
+
+SRC_URI = "http://agl.wismobi.com/data/japan_TR9/navi_data.tar.gz"
+SRC_URI[md5sum] = "4fd44b0633d44d41c07227d086cd299c"
+SRC_URI[sha256sum] = "ce39a36741baccd6b40277acb8c81ebc181997c75483dffb46ccd22f7877295a"
+
+require navigation-maps.inc
+
+RCONFLICTS_${PN} = "navigation-maps-uk"
diff --git a/recipes-demo-hmi/navigation/navigation-maps-uk_1.0.bb b/recipes-demo-hmi/navigation/navigation-maps-uk_1.0.bb
new file mode 100755 (executable)
index 0000000..1718c36
--- /dev/null
@@ -0,0 +1,14 @@
+SUMMARY = "AGL Reference Navigation application UK maps"
+DESCRIPTION = "Preload the UK maps for the AGL Navigation application."
+HOMEPAGE = "http://agl.wismobi.com/"
+SECTION = "apps"
+LICENSE = "Proprietary"
+LIC_FILES_CHKSUM="file://${COMMON_LICENSE_DIR}/Proprietary;md5=0557f9d92cf58f2ccdd50f62f8ac0b28"
+
+SRC_URI = "http://agl.wismobi.com/data/UnitedKingdom_TR9/navi_data_UK.tar.gz"
+SRC_URI[md5sum] = "f711c6d2c88553a1de4db9f7e12f6e8e"
+SRC_URI[sha256sum] = "515bdc81ac0615d541e0d18c186ad5cd24de2d47b60e13079a918f6dec802fd7"
+
+require navigation-maps.inc
+
+RCONFLICTS_${PN} = "navigation-maps-jp"
diff --git a/recipes-demo-hmi/navigation/navigation-maps.inc b/recipes-demo-hmi/navigation/navigation-maps.inc
new file mode 100755 (executable)
index 0000000..49b7ab4
--- /dev/null
@@ -0,0 +1,14 @@
+DEPENDS = "tar-native"
+
+SRC_URI_append = ";downloadfilename=${BP}.tar.gz;unpack=0"
+
+do_compile[noexec] = "1"
+
+do_install () {
+    install -d ${D}${localstatedir}/mapdata
+    tar -C ${D}${localstatedir}/mapdata --no-same-owner -xf ${WORKDIR}/${BP}.tar.gz
+}
+
+FILES_${PN} += "${localstatedir}/mapdata/*"
+
+RDEPENDS_${PN} += "navigation"
diff --git a/recipes-demo-hmi/navigation/poiapp-api-key_1.0.bb b/recipes-demo-hmi/navigation/poiapp-api-key_1.0.bb
new file mode 100755 (executable)
index 0000000..ad6546f
--- /dev/null
@@ -0,0 +1,17 @@
+SUMMARY = "AGL Reference POI application API key."
+DESCRIPTION = "Preload the API key for the AGL POI application."
+HOMEPAGE = "https://github.com/AGLExport/genivi-navi-yelp-client"
+SECTION = "apps"
+LICENSE = "Proprietary"
+LIC_FILES_CHKSUM="file://${COMMON_LICENSE_DIR}/Proprietary;md5=0557f9d92cf58f2ccdd50f62f8ac0b28"
+
+do_fetch[noexec] = "1"
+do_unpack[noexec] = "1"
+do_compile[noexec] = "1"
+
+POIAPP_API_KEY ?= ""
+
+do_install () {
+    install -d ${D}${sysconfdir}
+    echo "${POIAPP_API_KEY}" > ${D}${sysconfdir}/poikey
+}
index 9deaea2..40e4d3c 100755 (executable)
@@ -61,6 +61,10 @@ QTAGLEXTRAS = "${@bb.utils.contains("DISTRO_FEATURES", "agl-hmi-framework", " qt
 # mapviewer and mapviewer-demo are required for AGL cluster demo
 MAPVIEWER = "${@bb.utils.contains("DISTRO_FEATURES", "agl-cluster-demo-support", " mapviewer mapviewer-demo", "",d)}"
 
+# Preload navigation maps and poi API key for demo if requested
+DEMO_MAPS_LOCALE ?= "uk"
+DEMO_PRELOAD = "${@bb.utils.contains("DISTRO_FEATURES", "agl-demo-preload", " navigation-maps-${DEMO_MAPS_LOCALE} poiapp-api-key", "",d)}"
+
 RDEPENDS_${PN}_append = " \
     qtquickcontrols2-agl \
     qtquickcontrols2-agl-style \
@@ -70,6 +74,7 @@ RDEPENDS_${PN}_append = " \
     ${AGL_APIS} \
     ${QTAGLEXTRAS} \
     ${MAPVIEWER} \
+    ${DEMO_PRELOAD} \
     "
 
 
diff --git a/templates/feature/agl-demo-preload/50_local.conf.inc b/templates/feature/agl-demo-preload/50_local.conf.inc
new file mode 100644 (file)
index 0000000..c7524e5
--- /dev/null
@@ -0,0 +1 @@
+DISTRO_FEATURES_append = " agl-demo-preload"