5 LICENSE = "Apache-2.0 & BSD-3-Clause & LGPL-2.0-only & LGPL-2.1-only"
8 file://LICENSE;md5=c408a301e3407c3803499ce9290515d6 \
9 file://third_party/blink/renderer/core/LICENSE-LGPL-2;md5=36357ffde2b64ae177b2494445b79d21 \
10 file://third_party/blink/renderer/core/LICENSE-LGPL-2.1;md5=a778a33ef338abbaf8b8a7c36b6eec80 \
13 CHROMIUM_VERSION = "118.0.5993.80"
15 SRCREV = "3cffa575446727e2fe1f6499efa21f8e096e8ca0"
17 PV = "${CHROMIUM_VERSION}.${BRANCH}+git"
19 FILESEXTRAPATHS:prepend := "${THISDIR}/files/cef:"
20 FILESEXTRAPATHS:prepend := "${THISDIR}/files/chromium:"
22 # The [agl]-prefixed patches are the changes needed to make WAM work with
23 # agl-compositor. The [meta-browser] patches comes from the https://github.com/OSSystems/meta-browser
24 # project that does similar work on keeping up to the new chromium milestones
25 # and the [MXX-Fix] patches are the fixes done by us to fix build issues for
26 # the current chromium milestone.
27 # For more information about the current milestones: https://chromiumdash.appspot.com/releases?platform=Linux
29 https://commondatastorage.googleapis.com/chromium-browser-official/chromium-${CHROMIUM_VERSION}.tar.xz \
30 file://0001-agl-compositor-Add-agl_shell_wrapper-AGL-wayland-ext.patch \
31 file://0002-agl-Add-waylandwindow-window-tree-host-essential-par.patch \
32 file://0003-agl-Only-bind-to-agl_shell-if-it-s-the-browser-proce.patch \
33 file://0004-agl-Add-a-method-to-check-if-the-agl-window-is-confi.patch \
34 file://0005-agl-Start-using-agl-shell-version-4.patch \
35 file://0006-agl-Don-t-use-DRI-for-renesas.patch \
36 file://0007-meta-browser-Remove-the-GN-settings-done-for-clang-t.patch \
37 file://0008-meta-browser-Pass-no-static-libstdc-to-gen.py.patch \
38 file://0009-meta-browser-IWYU-Add-includes-for-size_t-and-int64_.patch \
39 file://0010-meta-browser-BUILD-do-not-specify-march-on-arm.patch \
40 file://0011-meta-browser-Avoid-parenthesized-initialization-of-a.patch \
41 file://0012-meta-browser-Fix-constexpr-variable-cannot-have-non-.patch \
42 file://0013-meta-browser-Add-missing-typename-s.patch \
43 file://0014-meta-browser-Avoid-std-ranges-find_if.patch \
44 file://0015-meta-browser-Avoid-capturing-structured-bindings.patch \
45 file://0016-meta-browser-Delete-compiler-options-not-available-i.patch \
46 file://0017-meta-browser-Don-t-pass-disable-auto-upgrade-debug-i.patch \
47 file://0018-meta-browser-Fix-undefined-symbol-PaintOpWriter-Seri.patch \
48 file://0019-upstream-Initialize-ServerCvc-with-designated-initia.patch \
49 file://0020-M118-fix-Don-t-look-for-depot_tools-in-chrommium-s-t.patch \
50 file://0021-M118-fix-Add-multiple-missing-includes.patch \
51 file://0022-M118-fix-Fix-aggregate-initialization-in-trace_log.patch \
52 file://0023-M118-fix-Add-missing-typename-keyword-in-multiple-st.patch \
53 file://0024-M118-fix-Fix-comparison-in-HostResolverCache.patch \
54 file://0025-M118-fix-Avoid-using-std-ranges-any_of-find_if-none_.patch \
55 file://0026-M118-fix-Add-deleted-constructors-operators.patch \
56 file://0027-M118-fix-Initialize-percentages-member-on-blink-Font.patch \
57 file://0028-M118-fix-Don-t-delete-ZstdSourceStream-copy-move-cto.patch \
58 file://0029-M118-fix-Fix-issue-with-structured-bindinds-captured.patch \
59 file://0030-M118-fix-Only-default-arm_use_neon-to-true-if-its-va.patch \
60 file://0031-M118-fix-Add-a-way-to-set-different-lib-paths-host-a.patch \
61 file://0032-M118-fix-zlib-Fix-arm-build.patch \
62 file://0033-M118-fix-Fix-skia-linker-issues-for-arm-neon.patch \
63 file://0034-v8-qemu-wrapper.patch \
65 git://bitbucket.org/chromiumembedded/cef.git;branch=${BRANCH};protocol=https;rev=${SRCREV};name=cef;destsuffix=chromium-${CHROMIUM_VERSION}/cef \
66 file://0001-Add-an-option-to-use-an-output-directory-outside-src.patch;patchdir=cef \
67 file://0002-Add-an-option-to-override-the-default-distrib-direct.patch;patchdir=cef \
68 file://0003-Add-an-option-to-use-an-alternative-base-output-dire.patch;patchdir=cef \
69 file://0004-Add-an-option-to-bypass-sysroot-checking-and-force.patch;patchdir=cef \
70 file://0005-Add-AGL-wayland-window-related-calls.patch;patchdir=cef \
71 file://0006-Add-a-method-to-check-if-the-agl-window-is-configure.patch;patchdir=cef \
72 file://0007-Add-the-SetActivateRegion-method.patch;patchdir=cef \
73 file://0008-Allow-passing-the-app_id-on-widget-creation.patch;patchdir=cef \
74 file://0009-Update-generated-api.patch;patchdir=cef \
75 file://0010-Make-patcher-work-outside-a-git-checkout.patch;patchdir=cef \
76 file://0011-Avoid-the-RuntimeError-dictionary-changed-size-durin.patch;patchdir=cef \
79 SRC_URI[sha256sum] = "741c5528a151bc364999969077a13d7a283cfd0eaf34adf47de667a34e5e58ff"
81 CHROMIUM_DIR = "${WORKDIR}/chromium-${CHROMIUM_VERSION}"
82 CEF_DIR = "${CHROMIUM_DIR}/cef"
83 DEPOT_TOOLS_DIR="${STAGING_DIR_NATIVE}${datadir}/depot_tools"
85 B = "${WORKDIR}/build"
87 OUT_PATH = "${B}/out/Release_GN_${GN_TARGET_ARCH_NAME}"
88 DIST_PATH = "${OUT_PATH}/dist/cef-minimal_${GN_TARGET_ARCH_NAME}"
89 CEF_DATA_PATH = "${datadir}/cef"
91 DEPENDS:append = " curl clang clang-native gperf-native gn-native dbus libcxx libcxx-native libpng libxslt jpeg compiler-rt libxkbcommon nss nss-native atk at-spi2-atk libdrm pango cairo virtual/egl qemu-native pciutils glib-2.0 pkgconfig-native pulseaudio xz-native compiler-rt compiler-rt-native"
93 do_sync[depends] += "depot-tools-wam-native:do_populate_sysroot"
94 do_configure[depends] += "depot-tools-wam-native:do_populate_sysroot"
95 do_compile[depends] += "depot-tools-wam-native:do_populate_sysroot"
97 GN_UNBUNDLE_LIBS = " libjpeg libpng libxslt"
99 # gn defaults from CEF wiki, except for use_sysroot
100 GN_DEFINES = "use_sysroot=false \
106 # Disable GTK and prevent cef from
107 # building its gtk demos
108 GN_DEFINES:append = " \
113 GN_DEFINES:append = " \
114 treat_warnings_as_errors=false \
115 is_component_build=false \
120 use_wayland_gbm=true \
121 use_gnome_keyring=false \
122 enable_remoting=false \
123 enable_js_type_check=false \
127 GN_DEFINES:append = " \
129 ozone_auto_platforms=false \
130 ozone_platform_headless=true \
131 ozone_platform_wayland=true \
132 ozone_platform_x11=false \
133 use_system_minigbm=true \
134 use_system_libdrm=true \
135 use_system_libwayland=false \
136 use_system_libffi=true \
139 GN_DEFINES:append = " \
140 dcheck_always_on=false \
142 is_official_build=true \
145 GN_DEFINES:append = " \
153 TOOLCHAIN:class-native = "clang"
154 LIBCPLUSPLUS = "-stdlib=libc++"
156 BUILD_CPPFLAGS:append:runtime-llvm = " -isysroot=${STAGING_DIR_NATIVE} -stdlib=libc++"
157 BUILD_LDFLAGS:append:runtime-llvm = " -rtlib=libgcc -unwindlib=libgcc -stdlib=libc++ -lc++abi -rpath ${STAGING_LIBDIR_NATIVE}"
158 CXXFLAGS:append:runtime-llvm = " -isysroot=${STAGING_DIR_NATIVE} -stdlib=libc++"
160 BUILD_AR:toolchain-clang = "llvm-ar"
161 BUILD_CC:toolchain-clang = "clang"
162 BUILD_CXX:toolchain-clang = "clang++"
163 BUILD_LD:toolchain-clang = "clang"
165 COMPATIBLE_MACHINE = "(-)"
166 COMPATIBLE_MACHINE:aarch64 = "(.*)"
167 COMPATIBLE_MACHINE:armv6 = "(.*)"
168 COMPATIBLE_MACHINE:armv7a = "(.*)"
169 COMPATIBLE_MACHINE:armv7ve = "(.*)"
170 COMPATIBLE_MACHINE:x86 = "(.*)"
171 COMPATIBLE_MACHINE:x86-64 = "(.*)"
173 # ARM builds need special additional flags (see ${S}/build/config/arm.gni).
174 # If we do not pass |arm_arch| and friends to GN, it will deduce a value that
175 # will then conflict with TUNE_CCARGS and CC.
176 # Note that as of M61 in some corner cases parts of the build system disable
177 # the "compiler_arm_fpu" GN config, whereas -mfpu is always passed via ${CC}.
178 # We might want to rework that if there are issues in the future.
179 def get_compiler_flag(params, param_name, d):
180 """Given a sequence of compiler arguments in |params|, returns the value of
181 an option |param_name| or an empty string if the option is not present."""
183 if param.startswith(param_name):
184 return param.split('=')[1]
187 ARM_FLOAT_ABI = "${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', 'hard', 'softfp', d)}"
188 ARM_FPU = "${@get_compiler_flag(d.getVar('TUNE_CCARGS').split(), '-mfpu', d)}"
189 ARM_TUNE = "${@get_compiler_flag(d.getVar('TUNE_CCARGS').split(), '-mcpu', d)}"
190 ARM_VERSION:aarch64 = "8"
191 ARM_VERSION:armv7a = "7"
192 ARM_VERSION:armv7ve = "7"
193 ARM_VERSION:armv6 = "6"
195 # GN computes and defaults to it automatically where needed
196 # forcing it from cmdline breaks build on places where it ends up
197 # overriding what GN wants
198 TUNE_CCARGS:remove = "-mthumb"
200 GN_DEFINES:append:arm = " \
201 arm_float_abi=\"${ARM_FLOAT_ABI}\" \
202 arm_fpu=\"${ARM_FPU}\" \
203 arm_tune=\"${ARM_TUNE}\" \
204 arm_version=${ARM_VERSION} \
206 # tcmalloc's atomicops-internals-arm-v6plus.h uses the "dmb" instruction that
207 # is not available on (some?) ARMv6 models, which causes the build to fail.
208 GN_DEFINES:append:armv6 = ' use_allocator="none"'
209 # The WebRTC code fails to build on ARMv6 when NEON is enabled.
210 # https://bugs.chromium.org/p/webrtc/issues/detail?id=6574
212 # Disable unknown attribute warnings that are generating tons of logs
213 # TODO(rzanoni): check if https://chromium-review.googlesource.com/c/chromium/src/+/4322480
214 # needs to be reverted
215 BUILD_CXXFLAGS:remove = '-Wunknown-attributes'
216 BUILD_CXXFLAGS:append = ' -Wno-unknown-attributes'
217 BUILD_CPPFLAGS:remove = '-Wunknown-attributes'
218 BUILD_CPPFLAGS:append = ' -Wno-unknown-attributes'
219 CXXFLAGS:remove = '-Wunknown-attributes'
220 CXXFLAGS:append = ' -Wno-unknown-attributes'
221 CPPFLAGS:remove = '-Wunknown-attributes'
222 CPPFLAGS:append = ' -Wno-unknown-attributes'
224 GN_DEFINES:append = ' \
228 use_custom_libcxx_for_host=false \
229 use_custom_libcxx=false \
234 clang_use_chrome_plugins=false \
235 clang_base_path="${STAGING_DIR_NATIVE}/usr" \
236 clang_version="14.0.6" \
237 clang_base_path_target="${STAGING_DIR_TARGET}/usr" \
238 custom_toolchain="//build/toolchain/cros:target" \
239 host_toolchain="//build/toolchain/cros:host" \
240 v8_snapshot_toolchain="//build/toolchain/cros:v8_snapshot" \
241 target_cpu="${@gn_target_arch_name(d)}" \
242 use_v8_context_snapshot=false \
243 custom_toolchain="//build/toolchain/yocto:yocto_target" \
244 host_toolchain="//build/toolchain/yocto:yocto_native" \
245 v8_snapshot_toolchain="//build/toolchain/yocto:yocto_target" \
248 PACKAGECONFIG ??= "upower use-egl"
249 PACKAGECONFIG[use-egl] = ",,virtual/egl virtual/libgles2"
250 PACKAGECONFIG[upower] = ",,,upower"
252 GN_DEFINES:append = ' \
253 ${PACKAGECONFIG_CONFARGS} \
256 python do_write_toolchain_file () {
257 """Writes a BUILD.gn file for Yocto detailing its toolchains."""
258 toolchain_dir = d.expand("${S}/build/toolchain/yocto")
259 bb.utils.mkdirhier(toolchain_dir)
260 toolchain_file = os.path.join(toolchain_dir, "BUILD.gn")
261 write_toolchain_file(d, toolchain_file)
263 addtask write_toolchain_file after do_patch before do_configure
265 # V8's JIT infrastructure requires binaries such as mksnapshot and
266 # mkpeephole to be run in the host during the build. However, these
267 # binaries must have the same bit-width as the target (e.g. a x86_64
268 # host targeting ARMv6 needs to produce a 32-bit binary). Instead of
269 # depending on a third Yocto toolchain, we just build those binaries
270 # for the target and run them on the host with QEMU.
271 python do_create_v8_qemu_wrapper () {
272 """Creates a small wrapper that invokes QEMU to run some target V8 binaries
274 qemu_libdirs = [d.expand('${STAGING_DIR_HOST}${libdir}'),
275 d.expand('${STAGING_DIR_HOST}${base_libdir}')]
276 qemu_cmd = qemu_wrapper_cmdline(d, d.getVar('STAGING_DIR_HOST', True),
278 wrapper_path = d.expand('${OUT_PATH}/v8-qemu-wrapper.sh')
279 with open(wrapper_path, 'w') as wrapper_file:
280 wrapper_file.write("""#!/bin/sh
282 # This file has been generated automatically.
283 # It invokes QEMU to run binaries built for the target in the host during the
288 os.chmod(wrapper_path, 0o755)
290 do_create_v8_qemu_wrapper[dirs] = "${OUT_PATH}"
291 addtask create_v8_qemu_wrapper after do_patch before do_configure
294 bbnote "do_configure:"
295 bbnote "Base out path: ${B}"
297 export DEPOT_TOOLS_UPDATE=0
299 export PATH="${DEPOT_TOOLS_DIR}:$PATH"
300 export GN_DEFINES="${GN_DEFINES}"
303 python3 ./build/linux/unbundle/replace_gn_files.py --system-libraries ${GN_UNBUNDLE_LIBS}
305 # Download a few dependencies. Check the current chromium DEPS file when
306 # upgrading to a new milestone.
307 python3 third_party/depot_tools/download_from_google_storage.py --no_resume --extract --no_auth --bucket chromium-fonts -s third_party/test_fonts/test_fonts.tar.gz.sha1
308 python3 third_party/depot_tools/download_from_google_storage.py --no_resume --extract --no_auth --bucket chromium-nodejs/16.13.0 -s third_party/node/linux/node-linux-x64.tar.gz.sha1
309 python3 tools/rust/update_rust.py
312 python3 tools/gclient_hook.py --base-out-path ${B} --bypass-sysroot-check
315 do_compile[progress] = "outof:^\[(\d+)/(\d+)\]\s+"
317 if [ ! -f ${OUT_PATH}/build.ninja ]; then
321 export PATH="${DEPOT_TOOLS_DIR}:$PATH"
322 export PATH="$PATH:${S}/third_party/ninja"
323 ninja ${PARALLEL_MAKE} -C ${OUT_PATH} libcef chrome_sandbox
328 python3 tools/make_distrib.py --output-dir ${OUT_PATH}/dist \
329 --dist-path-name cef-minimal \
330 --base-out-path ${B} \
336 --${GN_TARGET_ARCH_NAME}-build \
339 install -d ${D}${CEF_DATA_PATH}
341 cp -R --no-dereference --preserve=mode,links -v ${DIST_PATH}/* ${D}${CEF_DATA_PATH}
342 # TODO(rzanoni): Follow the wiki instructions to install the sandbox
345 # TODO: fix QA issues, libraries in the wrong location
350 INSANE_SKIP:${PN} += "libdir"
352 PROVIDES:${PN} += "cef"