Diff chromium-117.0.5938.149 with a chromium-118.0.5993.32

/usr/portage/www-client/chromium/chromium-118.0.5993.32.ebuild 2023-10-09 14:52:35.884368511 +0300
3 3

  
4 4
EAPI=8
5 5

  
6
# Can't do 12 yet: heavy use of imp, among other things (bug #915001, bug #915062)
6 7
PYTHON_COMPAT=( python3_{10..11} )
7 8
PYTHON_REQ_USE="xml(+)"
8 9
LLVM_MAX_SLOT=17
10
VIRTUALX_REQUIRED="pgo"
9 11

  
10 12
CHROMIUM_LANGS="af am ar bg bn ca cs da de el en-GB es es-419 et fa fi fil fr gu he
11 13
	hi hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt-BR pt-PT ro ru sk sl sr
12 14
	sv sw ta te th tr uk ur vi zh-CN zh-TW"
13 15

  
14
VIRTUALX_REQUIRED="pgo"
15

  
16 16
inherit check-reqs chromium-2 desktop flag-o-matic llvm ninja-utils pax-utils
17 17
inherit python-any-r1 qmake-utils readme.gentoo-r1 toolchain-funcs virtualx xdg-utils
18 18

  
......
28 28
	pgo? ( https://github.com/elkablo/chromium-profiler/releases/download/v0.2/chromium-profiler-0.2.tar )"
29 29

  
30 30
LICENSE="BSD"
31
SLOT="0/stable"
32
KEYWORDS="amd64 arm64 ~ppc64"
33
IUSE_SYSTEM_LIBS="+system-av1 +system-ffmpeg +system-harfbuzz +system-icu +system-png +system-zstd"
34
IUSE="+X ${IUSE_SYSTEM_LIBS} component-build cups cpu_flags_arm_neon debug gtk4 +hangouts headless kerberos libcxx lto +official pax-kernel pgo pic +proprietary-codecs pulseaudio qt5 qt6 screencast selinux +suid vaapi wayland widevine"
31
SLOT="0/beta"
32
KEYWORDS="~amd64 ~arm64"
33
IUSE_SYSTEM_LIBS="+system-harfbuzz +system-icu +system-png +system-zstd"
34
IUSE="+X ${IUSE_SYSTEM_LIBS} cups debug gtk4 +hangouts headless kerberos libcxx lto +official pax-kernel pgo +proprietary-codecs pulseaudio qt5 qt6 screencast selinux vaapi wayland widevine"
35 35
REQUIRED_USE="
36
	component-build? ( !suid !libcxx )
37 36
	screencast? ( wayland )
38 37
	!headless? ( || ( X wayland ) )
39 38
	pgo? ( X !wayland )
......
67 66
	>=media-libs/libwebp-0.4.0:=
68 67
	media-libs/mesa:=[gbm(+)]
69 68
	>=media-libs/openh264-1.6.0:=
70
	system-av1? (
71
		>=media-libs/dav1d-1.0.0:=
72
		>=media-libs/libaom-3.4.0:=
73
	)
74 69
	sys-libs/zlib:=
75 70
	x11-libs/libdrm:=
76 71
	!headless? (
......
97 92
	${COMMON_SNAPSHOT_DEPEND}
98 93
	app-arch/bzip2:=
99 94
	dev-libs/expat:=
100
	system-ffmpeg? (
101
		>=media-video/ffmpeg-4.3:=
102
		|| (
103
			media-video/ffmpeg[-samba]
104
			>=net-fs/samba-4.5.10-r1[-debug(-)]
105
		)
106
		>=media-libs/opus-1.3.1:=
107
	)
108 95
	net-misc/curl[ssl]
109 96
	sys-apps/dbus:=
110 97
	media-libs/flac:=
......
176 163
		qt5? ( dev-qt/qtcore:5 )
177 164
		qt6? ( dev-qt/qtbase:6 )
178 165
	)
179
	libcxx? ( >=sys-devel/clang-16 )
180
	lto? ( $(depend_clang_llvm_versions 16) )
166
	libcxx? ( >=sys-devel/clang-17 )
167
	lto? ( $(depend_clang_llvm_versions 17) )
181 168
	pgo? (
182 169
		>=dev-python/selenium-3.141.0
183 170
		>=dev-util/web_page_replay_go-20220314
184
		$(depend_clang_llvm_versions 16)
171
		$(depend_clang_llvm_versions 17)
185 172
	)
186 173
	dev-lang/perl
187 174
	>=dev-util/gn-0.2114
......
198 185
: ${CHROMIUM_FORCE_CLANG=no}
199 186

  
200 187
if [[ ${CHROMIUM_FORCE_CLANG} == yes ]]; then
201
	BDEPEND+=" >=sys-devel/clang-16"
188
	BDEPEND+=" >=sys-devel/clang-17"
202 189
fi
203 190

  
204 191
if ! has chromium_pkg_die ${EBUILD_DEATH_HOOKS}; then
......
260 247
	# Check build requirements: bugs #471810, #541816, #914220
261 248
	# We're going to start doing maths here on the size of an unpacked source tarball,
262 249
	# this should make updates easier as chromium continues to balloon in size.
263
	local BASE_DISK=17
250
	local BASE_DISK=18
264 251
	local EXTRA_DISK=1
265
	CHECKREQS_MEMORY="4G"
252
	local CHECKREQS_MEMORY="4G"
266 253
	tc-is-cross-compiler && EXTRA_DISK=2
267 254
	if use lto || use pgo; then
268 255
		CHECKREQS_MEMORY="9G"
269
		EXTRA_DISK=2
270
		tc-is-cross-compiler && EXTRA_DISK=3
256
		tc-is-cross-compiler && EXTRA_DISK=4
271 257
		use pgo && EXTRA_DISK=8
272 258
	fi
273 259
	if is-flagq '-g?(gdb)?([1-9])'; then
274
		if use custom-cflags || use component-build; then
260
		if use custom-cflags; then
275 261
			EXTRA_DISK=13
276 262
		fi
277
		if ! use component-build; then
278
			CHECKREQS_MEMORY="16G"
279
		fi
263
		CHECKREQS_MEMORY="16G"
280 264
	fi
281 265
	CHECKREQS_DISK_BUILD="$((BASE_DISK + EXTRA_DISK))G"
282 266
	check-reqs_${EBUILD_PHASE_FUNC}
......
314 298
			else
315 299
				CPP="${CHOST}-clang++ -E"
316 300
			fi
317
			if ! ver_test "$(clang-major-version)" -ge 16; then
318
				die "At least clang 16 is required"
301
			if ver_test "$(clang-major-version)" -lt 17; then
302
				die "At least clang 17 is required"
319 303
			fi
320 304
		fi
321 305
	fi
......
333 317
		"chrome/browser/media/router/media_router_feature.cc" || die
334 318

  
335 319
	local PATCHES=(
336
		"${WORKDIR}/chromium-patches-${PV%%\.*}"
320
		"${WORKDIR}/chromium-patches-${PV%%.*}"
337 321
		"${FILESDIR}/chromium-cross-compile.patch"
338 322
		"${FILESDIR}/chromium-use-oauth2-client-switches-as-default.patch"
339 323
		"${FILESDIR}/chromium-108-EnumTable-crash.patch"
......
422 406
		third_party/dawn
423 407
		third_party/dawn/third_party/gn/webgpu-cts
424 408
		third_party/dawn/third_party/khronos
409
		third_party/dav1d
425 410
		third_party/depot_tools
426 411
		third_party/devscripts
427 412
		third_party/devtools-frontend
......
451 436
		third_party/farmhash
452 437
		third_party/fdlibm
453 438
		third_party/fft2d
439
		third_party/ffmpeg
454 440
		third_party/flatbuffers
455 441
		third_party/fp16
456 442
		third_party/freetype
......
474 460
		third_party/khronos
475 461
		third_party/leveldatabase
476 462
		third_party/libaddressinput
463
		third_party/libaom
464
		third_party/libaom/source/libaom/third_party/fastfeat
465
		third_party/libaom/source/libaom/third_party/SVT-AV1
466
		third_party/libaom/source/libaom/third_party/vector
467
		third_party/libaom/source/libaom/third_party/x86inc
477 468
		third_party/libavif
478 469
		third_party/libevent
479 470
		third_party/libgav1
......
514 505
		third_party/openscreen
515 506
		third_party/openscreen/src/third_party/mozilla
516 507
		third_party/openscreen/src/third_party/tinycbor/src/src
508
		third_party/opus
517 509
		third_party/ots
518 510
		third_party/pdfium
519 511
		third_party/pdfium/third_party/agg23
......
601 593
	)
602 594

  
603 595
	# USE=system-*
604
	if ! use system-av1; then
605
		keeplibs+=(
606
			third_party/dav1d
607
			third_party/libaom
608
			third_party/libaom/source/libaom/third_party/fastfeat
609
			third_party/libaom/source/libaom/third_party/SVT-AV1
610
			third_party/libaom/source/libaom/third_party/vector
611
			third_party/libaom/source/libaom/third_party/x86inc
612
		)
613
	fi
614

  
615
	if ! use system-ffmpeg; then
616
		keeplibs+=( third_party/ffmpeg third_party/opus )
617
	fi
618

  
619 596
	if ! use system-harfbuzz; then
620 597
		keeplibs+=( third_party/harfbuzz-ng )
621 598
	fi
......
636 613
		keeplibs+=( third_party/libc++ )
637 614
	fi
638 615

  
616
	if use libcxx; then
617
		keeplibs+=( third_party/libc++ )
618
	fi
619

  
639 620
	# Arch-specific
640 621
	if use arm64 || use ppc64 ; then
641 622
		keeplibs+=( third_party/swiftshader/third_party/llvm-10.0 )
......
695 676
		myconf_gn+=" is_clang=false"
696 677
	fi
697 678

  
698
	# Force lld for lto or pgo builds only, otherwise disable, bug 641556
679
	# Force lld for lto builds only, otherwise disable, bug 641556
699 680
	if use lto || use pgo; then
700 681
		myconf_gn+=" use_lld=true"
701 682
	else
702 683
		myconf_gn+=" use_lld=false"
703 684
	fi
704 685

  
705
	if use lto || use pgo; then
686
	if use lto; then
706 687
		AR=llvm-ar
707 688
		NM=llvm-nm
708 689
		if tc-is-cross-compiler; then
......
747 728

  
748 729
	# Component build isn't generally intended for use by end users. It's mostly useful
749 730
	# for development and debugging.
750
	myconf_gn+=" is_component_build=$(usex component-build true false)"
731
	myconf_gn+=" is_component_build=false"
751 732

  
752 733
	# Disable nacl, we can't build without pnacl (http://crbug.com/269560).
753 734
	myconf_gn+=" enable_nacl=false"
......
773 754
		openh264
774 755
		zlib
775 756
	)
