commit:     7829629f04bdc7632cf54dbeec17cfca283a0ae0
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 21 15:11:25 2023 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Tue Mar 21 15:13:18 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7829629f

www-client/chromium: remove compiler checks from pkg_pretend

The clang-related dependencies may not be satisfied when pkg_pretend
runs.

Closes: https://bugs.gentoo.org/902489
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 www-client/chromium/chromium-111.0.5563.64.ebuild | 43 +++++++++++++----------
 1 file changed, 24 insertions(+), 19 deletions(-)

diff --git a/www-client/chromium/chromium-111.0.5563.64.ebuild 
b/www-client/chromium/chromium-111.0.5563.64.ebuild
index 11504b3f6f65..d41b4c6b4d15 100644
--- a/www-client/chromium/chromium-111.0.5563.64.ebuild
+++ b/www-client/chromium/chromium-111.0.5563.64.ebuild
@@ -254,25 +254,6 @@ llvm_check_deps() {
 }
 
 pre_build_checks() {
-       if [[ ${MERGE_TYPE} != binary ]]; then
-               [[ ${EBUILD_PHASE_FUNC} == pkg_setup ]] && ( use lto || use pgo 
) && llvm_pkg_setup
-
-               local -x CPP="$(tc-getCXX) -E"
-               if tc-is-gcc && ! ver_test "$(gcc-version)" -ge 10.4; then
-                       die "At least gcc 10.4 is required"
-               fi
-               if use pgo && tc-is-cross-compiler; then
-                       die "The pgo USE flag cannot be used when 
cross-compiling"
-               fi
-               if needs_clang || tc-is-clang; then
-                       tc-is-cross-compiler && CPP=${CBUILD}-clang++ || 
CPP=${CHOST}-clang++
-                       CPP+=" -E"
-                       if ! ver_test "$(clang-major-version)" -ge 13; then
-                               die "At least clang 13 is required"
-                       fi
-               fi
-       fi
-
        # Check build requirements, bug #541816 and bug #471810 .
        CHECKREQS_MEMORY="4G"
        CHECKREQS_DISK_BUILD="12G"
@@ -306,8 +287,32 @@ pkg_pretend() {
 }
 
 pkg_setup() {
+       if use lto || use pgo; then
+               llvm_pkg_setup
+       fi
+
        pre_build_checks
 
+       if [[ ${MERGE_TYPE} != binary ]]; then
+               local -x CPP="$(tc-getCXX) -E"
+               if tc-is-gcc && ! ver_test "$(gcc-version)" -ge 10.4; then
+                       die "At least gcc 10.4 is required"
+               fi
+               if use pgo && tc-is-cross-compiler; then
+                       die "The pgo USE flag cannot be used when 
cross-compiling"
+               fi
+               if needs_clang && ! tc-is-clang; then
+                       if tc-is-cross-compiler; then
+                               CPP="${CBUILD}-clang++ -E"
+                       else
+                               CPP="${CHOST}-clang++ -E"
+                       fi
+                       if ! ver_test "$(clang-major-version)" -ge 13; then
+                               die "At least clang 13 is required"
+                       fi
+               fi
+       fi
+
        chromium_suid_sandbox_check_kernel_config
 
        # nvidia-drivers does not work correctly with Wayland due to 
unsupported EGLStreams

Reply via email to