mirror of
http://code.qt.io/yocto/meta-qt6.git
synced 2026-01-04 16:10:12 +00:00
Add QtWebEngine
Build QtWebEngine using CMake. Include helper files (chromium-gn.inc and
gn-utils.inc) from meta-browser. QtWebEngine build no longer requires
additional support in the host system, instead the build time tools
are run using QEMU.
WebEngine requires python2, available from meta-python2 layer, and
at least CMake 3.19. Only oe-core/hardknott provides recent enough CMake.
CI builds of webengine are limited to hardknott for this reason.
To use system ICU, QtWebEngine requires ICU 68 or up. This is also
available starting from oe-core/hardnott.
spellchecker feature doesn't work properly, since it requires
a native util to be built.
Task-number: QTBUG-93825
Change-Id: Id150275f5adfedd8f1acdc5f92c46a437da84f2e
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 403ab76764)
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
This commit is contained in:
parent
20429485e3
commit
4f46daa9e2
|
|
@ -3,11 +3,12 @@ Qt6 OpenEmbedded/Yocto Project layer
|
|||
|
||||
This layer depends on:
|
||||
|
||||
URI: https://github.com/openembedded/openembedded-core
|
||||
URI: https://git.openembedded.org/openembedded-core/
|
||||
|
||||
and optionally:
|
||||
|
||||
URI: https://github.com/openembedded/meta-openembedded
|
||||
URI: https://git.openembedded.org/meta-openembedded/
|
||||
URI: https://git.openembedded.org/meta-python2
|
||||
|
||||
Yocto version support
|
||||
---------------------
|
||||
|
|
|
|||
|
|
@ -113,12 +113,10 @@ instructions:
|
|||
sudo mkdir -p /mnt/yocto-cache
|
||||
sudo mount yocto-cache.intra.qt.io:/srv/yocto-cache /mnt/yocto-cache
|
||||
|
||||
git clone git://git.yoctoproject.org/poky --reference /mnt/yocto-cache/mirror/poky.git
|
||||
(cd poky; git checkout ${YOCTO_BRANCH})
|
||||
git clone git://github.com/openembedded/meta-openembedded --reference /mnt/yocto-cache/mirror/meta-openembedded.git
|
||||
(cd meta-openembedded; git checkout ${YOCTO_BRANCH})
|
||||
git clone git://git.yoctoproject.org/meta-mingw --reference /mnt/yocto-cache/mirror/meta-mingw.git
|
||||
(cd meta-mingw; git checkout ${YOCTO_BRANCH})
|
||||
git clone git://git.yoctoproject.org/poky --reference /mnt/yocto-cache/mirror/poky.git -b ${YOCTO_BRANCH}
|
||||
git clone git://github.com/openembedded/meta-openembedded --reference /mnt/yocto-cache/mirror/meta-openembedded.git -b ${YOCTO_BRANCH}
|
||||
git clone git://git.yoctoproject.org/meta-mingw --reference /mnt/yocto-cache/mirror/meta-mingw.git -b ${YOCTO_BRANCH}
|
||||
git clone git://git.openembedded.org/meta-python2 --reference /mnt/yocto-cache/mirror/meta-python2.git -b ${YOCTO_BRANCH}
|
||||
|
||||
source ./poky/oe-init-build-env
|
||||
export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE SSTATE_DIR DL_DIR"
|
||||
|
|
@ -129,7 +127,9 @@ instructions:
|
|||
export SSTATE_DIR=/mnt/yocto-cache/sstate-caches/${DISTRO_CODENAME}-meta-qt6
|
||||
bitbake-layers add-layer ../meta-openembedded/meta-oe
|
||||
bitbake-layers add-layer ../meta-openembedded/meta-python
|
||||
bitbake-layers add-layer ../meta-openembedded/meta-multimedia
|
||||
bitbake-layers add-layer ../meta-mingw
|
||||
bitbake-layers add-layer ../meta-python2
|
||||
bitbake-layers add-layer ${SOURCE_DIR}
|
||||
|
||||
if [ -n "${DISABLE_X11}" ] ; then
|
||||
|
|
|
|||
|
|
@ -33,6 +33,11 @@ WARN_QA:remove = "${EXTRA_QA}"
|
|||
PREFERRED_ARM_INSTRUCTION_SET ?= "thumb"
|
||||
ARM_INSTRUCTION_SET = "${PREFERRED_ARM_INSTRUCTION_SET}"
|
||||
|
||||
# enable webengine with commercial/proprietary features
|
||||
DISTRO_FEATURES:append = " webengine"
|
||||
LICENSE_FLAGS_WHITELIST = "commercial"
|
||||
PACKAGECONFIG:append:pn-qtwebengine = " proprietary-codecs ffmpeg"
|
||||
|
||||
PACKAGECONFIG:append:pn-qtbase = "\
|
||||
tslib kms gbm zstd libproxy gssapi vulkan mtdev cups \
|
||||
sql-mysql sql-odbc sql-psql sql-sqlite journald brotli \
|
||||
|
|
@ -73,4 +78,5 @@ PACKAGECONFIG:append:pn-qttranslations = " examples"
|
|||
PACKAGECONFIG:append:pn-qtvirtualkeyboard = " examples"
|
||||
PACKAGECONFIG:append:pn-qtwayland = " examples"
|
||||
PACKAGECONFIG:append:pn-qtwebchannel = " examples"
|
||||
PACKAGECONFIG:append:pn-qtwebengine = " examples"
|
||||
PACKAGECONFIG:append:pn-qtwebsockets = " examples"
|
||||
|
|
|
|||
|
|
@ -40,4 +40,5 @@ RDEPENDS:${PN} += " \
|
|||
${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'qtwayland', '', d)} \
|
||||
qtwebchannel \
|
||||
qtwebsockets \
|
||||
${@bb.utils.contains('DISTRO_FEATURES', 'webengine', 'qtwebengine', '', d)} \
|
||||
"
|
||||
|
|
|
|||
90
recipes-qt/qt6/chromium-gn.inc
Normal file
90
recipes-qt/qt6/chromium-gn.inc
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
require gn-utils.inc
|
||||
|
||||
inherit qemu
|
||||
|
||||
COMPATIBLE_MACHINE = "(-)"
|
||||
COMPATIBLE_MACHINE:aarch64 = "(.*)"
|
||||
COMPATIBLE_MACHINE:armv6 = "(.*)"
|
||||
COMPATIBLE_MACHINE:armv7a = "(.*)"
|
||||
COMPATIBLE_MACHINE:armv7ve = "(.*)"
|
||||
COMPATIBLE_MACHINE:x86 = "(.*)"
|
||||
COMPATIBLE_MACHINE:x86-64 = "(.*)"
|
||||
|
||||
# By default, passing is_official_build=true to GN causes its symbol_level
|
||||
# variable to be set to "2". This means the compiler will be passed "-g2" and
|
||||
# we will end up with a very large chrome binary (around 5Gb as of M58)
|
||||
# regardless of whether DEBUG_BUILD has been set or not. In addition, binutils,
|
||||
# file and other utilities are unable to read a 32-bit binary this size, which
|
||||
# causes it not to be stripped.
|
||||
# The solution is two-fold:
|
||||
# 1. Make sure -g is not passed on 32-bit architectures via DEBUG_FLAGS. -g is
|
||||
# the same as -g2. -g1 generates an 800MB binary, which is a lot more
|
||||
# manageable.
|
||||
# 2. Explicitly pass symbol_level=0 to GN. This causes -g0 to be passed
|
||||
# instead, so that if DEBUG_BUILD is not set GN will not create a huge debug
|
||||
# binary anyway. Since our compiler flags are passed after GN's, -g0 does
|
||||
# not cause any issues if DEBUG_BUILD is set, as -g1 will be passed later.
|
||||
DEBUG_FLAGS:remove:arm = "-g"
|
||||
DEBUG_FLAGS:append:arm = "-g1"
|
||||
DEBUG_FLAGS:remove:x86 = "-g"
|
||||
DEBUG_FLAGS:append:x86 = "-g1"
|
||||
|
||||
# As of Chromium 62.0.3202.94 and Yocto Rocko (GCC 7, binutils 2.29), passing
|
||||
# -g to the compiler results in many linker errors on aarch64, such as:
|
||||
# obj/third_party/WebKit/Source/modules/payments/libpayments.a(PaymentEventDataConversion.o)(.debug_loc+0x4e25): error: relocation overflow in R_AARCH64_ABS32
|
||||
DEBUG_FLAGS:remove:aarch64 = "-g"
|
||||
DEBUG_FLAGS:append:aarch64 = "-g1"
|
||||
|
||||
# As of Chromium 60.0.3112.101 and Yocto Pyro (GCC 6, binutils 2.28), passing
|
||||
# -g to the compiler results in many linker errors on x86_64, such as:
|
||||
# obj/third_party/WebKit/Source/core/loader/libloader.a(ModuleTreeLinker.o)(.debug_loc+0x1e9a5): error: relocation overflow: reference to local symbol 82 in obj/third_party/WebKit/Source/core/loader/libloader.a(ModuleTreeLinker.o)
|
||||
# obj/third_party/WebKit/Source/core/libcore_generated.a(ScriptModule.o)(.debug_loc+0x253c): error: relocation overflow: reference to local symbol 31 in obj/third_party/WebKit/Source/core/libcore_generated.a(ScriptModule.o)
|
||||
# so we have to use the same hack described above.
|
||||
DEBUG_FLAGS:remove:x86-64 = "-g"
|
||||
DEBUG_FLAGS:append:x86-64 = "-g1"
|
||||
|
||||
# V8's JIT infrastructure requires binaries such as mksnapshot and
|
||||
# mkpeephole to be run in the host during the build. However, these
|
||||
# binaries must have the same bit-width as the target (e.g. a x86_64
|
||||
# host targeting ARMv6 needs to produce a 32-bit binary). Instead of
|
||||
# depending on a third Yocto toolchain, we just build those binaries
|
||||
# for the target and run them on the host with QEMU.
|
||||
python do_create_v8_qemu_wrapper () {
|
||||
"""Creates a small wrapper that invokes QEMU to run some target V8 binaries
|
||||
on the host."""
|
||||
qemu_libdirs = [d.expand('${STAGING_DIR_HOST}${libdir}'),
|
||||
d.expand('${STAGING_DIR_HOST}${base_libdir}')]
|
||||
qemu_cmd = qemu_wrapper_cmdline(d, d.getVar('STAGING_DIR_HOST', True),
|
||||
qemu_libdirs)
|
||||
wrapper_path = d.expand('${B}/src/core/Release/${TARGET_ARCH}')
|
||||
bb.utils.mkdirhier(wrapper_path)
|
||||
wrapper_path = os.path.join(wrapper_path, "v8-qemu-wrapper.sh")
|
||||
with open(wrapper_path, 'w') as wrapper_file:
|
||||
wrapper_file.write("""#!/bin/sh
|
||||
|
||||
# This file has been generated automatically.
|
||||
# It invokes QEMU to run binaries built for the target in the host during the
|
||||
# build process.
|
||||
|
||||
%s "$@"
|
||||
""" % qemu_cmd)
|
||||
os.chmod(wrapper_path, 0o755)
|
||||
}
|
||||
do_create_v8_qemu_wrapper[dirs] = "${B}"
|
||||
addtask create_v8_qemu_wrapper after do_configure before do_compile
|
||||
|
||||
python do_write_toolchain_file () {
|
||||
"""Writes a BUILD.gn file for Yocto detailing its toolchains."""
|
||||
toolchain_dir = d.expand("${S}/src/3rdparty/chromium/build/toolchain/yocto")
|
||||
bb.utils.mkdirhier(toolchain_dir)
|
||||
toolchain_file = os.path.join(toolchain_dir, "BUILD.gn")
|
||||
write_toolchain_file(d, toolchain_file)
|
||||
}
|
||||
addtask write_toolchain_file after do_patch before do_configure
|
||||
|
||||
do_compile[progress] = "outof:^\[(\d+)/(\d+)\]\s+"
|
||||
|
||||
PACKAGE_DEBUG_SPLIT_STYLE = "debug-without-src"
|
||||
|
||||
# There is no need to ship empty -dev packages.
|
||||
ALLOW_EMPTY:${PN}-dev = "0"
|
||||
11
recipes-qt/qt6/gn-native_git.bb
Normal file
11
recipes-qt/qt6/gn-native_git.bb
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
require recipes-qt/qt6/qtwebengine.inc
|
||||
|
||||
inherit native
|
||||
|
||||
OECMAKE_SOURCEPATH = "${S}/src/gn"
|
||||
|
||||
cmake_do_install() {
|
||||
eval DESTDIR='${D}' ${CMAKE_VERBOSE} cmake --install '${B}'
|
||||
}
|
||||
|
||||
INSANE_SKIP:${PN} += "already-stripped"
|
||||
111
recipes-qt/qt6/gn-utils.inc
Normal file
111
recipes-qt/qt6/gn-utils.inc
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
# GN host architecture helpers.
|
||||
#
|
||||
# BUILD_ARCH's value corresponds to what uname returns as the machine name.
|
||||
# The mapping in gn_host_arch_name() tries to match several possible values
|
||||
# returned by the Linux kernel in uname(2) into the corresponding values GN
|
||||
# understands.
|
||||
def gn_host_arch_name(d):
|
||||
"""Returns a GN architecture name corresponding to the build host's machine
|
||||
architecture."""
|
||||
import re
|
||||
arch_translations = {
|
||||
r'aarch64.*': 'arm64',
|
||||
r'arm.*': 'arm',
|
||||
r'i[3456]86$': 'x86',
|
||||
r'x86_64$': 'x64',
|
||||
}
|
||||
build_arch = d.getVar("BUILD_ARCH")
|
||||
for arch_regexp, gn_arch_name in arch_translations.items():
|
||||
if re.match(arch_regexp, build_arch):
|
||||
return gn_arch_name
|
||||
bb.fatal('Unsuported BUILD_ARCH value: "%s"' % build_arch)
|
||||
|
||||
# GN target architecture helpers.
|
||||
#
|
||||
# Determining the target architecture is more difficult, as there are many
|
||||
# different values we can use on the Yocto side (e.g. TUNE_ARCH, TARGET_ARCH,
|
||||
# MACHINEOVERRIDES etc). What we do is define the mapping with regular,
|
||||
# non-Python variables with overrides that are generic enough (i.e. "x86"
|
||||
# instead of "i586") and then use gn_target_arch_name() to return the right
|
||||
# value with some validation.
|
||||
GN_TARGET_ARCH_NAME:aarch64 = "arm64"
|
||||
GN_TARGET_ARCH_NAME:arm = "arm"
|
||||
GN_TARGET_ARCH_NAME:x86 = "x86"
|
||||
GN_TARGET_ARCH_NAME:x86-64 = "x64"
|
||||
|
||||
def clang_install_path(d):
|
||||
"""Return clang compiler install path."""
|
||||
return d.getVar("STAGING_BINDIR_NATIVE")
|
||||
|
||||
def gn_target_arch_name(d):
|
||||
"""Returns a GN architecture name corresponding to the target machine's
|
||||
architecture."""
|
||||
name = d.getVar("GN_TARGET_ARCH_NAME")
|
||||
if name is None:
|
||||
bb.fatal('Unsupported target architecture. A valid override for the '
|
||||
'GN_TARGET_ARCH_NAME variable could not be found.')
|
||||
return name
|
||||
|
||||
def write_toolchain_file(d, file_path):
|
||||
"""Creates a complete GN toolchain file in |file_path|."""
|
||||
import string
|
||||
# Even though we always use clang, the "clang_toolchain" GN template is too
|
||||
# restrictive in the way it sets variables such as |cxx|. Since it is just
|
||||
# a wrapper on top of the "gcc_toolchain" template, we keep using the
|
||||
# latter directly to accommodate our cross-compilation needs.
|
||||
toolchain_tmpl = string.Template(
|
||||
'gcc_toolchain("${toolchain_name}") {\n'
|
||||
' cc = "${cc}"\n'
|
||||
' cxx = "${cxx}"\n'
|
||||
' ar = "${ar}"\n'
|
||||
' ld = cxx # GN expects a compiler, not a linker.\n'
|
||||
' nm = "${nm}"\n'
|
||||
' readelf = "${readelf}"\n'
|
||||
' extra_cflags = "${extra_cflags}"\n'
|
||||
' extra_cppflags = "${extra_cppflags}"\n'
|
||||
' extra_cxxflags = "${extra_cxxflags}"\n'
|
||||
' extra_ldflags = "${extra_ldflags}"\n'
|
||||
' toolchain_args = {\n'
|
||||
' current_cpu = "${current_cpu}"\n'
|
||||
' current_os = "linux"\n'
|
||||
' is_clang = false\n'
|
||||
' }\n'
|
||||
'}\n'
|
||||
)
|
||||
|
||||
native_toolchain = {
|
||||
'toolchain_name': 'yocto_native',
|
||||
'current_cpu': gn_host_arch_name(d),
|
||||
'cc': d.expand('${BUILD_CC}'),
|
||||
'cxx': d.expand('${BUILD_CXX}'),
|
||||
'ar': d.expand('${BUILD_AR}'),
|
||||
'nm': d.expand('${BUILD_NM}'),
|
||||
'readelf': d.expand('${BUILD_PREFIX}readelf'),
|
||||
'extra_cflags': d.expand('${BUILD_CFLAGS}'),
|
||||
'extra_cppflags': d.expand('${BUILD_CPPFLAGS}'),
|
||||
'extra_cxxflags': d.expand('${BUILD_CXXFLAGS}'),
|
||||
'extra_ldflags': d.expand('${BUILD_LDFLAGS}'),
|
||||
}
|
||||
target_toolchain = {
|
||||
'toolchain_name': 'yocto_target',
|
||||
'current_cpu': gn_target_arch_name(d),
|
||||
'cc': d.expand('${CC}'),
|
||||
'cxx': d.expand('${CXX}'),
|
||||
'ar': d.expand('${AR}'),
|
||||
'nm': d.expand('${NM}'),
|
||||
'readelf': d.expand('${TARGET_PREFIX}readelf'),
|
||||
'extra_cflags': d.expand('${TARGET_CFLAGS}'),
|
||||
'extra_cppflags': d.expand('${TARGET_CPPFLAGS}'),
|
||||
'extra_cxxflags': d.expand('${TARGET_CXXFLAGS}'),
|
||||
'extra_ldflags': d.expand('${TARGET_LDFLAGS}'),
|
||||
}
|
||||
|
||||
with open(file_path, 'w') as toolchain_file:
|
||||
toolchain_file.write(
|
||||
'# This file has been generated automatically.\n'
|
||||
'\n'
|
||||
'import("//build/toolchain/gcc_toolchain.gni")\n'
|
||||
'\n'
|
||||
)
|
||||
toolchain_file.write(toolchain_tmpl.substitute(native_toolchain))
|
||||
toolchain_file.write(toolchain_tmpl.substitute(target_toolchain))
|
||||
|
|
@ -51,4 +51,6 @@ SRCREV_qttranslations = "534ac65af9dd7f298f05ea537a8a545c6fe4ebb0"
|
|||
SRCREV_qtvirtualkeyboard = "64b68eeb265596df1ef72919cff4496c0fe4acc4"
|
||||
SRCREV_qtwayland = "bf47542a797c8d720c7336cf937b7e4c5e36d29d"
|
||||
SRCREV_qtwebchannel = "b741418a84a59c6d23c94a7f599934164459fe77"
|
||||
SRCREV_qtwebengine = "a32ef7057c01fbcadcf451e7f2b785f7b3dd3942"
|
||||
SRCREV_qtwebengine-chromium = "202e34476e934633b3c2e4679a53c4b0847364a8"
|
||||
SRCREV_qtwebsockets = "4ba5853914dc1c7dedf86d3c8c45ac57480a3581"
|
||||
|
|
|
|||
48
recipes-qt/qt6/qtwebengine.inc
Normal file
48
recipes-qt/qt6/qtwebengine.inc
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
LICENSE = "BSD & ( GPL-3.0 & The-Qt-Company-GPL-Exception-1.0 | The-Qt-Company-Commercial ) & ( LGPL-3.0 | The-Qt-Company-Commercial )"
|
||||
LIC_FILES_CHKSUM = " \
|
||||
file://src/3rdparty/chromium/LICENSE;md5=0fca02217a5d49a14dfe2d11837bb34d \
|
||||
file://LICENSE.LGPL3;md5=8211fde12cc8a4e2477602f5953f5b71 \
|
||||
file://LICENSE.GPLv3;md5=88e2b9117e6be406b5ed6ee4ca99a705 \
|
||||
file://LICENSE.GPL3;md5=d32239bcb673463ab874e80d47fae504 \
|
||||
file://LICENSE.GPL3-EXCEPT;md5=763d8c535a234d9a3fb682c7ecb6c073 \
|
||||
file://LICENSE.GPL2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
|
||||
"
|
||||
|
||||
inherit qt6-cmake
|
||||
|
||||
include recipes-qt/qt6/qt6-git.inc
|
||||
include recipes-qt/qt6/qt6.inc
|
||||
|
||||
inherit gettext
|
||||
inherit perlnative
|
||||
|
||||
inherit ${@bb.utils.contains("BBFILE_COLLECTIONS", "meta-python2", "pythonnative", "", d)}
|
||||
|
||||
python() {
|
||||
if 'meta-python2' not in d.getVar('BBFILE_COLLECTIONS').split():
|
||||
raise bb.parse.SkipRecipe('Requires meta-python2 to be present.')
|
||||
}
|
||||
|
||||
# we don't want gettext.bbclass to append --enable-nls
|
||||
def gettext_oeconf(d):
|
||||
return ""
|
||||
|
||||
QT_MODULE = "qtwebengine"
|
||||
QT_MODULE_BRANCH_CHROMIUM = "90-based"
|
||||
|
||||
FILESEXTRAPATHS:prepend := "${THISDIR}/qtwebengine:"
|
||||
|
||||
SRC_URI += " \
|
||||
${QT_GIT}/${QT_GIT_PROJECT}/qtwebengine-chromium.git;name=qtwebengine-chromium;branch=${QT_MODULE_BRANCH_CHROMIUM};protocol=${QT_GIT_PROTOCOL};destsuffix=git/src/3rdparty \
|
||||
file://0001-CMake-use-generated-yocto-toolchains.patch \
|
||||
file://0002-Enable-examples.patch \
|
||||
"
|
||||
|
||||
SRC_URI += " \
|
||||
file://chromium/0001-v8-qemu-wrapper.patch;patchdir=src/3rdparty \
|
||||
file://chromium/0002-chromium-workaround-for-too-long-.rps-file-name.patch;patchdir=src/3rdparty \
|
||||
file://chromium/0003-abseil-cpp-fix-build-with-glibc-2.34.patch;patchdir=src/3rdparty \
|
||||
file://chromium/0004-breakpad-fix-build-with-glibc-2.34.patch;patchdir=src/3rdparty \
|
||||
"
|
||||
|
||||
SRCREV_FORMAT = "qtwebengine_qtwebengine-chromium"
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
From ba24cb211c85c28833554d674d43b88b72e9a488 Mon Sep 17 00:00:00 2001
|
||||
From: Samuli Piippo <samuli.piippo@qt.io>
|
||||
Date: Wed, 18 Aug 2021 15:09:41 +0300
|
||||
Subject: [PATCH] CMake: use generated yocto toolchains
|
||||
|
||||
Bitbake knows how to generate working toolchains, use those instead of
|
||||
ones done by webengine. No need to use separate host pkg-wrapper with
|
||||
these toolchain.
|
||||
|
||||
Upstream-Status: Inappropriate [embedder specific]
|
||||
Change-Id: I217c9122144f25bb2d28717e7248c2a51b149127
|
||||
---
|
||||
cmake/Functions.cmake | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
|
||||
index b7c386fc..a75dfc30 100644
|
||||
--- a/cmake/Functions.cmake
|
||||
+++ b/cmake/Functions.cmake
|
||||
@@ -630,7 +630,7 @@ endfunction()
|
||||
|
||||
macro(create_pkg_config_host_wrapper buildDir)
|
||||
find_package(PkgConfigHost)
|
||||
- if(CMAKE_CROSSCOMPILING)
|
||||
+ if(FALSE)
|
||||
create_pkg_config_wrapper("${buildDir}/pkg-config-host_wrapper.sh" "${PKG_CONFIG_HOST_EXECUTABLE}")
|
||||
set(PKG_CONFIG_HOST_EXECUTABLE "${buildDir}/pkg-config-host_wrapper.sh")
|
||||
endif()
|
||||
@@ -818,9 +818,9 @@ endmacro()
|
||||
macro(append_toolchain_setup)
|
||||
if(LINUX)
|
||||
list(APPEND gnArgArg
|
||||
- custom_toolchain="${buildDir}/target_toolchain:target"
|
||||
- host_toolchain="${buildDir}/host_toolchain:host"
|
||||
- v8_snapshot_toolchain="${buildDir}/v8_toolchain:v8"
|
||||
+ custom_toolchain="//build/toolchain/yocto:yocto_target"
|
||||
+ host_toolchain="//build/toolchain/yocto:yocto_native"
|
||||
+ v8_snapshot_toolchain="//build/toolchain/yocto:yocto_target"
|
||||
)
|
||||
get_gn_arch(cpu ${TEST_architecture_arch})
|
||||
if(CMAKE_CROSSCOMPILING)
|
||||
25
recipes-qt/qt6/qtwebengine/0002-Enable-examples.patch
Normal file
25
recipes-qt/qt6/qtwebengine/0002-Enable-examples.patch
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
From 2ddd0a26eaf583ac9f11c8b0a97602c4f3a86e4c Mon Sep 17 00:00:00 2001
|
||||
From: Samuli Piippo <samuli.piippo@qt.io>
|
||||
Date: Tue, 31 Aug 2021 18:27:48 +0300
|
||||
Subject: [PATCH] Enable examples
|
||||
|
||||
The bug mentioned does not affect bitbake builds.
|
||||
|
||||
Change-Id: I076763d9241061f9cdb4d46bcd88e46bd4f783aa
|
||||
---
|
||||
examples/CMakeLists.txt | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
|
||||
index 06e36ecc..035a14f6 100644
|
||||
--- a/examples/CMakeLists.txt
|
||||
+++ b/examples/CMakeLists.txt
|
||||
@@ -1,7 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
qt_examples_build_begin()
|
||||
-if(NOT CMAKE_CROSSCOMPILING) #QTBUG-86533
|
||||
+if(TRUE) #QTBUG-86533
|
||||
if(TARGET Qt::WebEngineCore)
|
||||
add_subdirectory(webenginequick)
|
||||
endif()
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
From 87769922a455bec09951f95e8cd3402cf646ee33 Mon Sep 17 00:00:00 2001
|
||||
From: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
|
||||
Date: Tue, 7 Nov 2017 15:24:32 +0100
|
||||
Subject: [PATCH] v8: qemu wrapper
|
||||
|
||||
The patch below makes the V8 binaries run during the build be invoked through
|
||||
QEMU, as they are built for the target.
|
||||
|
||||
Upstream-Status: Inappropriate [embedder specific]
|
||||
|
||||
Signed-off-by: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
|
||||
Signed-off-by: Maksim Sisov <msisov@igalia.com>
|
||||
---
|
||||
chromium/tools/v8_context_snapshot/BUILD.gn | 1 +
|
||||
chromium/v8/BUILD.gn | 4 ++++
|
||||
2 files changed, 5 insertions(+)
|
||||
|
||||
diff --git a/chromium/tools/v8_context_snapshot/BUILD.gn b/chromium/tools/v8_context_snapshot/BUILD.gn
|
||||
index 6e86a543558..eee89b37064 100644
|
||||
--- a/chromium/tools/v8_context_snapshot/BUILD.gn
|
||||
+++ b/chromium/tools/v8_context_snapshot/BUILD.gn
|
||||
@@ -56,6 +56,7 @@ if (use_v8_context_snapshot) {
|
||||
output_path = rebase_path(output_file, root_build_dir)
|
||||
|
||||
args = [
|
||||
+ "./v8-qemu-wrapper.sh",
|
||||
"./" + rebase_path(
|
||||
get_label_info(
|
||||
":v8_context_snapshot_generator($v8_snapshot_toolchain)",
|
||||
diff --git a/chromium/v8/BUILD.gn b/chromium/v8/BUILD.gn
|
||||
index db762c8c300..11e96d1ea3b 100644
|
||||
--- a/chromium/v8/BUILD.gn
|
||||
+++ b/chromium/v8/BUILD.gn
|
||||
@@ -1521,6 +1521,7 @@ template("run_torque") {
|
||||
}
|
||||
|
||||
args = [
|
||||
+ "./v8-qemu-wrapper.sh",
|
||||
"./" + rebase_path(
|
||||
get_label_info(":torque($toolchain)", "root_out_dir") + "/torque",
|
||||
root_build_dir),
|
||||
@@ -1637,6 +1638,7 @@ action("generate_bytecode_builtins_list") {
|
||||
outputs = [ "$target_gen_dir/builtins-generated/bytecodes-builtins-list.h" ]
|
||||
deps = [ ":bytecode_builtins_list_generator($v8_generator_toolchain)" ]
|
||||
args = [
|
||||
+ "./v8-qemu-wrapper.sh",
|
||||
"./" + rebase_path(
|
||||
get_label_info(
|
||||
":bytecode_builtins_list_generator($v8_generator_toolchain)",
|
||||
@@ -1682,6 +1684,7 @@ template("run_mksnapshot") {
|
||||
data = []
|
||||
|
||||
args = [
|
||||
+ "./v8-qemu-wrapper.sh",
|
||||
"./" + rebase_path(get_label_info(":mksnapshot($v8_snapshot_toolchain)",
|
||||
"root_out_dir") + "/mksnapshot",
|
||||
root_build_dir),
|
||||
@@ -5133,6 +5136,7 @@ if (v8_enable_i18n_support) {
|
||||
outputs = [ output_file ]
|
||||
|
||||
args = [
|
||||
+ "./v8-qemu-wrapper.sh",
|
||||
"./" + rebase_path(
|
||||
get_label_info(
|
||||
":gen-regexp-special-case($v8_generator_toolchain)",
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
From 358e7b51c205521dc9eac8a8cf676412078fe014 Mon Sep 17 00:00:00 2001
|
||||
From: Samuli Piippo <samuli.piippo@qt.io>
|
||||
Date: Thu, 30 Mar 2017 11:37:24 +0300
|
||||
Subject: [PATCH] chromium: workaround for too long .rps file name
|
||||
|
||||
Ninja may fail when the build directory is too long:
|
||||
|
||||
ninja: error: WriteFile(__third_party_WebKit_Source_bindings_modules_\
|
||||
interfaces_info_individual_modules__home_qt_work_build_build-nitrogen\
|
||||
6x_tmp_work_cortexa9hf-neon-mx6qdl-poky-linux-gnueabi_qtwebengine_5.9\
|
||||
.0_gitAUTOINC_29afdb0a34_049134677a-r0_build_src_toolchain_target__ru\
|
||||
le.rsp): Unable to create file. File name too long
|
||||
|
||||
Task-number: QTBUG-59769
|
||||
Change-Id: I73c5e64ae5174412be2a675e35b0b6047f2bf4c1
|
||||
---
|
||||
gn/src/gn/ninja_action_target_writer.cc | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/gn/src/gn/ninja_action_target_writer.cc b/gn/src/gn/ninja_action_target_writer.cc
|
||||
index 2ceac904a3c..8496e309cec 100644
|
||||
--- a/gn/src/gn/ninja_action_target_writer.cc
|
||||
+++ b/gn/src/gn/ninja_action_target_writer.cc
|
||||
@@ -122,9 +122,18 @@ std::string NinjaActionTargetWriter::WriteRuleDefinition() {
|
||||
// strictly necessary for regular one-shot actions, but it's easier to
|
||||
// just always define unique_name.
|
||||
std::string rspfile = custom_rule_name;
|
||||
+
|
||||
+ //quick workaround if filename length > 255 - ".rsp", just cut the dirs starting from the end
|
||||
+ //please note ".$unique_name" is not used at the moment
|
||||
+ int pos = 0;
|
||||
+ std::string delimiter("_");
|
||||
+ while (rspfile.length() > 250 && (pos = rspfile.find_last_of(delimiter)) != std::string::npos)
|
||||
+ rspfile = rspfile.substr(0,pos);
|
||||
+
|
||||
if (!target_->sources().empty())
|
||||
rspfile += ".$unique_name";
|
||||
rspfile += ".rsp";
|
||||
+
|
||||
out_ << " rspfile = " << rspfile << std::endl;
|
||||
|
||||
// Response file contents.
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
From 5f7bc5a9ed2429705c37ac176a385ce7ec100d33 Mon Sep 17 00:00:00 2001
|
||||
From: Samuli Piippo <samuli.piippo@qt.io>
|
||||
Date: Fri, 17 Sep 2021 07:55:21 +0300
|
||||
Subject: [PATCH] abseil-cpp: fix build with glibc-2.34
|
||||
|
||||
Backport upstream fix for:
|
||||
../../../../../git/src/3rdparty/chromium/third_party/abseil-cpp/absl/debugging/failure_signal_handler.cc: In function 'bool absl::SetupAlternateStackOnce()':
|
||||
../../../../../git/src/3rdparty/chromium/third_party/abseil-cpp/absl/debugging/failure_signal_handler.cc:139:32: error: no matching function for call to 'max(long int, int)'
|
||||
size_t stack_size = (std::max(SIGSTKSZ, 65536) + page_mask) & ~page_mask;
|
||||
~~~~~~~~^~~~~~~~~~~~~~~~~
|
||||
|
||||
Caused by SIGSTCKZ no longer being compile time constant in glibc-2.34.
|
||||
|
||||
https://github.com/abseil/abseil-cpp/commit/a9831f1cbf93fb18dd951453635f488037454ce9
|
||||
|
||||
Change-Id: I88611684c25ffbc9d8a27a02ca55b906098b48a8
|
||||
---
|
||||
.../abseil-cpp/absl/debugging/failure_signal_handler.cc | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chromium/third_party/abseil-cpp/absl/debugging/failure_signal_handler.cc b/chromium/third_party/abseil-cpp/absl/debugging/failure_signal_handler.cc
|
||||
index a9ed6ef9648..3ddebd74ecf 100644
|
||||
--- a/chromium/third_party/abseil-cpp/absl/debugging/failure_signal_handler.cc
|
||||
+++ b/chromium/third_party/abseil-cpp/absl/debugging/failure_signal_handler.cc
|
||||
@@ -136,7 +136,8 @@ static bool SetupAlternateStackOnce() {
|
||||
#else
|
||||
const size_t page_mask = sysconf(_SC_PAGESIZE) - 1;
|
||||
#endif
|
||||
- size_t stack_size = (std::max(SIGSTKSZ, 65536) + page_mask) & ~page_mask;
|
||||
+ size_t stack_size =
|
||||
+ (std::max<size_t>(SIGSTKSZ, 65536) + page_mask) & ~page_mask;
|
||||
#if defined(ABSL_HAVE_ADDRESS_SANITIZER) || \
|
||||
defined(ABSL_HAVE_MEMORY_SANITIZER) || defined(ABSL_HAVE_THREAD_SANITIZER)
|
||||
// Account for sanitizer instrumentation requiring additional stack space.
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
From c30c5ef4cdd53cac45572ac91e81f04e2fec6e64 Mon Sep 17 00:00:00 2001
|
||||
From: Samuli Piippo <samuli.piippo@qt.io>
|
||||
Date: Fri, 17 Sep 2021 08:00:38 +0300
|
||||
Subject: [PATCH] breakpad: fix build with glibc-2.34
|
||||
|
||||
Fix compilation error:
|
||||
../../../../git/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc:141:49: error: no matching function for call to 'max(int, long int)'
|
||||
141 | static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ);
|
||||
| ~~~~~~~~^~~~~~~~~~~~~~~~~
|
||||
|
||||
Caused by SIGSTCKZ no longer being compile time constant in glibc-2.34.
|
||||
|
||||
Change-Id: I19e6f848208144e6d2abfa36e5a62edf28f0bfd4
|
||||
---
|
||||
.../breakpad/src/client/linux/handler/exception_handler.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc b/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
|
||||
index ca353c40997..2e43ba6fc04 100644
|
||||
--- a/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
|
||||
+++ b/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
|
||||
@@ -138,7 +138,7 @@ void InstallAlternateStackLocked() {
|
||||
// SIGSTKSZ may be too small to prevent the signal handlers from overrunning
|
||||
// the alternative stack. Ensure that the size of the alternative stack is
|
||||
// large enough.
|
||||
- static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ);
|
||||
+ static const unsigned kSigStackSize = std::max<size_t>(16384, SIGSTKSZ);
|
||||
|
||||
// Only set an alternative stack if there isn't already one, or if the current
|
||||
// one is too small.
|
||||
85
recipes-qt/qt6/qtwebengine_git.bb
Normal file
85
recipes-qt/qt6/qtwebengine_git.bb
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
require recipes-qt/qt6/qtwebengine.inc
|
||||
require recipes-qt/qt6/chromium-gn.inc
|
||||
|
||||
DEPENDS += " \
|
||||
nodejs-native \
|
||||
gperf-native \
|
||||
bison-native \
|
||||
qemu-native \
|
||||
nss nss-native \
|
||||
${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'libxcomposite libxcursor libxi libxrandr libxtst libxkbfile', '', d)} \
|
||||
qtbase qtdeclarative \
|
||||
gn-native \
|
||||
"
|
||||
|
||||
EXTRA_OECMAKE += "\
|
||||
-DFEATURE_qtwebengine_build=ON \
|
||||
-DFEATURE_qtpdf_build=OFF \
|
||||
"
|
||||
|
||||
# chromium/third_party/openh264/BUILD.gn add -Wno-format to cflags
|
||||
# causing following error, because -Wformat-security cannot be used together with -Wno-format
|
||||
# cc1plus: error: -Wformat-security ignored without -Wformat [-Werror=format-security]
|
||||
# http://errors.yoctoproject.org/Errors/Details/150333/
|
||||
SECURITY_STRINGFORMAT = ""
|
||||
|
||||
PACKAGECONFIG ??= "\
|
||||
${@bb.utils.filter('DISTRO_FEATURES', 'alsa pulseaudio', d)} \
|
||||
freetype \
|
||||
glib \
|
||||
harfbuzz \
|
||||
icu \
|
||||
libevent \
|
||||
libjpeg \
|
||||
libpci \
|
||||
libpng \
|
||||
libwebp \
|
||||
zlib \
|
||||
${@bb.utils.contains('BBFILE_COLLECTIONS', 'openembedded-layer', '${PACKAGECONFIG_OPENEMBEDDED}', '', d)} \
|
||||
geolocation \
|
||||
webchannel \
|
||||
printing-and-pdf \
|
||||
pepper-plugins \
|
||||
"
|
||||
PACKAGECONFIG_OPENEMBEDDED ?= "\
|
||||
lcms2 \
|
||||
opus \
|
||||
snappy \
|
||||
webrtc \
|
||||
webrtc-pipewire \
|
||||
"
|
||||
|
||||
PACKAGECONFIG[alsa] = "-DFEATURE_webengine_system_alsa=ON,-DFEATURE_webengine_system_alsa=OFF,alsa-lib"
|
||||
PACKAGECONFIG[ffmpeg] = "-DFEATURE_webengine_system_ffmpeg=ON,-DFEATURE_webengine_system_ffmpeg=OFF,libav"
|
||||
PACKAGECONFIG[freetype] = "-DFEATURE_webengine_system_freetype=ON,-DFEATURE_webengine_system_freetype=OFF,freetype"
|
||||
PACKAGECONFIG[geolocation] = "-DFEATURE_webengine_geolocation=ON,-DFEATURE_webengine_geolocation=OFF,qtpositioning"
|
||||
PACKAGECONFIG[glib] = "-DFEATURE_webengine_system_glib=ON,-DFEATURE_webengine_system_glib=OFF,glib-2.0"
|
||||
PACKAGECONFIG[harfbuzz] = "-DFEATURE_webengine_system_harfbuzz=ON,-DFEATURE_webengine_system_harfbuzz=OFF,harfbuzz"
|
||||
PACKAGECONFIG[icu] = "-DFEATURE_webengine_system_icu=ON,-DFEATURE_webengine_system_icu=OFF,icu"
|
||||
PACKAGECONFIG[lcms2] = "-DFEATURE_webengine_system_lcms2=ON,-DFEATURE_webengine_system_lcms2=OFF,lcms"
|
||||
PACKAGECONFIG[libevent] = "-DFEATURE_webengine_system_libevent=ON,-DFEATURE_webengine_system_libevent=OFF,libevent"
|
||||
PACKAGECONFIG[libjpeg] = "-DFEATURE_webengine_system_libjpeg=ON,-DFEATURE_webengine_system_libjpeg=OFF,jpeg"
|
||||
PACKAGECONFIG[libpng] = "-DFEATURE_webengine_system_libpng=ON,-DFEATURE_webengine_system_libpng=OFF,libpng"
|
||||
PACKAGECONFIG[libvpx] = "-DFEATURE_webengine_system_libvpx=ON,-DFEATURE_webengine_system_libvpx=OFF,libvpx"
|
||||
PACKAGECONFIG[libwebp] = "-DFEATURE_webengine_system_libwebp=ON,-DFEATURE_webengine_system_libwebp=OFF,libwebp"
|
||||
PACKAGECONFIG[libxml] = "-DFEATURE_webengine_system_libxml=ON,-DFEATURE_webengine_system_libxml=OFF,libxml2 libxslt"
|
||||
PACKAGECONFIG[minizip] = "-DFEATURE_webengine_system_minizip=ON,-DFEATURE_webengine_system_minizip=OFF,minizip"
|
||||
PACKAGECONFIG[opus] = "-DFEATURE_webengine_system_opus=ON,-DFEATURE_webengine_system_opus=OFF,libopus"
|
||||
PACKAGECONFIG[libpci] = "-DFEATURE_webengine_system_libpci=ON,-DFEATURE_webengine_system_libpci=OFF,pciutils"
|
||||
PACKAGECONFIG[pepper-plugins] = "-DFEATURE_webengine_pepper_plugins=ON,-DFEATURE_webengine_pepper_plugins=OFF"
|
||||
PACKAGECONFIG[printing-and-pdf] = "-DFEATURE_webengine_printing_and_pdf=ON,-DFEATURE_webengine_printing_and_pdf=OFF"
|
||||
PACKAGECONFIG[proprietary-codecs] = "-DFEATURE_webengine_proprietary_codecs=ON,-DFEATURE_webengine_proprietary_codecs=OFF"
|
||||
PACKAGECONFIG[pulseaudio] = "-DFEATURE_webengine_system_pulseaudio=ON,-DFEATURE_webengine_system_pulseaudio=OFF,pulseaudio"
|
||||
PACKAGECONFIG[re2] = "-DFEATURE_webengine_system_re2=ON,-DFEATURE_webengine_system_re2=OFF,re2"
|
||||
PACKAGECONFIG[snappy] = "-DFEATURE_webengine_system_snappy=ON,-DFEATURE_webengine_system_snappy=OFF,snappy"
|
||||
PACKAGECONFIG[spellchecker] = "-DFEATURE_webengine_spellchecker=ON,-DFEATURE_webengine_spellchecker=OFF"
|
||||
PACKAGECONFIG[webchannel] = "-DFEATURE_webengine_webchannel=ON,-DFEATURE_webengine_webchannel=OFF,qtwebchannel"
|
||||
PACKAGECONFIG[webrtc] = "-DFEATURE_webengine_webrtc=ON,-DFEATURE_webengine_webrtc=OFF,libvpx"
|
||||
PACKAGECONFIG[webrtc-pipewire] = "-DFEATURE_webengine_webrtc_pipewire=ON,-DFEATURE_webengine_webrtc_pipewire=OFF,pipewire glib-2.0"
|
||||
PACKAGECONFIG[zlib] = "-DFEATURE_webengine_system_zlib=ON,-DFEATURE_webengine_system_zlib=OFF,zlib"
|
||||
|
||||
FILES:${PN} += "\
|
||||
${QT6_INSTALL_TRANSLATIONSDIR} \
|
||||
${QT6_INSTALL_DATADIR}/resources \
|
||||
${QT6_INSTALL_LIBEXECDIR}/QtWebEngineProcess \
|
||||
"
|
||||
Loading…
Reference in New Issue
Block a user