Remove redundancy from recipe CES2017-demo
[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 SRC_URI     = "git://gerrit.automotivelinux.org/gerrit/AGL/DemoApps/CES2017;protocol=http"
16 SRCREV      = "${AUTOREV}"
17
18
19 RDEPENDS_${PN} += " \
20     qtmultimedia-qmlplugins \
21     qtmultimedia-rtlfm-radio-plugin \
22     qtquickcontrols-qmlplugins \
23     qtquickcontrols2-qmlplugins \
24     qtsvg-plugins \
25     "
26
27 do_install_prepend() {
28     echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?> \
29 <widget xmlns=\"http://www.w3.org/ns/widgets\" id=\"controls\" version=\"0.1\"> \
30   <name>Controls</name> \
31   <content src=\"controls\" type=\"application/x-executable\"/> \
32   <description>Controls app.</description> \
33   <author>Qt</author> \
34   <icon src=\"controls.png\"/> \
35   <license>Apache 2.0</license> \
36 </widget> \
37 " > ${B}/apps/Controls/config.xml
38
39     cd ${B}/apps/Controls/
40     zip controls.wgt config.xml controls
41
42
43
44     echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?> \
45 <widget xmlns=\"http://www.w3.org/ns/widgets\" id=\"dashboard\" version=\"0.1\"> \
46   <name>Dashboard</name> \
47   <content src=\"dashboard\" type=\"application/x-executable\"/> \
48   <description>Dashboard app.</description> \
49   <author>Qt</author> \
50   <icon src=\"dashboard.png\"/> \
51   <license>Apache 2.0</license> \
52 </widget> \
53 " > ${B}/apps/Dashboard/config.xml
54
55     cd ${B}/apps/Dashboard/
56     zip dashboard.wgt config.xml dashboard
57
58
59
60     echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?> \
61 <widget xmlns=\"http://www.w3.org/ns/widgets\" id=\"phone\" version=\"0.1\"> \
62   <name>Phone</name> \
63   <content src=\"phone\" type=\"application/x-executable\"/> \
64   <description>Phone app.</description> \
65   <author>Qt</author> \
66   <icon src=\"phone.png\"/> \
67   <license>Apache 2.0</license> \
68 </widget> \
69 " > ${B}/apps/Phone/config.xml
70
71     cd ${B}/apps/Phone/
72     zip phone.wgt config.xml phone
73
74
75
76     echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?> \
77 <widget xmlns=\"http://www.w3.org/ns/widgets\" id=\"radio\" version=\"0.1\"> \
78   <name>Radio</name> \
79   <content src=\"radio\" type=\"application/x-executable\"/> \
80   <description>Radio app.</description> \
81   <author>Qt</author> \
82   <icon src=\"radio.png\"/> \
83   <license>Apache 2.0</license> \
84 </widget> \
85 " > ${B}/apps/Radio/config.xml
86
87     cd ${B}/apps/Radio/
88     zip radio.wgt config.xml radio
89
90
91
92     cat > ${B}/apps/installAllApps.sh <<-EOF
93         #!/bin/sh
94         /usr/bin/afm-util install controls.wgt
95         /usr/bin/afm-util install dashboard.wgt
96         /usr/bin/afm-util install phone.wgt
97         /usr/bin/afm-util install radio.wgt
98         /usr/bin/afm-util install settings.wgt
99         /usr/bin/afm-util install navigation.wgt
100         EOF
101 }
102
103 do_install() {
104     install -d ${D}/usr/AGL/${PN}
105     install -m 0644 ${B}/apps/Controls/controls.wgt ${D}/usr/AGL/${PN}/
106     install -m 0644 ${B}/apps/Dashboard/dashboard.wgt ${D}/usr/AGL/${PN}/
107     install -m 0644 ${B}/apps/Phone/phone.wgt ${D}/usr/AGL/${PN}/
108     install -m 0644 ${B}/apps/Radio/radio.wgt ${D}/usr/AGL/${PN}/
109
110     install -m 0755 ${B}/apps/installAllApps.sh ${D}/usr/AGL/${PN}/
111
112     install -d ${D}${libdir}/qt5/qml/AGL/Demo/Controls/
113     install -m 0644 ${S}/imports/AGL/Demo/Controls/qmldir ${D}${libdir}/qt5/qml/AGL/Demo/Controls/
114     install -m 0644 ${S}/imports/AGL/Demo/Controls/ImageButton.qml ${D}${libdir}/qt5/qml/AGL/Demo/Controls/
115     install -m 0644 ${S}/imports/AGL/Demo/Controls/ToggleButton.qml ${D}${libdir}/qt5/qml/AGL/Demo/Controls/
116
117     install -d ${D}${libdir}/qt5/qml/QtQuick/Controls.2/AGL
118     install -m 0644 ${S}/imports/qtquickcontrols2aglstyle/*.qml ${D}${libdir}/qt5/qml/QtQuick/Controls.2/AGL
119
120     install -d ${D}${libdir}/qt5/qml/QtQuick/Controls.2/AGL/images/
121     install -m 0644 ${S}/imports/qtquickcontrols2aglstyle/images/* ${D}${libdir}/qt5/qml/QtQuick/Controls.2/AGL/images/
122 }
123
124 # plain copy in own folder for now
125 #do_install() {
126 #    mkdir -p ${D}/usr/AGL/CES2017/
127 #    cp -rf ./* ${D}/usr/AGL/CES2017/
128 #}
129
130 FILES_${PN} += "/usr/AGL/ \
131         /usr/lib/qt5/qml/AGL/Demo/Controls/qmldir \
132         /usr/lib/qt5/qml/AGL/Demo/Controls/ImageButton.qml \
133         /usr/lib/qt5/qml/AGL/Demo/Controls/ToggleButton.qml \
134         /usr/lib/qt5/qml/QtQuick/Controls.2/AGL \
135         /usr/lib/qt5/qml/QtQuick/Controls.2/AGL/images \
136         "