776
	if use system-ffmpeg; then
777
		gn_system_libraries+=( ffmpeg opus )
778
	fi
779 757
	if use system-icu; then
780 758
		gn_system_libraries+=( icu )
781 759
	fi
782 760
	if use system-png; then
783 761
		gn_system_libraries+=( libpng )
784 762
	fi
785
	if use system-av1; then
786
		gn_system_libraries+=( dav1d libaom )
787
	fi
788 763
	if use system-zstd; then
789 764
		gn_system_libraries+=( zstd )
790 765
	fi
......
853 828

  
854 829
		# Debug info section overflows without component build
855 830
		# Prevent linker from running out of address space, bug #471810 .
856
		if ! use component-build || use x86; then
857
			filter-flags "-g*"
858
		fi
831
		filter-flags "-g*"
859 832

  
860 833
		# Prevent libvpx/xnnpack build failures. Bug 530248, 544702, 546984, 853646.
861
		if [[ ${myarch} == amd64 || ${myarch} == x86 ]]; then
834
		if [[ ${myarch} == amd64 ]]; then
862 835
			filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 -mno-avx -mno-avx2 -mno-fma -mno-fma4 -mno-xop -mno-sse4a
863 836
		fi
864 837

  
......
873 846
	if [[ $myarch = amd64 ]] ; then
