diff --git a/.gitignore b/.gitignore index 7c2acfb..abcaf8a 100644 --- a/.gitignore +++ b/.gitignore @@ -140,3 +140,5 @@ /qt-creator-opensource-src-10.0.0-beta2.tar.xz /cmake-15.0.7.src.tar.xz /qt-creator-opensource-src-10.0.0.tar.xz +/cmake-16.0.0.src.tar.xz +/clang-16.0.0.src.tar.xz diff --git a/clangFormat.patch b/clangFormat.patch index 39d6c0c..e69de29 100644 --- a/clangFormat.patch +++ b/clangFormat.patch @@ -1,146 +0,0 @@ -diff -rupN clang/clang-15.0.7.src/include/clang/Format/Format.h clang-new/clang-15.0.7.src/include/clang/Format/Format.h ---- clang/clang-15.0.7.src/include/clang/Format/Format.h 2022-09-05 11:48:03.000000000 +0200 -+++ clang-new/clang-15.0.7.src/include/clang/Format/Format.h 2022-09-17 11:39:02.794594747 +0200 -@@ -22,6 +22,8 @@ - #include "llvm/Support/SourceMgr.h" - #include - -+#define KEEP_LINE_BREAKS_FOR_NON_EMPTY_LINES_BACKPORTED -+ - namespace llvm { - namespace vfs { - class FileSystem; -@@ -2551,6 +2553,16 @@ struct FormatStyle { - bool JavaScriptWrapImports; - // clang-format on - -+ /// If true, no line breaks are optimized out (works only with ColumnLimit = 0) -+ /// \code -+ /// true: false: -+ /// int foo(int a, vs. int foo(int a, int b) { -+ /// int b) { -+ /// bar(); bar(); -+ /// } } -+ /// \endcode -+ bool KeepLineBreaksForNonEmptyLines; -+ - /// If true, the empty line at the start of blocks is kept. - /// \code - /// true: false: -@@ -3920,6 +3932,7 @@ struct FormatStyle { - JavaImportGroups == R.JavaImportGroups && - JavaScriptQuotes == R.JavaScriptQuotes && - JavaScriptWrapImports == R.JavaScriptWrapImports && -+ KeepLineBreaksForNonEmptyLines == R.KeepLineBreaksForNonEmptyLines && - KeepEmptyLinesAtTheStartOfBlocks == - R.KeepEmptyLinesAtTheStartOfBlocks && - LambdaBodyIndentation == R.LambdaBodyIndentation && -diff -rupN clang/clang-15.0.7.src/lib/Format/Format.cpp clang-new/clang-15.0.7.src/lib/Format/Format.cpp ---- clang/clang-15.0.7.src/lib/Format/Format.cpp 2022-09-05 11:48:03.000000000 +0200 -+++ clang-new/clang-15.0.7.src/lib/Format/Format.cpp 2022-09-17 11:39:02.796594746 +0200 -@@ -814,6 +814,8 @@ template <> struct MappingTraitsFirst->MustBreakBefore && -+ Style.KeepLineBreaksForNonEmptyLines)) { - const ParenState &P = State.Stack.back(); - - int AdditionalIndent = -@@ -1020,10 +1021,10 @@ protected: - } - - ContinuationIndenter *Indenter; -+ const FormatStyle &Style; - - private: - WhitespaceManager *Whitespaces; -- const FormatStyle &Style; - UnwrappedLineFormatter *BlockFormatter; - }; - -@@ -1046,7 +1047,7 @@ public: - while (State.NextToken) { - bool Newline = - Indenter->mustBreak(State) || -- (Indenter->canBreak(State) && State.NextToken->NewlinesBefore > 0); -+ (State.NextToken->NewlinesBefore > 0 && Indenter->canBreak(State)); - unsigned Penalty = 0; - formatChildren(State, Newline, /*DryRun=*/false, Penalty); - Indenter->addTokenToState(State, Newline, /*DryRun=*/false); -diff -rupN clang/clang-15.0.7.src/lib/Format/UnwrappedLineParser.cpp clang-new/clang-15.0.7.src/lib/Format/UnwrappedLineParser.cpp ---- clang/clang-15.0.7.src/lib/Format/UnwrappedLineParser.cpp 2022-09-05 11:48:03.000000000 +0200 -+++ clang-new/clang-15.0.7.src/lib/Format/UnwrappedLineParser.cpp 2022-09-17 11:39:53.737590983 +0200 -@@ -4186,6 +4186,8 @@ void UnwrappedLineParser::nextToken(int - else - readTokenWithJavaScriptASI(); - FormatTok->Previous = Previous; -+ if (FormatTok->NewlinesBefore && Style.KeepLineBreaksForNonEmptyLines) -+ FormatTok->MustBreakBefore = true; - if (Style.isVerilog()) { - // Blocks in Verilog can have `begin` and `end` instead of braces. For - // keywords like `begin`, we can't treat them the same as left braces -diff -rupN clang/clang-15.0.7.src/unittests/Format/FormatTest.cpp clang-new/clang-15.0.7.src/unittests/Format/FormatTest.cpp ---- clang/clang-15.0.7.src/unittests/Format/FormatTest.cpp 2022-09-05 11:48:03.000000000 +0200 -+++ clang-new/clang-15.0.7.src/unittests/Format/FormatTest.cpp 2022-09-17 11:39:02.810594745 +0200 -@@ -527,6 +527,22 @@ TEST_F(FormatTest, RemovesEmptyLines) { - " void funk() {}\n" - "};", - Style)); -+ -+ Style.KeepLineBreaksForNonEmptyLines = true; -+ Style.ColumnLimit = 0; -+ EXPECT_EQ("int foo(int a,\n" -+ " int b)\n" -+ "{\n" -+ "}", -+ format("int foo(int a,\n" -+ "int b) {}", -+ Style)); -+ -+ EXPECT_EQ("[]() {\n" -+ " foo(); }", -+ format("[]() {\n" -+ "foo(); }", -+ Style)); - } - - TEST_F(FormatTest, RecognizesBinaryOperatorKeywords) { diff --git a/qt-creator-clangformat.patch b/qt-creator-clangformat.patch index 61e76e7..b228ea2 100644 --- a/qt-creator-clangformat.patch +++ b/qt-creator-clangformat.patch @@ -11,7 +11,7 @@ diff -rupN --no-dereference qt-creator-opensource-src-10.0.0/cmake/FindClang.cma +else() + set(CLANG_FORMAT_INC_DIR "." CACHE STRING "Base path to clang includes") + set(CLANG_FORMAT_LIB_DIR "." CACHE STRING "Base path to clang libs") -+ foreach(lib in LIST clangFormat clangToolingCore clangRewrite clangLex clangBasic clangToolingInclusions clangAST) ++ foreach(lib in LIST clangFormat clangToolingCore clangRewrite clangLex clangBasic clangToolingInclusions) + add_library(${lib} STATIC IMPORTED) + set_property(TARGET ${lib} PROPERTY IMPORTED_LOCATION ${CLANG_FORMAT_LIB_DIR}/lib${lib}.a) + endforeach() @@ -27,7 +27,7 @@ diff -rupN --no-dereference qt-creator-opensource-src-10.0.0/src/plugins/clangfo - CONDITION TARGET ${CLANG_FORMAT_LIB} AND LLVM_PACKAGE_VERSION VERSION_GREATER_EQUAL 10.0.0 AND (QTC_CLANG_BUILDMODE_MATCH OR CLANGTOOLING_LINK_CLANG_DYLIB) - DEPENDS Utils Qt::Widgets ${CLANG_FORMAT_LIB} + CONDITION TARGET clangFormat AND (QTC_CLANG_BUILDMODE_MATCH OR CLANGTOOLING_LINK_CLANG_DYLIB) -+ DEPENDS Utils Qt::Widgets clangFormat clangToolingCore clangRewrite clangLex clangBasic clangToolingInclusions clangAST ++ DEPENDS Utils Qt::Widgets clangFormat clangToolingCore clangRewrite clangLex clangBasic clangToolingInclusions PLUGIN_DEPENDS Core TextEditor CppEditor ProjectExplorer SOURCES clangformatbaseindenter.cpp clangformatbaseindenter.h diff --git a/qt-creator.spec b/qt-creator.spec index 0588e4a..05f2e43 100644 --- a/qt-creator.spec +++ b/qt-creator.spec @@ -4,11 +4,11 @@ # is not a valid python file, only for the IDE %global _python_bytecompile_errors_terminate_build 0 -%global clangver 15.0.7 +%global clangver 16.0.0 Name: qt-creator Version: 10.0.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Cross-platform IDE for Qt License: GPLv3 with exceptions @@ -216,7 +216,10 @@ diff -u %{SOURCE1} $outfile %changelog -* Tue Apr 04 2023 Jan Grulich +* Thu Apr 06 2023 Sandro Mani - 10.0.0-3 +- Switch to clang-16 + +* Tue Apr 04 2023 Jan Grulich - 10.0.0-2 - Rebuild (qt6) * Wed Mar 29 2023 Sandro Mani - 10.0.0-1 diff --git a/sources b/sources index a57b9ee..39a7288 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (clang-15.0.7.src.tar.xz) = 9fd2736a9f5993ddbb5b3c507fe497234a6def64f6f418f379d1ca56c9c361ad1ae9a5445ab938230fbc1671ec00b4f802a412b048569023863c20dc6bb46a1f -SHA512 (cmake-15.0.7.src.tar.xz) = 85097a6eaee0df004567905f7e5ce8ca02e3b46c6fc66fa552fe99734642e6ee61685de4e5e6e8b505963334d7b91d98ecd9c5870e6bdd3f0018ee5b963ffa96 +SHA512 (cmake-16.0.0.src.tar.xz) = 4f21461aa8165061dbea47dcda4f098957e16bd307484bcb66884cf5a0776197f69a74002d5601229c4630db53ac44049f3f2ce1e96a6bb16ba3df828d387932 +SHA512 (clang-16.0.0.src.tar.xz) = 2a6ff3b4d61b4e9fcb60a6d9dae451170cd91acc25f924a29c18c579ee78af76d2d5eebb2940d61676e2e791fb247ccf9f5377b5528f3a0fa7dd0ac8e72816ba SHA512 (qt-creator-opensource-src-10.0.0.tar.xz) = 33087c1ca4557a62e03b9a8213d1e00abda78cac09320421497e9908eef3bd454a60e968d7898f9928f90cbf1cdd5c1bea42f1d3f6f9f1095f9a2a24c78a5a01