summaryrefslogtreecommitdiffstats
path: root/meta-boot2qt/classes
diff options
context:
space:
mode:
Diffstat (limited to 'meta-boot2qt/classes')
-rw-r--r--meta-boot2qt/classes/abi-arch.bbclass49
-rw-r--r--meta-boot2qt/classes/bootfs-image.bbclass60
-rw-r--r--meta-boot2qt/classes/consistent_timestamps.bbclass35
-rw-r--r--meta-boot2qt/classes/deploy-conf.bbclass48
-rw-r--r--meta-boot2qt/classes/image-hdd.bbclass48
-rw-r--r--meta-boot2qt/classes/image_dd.bbclass87
-rw-r--r--meta-boot2qt/classes/image_types_sdcard.bbclass89
-rw-r--r--meta-boot2qt/classes/internal-build.bbclass55
-rw-r--r--meta-boot2qt/classes/populate_b2qt_qt5_sdk.bbclass92
-rw-r--r--meta-boot2qt/classes/populate_b2qt_sdk.bbclass62
-rw-r--r--meta-boot2qt/classes/qbsp-image.bbclass62
-rw-r--r--meta-boot2qt/classes/qbsp.bbclass174
-rw-r--r--meta-boot2qt/classes/qt5-module.bbclass30
-rw-r--r--meta-boot2qt/classes/qtquickcompiler.bbclass30
-rw-r--r--meta-boot2qt/classes/sdk-sources.bbclass99
15 files changed, 1020 insertions, 0 deletions
diff --git a/meta-boot2qt/classes/abi-arch.bbclass b/meta-boot2qt/classes/abi-arch.bbclass
new file mode 100644
index 0000000..23b9b1c
--- /dev/null
+++ b/meta-boot2qt/classes/abi-arch.bbclass
@@ -0,0 +1,49 @@
1############################################################################
2##
3## Copyright (C) 2016 The Qt Company Ltd.
4## Contact: https://www.qt.io/licensing/
5##
6## This file is part of the Boot to Qt meta layer.
7##
8## $QT_BEGIN_LICENSE:GPL$
9## Commercial License Usage
10## Licensees holding valid commercial Qt licenses may use this file in
11## accordance with the commercial license agreement provided with the
12## Software or, alternatively, in accordance with the terms contained in
13## a written agreement between you and The Qt Company. For licensing terms
14## and conditions see https://www.qt.io/terms-conditions. For further
15## information use the contact form at https://www.qt.io/contact-us.
16##
17## GNU General Public License Usage
18## Alternatively, this file may be used under the terms of the GNU
19## General Public License version 3 or (at your option) any later version
20## approved by the KDE Free Qt Foundation. The licenses are as published by
21## the Free Software Foundation and appearing in the file LICENSE.GPL3
22## included in the packaging of this file. Please review the following
23## information to ensure the GNU General Public License requirements will
24## be met: https://www.gnu.org/licenses/gpl-3.0.html.
25##
26## $QT_END_LICENSE$
27##
28############################################################################
29
30# map target architecture to abi architectures used by Qt Creator
31valid_archs = "arm x86 itanium mips ppc sh"
32
33def map_abi_arch(a, d):
34 import re
35
36 valid_archs = d.getVar('valid_archs', True).split()
37
38 if re.match('i.86$', a): return 'x86'
39 elif re.match('x86.64$', a): return 'x86'
40 elif re.match('armeb$', a): return 'arm'
41 elif re.match('aarch64', a): return 'arm'
42 elif re.match('mips(el|64|64el)$', a): return 'mips'
43 elif re.match('p(pc|owerpc)(|64)', a): return 'ppc'
44 elif re.match('sh(3|4)$', a): return 'sh'
45 elif a in valid_archs: return a
46 else:
47 bb.error("cannot map '%s' to a abi architecture" % a)
48
49ABI = "${@map_abi_arch(d.getVar('TARGET_ARCH', True), d)}"
diff --git a/meta-boot2qt/classes/bootfs-image.bbclass b/meta-boot2qt/classes/bootfs-image.bbclass
new file mode 100644
index 0000000..c7a25ae
--- /dev/null
+++ b/meta-boot2qt/classes/bootfs-image.bbclass
@@ -0,0 +1,60 @@
1############################################################################
2##
3## Copyright (C) 2016 The Qt Company Ltd.
4## Contact: https://www.qt.io/licensing/
5##
6## This file is part of the Boot to Qt meta layer.
7##
8## $QT_BEGIN_LICENSE:GPL$
9## Commercial License Usage
10## Licensees holding valid commercial Qt licenses may use this file in
11## accordance with the commercial license agreement provided with the
12## Software or, alternatively, in accordance with the terms contained in
13## a written agreement between you and The Qt Company. For licensing terms
14## and conditions see https://www.qt.io/terms-conditions. For further
15## information use the contact form at https://www.qt.io/contact-us.
16##
17## GNU General Public License Usage
18## Alternatively, this file may be used under the terms of the GNU
19## General Public License version 3 or (at your option) any later version
20## approved by the KDE Free Qt Foundation. The licenses are as published by
21## the Free Software Foundation and appearing in the file LICENSE.GPL3
22## included in the packaging of this file. Please review the following
23## information to ensure the GNU General Public License requirements will
24## be met: https://www.gnu.org/licenses/gpl-3.0.html.
25##
26## $QT_END_LICENSE$
27##
28############################################################################
29
30BOOTFS_NAME = "${IMAGE_BASENAME}-boot-${MACHINE}-${DATETIME}"
31BOOTFS_LINK_NAME = "${IMAGE_BASENAME}-boot-${MACHINE}"
32BOOTFS_NAME[vardepsexclude] += "DATETIME"
33
34BOOTFS_DEPENDS ?= ""
35
36fakeroot do_bootfs () {
37 if [ -z "${BOOTFS_CONTENT}" ]; then
38 exit 0
39 fi
40
41 mkdir -p ${S}/bootfs
42
43 for item in ${BOOTFS_CONTENT}; do
44 src=`echo $item | awk -F':' '{ print $1 }'`
45 dst=`echo $item | awk -F':' '{ print $2 }'`
46
47 install -D -m 0755 ${IMGDEPLOYDIR}/$src ${S}/bootfs/$dst
48 done
49
50 cd ${S}/bootfs
51 rm -f ${IMGDEPLOYDIR}/${BOOTFS_NAME}.tar.gz ${IMGDEPLOYDIR}/${BOOTFS_LINK_NAME}.tar.gz
52
53 mkdir -p ${IMGDEPLOYDIR}
54 tar czvf ${IMGDEPLOYDIR}/${BOOTFS_NAME}.tar.gz .
55 ln -s ${BOOTFS_NAME}.tar.gz ${IMGDEPLOYDIR}/${BOOTFS_LINK_NAME}.tar.gz
56}
57
58addtask bootfs before do_rootfs
59
60do_bootfs[depends] += "${BOOTFS_DEPENDS}"
diff --git a/meta-boot2qt/classes/consistent_timestamps.bbclass b/meta-boot2qt/classes/consistent_timestamps.bbclass
new file mode 100644
index 0000000..1f560c2
--- /dev/null
+++ b/meta-boot2qt/classes/consistent_timestamps.bbclass
@@ -0,0 +1,35 @@
1############################################################################
2##
3## Copyright (C) 2016 The Qt Company Ltd.
4## Contact: https://www.qt.io/licensing/
5##
6## This file is part of the Boot to Qt meta layer.
7##
8## $QT_BEGIN_LICENSE:GPL$
9## Commercial License Usage
10## Licensees holding valid commercial Qt licenses may use this file in
11## accordance with the commercial license agreement provided with the
12## Software or, alternatively, in accordance with the terms contained in
13## a written agreement between you and The Qt Company. For licensing terms
14## and conditions see https://www.qt.io/terms-conditions. For further
15## information use the contact form at https://www.qt.io/contact-us.
16##
17## GNU General Public License Usage
18## Alternatively, this file may be used under the terms of the GNU
19## General Public License version 3 or (at your option) any later version
20## approved by the KDE Free Qt Foundation. The licenses are as published by
21## the Free Software Foundation and appearing in the file LICENSE.GPL3
22## included in the packaging of this file. Please review the following
23## information to ensure the GNU General Public License requirements will
24## be met: https://www.gnu.org/licenses/gpl-3.0.html.
25##
26## $QT_END_LICENSE$
27##
28############################################################################
29
30update_file_timestaps() {
31 # Update file timestamp to 1 second since Epoch time.
32 TZ=UTC find ${IMAGE_ROOTFS} -exec touch -h -m -t '197001010000.01' {} \;
33}
34
35ROOTFS_POSTINSTALL_COMMAND += "update_file_timestaps; "
diff --git a/meta-boot2qt/classes/deploy-conf.bbclass b/meta-boot2qt/classes/deploy-conf.bbclass
new file mode 100644
index 0000000..22c6ef7
--- /dev/null
+++ b/meta-boot2qt/classes/deploy-conf.bbclass
@@ -0,0 +1,48 @@
1############################################################################
2##
3## Copyright (C) 2016 The Qt Company Ltd.
4## Contact: https://www.qt.io/licensing/
5##
6## This file is part of the Boot to Qt meta layer.
7##
8## $QT_BEGIN_LICENSE:GPL$
9## Commercial License Usage
10## Licensees holding valid commercial Qt licenses may use this file in
11## accordance with the commercial license agreement provided with the
12## Software or, alternatively, in accordance with the terms contained in
13## a written agreement between you and The Qt Company. For licensing terms
14## and conditions see https://www.qt.io/terms-conditions. For further
15## information use the contact form at https://www.qt.io/contact-us.
16##
17## GNU General Public License Usage
18## Alternatively, this file may be used under the terms of the GNU
19## General Public License version 3 or (at your option) any later version
20## approved by the KDE Free Qt Foundation. The licenses are as published by
21## the Free Software Foundation and appearing in the file LICENSE.GPL3
22## included in the packaging of this file. Please review the following
23## information to ensure the GNU General Public License requirements will
24## be met: https://www.gnu.org/licenses/gpl-3.0.html.
25##
26## $QT_END_LICENSE$
27##
28############################################################################
29
30inherit image_types
31
32IMAGE_DEPENDS_conf = "qtbase-native"
33
34DEPLOY_CONF_NAME ?= "${MACHINE}"
35DEPLOY_CONF_TYPE ?= "Boot2Qt"
36
37IMAGE_CMD_conf() {
38 QT_VERSION=$(qmake -query QT_VERSION)
39 cat > ${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.conf <<EOF
40[${DEPLOY_CONF_NAME}]
41platform=${MACHINE}
42product=${DEPLOY_CONF_TYPE}
43qt=Qt $QT_VERSION
44os=linux
45imagefile=${IMAGE_LINK_NAME}.img
46asroot=true
47EOF
48}
diff --git a/meta-boot2qt/classes/image-hdd.bbclass b/meta-boot2qt/classes/image-hdd.bbclass
new file mode 100644
index 0000000..d12f3bf
--- /dev/null
+++ b/meta-boot2qt/classes/image-hdd.bbclass
@@ -0,0 +1,48 @@
1############################################################################
2##
3## Copyright (C) 2016 The Qt Company Ltd.
4## Contact: https://www.qt.io/licensing/
5##
6## This file is part of the Boot to Qt meta layer.
7##
8## $QT_BEGIN_LICENSE:GPL$
9## Commercial License Usage
10## Licensees holding valid commercial Qt licenses may use this file in
11## accordance with the commercial license agreement provided with the
12## Software or, alternatively, in accordance with the terms contained in
13## a written agreement between you and The Qt Company. For licensing terms
14## and conditions see https://www.qt.io/terms-conditions. For further
15## information use the contact form at https://www.qt.io/contact-us.
16##
17## GNU General Public License Usage
18## Alternatively, this file may be used under the terms of the GNU
19## General Public License version 3 or (at your option) any later version
20## approved by the KDE Free Qt Foundation. The licenses are as published by
21## the Free Software Foundation and appearing in the file LICENSE.GPL3
22## included in the packaging of this file. Please review the following
23## information to ensure the GNU General Public License requirements will
24## be met: https://www.gnu.org/licenses/gpl-3.0.html.
25##
26## $QT_END_LICENSE$
27##
28############################################################################
29
30VM_ROOTFS_TYPE = "ext3"
31ROOT_VM = "root=/dev/hda2"
32LABELS_VM = "boot"
33AUTO_SYSLINUXMENU = "0"
34SYSLINUX_DEFAULT_CONSOLE = "console=ttyS0,115200"
35
36inherit image_types image-vm
37
38create_hdd_image () {
39 cd ${IMGDEPLOYDIR}
40 rm -f ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.hdd
41 ln -s ${IMAGE_NAME}.hdddirect ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.hdd
42}
43
44python do_hddimg() {
45 bb.build.exec_func('create_hdd_image', d)
46}
47
48addtask hddimg after do_bootdirectdisk before do_build
diff --git a/meta-boot2qt/classes/image_dd.bbclass b/meta-boot2qt/classes/image_dd.bbclass
new file mode 100644
index 0000000..e05536b
--- /dev/null
+++ b/meta-boot2qt/classes/image_dd.bbclass
@@ -0,0 +1,87 @@
1############################################################################
2##
3## Copyright (C) 2016 The Qt Company Ltd.
4## Contact: https://www.qt.io/licensing/
5##
6## This file is part of the Boot to Qt meta layer.
7##
8## $QT_BEGIN_LICENSE:GPL$
9## Commercial License Usage
10## Licensees holding valid commercial Qt licenses may use this file in
11## accordance with the commercial license agreement provided with the
12## Software or, alternatively, in accordance with the terms contained in
13## a written agreement between you and The Qt Company. For licensing terms
14## and conditions see https://www.qt.io/terms-conditions. For further
15## information use the contact form at https://www.qt.io/contact-us.
16##
17## GNU General Public License Usage
18## Alternatively, this file may be used under the terms of the GNU
19## General Public License version 3 or (at your option) any later version
20## approved by the KDE Free Qt Foundation. The licenses are as published by
21## the Free Software Foundation and appearing in the file LICENSE.GPL3
22## included in the packaging of this file. Please review the following
23## information to ensure the GNU General Public License requirements will
24## be met: https://www.gnu.org/licenses/gpl-3.0.html.
25##
26## $QT_END_LICENSE$
27##
28############################################################################
29
30# This class is based on meta-freescale/classes/image_types_fsl.bbclass::generate_imx_sdcard()
31DESCRIPTION = "The base class for building images that can be deployed with GNU coreutils dd tool."
32inherit image_types
33
34IMAGE="${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.img"
35
36# Boot partition size [in KiB]
37BOOT_SPACE ?= "8192"
38
39# Set alignment to 4MB [in KiB]
40IMAGE_ROOTFS_ALIGNMENT = "4096"
41
42# Boot partition volume id
43BOOTDD_VOLUME_ID = "boot"
44
45IMAGE_TYPEDEP_dd = "ext3"
46IMAGE_DEPENDS_dd = "parted-native:do_populate_sysroot \
47 dosfstools-native:do_populate_sysroot \
48 mtools-native:do_populate_sysroot"
49
50image_dd_do_populate_boot() {
51}
52EXPORT_FUNCTIONS do_populate_boot
53
54IMAGE_CMD_dd() {
55
56 ROOTFS="${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.ext3"
57
58 # Align boot partition and calculate total binary image size
59 BOOT_SPACE_ALIGNED=$(expr ${BOOT_SPACE} + ${IMAGE_ROOTFS_ALIGNMENT} - 1)
60 BOOT_SPACE_ALIGNED=$(expr ${BOOT_SPACE_ALIGNED} - ${BOOT_SPACE_ALIGNED} % ${IMAGE_ROOTFS_ALIGNMENT})
61 IMAGE_SIZE=$(expr ${IMAGE_ROOTFS_ALIGNMENT} + ${BOOT_SPACE_ALIGNED} + $ROOTFS_SIZE + ${IMAGE_ROOTFS_ALIGNMENT})
62
63 # Initialize a sparse file
64 dd if=/dev/zero of=${IMAGE} bs=1 count=0 seek=$(expr 1024 \* ${IMAGE_SIZE})
65
66 # Create partition table
67 parted -s ${IMAGE} mklabel msdos
68 parted -s ${IMAGE} unit KiB mkpart primary fat32 ${IMAGE_ROOTFS_ALIGNMENT} $(expr ${IMAGE_ROOTFS_ALIGNMENT} \+ ${BOOT_SPACE_ALIGNED})
69 parted -s ${IMAGE} unit KiB mkpart primary $(expr ${IMAGE_ROOTFS_ALIGNMENT} \+ ${BOOT_SPACE_ALIGNED}) $(expr ${IMAGE_ROOTFS_ALIGNMENT} \+ ${BOOT_SPACE_ALIGNED} \+ $ROOTFS_SIZE)
70 parted -s ${IMAGE} set 1 boot on
71 parted ${IMAGE} print
72
73 # Create boot partition image
74 BOOT_BLOCKS=$(LC_ALL=C parted -s ${IMAGE} unit b print \
75 | awk '/ 1 / { print substr($4, 1, length($4 -1)) / 1024 }')
76 rm -f ${WORKDIR}/boot.img
77 mkfs.vfat -n "${BOOTDD_VOLUME_ID}" -S 512 -C ${WORKDIR}/boot.img $BOOT_BLOCKS
78 do_populate_boot
79
80 # Burn Partitions
81 dd if=${WORKDIR}/boot.img of=${IMAGE} conv=notrunc seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync
82 dd if=${ROOTFS} of=${IMAGE} conv=notrunc seek=1 bs=$(expr ${BOOT_SPACE_ALIGNED} \* 1024 + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync
83
84 rm -f ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.img
85 ln -s ${IMAGE_NAME}.rootfs.img ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.img
86}
87
diff --git a/meta-boot2qt/classes/image_types_sdcard.bbclass b/meta-boot2qt/classes/image_types_sdcard.bbclass
new file mode 100644
index 0000000..7dedf87
--- /dev/null
+++ b/meta-boot2qt/classes/image_types_sdcard.bbclass
@@ -0,0 +1,89 @@
1############################################################################
2##
3## Copyright (C) 2016 The Qt Company Ltd.
4## Contact: https://www.qt.io/licensing/
5##
6## This file is part of the Boot to Qt meta layer.
7##
8## $QT_BEGIN_LICENSE:GPL$
9## Commercial License Usage
10## Licensees holding valid commercial Qt licenses may use this file in
11## accordance with the commercial license agreement provided with the
12## Software or, alternatively, in accordance with the terms contained in
13## a written agreement between you and The Qt Company. For licensing terms
14## and conditions see https://www.qt.io/terms-conditions. For further
15## information use the contact form at https://www.qt.io/contact-us.
16##
17## GNU General Public License Usage
18## Alternatively, this file may be used under the terms of the GNU
19## General Public License version 3 or (at your option) any later version
20## approved by the KDE Free Qt Foundation. The licenses are as published by
21## the Free Software Foundation and appearing in the file LICENSE.GPL3
22## included in the packaging of this file. Please review the following
23## information to ensure the GNU General Public License requirements will
24## be met: https://www.gnu.org/licenses/gpl-3.0.html.
25##
26## $QT_END_LICENSE$
27##
28############################################################################
29
30IMAGE_ROOTFS_EXTRA_SPACE = "100000"
31SDCARD_ROOTFS = "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.ext3"
32SDCARD_GENERATION_COMMAND ?= "generate_imx_sdcard"
33
34IMAGE_CMD_sdcard_append() {
35 parted -s ${SDCARD} set 1 boot on
36
37 rm -f ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.img
38 ln -s ${IMAGE_NAME}.rootfs.sdcard ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.img
39}
40
41IMAGE_CMD_rpi-sdimg_append() {
42 rm -f ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.img
43 ln -s ${IMAGE_NAME}.rootfs.rpi-sdimg ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.img
44}
45
46build_hddimg_append() {
47 rm -f ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.img
48 ln -s ${IMAGE_NAME}.hddimg ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.img
49}
50
51IMAGE_DEPENDS_tegraflash_append = " parted-native:do_populate_sysroot"
52create_tegraflash_pkg_prepend() {
53 # Create partition table
54 SDCARD=${IMGDEPLOYDIR}/${IMAGE_NAME}.img
55 SDCARD_ROOTFS=${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.${IMAGE_TEGRAFLASH_FS_TYPE}
56 SDCARD_SIZE=$(expr ${IMAGE_ROOTFS_ALIGNMENT} + ${ROOTFS_SIZE} + ${IMAGE_ROOTFS_ALIGNMENT})
57
58 dd if=/dev/zero of=$SDCARD bs=1 count=0 seek=$(expr 1024 \* $SDCARD_SIZE)
59
60 parted -s $SDCARD mklabel gpt
61 parted -s $SDCARD unit KiB mkpart primary ${IMAGE_ROOTFS_ALIGNMENT} $(expr ${IMAGE_ROOTFS_ALIGNMENT} \+ ${ROOTFS_SIZE})
62 parted $SDCARD print
63
64 dd if=$SDCARD_ROOTFS of=$SDCARD conv=notrunc,fsync seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024)
65
66 rm -f ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.img
67 ln -s ${IMAGE_NAME}.img ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.img
68}
69
70# create flash package that utilizes the SD card image
71create_tegraflash_pkg_append() {
72 cd ${WORKDIR}/tegraflash
73 cat > prepare-image.sh <<END
74#!/bin/sh -e
75if [ ! -e "${IMAGE_BASENAME}.img" ]; then
76 dd if=../${IMAGE_LINK_NAME}.img of=${IMAGE_LINK_NAME}.${IMAGE_TEGRAFLASH_FS_TYPE} skip=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) count=$(expr ${ROOTFS_SIZE} / 1024)
77 ./tegra*-flash/mksparse -v --fillpattern=0 ${IMAGE_LINK_NAME}.${IMAGE_TEGRAFLASH_FS_TYPE} ${IMAGE_BASENAME}.img
78 rm -f ${IMAGE_LINK_NAME}.${IMAGE_TEGRAFLASH_FS_TYPE}
79fi
80echo "Flash image ready"
81END
82 chmod +x prepare-image.sh
83 rm ${IMAGE_BASENAME}.img
84
85 cd ..
86 rm -f ${IMGDEPLOYDIR}/${IMAGE_NAME}.flasher.tar.gz
87 tar czhf ${IMGDEPLOYDIR}/${IMAGE_NAME}.flasher.tar.gz tegraflash
88 ln -sf ${IMAGE_NAME}.flasher.tar.gz ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.flasher.tar.gz
89}
diff --git a/meta-boot2qt/classes/internal-build.bbclass b/meta-boot2qt/classes/internal-build.bbclass
new file mode 100644
index 0000000..d842dcb
--- /dev/null
+++ b/meta-boot2qt/classes/internal-build.bbclass
@@ -0,0 +1,55 @@
1############################################################################
2##
3## Copyright (C) 2016 The Qt Company Ltd.
4## Contact: https://www.qt.io/licensing/
5##
6## This file is part of the Boot to Qt meta layer.
7##
8## $QT_BEGIN_LICENSE:GPL$
9## Commercial License Usage
10## Licensees holding valid commercial Qt licenses may use this file in
11## accordance with the commercial license agreement provided with the
12## Software or, alternatively, in accordance with the terms contained in
13## a written agreement between you and The Qt Company. For licensing terms
14## and conditions see https://www.qt.io/terms-conditions. For further
15## information use the contact form at https://www.qt.io/contact-us.
16##
17## GNU General Public License Usage
18## Alternatively, this file may be used under the terms of the GNU
19## General Public License version 3 or (at your option) any later version
20## approved by the KDE Free Qt Foundation. The licenses are as published by
21## the Free Software Foundation and appearing in the file LICENSE.GPL3
22## included in the packaging of this file. Please review the following
23## information to ensure the GNU General Public License requirements will
24## be met: https://www.gnu.org/licenses/gpl-3.0.html.
25##
26## $QT_END_LICENSE$
27##
28############################################################################
29
30python enable_internal_build () {
31 import socket
32 try:
33 socket.gethostbyname('yocto-cache.intra.qt.io')
34 except:
35 return
36
37 e.data.setVar('QT_INTERNAL_BUILD', "1")
38 e.data.prependVar('SSTATE_MIRRORS', "file://.* http://yocto-cache.intra.qt.io/sstate-caches/${DISTRO_CODENAME}/PATH")
39 e.data.prependVar('PREMIRRORS', "\
40 ftp://.*/.* http://yocto-cache.intra.qt.io/sources/ \n \
41 http://.*/.* http://yocto-cache.intra.qt.io/sources/ \n \
42 https://.*/.* http://yocto-cache.intra.qt.io/sources/ \n \
43 bzr://.*/.* http://yocto-cache.intra.qt.io/sources/ \n \
44 cvs://.*/.* http://yocto-cache.intra.qt.io/sources/ \n \
45 git://.*/.* http://yocto-cache.intra.qt.io/sources/ \n \
46 gitsm://.*/.* http://yocto-cache.intra.qt.io/sources/ \n \
47 hg://.*/.* http://yocto-cache.intra.qt.io/sources/ \n \
48 osc://.*/.* http://yocto-cache.intra.qt.io/sources/ \n \
49 p4://.*/.* http://yocto-cache.intra.qt.io/sources/ \n \
50 svn://.*/.* http://yocto-cache.intra.qt.io/sources/ \n \
51 ")
52}
53
54addhandler enable_internal_build
55enable_internal_build[eventmask] = "bb.event.ConfigParsed"
diff --git a/meta-boot2qt/classes/populate_b2qt_qt5_sdk.bbclass b/meta-boot2qt/classes/populate_b2qt_qt5_sdk.bbclass
new file mode 100644
index 0000000..e98565c
--- /dev/null
+++ b/meta-boot2qt/classes/populate_b2qt_qt5_sdk.bbclass
@@ -0,0 +1,92 @@
1############################################################################
2##
3## Copyright (C) 2016 The Qt Company Ltd.
4## Contact: https://www.qt.io/licensing/
5##
6## This file is part of the Boot to Qt meta layer.
7##
8## $QT_BEGIN_LICENSE:GPL$
9## Commercial License Usage
10## Licensees holding valid commercial Qt licenses may use this file in
11## accordance with the commercial license agreement provided with the
12## Software or, alternatively, in accordance with the terms contained in
13## a written agreement between you and The Qt Company. For licensing terms
14## and conditions see https://www.qt.io/terms-conditions. For further
15## information use the contact form at https://www.qt.io/contact-us.
16##
17## GNU General Public License Usage
18## Alternatively, this file may be used under the terms of the GNU
19## General Public License version 3 or (at your option) any later version
20## approved by the KDE Free Qt Foundation. The licenses are as published by
21## the Free Software Foundation and appearing in the file LICENSE.GPL3
22## included in the packaging of this file. Please review the following
23## information to ensure the GNU General Public License requirements will
24## be met: https://www.gnu.org/licenses/gpl-3.0.html.
25##
26## $QT_END_LICENSE$
27##
28############################################################################
29
30inherit populate_b2qt_sdk populate_sdk_qt5_base abi-arch siteinfo
31
32SDK_MKSPEC_DIR = "${SDK_OUTPUT}${SDKTARGETSYSROOT}${libdir}/${QT_DIR_NAME}/mkspecs"
33NATIVE_SDK_MKSPEC_DIR = "${SDK_OUTPUT}${SDKPATHNATIVE}${libdir}/${QT_DIR_NAME}/mkspecs"
34SDK_MKSPEC = "devices/linux-oe-generic-g++"
35SDK_DEVICE_PRI = "${SDK_MKSPEC_DIR}/qdevice.pri"
36SDK_DYNAMIC_FLAGS = "-O. -pipe -g"
37
38create_sdk_files_append () {
39 # Create the toolchain user's generic device mkspec
40 install -d ${SDK_MKSPEC_DIR}/${SDK_MKSPEC}
41 cat > ${SDK_MKSPEC_DIR}/${SDK_MKSPEC}/qmake.conf <<EOF
42include(../common/linux_device_pre.conf)
43exists(../../oe-device-extra.pri):include(../../oe-device-extra.pri)
44include(../common/linux_device_post.conf)
45load(qt_config)
46EOF
47
48 cat > ${SDK_MKSPEC_DIR}/${SDK_MKSPEC}/qplatformdefs.h <<EOF
49#include "../../linux-g++/qplatformdefs.h"
50EOF
51
52 # Fill in the qdevice.pri file which will be used by the device mksspec
53 static_cflags="${TARGET_CFLAGS}"
54 static_cxxflags="${TARGET_CXXFLAGS}"
55 for i in ${SDK_DYNAMIC_FLAGS}; do
56 static_cflags=$(echo $static_cflags | sed -e "s/$i //")
57 static_cxxflags=$(echo $static_cxxflags | sed -e "s/$i //")
58 done
59 echo "MACHINE = ${MACHINE}" > ${SDK_DEVICE_PRI}
60 echo "CROSS_COMPILE = \$\$[QT_HOST_PREFIX]${bindir_nativesdk}/${TARGET_SYS}/${TARGET_PREFIX}" >> ${SDK_DEVICE_PRI}
61 echo "QMAKE_CFLAGS *= ${TARGET_CC_ARCH} ${static_cflags}" >> ${SDK_DEVICE_PRI}
62 echo "QMAKE_CXXFLAGS *= ${TARGET_CC_ARCH} ${static_cxxflags}" >> ${SDK_DEVICE_PRI}
63 echo "QMAKE_LFLAGS *= ${TARGET_CC_ARCH} ${TARGET_LDFLAGS}" >> ${SDK_DEVICE_PRI}
64
65 # Setup qt.conf to point at the device mkspec by default
66 qtconf=${SDK_OUTPUT}/${SDKPATHNATIVE}${OE_QMAKE_PATH_HOST_BINS}/qt.conf
67 echo 'HostSpec = linux-g++' >> $qtconf
68 echo 'TargetSpec = devices/linux-oe-generic-g++' >> $qtconf
69
70 # Update correct host_build ARCH and ABI to mkspecs/qconfig.pri
71 QT_ARCH=$(grep QT_ARCH ${NATIVE_SDK_MKSPEC_DIR}/qconfig.pri | tail -1)
72 QT_BUILDABI=$(grep QT_BUILDABI ${NATIVE_SDK_MKSPEC_DIR}/qconfig.pri | tail -1)
73
74 sed -e "0,/QT_ARCH/s/^.*QT_ARCH.*/$QT_ARCH/" \
75 -e "0,/QT_BUILDABI/s/^.*QT_BUILDABI.*/$QT_BUILDABI/" \
76 -i ${SDK_MKSPEC_DIR}/qconfig.pri
77
78 create_qtcreator_configure_script
79
80 # Link /etc/resolv.conf is broken in the toolchain sysroot, remove it
81 rm -f ${SDK_OUTPUT}${SDKTARGETSYSROOT}${sysconfdir}/resolv.conf
82}
83
84create_qtcreator_configure_script () {
85 # add qtcreator configuration script
86 install -m 0755 ${B2QTBASE}/files/configure-qtcreator.sh ${SDK_OUTPUT}/${SDKPATH}
87 sed -i -e '/^CONFIG=/c\CONFIG="${SDKPATH}/environment-setup-${REAL_MULTIMACH_TARGET_SYS}"' ${SDK_OUTPUT}/${SDKPATH}/configure-qtcreator.sh
88 sed -i -e '/^ABI=/c\ABI="${ABI}-linux-generic-elf-${SITEINFO_BITS}bit"' ${SDK_OUTPUT}/${SDKPATH}/configure-qtcreator.sh
89}
90
91create_qtcreator_configure_script_mingw32 () {
92}
diff --git a/meta-boot2qt/classes/populate_b2qt_sdk.bbclass b/meta-boot2qt/classes/populate_b2qt_sdk.bbclass
new file mode 100644
index 0000000..8d600d0
--- /dev/null
+++ b/meta-boot2qt/classes/populate_b2qt_sdk.bbclass
@@ -0,0 +1,62 @@
1############################################################################
2##
3## Copyright (C) 2016 The Qt Company Ltd.
4## Contact: https://www.qt.io/licensing/
5##
6## This file is part of the Boot to Qt meta layer.
7##
8## $QT_BEGIN_LICENSE:GPL$
9## Commercial License Usage
10## Licensees holding valid commercial Qt licenses may use this file in
11## accordance with the commercial license agreement provided with the
12## Software or, alternatively, in accordance with the terms contained in
13## a written agreement between you and The Qt Company. For licensing terms
14## and conditions see https://www.qt.io/terms-conditions. For further
15## information use the contact form at https://www.qt.io/contact-us.
16##
17## GNU General Public License Usage
18## Alternatively, this file may be used under the terms of the GNU
19## General Public License version 3 or (at your option) any later version
20## approved by the KDE Free Qt Foundation. The licenses are as published by
21## the Free Software Foundation and appearing in the file LICENSE.GPL3
22## included in the packaging of this file. Please review the following
23## information to ensure the GNU General Public License requirements will
24## be met: https://www.gnu.org/licenses/gpl-3.0.html.
25##
26## $QT_END_LICENSE$
27##
28############################################################################
29
30inherit populate_sdk
31
32replace_sysroot_symlink() {
33 SYMLINK_SYSROOT=$1
34 SEARCH_FOLDER=$2
35 for SOURCE in `find ${SEARCH_FOLDER} -type l`
36 do
37 TARGET=`readlink -m "${SOURCE}"`
38 #check whether TARGET is inside the sysroot when not prepend the sysroot
39 TARGET=`echo ${TARGET} | grep "^${SYMLINK_SYSROOT}" || echo ${SYMLINK_SYSROOT}${TARGET}`
40 rm "${SOURCE}"
41 if [ -f "${TARGET}" ]; then
42 cp "${TARGET}" "${SOURCE}"
43 elif [ -e "${TARGET}" ]; then
44 touch "${SOURCE}"
45 fi
46 done
47}
48
49do_populate_sdk[depends] += "p7zip-native:do_populate_sysroot"
50
51fakeroot tar_sdk_sdkmingw32() {
52 replace_sysroot_symlink ${SDK_OUTPUT}${SDKTARGETSYSROOT} ${SDK_OUTPUT}${SDKTARGETSYSROOT}
53 replace_sysroot_symlink ${SDK_OUTPUT}${SDKPATHNATIVE} ${SDK_OUTPUT}${SDKPATHNATIVE}
54 # Package it up
55 mkdir -p ${SDK_DEPLOY}
56 cd ${SDK_OUTPUT}/${SDKPATH}
57 if [ -e ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.7z ]; then
58 rm ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.7z
59 fi
60 7zr a ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.7z sysroots
61}
62
diff --git a/meta-boot2qt/classes/qbsp-image.bbclass b/meta-boot2qt/classes/qbsp-image.bbclass
new file mode 100644
index 0000000..71d1d45
--- /dev/null
+++ b/meta-boot2qt/classes/qbsp-image.bbclass
@@ -0,0 +1,62 @@
1############################################################################
2##
3## Copyright (C) 2016 The Qt Company Ltd.
4## Contact: https://www.qt.io/licensing/
5##
6## This file is part of the Boot to Qt meta layer.
7##
8## $QT_BEGIN_LICENSE:GPL$
9## Commercial License Usage
10## Licensees holding valid commercial Qt licenses may use this file in
11## accordance with the commercial license agreement provided with the
12## Software or, alternatively, in accordance with the terms contained in
13## a written agreement between you and The Qt Company. For licensing terms
14## and conditions see https://www.qt.io/terms-conditions. For further
15## information use the contact form at https://www.qt.io/contact-us.
16##
17## GNU General Public License Usage
18## Alternatively, this file may be used under the terms of the GNU
19## General Public License version 3 or (at your option) any later version
20## approved by the KDE Free Qt Foundation. The licenses are as published by
21## the Free Software Foundation and appearing in the file LICENSE.GPL3
22## included in the packaging of this file. Please review the following
23## information to ensure the GNU General Public License requirements will
24## be met: https://www.gnu.org/licenses/gpl-3.0.html.
25##
26## $QT_END_LICENSE$
27##
28############################################################################
29
30QBSP_IMAGE_CONTENT ??= ""
31
32do_image_complete[depends] += "p7zip-native:do_populate_sysroot"
33
34fakeroot do_qbsp_image () {
35 if [ -z "${QBSP_IMAGE_CONTENT}" ]; then
36 exit 0
37 fi
38
39 mkdir -p ${S}/qbsp
40
41 for item in ${QBSP_IMAGE_CONTENT}; do
42 src=`echo $item | awk -F':' '{ print $1 }'`
43 dst=`echo $item | awk -F':' '{ print $2 }'`
44
45 if [ -e "${IMGDEPLOYDIR}/$src" ]; then
46 install -D -m 0755 ${IMGDEPLOYDIR}/$src ${S}/qbsp/$dst
47 elif [ -e "${DEPLOY_DIR_IMAGE}/$src" ]; then
48 install -D -m 0755 ${DEPLOY_DIR_IMAGE}/$src ${S}/qbsp/$dst
49 else
50 echo "Could not copy file $src"
51 exit 1
52 fi
53 done
54
55 cd ${S}/qbsp
56 7zr a ${IMGDEPLOYDIR}/${IMAGE_NAME}.7z .
57
58 rm -f ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.7z
59 ln -s ${IMAGE_NAME}.7z ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.7z
60}
61
62IMAGE_POSTPROCESS_COMMAND += "do_qbsp_image;"
diff --git a/meta-boot2qt/classes/qbsp.bbclass b/meta-boot2qt/classes/qbsp.bbclass
new file mode 100644
index 0000000..da790bf
--- /dev/null
+++ b/meta-boot2qt/classes/qbsp.bbclass
@@ -0,0 +1,174 @@
1############################################################################
2##
3## Copyright (C) 2016 The Qt Company Ltd.
4## Contact: https://www.qt.io/licensing/
5##
6## This file is part of the Boot to Qt meta layer.
7##
8## $QT_BEGIN_LICENSE:GPL$
9## Commercial License Usage
10## Licensees holding valid commercial Qt licenses may use this file in
11## accordance with the commercial license agreement provided with the
12## Software or, alternatively, in accordance with the terms contained in
13## a written agreement between you and The Qt Company. For licensing terms
14## and conditions see https://www.qt.io/terms-conditions. For further
15## information use the contact form at https://www.qt.io/contact-us.
16##
17## GNU General Public License Usage
18## Alternatively, this file may be used under the terms of the GNU
19## General Public License version 3 or (at your option) any later version
20## approved by the KDE Free Qt Foundation. The licenses are as published by
21## the Free Software Foundation and appearing in the file LICENSE.GPL3
22## included in the packaging of this file. Please review the following
23## information to ensure the GNU General Public License requirements will
24## be met: https://www.gnu.org/licenses/gpl-3.0.html.
25##
26## $QT_END_LICENSE$
27##
28############################################################################
29
30inherit meta nopackages abi-arch
31
32FILESEXTRAPATHS_prepend := "${B2QTBASE}/files/qbsp:"
33
34SRC_URI = "\
35 file://base_package.xml \
36 file://image_package.xml \
37 file://toolchain_package.xml \
38 file://toolchain_installscript.qs \
39 file://license_package.xml \
40 file://NXP-EULA \
41 "
42
43INHIBIT_DEFAULT_DEPS = "1"
44do_qbsp[depends] += "\
45 p7zip-native:do_populate_sysroot \
46 installer-framework-native:do_populate_sysroot \
47 ${QBSP_SDK_TASK}:do_populate_sdk \
48 ${QBSP_IMAGE_TASK}:do_image_complete \
49 "
50
51QBSP_VERSION ?= "${PV}${VERSION_AUTO_INCREMENT}"
52QBSP_INSTALLER_COMPONENT ?= "${@d.getVar('MACHINE', True).replace('-','')}"
53QBSP_INSTALL_PATH ?= "/Extras/${MACHINE}"
54
55QBSP_LICENSE_FILE ?= ""
56QBSP_LICENSE_NAME ?= ""
57QBSP_LICENSE_FILE_imx = "NXP-EULA"
58QBSP_LICENSE_NAME_imx = "NXP Semiconductors Software License Agreement"
59
60VERSION_AUTO_INCREMENT = "-${DATETIME}"
61VERSION_AUTO_INCREMENT[vardepsexclude] = "DATETIME"
62
63DEPLOY_CONF_NAME ?= "${MACHINE}"
64RELEASEDATE = "${@time.strftime('%Y-%m-%d',time.gmtime())}"
65
66IMAGE_PACKAGE = "${QBSP_IMAGE_TASK}-${MACHINE}.7z"
67SDK_NAME = "${DISTRO}-${SDK_MACHINE}-${QBSP_SDK_TASK}-${MACHINE}.${SDK_POSTFIX}"
68SDK_POSTFIX = "sh"
69SDK_POSTFIX_sdkmingw32 = "7z"
70REAL_MULTIMACH_TARGET_SYS = "${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}"
71SDK_MACHINE = "${@d.getVar('SDKMACHINE', True) or '${SDK_ARCH}'}"
72
73B = "${WORKDIR}/build"
74
75patch_installer_files() {
76 LICENSE_DEPENDENCY=""
77 if [ -n "${QBSP_LICENSE_FILE}" ]; then
78 LICENSE_DEPENDENCY="${QBSP_INSTALLER_COMPONENT}.license"
79 fi
80
81 sed -e "s#@NAME@#${QBSP_NAME}#" \
82 -e "s#@TARGET@#${DEPLOY_CONF_NAME}#" \
83 -e "s#@VERSION@#${QBSP_VERSION}#" \
84 -e "s#@RELEASEDATE@#${RELEASEDATE}#" \
85 -e "s#@MACHINE@#${MACHINE}#" \
86 -e "s#@SYSROOT@#${REAL_MULTIMACH_TARGET_SYS}#" \
87 -e "s#@TARGET_SYS@#${TARGET_SYS}#" \
88 -e "s#@ABI@#${ABI}#" \
89 -e "s#@INSTALLPATH@#${QBSP_INSTALL_PATH}#" \
90 -e "s#@SDKPATH@#${SDKPATH}#" \
91 -e "s#@SDKFILE@#${SDK_NAME}#" \
92 -e "s#@LICENSEDEPENDENCY@#${LICENSE_DEPENDENCY}#" \
93 -e "s#@LICENSEFILE@#${QBSP_LICENSE_FILE}#" \
94 -e "s#@LICENSENAME@#${QBSP_LICENSE_NAME}#" \
95 -i ${1}/*
96}
97
98prepare_qbsp() {
99 # Toolchain component
100 COMPONENT_PATH="${B}/pkg/${QBSP_INSTALLER_COMPONENT}.toolchain"
101 mkdir -p ${COMPONENT_PATH}/meta
102 mkdir -p ${COMPONENT_PATH}/data
103
104 cp ${WORKDIR}/toolchain_package.xml ${COMPONENT_PATH}/meta/package.xml
105 cp ${WORKDIR}/toolchain_installscript.qs ${COMPONENT_PATH}/meta/installscript.qs
106 patch_installer_files ${COMPONENT_PATH}/meta
107
108 mkdir -p ${B}/toolchain/${QBSP_INSTALL_PATH}/toolchain
109 if [ "${SDK_POSTFIX}" = "7z" ]; then
110 7zr x ${DEPLOY_DIR}/sdk/${SDK_NAME} -o${B}/toolchain/${QBSP_INSTALL_PATH}/toolchain/
111 else
112 cp ${DEPLOY_DIR}/sdk/${SDK_NAME} ${B}/toolchain/${QBSP_INSTALL_PATH}/toolchain/
113 fi
114
115 cd ${B}/toolchain
116 7zr a ${COMPONENT_PATH}/data/toolchain.7z *
117
118 # Image component
119 COMPONENT_PATH="${B}/pkg/${QBSP_INSTALLER_COMPONENT}.system"
120 mkdir -p ${COMPONENT_PATH}/meta
121 mkdir -p ${COMPONENT_PATH}/data
122
123 cp ${WORKDIR}/image_package.xml ${COMPONENT_PATH}/meta/package.xml
124 patch_installer_files ${COMPONENT_PATH}/meta
125
126 mkdir -p ${B}/images/${QBSP_INSTALL_PATH}/images
127 7zr x ${DEPLOY_DIR_IMAGE}/${IMAGE_PACKAGE} -o${B}/images/${QBSP_INSTALL_PATH}/images/
128
129 cd ${B}/images
130 7zr a ${COMPONENT_PATH}/data/image.7z *
131
132 # License component
133 if [ -n "${QBSP_LICENSE_FILE}" ]; then
134 COMPONENT_PATH="${B}/pkg/${QBSP_INSTALLER_COMPONENT}.license"
135 mkdir -p ${COMPONENT_PATH}/meta
136
137 cp ${WORKDIR}/license_package.xml ${COMPONENT_PATH}/meta/package.xml
138 cp ${WORKDIR}/${QBSP_LICENSE_FILE} ${COMPONENT_PATH}/meta/
139 patch_installer_files ${COMPONENT_PATH}/meta
140 fi
141
142 # Base component
143 COMPONENT_PATH="${B}/pkg/${QBSP_INSTALLER_COMPONENT}"
144 mkdir -p ${COMPONENT_PATH}/meta
145
146 cp ${WORKDIR}/base_package.xml ${COMPONENT_PATH}/meta/package.xml
147 patch_installer_files ${COMPONENT_PATH}/meta
148}
149
150create_qbsp() {
151 prepare_qbsp
152
153 # Repository creation
154 repogen -p ${B}/pkg ${B}/repository
155
156 mkdir -p ${DEPLOY_DIR}/qbsp
157 rm -f ${DEPLOY_DIR}/qbsp/${PN}-${SDK_MACHINE}-${MACHINE}.qbsp
158
159 cd ${B}/repository
160 7zr a ${DEPLOY_DIR}/qbsp/${PN}-${SDK_MACHINE}-${MACHINE}.qbsp *
161}
162
163python do_qbsp() {
164 bb.build.exec_func('create_qbsp', d)
165}
166
167addtask qbsp after do_unpack before do_build
168
169do_qbsp[cleandirs] += "${B}"
170
171do_configure[noexec] = "1"
172do_compile[noexec] = "1"
173do_populate_sysroot[noexec] = "1"
174do_populate_lic[noexec] = "1"
diff --git a/meta-boot2qt/classes/qt5-module.bbclass b/meta-boot2qt/classes/qt5-module.bbclass
new file mode 100644
index 0000000..e68f95f
--- /dev/null
+++ b/meta-boot2qt/classes/qt5-module.bbclass
@@ -0,0 +1,30 @@
1############################################################################
2##
3## Copyright (C) 2016 The Qt Company Ltd.
4## Contact: https://www.qt.io/licensing/
5##
6## This file is part of the Boot to Qt meta layer.
7##
8## $QT_BEGIN_LICENSE:GPL$
9## Commercial License Usage
10## Licensees holding valid commercial Qt licenses may use this file in
11## accordance with the commercial license agreement provided with the
12## Software or, alternatively, in accordance with the terms contained in
13## a written agreement between you and The Qt Company. For licensing terms
14## and conditions see https://www.qt.io/terms-conditions. For further
15## information use the contact form at https://www.qt.io/contact-us.
16##
17## GNU General Public License Usage
18## Alternatively, this file may be used under the terms of the GNU
19## General Public License version 3 or (at your option) any later version
20## approved by the KDE Free Qt Foundation. The licenses are as published by
21## the Free Software Foundation and appearing in the file LICENSE.GPL3
22## included in the packaging of this file. Please review the following
23## information to ensure the GNU General Public License requirements will
24## be met: https://www.gnu.org/licenses/gpl-3.0.html.
25##
26## $QT_END_LICENSE$
27##
28############################################################################
29
30require recipes-qt/qt5/qt5.inc
diff --git a/meta-boot2qt/classes/qtquickcompiler.bbclass b/meta-boot2qt/classes/qtquickcompiler.bbclass
new file mode 100644
index 0000000..f54887c
--- /dev/null
+++ b/meta-boot2qt/classes/qtquickcompiler.bbclass
@@ -0,0 +1,30 @@
1############################################################################
2##
3## Copyright (C) 2018 The Qt Company Ltd.
4## Contact: https://www.qt.io/licensing/
5##
6## This file is part of the Boot to Qt meta layer.
7##
8## $QT_BEGIN_LICENSE:GPL$
9## Commercial License Usage
10## Licensees holding valid commercial Qt licenses may use this file in
11## accordance with the commercial license agreement provided with the
12## Software or, alternatively, in accordance with the terms contained in
13## a written agreement between you and The Qt Company. For licensing terms
14## and conditions see https://www.qt.io/terms-conditions. For further
15## information use the contact form at https://www.qt.io/contact-us.
16##
17## GNU General Public License Usage
18## Alternatively, this file may be used under the terms of the GNU
19## General Public License version 3 or (at your option) any later version
20## approved by the KDE Free Qt Foundation. The licenses are as published by
21## the Free Software Foundation and appearing in the file LICENSE.GPL3
22## included in the packaging of this file. Please review the following
23## information to ensure the GNU General Public License requirements will
24## be met: https://www.gnu.org/licenses/gpl-3.0.html.
25##
26## $QT_END_LICENSE$
27##
28############################################################################
29
30EXTRA_QMAKEVARS_PRE += "CONFIG+=qtquickcompiler"
diff --git a/meta-boot2qt/classes/sdk-sources.bbclass b/meta-boot2qt/classes/sdk-sources.bbclass
new file mode 100644
index 0000000..b12f371
--- /dev/null
+++ b/meta-boot2qt/classes/sdk-sources.bbclass
@@ -0,0 +1,99 @@
1############################################################################
2##
3## Copyright (C) 2016 The Qt Company Ltd.
4## Contact: https://www.qt.io/licensing/
5##
6## This file is part of the Boot to Qt meta layer.
7##
8## $QT_BEGIN_LICENSE:GPL$
9## Commercial License Usage
10## Licensees holding valid commercial Qt licenses may use this file in
11## accordance with the commercial license agreement provided with the
12## Software or, alternatively, in accordance with the terms contained in
13## a written agreement between you and The Qt Company. For licensing terms
14## and conditions see https://www.qt.io/terms-conditions. For further
15## information use the contact form at https://www.qt.io/contact-us.
16##
17## GNU General Public License Usage
18## Alternatively, this file may be used under the terms of the GNU
19## General Public License version 3 or (at your option) any later version
20## approved by the KDE Free Qt Foundation. The licenses are as published by
21## the Free Software Foundation and appearing in the file LICENSE.GPL3
22## included in the packaging of this file. Please review the following
23## information to ensure the GNU General Public License requirements will
24## be met: https://www.gnu.org/licenses/gpl-3.0.html.
25##
26## $QT_END_LICENSE$
27##
28############################################################################
29
30python do_fetch () {
31 src_uri = (d.getVar('SRC_URI', True) or "").split()
32 if len(src_uri) == 0:
33 return
34
35 sdk_path = d.getVar('QT_SDK_PATH', True) or ""
36 if len(sdk_path) != 0:
37 uris = list(src_uri);
38 for url in uris:
39 ud = list(bb.fetch2.decodeurl(url))
40 if ("sdk-uri" in ud[5]):
41 src_uri.remove(url)
42
43
44 if len(src_uri) == 0:
45 return
46
47 try:
48 fetcher = bb.fetch2.Fetch(src_uri, d)
49 fetcher.download()
50 except bb.fetch2.BBFetchException as e:
51 raise bb.build.FuncFailed(e)
52}
53
54python do_unpack () {
55 sdk_uds = [];
56 src_uri = (d.getVar('SRC_URI', True) or "").split()
57 if len(src_uri) == 0:
58 return
59
60 rootdir = d.getVar('WORKDIR', True)
61
62 sdk_path = d.getVar('QT_SDK_PATH', True) or ""
63 if len(sdk_path) != 0:
64 uris = list(src_uri);
65 for url in uris:
66 ud = list(bb.fetch2.decodeurl(url))
67 if ("sdk-uri" in ud[5]):
68 sdk_uds.append(ud)
69 src_uri.remove(url)
70
71 if len(src_uri) != 0:
72 try:
73 fetcher = bb.fetch2.Fetch(src_uri, d)
74 fetcher.unpack(rootdir)
75 except bb.fetch2.BBFetchException as e:
76 raise bb.build.FuncFailed(e)
77
78 for ud in sdk_uds:
79 unpack_local_uri(ud, d)
80}
81
82def unpack_local_uri(ud, d):
83 import subprocess
84 rootdir = d.getVar('WORKDIR', True)
85 sdk_path = d.getVar('QT_SDK_PATH', True)
86
87 destdir = os.path.join(rootdir, ud[5].get("destsuffix", "git"))
88 srcdir = os.path.join(sdk_path, ud[5].get("sdk-uri"))
89 cmd = "cp -vrf %s %s" % (srcdir, destdir)
90
91 bb.note("Unpacking SDK sources %s to %s" % (srcdir, destdir))
92
93 if os.path.exists(destdir):
94 bb.utils.prunedir(destdir)
95
96 ret = subprocess.call(cmd, shell=True)
97
98 if ret != 0:
99 raise bb.fetch.UnpackError("Unpack command %s failed with return value %s" % (cmd, ret), ud)