874 847
		myconf_gn+=" target_cpu=\"x64\""
875 848
		ffmpeg_target_arch=x64
876
	elif [[ $myarch = x86 ]] ; then
877
		myconf_gn+=" target_cpu=\"x86\""
878
		ffmpeg_target_arch=ia32
879

  
880
		# This is normally defined by compiler_cpu_abi in
881
		# build/config/compiler/BUILD.gn, but we patch that part out.
882
		append-flags -msse2 -mfpmath=sse -mmmx
883 849
	elif [[ $myarch = arm64 ]] ; then
884 850
		myconf_gn+=" target_cpu=\"arm64\""
885 851
		ffmpeg_target_arch=arm64
886
	elif [[ $myarch = arm ]] ; then
887
		myconf_gn+=" target_cpu=\"arm\""
888
		ffmpeg_target_arch=$(usex cpu_flags_arm_neon arm-neon arm)
889 852
	elif [[ $myarch = ppc64 ]] ; then
890 853
		myconf_gn+=" target_cpu=\"ppc64\""
891 854
		ffmpeg_target_arch=ppc64
......
919 882
	# https://bugs.gentoo.org/654216
920 883
	addpredict /dev/dri/ #nowarn
921 884

  
922
	#if ! use system-ffmpeg; then
923
	if false; then
