commit:     c5246513ad3ef0044d063f5bb5a0246f8cc9cd1a
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Oct  7 13:26:04 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Oct  7 13:38:12 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c5246513

sys-devel/llvm: Add git commit id to SOVERSION suffix for 16.x

Include a shortened git commit id in the LLVM version suffix of live
and snapshot ebuilds of 16.x branch.  Since the ABI of this branch
is not yet stable, using unique SOVERSIONs can avoid immediate breakage
when using the same clang version as the compiler.

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 sys-devel/llvm/llvm-16.0.0.9999.ebuild        | 11 ++++++++++-
 sys-devel/llvm/llvm-16.0.0_pre20221006.ebuild | 11 ++++++++++-
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/sys-devel/llvm/llvm-16.0.0.9999.ebuild 
b/sys-devel/llvm/llvm-16.0.0.9999.ebuild
index b306d267303c..63c986a698a5 100644
--- a/sys-devel/llvm/llvm-16.0.0.9999.ebuild
+++ b/sys-devel/llvm/llvm-16.0.0.9999.ebuild
@@ -385,15 +385,24 @@ multilib_src_configure() {
                -DOCAMLFIND=NO
        )
 
+       local suffix=
+       if [[ -n ${EGIT_VERSION} && ${EGIT_BRANCH} != release/* ]]; then
+               # the ABI of the main branch is not stable, so let's include
+               # the commit id in the SOVERSION to contain the breakage
+               suffix+="git${EGIT_VERSION::8}"
+       fi
        if is_libcxx_linked; then
                # Smart hack: alter version suffix -> SOVERSION when linking
                # against libc++. This way we won't end up mixing LLVM libc++
                # libraries with libstdc++ clang, and the other way around.
+               suffix+="+libcxx"
                mycmakeargs+=(
-                       -DLLVM_VERSION_SUFFIX="libcxx"
                        -DLLVM_ENABLE_LIBCXX=ON
                )
        fi
+       mycmakeargs+=(
+               -DLLVM_VERSION_SUFFIX="${suffix}"
+       )
 
 #      Note: go bindings have no CMake rules at the moment
 #      but let's kill the check in case they are introduced

diff --git a/sys-devel/llvm/llvm-16.0.0_pre20221006.ebuild 
b/sys-devel/llvm/llvm-16.0.0_pre20221006.ebuild
index b306d267303c..63c986a698a5 100644
--- a/sys-devel/llvm/llvm-16.0.0_pre20221006.ebuild
+++ b/sys-devel/llvm/llvm-16.0.0_pre20221006.ebuild
@@ -385,15 +385,24 @@ multilib_src_configure() {
                -DOCAMLFIND=NO
        )
 
+       local suffix=
+       if [[ -n ${EGIT_VERSION} && ${EGIT_BRANCH} != release/* ]]; then
+               # the ABI of the main branch is not stable, so let's include
+               # the commit id in the SOVERSION to contain the breakage
+               suffix+="git${EGIT_VERSION::8}"
+       fi
        if is_libcxx_linked; then
                # Smart hack: alter version suffix -> SOVERSION when linking
                # against libc++. This way we won't end up mixing LLVM libc++
                # libraries with libstdc++ clang, and the other way around.
+               suffix+="+libcxx"
                mycmakeargs+=(
-                       -DLLVM_VERSION_SUFFIX="libcxx"
                        -DLLVM_ENABLE_LIBCXX=ON
                )
        fi
+       mycmakeargs+=(
+               -DLLVM_VERSION_SUFFIX="${suffix}"
+       )
 
 #      Note: go bindings have no CMake rules at the moment
 #      but let's kill the check in case they are introduced

Reply via email to