commit:     f467a5768a9098bdf81aec76c7fd6392dc74ca6c
Author:     Jimi Huotari <chiitoo <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 14 15:56:09 2022 +0000
Commit:     Jimi Huotari <chiitoo <AT> gentoo <DOT> org>
CommitDate: Fri Oct 14 16:00:13 2022 +0000
URL:        https://gitweb.gentoo.org/proj/qt.git/commit/?id=f467a576

dev-qt/qttools: fix linguist build with clang 15

Closes: https://bugs.gentoo.org/873640
Thanks-to: cyrillic <cyrilmaley <AT> hotmail.com>
Tested-by: Bernd Waibel <waebbl-gentoo <AT> posteo.net>
Signed-off-by: Jimi Huotari <chiitoo <AT> gentoo.org>

 .../files/qttools-6.4.0-clang-15-build.patch       | 75 ++++++++++++++++++++++
 dev-qt/qttools/qttools-6.4.0.ebuild                |  4 ++
 2 files changed, 79 insertions(+)

diff --git a/dev-qt/qttools/files/qttools-6.4.0-clang-15-build.patch 
b/dev-qt/qttools/files/qttools-6.4.0-clang-15-build.patch
new file mode 100644
index 00000000..71219885
--- /dev/null
+++ b/dev-qt/qttools/files/qttools-6.4.0-clang-15-build.patch
@@ -0,0 +1,75 @@
+Gentoo Bug: https://bugs.gentoo.org/873640
+Qt Bug: https://bugreports.qt.io/browse/QTBUG-106224
+Patch: https://codereview.qt-project.org/c/qt/qttools/+/430427
+
+From d5142f3ad86f1cc685a36e1cd4c8a401d8842f01 Mon Sep 17 00:00:00 2001
+From: =?utf8?q?Bernhard=20Rosenkr=C3=A4nzer?= <b...@lindev.ch>
+Date: Fri, 2 Sep 2022 19:11:27 +0200
+Subject: [PATCH] lupdate: Port to clang 15.0
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf8
+Content-Transfer-Encoding: 8bit
+
+Clang 15.0 changes the API of InclusionDirective a little,
+passing an llvm::Optional<clang::FileEntryRef> instead of
+a const clang::FileEntry *
+
+Adapt lupdate accordingly.
+
+Signed-off-by: Bernhard Rosenkränzer <b...@lindev.ch>
+Change-Id: I9a5d8b54a8c223d06c439d8a17539c8e64c3e0a2
+---
+ src/linguist/lupdate/lupdatepreprocessoraction.cpp | 11 ++++++++++-
+ src/linguist/lupdate/lupdatepreprocessoraction.h   |  7 ++++++-
+ 2 files changed, 16 insertions(+), 2 deletions(-)
+
+diff --git a/src/linguist/lupdate/lupdatepreprocessoraction.cpp 
b/src/linguist/lupdate/lupdatepreprocessoraction.cpp
+index d7446c364e..91c061721e 100644
+--- a/src/linguist/lupdate/lupdatepreprocessoraction.cpp
++++ b/src/linguist/lupdate/lupdatepreprocessoraction.cpp
+@@ -156,14 +156,23 @@ void 
LupdatePPCallbacks::SourceRangeSkipped(clang::SourceRange sourceRange,
+ // To list the included files
+ void LupdatePPCallbacks::InclusionDirective(clang::SourceLocation /*hashLoc*/,
+     const clang::Token & /*includeTok*/, clang::StringRef /*fileName*/, bool 
/*isAngled*/,
+-    clang::CharSourceRange /*filenameRange*/, const clang::FileEntry *file,
++    clang::CharSourceRange /*filenameRange*/,
++#if LLVM_VERSION_MAJOR < 15
++    const clang::FileEntry *file,
++#else
++    llvm::Optional<clang::FileEntryRef> file,
++#endif
+     clang::StringRef /*searchPath*/, clang::StringRef /*relativePath*/,
+     const clang::Module */*imported*/, clang::SrcMgr::CharacteristicKind 
/*fileType*/)
+ {
+     if (!file)
+         return;
+ 
++#if LLVM_VERSION_MAJOR < 15
+     clang::StringRef fileNameRealPath = file->tryGetRealPathName();
++#else
++    clang::StringRef fileNameRealPath = 
file->getFileEntry().tryGetRealPathName();
++#endif
+     if (!LupdatePrivate::isFileSignificant(fileNameRealPath.str()))
+         return;
+ 
+diff --git a/src/linguist/lupdate/lupdatepreprocessoraction.h 
b/src/linguist/lupdate/lupdatepreprocessoraction.h
+index b1ee468d4e..b615c8a213 100644
+--- a/src/linguist/lupdate/lupdatepreprocessoraction.h
++++ b/src/linguist/lupdate/lupdatepreprocessoraction.h
+@@ -51,7 +51,12 @@ private:
+     void SourceRangeSkipped(clang::SourceRange sourceRange, 
clang::SourceLocation endifLoc) override;
+     void InclusionDirective(clang::SourceLocation /*hashLoc*/, const 
clang::Token &/*includeTok*/,
+                             clang::StringRef /*fileName*/, bool /*isAngled*/,
+-                            clang::CharSourceRange /*filenameRange*/, const 
clang::FileEntry *file,
++                            clang::CharSourceRange /*filenameRange*/,
++#if LLVM_VERSION_MAJOR < 15
++                            const clang::FileEntry *file,
++#else
++                            llvm::Optional<clang::FileEntryRef> file,
++#endif
+                             clang::StringRef /*searchPath*/, clang::StringRef 
/*relativePath*/,
+                             const clang::Module */*imported*/,
+                             clang::SrcMgr::CharacteristicKind /*fileType*/) 
override;
+-- 
+2.16.3
+

diff --git a/dev-qt/qttools/qttools-6.4.0.ebuild 
b/dev-qt/qttools/qttools-6.4.0.ebuild
index 23e1c087..5ba47589 100644
--- a/dev-qt/qttools/qttools-6.4.0.ebuild
+++ b/dev-qt/qttools/qttools-6.4.0.ebuild
@@ -32,6 +32,10 @@ DEPEND="
 "
 RDEPEND="${DEPEND}"
 
+PATCHES=(
+       "${FILESDIR}/${PN}-6.4.0-clang-15-build.patch" # Bug 873640
+)
+
 src_configure() {
        local mycmakeargs=(
                $(qt_feature assistant)

Reply via email to