1 |
commit: 93e60138b73fb5f06b207c433976881aa25a2226 |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Dec 31 19:13:11 2019 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Dec 31 19:14:53 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=93e60138 |
7 |
|
8 |
kde-frameworks/kdoctools: Use upstream docbundledir patch |
9 |
|
10 |
See also: https://phabricator.kde.org/D26306 |
11 |
|
12 |
Package-Manager: Portage-2.3.84, Repoman-2.3.20 |
13 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
14 |
|
15 |
.../kdoctools-5.54.0-gentoo-docbundledir.patch | 26 ---- |
16 |
.../files/kdoctools-5.66.0-docbundledir.patch | 160 +++++++++++++++++++++ |
17 |
kde-frameworks/kdoctools/kdoctools-9999.ebuild | 2 +- |
18 |
3 files changed, 161 insertions(+), 27 deletions(-) |
19 |
|
20 |
diff --git a/kde-frameworks/kdoctools/files/kdoctools-5.54.0-gentoo-docbundledir.patch b/kde-frameworks/kdoctools/files/kdoctools-5.54.0-gentoo-docbundledir.patch |
21 |
deleted file mode 100644 |
22 |
index cb6c35f19f..0000000000 |
23 |
--- a/kde-frameworks/kdoctools/files/kdoctools-5.54.0-gentoo-docbundledir.patch |
24 |
+++ /dev/null |
25 |
@@ -1,26 +0,0 @@ |
26 |
-From 79f31819b95fcb0bd3d30630f769706923d41609 Mon Sep 17 00:00:00 2001 |
27 |
-From: Andreas Sturmlechner <asturm@g.o> |
28 |
-Date: Mon, 28 Jan 2019 22:50:56 +0100 |
29 |
-Subject: [PATCH] xslt.cpp: Add /usr/share/help dir to list of paths containing |
30 |
- documentation |
31 |
- |
32 |
---- |
33 |
- src/xslt.cpp | 4 +++- |
34 |
- 1 file changed, 3 insertions(+), 1 deletion(-) |
35 |
- |
36 |
-diff --git a/src/xslt.cpp b/src/xslt.cpp |
37 |
-index 1000e33..a0fbe4c 100644 |
38 |
---- a/src/xslt.cpp |
39 |
-+++ b/src/xslt.cpp |
40 |
-@@ -494,5 +494,7 @@ QStringList getKDocToolsCatalogs() |
41 |
- QStringList KDocTools::documentationDirs() |
42 |
- { |
43 |
- /* List of paths containing documentation */ |
44 |
-- return QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("doc/HTML"), QStandardPaths::LocateDirectory); |
45 |
-+ QStringList docDirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("help"), QStandardPaths::LocateDirectory); |
46 |
-+ docDirs.append(QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("doc/HTML"), QStandardPaths::LocateDirectory)); |
47 |
-+ return docDirs; |
48 |
- } |
49 |
--- |
50 |
-2.20.1 |
51 |
- |
52 |
|
53 |
diff --git a/kde-frameworks/kdoctools/files/kdoctools-5.66.0-docbundledir.patch b/kde-frameworks/kdoctools/files/kdoctools-5.66.0-docbundledir.patch |
54 |
new file mode 100644 |
55 |
index 0000000000..640e4d8342 |
56 |
--- /dev/null |
57 |
+++ b/kde-frameworks/kdoctools/files/kdoctools-5.66.0-docbundledir.patch |
58 |
@@ -0,0 +1,160 @@ |
59 |
+diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt |
60 |
+--- a/autotests/CMakeLists.txt |
61 |
++++ b/autotests/CMakeLists.txt |
62 |
+@@ -1,3 +1,40 @@ |
63 |
++include(ECMMarkAsTest) |
64 |
++ |
65 |
++find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core Test) |
66 |
++ |
67 |
++find_package(LibXslt REQUIRED) |
68 |
++find_package(LibXml2 REQUIRED) |
69 |
++ |
70 |
++include_directories( ${LIBXML2_INCLUDE_DIR} ${LIBXSLT_INCLUDE_DIR} ) |
71 |
++ |
72 |
++include_directories(${CMAKE_CURRENT_BINARY_DIR}/../src) |
73 |
++include_directories(${CMAKE_CURRENT_BINARY_DIR}/..) |
74 |
++ |
75 |
++add_definitions(-DSIMPLE_XSLT) |
76 |
++ |
77 |
++function(kdoctools_define_document_test basetest) |
78 |
++ set(documentdirstest_SRCS |
79 |
++ ${basetest}.cpp |
80 |
++ ../src/xslt.cpp |
81 |
++ ${CMAKE_CURRENT_BINARY_DIR}/../src/loggingcategory.cpp |
82 |
++ ) |
83 |
++ |
84 |
++ add_executable(${basetest} ${documentdirstest_SRCS}) |
85 |
++ target_link_libraries(${basetest} |
86 |
++ Qt5::Core Qt5::Test |
87 |
++ ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${LIBXSLT_EXSLT_LIBRARIES} |
88 |
++ ) |
89 |
++ |
90 |
++ add_test(NAME ${basetest} COMMAND ${basetest}) |
91 |
++ ecm_mark_as_test(${basetest}) |
92 |
++endfunction() |
93 |
++ |
94 |
++kdoctools_define_document_test(documentdirstest) |
95 |
++ |
96 |
++kdoctools_define_document_test(documentcustomdirtest) |
97 |
++# custom path, used by the test |
98 |
++target_compile_definitions(documentcustomdirtest PRIVATE KDOCTOOLS_CUSTOM_DOC_PATH="/usr/share/doc/kde/HTML") |
99 |
++ |
100 |
+ add_test( |
101 |
+ NAME meinproc_template |
102 |
+ COMMAND meinproc5 --srcdir ${CMAKE_CURRENT_BINARY_DIR}/../src ${CMAKE_CURRENT_SOURCE_DIR}/../src/template.docbook |
103 |
+diff --git a/autotests/documentcustomdirtest.cpp b/autotests/documentcustomdirtest.cpp |
104 |
+new file mode 100644 |
105 |
+--- /dev/null |
106 |
++++ b/autotests/documentcustomdirtest.cpp |
107 |
+@@ -0,0 +1,37 @@ |
108 |
++#include <QDebug> |
109 |
++#include <QRegularExpression> |
110 |
++#include <QTest> |
111 |
++ |
112 |
++#include "../src/docbookxslt.h" |
113 |
++#include "config-kdoctools.h" |
114 |
++#include "loggingcategory.h" |
115 |
++ |
116 |
++using namespace KDocTools; |
117 |
++ |
118 |
++class documentCustomDirTest: public QObject |
119 |
++{ |
120 |
++ Q_OBJECT |
121 |
++private Q_SLOTS: |
122 |
++ void testDirsContent(); |
123 |
++}; |
124 |
++ |
125 |
++void documentCustomDirTest::testDirsContent() |
126 |
++{ |
127 |
++ const QStringList docDirs = documentationDirs(); |
128 |
++ QVERIFY(docDirs.size() >= 1); |
129 |
++ /* DOCBUNDLEDIR (one of its matches) must be the first element */ |
130 |
++ QVERIFY(docDirs[0].indexOf(QRegularExpression(QStringLiteral(KDOCTOOLS_DOCBUNDLEDIR))) >= 0); |
131 |
++ /* Check all the other items that should be there; |
132 |
++ check the last occurrence, as each locateAll can return more items |
133 |
++ and also some of them may match KDOCTOOLS_DOCBUNDLEDIR */ |
134 |
++ int position_dir_doc_HTML = docDirs.lastIndexOf(QRegularExpression(QStringLiteral(".*/doc/HTML$"))); |
135 |
++ QVERIFY(position_dir_doc_HTML >= 0); |
136 |
++ int position_dir_help = docDirs.lastIndexOf(QRegularExpression(QStringLiteral(".*/help$"))); |
137 |
++ QVERIFY(position_dir_help >= 0); |
138 |
++ /* The custom directory */ |
139 |
++ int position_dir_custom = docDirs.lastIndexOf(QStringLiteral(KDOCTOOLS_CUSTOM_DOC_PATH)); |
140 |
++ QVERIFY(position_dir_custom >= 0); |
141 |
++} |
142 |
++ |
143 |
++QTEST_MAIN(documentCustomDirTest) |
144 |
++#include "documentcustomdirtest.moc" |
145 |
+diff --git a/autotests/documentdirstest.cpp b/autotests/documentdirstest.cpp |
146 |
+new file mode 100644 |
147 |
+--- /dev/null |
148 |
++++ b/autotests/documentdirstest.cpp |
149 |
+@@ -0,0 +1,34 @@ |
150 |
++#include <QDebug> |
151 |
++#include <QRegularExpression> |
152 |
++#include <QTest> |
153 |
++ |
154 |
++#include "../src/docbookxslt.h" |
155 |
++#include "config-kdoctools.h" |
156 |
++#include "loggingcategory.h" |
157 |
++ |
158 |
++using namespace KDocTools; |
159 |
++ |
160 |
++class documentDirsTest: public QObject |
161 |
++{ |
162 |
++ Q_OBJECT |
163 |
++private Q_SLOTS: |
164 |
++ void testDirsContent(); |
165 |
++}; |
166 |
++ |
167 |
++void documentDirsTest::testDirsContent() |
168 |
++{ |
169 |
++ const QStringList docDirs = documentationDirs(); |
170 |
++ QVERIFY(docDirs.size() >= 1); |
171 |
++ /* DOCBUNDLEDIR (one of its matches) must be the first element */ |
172 |
++ QVERIFY(docDirs[0].indexOf(QRegularExpression(QStringLiteral(KDOCTOOLS_DOCBUNDLEDIR))) >= 0); |
173 |
++ /* Check all the other items that should be there; |
174 |
++ check the last occurrence, as each locateAll can return more items |
175 |
++ and also some of them may match KDOCTOOLS_DOCBUNDLEDIR */ |
176 |
++ int position_dir_doc_HTML = docDirs.lastIndexOf(QRegularExpression(QStringLiteral(".*/doc/HTML$"))); |
177 |
++ QVERIFY(position_dir_doc_HTML >= 0); |
178 |
++ int position_dir_help = docDirs.lastIndexOf(QRegularExpression(QStringLiteral(".*/help$"))); |
179 |
++ QVERIFY(position_dir_help >= 0); |
180 |
++} |
181 |
++ |
182 |
++QTEST_MAIN(documentDirsTest) |
183 |
++#include "documentdirstest.moc" |
184 |
+diff --git a/config-kdoctools.h.cmake b/config-kdoctools.h.cmake |
185 |
+--- a/config-kdoctools.h.cmake |
186 |
++++ b/config-kdoctools.h.cmake |
187 |
+@@ -3,3 +3,13 @@ |
188 |
+ #define DOCBOOK_XML_CURRDTD "@DocBookXML4_DTD_DIR@" |
189 |
+ |
190 |
+ #define KDOCTOOLS_INSTALL_DATADIR_KF5 "${CMAKE_INSTALL_PREFIX}/${KDE_INSTALL_DATADIR_KF5}" |
191 |
++ |
192 |
++#define KDOCTOOLS_DOCBUNDLEDIR "${KDE_INSTALL_DOCBUNDLEDIR}" |
193 |
++ |
194 |
++/* Get the value set in the library at compile time, or allow the application |
195 |
++ to set it if the library has not defined it (useful for example for testing |
196 |
++ purposes) |
197 |
++*/ |
198 |
++#ifndef KDOCTOOLS_CUSTOM_DOC_PATH |
199 |
++#define KDOCTOOLS_CUSTOM_DOC_PATH "${KDOCTOOLS_CUSTOM_DOC_PATH}" |
200 |
++#endif |
201 |
+diff --git a/src/xslt.cpp b/src/xslt.cpp |
202 |
+--- a/src/xslt.cpp |
203 |
++++ b/src/xslt.cpp |
204 |
+@@ -489,5 +489,13 @@ |
205 |
+ QStringList KDocTools::documentationDirs() |
206 |
+ { |
207 |
+ /* List of paths containing documentation */ |
208 |
+- return QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("doc/HTML"), QStandardPaths::LocateDirectory); |
209 |
++ QStringList allDocDirs; |
210 |
++ allDocDirs << QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral(KDOCTOOLS_DOCBUNDLEDIR), QStandardPaths::LocateDirectory) |
211 |
++ << QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("doc/HTML"), QStandardPaths::LocateDirectory) |
212 |
++ << QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("help"), QStandardPaths::LocateDirectory); |
213 |
++ if (!QStringLiteral(KDOCTOOLS_CUSTOM_DOC_PATH).isEmpty()) { |
214 |
++ allDocDirs << QStringLiteral(KDOCTOOLS_CUSTOM_DOC_PATH); |
215 |
++ } |
216 |
++ allDocDirs.removeDuplicates(); |
217 |
++ return allDocDirs; |
218 |
+ } |
219 |
|
220 |
diff --git a/kde-frameworks/kdoctools/kdoctools-9999.ebuild b/kde-frameworks/kdoctools/kdoctools-9999.ebuild |
221 |
index 1a3604cc37..b367c26dc9 100644 |
222 |
--- a/kde-frameworks/kdoctools/kdoctools-9999.ebuild |
223 |
+++ b/kde-frameworks/kdoctools/kdoctools-9999.ebuild |
224 |
@@ -28,7 +28,7 @@ DEPEND=" |
225 |
" |
226 |
RDEPEND="${DEPEND}" |
227 |
|
228 |
-PATCHES=( "${FILESDIR}/${PN}-5.54.0-gentoo-docbundledir.patch" ) |
229 |
+PATCHES=( "${FILESDIR}/${PN}-5.66.0-docbundledir.patch" ) |
230 |
|
231 |
src_configure() { |
232 |
local mycmakeargs=( |