summaryrefslogtreecommitdiffstats
path: root/meta-boot2qt/recipes-qt/b2qt-addons/b2qt-demos.bb
blob: 3726482ffa9489d168e5903624f2cb22c8dece2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
############################################################################
##
## Copyright (C) 2018 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of the Boot to Qt meta layer.
##
## $QT_BEGIN_LICENSE:GPL$
## Commercial License Usage
## Licensees holding valid commercial Qt licenses may use this file in
## accordance with the commercial license agreement provided with the
## Software or, alternatively, in accordance with the terms contained in
## a written agreement between you and The Qt Company. For licensing terms
## and conditions see https://www.qt.io/terms-conditions. For further
## information use the contact form at https://www.qt.io/contact-us.
##
## GNU General Public License Usage
## Alternatively, this file may be used under the terms of the GNU
## General Public License version 3 or (at your option) any later version
## approved by the KDE Free Qt Foundation. The licenses are as published by
## the Free Software Foundation and appearing in the file LICENSE.GPL3
## included in the packaging of this file. Please review the following
## information to ensure the GNU General Public License requirements will
## be met: https://www.gnu.org/licenses/gpl-3.0.html.
##
## $QT_END_LICENSE$
##
############################################################################

DESCRIPTION = "Boot to Qt Demos"
LICENSE = "BSD | The-Qt-Company-DCLA-2.1"
LIC_FILES_CHKSUM = "file://about-b2qt/AboutBoot2Qt.qml;md5=b0a1a6eef4a172b0a8cb4dad9a167d91;beginline=1;endline=49"

inherit qmake5

QT_GIT_PROJECT=""

SRC_URI = " \
    ${QT_GIT}qt-apps/boot2qt-demos.git;branch=${BRANCH};name=demos \
    ${QT_GIT}qt/qtcanvas3d.git;branch=${QT_BRANCH};name=qtcanvas3d;destsuffix=qtcanvas3d \
    ${QT_GIT}qt/qtquickcontrols.git;branch=${QT_BRANCH};name=qtquickcontrols;destsuffix=qtquickcontrols \
    ${QT_GIT}qt-apps/qtwebbrowser.git;branch=${BROWSER_BRANCH};name=qtwebbrowser;destsuffix=git/basicsuite/qtwebbrowser/tqtc-qtwebbrowser \
    https://s3-eu-west-1.amazonaws.com/qt-files/examples/Videos/Qt_video_720p.webm;name=video1 \
    https://s3-eu-west-1.amazonaws.com/qt-files/examples/Videos/Qt+World+Summit+2015+Recap.mp4;name=video2 \
    "

PV = "5.11.0+git${SRCPV}"

BRANCH = "5.10"
BROWSER_BRANCH = "dev"
QT_BRANCH = "5.10"
SRCREV_demos = "f9c7da64cea85d44998e62f4e0d3ec217a22f0d2"
SRCREV_qtcanvas3d = "32404e27101c5ec81b4ab965faf38263429bbc5a"
SRCREV_qtquickcontrols = "c6713e212ef0b97c45d6466b73220567e94a05f1"
SRCREV_qtwebbrowser = "7c570ee4297946f3ed70565a630d690070533cbd"
SRCREV_FORMAT = "demos_qtcanvas3d_qtquickcontrols_qtwebbrowser"

SRC_URI[video1.md5sum] = "56de4dcfd5201952dce9af9c69fcec9b"
SRC_URI[video1.sha256sum] = "809123419acac99353439e52c870e2e497dfa8f434ef0777e6c7303e6ad27f89"
SRC_URI[video2.md5sum] = "e03422de1dba27189872e7d579e7da1b"
SRC_URI[video2.sha256sum] = "651e0b4d2b3272dc10bfc9edba4f0c1a7084cd087c75e8a098f7ba3454c7e485"

S = "${WORKDIR}/git/basicsuite"

DEPENDS = "qtbase qtdeclarative qtxmlpatterns qtquickcontrols qtgraphicaleffects qtsensors qtmultimedia qtcanvas3d \
           ${@bb.utils.contains('DISTRO_FEATURES', 'webengine', 'qtwebengine', '', d)}"