924
		local build_ffmpeg_args=""
925
		if use pic && [[ "${ffmpeg_target_arch}" == "ia32" ]]; then
926
			build_ffmpeg_args+=" --disable-asm"
927
		fi
928

  
929
		# Re-configure bundled ffmpeg. See bug #491378 for example reasons.
930
		einfo "Configuring bundled ffmpeg ..."
931
		pushd third_party/ffmpeg > /dev/null || die
932
		chromium/scripts/build_ffmpeg.py linux ${ffmpeg_target_arch} \
933
			--branding ${ffmpeg_branding} -- ${build_ffmpeg_args} || die
934
		chromium/scripts/copy_config.sh || die
935
		chromium/scripts/generate_gn.py || die
936
		popd > /dev/null || die
937
	fi
938

  
939 885
	# Disable unknown warning message from clang.
940 886
	if tc-is-clang; then
941 887
		append-flags -Wno-unknown-warning-option
......
1020 966
			myconf_gn+=" pgo_data_path=\"${2}\""
1021 967
		fi
1022 968
	else
1023
		# Disable PGO, because profile data is only compatible with >=clang-11
969
		# Disable PGO
1024 970
		myconf_gn+=" chrome_pgo_phase=0"
1025 971
	fi
1026 972

  
......
1071 1017

  
1072 1018
	# Even though ninja autodetects number of CPUs, we respect
1073 1019
	# user's options, for debugging with -j 1 or any other reason.
1074
	eninja -C out/Release chrome chromedriver
1075
	use suid && eninja -C out/Release chrome_sandbox
1020
	eninja -C out/Release chrome chromedriver chrome_sandbox
1076 1021

  
1077 1022
	pax-mark m out/Release/chrome
1078 1023
}
......
1158 1103
	exeinto "${CHROMIUM_HOME}"
1159 1104
	doexe out/Release/chrome
1160 1105

  
1161
	if use suid; then
1162
		newexe out/Release/chrome_sandbox chrome-sandbox
1163
		fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox"
1164
	fi
1106
	newexe out/Release/chrome_sandbox chrome-sandbox
1107
	fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox"
1165 1108

  
1166 1109
	doexe out/Release/chromedriver
1167 1110
	doexe out/Release/chrome_crashpad_handler
Thank you!