Pin ces2017-demo recipe for chinook
[AGL/meta-agl-demo.git] / recipes-demo-hmi / CES2017-demo / CES2017-demo.bb
1 SUMMARY     = "App Launcher for the AGL Demonstrator @ CES2017"
2 DESCRIPTION = "App Lanucher app in QML format for the AGL Demonstrator @ CESS2017"
3 HOMEPAGE    = "https://git.automotivelinux.org/gerrit/#/admin/projects/AGL/DemoApps/CES2017"
4 LICENSE     = "MPL-2.0"
5 SECTION     = "apps"
6 PV          = "1.0+git${SRCPV}"
7 S           = "${WORKDIR}/git/"
8 PN          = "ces2017-demo"
9
10 inherit qmake5
11 DEPENDS = "homescreen zip-native qtmultimedia qtquickcontrols2"
12
13 LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=815ca599c9df247a0c7f619bab123dad"
14
15 AGL_RADIO_PRESETS_LOCALE ?= "CES"
16
17 SRC_URI     = "git://gerrit.automotivelinux.org/gerrit/AGL/DemoApps/CES2017;protocol=http \
18                file://presets-${AGL_RADIO_PRESETS_LOCALE}.conf \
19               "
20 SRCREV      = "${AUTOREV}"
21
22 # Pinned branch/SRCREV for Charming Chinook
23 SRC_URI_chinook = "git://gerrit.automotivelinux.org/gerrit/AGL/DemoApps/CES2017;protocol=http;branch=chinook \
24                    file://presets-${AGL_RADIO_PRESETS_LOCALE}.conf \
25                   "
26 SRCREV_chinook = "354195c83841240ddd5f2c5daad97d66cc9e1d28"
27
28 RDEPENDS_${PN} += " \
29     qtmultimedia-qmlplugins \
30     qtmultimedia-rtlfm-radio-plugin \
31     qtquickcontrols-qmlplugins \
32     qtquickcontrols2-qmlplugins \
33     qtsvg-plugins \
34     "
35
36 do_install_prepend() {
37     echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?> \
38 <widget xmlns=\"http://www.w3.org/ns/widgets\" id=\"controls\" version=\"0.1\"> \
39   <name>Controls</name> \
40   <content src=\"controls\" type=\"application/x-executable\"/> \
41   <description>Controls app.</description> \
42   <author>Qt</author> \
43   <icon src=\"controls.png\"/> \
44   <license>Apache 2.0</license> \
45 </widget> \
46 " > ${B}/apps/Controls/config.xml
47
48     cd ${B}/apps/Controls/
49     zip controls.wgt config.xml controls
50
51
52
53     echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?> \
54 <widget xmlns=\"http://www.w3.org/ns/widgets\" id=\"dashboard\" version=\"0.1\"> \
55   <name>Dashboard</name> \
56   <content src=\"dashboard\" type=\"application/x-executable\"/> \
57   <description>Dashboard app.</description> \
58   <author>Qt</author> \
59   <icon src=\"dashboard.png\"/> \
60   <license>Apache 2.0</license> \
61 </widget> \
62 " > ${B}/apps/Dashboard/config.xml
63
64     cd ${B}/apps/Dashboard/
65     zip dashboard.wgt config.xml dashboard
66
67
68
69     echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?> \
70 <widget xmlns=\"http://www.w3.org/ns/widgets\" id=\"phone\" version=\"0.1\"> \
71   <name>Phone</name> \
72   <content src=\"phone\" type=\"application/x-executable\"/> \
73   <description>Phone app.</description> \
74   <author>Qt</author> \
75   <icon src=\"phone.png\"/> \
76   <license>Apache 2.0</license> \
77 </widget> \
78 " > ${B}/apps/Phone/config.xml
79
80     cd ${B}/apps/Phone/
81     zip phone.wgt config.xml phone
82
83
84
85     echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?> \
86 <widget xmlns=\"http://www.w3.org/ns/widgets\" id=\"radio\" version=\"0.1\"> \
87   <name>Radio</name> \
88   <content src=\"radio\" type=\"application/x-executable\"/> \
89   <description>Radio app.</description> \
90   <author>Qt</author> \
91   <icon src=\"radio.png\"/> \
92   <license>Apache 2.0</license> \
93 </widget> \
94 " > ${B}/apps/Radio/config.xml
95
96     cd ${B}/apps/Radio/
97     zip radio.wgt config.xml radio
98
99
100     cat > ${B}/apps/installAllApps.sh <<-EOF
101         #!/bin/sh
102         cd /usr/AGL/apps
103         for file in \`find . -maxdepth 1 -name '*.wgt'\`; do
104
105             /usr/bin/afm-util install \$file
106         done
107         sync
108         
109         #it's Workaround
110         cyad -s -k MANIFESTS -t allow -c User::App::navigation -u '*' -p 'http://tizen.org/privilege/internal/dbus'
111         cyad -s -k MANIFESTS -t allow -c User::App::poi -u '*' -p 'http://tizen.org/privilege/internal/dbus'
112         EOF
113 }
114
115 do_install() {
116     install -d ${D}/usr/AGL/${PN}
117     install -d ${D}/usr/AGL/apps
118     install -m 0644 ${B}/apps/Controls/controls.wgt ${D}/usr/AGL/apps/
119     install -m 0644 ${B}/apps/Dashboard/dashboard.wgt ${D}/usr/AGL/apps/
120     install -m 0644 ${B}/apps/Phone/phone.wgt ${D}/usr/AGL/apps/
121     install -m 0644 ${B}/apps/Radio/radio.wgt ${D}/usr/AGL/apps/
122     install -d ${D}/home/root/app-data/radio
123     install -m 0644 ${WORKDIR}/presets-${AGL_RADIO_PRESETS_LOCALE}.conf ${D}/home/root/app-data/radio/presets.conf
124
125     install -m 0755 ${B}/apps/installAllApps.sh ${D}/usr/AGL/apps/
126     ln -sf            ../apps/installAllApps.sh ${D}/usr/AGL/${PN}/installAllApps.sh
127
128     install -d ${D}${libdir}/qt5/qml/AGL/Demo/Controls/
129     install -m 0644 ${S}/imports/AGL/Demo/Controls/qmldir ${D}${libdir}/qt5/qml/AGL/Demo/Controls/
130     install -m 0644 ${S}/imports/AGL/Demo/Controls/ImageButton.qml ${D}${libdir}/qt5/qml/AGL/Demo/Controls/
131     install -m 0644 ${S}/imports/AGL/Demo/Controls/ToggleButton.qml ${D}${libdir}/qt5/qml/AGL/Demo/Controls/
132     install -m 0644 ${S}/imports/AGL/Demo/Controls/Key.qml ${D}${libdir}/qt5/qml/AGL/Demo/Controls/
133     install -m 0644 ${S}/imports/AGL/Demo/Controls/AbstractKeyboard.qml ${D}${libdir}/qt5/qml/AGL/Demo/Controls/
134     install -m 0644 ${S}/imports/AGL/Demo/Controls/Symbols.qml ${D}${libdir}/qt5/qml/AGL/Demo/Controls/
135     install -m 0644 ${S}/imports/AGL/Demo/Controls/Alphabet.qml ${D}${libdir}/qt5/qml/AGL/Demo/Controls/
136     install -m 0644 ${S}/imports/AGL/Demo/Controls/Keyboard.qml ${D}${libdir}/qt5/qml/AGL/Demo/Controls/
137     install -d ${D}${libdir}/qt5/qml/AGL/Demo/Controls/images/
138     install -m 0644 ${S}/imports/AGL/Demo/Controls/images/Keyboard_Back.svg ${D}${libdir}/qt5/qml/AGL/Demo/Controls/images/
139     install -m 0644 ${S}/imports/AGL/Demo/Controls/images/Keyboard_Shift.svg ${D}${libdir}/qt5/qml/AGL/Demo/Controls/images/
140     install -m 0644 ${S}/imports/AGL/Demo/Controls/images/Keyboard_Space.svg ${D}${libdir}/qt5/qml/AGL/Demo/Controls/images/
141     install -m 0644 ${S}/imports/AGL/Demo/Controls/images/Keyboard_Arrow.svg ${D}${libdir}/qt5/qml/AGL/Demo/Controls/images/
142
143     install -d ${D}${libdir}/qt5/qml/QtQuick/Controls.2/AGL
144     install -m 0644 ${S}/imports/qtquickcontrols2aglstyle/*.qml ${D}${libdir}/qt5/qml/QtQuick/Controls.2/AGL
145
146     install -d ${D}${libdir}/qt5/qml/QtQuick/Controls.2/AGL/images/
147     install -m 0644 ${S}/imports/qtquickcontrols2aglstyle/images/* ${D}${libdir}/qt5/qml/QtQuick/Controls.2/AGL/images/
148 }
149
150 # plain copy in own folder for now
151 #do_install() {
152 #    mkdir -p ${D}/usr/AGL/CES2017/
153 #    cp -rf ./* ${D}/usr/AGL/CES2017/
154 #}
155
156 FILES_${PN} += "/usr/AGL/ \
157         /usr/AGL/apps/* \
158         /usr/AGL/${PN}/* \
159         /home/root/app-data/radio/presets.conf \
160         /usr/lib/qt5/qml/AGL/Demo/Controls/qmldir \
161         /usr/lib/qt5/qml/AGL/Demo/Controls/ImageButton.qml \
162         /usr/lib/qt5/qml/AGL/Demo/Controls/ToggleButton.qml \
163         /usr/lib/qt5/qml/AGL/Demo/Controls/Key.qml \
164         /usr/lib/qt5/qml/AGL/Demo/Controls/AbstractKeyboard.qml \
165         /usr/lib/qt5/qml/AGL/Demo/Controls/Symbols.qml \
166         /usr/lib/qt5/qml/AGL/Demo/Controls/Alphabet.qml \
167         /usr/lib/qt5/qml/AGL/Demo/Controls/Keyboard.qml \
168         /usr/lib/qt5/qml/AGL/Demo/Controls/images/Keyboard_Back.svg \
169         /usr/lib/qt5/qml/AGL/Demo/Controls/images/Keyboard_Shift.svg \
170         /usr/lib/qt5/qml/AGL/Demo/Controls/images/Keyboard_Space.svg \
171         /usr/lib/qt5/qml/AGL/Demo/Controls/images/Keyboard_Arrow.svg \
172         /usr/lib/qt5/qml/QtQuick/Controls.2/AGL \
173         /usr/lib/qt5/qml/QtQuick/Controls.2/AGL/images \
174         "