From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 2557A1382C5 for ; Thu, 3 Dec 2020 19:26:50 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 66593E077C; Thu, 3 Dec 2020 19:26:49 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3C4EAE077C for ; Thu, 3 Dec 2020 19:26:49 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9FAF9340AED for ; Thu, 3 Dec 2020 19:26:47 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 20AC4435 for ; Thu, 3 Dec 2020 19:26:46 +0000 (UTC) From: "Stephan Hartmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Stephan Hartmann" Message-ID: <1607023583.ce271b74f0f6be73cef6b837d17a411386d691a4.sultan@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: www-client/chromium/, www-client/chromium/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: www-client/chromium/Manifest www-client/chromium/chromium-87.0.4280.88.ebuild www-client/chromium/files/chromium-87-icu68.patch www-client/chromium/files/chromium-87-v8-icu68.patch X-VCS-Directories: www-client/chromium/files/ www-client/chromium/ X-VCS-Committer: sultan X-VCS-Committer-Name: Stephan Hartmann X-VCS-Revision: ce271b74f0f6be73cef6b837d17a411386d691a4 X-VCS-Branch: master Date: Thu, 3 Dec 2020 19:26:46 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: e04e00e2-bddb-4067-befa-0f84a910d921 X-Archives-Hash: 892b753bac0ff683d43fdf6ac4eeae60 commit: ce271b74f0f6be73cef6b837d17a411386d691a4 Author: Stephan Hartmann gentoo org> AuthorDate: Thu Dec 3 19:25:45 2020 +0000 Commit: Stephan Hartmann gentoo org> CommitDate: Thu Dec 3 19:26:23 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ce271b74 www-client/chromium: stable channel bump to 87.0.4280.88 Add patches for ICU 68.1 compatibility. Bug: https://bugs.gentoo.org/757606 Package-Manager: Portage-3.0.9, Repoman-3.0.2 Signed-off-by: Stephan Hartmann gentoo.org> www-client/chromium/Manifest | 1 + www-client/chromium/chromium-87.0.4280.88.ebuild | 899 +++++++++++++++++++++ www-client/chromium/files/chromium-87-icu68.patch | 400 +++++++++ .../chromium/files/chromium-87-v8-icu68.patch | 192 +++++ 4 files changed, 1492 insertions(+) diff --git a/www-client/chromium/Manifest b/www-client/chromium/Manifest index 56a20f2793a..e7ad956666c 100644 --- a/www-client/chromium/Manifest +++ b/www-client/chromium/Manifest @@ -1,5 +1,6 @@ DIST chromium-87-patchset-9.tar.xz 6036 BLAKE2B 4dd9aa0e88f11a9104cb13e73607c3b4fcd7e9cb556034472e2fd46158db6e7505b22c098df1c7cab6c7ff06ba6dc45914dcab58a405e0eafffa58d8b0cafbbf SHA512 c036ee20b4906bdb1b3104ecacf30a092ee3662ec10754bf2b168f1b7e1dbf593216e4dc70f8264540fadf91a33b48a8b8040028966dfcc8d8be99807b5f1b99 DIST chromium-87.0.4280.66.tar.xz 856464608 BLAKE2B 5e386c8043aac6c55d3f16ffeabc36571999b265559f3e1d3eddfd972fb3fb3c0fba4d9c6a23a94bcaa6bcec1f4892c04fb301d18cc76f997ce5696908f0c9dd SHA512 8bf31b012166fb1fd35107020608cf77e6a31038a583423541c64aaf1c91bca0767ca111dcb4dd0f57c9c19c347375bde6b6488c56e309bd2871998c26b8b32a +DIST chromium-87.0.4280.88.tar.xz 856266548 BLAKE2B 06a29a6c1e8cf71eb2db6e93a009feb8fd0b7ee676ff2c1dd31d2d72c597e5e84d979dbc64b7cb3f80ee0c51196f60a56157a27b679cab7f779baee61cd1928a SHA512 ac3903b598bd69f4ee3065845eac3c85cb5524715b9ce629c9c2bd017f2ebd168b7ee8111bccc2e6b6cfd12ad07add834cb2cd3bf0e27a8a5076bb7842fca897 DIST chromium-88-patchset-3.tar.xz 8396 BLAKE2B 4c978f1a6efef3f71e3dd6340c392b74bc6a734b49a9ca43343d03903159dafc66159939f9a6c4b55665ddbe7bd97a26d8d86c285ec02cf76cad5f5cc7410570 SHA512 c39afa26f5b0b9930f6f67ce0c42eefd74c09d528b26bc0db57129b150f75ff83c8b1cb97bd9c5d75f288fb4767cc68c9c5ce89231b4a59f8ca02493e4dd281a DIST chromium-88.0.4324.11.tar.xz 857506624 BLAKE2B 4ba54ceb848d9d7b9d3b9d5dc2a1dc80ea7da49150beb4ee5509f51db7d85cd72de79803ed25be52d0e6f8ff176a7154d05be5f36d604c4efe0a5b86c2fcd533 SHA512 736d77ba1c100cb6a0e6518920acf839f15213eaaa5f350f304c8ce9afbbeb47195b9927609ac01829e04f11f23cd2f8ab06493c1b14639c5b57f3ef5d01d5ee DIST setuptools-44.1.0.zip 858569 BLAKE2B f59f154e121502a731e51294ccd293d60ffccadacf51e23b53bf7ceba38858948b86783238061136c827ac3373ea7ea8e6253d4bb53f3f1dd69284568ec65a68 SHA512 4dfb0f42d334b835758e865a26ecd1e725711fa2b9c38ddc273b8b3849fba04527bc97436d11ba1e98f1a42922aa0f0b9032e32998273c705fac6e10735eacbf diff --git a/www-client/chromium/chromium-87.0.4280.88.ebuild b/www-client/chromium/chromium-87.0.4280.88.ebuild new file mode 100644 index 00000000000..a23879fdc47 --- /dev/null +++ b/www-client/chromium/chromium-87.0.4280.88.ebuild @@ -0,0 +1,899 @@ +# Copyright 2009-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +PYTHON_COMPAT=( python2_7 ) +PYTHON_REQ_USE="xml" + +CHROMIUM_LANGS="am ar bg bn ca cs da de el en-GB es es-419 et fa fi fil fr gu he + 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 + sv sw ta te th tr uk vi zh-CN zh-TW" + +inherit check-reqs chromium-2 desktop flag-o-matic multilib ninja-utils pax-utils portability python-any-r1 readme.gentoo-r1 toolchain-funcs xdg-utils + +DESCRIPTION="Open-source version of Google Chrome web browser" +HOMEPAGE="https://chromium.org/" +PATCHSET="9" +PATCHSET_NAME="chromium-$(ver_cut 1)-patchset-${PATCHSET}" +SRC_URI="https://commondatastorage.googleapis.com/chromium-browser-official/${P}.tar.xz + https://files.pythonhosted.org/packages/ed/7b/bbf89ca71e722b7f9464ebffe4b5ee20a9e5c9a555a56e2d3914bb9119a6/setuptools-44.1.0.zip + https://github.com/stha09/chromium-patches/releases/download/${PATCHSET_NAME}/${PATCHSET_NAME}.tar.xz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~x86" +IUSE="component-build cups cpu_flags_arm_neon +hangouts headless +js-type-check kerberos official pic +proprietary-codecs pulseaudio selinux +suid +system-ffmpeg +system-icu +tcmalloc vaapi wayland widevine" +RESTRICT="!system-ffmpeg? ( proprietary-codecs? ( bindist ) )" +REQUIRED_USE=" + component-build? ( !suid ) +" + +COMMON_X_DEPEND=" + media-libs/mesa:=[gbm] + x11-libs/libX11:= + x11-libs/libXcomposite:= + x11-libs/libXcursor:= + x11-libs/libXdamage:= + x11-libs/libXext:= + x11-libs/libXfixes:= + >=x11-libs/libXi-1.6.0:= + x11-libs/libXrandr:= + x11-libs/libXrender:= + x11-libs/libXtst:= + x11-libs/libXScrnSaver:= + x11-libs/libxcb:= + vaapi? ( >=x11-libs/libva-2.7:=[X,drm] ) +" + +COMMON_DEPEND=" + app-arch/bzip2:= + cups? ( >=net-print/cups-1.3.11:= ) + dev-libs/expat:= + dev-libs/glib:2 + >=dev-libs/libxml2-2.9.4-r3:=[icu] + dev-libs/nspr:= + >=dev-libs/nss-3.26:= + >=media-libs/alsa-lib-1.0.19:= + media-libs/fontconfig:= + media-libs/freetype:= + >=media-libs/harfbuzz-2.4.0:0=[icu(-)] + media-libs/libjpeg-turbo:= + media-libs/libpng:= + pulseaudio? ( media-sound/pulseaudio:= ) + system-ffmpeg? ( + >=media-video/ffmpeg-4.3:= + || ( + media-video/ffmpeg[-samba] + >=net-fs/samba-4.5.10-r1[-debug(-)] + ) + >=media-libs/opus-1.3.1:= + ) + sys-apps/dbus:= + sys-apps/pciutils:= + virtual/udev + x11-libs/cairo:= + x11-libs/gdk-pixbuf:2 + x11-libs/pango:= + media-libs/flac:= + >=media-libs/libwebp-0.4.0:= + sys-libs/zlib:=[minizip] + kerberos? ( virtual/krb5 ) + !headless? ( + ${COMMON_X_DEPEND} + >=app-accessibility/at-spi2-atk-2.26:2 + >=app-accessibility/at-spi2-core-2.26:2 + >=dev-libs/atk-2.26 + x11-libs/gtk+:3[X] + wayland? ( + dev-libs/wayland:= + dev-libs/libffi:= + x11-libs/gtk+:3[wayland,X] + x11-libs/libdrm:= + x11-libs/libxkbcommon:= + ) + ) +" +# For nvidia-drivers blocker, see bug #413637 . +RDEPEND="${COMMON_DEPEND} + x11-misc/xdg-utils + virtual/opengl + virtual/ttf-fonts + selinux? ( sec-policy/selinux-chromium ) + tcmalloc? ( ! gn leftovers + base/third_party/libevent + third_party/adobe + third_party/speech-dispatcher + third_party/usb_ids + third_party/xdg-utils + ) + if ! use system-ffmpeg; then + keeplibs+=( third_party/ffmpeg third_party/opus ) + fi + if ! use system-icu; then + keeplibs+=( third_party/icu ) + fi + if use tcmalloc; then + keeplibs+=( third_party/tcmalloc ) + fi + if use wayland && ! use headless ; then + keeplibs+=( third_party/wayland ) + fi + if [[ ${CHROMIUM_FORCE_LIBCXX} == yes ]]; then + keeplibs+=( third_party/libxml ) + keeplibs+=( third_party/libxslt ) + keeplibs+=( third_party/openh264 ) + keeplibs+=( third_party/re2 ) + keeplibs+=( third_party/snappy ) + if use system-icu; then + keeplibs+=( third_party/icu ) + fi + fi + if use arm64 || use ppc64 ; then + keeplibs+=( third_party/swiftshader/third_party/llvm-10.0 ) + fi + # we need to generate ppc64 stuff because upstream does not ship it yet + # it has to be done before unbundling. + if use ppc64; then + pushd third_party/libvpx >/dev/null || die + mkdir -p source/config/linux/ppc64 || die + ./generate_gni.sh || die + popd >/dev/null || die + fi + + # Remove most bundled libraries. Some are still needed. + build/linux/unbundle/remove_bundled_libraries.py "${keeplibs[@]}" --do-remove || die +} + +src_configure() { + # Calling this here supports resumption via FEATURES=keepwork + python_setup + + local myconf_gn="" + + # Make sure the build system will use the right tools, bug #340795. + tc-export AR CC CXX NM + + if [[ ${CHROMIUM_FORCE_CLANG} == yes ]] && ! tc-is-clang; then + # Force clang since gcc is pretty broken at the moment. + CC=${CHOST}-clang + CXX=${CHOST}-clang++ + strip-unsupported-flags + fi + + if tc-is-clang; then + myconf_gn+=" is_clang=true clang_use_chrome_plugins=false" + else + if [[ ${CHROMIUM_FORCE_LIBCXX} == yes ]]; then + die "Compiling with sys-libs/libcxx requires clang." + fi + myconf_gn+=" is_clang=false" + fi + + # Define a custom toolchain for GN + myconf_gn+=" custom_toolchain=\"//build/toolchain/linux/unbundle:default\"" + + if tc-is-cross-compiler; then + tc-export BUILD_{AR,CC,CXX,NM} + myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:host\"" + myconf_gn+=" v8_snapshot_toolchain=\"//build/toolchain/linux/unbundle:host\"" + else + myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:default\"" + fi + + # GN needs explicit config for Debug/Release as opposed to inferring it from build directory. + myconf_gn+=" is_debug=false" + + # Component build isn't generally intended for use by end users. It's mostly useful + # for development and debugging. + myconf_gn+=" is_component_build=$(usex component-build true false)" + + myconf_gn+=" use_allocator=$(usex tcmalloc \"tcmalloc\" \"none\")" + + # Disable nacl, we can't build without pnacl (http://crbug.com/269560). + myconf_gn+=" enable_nacl=false" + + # Use system-provided libraries. + # TODO: freetype -- remove sources (https://bugs.chromium.org/p/pdfium/issues/detail?id=733). + # TODO: use_system_hunspell (upstream changes needed). + # TODO: use_system_libsrtp (bug #459932). + # TODO: use_system_protobuf (bug #525560). + # TODO: use_system_ssl (http://crbug.com/58087). + # TODO: use_system_sqlite (http://crbug.com/22208). + + # libevent: https://bugs.gentoo.org/593458 + local gn_system_libraries=( + flac + fontconfig + freetype + # Need harfbuzz_from_pkgconfig target + #harfbuzz-ng + libdrm + libjpeg + libpng + libwebp + zlib + ) + if use system-ffmpeg; then + gn_system_libraries+=( ffmpeg opus ) + fi + if use system-icu; then + gn_system_libraries+=( icu ) + fi + if [[ ${CHROMIUM_FORCE_LIBCXX} != yes ]]; then + # unbundle only without libc++, because libc++ is not fully ABI compatible with libstdc++ + gn_system_libraries+=( libxml ) + gn_system_libraries+=( libxslt ) + gn_system_libraries+=( openh264 ) + gn_system_libraries+=( re2 ) + gn_system_libraries+=( snappy ) + fi + build/linux/unbundle/replace_gn_files.py --system-libraries "${gn_system_libraries[@]}" || die + + # See dependency logic in third_party/BUILD.gn + myconf_gn+=" use_system_harfbuzz=true" + + # Disable deprecated libgnome-keyring dependency, bug #713012 + myconf_gn+=" use_gnome_keyring=false" + + # Optional dependencies. + myconf_gn+=" enable_js_type_check=$(usex js-type-check true false)" + myconf_gn+=" enable_hangout_services_extension=$(usex hangouts true false)" + myconf_gn+=" enable_widevine=$(usex widevine true false)" + myconf_gn+=" use_cups=$(usex cups true false)" + myconf_gn+=" use_kerberos=$(usex kerberos true false)" + myconf_gn+=" use_pulseaudio=$(usex pulseaudio true false)" + myconf_gn+=" use_vaapi=$(usex vaapi true false)" + + # TODO: link_pulseaudio=true for GN. + + myconf_gn+=" fieldtrial_testing_like_official_build=true" + + # Never use bundled gold binary. Disable gold linker flags for now. + # Do not use bundled clang. + # Trying to use gold results in linker crash. + myconf_gn+=" use_gold=false use_sysroot=false use_custom_libcxx=false" + + # Disable forced lld, bug 641556 + myconf_gn+=" use_lld=false" + + ffmpeg_branding="$(usex proprietary-codecs Chrome Chromium)" + myconf_gn+=" proprietary_codecs=$(usex proprietary-codecs true false)" + myconf_gn+=" ffmpeg_branding=\"${ffmpeg_branding}\"" + + # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys . + # Note: these are for Gentoo use ONLY. For your own distribution, + # please get your own set of keys. Feel free to contact chromium@gentoo.org + # for more info. + local google_api_key="AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc" + local google_default_client_id="329227923882.apps.googleusercontent.com" + local google_default_client_secret="vgKG0NNv7GoDpbtoFNLxCUXu" + myconf_gn+=" google_api_key=\"${google_api_key}\"" + myconf_gn+=" google_default_client_id=\"${google_default_client_id}\"" + myconf_gn+=" google_default_client_secret=\"${google_default_client_secret}\"" + local myarch="$(tc-arch)" + + # Avoid CFLAGS problems, bug #352457, bug #390147. + if ! use custom-cflags; then + replace-flags "-Os" "-O2" + strip-flags + + # Debug info section overflows without component build + # Prevent linker from running out of address space, bug #471810 . + if ! use component-build || use x86; then + filter-flags "-g*" + fi + + # Prevent libvpx build failures. Bug 530248, 544702, 546984. + if [[ ${myarch} == amd64 || ${myarch} == x86 ]]; then + filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 -mno-avx -mno-avx2 -mno-fma -mno-fma4 + fi + fi + + if [[ ${CHROMIUM_FORCE_LIBCXX} == yes ]]; then + append-flags -stdlib=libc++ + append-ldflags -stdlib=libc++ + fi + + if [[ $myarch = amd64 ]] ; then + myconf_gn+=" target_cpu=\"x64\"" + ffmpeg_target_arch=x64 + elif [[ $myarch = x86 ]] ; then + myconf_gn+=" target_cpu=\"x86\"" + ffmpeg_target_arch=ia32 + + # This is normally defined by compiler_cpu_abi in + # build/config/compiler/BUILD.gn, but we patch that part out. + append-flags -msse2 -mfpmath=sse -mmmx + elif [[ $myarch = arm64 ]] ; then + myconf_gn+=" target_cpu=\"arm64\"" + ffmpeg_target_arch=arm64 + elif [[ $myarch = arm ]] ; then + myconf_gn+=" target_cpu=\"arm\"" + ffmpeg_target_arch=$(usex cpu_flags_arm_neon arm-neon arm) + elif [[ $myarch = ppc64 ]] ; then + myconf_gn+=" target_cpu=\"ppc64\"" + ffmpeg_target_arch=ppc64 + else + die "Failed to determine target arch, got '$myarch'." + fi + + # Make sure that -Werror doesn't get added to CFLAGS by the build system. + # Depending on GCC version the warnings are different and we don't want + # the build to fail because of that. + myconf_gn+=" treat_warnings_as_errors=false" + + # Disable fatal linker warnings, bug 506268. + myconf_gn+=" fatal_linker_warnings=false" + + # Bug 491582. + export TMPDIR="${WORKDIR}/temp" + mkdir -p -m 755 "${TMPDIR}" || die + + # https://bugs.gentoo.org/654216 + addpredict /dev/dri/ #nowarn + + #if ! use system-ffmpeg; then + if false; then + local build_ffmpeg_args="" + if use pic && [[ "${ffmpeg_target_arch}" == "ia32" ]]; then + build_ffmpeg_args+=" --disable-asm" + fi + + # Re-configure bundled ffmpeg. See bug #491378 for example reasons. + einfo "Configuring bundled ffmpeg..." + pushd third_party/ffmpeg > /dev/null || die + chromium/scripts/build_ffmpeg.py linux ${ffmpeg_target_arch} \ + --branding ${ffmpeg_branding} -- ${build_ffmpeg_args} || die + chromium/scripts/copy_config.sh || die + chromium/scripts/generate_gn.py || die + popd > /dev/null || die + fi + + # Chromium relies on this, but was disabled in >=clang-10, crbug.com/1042470 + append-cxxflags $(test-flags-CXX -flax-vector-conversions=all) + + # Disable unknown warning message from clang. + tc-is-clang && append-flags -Wno-unknown-warning-option + + # Explicitly disable ICU data file support for system-icu builds. + if use system-icu; then + myconf_gn+=" icu_use_data_file=false" + fi + + # Enable ozone wayland and/or headless support + if use wayland || use headless; then + myconf_gn+=" use_ozone=true ozone_auto_platforms=false" + myconf_gn+=" ozone_platform_headless=true" + if use headless; then + myconf_gn+=" ozone_platform=\"headless\"" + myconf_gn+=" use_x11=false" + else + myconf_gn+=" ozone_platform_wayland=true" + myconf_gn+=" use_system_libdrm=true" + myconf_gn+=" use_system_minigbm=true" + myconf_gn+=" use_xkbcommon=true" + myconf_gn+=" ozone_platform=\"wayland\"" + fi + else + myconf_gn+=" use_ozone=false" + fi + + # Enable official builds + myconf_gn+=" is_official_build=$(usex official true false)" + if use official; then + # Allow building against system libraries in official builds + sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \ + tools/generate_shim_headers/generate_shim_headers.py || die + # Disable CFI: unsupported for GCC, requires clang+lto+lld + myconf_gn+=" is_cfi=false" + # Disable PGO, because profile data is missing in tarball + # (https://groups.google.com/a/chromium.org/g/chromium-packagers/c/2ID9c4j6UkY) + myconf_gn+=" chrome_pgo_phase=0" + fi + + einfo "Configuring Chromium..." + set -- gn gen --args="${myconf_gn} ${EXTRA_GN}" out/Release + echo "$@" + "$@" || die +} + +src_compile() { + # Final link uses lots of file descriptors. + ulimit -n 2048 + + # Calling this here supports resumption via FEATURES=keepwork + python_setup + + # https://bugs.gentoo.org/717456 + local -x PYTHONPATH="${WORKDIR}/setuptools-44.1.0:${PYTHONPATH+:}${PYTHONPATH}" + + #"${EPYTHON}" tools/clang/scripts/update.py --force-local-build --gcc-toolchain /usr --skip-checkout --use-system-cmake --without-android || die + + # Build mksnapshot and pax-mark it. + local x + for x in mksnapshot v8_context_snapshot_generator; do + if tc-is-cross-compiler; then + eninja -C out/Release "host/${x}" + pax-mark m "out/Release/host/${x}" + else + eninja -C out/Release "${x}" + pax-mark m "out/Release/${x}" + fi + done + + # Even though ninja autodetects number of CPUs, we respect + # user's options, for debugging with -j 1 or any other reason. + eninja -C out/Release chrome chromedriver + use suid && eninja -C out/Release chrome_sandbox + + pax-mark m out/Release/chrome + + # Build manpage; bug #684550 + sed -e 's|@@PACKAGE@@|chromium-browser|g; + s|@@MENUNAME@@|Chromium|g;' \ + chrome/app/resources/manpage.1.in > \ + out/Release/chromium-browser.1 || die + + # Build desktop file; bug #706786 + sed -e 's|@@MENUNAME@@|Chromium|g; + s|@@USR_BIN_SYMLINK_NAME@@|chromium-browser|g; + s|@@PACKAGE@@|chromium-browser|g; + s|\(^Exec=\)/usr/bin/|\1|g;' \ + chrome/installer/linux/common/desktop.template > \ + out/Release/chromium-browser-chromium.desktop || die +} + +src_install() { + local CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser" + exeinto "${CHROMIUM_HOME}" + doexe out/Release/chrome + + if use suid; then + newexe out/Release/chrome_sandbox chrome-sandbox + fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox" + fi + + doexe out/Release/chromedriver + + local sedargs=( -e + "s:/usr/lib/:/usr/$(get_libdir)/:g; + s:@@OZONE_AUTO_SESSION@@:$(usex wayland true false):g; + s:@@FORCE_OZONE_PLATFORM@@:$(usex headless true false):g" + ) + sed "${sedargs[@]}" "${FILESDIR}/chromium-launcher-r6.sh" > chromium-launcher.sh || die + doexe chromium-launcher.sh + + # It is important that we name the target "chromium-browser", + # xdg-utils expect it; bug #355517. + dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser + # keep the old symlink around for consistency + dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium + + dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver + + # Allow users to override command-line options, bug #357629. + insinto /etc/chromium + newins "${FILESDIR}/chromium.default" "default" + + pushd out/Release/locales > /dev/null || die + chromium_remove_language_paks + popd + + insinto "${CHROMIUM_HOME}" + doins out/Release/*.bin + doins out/Release/*.pak + ( + shopt -s nullglob + local files=(out/Release/*.so) + [[ ${#files[@]} -gt 0 ]] && doins "${files[@]}" + ) + + if ! use system-icu; then + doins out/Release/icudtl.dat + fi + + doins -r out/Release/locales + doins -r out/Release/resources + + if [[ -d out/Release/swiftshader ]]; then + insinto "${CHROMIUM_HOME}/swiftshader" + doins out/Release/swiftshader/*.so + fi + + # Install icons + local branding size + for size in 16 24 32 48 64 128 256 ; do + case ${size} in + 16|32) branding="chrome/app/theme/default_100_percent/chromium" ;; + *) branding="chrome/app/theme/chromium" ;; + esac + newicon -s ${size} "${branding}/product_logo_${size}.png" \ + chromium-browser.png + done + + # Install desktop entry + domenu out/Release/chromium-browser-chromium.desktop + + # Install GNOME default application entry (bug #303100). + insinto /usr/share/gnome-control-center/default-apps + newins "${FILESDIR}"/chromium-browser.xml chromium-browser.xml + + # Install manpage; bug #684550 + doman out/Release/chromium-browser.1 + dosym chromium-browser.1 /usr/share/man/man1/chromium.1 + + readme.gentoo_create_doc +} + +pkg_postrm() { + xdg_icon_cache_update + xdg_desktop_database_update +} + +pkg_postinst() { + xdg_icon_cache_update + xdg_desktop_database_update + readme.gentoo_print_elog + + if use vaapi; then + elog "VA-API is disabled by default at runtime. Either enable it" + elog "by navigating to chrome://flags/#enable-accelerated-video-decode" + elog "inside Chromium or add --enable-accelerated-video-decode" + elog "to CHROMIUM_FLAGS in /etc/chromium/default." + fi +} diff --git a/www-client/chromium/files/chromium-87-icu68.patch b/www-client/chromium/files/chromium-87-icu68.patch new file mode 100644 index 00000000000..dfea967dbaa --- /dev/null +++ b/www-client/chromium/files/chromium-87-icu68.patch @@ -0,0 +1,400 @@ +From 4d16e52a5e6771c4aa5f892e14486bf0e87027d1 Mon Sep 17 00:00:00 2001 +From: Frank Tang +Date: Tue, 20 Oct 2020 00:11:50 +0000 +Subject: [PATCH] Prepare for landing ICU68 + +In the landing process of ICU68 we found these need to be changed +since ICU68 no longer define TRUE and FALSE for UBool to +avoid C++20 problem. + +Bug: 1138555 +Change-Id: I64fd98c99864aa86b07280537a780105cb0eabbe +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2473522 +Reviewed-by: Frank Tang +Reviewed-by: Colin Blundell +Reviewed-by: Dominic Battré +Reviewed-by: Guillaume Jenkins +Reviewed-by: Jungshik Shin +Reviewed-by: Mihai Sardarescu +Reviewed-by: Dave Tapuska +Reviewed-by: Mustafa Emre Acer +Reviewed-by: Marian Fechete +Reviewed-by: Matthew Denton +Commit-Queue: Frank Tang +Cr-Commit-Position: refs/heads/master@{#818713} +--- + +diff --git a/base/i18n/icu_util.cc b/base/i18n/icu_util.cc +index b225f1d..20debbe 100644 +--- a/base/i18n/icu_util.cc ++++ b/base/i18n/icu_util.cc +@@ -327,7 +327,7 @@ + // https://ssl.icu-project.org/trac/ticket/13208 . + string16 zone_id = android::GetDefaultTimeZoneId(); + icu::TimeZone::adoptDefault(icu::TimeZone::createTimeZone( +- icu::UnicodeString(FALSE, zone_id.data(), zone_id.length()))); ++ icu::UnicodeString(false, zone_id.data(), zone_id.length()))); + #elif defined(OS_FUCHSIA) + // The platform-specific mechanisms used by ICU's detectHostTimeZone() to + // determine the default time zone will not work on Fuchsia. Therefore, +diff --git a/base/i18n/string_compare.cc b/base/i18n/string_compare.cc +index c0e83c6..e4fb687 100644 +--- a/base/i18n/string_compare.cc ++++ b/base/i18n/string_compare.cc +@@ -18,8 +18,8 @@ + StringPiece16 rhs) { + UErrorCode error = U_ZERO_ERROR; + UCollationResult result = collator.compare( +- icu::UnicodeString(FALSE, lhs.data(), static_cast(lhs.length())), +- icu::UnicodeString(FALSE, rhs.data(), static_cast(rhs.length())), ++ icu::UnicodeString(false, lhs.data(), static_cast(lhs.length())), ++ icu::UnicodeString(false, rhs.data(), static_cast(rhs.length())), + error); + DCHECK(U_SUCCESS(error)); + return result; +diff --git a/base/i18n/time_formatting.cc b/base/i18n/time_formatting.cc +index c769b57..c085f5e 100644 +--- a/base/i18n/time_formatting.cc ++++ b/base/i18n/time_formatting.cc +@@ -240,7 +240,7 @@ + icu::FieldPosition ignore(icu::FieldPosition::DONT_CARE); + measure_format.formatMeasures(measures, 3, formatted, ignore, status); + *out = i18n::UnicodeStringToString16(formatted); +- return U_SUCCESS(status) == TRUE; ++ return U_SUCCESS(status); + } + + string16 DateIntervalFormat(const Time& begin_time, +diff --git a/components/autofill/core/common/autofill_regexes.cc b/components/autofill/core/common/autofill_regexes.cc +index 02254fa..1cf12f3 100644 +--- a/components/autofill/core/common/autofill_regexes.cc ++++ b/components/autofill/core/common/autofill_regexes.cc +@@ -43,7 +43,7 @@ + icu::RegexMatcher* AutofillRegexes::GetMatcher(const base::string16& pattern) { + auto it = matchers_.find(pattern); + if (it == matchers_.end()) { +- const icu::UnicodeString icu_pattern(FALSE, pattern.data(), ++ const icu::UnicodeString icu_pattern(false, pattern.data(), + pattern.length()); + + UErrorCode status = U_ZERO_ERROR; +@@ -71,21 +71,21 @@ + base::AutoLock lock(*g_lock); + + icu::RegexMatcher* matcher = g_autofill_regexes->GetMatcher(pattern); +- icu::UnicodeString icu_input(FALSE, input.data(), input.length()); ++ icu::UnicodeString icu_input(false, input.data(), input.length()); + matcher->reset(icu_input); + + UErrorCode status = U_ZERO_ERROR; + UBool matched = matcher->find(0, status); + DCHECK(U_SUCCESS(status)); + +- if (matched == TRUE && match) { ++ if (matched && match) { + icu::UnicodeString match_unicode = + matcher->group(group_to_be_captured, status); + DCHECK(U_SUCCESS(status)); + *match = base::i18n::UnicodeStringToString16(match_unicode); + } + +- return matched == TRUE; ++ return matched; + } + + } // namespace autofill +diff --git a/components/autofill_assistant/browser/string_conversions_util.cc b/components/autofill_assistant/browser/string_conversions_util.cc +index 212bafa..1d00d68 100644 +--- a/components/autofill_assistant/browser/string_conversions_util.cc ++++ b/components/autofill_assistant/browser/string_conversions_util.cc +@@ -39,13 +39,13 @@ + // |target|. + bool AppendUnicodeToUTF8(const UChar32 source, std::string* target) { + char bytes[4]; +- UBool error = FALSE; ++ UBool error = false; + size_t offset = 0; + U8_APPEND(bytes, offset, base::size(bytes), source, error); +- if (error == FALSE) { ++ if (error == false) { + target->append(bytes, offset); + } +- return error == FALSE; ++ return !error; + } + + } // namespace autofill_assistant +diff --git a/components/signin/public/identity_manager/identity_utils.cc b/components/signin/public/identity_manager/identity_utils.cc +index 1c414e2..014d674 100644 +--- a/components/signin/public/identity_manager/identity_utils.cc ++++ b/components/signin/public/identity_manager/identity_utils.cc +@@ -33,7 +33,7 @@ + + // See if the username matches the policy-provided pattern. + UErrorCode status = U_ZERO_ERROR; +- const icu::UnicodeString icu_pattern(FALSE, utf16_pattern.data(), ++ const icu::UnicodeString icu_pattern(false, utf16_pattern.data(), + utf16_pattern.length()); + icu::RegexMatcher matcher(icu_pattern, UREGEX_CASE_INSENSITIVE, status); + if (!U_SUCCESS(status)) { +diff --git a/components/spellcheck/renderer/spellcheck_worditerator.cc b/components/spellcheck/renderer/spellcheck_worditerator.cc +index ec16fef..3b1f060 100644 +--- a/components/spellcheck/renderer/spellcheck_worditerator.cc ++++ b/components/spellcheck/renderer/spellcheck_worditerator.cc +@@ -442,7 +442,7 @@ + // spellchecker and we need manual normalization as well. The normalized + // text does not have to be NUL-terminated since its characters are copied to + // string16, which adds a NUL character when we need. +- icu::UnicodeString input(FALSE, &text_[input_start], ++ icu::UnicodeString input(false, &text_[input_start], + base::checked_cast(input_length)); + UErrorCode status = U_ZERO_ERROR; + icu::UnicodeString output; +diff --git a/components/url_formatter/spoof_checks/idn_spoof_checker.cc b/components/url_formatter/spoof_checks/idn_spoof_checker.cc +index 6d66a7c..d73192b1 100644 +--- a/components/url_formatter/spoof_checks/idn_spoof_checker.cc ++++ b/components/url_formatter/spoof_checks/idn_spoof_checker.cc +@@ -368,7 +368,7 @@ + return Result::kICUSpoofChecks; + } + +- icu::UnicodeString label_string(FALSE /* isTerminated */, label.data(), ++ icu::UnicodeString label_string(false /* isTerminated */, label.data(), + base::checked_cast(label.size())); + + // A punycode label with 'xn--' prefix is not subject to the URL +@@ -711,7 +711,7 @@ + base::StringPiece tld, + base::StringPiece16 tld_unicode) { + icu::UnicodeString tld_string( +- FALSE /* isTerminated */, tld_unicode.data(), ++ false /* isTerminated */, tld_unicode.data(), + base::checked_cast(tld_unicode.size())); + // Allow if the TLD contains any letter from the script, in which case it's + // likely to be a TLD in that script. +diff --git a/components/url_formatter/spoof_checks/skeleton_generator.cc b/components/url_formatter/spoof_checks/skeleton_generator.cc +index 9628626..9a77901 100644 +--- a/components/url_formatter/spoof_checks/skeleton_generator.cc ++++ b/components/url_formatter/spoof_checks/skeleton_generator.cc +@@ -116,7 +116,7 @@ + Skeletons SkeletonGenerator::GetSkeletons(base::StringPiece16 hostname) { + Skeletons skeletons; + size_t hostname_length = hostname.length() - (hostname.back() == '.' ? 1 : 0); +- icu::UnicodeString host(FALSE, hostname.data(), hostname_length); ++ icu::UnicodeString host(false, hostname.data(), hostname_length); + // If input has any characters outside Latin-Greek-Cyrillic and [0-9._-], + // there is no point in getting rid of diacritics because combining marks + // attached to non-LGC characters are already blocked. +diff --git a/content/zygote/zygote_linux.cc b/content/zygote/zygote_linux.cc +index 95d5a82..b6d8e5a 100644 +--- a/content/zygote/zygote_linux.cc ++++ b/content/zygote/zygote_linux.cc +@@ -557,7 +557,7 @@ + if (!iter.ReadString16(&timezone_id)) + return -1; + icu::TimeZone::adoptDefault(icu::TimeZone::createTimeZone( +- icu::UnicodeString(FALSE, timezone_id.data(), timezone_id.length()))); ++ icu::UnicodeString(false, timezone_id.data(), timezone_id.length()))); + + if (!iter.ReadInt(&numfds)) + return -1; +diff --git a/services/device/time_zone_monitor/time_zone_monitor_android.cc b/services/device/time_zone_monitor/time_zone_monitor_android.cc +index 818670a..f57f972 100644 +--- a/services/device/time_zone_monitor/time_zone_monitor_android.cc ++++ b/services/device/time_zone_monitor/time_zone_monitor_android.cc +@@ -34,7 +34,7 @@ + // See base/i18n/icu_util.cc:InitializeIcuTimeZone() for more information. + base::string16 zone_id = base::android::GetDefaultTimeZoneId(); + std::unique_ptr new_zone(icu::TimeZone::createTimeZone( +- icu::UnicodeString(FALSE, zone_id.data(), zone_id.length()))); ++ icu::UnicodeString(false, zone_id.data(), zone_id.length()))); + UpdateIcuAndNotifyClients(std::move(new_zone)); + } + +diff --git a/third_party/blink/renderer/core/exported/web_view_test.cc b/third_party/blink/renderer/core/exported/web_view_test.cc +index a6b9552..36809d91 100644 +--- a/third_party/blink/renderer/core/exported/web_view_test.cc ++++ b/third_party/blink/renderer/core/exported/web_view_test.cc +@@ -4868,18 +4868,18 @@ + + TEST_F(ShowUnhandledTapTest, ShowUnhandledTapUIIfNeededWithMutateDom) { + // Test dom mutation. +- TestEachMouseEvent("mutateDom", FALSE); ++ TestEachMouseEvent("mutateDom", false); + + // Test without any DOM mutation. +- TestEachMouseEvent("none", TRUE); ++ TestEachMouseEvent("none", true); + } + + TEST_F(ShowUnhandledTapTest, ShowUnhandledTapUIIfNeededWithMutateStyle) { + // Test style mutation. +- TestEachMouseEvent("mutateStyle", FALSE); ++ TestEachMouseEvent("mutateStyle", false); + + // Test checkbox:indeterminate style mutation. +- TestEachMouseEvent("mutateIndeterminate", FALSE); ++ TestEachMouseEvent("mutateIndeterminate", false); + + // Test click div with :active style. + Tap("style_active"); +@@ -4888,10 +4888,10 @@ + + TEST_F(ShowUnhandledTapTest, ShowUnhandledTapUIIfNeededWithPreventDefault) { + // Test swallowing. +- TestEachMouseEvent("preventDefault", FALSE); ++ TestEachMouseEvent("preventDefault", false); + + // Test without any preventDefault. +- TestEachMouseEvent("none", TRUE); ++ TestEachMouseEvent("none", true); + } + + TEST_F(ShowUnhandledTapTest, ShowUnhandledTapUIIfNeededWithNonTriggeringNodes) { +diff --git a/third_party/blink/renderer/platform/text/locale_icu.cc b/third_party/blink/renderer/platform/text/locale_icu.cc +index 92fb99e0..f991b51 100644 +--- a/third_party/blink/renderer/platform/text/locale_icu.cc ++++ b/third_party/blink/renderer/platform/text/locale_icu.cc +@@ -169,12 +169,12 @@ + return g_empty_string; + + UErrorCode status = U_ZERO_ERROR; +- int32_t length = udat_toPattern(date_format, TRUE, nullptr, 0, &status); ++ int32_t length = udat_toPattern(date_format, true, nullptr, 0, &status); + if (status != U_BUFFER_OVERFLOW_ERROR || !length) + return g_empty_string; + StringBuffer buffer(length); + status = U_ZERO_ERROR; +- udat_toPattern(date_format, TRUE, buffer.Characters(), length, &status); ++ udat_toPattern(date_format, true, buffer.Characters(), length, &status); + if (U_FAILURE(status)) + return g_empty_string; + return String::Adopt(buffer); +diff --git a/third_party/blink/renderer/platform/text/text_break_iterator_icu.cc b/third_party/blink/renderer/platform/text/text_break_iterator_icu.cc +index 5bea007..0e8c60a 100644 +--- a/third_party/blink/renderer/platform/text/text_break_iterator_icu.cc ++++ b/third_party/blink/renderer/platform/text/text_break_iterator_icu.cc +@@ -312,13 +312,13 @@ + text->chunkOffset = offset <= std::numeric_limits::max() + ? static_cast(offset) + : 0; +- is_accessible = TRUE; ++ is_accessible = true; + return true; + } + if (native_index >= native_length && + text->chunkNativeLimit == native_length) { + text->chunkOffset = text->chunkLength; +- is_accessible = FALSE; ++ is_accessible = false; + return true; + } + } else { +@@ -331,12 +331,12 @@ + text->chunkOffset = offset <= std::numeric_limits::max() + ? static_cast(offset) + : 0; +- is_accessible = TRUE; ++ is_accessible = true; + return true; + } + if (native_index <= 0 && !text->chunkNativeStart) { + text->chunkOffset = 0; +- is_accessible = FALSE; ++ is_accessible = false; + return true; + } + } +@@ -347,7 +347,7 @@ + int64_t native_index, + UBool forward) { + if (!text->context) +- return FALSE; ++ return false; + int64_t native_length = TextNativeLength(text); + UBool is_accessible; + if (TextInChunkOrOutOfRange(text, native_index, native_length, forward, +@@ -371,7 +371,7 @@ + DCHECK_EQ(new_context, kPriorContext); + TextLatin1SwitchToPriorContext(text, native_index, native_length, forward); + } +- return TRUE; ++ return true; + } + + static const struct UTextFuncs kTextLatin1Funcs = { +@@ -511,7 +511,7 @@ + + static UBool TextUTF16Access(UText* text, int64_t native_index, UBool forward) { + if (!text->context) +- return FALSE; ++ return false; + int64_t native_length = TextNativeLength(text); + UBool is_accessible; + if (TextInChunkOrOutOfRange(text, native_index, native_length, forward, +@@ -533,7 +533,7 @@ + DCHECK_EQ(new_context, kPriorContext); + TextUTF16SwitchToPriorContext(text, native_index, native_length, forward); + } +- return TRUE; ++ return true; + } + + static const struct UTextFuncs kTextUTF16Funcs = { +diff --git a/third_party/blink/renderer/platform/text/unicode_utilities.cc b/third_party/blink/renderer/platform/text/unicode_utilities.cc +index 2cefd53..b8c4515 100644 +--- a/third_party/blink/renderer/platform/text/unicode_utilities.cc ++++ b/third_party/blink/renderer/platform/text/unicode_utilities.cc +@@ -300,7 +300,7 @@ + DCHECK(U_SUCCESS(status)); + int32_t input_length = static_cast(length); + // copy-on-write. +- icu::UnicodeString normalized(FALSE, characters, input_length); ++ icu::UnicodeString normalized(false, characters, input_length); + // In the vast majority of cases, input is already NFC. Run a quick check + // to avoid normalizing the entire input unnecessarily. + int32_t normalized_prefix_length = +diff --git a/third_party/blink/renderer/platform/wtf/text/text_codec_icu.cc b/third_party/blink/renderer/platform/wtf/text/text_codec_icu.cc +index b625735..fb8ab05 100644 +--- a/third_party/blink/renderer/platform/wtf/text/text_codec_icu.cc ++++ b/third_party/blink/renderer/platform/wtf/text/text_codec_icu.cc +@@ -327,7 +327,7 @@ + DLOG_IF(ERROR, err == U_AMBIGUOUS_ALIAS_WARNING) + << "ICU ambiguous alias warning for encoding: " << encoding_.GetName(); + if (converter_icu_) +- ucnv_setFallback(converter_icu_, TRUE); ++ ucnv_setFallback(converter_icu_, true); + } + + int TextCodecICU::DecodeToBuffer(UChar* target, +diff --git a/ui/base/l10n/formatter.cc b/ui/base/l10n/formatter.cc +index e4446d4..684ead8 100644 +--- a/ui/base/l10n/formatter.cc ++++ b/ui/base/l10n/formatter.cc +@@ -234,7 +234,7 @@ + int value, + icu::UnicodeString* formatted_string) const { + DCHECK(simple_format_[unit]); +- DCHECK(formatted_string->isEmpty() == TRUE); ++ DCHECK(formatted_string->isEmpty()); + UErrorCode error = U_ZERO_ERROR; + FormatNumberInPlural(*simple_format_[unit], + value, formatted_string, &error); +@@ -250,7 +250,7 @@ + << "Detailed() not implemented for your (format, length) combination!"; + DCHECK(detailed_format_[units][1]) + << "Detailed() not implemented for your (format, length) combination!"; +- DCHECK(formatted_string->isEmpty() == TRUE); ++ DCHECK(formatted_string->isEmpty()); + UErrorCode error = U_ZERO_ERROR; + FormatNumberInPlural(*detailed_format_[units][0], value_1, + formatted_string, &error); +@@ -283,7 +283,7 @@ + base::string16 pattern = l10n_util::GetStringUTF16(pluralities.id); + UErrorCode error = U_ZERO_ERROR; + std::unique_ptr format(new icu::MessageFormat( +- icu::UnicodeString(FALSE, pattern.data(), pattern.length()), error)); ++ icu::UnicodeString(false, pattern.data(), pattern.length()), error)); + DCHECK(U_SUCCESS(error)); + if (format.get()) + return format; diff --git a/www-client/chromium/files/chromium-87-v8-icu68.patch b/www-client/chromium/files/chromium-87-v8-icu68.patch new file mode 100644 index 00000000000..2c274dc1abb --- /dev/null +++ b/www-client/chromium/files/chromium-87-v8-icu68.patch @@ -0,0 +1,192 @@ +From b0a7f5691113534c2cf771f2dd3cece5e93bc7d4 Mon Sep 17 00:00:00 2001 +From: Frank Tang +Date: Tue, 03 Nov 2020 23:20:37 -0800 +Subject: [PATCH] Update to ICU68-1 + +ICU68-1 change the output skeleton format. So we need to change +resolvedOptions code for 68 migration. + +Chromium roll +https://chromium-review.googlesource.com/c/chromium/src/+/2474093 + +Bug: v8:10945 +Change-Id: I3b2c7fbe8abb22df8fa51287c498ca3245b8c55b +Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2477431 +Commit-Queue: Frank Tang +Reviewed-by: Jakob Kummerow +Reviewed-by: Shu-yu Guo +Cr-Commit-Position: refs/heads/master@{#70972} + +(ported to work with CurrencySignString(Isolate* isolate, + Handle UnitDisplayString(Isolate* isolate, + const icu::UnicodeString& skeleton) { + // Ex: skeleton as +- // "measure-unit/length-meter .### rounding-mode-half-up unit-width-full-name" ++ // =ICU-68.1: "unit/length-meter .### rounding-mode-half-up unit-width-full-name" + if (skeleton.indexOf("unit-width-full-name") >= 0) { + return ReadOnlyRoots(isolate).long_string_handle(); + } + // Ex: skeleton as +- // "measure-unit/length-meter .### rounding-mode-half-up unit-width-narrow". ++ // =ICU-68.1: "unit/length-meter .### rounding-mode-half-up unit-width-narrow". + if (skeleton.indexOf("unit-width-narrow") >= 0) { + return ReadOnlyRoots(isolate).narrow_string_handle(); + } + // Ex: skeleton as +- // "measure-unit/length-foot .### rounding-mode-half-up" ++ // =ICU-68.1: "unit/length-foot .### rounding-mode-half-up" + return ReadOnlyRoots(isolate).short_string_handle(); + } + +@@ -422,7 +425,8 @@ Notation NotationFromSkeleton(const icu::UnicodeString& skeleton) { + return Notation::COMPACT; + } + // Ex: skeleton as +- // "measure-unit/length-foot .### rounding-mode-half-up" ++ // =ICU-68.1: "unit/length-foot .### rounding-mode-half-up" + return Notation::STANDARD; + } + +@@ -562,14 +566,23 @@ namespace { + + // Ex: percent .### rounding-mode-half-up + // Special case for "percent" +-// Ex: "measure-unit/length-kilometer per-measure-unit/duration-hour .### +-// rounding-mode-half-up" should return "kilometer-per-unit". +-// Ex: "measure-unit/duration-year .### rounding-mode-half-up" should return +-// "year". ++// =ICU-68.1: ++// Ex: "unit/milliliter-per-acre .### rounding-mode-half-up" ++// should return "milliliter-per-acre". ++// Ex: "unit/year .### rounding-mode-half-up" should return ++// "year". + std::string UnitFromSkeleton(const icu::UnicodeString& skeleton) { + std::string str; + str = skeleton.toUTF8String(str); ++#if U_ICU_VERSION_MAJOR_NUM < 68 + std::string search("measure-unit/"); ++#else ++ std::string search("unit/"); ++#endif + size_t begin = str.find(search); + if (begin == str.npos) { + // Special case for "percent". +@@ -578,20 +591,41 @@ std::string UnitFromSkeleton(const icu::UnicodeString& skeleton) { + } + return ""; + } ++#if U_ICU_VERSION_MAJOR_NUM < 68 + // Skip the type (ex: "length"). + // "measure-unit/length-kilometer per-measure-unit/duration-hour" + // b + begin = str.find("-", begin + search.size()); ++#else ++ // Ex: ++ // "unit/acre .### rounding-mode-half-up" ++ // b ++ // Ex: ++ // "unit/milliliter-per-acre .### rounding-mode-half-up" ++ // b ++ begin += search.size(); ++#endif + if (begin == str.npos) { + return ""; + } ++#if U_ICU_VERSION_MAJOR_NUM < 68 + begin++; // Skip the '-'. ++#endif + // Find the end of the subtype. + size_t end = str.find(" ", begin); +- // "measure-unit/length-kilometer per-measure-unit/duration-hour" +- // b e ++ // =ICU-68.1: ++ // Ex: ++ // "unit/acre .### rounding-mode-half-up" ++ // b e ++ // Ex: ++ // "unit/milliliter-per-acre .### rounding-mode-half-up" ++ // b e + if (end == str.npos) { + end = str.size(); ++#if U_ICU_VERSION_MAJOR_NUM < 68 + return str.substr(begin, end - begin); + } + // "measure-unit/length-kilometer per-measure-unit/duration-hour" +@@ -625,17 +659,36 @@ std::string UnitFromSkeleton(const icu::UnicodeString& skeleton) { + // "measure-unit/length-kilometer per-measure-unit/duration-hour" + // [result ] b e + return result + "-per-" + str.substr(begin, end - begin); ++#else ++ } ++ return str.substr(begin, end - begin); ++#endif + } + + Style StyleFromSkeleton(const icu::UnicodeString& skeleton) { + if (skeleton.indexOf("currency/") >= 0) { + return Style::CURRENCY; + } ++#if U_ICU_VERSION_MAJOR_NUM < 68 + if (skeleton.indexOf("measure-unit/") >= 0) { + if (skeleton.indexOf("scale/100") >= 0 && + skeleton.indexOf("measure-unit/concentr-percent") >= 0) { ++#else ++ if (skeleton.indexOf("percent") >= 0) { ++ // percent precision-integer rounding-mode-half-up scale/100 ++ if (skeleton.indexOf("scale/100") >= 0) { ++#endif + return Style::PERCENT; ++#if U_ICU_VERSION_MAJOR_NUM >= 68 ++ } else { ++ return Style::UNIT; ++#endif + } ++#if U_ICU_VERSION_MAJOR_NUM >= 68 ++ } ++ // Before ICU68: "measure-unit/", since ICU68 "unit/" ++ if (skeleton.indexOf("unit/") >= 0) { ++#endif + return Style::UNIT; + } + return Style::DECIMAL; +diff --git a/v8/src/objects/js-relative-time-format.cc b/v8/src/objects/js-relative-time-format.cc +index 267343aaae..64d56a1c12 100644 +--- a/v8/src/objects/js-relative-time-format.cc ++++ b/v8/src/objects/js-relative-time-format.cc +@@ -195,9 +195,18 @@ MaybeHandle JSRelativeTimeFormat::New( + } + } + ++#if U_ICU_VERSION_MAJOR_NUM < 68 + icu::DecimalFormat* decimal_format = + static_cast(number_format); + decimal_format->setMinimumGroupingDigits(-2); ++#else ++ if (number_format->getDynamicClassID() == ++ icu::DecimalFormat::getStaticClassID()) { ++ icu::DecimalFormat* decimal_format = ++ static_cast(number_format); ++ decimal_format->setMinimumGroupingDigits(-2); ++ } ++#endif + + // Change UDISPCTX_CAPITALIZATION_NONE to other values if + // ECMA402 later include option to change capitalization.