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