do_install_append() {
    # we only need plugins from the demos
    rm -rf ${D}/data/user/camera
    rm -rf ${D}/data/user/sensorexplorer
    rm -rf ${D}/data/user/qtwebbrowser

    # we need all qml and content files
    cp -r ${S}/* ${D}/data/user/qt/

    # but none of the source files
    find ${D}/data/user/qt/ \( -name '*.cpp' -or -name '*.h' -or -name '*.pro' \) -delete
    rm -rf ${D}/data/user/qt/qtwebbrowser/tqtc-qtwebbrowser
    rm -rf ${D}/data/user/qt/qtwebbrowser/qmldir

    if [ -d ${WORKDIR}/git/images ]; then
        install -d 0755 ${D}/data/images
        install -m 0644 ${WORKDIR}/git/images/* ${D}/data/images/
    fi

    install -d -m 0755 ${D}/data/videos
    install -m 0644 ${WORKDIR}/Qt_video_720p.webm ${D}/data/videos
    install -m 0644 ${WORKDIR}/Qt+World+Summit+2015+Recap.mp4 ${D}/data/videos

    cp ${WORKDIR}/qtcanvas3d/examples/canvas3d/canvas3d/threejs/planets/*.qml  ${D}/data/user/qt/canvas3d-planets
    cp ${WORKDIR}/qtcanvas3d/examples/canvas3d/canvas3d/threejs/planets/*.js ${D}/data/user/qt/canvas3d-planets
    cp -r ${WORKDIR}/qtcanvas3d/examples/canvas3d/canvas3d/threejs/planets/images ${D}/data/user/qt/canvas3d-planets
    cp ${WORKDIR}/qtcanvas3d/examples/canvas3d/canvas3d/threejs/controls/ControlEventSource.qml ${D}/data/user/qt/canvas3d-planets
    cp ${WORKDIR}/qtcanvas3d/examples/canvas3d/canvas3d/3rdparty/*.js ${D}/data/user/qt/canvas3d-planets

    # get rid of qrc:/ prefixes and the custom slider
    sed -i 's/qrc:\(\/\)\?//g' ${D}/data/user/qt/canvas3d-planets/*.qml
    sed -i 's/qrc:\(\/\)\?//g' ${D}/data/user/qt/canvas3d-planets/*.js
    sed -i 's/StyledSlider/Slider/g' ${D}/data/user/qt/canvas3d-planets/planets.qml
    sed -i '/import QtCanvas3D/a import QtQuick.Controls 1.2' ${D}/data/user/qt/canvas3d-planets/planets.qml

    # Qt Quick Extras
    cp -r ${WORKDIR}/qtquickcontrols/examples/quickcontrols/extras/dashboard/qml ${D}/data/user/qt/enterprise-dashboard/
    cp -r ${WORKDIR}/qtquickcontrols/examples/quickcontrols/extras/dashboard/images ${D}/data/user/qt/enterprise-dashboard/

    cp -r ${WORKDIR}/qtquickcontrols/examples/quickcontrols/extras/gallery/qml ${D}/data/user/qt/enterprise-gallery/
    cp -r ${WORKDIR}/qtquickcontrols/examples/quickcontrols/extras/gallery/images ${D}/data/user/qt/enterprise-gallery/
    cp -r ${WORKDIR}/qtquickcontrols/examples/quickcontrols/extras/gallery/fonts ${D}/data/user/qt/enterprise-gallery/

    cp -r ${WORKDIR}/qtquickcontrols/examples/quickcontrols/extras/flat/images ${D}/data/user/qt/enterprise-flat-controls/
    cp ${WORKDIR}/qtquickcontrols/examples/quickcontrols/extras/flat/*.qml ${D}/data/user/qt/enterprise-flat-controls/

    sed -i '/import QtQuick.Window/c\' ${D}/data/user/qt/enterprise-dashboard/qml/dashboard.qml ${D}/data/user/qt/enterprise-gallery/qml/gallery.qml
    sed -i 's/Window /Rectangle /1' ${D}/data/user/qt/enterprise-dashboard/qml/dashboard.qml ${D}/data/user/qt/enterprise-gallery/qml/gallery.qml
    sed -i 's/ApplicationWindow /Rectangle /1' ${D}/data/user/qt/enterprise-flat-controls/main.qml
    sed -i '/title: "Qt Quick Extras Demo"/c\' ${D}/data/user/qt/enterprise-dashboard/qml/dashboard.qml ${D}/data/user/qt/enterprise-gallery/qml/gallery.qml
    sed -i '/title: "Flat Example"/c\' ${D}/data/user/qt/enterprise-flat-controls/main.qml
    sed -i 's/"Light Flat UI Demo"/"Qt Quick Controls"/1' ${D}/data/user/qt/enterprise-flat-controls/main.qml
    sed -i '/{ name: "Exit", action: null }/c\' ${D}/data/user/qt/enterprise-flat-controls/main.qml

    sed -i -e 's/qrc:/../g' ${D}/data/user/qt/enterprise-dashboard/qml/* ${D}/data/user/qt/enterprise-gallery/qml/*
    sed -i 's/qrc:\///g' ${D}/data/user/qt/enterprise-flat-controls/Content.qml
}

FILES_${PN} += " \
    /data/images/ \
    /data/videos/ \
    /data/user \
    "

FILES_${PN}-dbg += " \
    /data/user/qt/qmlplugins/*/.debug/ \
    "