commit:     3f9e88471ffe3aa048e513c18b82f15702fab04f
Author:     Stephan Hartmann <sultan <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 15 11:54:22 2022 +0000
Commit:     Stephan Hartmann <sultan <AT> gentoo <DOT> org>
CommitDate: Thu Dec 15 11:56:39 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3f9e8847

www-client/chromium: fix cross compiling with qt5

Signed-off-by: Stephan Hartmann <sultan <AT> gentoo.org>

 www-client/chromium/chromium-108.0.5359.124.ebuild | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/www-client/chromium/chromium-108.0.5359.124.ebuild 
b/www-client/chromium/chromium-108.0.5359.124.ebuild
index 467c429a2729..46391da7fd60 100644
--- a/www-client/chromium/chromium-108.0.5359.124.ebuild
+++ b/www-client/chromium/chromium-108.0.5359.124.ebuild
@@ -169,6 +169,9 @@ BDEPEND="
                dev-python/setuptools[${PYTHON_USEDEP}]
        ')
        >=app-arch/gzip-1.7
+       !headless? (
+               qt5? ( dev-qt/qtcore:5 )
+       )
        libcxx? ( >=sys-devel/clang-13 )
        lto? ( $(depend_clang_llvm_versions 13 14 15) )
        pgo? (
@@ -941,7 +944,16 @@ chromium_configure() {
                myconf_gn+=" use_system_libdrm=true"
                myconf_gn+=" use_system_minigbm=true"
                myconf_gn+=" use_xkbcommon=true"
-               use qt5 && export PATH="${PATH}:$(qt5_get_bindir)"
+               if use qt5; then
+                       local moc_dir="$(qt5_get_bindir)"
+                       if tc-is-cross-compiler; then
+                               # Hack to workaround get_libdir not being able 
to handle CBUILD, bug #794181
+                               local cbuild_libdir=$($(tc-getBUILD_PKG_CONFIG) 
--keep-system-libs --libs-only-L libxslt)
+                               cbuild_libdir=${cbuild_libdir:2}
+                               moc_dir="${EPREFIX}"/${cbuild_libdir/% }/qt5/bin
+                       fi
+                       export PATH="${PATH}:${moc_dir}"
+               fi
                myconf_gn+=" use_qt=$(usex qt5 true false)"
                myconf_gn+=" ozone_platform_x11=$(usex X true false)"
                myconf_gn+=" ozone_platform_wayland=$(usex wayland true false)"

Reply via email to