File 0001-Correctly-include-KSyntaxHighlighting-headers.patch of Package qt-creator.17641
From 4d9215e44d70c10be2c183592e8280c4d7292a83 Mon Sep 17 00:00:00 2001
From: Dmitry Shachnev <mitya57@gmail.com>
Date: Wed, 18 May 2022 18:03:22 +0300
Subject: [PATCH] Correctly include KSyntaxHighlighting headers
In external KSyntaxHighlighting, these headers now have paths like
/usr/include/KF5/KSyntaxHighlighting/KSyntaxHighlighting/AbstractHighlighter,
where /usr/include/KF5/KSyntaxHighlighting is passed to compiler as include
path.
Old headers which had only one KSyntaxHighlighting fragment in path were
removed in v5.94.0:
https://invent.kde.org/frameworks/syntax-highlighting/-/merge_requests/305
Adjust our vendored version to make the code work with both external and
vendored versions.
Change-Id: Iadcc668c3c705c563ae359301d227ee19eadca0f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
---
diff --git a/src/libs/3rdparty/syntax-highlighting/CMakeLists.txt b/src/libs/3rdparty/syntax-highlighting/CMakeLists.txt
index 4d352af..b168de5 100644
--- a/src/libs/3rdparty/syntax-highlighting/CMakeLists.txt
+++ b/src/libs/3rdparty/syntax-highlighting/CMakeLists.txt
@@ -9,6 +9,7 @@ add_qtc_library(KSyntaxHighlighting SHARED
INCLUDES autogenerated/
PUBLIC_INCLUDES
src/lib
+ autogenerated/include
autogenerated/src/lib
DEFINES KF5SyntaxHighlighting_EXPORTS
DEPENDS Qt5::Network Qt5::Widgets
@@ -43,7 +44,7 @@ add_qtc_library(KSyntaxHighlighting SHARED
src/lib/worddelimiters.cpp src/lib/worddelimiters_p.h
src/lib/xml_p.h
)
-qtc_add_public_header(autogenerated/src/lib/State)
+qtc_add_public_header(autogenerated/include/KSyntaxHighlighting/State)
if(TARGET KSyntaxHighlighting)
install(
diff --git a/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/AbstractHighlighter b/src/libs/3rdparty/syntax-highlighting/autogenerated/include/KSyntaxHighlighting/AbstractHighlighter
similarity index 100%
rename from src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/AbstractHighlighter
rename to src/libs/3rdparty/syntax-highlighting/autogenerated/include/KSyntaxHighlighting/AbstractHighlighter
diff --git a/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/Definition b/src/libs/3rdparty/syntax-highlighting/autogenerated/include/KSyntaxHighlighting/Definition
similarity index 100%
rename from src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/Definition
rename to src/libs/3rdparty/syntax-highlighting/autogenerated/include/KSyntaxHighlighting/Definition
diff --git a/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/DefinitionDownloader b/src/libs/3rdparty/syntax-highlighting/autogenerated/include/KSyntaxHighlighting/DefinitionDownloader
similarity index 100%
rename from src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/DefinitionDownloader
rename to src/libs/3rdparty/syntax-highlighting/autogenerated/include/KSyntaxHighlighting/DefinitionDownloader
diff --git a/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/FoldingRegion b/src/libs/3rdparty/syntax-highlighting/autogenerated/include/KSyntaxHighlighting/FoldingRegion
similarity index 100%
rename from src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/FoldingRegion
rename to src/libs/3rdparty/syntax-highlighting/autogenerated/include/KSyntaxHighlighting/FoldingRegion
diff --git a/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/Format b/src/libs/3rdparty/syntax-highlighting/autogenerated/include/KSyntaxHighlighting/Format
similarity index 100%
rename from src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/Format
rename to src/libs/3rdparty/syntax-highlighting/autogenerated/include/KSyntaxHighlighting/Format
diff --git a/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/Repository b/src/libs/3rdparty/syntax-highlighting/autogenerated/include/KSyntaxHighlighting/Repository
similarity index 100%
rename from src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/Repository
rename to src/libs/3rdparty/syntax-highlighting/autogenerated/include/KSyntaxHighlighting/Repository
diff --git a/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/State b/src/libs/3rdparty/syntax-highlighting/autogenerated/include/KSyntaxHighlighting/State
similarity index 100%
rename from src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/State
rename to src/libs/3rdparty/syntax-highlighting/autogenerated/include/KSyntaxHighlighting/State
diff --git a/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/SyntaxHighlighter b/src/libs/3rdparty/syntax-highlighting/autogenerated/include/KSyntaxHighlighting/SyntaxHighlighter
similarity index 100%
rename from src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/SyntaxHighlighter
rename to src/libs/3rdparty/syntax-highlighting/autogenerated/include/KSyntaxHighlighting/SyntaxHighlighter
diff --git a/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/Theme b/src/libs/3rdparty/syntax-highlighting/autogenerated/include/KSyntaxHighlighting/Theme
similarity index 100%
rename from src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/Theme
rename to src/libs/3rdparty/syntax-highlighting/autogenerated/include/KSyntaxHighlighting/Theme
diff --git a/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/WildcardMatcher b/src/libs/3rdparty/syntax-highlighting/autogenerated/include/KSyntaxHighlighting/WildcardMatcher
similarity index 100%
rename from src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/WildcardMatcher
rename to src/libs/3rdparty/syntax-highlighting/autogenerated/include/KSyntaxHighlighting/WildcardMatcher
diff --git a/src/libs/3rdparty/syntax-highlighting/patches/0003-Add-qmake-Qbs-files-and-files-generated-by-CMake.patch b/src/libs/3rdparty/syntax-highlighting/patches/0003-Add-qmake-Qbs-files-and-files-generated-by-CMake.patch
index c35188f..2d74873 100644
--- a/src/libs/3rdparty/syntax-highlighting/patches/0003-Add-qmake-Qbs-files-and-files-generated-by-CMake.patch
+++ b/src/libs/3rdparty/syntax-highlighting/patches/0003-Add-qmake-Qbs-files-and-files-generated-by-CMake.patch
@@ -4,34 +4,34 @@ Date: Tue, 12 Feb 2019 19:45:08 +0100
Subject: [PATCH 3/6] Add qmake/Qbs files and files generated by CMake
---
- autogenerated/autogenerated.pri | 9 ++
+ autogenerated/autogenerated.pri | 10 +++
+ .../KSyntaxHighlighting/AbstractHighlighter | 1 +
+ .../include/KSyntaxHighlighting/Definition | 1 +
+ .../include/KSyntaxHighlighting/FoldingRegion | 1 +
+ .../include/KSyntaxHighlighting/Format | 1 +
+ .../include/KSyntaxHighlighting/Repository | 1 +
+ .../include/KSyntaxHighlighting/State | 1 +
+ .../KSyntaxHighlighting/SyntaxHighlighter | 1 +
+ .../include/KSyntaxHighlighting/Theme | 1 +
autogenerated/ksyntaxhighlighting_version.h | 12 +++
- autogenerated/src/lib/AbstractHighlighter | 1 +
- autogenerated/src/lib/Definition | 1 +
- autogenerated/src/lib/FoldingRegion | 1 +
- autogenerated/src/lib/Format | 1 +
- autogenerated/src/lib/Repository | 1 +
- autogenerated/src/lib/State | 1 +
- autogenerated/src/lib/SyntaxHighlighter | 1 +
- autogenerated/src/lib/Theme | 1 +
.../src/lib/ksyntaxhighlighting_logging.cpp | 11 +++
.../src/lib/ksyntaxhighlighting_logging.h | 11 +++
data/data.pro | 11 +++
src/lib/ksyntaxhighlighting_export.h | 34 +++++++
syntax-highlighting.pro | 55 ++++++++++++
- syntax-highlighting.qbs | 88 +++++++++++++++++++
+ syntax-highlighting.qbs | 90 +++++++++++++++++++
syntax-highlighting_dependencies.pri | 3 +
- 17 files changed, 242 insertions(+)
+ 17 files changed, 245 insertions(+)
create mode 100644 autogenerated/autogenerated.pri
+ create mode 100644 autogenerated/include/KSyntaxHighlighting/AbstractHighlighter
+ create mode 100644 autogenerated/include/KSyntaxHighlighting/Definition
+ create mode 100644 autogenerated/include/KSyntaxHighlighting/FoldingRegion
+ create mode 100644 autogenerated/include/KSyntaxHighlighting/Format
+ create mode 100644 autogenerated/include/KSyntaxHighlighting/Repository
+ create mode 100644 autogenerated/include/KSyntaxHighlighting/State
+ create mode 100644 autogenerated/include/KSyntaxHighlighting/SyntaxHighlighter
+ create mode 100644 autogenerated/include/KSyntaxHighlighting/Theme
create mode 100644 autogenerated/ksyntaxhighlighting_version.h
- create mode 100644 autogenerated/src/lib/AbstractHighlighter
- create mode 100644 autogenerated/src/lib/Definition
- create mode 100644 autogenerated/src/lib/FoldingRegion
- create mode 100644 autogenerated/src/lib/Format
- create mode 100644 autogenerated/src/lib/Repository
- create mode 100644 autogenerated/src/lib/State
- create mode 100644 autogenerated/src/lib/SyntaxHighlighter
- create mode 100644 autogenerated/src/lib/Theme
create mode 100644 autogenerated/src/lib/ksyntaxhighlighting_logging.cpp
create mode 100644 autogenerated/src/lib/ksyntaxhighlighting_logging.h
create mode 100644 data/data.pro
@@ -42,10 +42,11 @@ Subject: [PATCH 3/6] Add qmake/Qbs files and files generated by CMake
diff --git a/autogenerated/autogenerated.pri b/autogenerated/autogenerated.pri
new file mode 100644
-index 0000000..aee620a
+index 0000000..4121aaf
--- /dev/null
+++ b/autogenerated/autogenerated.pri
-@@ -0,0 +1,9 @@
+@@ -0,0 +1,10 @@
++INCLUDEPATH *= $$PWD/include
+INCLUDEPATH *= $$PWD/src/lib
+INCLUDEPATH *= $$PWD
+
@@ -55,80 +56,80 @@ index 0000000..aee620a
+HEADERS += \
+ $$PWD/ksyntaxhighlighting_version.h \
+ $$PWD/src/lib/ksyntaxhighlighting_logging.h
-diff --git a/autogenerated/ksyntaxhighlighting_version.h b/autogenerated/ksyntaxhighlighting_version.h
-new file mode 100644
-index 0000000..bd31a4d
---- /dev/null
-+++ b/autogenerated/ksyntaxhighlighting_version.h
-@@ -0,0 +1,12 @@
-+// This file was generated by ecm_setup_version(): DO NOT EDIT!
-+
-+#ifndef SyntaxHighlighting_VERSION_H
-+#define SyntaxHighlighting_VERSION_H
-+
-+#define SyntaxHighlighting_VERSION_STRING "5.52.0"
-+#define SyntaxHighlighting_VERSION_MAJOR 5
-+#define SyntaxHighlighting_VERSION_MINOR 52
-+#define SyntaxHighlighting_VERSION_PATCH 0
-+#define SyntaxHighlighting_VERSION ((5<<16)|(52<<8)|(0))
-+
-+#endif
-diff --git a/autogenerated/src/lib/AbstractHighlighter b/autogenerated/src/lib/AbstractHighlighter
+diff --git a/autogenerated/include/KSyntaxHighlighting/AbstractHighlighter b/autogenerated/include/KSyntaxHighlighting/AbstractHighlighter
new file mode 100644
index 0000000..b787873
--- /dev/null
-+++ b/autogenerated/src/lib/AbstractHighlighter
++++ b/autogenerated/include/KSyntaxHighlighting/AbstractHighlighter
@@ -0,0 +1 @@
+#include "abstracthighlighter.h"
-diff --git a/autogenerated/src/lib/Definition b/autogenerated/src/lib/Definition
+diff --git a/autogenerated/include/KSyntaxHighlighting/Definition b/autogenerated/include/KSyntaxHighlighting/Definition
new file mode 100644
index 0000000..2c3241f
--- /dev/null
-+++ b/autogenerated/src/lib/Definition
++++ b/autogenerated/include/KSyntaxHighlighting/Definition
@@ -0,0 +1 @@
+#include "definition.h"
-diff --git a/autogenerated/src/lib/FoldingRegion b/autogenerated/src/lib/FoldingRegion
+diff --git a/autogenerated/include/KSyntaxHighlighting/FoldingRegion b/autogenerated/include/KSyntaxHighlighting/FoldingRegion
new file mode 100644
index 0000000..005b829
--- /dev/null
-+++ b/autogenerated/src/lib/FoldingRegion
++++ b/autogenerated/include/KSyntaxHighlighting/FoldingRegion
@@ -0,0 +1 @@
+#include "foldingregion.h"
-diff --git a/autogenerated/src/lib/Format b/autogenerated/src/lib/Format
+diff --git a/autogenerated/include/KSyntaxHighlighting/Format b/autogenerated/include/KSyntaxHighlighting/Format
new file mode 100644
index 0000000..b0d6a10
--- /dev/null
-+++ b/autogenerated/src/lib/Format
++++ b/autogenerated/include/KSyntaxHighlighting/Format
@@ -0,0 +1 @@
+#include "format.h"
-diff --git a/autogenerated/src/lib/Repository b/autogenerated/src/lib/Repository
+diff --git a/autogenerated/include/KSyntaxHighlighting/Repository b/autogenerated/include/KSyntaxHighlighting/Repository
new file mode 100644
index 0000000..189dbc2
--- /dev/null
-+++ b/autogenerated/src/lib/Repository
++++ b/autogenerated/include/KSyntaxHighlighting/Repository
@@ -0,0 +1 @@
+#include "repository.h"
-diff --git a/autogenerated/src/lib/State b/autogenerated/src/lib/State
+diff --git a/autogenerated/include/KSyntaxHighlighting/State b/autogenerated/include/KSyntaxHighlighting/State
new file mode 100644
index 0000000..e148d70
--- /dev/null
-+++ b/autogenerated/src/lib/State
++++ b/autogenerated/include/KSyntaxHighlighting/State
@@ -0,0 +1 @@
+#include "state.h"
-diff --git a/autogenerated/src/lib/SyntaxHighlighter b/autogenerated/src/lib/SyntaxHighlighter
+diff --git a/autogenerated/include/KSyntaxHighlighting/SyntaxHighlighter b/autogenerated/include/KSyntaxHighlighting/SyntaxHighlighter
new file mode 100644
index 0000000..b429824
--- /dev/null
-+++ b/autogenerated/src/lib/SyntaxHighlighter
++++ b/autogenerated/include/KSyntaxHighlighting/SyntaxHighlighter
@@ -0,0 +1 @@
+#include "syntaxhighlighter.h"
-diff --git a/autogenerated/src/lib/Theme b/autogenerated/src/lib/Theme
+diff --git a/autogenerated/include/KSyntaxHighlighting/Theme b/autogenerated/include/KSyntaxHighlighting/Theme
new file mode 100644
index 0000000..34a3e98
--- /dev/null
-+++ b/autogenerated/src/lib/Theme
++++ b/autogenerated/include/KSyntaxHighlighting/Theme
@@ -0,0 +1 @@
+#include "theme.h"
+diff --git a/autogenerated/ksyntaxhighlighting_version.h b/autogenerated/ksyntaxhighlighting_version.h
+new file mode 100644
+index 0000000..4336b19
+--- /dev/null
++++ b/autogenerated/ksyntaxhighlighting_version.h
+@@ -0,0 +1,12 @@
++// This file was generated by ecm_setup_version(): DO NOT EDIT!
++
++#ifndef SyntaxHighlighting_VERSION_H
++#define SyntaxHighlighting_VERSION_H
++
++#define SyntaxHighlighting_VERSION_STRING "5.90.0"
++#define SyntaxHighlighting_VERSION_MAJOR 5
++#define SyntaxHighlighting_VERSION_MINOR 90
++#define SyntaxHighlighting_VERSION_PATCH 0
++#define SyntaxHighlighting_VERSION ((5<<16)|(90<<8)|(0))
++
++#endif
diff --git a/autogenerated/src/lib/ksyntaxhighlighting_logging.cpp b/autogenerated/src/lib/ksyntaxhighlighting_logging.cpp
new file mode 100644
index 0000000..4082ac4
@@ -283,10 +284,10 @@ index 0000000..38127e1
+ src/lib/wildcardmatcher.cpp \
diff --git a/syntax-highlighting.qbs b/syntax-highlighting.qbs
new file mode 100644
-index 0000000..248ebe0
+index 0000000..4f6de09
--- /dev/null
+++ b/syntax-highlighting.qbs
-@@ -0,0 +1,88 @@
+@@ -0,0 +1,90 @@
+import qbs 1.0
+import qbs.File
+import qbs.FileInfo
@@ -324,6 +325,7 @@ index 0000000..248ebe0
+ cpp.defines: base.concat("KSYNTAXHIGHLIGHTING_LIBRARY")
+ cpp.includePaths: [
+ product.sourceDirectory + "/src/lib/",
++ product.sourceDirectory + "/autogenerated/include/",
+ product.sourceDirectory + "/autogenerated/src/lib/",
+ product.sourceDirectory + "/autogenerated/"
+ ]
@@ -370,6 +372,7 @@ index 0000000..248ebe0
+ Depends { name: "cpp" }
+ cpp.includePaths: [
+ product.sourceDirectory + "/src/lib/",
++ product.sourceDirectory + "/autogenerated/include/",
+ product.sourceDirectory + "/autogenerated/src/lib/",
+ ]
+ }
diff --git a/src/libs/3rdparty/syntax-highlighting/syntax-highlighting.qbs b/src/libs/3rdparty/syntax-highlighting/syntax-highlighting.qbs
index 82b5ea8..5dbb334 100644
--- a/src/libs/3rdparty/syntax-highlighting/syntax-highlighting.qbs
+++ b/src/libs/3rdparty/syntax-highlighting/syntax-highlighting.qbs
@@ -28,6 +28,7 @@ Project {
cpp.defines: base.concat("KF5SyntaxHighlighting_EXPORTS")
cpp.includePaths: [
product.sourceDirectory + "/src/lib/",
+ product.sourceDirectory + "/autogenerated/include/",
product.sourceDirectory + "/autogenerated/src/lib/",
product.sourceDirectory + "/autogenerated/"
]
@@ -122,6 +123,7 @@ Project {
Depends { name: "cpp" }
cpp.includePaths: [
exportingProduct.sourceDirectory + "/src/lib/",
+ exportingProduct.sourceDirectory + "/autogenerated/include/",
exportingProduct.sourceDirectory + "/autogenerated/src/lib/",
]
}
diff --git a/src/plugins/texteditor/highlighter.cpp b/src/plugins/texteditor/highlighter.cpp
index 5a7cb01..50b8c6a 100644
--- a/src/plugins/texteditor/highlighter.cpp
+++ b/src/plugins/texteditor/highlighter.cpp
@@ -38,11 +38,11 @@
#include <utils/qtcassert.h>
#include <utils/stylehelper.h>
-#include <DefinitionDownloader>
-#include <FoldingRegion>
-#include <Format>
-#include <Repository>
-#include <SyntaxHighlighter>
+#include <KSyntaxHighlighting/DefinitionDownloader>
+#include <KSyntaxHighlighting/FoldingRegion>
+#include <KSyntaxHighlighting/Format>
+#include <KSyntaxHighlighting/Repository>
+#include <KSyntaxHighlighting/SyntaxHighlighter>
#include <QLoggingCategory>
#include <QMetaEnum>
diff --git a/src/plugins/texteditor/highlighter.h b/src/plugins/texteditor/highlighter.h
index e18a67e..3127589 100644
--- a/src/plugins/texteditor/highlighter.h
+++ b/src/plugins/texteditor/highlighter.h
@@ -29,8 +29,8 @@
#include <utils/fileutils.h>
-#include <AbstractHighlighter>
-#include <Definition>
+#include <KSyntaxHighlighting/AbstractHighlighter>
+#include <KSyntaxHighlighting/Definition>
namespace TextEditor {
class TextDocument;
diff --git a/src/plugins/texteditor/textdocumentlayout.h b/src/plugins/texteditor/textdocumentlayout.h
index 69034bf..3bed9f7 100644
--- a/src/plugins/texteditor/textdocumentlayout.h
+++ b/src/plugins/texteditor/textdocumentlayout.h
@@ -32,7 +32,7 @@
#include <utils/id.h>
-#include <State>
+#include <KSyntaxHighlighting/State>
#include <QTextBlockUserData>
#include <QPlainTextDocumentLayout>