diff options
author | Samuli Piippo <samuli.piippo@qt.io> | 2018-03-02 13:08:39 +0200 |
---|---|---|
committer | Samuli Piippo <samuli.piippo@qt.io> | 2018-03-12 14:12:31 +0000 |
commit | 344c2f97025c6504ec986600498121bb83aaeb8f (patch) | |
tree | 3d7ec602603cb083b7c8e998eddca543ce17e57c /meta-boot2qt/classes | |
parent | d9985542d7617b43ec7180c7ade0c4f64db82b42 (diff) | |
download | meta-boot2qt-344c2f97025c6504ec986600498121bb83aaeb8f.tar.gz |
Split meta-boot2qt layer
Move distro specific recipes to own layer and leave only new recipes
and bbclasses to meta-boot2qt layer. This makes it easier to include
meta-boot2qt to your own distro layer to get access e.g., QDB and
QBSP recipes that might be useful even without boot2qt distro.
Task-number: QTBUG-65871
Change-Id: I6c353774dd1668b00f2d05aa262ad866b90bdef6
Reviewed-by: Timo Aarnipuro <timo.aarnipuro@qt.io>
Diffstat (limited to 'meta-boot2qt/classes')
-rw-r--r-- | meta-boot2qt/classes/abi-arch.bbclass | 49 | ||||
-rw-r--r-- | meta-boot2qt/classes/bootfs-image.bbclass | 60 | ||||
-rw-r--r-- | meta-boot2qt/classes/consistent_timestamps.bbclass | 35 | ||||
-rw-r--r-- | meta-boot2qt/classes/deploy-conf.bbclass | 44 | ||||
-rw-r--r-- | meta-boot2qt/classes/image-hdd.bbclass | 48 | ||||
-rw-r--r-- | meta-boot2qt/classes/image_dd.bbclass | 87 | ||||
-rw-r--r-- | meta-boot2qt/classes/image_types_sdcard.bbclass | 68 | ||||
-rw-r--r-- | meta-boot2qt/classes/internal-build.bbclass | 55 | ||||
-rw-r--r-- | meta-boot2qt/classes/populate_b2qt_qt5_sdk.bbclass | 92 | ||||
-rw-r--r-- | meta-boot2qt/classes/populate_b2qt_sdk.bbclass | 62 | ||||
-rw-r--r-- | meta-boot2qt/classes/qbsp-image.bbclass | 62 | ||||
-rw-r--r-- | meta-boot2qt/classes/qbsp.bbclass | 174 | ||||
-rw-r--r-- | meta-boot2qt/classes/qt5-module.bbclass | 30 | ||||
-rw-r--r-- | meta-boot2qt/classes/qtquickcompiler.bbclass | 30 | ||||
-rw-r--r-- | meta-boot2qt/classes/sdk-sources.bbclass | 99 |
15 files changed, 995 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 | ||
31 | valid_archs = "arm x86 itanium mips ppc sh" | ||
32 | |||
33 | def 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 | |||
49 | ABI = "${@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 | |||
30 | BOOTFS_NAME = "${IMAGE_BASENAME}-boot-${MACHINE}-${DATETIME}" | ||
31 | BOOTFS_LINK_NAME = "${IMAGE_BASENAME}-boot-${MACHINE}" | ||
32 | BOOTFS_NAME[vardepsexclude] += "DATETIME" | ||
33 | |||
34 | BOOTFS_DEPENDS ?= "" | ||
35 | |||
36 | fakeroot 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 | |||
58 | addtask bootfs before do_rootfs | ||
59 | |||
60 | do_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 | |||
30 | update_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 | |||
35 | ROOTFS_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..228b1e2 --- /dev/null +++ b/meta-boot2qt/classes/deploy-conf.bbclass | |||
@@ -0,0 +1,44 @@ | |||
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 | inherit image_types | ||
31 | |||
32 | DEPLOY_CONF_NAME ?= "${MACHINE}" | ||
33 | DEPLOY_CONF_TYPE ?= "Boot2Qt" | ||
34 | |||
35 | IMAGE_CMD_conf() { | ||
36 | cat > ${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.conf <<EOF | ||
37 | [${DEPLOY_CONF_TYPE} | ${DEPLOY_CONF_NAME}] | ||
38 | platform=${MACHINE} | ||
39 | os=linux | ||
40 | board= | ||
41 | imagefile=${IMAGE_LINK_NAME}.img | ||
42 | asroot=true | ||
43 | EOF | ||
44 | } | ||
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 | |||
30 | VM_ROOTFS_TYPE = "ext3" | ||
31 | ROOT_VM = "root=/dev/hda2" | ||
32 | LABELS_VM = "boot" | ||
33 | AUTO_SYSLINUXMENU = "0" | ||
34 | SYSLINUX_DEFAULT_CONSOLE = "console=ttyS0,115200" | ||
35 | |||
36 | inherit image_types image-vm | ||
37 | |||
38 | create_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 | |||
44 | python do_hddimg() { | ||
45 | bb.build.exec_func('create_hdd_image', d) | ||
46 | } | ||
47 | |||
48 | addtask 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() | ||
31 | DESCRIPTION = "The base class for building images that can be deployed with GNU coreutils dd tool." | ||
32 | inherit image_types | ||
33 | |||
34 | IMAGE="${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.img" | ||
35 | |||
36 | # Boot partition size [in KiB] | ||
37 | BOOT_SPACE ?= "8192" | ||
38 | |||
39 | # Set alignment to 4MB [in KiB] | ||
40 | IMAGE_ROOTFS_ALIGNMENT = "4096" | ||
41 | |||
42 | # Boot partition volume id | ||
43 | BOOTDD_VOLUME_ID = "boot" | ||
44 | |||
45 | IMAGE_TYPEDEP_dd = "ext3" | ||
46 | IMAGE_DEPENDS_dd = "parted-native:do_populate_sysroot \ | ||
47 | dosfstools-native:do_populate_sysroot \ | ||
48 | mtools-native:do_populate_sysroot" | ||
49 | |||
50 | image_dd_do_populate_boot() { | ||
51 | } | ||
52 | EXPORT_FUNCTIONS do_populate_boot | ||
53 | |||
54 | IMAGE_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..37b1b61 --- /dev/null +++ b/meta-boot2qt/classes/image_types_sdcard.bbclass | |||
@@ -0,0 +1,68 @@ | |||
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 | IMAGE_ROOTFS_EXTRA_SPACE = "100000" | ||
31 | SDCARD_ROOTFS = "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.ext3" | ||
32 | SDCARD_GENERATION_COMMAND ?= "generate_imx_sdcard" | ||
33 | |||
34 | IMAGE_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 | |||
41 | IMAGE_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 | |||
46 | build_hddimg_append() { | ||
47 | rm -f ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.img | ||
48 | ln -s ${IMAGE_NAME}.hddimg ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.img | ||
49 | } | ||
50 | |||
51 | IMAGE_DEPENDS_tegraflash_append = " parted-native:do_populate_sysroot" | ||
52 | create_tegraflash_pkg_prepend() { | ||
53 | # Create partition table | ||
54 | SDCARD=${IMGDEPLOYDIR}/${IMAGE_NAME}.img | ||
55 | SDCARD_ROOTFS=${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.ext4 | ||
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 | } | ||
diff --git a/meta-boot2qt/classes/internal-build.bbclass b/meta-boot2qt/classes/internal-build.bbclass new file mode 100644 index 0000000..64c07bf --- /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 | |||
30 | python 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('ENABLE_QTQUICKCOMPILER', "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 | |||
54 | addhandler enable_internal_build | ||
55 | enable_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 | |||
30 | inherit populate_b2qt_sdk populate_sdk_qt5_base abi-arch siteinfo | ||
31 | |||
32 | SDK_MKSPEC_DIR = "${SDK_OUTPUT}${SDKTARGETSYSROOT}${libdir}/${QT_DIR_NAME}/mkspecs" | ||
33 | NATIVE_SDK_MKSPEC_DIR = "${SDK_OUTPUT}${SDKPATHNATIVE}${libdir}/${QT_DIR_NAME}/mkspecs" | ||
34 | SDK_MKSPEC = "devices/linux-oe-generic-g++" | ||
35 | SDK_DEVICE_PRI = "${SDK_MKSPEC_DIR}/qdevice.pri" | ||
36 | SDK_DYNAMIC_FLAGS = "-O. -pipe -g" | ||
37 | |||
38 | create_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 | ||
42 | include(../common/linux_device_pre.conf) | ||
43 | exists(../../oe-device-extra.pri):include(../../oe-device-extra.pri) | ||
44 | include(../common/linux_device_post.conf) | ||
45 | load(qt_config) | ||
46 | EOF | ||
47 | |||
48 | cat > ${SDK_MKSPEC_DIR}/${SDK_MKSPEC}/qplatformdefs.h <<EOF | ||
49 | #include "../../linux-g++/qplatformdefs.h" | ||
50 | EOF | ||
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 | |||
84 | create_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 | |||
91 | create_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 | |||
30 | inherit populate_sdk | ||
31 | |||
32 | replace_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 | |||
49 | do_populate_sdk[depends] += "p7zip-native:do_populate_sysroot" | ||
50 | |||
51 | fakeroot 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 | |||
30 | QBSP_IMAGE_CONTENT ??= "" | ||
31 | |||
32 | do_image_complete[depends] += "p7zip-native:do_populate_sysroot" | ||
33 | |||
34 | fakeroot 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 | |||
62 | IMAGE_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 | |||
30 | inherit meta nopackages abi-arch | ||
31 | |||
32 | FILESEXTRAPATHS_prepend := "${B2QTBASE}/files/qbsp:" | ||
33 | |||
34 | SRC_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 | |||
43 | INHIBIT_DEFAULT_DEPS = "1" | ||
44 | do_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 | |||
51 | QBSP_VERSION ?= "${PV}${VERSION_AUTO_INCREMENT}" | ||
52 | QBSP_INSTALLER_COMPONENT ?= "${@d.getVar('MACHINE', True).replace('-','')}" | ||
53 | QBSP_INSTALL_PATH ?= "/Extras/${MACHINE}" | ||
54 | |||
55 | QBSP_LICENSE_FILE ?= "" | ||
56 | QBSP_LICENSE_NAME ?= "" | ||
57 | QBSP_LICENSE_FILE_imx = "NXP-EULA" | ||
58 | QBSP_LICENSE_NAME_imx = "NXP Semiconductors Software License Agreement" | ||
59 | |||
60 | VERSION_AUTO_INCREMENT = "-${DATETIME}" | ||
61 | VERSION_AUTO_INCREMENT[vardepsexclude] = "DATETIME" | ||
62 | |||
63 | DEPLOY_CONF_NAME ?= "${MACHINE}" | ||
64 | RELEASEDATE = "${@time.strftime('%Y-%m-%d',time.gmtime())}" | ||
65 | |||
66 | IMAGE_PACKAGE = "${QBSP_IMAGE_TASK}-${MACHINE}.7z" | ||
67 | SDK_NAME = "${DISTRO}-${SDK_MACHINE}-${QBSP_SDK_TASK}-${MACHINE}.${SDK_POSTFIX}" | ||
68 | SDK_POSTFIX = "sh" | ||
69 | SDK_POSTFIX_sdkmingw32 = "7z" | ||
70 | REAL_MULTIMACH_TARGET_SYS = "${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}" | ||
71 | SDK_MACHINE = "${@d.getVar('SDKMACHINE', True) or '${SDK_ARCH}'}" | ||
72 | |||
73 | B = "${WORKDIR}/build" | ||
74 | |||
75 | patch_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 | |||
98 | prepare_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 | |||
150 | create_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 | |||
163 | python do_qbsp() { | ||
164 | bb.build.exec_func('create_qbsp', d) | ||
165 | } | ||
166 | |||
167 | addtask qbsp after do_unpack before do_build | ||
168 | |||
169 | do_qbsp[cleandirs] += "${B}" | ||
170 | |||
171 | do_configure[noexec] = "1" | ||
172 | do_compile[noexec] = "1" | ||
173 | do_populate_sysroot[noexec] = "1" | ||
174 | do_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 | |||
30 | require 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 | |||
30 | EXTRA_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 | |||
30 | python 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 | |||
54 | python 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 | |||
82 | def 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) | ||