From 5d53ec47661b9e23dad278e2d3ae1a6faa52f404 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Sat, 3 Feb 2024 22:41:33 -0500 Subject: apparently rust is required now? --- www-client/chromium/chromium-123.0.6272.2.ebuild | 34 +++++++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) (limited to 'www-client/chromium/chromium-123.0.6272.2.ebuild') diff --git a/www-client/chromium/chromium-123.0.6272.2.ebuild b/www-client/chromium/chromium-123.0.6272.2.ebuild index 9699d2e..f0efc89 100644 --- a/www-client/chromium/chromium-123.0.6272.2.ebuild +++ b/www-client/chromium/chromium-123.0.6272.2.ebuild @@ -5,6 +5,7 @@ EAPI=8 PYTHON_COMPAT=( python3_{9..11} ) PYTHON_REQ_USE="xml(+)" LLVM_MAX_SLOT=17 +RUST_MIN_VER=1.72.0 CHROMIUM_LANGS="af 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 @@ -171,6 +172,7 @@ BDEPEND=" >=dev-util/web_page_replay_go-20220314 $(depend_clang_llvm_versions 17) ) + >=dev-lang/rust-${RUST_MIN_VER}[profiler] dev-lang/perl >=dev-util/gn-0.1807 >=dev-util/gperf-3.0.3 @@ -324,7 +326,6 @@ src_prepare() { "${FILESDIR}/chromium-118-material-color-utils.patch" "${FILESDIR}/chromium-118-freetype-blink.patch" "${FILESDIR}/chromium-121-blink_libxml2_downgrade.patch" - "${FILESDIR}/chromium-123-qrgen-disablerust.patch" "${FILESDIR}/chromium-121-icu74.patch" "${FILESDIR}/chromium-111-InkDropHost-crash.patch" @@ -333,6 +334,10 @@ src_prepare() { "${FILESDIR}/chromium-cross-compile.patch" ) + sed -i -e \ + "/if (is_clang && toolchain_has_rust) {/,+2d" \ + build/config/compiler/BUILD.gn || die "Failed to disable bundled compiler builtins" + default mkdir -p third_party/node/linux/node-linux-x64/bin || die @@ -520,6 +525,7 @@ src_prepare() { third_party/pyyaml third_party/qcms third_party/rnnoise + third_party/rust third_party/s2cellid third_party/securemessage third_party/selenium-atoms @@ -645,6 +651,17 @@ src_prepare() { ln -s "${EPREFIX}"/bin/true buildtools/third_party/eu-strip/bin/eu-strip || die } +chromium_rust_version_check() { + [[ ${MERGE_TYPE} == binary ]] && return + local rustc_version=( $(eselect --brief rust show 2>/dev/null) ) + rustc_version=${rustc_version[0]#rust-bin-} + rustc_version=${rustc_version#rust-} + + [[ -z "${rustc_version}" ]] && die "Failed to determine rust version, check 'eselect rust' output" + + echo $rustc_version +} + chromium_configure() { # Calling this here supports resumption via FEATURES=keepwork python_setup @@ -713,6 +730,18 @@ chromium_configure() { myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:default\"" fi + local rustc_ver + rustc_ver=$(chromium_rust_version_check) + if ver_test "${rustc_ver}" -lt "${RUST_MIN_VER}"; then + eerror "Rust >=${RUST_MIN_VER} is required" + eerror "Please run 'eselect rust' and select the correct rust version" + die "Selected rust version is too old" + else + einfo "Using rust ${rustc_ver} to build" + fi + myconf_gn+=" rust_sysroot_absolute=\"${EPREFIX}/usr/lib/rust/${rustc_ver}/\"" + myconf_gn+=" rustc_version=\"${rustc_ver}\"" + # Create dummy pkg-config file for libsystemd, only dependency of installer mkdir "${T}/libsystemd" || die cat <<- EOF > "${T}/libsystemd/libsystemd.pc" @@ -722,9 +751,6 @@ chromium_configure() { EOF local -x PKG_CONFIG_PATH="${PKG_CONFIG_PATH:+"${PKG_CONFIG_PATH}:"}${T}/libsystemd" - # Disable rust for now; it's only used for testing and we don't need the additional bdep - myconf_gn+=" enable_rust=false" - # GN needs explicit config for Debug/Release as opposed to inferring it from build directory. myconf_gn+=" is_debug=false" -- cgit v1.2.3