commit:     c7eeefaef05e0014713eef90e3ff50f21f11346d
Author:     Peter Levine <plevine457 <AT> gmail <DOT> com>
AuthorDate: Tue May 19 03:16:47 2020 +0000
Commit:     Jason A. Donenfeld <zx2c4 <AT> gentoo <DOT> org>
CommitDate: Thu Jun 25 07:11:07 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c7eeefae

dev-qt/qt-creator: Build against dev-libs/libclangformat-ide

Build against a patched libclangFormat in the correct slot for a fully
functional clangformat plugin.

Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Peter Levine <plevine457 <AT> gmail.com>
Signed-off-by: Jason A. Donenfeld <zx2c4 <AT> gentoo.org>

 .../qt-creator-4.12.0-libclangformat-ide.patch     | 64 ++++++++++++++++++++++
 dev-qt/qt-creator/qt-creator-9999.ebuild           | 14 +++--
 2 files changed, 74 insertions(+), 4 deletions(-)

diff --git a/dev-qt/qt-creator/files/qt-creator-4.12.0-libclangformat-ide.patch 
b/dev-qt/qt-creator/files/qt-creator-4.12.0-libclangformat-ide.patch
new file mode 100644
index 00000000000..12c46c89ed0
--- /dev/null
+++ b/dev-qt/qt-creator/files/qt-creator-4.12.0-libclangformat-ide.patch
@@ -0,0 +1,64 @@
+--- a/src/plugins/clangformat/clangformatbaseindenter.h
++++ b/src/plugins/clangformat/clangformatbaseindenter.h
+@@ -27,7 +27,7 @@
+ 
+ #include <texteditor/indenter.h>
+ 
+-#include <clang/Format/Format.h>
++#include <clang/Format/FormatIDE.h>
+ 
+ namespace ClangFormat {
+ 
+--- a/src/plugins/clangformat/clangformatconfigwidget.cpp
++++ b/src/plugins/clangformat/clangformatconfigwidget.cpp
+@@ -32,7 +32,7 @@
+ #include "ui_clangformatchecks.h"
+ #include "ui_clangformatconfigwidget.h"
+ 
+-#include <clang/Format/Format.h>
++#include <clang/Format/FormatIDE.h>
+ 
+ #include <coreplugin/icore.h>
+ #include <cppeditor/cpphighlighter.h>
+--- a/src/plugins/clangformat/clangformatplugin.cpp
++++ b/src/plugins/clangformat/clangformatplugin.cpp
+@@ -56,7 +56,7 @@
+ #include <texteditor/icodestylepreferences.h>
+ #include <texteditor/texteditorsettings.h>
+ 
+-#include <clang/Format/Format.h>
++#include <clang/Format/FormatIDE.h>
+ 
+ #include <utils/algorithm.h>
+ 
+--- a/src/plugins/clangformat/clangformatutils.h
++++ b/src/plugins/clangformat/clangformatutils.h
+@@ -27,7 +27,7 @@
+ 
+ #include <coreplugin/id.h>
+ #include <utils/fileutils.h>
+-#include <clang/Format/Format.h>
++#include <clang/Format/FormatIDE.h>
+ 
+ #include <QFile>
+ 
+--- a/src/shared/clang/clang_installation.pri
++++ b/src/shared/clang/clang_installation.pri
+@@ -227,7 +227,7 @@
+         CLANGFORMAT_MAIN_HEADER = $$LLVM_INCLUDEPATH/clang/Format/Format.h
+         exists($$CLANGFORMAT_MAIN_HEADER) {
+             
exists($${LLVM_LIBDIR}/libclangFormat.so*)|exists($${LLVM_LIBDIR}/libclangFormat.dylib)
 {
+-                CLANGFORMAT_LIBS=-lclangFormat -lclangToolingInclusions 
-lclangToolingCore -lclangRewrite -lclangLex -lclangBasic
++                CLANGFORMAT_LIBS=-lclangFormatIDE -lclangToolingInclusions 
-lclangToolingCore -lclangRewrite -lclangLex -lclangBasic
+                 ALL_CLANG_LIBS=-lclangFormat -lclangToolingInclusions 
-lclangTooling -lclangToolingCore \
+                            -lclangRewrite -lclangIndex -lclangFrontend 
-lclangParse -lclangSerialization \
+                            -lclangSema -lclangEdit -lclangAnalysis 
-lclangDriver -lclangDynamicASTMatchers \
+@@ -235,7 +235,7 @@
+                 win32:CLANGFORMAT_LIBS += -lversion
+                 win32:ALL_CLANG_LIBS += -lversion
+             } else {
+-                CLANGFORMAT_LIBS=-lclang-cpp
++                CLANGFORMAT_LIBS=-lclangFormatIDE -lclang-cpp
+                 ALL_CLANG_LIBS=-lclang-cpp
+             }
+         }

diff --git a/dev-qt/qt-creator/qt-creator-9999.ebuild 
b/dev-qt/qt-creator/qt-creator-9999.ebuild
index 3f09133f6ee..ff58c169e4e 100644
--- a/dev-qt/qt-creator/qt-creator-9999.ebuild
+++ b/dev-qt/qt-creator/qt-creator-9999.ebuild
@@ -68,8 +68,10 @@ CDEPEND="
        kde-frameworks/syntax-highlighting:5
        clang? (
                || (
-                       sys-devel/clang:10
-                       sys-devel/clang:9
+                       ( sys-devel/clang:10
+                               dev-libs/libclangformat-ide:10 )
+                       ( sys-devel/clang:9
+                               dev-libs/libclangformat-ide:9 )
                )
                <sys-devel/clang-$((LLVM_MAX_SLOT + 1)):=
        )
@@ -110,10 +112,14 @@ for x in ${PLOCALES}; do
 done
 unset x
 
-PATCHES=( "${FILESDIR}"/${PN}-4.12.0-dylib-fix.patch )
+PATCHES=(
+       "${FILESDIR}"/${PN}-4.12.0-dylib-fix.patch
+       "${FILESDIR}"/${PN}-4.12.0-libclangformat-ide.patch
+)
 
 llvm_check_deps() {
-       has_version -d "sys-devel/clang:${LLVM_SLOT}"
+       has_version -d "sys-devel/clang:${LLVM_SLOT}" && \
+               has_version -d "dev-libs/libclangformat-ide:${LLVM_SLOT}"
 }
 
 pkg_setup() {

Reply via email to