commit:     65fb81e5c9c2fba626f0d7a6ede88e7ac2e97336
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat May 17 15:38:55 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat May 17 15:40:48 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=65fb81e5

app-office/libreoffice: drop USE=clang

It was added originally for Skia issues w/o Clang and we removed
the warning for that a while ago: 326d52937573cf713dd070d23573b8deb5c9ede8.

There's no need for any of this anymore. Users can set Clang via package.env
if they really want.

Bug: https://bugs.gentoo.org/739134
Bug: https://bugs.gentoo.org/915673
Bug: https://bugs.gentoo.org/953422
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../libreoffice/libreoffice-25.2.9999.ebuild       | 53 ++++----------------
 app-office/libreoffice/libreoffice-9999.ebuild     | 56 ++++------------------
 2 files changed, 16 insertions(+), 93 deletions(-)

diff --git a/app-office/libreoffice/libreoffice-25.2.9999.ebuild 
b/app-office/libreoffice/libreoffice-25.2.9999.ebuild
index a5f3743dc44e..545b86c9f74d 100644
--- a/app-office/libreoffice/libreoffice-25.2.9999.ebuild
+++ b/app-office/libreoffice/libreoffice-25.2.9999.ebuild
@@ -92,7 +92,7 @@ KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86 
~amd64-linux"
 # Extensions that need extra work:
 LO_EXTS="nlpsolver scripting-beanshell scripting-javascript wiki-publisher"
 
-IUSE="accessibility base bluetooth +branding clang coinmp +cups custom-cflags 
+dbus debug eds
+IUSE="accessibility base bluetooth +branding coinmp +cups custom-cflags +dbus 
debug eds
 googledrive gstreamer +gtk3 gtk4 kde ldap +mariadb odk pdfimport postgres qt6 
test valgrind vulkan
 $(printf 'libreoffice_extensions_%s ' ${LO_EXTS})"
 
@@ -275,23 +275,6 @@ BDEPEND="
        sys-apps/which
        sys-devel/gettext
        virtual/pkgconfig
-       clang? ( || (
-               (       llvm-core/clang:19
-                       llvm-core/llvm:19
-                       =llvm-core/lld-19*      )
-               (       llvm-core/clang:18
-                       llvm-core/llvm:18
-                       =llvm-core/lld-18*      )
-               (       llvm-core/clang:17
-                       llvm-core/llvm:17
-                       =llvm-core/lld-17*      )
-               (       llvm-core/clang:16
-                       llvm-core/llvm:16
-                       =llvm-core/lld-16*      )
-               (       llvm-core/clang:15
-                       llvm-core/llvm:15
-                       =llvm-core/lld-15*      )
-       ) )
        odk? ( >=app-text/doxygen-1.8.4 )
 "
 if [[ ${MY_PV} != *9999* ]] && [[ ${PV} != *_* ]]; then
