commit:     2a8261f17c36e7abbe38717a8f4b8a9b2c5e8868
Author:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
AuthorDate: Fri Oct  6 07:34:05 2023 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Fri Oct  6 07:43:16 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2a8261f1

dev-python/shiboken2: adjust clang header finding logic for clang>=16

Pyside2 currently fails with clang-16, so we have to keep the current
LLVM_MAX_SLOT. However we can adjust the logic here to keep it in sync with
shiboken6 and prepare it for a possible next release that may be compatible
with clang-16.

Co-authored-by: Alfred Wingate <parona <AT> protonmail.com>
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>

 .../{shiboken2-5.15.10-r1.ebuild => shiboken2-5.15.10-r2.ebuild} | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/dev-python/shiboken2/shiboken2-5.15.10-r1.ebuild 
b/dev-python/shiboken2/shiboken2-5.15.10-r2.ebuild
similarity index 96%
rename from dev-python/shiboken2/shiboken2-5.15.10-r1.ebuild
rename to dev-python/shiboken2/shiboken2-5.15.10-r2.ebuild
index b47b73c5ae04..f83d6000ad45 100644
--- a/dev-python/shiboken2/shiboken2-5.15.10-r1.ebuild
+++ b/dev-python/shiboken2/shiboken2-5.15.10-r2.ebuild
@@ -86,6 +86,13 @@ src_prepare() {
                        ApiExtractor/clangparser/compilersupport.cpp || die
        fi
 
+       local clangver="$(CPP=clang clang-major-version)"
+
+       # Clang 15 and older used the full version as a directory name.
+       if [[ ${clangver} -lt 16 ]]; then
+               clangver="$(CPP=clang clang-fullversion)"
+       fi
+
        # Shiboken2 assumes the 
"/usr/lib/clang/${CLANG_NEWEST_VERSION}/include/"
        # subdirectory provides Clang builtin includes (e.g., "stddef.h") for 
the
        # currently installed version of Clang, where ${CLANG_NEWEST_VERSION} is
@@ -101,7 +108,7 @@ src_prepare() {
        # PySide2 does *NOT* care whether the end user has done so or not, as
        # PySide2 unconditionally requires Clang in either case. See also:
        #     https://bugs.gentoo.org/619490
-       sed -i -e 
's~(findClangBuiltInIncludesDir())~(QStringLiteral("'"${EPREFIX}"'/usr/lib/clang/'$(CPP=clang
 clang-fullversion)'/include"))~' \
+       sed -i -e 
's~(findClangBuiltInIncludesDir())~(QStringLiteral("'"${EPREFIX}"'/usr/lib/clang/'"${clangver}"'/include"))~'
 \
                ApiExtractor/clangparser/compilersupport.cpp || die
 
        cmake_src_prepare

Reply via email to