Gentoo Archives: gentoo-commits

From: Stephan Hartmann <sultan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-client/chromium/files/, www-client/chromium/
Date: Sun, 30 Jan 2022 08:37:50
Message-Id: 1643531855.c65f1fb18943313a621d8cce43d0a68ebf65d2f4.sultan@gentoo
1 commit: c65f1fb18943313a621d8cce43d0a68ebf65d2f4
2 Author: Stephan Hartmann <sultan <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jan 30 08:36:59 2022 +0000
4 Commit: Stephan Hartmann <sultan <AT> gentoo <DOT> org>
5 CommitDate: Sun Jan 30 08:37:35 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c65f1fb1
7
8 www-client/chromium: dev channel bump to 99.0.4844.11
9
10 - improve headless builds
11 - fix cross compiling
12 - remove CHROMIUM_FORCE_LIBCXX and add USE=libcxx instead
13 - allow building with GTK4
14
15 Bug: https://bugs.gentoo.org/786597
16 Bug: https://bugs.gentoo.org/828442
17 Package-Manager: Portage-3.0.28, Repoman-3.0.3
18 Signed-off-by: Stephan Hartmann <sultan <AT> gentoo.org>
19
20 www-client/chromium/Manifest | 4 +-
21 ....4840.0.ebuild => chromium-99.0.4844.11.ebuild} | 242 +++++++++++++--------
22 .../chromium/files/chromium-cross-compile.patch | 12 +
23 www-client/chromium/metadata.xml | 2 +
24 4 files changed, 162 insertions(+), 98 deletions(-)
25
26 diff --git a/www-client/chromium/Manifest b/www-client/chromium/Manifest
27 index 1a157501d7c6..3bcb68c6ac93 100644
28 --- a/www-client/chromium/Manifest
29 +++ b/www-client/chromium/Manifest
30 @@ -2,5 +2,5 @@ DIST chromium-97-patchset-4.tar.xz 4240 BLAKE2B 450d013b6fd68f7e0bcb21a2b0828d53
31 DIST chromium-97.0.4692.99.tar.xz 1213731872 BLAKE2B e7fdf30f562fe6d50615b8213e762825d3b346c9c87e3512c957cc68dc75bf31b551b262f72801a3b0b51f2ff5ee31939dc7d4b2c2f005a4aaaec1c37983909d SHA512 928684286b5bbc15b0e60bdf3b1eb5d644f31d13baa0b55c652b9e302f48776fac367af99d89b85ff8258455551846f7efb4f11772b182aa743c6beff844e7d5
32 DIST chromium-98-patchset-5.tar.xz 4928 BLAKE2B f96fb34d5cb3c3ac2c6e327805322e5d6047b0b190a043795de1063c934ca6400800aafaaa4eea7ebad571298b96bf67e48ee0d2d1eb3e0bf23b14932734e026 SHA512 fae1010b91af7e6aa981ea22fc15c32a510b3e78ab71fec73b65290d963dfe6c42e5a2965446803519356858b60cd587018b1b2aea36e112e4d315efbdad7d8f
33 DIST chromium-98.0.4758.74.tar.xz 1242612520 BLAKE2B ed4beb62e04254508d2d8ebd35c69308f403954bd082cd8dce0f23c5f36df155193c96d3204d8cf9a4d8767ca5a692a32a199d30ada6363865b000f86650332f SHA512 dd9ba829d4d8e28299f84eeaffa8f94d30cdc3daa7709938886a31e67fcb6a458bfcb68be69b31a92872e028b76a88421a1a1e02cd44c7d78ed7e4fc4da18e45
34 -DIST chromium-99-patchset-2.tar.xz 4264 BLAKE2B 3c81029085931df7db5724845a9a1ef17fd19e1964cdb53f78cf0b8c3765ff81f97ccea344e4db853f780c14e18b6bf1839f0ef142906042385bfcde01364ab8 SHA512 14eef917ecab7668072834aac277d2faf32e9c2ca85268a7591b94ff69e9df331c0114da1ebcb92a332f8ad066eeaebd841a937e80198baf4649065b677cc2c3
35 -DIST chromium-99.0.4840.0.tar.xz 1315491932 BLAKE2B 7c01c962e604c8147d446cf0e9fd86538b7112d93a535ffdfd2a938462f0e9edf51c12bf01b068ff0d64776726bbfb04991fbfa0dcfedd428e7ee79610534559 SHA512 79f9b2e8f7e56ae0bcc49d1f5b7dc306d167dfc6b2652874b6f4fc795d63c6f4dc3bb74545ba586e57ba5e0a5f350eaf8ac1202953d9ed2f94b71198f494c907
36 +DIST chromium-99-patchset-3.tar.xz 3912 BLAKE2B 79030156e81ebd6b3c348fb429e23d0c866059e047e7cdc0f656a1b1ee290f3afa8b358d0e1df18a86616a35a9a256e7432a5ab4e9b952c7a360aed871236659 SHA512 63d951cb3d17c1d02d9ddbee3a44aca000c5ba2f908012584944ce7fc435aebfe39b9628d4bd043df97c4dd7afa0ad614c65368ca759b64a84654126f06f9ea8
37 +DIST chromium-99.0.4844.11.tar.xz 1315744804 BLAKE2B f91dfdca603d789dbc34eeb563868f7ae20a2946b2978db7455b3b9f332fd2a8a59f3aa408dd99f77b13074b47a9992fc2aea029116b3363156f76e306efdb69 SHA512 eb353fe470abffb8f99a4aa8b86991b43678786f8b0c456c676ebe000653ba938384cc135438f5bee9f39e236908b1acef6e12fa2b13880b69177b0f271fdec4
38
39 diff --git a/www-client/chromium/chromium-99.0.4840.0.ebuild b/www-client/chromium/chromium-99.0.4844.11.ebuild
40 similarity index 85%
41 rename from www-client/chromium/chromium-99.0.4840.0.ebuild
42 rename to www-client/chromium/chromium-99.0.4844.11.ebuild
43 index 539cfcc65eb4..ce883356d49c 100644
44 --- a/www-client/chromium/chromium-99.0.4840.0.ebuild
45 +++ b/www-client/chromium/chromium-99.0.4844.11.ebuild
46 @@ -13,7 +13,7 @@ inherit check-reqs chromium-2 desktop flag-o-matic ninja-utils pax-utils python-
47
48 DESCRIPTION="Open-source version of Google Chrome web browser"
49 HOMEPAGE="https://chromium.org/"
50 -PATCHSET="2"
51 +PATCHSET="3"
52 PATCHSET_NAME="chromium-$(ver_cut 1)-patchset-${PATCHSET}"
53 SRC_URI="https://commondatastorage.googleapis.com/chromium-browser-official/${P}.tar.xz
54 https://github.com/stha09/chromium-patches/releases/download/${PATCHSET_NAME}/${PATCHSET_NAME}.tar.xz"
55 @@ -21,44 +21,64 @@ SRC_URI="https://commondatastorage.googleapis.com/chromium-browser-official/${P}
56 LICENSE="BSD"
57 SLOT="0/dev"
58 KEYWORDS="~amd64 ~arm64 ~x86"
59 -IUSE="component-build cups cpu_flags_arm_neon debug +hangouts headless +js-type-check kerberos +official pic +proprietary-codecs pulseaudio screencast selinux +suid +system-ffmpeg +system-harfbuzz +system-icu +system-png vaapi wayland widevine"
60 +IUSE="component-build cups cpu_flags_arm_neon debug gtk4 +hangouts headless +js-type-check kerberos libcxx +official pic +proprietary-codecs pulseaudio screencast selinux +suid +system-ffmpeg +system-harfbuzz +system-icu +system-png vaapi wayland widevine"
61 REQUIRED_USE="
62 - component-build? ( !suid )
63 + component-build? ( !suid !libcxx )
64 screencast? ( wayland )
65 "
66
67 COMMON_X_DEPEND="
68 - media-libs/mesa:=[gbm(+)]
69 - x11-libs/libX11:=
70 + x11-libs/gdk-pixbuf:2
71 x11-libs/libXcomposite:=
72 x11-libs/libXcursor:=
73 x11-libs/libXdamage:=
74 - x11-libs/libXext:=
75 x11-libs/libXfixes:=
76 >=x11-libs/libXi-1.6.0:=
77 x11-libs/libXrandr:=
78 x11-libs/libXrender:=
79 x11-libs/libXtst:=
80 - x11-libs/libxcb:=
81 x11-libs/libxshmfence:=
82 - vaapi? ( >=x11-libs/libva-2.7:=[X,drm] )
83 + virtual/opengl
84 "
85
86 -COMMON_DEPEND="
87 - app-arch/bzip2:=
88 - cups? ( >=net-print/cups-1.3.11:= )
89 - dev-libs/expat:=
90 - dev-libs/glib:2
91 +COMMON_SNAPSHOT_DEPEND="
92 + system-icu? ( >=dev-libs/icu-69.1:= )
93 >=dev-libs/libxml2-2.9.4-r3:=[icu]
94 dev-libs/nspr:=
95 >=dev-libs/nss-3.26:=
96 - >=media-libs/alsa-lib-1.0.19:=
97 + !libcxx? ( >=dev-libs/re2-0.2019.08.01:= )
98 + dev-libs/libxslt:=
99 media-libs/fontconfig:=
100 >=media-libs/freetype-2.11.0-r1:=
101 system-harfbuzz? ( >=media-libs/harfbuzz-3:0=[icu(-)] )
102 media-libs/libjpeg-turbo:=
103 system-png? ( media-libs/libpng:=[-apng] )
104 - pulseaudio? ( media-sound/pulseaudio:= )
105 + >=media-libs/libwebp-0.4.0:=
106 + media-libs/mesa:=[gbm(+)]
107 + >=media-libs/openh264-1.6.0:=
108 + sys-libs/zlib:=
109 + x11-libs/libdrm:=
110 + !headless? (
111 + dev-libs/glib:2
112 + >=media-libs/alsa-lib-1.0.19:=
113 + pulseaudio? ( media-sound/pulseaudio:= )
114 + kerberos? ( virtual/krb5 )
115 + vaapi? ( >=x11-libs/libva-2.7:=[X,drm] )
116 + x11-libs/libX11:=
117 + x11-libs/libXext:=
118 + x11-libs/libxcb:=
119 + x11-libs/libxkbcommon:=
120 + wayland? (
121 + dev-libs/wayland:=
122 + screencast? ( media-video/pipewire:= )
123 + )
124 + )
125 +"
126 +
127 +COMMON_DEPEND="
128 + ${COMMON_SNAPSHOT_DEPEND}
129 + app-arch/bzip2:=
130 + dev-libs/expat:=
131 system-ffmpeg? (
132 >=media-video/ffmpeg-4.3:=
133 || (
134 @@ -69,45 +89,46 @@ COMMON_DEPEND="
135 )
136 net-misc/curl[ssl]
137 sys-apps/dbus:=
138 - sys-apps/pciutils:=
139 - virtual/udev
140 - x11-libs/cairo:=
141 - x11-libs/gdk-pixbuf:2
142 - x11-libs/libxkbcommon:=
143 - x11-libs/pango:=
144 media-libs/flac:=
145 - >=media-libs/libwebp-0.4.0:=
146 sys-libs/zlib:=[minizip]
147 - kerberos? ( virtual/krb5 )
148 !headless? (
149 ${COMMON_X_DEPEND}
150 >=app-accessibility/at-spi2-atk-2.26:2
151 >=app-accessibility/at-spi2-core-2.26:2
152 >=dev-libs/atk-2.26
153 - x11-libs/gtk+:3[X]
154 - wayland? (
155 - dev-libs/wayland:=
156 - screencast? ( media-video/pipewire:= )
157 - x11-libs/gtk+:3[wayland,X]
158 - x11-libs/libdrm:=
159 - )
160 + cups? ( >=net-print/cups-1.3.11:= )
161 + sys-apps/pciutils:=
162 + virtual/udev
163 + x11-libs/cairo:=
164 + x11-libs/pango:=
165 )
166 "
167 RDEPEND="${COMMON_DEPEND}
168 + !headless? (
169 + || (
170 + x11-libs/gtk+:3[X,wayland?]
171 + gui-libs/gtk:4[X,wayland?]
172 + )
173 + )
174 x11-misc/xdg-utils
175 - virtual/opengl
176 virtual/ttf-fonts
177 selinux? ( sec-policy/selinux-chromium )
178 "
179 DEPEND="${COMMON_DEPEND}
180 + !headless? (
181 + gtk4? ( gui-libs/gtk:4[X,wayland?] )
182 + !gtk4? ( x11-libs/gtk+:3[X,wayland?] )
183 + )
184 "
185 # dev-vcs/git - https://bugs.gentoo.org/593476
186 BDEPEND="
187 + ${COMMON_SNAPSHOT_DEPEND}
188 ${PYTHON_DEPS}
189 $(python_gen_any_dep '
190 dev-python/setuptools[${PYTHON_USEDEP}]
191 ')
192 >=app-arch/gzip-1.7
193 + libcxx? ( >=sys-devel/clang-12 )
194 dev-lang/perl
195 >=dev-util/gn-0.1807
196 dev-vcs/git
197 @@ -122,26 +143,11 @@ BDEPEND="
198
199 # These are intended for ebuild maintainer use to force clang if GCC is broken.
200 : ${CHROMIUM_FORCE_CLANG=no}
201 -: ${CHROMIUM_FORCE_LIBCXX=no}
202
203 if [[ ${CHROMIUM_FORCE_CLANG} == yes ]]; then
204 BDEPEND+=" >=sys-devel/clang-12"
205 fi
206
207 -if [[ ${CHROMIUM_FORCE_LIBCXX} == yes ]]; then
208 - RDEPEND+=" >=sys-libs/libcxx-12"
209 - DEPEND+=" >=sys-libs/libcxx-12"
210 -else
211 - COMMON_DEPEND="
212 - dev-libs/libxslt:=
213 - >=dev-libs/re2-0.2019.08.01:=
214 - >=media-libs/openh264-1.6.0:=
215 - system-icu? ( >=dev-libs/icu-69.1:= )
216 - "
217 - RDEPEND+="${COMMON_DEPEND}"
218 - DEPEND+="${COMMON_DEPEND}"
219 -fi
220 -
221 if ! has chromium_pkg_die ${EBUILD_DEATH_HOOKS}; then
222 EBUILD_DEATH_HOOKS+=" chromium_pkg_die";
223 fi
224 @@ -185,8 +191,9 @@ pre_build_checks() {
225 if tc-is-gcc && ! ver_test "$(gcc-version)" -ge 9.2; then
226 die "At least gcc 9.2 is required"
227 fi
228 - if [[ ${CHROMIUM_FORCE_CLANG} == yes ]] || tc-is-clang; then
229 - CPP="${CHOST}-clang++ -E"
230 + if [[ ${CHROMIUM_FORCE_CLANG} == yes ]] || tc-is-clang || use libcxx; then
231 + tc-is-cross-compiler && CPP=${CBUILD}-clang++ || CPP=${CHOST}-clang++
232 + CPP+=" -E"
233 if ! ver_test "$(clang-major-version)" -ge 12; then
234 die "At least clang 12 is required"
235 fi
236 @@ -196,6 +203,7 @@ pre_build_checks() {
237 # Check build requirements, bug #541816 and bug #471810 .
238 CHECKREQS_MEMORY="4G"
239 CHECKREQS_DISK_BUILD="9G"
240 + tc-is-cross-compiler && CHECKREQS_DISK_BUILD="12G"
241 if ( shopt -s extglob; is-flagq '-g?(gdb)?([1-9])' ); then
242 if use custom-cflags || use component-build; then
243 CHECKREQS_DISK_BUILD="25G"
244 @@ -209,6 +217,13 @@ pre_build_checks() {
245
246 pkg_pretend() {
247 pre_build_checks
248 +
249 + if use headless; then
250 + local headless_unused_flags=("cups" "kerberos" "pulseaudio" "vaapi" "wayland")
251 + for myiuse in ${headless_unused_flags[@]}; do
252 + use ${myiuse} && ewarn "Ignoring USE=${myiuse} since USE=headless is set."
253 + done
254 + fi
255 }
256
257 pkg_setup() {
258 @@ -236,6 +251,7 @@ src_prepare() {
259 "${FILESDIR}/chromium-glibc-2.34-r1.patch"
260 "${FILESDIR}/chromium-use-oauth2-client-switches-as-default.patch"
261 "${FILESDIR}/chromium-shim_headers.patch"
262 + "${FILESDIR}/chromium-cross-compile.patch"
263 )
264
265 default
266 @@ -492,6 +508,9 @@ src_prepare() {
267 if ! use system-png; then
268 keeplibs+=( third_party/libpng )
269 fi
270 + if use libcxx; then
271 + keeplibs+=( third_party/re2 )
272 + fi
273 if use system-harfbuzz; then
274 keeplibs+=( third_party/harfbuzz-ng/utils )
275 else
276 @@ -500,15 +519,6 @@ src_prepare() {
277 if use wayland && ! use headless ; then
278 keeplibs+=( third_party/wayland )
279 fi
280 - if [[ ${CHROMIUM_FORCE_LIBCXX} == yes ]]; then
281 - keeplibs+=( third_party/libxml )
282 - keeplibs+=( third_party/libxslt )
283 - keeplibs+=( third_party/openh264 )
284 - keeplibs+=( third_party/re2 )
285 - if use system-icu; then
286 - keeplibs+=( third_party/icu )
287 - fi
288 - fi
289 if use arm64 || use ppc64 ; then
290 keeplibs+=( third_party/swiftshader/third_party/llvm-10.0 )
291 fi
292 @@ -542,19 +552,23 @@ src_configure() {
293 # Make sure the build system will use the right tools, bug #340795.
294 tc-export AR CC CXX NM
295
296 - if [[ ${CHROMIUM_FORCE_CLANG} == yes ]] && ! tc-is-clang; then
297 - # Force clang since gcc is pretty broken at the moment.
298 - CC=${CHOST}-clang
299 - CXX=${CHOST}-clang++
300 + if { [[ ${CHROMIUM_FORCE_CLANG} == yes ]] || use libcxx; } && ! tc-is-clang; then
301 + # Force clang since gcc is either broken or build is using libcxx.
302 + if tc-is-cross-compiler; then
303 + CC="${CBUILD}-clang -target ${CHOST} --sysroot ${ESYSROOT}"
304 + CXX="${CBUILD}-clang++ -target ${CHOST} --sysroot ${ESYSROOT}"
305 + BUILD_CC=${CBUILD}-clang
306 + BUILD_CXX=${CBUILD}-clang++
307 + else
308 + CC=${CHOST}-clang
309 + CXX=${CHOST}-clang++
310 + fi
311 strip-unsupported-flags
312 fi
313
314 - if tc-is-clang; then
315 + if tc-is-clang || use libcxx; then
316 myconf_gn+=" is_clang=true clang_use_chrome_plugins=false"
317 else
318 - if [[ ${CHROMIUM_FORCE_LIBCXX} == yes ]]; then
319 - die "Compiling with sys-libs/libcxx requires clang."
320 - fi
321 myconf_gn+=" is_clang=false"
322 fi
323
324 @@ -565,6 +579,18 @@ src_configure() {
325 tc-export BUILD_{AR,CC,CXX,NM}
326 myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:host\""
327 myconf_gn+=" v8_snapshot_toolchain=\"//build/toolchain/linux/unbundle:host\""
328 + myconf_gn+=" pkg_config=\"$(tc-get_PKG_CONFIG)\""
329 + myconf_gn+=" host_pkg_config=\"$(tc-getBUILD_PKG_CONFIG)\""
330 +
331 + # setup cups-config, build system only uses --libs option
332 + if use cups; then
333 + mkdir "${T}/cups-config" || die
334 + cp "${ESYSROOT}/usr/bin/${CHOST}-cups-config" "${T}/cups-config/cups-config" || die
335 + export PATH="${PATH}:${T}/cups-config"
336 + fi
337 +
338 + # Don't inherit PKG_CONFIG_PATH from environment
339 + local -x PKG_CONFIG_PATH=
340 else
341 myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:default\""
342 fi
343 @@ -600,6 +626,9 @@ src_configure() {
344 libdrm
345 libjpeg
346 libwebp
347 + libxml
348 + libxslt
349 + openh264
350 zlib
351 )
352 if use system-ffmpeg; then
353 @@ -611,11 +640,8 @@ src_configure() {
354 if use system-png; then
355 gn_system_libraries+=( libpng )
356 fi
357 - if [[ ${CHROMIUM_FORCE_LIBCXX} != yes ]]; then
358 - # unbundle only without libc++, because libc++ is not fully ABI compatible with libstdc++
359 - gn_system_libraries+=( libxml )
360 - gn_system_libraries+=( libxslt )
361 - gn_system_libraries+=( openh264 )
362 + # re2 library interface relies on std::string and std::vector
363 + if ! use libcxx; then
364 gn_system_libraries+=( re2 )
365 fi
366 build/linux/unbundle/replace_gn_files.py --system-libraries "${gn_system_libraries[@]}" || die
367 @@ -630,11 +656,21 @@ src_configure() {
368 myconf_gn+=" enable_js_type_check=$(usex js-type-check true false)"
369 myconf_gn+=" enable_hangout_services_extension=$(usex hangouts true false)"
370 myconf_gn+=" enable_widevine=$(usex widevine true false)"
371 - myconf_gn+=" use_cups=$(usex cups true false)"
372 - myconf_gn+=" use_kerberos=$(usex kerberos true false)"
373 - myconf_gn+=" use_pulseaudio=$(usex pulseaudio true false)"
374 - myconf_gn+=" use_vaapi=$(usex vaapi true false)"
375 - myconf_gn+=" rtc_use_pipewire=$(usex screencast true false)"
376 +
377 + if use headless; then
378 + myconf_gn+=" use_cups=false"
379 + myconf_gn+=" use_kerberos=false"
380 + myconf_gn+=" use_pulseaudio=false"
381 + myconf_gn+=" use_vaapi=false"
382 + myconf_gn+=" rtc_use_pipewire=false"
383 + else
384 + myconf_gn+=" use_cups=$(usex cups true false)"
385 + myconf_gn+=" use_kerberos=$(usex kerberos true false)"
386 + myconf_gn+=" use_pulseaudio=$(usex pulseaudio true false)"
387 + myconf_gn+=" use_vaapi=$(usex vaapi true false)"
388 + myconf_gn+=" rtc_use_pipewire=$(usex screencast true false)"
389 + myconf_gn+=" gtk_version=$(usex gtk4 4 3)"
390 + fi
391
392 # TODO: link_pulseaudio=true for GN.
393
394 @@ -643,7 +679,8 @@ src_configure() {
395 # Never use bundled gold binary. Disable gold linker flags for now.
396 # Do not use bundled clang.
397 # Trying to use gold results in linker crash.
398 - myconf_gn+=" use_gold=false use_sysroot=false use_custom_libcxx=false"
399 + myconf_gn+=" use_gold=false use_sysroot=false"
400 + myconf_gn+=" use_custom_libcxx=$(usex libcxx true false)"
401
402 # Disable forced lld, bug 641556
403 myconf_gn+=" use_lld=false"
404 @@ -688,11 +725,6 @@ src_configure() {
405 fi
406 fi
407
408 - if [[ ${CHROMIUM_FORCE_LIBCXX} == yes ]]; then
409 - append-flags -stdlib=libc++
410 - append-ldflags -stdlib=libc++
411 - fi
412 -
413 if [[ $myarch = amd64 ]] ; then
414 myconf_gn+=" target_cpu=\"x64\""
415 ffmpeg_target_arch=x64
416 @@ -749,10 +781,16 @@ src_configure() {
417 fi
418
419 # Disable unknown warning message from clang.
420 - tc-is-clang && append-flags -Wno-unknown-warning-option
421 + if tc-is-clang; then
422 + append-flags -Wno-unknown-warning-option
423 + if tc-is-cross-compiler; then
424 + export BUILD_CXXFLAGS+=" -Wno-unknown-warning-option"
425 + export BUILD_CFLAGS+=" -Wno-unknown-warning-option"
426 + fi
427 + fi
428
429 - # Explicitly disable ICU data file support for system-icu builds.
430 - if use system-icu; then
431 + # Explicitly disable ICU data file support for system-icu/headless builds.
432 + if use system-icu || use headless; then
433 myconf_gn+=" icu_use_data_file=false"
434 fi
435
436 @@ -763,7 +801,12 @@ src_configure() {
437 if use wayland || use headless; then
438 if use headless; then
439 myconf_gn+=" ozone_platform=\"headless\""
440 - myconf_gn+=" use_x11=false"
441 + myconf_gn+=" use_xkbcommon=false use_gtk=false"
442 + myconf_gn+=" use_glib=false use_gio=false"
443 + myconf_gn+=" use_pangocairo=false use_alsa=false"
444 + myconf_gn+=" use_libpci=false use_udev=false"
445 + myconf_gn+=" enable_print_preview=false"
446 + myconf_gn+=" enable_remoting=false"
447 else
448 myconf_gn+=" ozone_platform_wayland=true"
449 myconf_gn+=" use_system_libdrm=true"
450 @@ -897,7 +940,7 @@ src_install() {
451 [[ ${#files[@]} -gt 0 ]] && doins "${files[@]}"
452 )
453
454 - if ! use system-icu; then
455 + if ! use system-icu && ! use headless; then
456 doins out/Release/icudtl.dat
457 fi
458
459 @@ -947,15 +990,22 @@ pkg_postinst() {
460 xdg_desktop_database_update
461 readme.gentoo_print_elog
462
463 - if use vaapi; then
464 - elog "VA-API is disabled by default at runtime. You have to enable it"
465 - elog "by adding --enable-features=VaapiVideoDecoder to CHROMIUM_FLAGS"
466 - elog "in /etc/chromium/default."
467 - fi
468 - if use screencast; then
469 - elog "Screencast is disabled by default at runtime. Either enable it"
470 - elog "by navigating to chrome://flags/#enable-webrtc-pipewire-capturer"
471 - elog "inside Chromium or add --enable-webrtc-pipewire-capturer"
472 - elog "to CHROMIUM_FLAGS in /etc/chromium/default."
473 + if ! use headless; then
474 + if use vaapi; then
475 + elog "VA-API is disabled by default at runtime. You have to enable it"
476 + elog "by adding --enable-features=VaapiVideoDecoder to CHROMIUM_FLAGS"
477 + elog "in /etc/chromium/default."
478 + fi
479 + if use screencast; then
480 + elog "Screencast is disabled by default at runtime. Either enable it"
481 + elog "by navigating to chrome://flags/#enable-webrtc-pipewire-capturer"
482 + elog "inside Chromium or add --enable-webrtc-pipewire-capturer"
483 + elog "to CHROMIUM_FLAGS in /etc/chromium/default."
484 + fi
485 + if use gtk4; then
486 + elog "Chromium prefers GTK3 over GTK4 at runtime. To override this"
487 + elog "behavior you need to pass --gtk-version=4, e.g. by adding it"
488 + elog "to CHROMIUM_FLAGS in /etc/chromium/default."
489 + fi
490 fi
491 }
492
493 diff --git a/www-client/chromium/files/chromium-cross-compile.patch b/www-client/chromium/files/chromium-cross-compile.patch
494 new file mode 100644
495 index 000000000000..430ceb7a4924
496 --- /dev/null
497 +++ b/www-client/chromium/files/chromium-cross-compile.patch
498 @@ -0,0 +1,12 @@
499 +--- a/build/toolchain/linux/unbundle/BUILD.gn
500 ++++ b/build/toolchain/linux/unbundle/BUILD.gn
501 +@@ -35,7 +35,7 @@ gcc_toolchain("host") {
502 + extra_ldflags = getenv("BUILD_LDFLAGS")
503 +
504 + toolchain_args = {
505 +- current_cpu = current_cpu
506 +- current_os = current_os
507 ++ current_cpu = host_cpu
508 ++ current_os = host_os
509 + }
510 + }
511
512 diff --git a/www-client/chromium/metadata.xml b/www-client/chromium/metadata.xml
513 index dcdaa4ce4a04..b97df5c6f029 100644
514 --- a/www-client/chromium/metadata.xml
515 +++ b/www-client/chromium/metadata.xml
516 @@ -9,8 +9,10 @@
517 <flag name="js-type-check">Enable JavaScript type-checking for Chrome's web technology-based UI. Requires Java.</flag>
518 <flag name="component-build">Split build into more shared libraries to speed up linking. Mostly intended for debugging and development, NOT RECOMMENDED for general use.</flag>
519 <flag name="debug">Enable DCHECK feature with severity configurable at runtime. Mostly intended for debugging and development, NOT RECOMMENDED for general use.</flag>
520 + <flag name="gtk4">Build with GTK4 headers.</flag>
521 <flag name="headless">Build Ozone only with headless backend, NOT RECOMMENDED for general use.</flag>
522 <flag name="hangouts">Enable support for Google Hangouts features such as screen sharing</flag>
523 + <flag name="libcxx">Use bundled libc++ instead of libstdc++ for building.</flag>
524 <flag name="official">Enable Official build instead of Developer build.</flag>
525 <flag name="pic">Disable optimized assembly code that is not PIC friendly</flag>
526 <flag name="proprietary-codecs">Enable codecs for patent-encumbered audio and video formats.</flag>