@@ -459,31 +442,9 @@ src_configure() {
        # Workaround for bug #915067
        append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
 
-       if use clang ; then
-               # Force clang
-               einfo "Enforcing the use of clang due to USE=clang ..."
-               AR=llvm-ar
-               CC=${CHOST}-clang
-               CXX=${CHOST}-clang++
-               NM=llvm-nm
-               RANLIB=llvm-ranlib
-               LDFLAGS+=" -fuse-ld=lld"
-
-               # Not implemented by Clang, bug #903889
-               filter-flags -Wlto-type-mismatch -Werror=lto-type-mismatch
-       else
-               # Force gcc
-               einfo "Enforcing the use of gcc due to USE=-clang ..."
-               AR=gcc-ar
-               CC=${CHOST}-gcc
-               CXX=${CHOST}-g++
-               NM=gcc-nm
-               RANLIB=gcc-ranlib
-
-               # Apparently the Clang flags get used even for GCC builds 
sometimes.
-               # bug #838115
-               sed -i -e "s/-flto=thin/-flto/" 
solenv/gbuild/platform/com_GCC_defs.mk || die
-       fi
+       # Apparently the Clang flags get used even for GCC builds sometimes.
+       # bug #838115
+       sed -i -e "s/-flto=thin/-flto/" solenv/gbuild/platform/com_GCC_defs.mk 
|| die
 
        # ODR violations (not just in skia/vulkan): bug #916435
        # Runtime crashes with Clang: bug #907905
@@ -496,8 +457,10 @@ src_configure() {
                strip-flags
        fi
 
-       export LO_CLANG_CC=${CC}
-       export LO_CLANG_CXX=${CXX}
+       if tc-is-clang ; then
+               export LO_CLANG_CC=${CC}
+               export LO_CLANG_CXX=${CXX}
+       fi
 
        # Show flags set at the end
        einfo "  Used CFLAGS:    ${CFLAGS}"

diff --git a/app-office/libreoffice/libreoffice-9999.ebuild 
b/app-office/libreoffice/libreoffice-9999.ebuild
index 6737987e46d3..8826430b1a2d 100644
--- a/app-office/libreoffice/libreoffice-9999.ebuild
+++ b/app-office/libreoffice/libreoffice-9999.ebuild
@@ -92,7 +92,7 @@ KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86 
~amd64-linux"
 # Extensions that need extra work:
 LO_EXTS="nlpsolver scripting-beanshell scripting-javascript wiki-publisher"
 
-IUSE="accessibility base bluetooth +branding clang coinmp +cups custom-cflags 
+dbus debug eds
+IUSE="accessibility base bluetooth +branding coinmp +cups custom-cflags +dbus 
debug eds
 googledrive gstreamer gtk kde ldap +mariadb odk pdfimport postgres qt6 test 
valgrind vulkan
 $(printf 'libreoffice_extensions_%s ' ${LO_EXTS})"
 
@@ -267,26 +267,6 @@ BDEPEND="
        sys-apps/which
        sys-devel/gettext
        virtual/pkgconfig
-       clang? ( || (
-               (       llvm-core/clang:20
-                       llvm-core/llvm:20
-                       =llvm-core/lld-20*      )
-               (       llvm-core/clang:19
-                       llvm-core/llvm:19
-                       =llvm-core/lld-19*      )
-               (       llvm-core/clang:18
-                       llvm-core/llvm:18
-                       =llvm-core/lld-18*      )
-               (       llvm-core/clang:17
-                       llvm-core/llvm:17
-                       =llvm-core/lld-17*      )
-               (       llvm-core/clang:16
-                       llvm-core/llvm:16
-                       =llvm-core/lld-16*      )
-               (       llvm-core/clang:15
-                       llvm-core/llvm:15
-                       =llvm-core/lld-15*      )
-       ) )
        odk? ( >=app-text/doxygen-1.8.4 )
 "
 if [[ ${MY_PV} != *9999* ]] && [[ ${PV} != *_* ]]; then
@@ -450,31 +430,9 @@ src_configure() {
        # Workaround for bug #915067
        append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
 
-       if use clang ; then
-               # Force clang
-               einfo "Enforcing the use of clang due to USE=clang ..."
-               AR=llvm-ar
-               CC=${CHOST}-clang
-               CXX=${CHOST}-clang++
-               NM=llvm-nm
-               RANLIB=llvm-ranlib
-               LDFLAGS+=" -fuse-ld=lld"
-
-               # Not implemented by Clang, bug #903889
-               filter-flags -Wlto-type-mismatch -Werror=lto-type-mismatch
-       else
-               # Force gcc
-               einfo "Enforcing the use of gcc due to USE=-clang ..."
-               AR=gcc-ar
-               CC=${CHOST}-gcc
-               CXX=${CHOST}-g++
-               NM=gcc-nm
-               RANLIB=gcc-ranlib
-
-               # Apparently the Clang flags get used even for GCC builds 
sometimes.
-               # bug #838115
-               sed -i -e "s/-flto=thin/-flto/" 
solenv/gbuild/platform/com_GCC_defs.mk || die
-       fi
+       # Apparently the Clang flags get used even for GCC builds sometimes.
+       # bug #838115
+       sed -i -e "s/-flto=thin/-flto/" solenv/gbuild/platform/com_GCC_defs.mk 
|| die
 
        # ODR violations (not just in skia/vulkan): bug #916435
        # Runtime crashes with Clang: bug #907905
@@ -487,8 +445,10 @@ src_configure() {
                strip-flags
        fi
 
-       export LO_CLANG_CC=${CC}
-       export LO_CLANG_CXX=${CXX}
+       if tc-is-clang ; then
+               export LO_CLANG_CC=${CC}
+               export LO_CLANG_CXX=${CXX}
+       fi
 
        # Show flags set at the end
        einfo "  Used CFLAGS:    ${CFLAGS}"

Reply via email to