Fixed demo recipes to auto-install wgt app at first boot
[AGL/meta-agl-demo.git] / recipes-demo-hmi / CES2017-demo / CES2017-demo.bb
index 631cbc1..681e246 100644 (file)
@@ -8,13 +8,21 @@ S           = "${WORKDIR}/git/"
 PN          = "ces2017-demo"
 
 inherit qmake5
-DEPENDS = " qtbase qtdeclarative qtquickcontrols2 qtvirtualkeyboard qtmultimedia homescreen zip-native"
+DEPENDS = "homescreen zip-native qtmultimedia qtquickcontrols2"
+
+inherit aglwgt
 
 LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=815ca599c9df247a0c7f619bab123dad"
 
-SRC_URI     = "git://gerrit.automotivelinux.org/gerrit/AGL/DemoApps/CES2017;protocol=http"
-SRCREV      = "${AUTOREV}"
+# ALS, CES, FOSDEM available
+AGL_RADIO_PRESETS_LOCALE ?= "CES"
 
+SRC_URI     = "git://gerrit.automotivelinux.org/gerrit/AGL/DemoApps/CES2017;protocol=http \
+               file://presets-ALS.conf \
+               file://presets-CES.conf \
+               file://presets-FOSDEM.conf \
+"
+SRCREV      = "${AUTOREV}"
 
 RDEPENDS_${PN} += " \
     qtmultimedia-qmlplugins \
@@ -25,6 +33,8 @@ RDEPENDS_${PN} += " \
     "
 
 do_install_prepend() {
+    mkdir -p ${B}/package
+
     echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?> \
 <widget xmlns=\"http://www.w3.org/ns/widgets\" id=\"controls\" version=\"0.1\"> \
   <name>Controls</name> \
@@ -37,9 +47,7 @@ do_install_prepend() {
 " > ${B}/apps/Controls/config.xml
 
     cd ${B}/apps/Controls/
-    zip controls.wgt config.xml controls
-
-
+    zip ${B}/package/controls.wgt config.xml controls
 
     echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?> \
 <widget xmlns=\"http://www.w3.org/ns/widgets\" id=\"dashboard\" version=\"0.1\"> \
@@ -53,40 +61,7 @@ do_install_prepend() {
 " > ${B}/apps/Dashboard/config.xml
 
     cd ${B}/apps/Dashboard/
-    zip dashboard.wgt config.xml dashboard
-
-
-
-    echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?> \
-<widget xmlns=\"http://www.w3.org/ns/widgets\" id=\"hvac\" version=\"0.1\"> \
-  <name>HVAC</name> \
-  <content src=\"hvac\" type=\"application/x-executable\"/> \
-  <description>HVAC app.</description> \
-  <author>Qt</author> \
-  <icon src=\"hvac.png\"/> \
-  <license>Apache 2.0</license> \
-</widget> \
-" > ${B}/apps/HVAC/config.xml
-
-    cd ${B}/apps/HVAC/
-    zip hvac.wgt config.xml hvac
-
-
-
-    echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?> \
-<widget xmlns=\"http://www.w3.org/ns/widgets\" id=\"mediaplayer\" version=\"0.1\"> \
-  <name>MediaPlayer</name> \
-  <content src=\"mediaplayer\" type=\"application/x-executable\"/> \
-  <description>MediaPlayer app.</description> \
-  <author>Qt</author> \
-  <icon src=\"mediaplayer.png\"/> \
-  <license>Apache 2.0</license> \
-</widget> \
-" > ${B}/apps/MediaPlayer/config.xml
-
-    cd ${B}/apps/MediaPlayer/
-    zip mediaplayer.wgt config.xml mediaplayer
-
+    zip ${B}/package/dashboard.wgt config.xml dashboard
 
 
     echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?> \
@@ -101,7 +76,7 @@ do_install_prepend() {
 " > ${B}/apps/Phone/config.xml
 
     cd ${B}/apps/Phone/
-    zip phone.wgt config.xml phone
+    zip ${B}/package/phone.wgt config.xml phone
 
 
 
@@ -117,53 +92,31 @@ do_install_prepend() {
 " > ${B}/apps/Radio/config.xml
 
     cd ${B}/apps/Radio/
-    zip radio.wgt config.xml radio
+    zip ${B}/package/radio.wgt config.xml radio
 
-
-
-    echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?> \
-<widget xmlns=\"http://www.w3.org/ns/widgets\" id=\"settings\" version=\"0.1\"> \
-  <name>Settings</name> \
-  <content src=\"settings\" type=\"application/x-executable\"/> \
-  <description>Settings app.</description> \
-  <author>Qt</author> \
-  <icon src=\"settings.png\"/> \
-  <license>Apache 2.0</license> \
-</widget> \
-" > ${B}/apps/Settings/config.xml
-
-    cd ${B}/apps/Settings/
-    zip settings.wgt config.xml settings
-
-
-    cat > ${B}/apps/installAllApps.sh <<-EOF
-       #!/bin/sh
-       /usr/bin/afm-util install controls.wgt
-       /usr/bin/afm-util install dashboard.wgt
-       /usr/bin/afm-util install hvac.wgt
-       /usr/bin/afm-util install mediaplayer.wgt
-       /usr/bin/afm-util install phone.wgt
-       /usr/bin/afm-util install radio.wgt
-       /usr/bin/afm-util install settings.wgt
-       EOF
 }
 
 do_install() {
-    install -d ${D}/usr/AGL/${PN}
-    install -m 0644 ${B}/apps/Controls/controls.wgt ${D}/usr/AGL/${PN}/
-    install -m 0644 ${B}/apps/Dashboard/dashboard.wgt ${D}/usr/AGL/${PN}/
-    install -m 0644 ${B}/apps/HVAC/hvac.wgt ${D}/usr/AGL/${PN}/
-    install -m 0644 ${B}/apps/MediaPlayer/mediaplayer.wgt ${D}/usr/AGL/${PN}/
-    install -m 0644 ${B}/apps/Phone/phone.wgt ${D}/usr/AGL/${PN}/
-    install -m 0644 ${B}/apps/Radio/radio.wgt ${D}/usr/AGL/${PN}/
-    install -m 0644 ${B}/apps/Settings/settings.wgt ${D}/usr/AGL/${PN}/
-
-    install -m 0755 ${B}/apps/installAllApps.sh ${D}/usr/AGL/${PN}/
+    install -d ${D}/home/root/app-data/radio
+    install -m 0644 ${WORKDIR}/presets-CES.conf ${D}/home/root/app-data/radio/
+    install -m 0644 ${WORKDIR}/presets-ALS.conf ${D}/home/root/app-data/radio/
+    install -m 0644 ${WORKDIR}/presets-FOSDEM.conf ${D}/home/root/app-data/radio/
+    install -m 0644 ${WORKDIR}/presets-${AGL_RADIO_PRESETS_LOCALE}.conf ${D}/home/root/app-data/radio/presets.conf
 
     install -d ${D}${libdir}/qt5/qml/AGL/Demo/Controls/
     install -m 0644 ${S}/imports/AGL/Demo/Controls/qmldir ${D}${libdir}/qt5/qml/AGL/Demo/Controls/
     install -m 0644 ${S}/imports/AGL/Demo/Controls/ImageButton.qml ${D}${libdir}/qt5/qml/AGL/Demo/Controls/
     install -m 0644 ${S}/imports/AGL/Demo/Controls/ToggleButton.qml ${D}${libdir}/qt5/qml/AGL/Demo/Controls/
+    install -m 0644 ${S}/imports/AGL/Demo/Controls/Key.qml ${D}${libdir}/qt5/qml/AGL/Demo/Controls/
+    install -m 0644 ${S}/imports/AGL/Demo/Controls/AbstractKeyboard.qml ${D}${libdir}/qt5/qml/AGL/Demo/Controls/
+    install -m 0644 ${S}/imports/AGL/Demo/Controls/Symbols.qml ${D}${libdir}/qt5/qml/AGL/Demo/Controls/
+    install -m 0644 ${S}/imports/AGL/Demo/Controls/Alphabet.qml ${D}${libdir}/qt5/qml/AGL/Demo/Controls/
+    install -m 0644 ${S}/imports/AGL/Demo/Controls/Keyboard.qml ${D}${libdir}/qt5/qml/AGL/Demo/Controls/
+    install -d ${D}${libdir}/qt5/qml/AGL/Demo/Controls/images/
+    install -m 0644 ${S}/imports/AGL/Demo/Controls/images/Keyboard_Back.svg ${D}${libdir}/qt5/qml/AGL/Demo/Controls/images/
+    install -m 0644 ${S}/imports/AGL/Demo/Controls/images/Keyboard_Shift.svg ${D}${libdir}/qt5/qml/AGL/Demo/Controls/images/
+    install -m 0644 ${S}/imports/AGL/Demo/Controls/images/Keyboard_Space.svg ${D}${libdir}/qt5/qml/AGL/Demo/Controls/images/
+    install -m 0644 ${S}/imports/AGL/Demo/Controls/images/Keyboard_Arrow.svg ${D}${libdir}/qt5/qml/AGL/Demo/Controls/images/
 
     install -d ${D}${libdir}/qt5/qml/QtQuick/Controls.2/AGL
     install -m 0644 ${S}/imports/qtquickcontrols2aglstyle/*.qml ${D}${libdir}/qt5/qml/QtQuick/Controls.2/AGL
@@ -179,9 +132,20 @@ do_install() {
 #}
 
 FILES_${PN} += "/usr/AGL/ \
+        /home/root/app-data/radio/presets-*.conf \
+        /home/root/app-data/radio/presets.conf \
        /usr/lib/qt5/qml/AGL/Demo/Controls/qmldir \
        /usr/lib/qt5/qml/AGL/Demo/Controls/ImageButton.qml \
        /usr/lib/qt5/qml/AGL/Demo/Controls/ToggleButton.qml \
+       /usr/lib/qt5/qml/AGL/Demo/Controls/Key.qml \
+       /usr/lib/qt5/qml/AGL/Demo/Controls/AbstractKeyboard.qml \
+       /usr/lib/qt5/qml/AGL/Demo/Controls/Symbols.qml \
+       /usr/lib/qt5/qml/AGL/Demo/Controls/Alphabet.qml \
+       /usr/lib/qt5/qml/AGL/Demo/Controls/Keyboard.qml \
+       /usr/lib/qt5/qml/AGL/Demo/Controls/images/Keyboard_Back.svg \
+       /usr/lib/qt5/qml/AGL/Demo/Controls/images/Keyboard_Shift.svg \
+       /usr/lib/qt5/qml/AGL/Demo/Controls/images/Keyboard_Space.svg \
+       /usr/lib/qt5/qml/AGL/Demo/Controls/images/Keyboard_Arrow.svg \
        /usr/lib/qt5/qml/QtQuick/Controls.2/AGL \
        /usr/lib/qt5/qml/QtQuick/Controls.2/AGL/images \
        "