Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: kde-apps/kpimtextedit/files/, kde-apps/kpimtextedit/
Date: Sun, 06 Feb 2022 21:17:16
Message-Id: 1644182192.cefc29423b72bf03dd5f548d0da560cef04f2635.asturm@gentoo
1 commit: cefc29423b72bf03dd5f548d0da560cef04f2635
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 6 10:39:10 2022 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 6 21:16:32 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cefc2942
7
8 kde-apps/kpimtextedit: Re-add IUSE=speech
9
10 Backporting upstream commits 2fb145fd9132c0f3cc589c8030eda8f536a45812
11 and 3596c0a90f590c409654a9aec2b087809cff0a79.
12
13 Closes: https://bugs.gentoo.org/832776
14 Package-Manager: Portage-3.0.30, Repoman-3.0.3
15 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
16
17 .../kpimtextedit-21.12.2-speech-optional-1.patch | 289 +++++++++++++++++++++
18 .../kpimtextedit-21.12.2-speech-optional-2.patch | 25 ++
19 ....12.2.ebuild => kpimtextedit-21.12.2-r1.ebuild} | 13 +-
20 kde-apps/kpimtextedit/metadata.xml | 1 +
21 4 files changed, 326 insertions(+), 2 deletions(-)
22
23 diff --git a/kde-apps/kpimtextedit/files/kpimtextedit-21.12.2-speech-optional-1.patch b/kde-apps/kpimtextedit/files/kpimtextedit-21.12.2-speech-optional-1.patch
24 new file mode 100644
25 index 000000000000..d7fa7474a4bf
26 --- /dev/null
27 +++ b/kde-apps/kpimtextedit/files/kpimtextedit-21.12.2-speech-optional-1.patch
28 @@ -0,0 +1,289 @@
29 +From 53f187315f51e7d53a03c4ed464812b388465c10 Mon Sep 17 00:00:00 2001
30 +From: Laurent Montel <montel@×××.org>
31 +Date: Mon, 27 Dec 2021 07:53:16 +0100
32 +Subject: [PATCH] Add support for building without texttospeech as for the
33 + moment we don't
34 +
35 +have it in qt6
36 +---
37 + CMakeLists.txt | 10 +++++-
38 + src/CMakeLists.txt | 34 ++++++++++++++-----
39 + .../plaintexteditor/plaintexteditor.cpp | 4 +++
40 + .../plaintexteditor/plaintexteditorwidget.cpp | 10 ++++--
41 + .../richtexteditor/richtexteditor.cpp | 5 ++-
42 + .../richtexteditor/richtexteditorwidget.cpp | 9 ++++-
43 + 6 files changed, 59 insertions(+), 13 deletions(-)
44 +
45 +diff --git a/CMakeLists.txt b/CMakeLists.txt
46 +index ae59804..d1a0181 100644
47 +--- a/CMakeLists.txt
48 ++++ b/CMakeLists.txt
49 +@@ -76,7 +76,15 @@ add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f02)
50 + add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055A00)
51 +
52 +
53 +-find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED COMPONENTS TextToSpeech)
54 ++find_package(Qt5TextToSpeech ${QT_REQUIRED_VERSION} CONFIG)
55 ++set_package_properties(Qt5TextToSpeech PROPERTIES DESCRIPTION
56 ++ "Add support for texttospeed"
57 ++ TYPE OPTIONAL
58 ++)
59 ++if(TARGET Qt5::TextToSpeech)
60 ++ set(HAVE_TEXT_TO_SPEECH_SUPPORT TRUE)
61 ++ add_definitions(-DHAVE_TEXT_TO_SPEECH_SUPPORT)
62 ++endif()
63 +
64 + if(BUILD_TESTING)
65 + find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED COMPONENTS Test)
66 +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
67 +index 2720e0a..98e2854 100644
68 +--- a/src/CMakeLists.txt
69 ++++ b/src/CMakeLists.txt
70 +@@ -53,7 +53,7 @@ target_sources(KF5PimTextEdit PRIVATE
71 + composer-ng/richtextcomposeremailquotehighlighter.h
72 + composer-ng/richtextcomposerwidget.h
73 + )
74 +-
75 ++if (HAVE_TEXT_TO_SPEECH_SUPPORT)
76 + target_sources(KF5PimTextEdit PRIVATE
77 + texttospeech/texttospeech.cpp
78 + texttospeech/texttospeechwidget.cpp
79 +@@ -76,6 +76,7 @@ target_sources(KF5PimTextEdit PRIVATE
80 + texttospeech/texttospeechlanguagecombobox.h
81 + texttospeech/texttospeechactions.h
82 + )
83 ++endif()
84 +
85 + target_sources(KF5PimTextEdit PRIVATE
86 + grantleebuilder/plaintextmarkupbuilder.cpp
87 +@@ -168,7 +169,12 @@ target_link_libraries(KF5PimTextEdit
88 + KF5::SyntaxHighlighting
89 + Qt::TextToSpeech
90 + )
91 +-
92 ++if (HAVE_TEXT_TO_SPEECH_SUPPORT)
93 ++ target_link_libraries(KF5PimTextEdit
94 ++ PRIVATE
95 ++ Qt::TextToSpeech
96 ++ )
97 ++endif()
98 + set_target_properties(KF5PimTextEdit PROPERTIES
99 + VERSION ${KPIMTEXTEDIT_VERSION}
100 + SOVERSION ${KPIMTEXTEDIT_SOVERSION}
101 +@@ -240,7 +246,7 @@ ecm_generate_headers(KPimTextEdit_CamelCasetexteditor_commonwidget_HEADERS
102 + )
103 +
104 +
105 +-
106 ++if (HAVE_TEXT_TO_SPEECH_SUPPORT)
107 + ecm_generate_headers(KPimTextEdit_CamelCasetexttospeechs_HEADERS
108 + HEADER_NAMES
109 + TextToSpeech
110 +@@ -252,7 +258,7 @@ ecm_generate_headers(KPimTextEdit_CamelCasetexttospeechs_HEADERS
111 + PREFIX KPIMTextEdit
112 + RELATIVE texttospeech
113 + )
114 +-
115 ++endif()
116 + ecm_generate_headers(KPimTextEdit_Camelcasecomposerng_HEADERS
117 + HEADER_NAMES
118 + RichTextComposer
119 +@@ -269,11 +275,22 @@ ecm_generate_headers(KPimTextEdit_Camelcasecomposerng_HEADERS
120 +
121 +
122 + ########### install files ###############
123 ++if (HAVE_TEXT_TO_SPEECH_SUPPORT)
124 ++ install(FILES
125 ++ ${KPimTextEdit_texttospeechs_HEADERS}
126 ++ DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/KPIMTextEdit/kpimtextedit
127 ++ COMPONENT Devel
128 ++ )
129 ++ install(FILES
130 ++ ${KPimTextEdit_CamelCasetexttospeechs_HEADERS}
131 ++ DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/KPIMTextEdit/KPIMTextEdit/
132 ++ COMPONENT Devel
133 ++ )
134 ++endif()
135 +
136 + install(FILES
137 + ${CMAKE_CURRENT_BINARY_DIR}/kpimtextedit_export.h
138 + ${kpimtextedit_HEADERS}
139 +- ${KPimTextEdit_texttospeechs_HEADERS}
140 + ${KPimTextEdit_richtexteditor_HEADERS}
141 + ${KPimTextEdit_texteditor_commonwidget_HEADERS}
142 + ${KPimTextEdit_plaintexteditor_HEADERS}
143 +@@ -288,7 +305,6 @@ install(FILES
144 + ${KPimTextEdit_CamelCase_HEADERS}
145 + ${KPimTextEdit_CamelCasetextrichtexteditor_HEADERS}
146 + ${KPimTextEdit_CamelCaseplaintexteditor_HEADERS}
147 +- ${KPimTextEdit_CamelCasetexttospeechs_HEADERS}
148 + ${KPimTextEdit_CamelCasetexteditor_commonwidget_HEADERS}
149 + ${KPimTextEdit_Camelcasecomposerng_HEADERS}
150 + ${KPimTextEdit_CamelCaseemoticon_HEADERS}
151 +@@ -306,8 +322,10 @@ if (BUILD_TESTING)
152 + add_subdirectory(texteditor/commonwidget/autotests)
153 + add_subdirectory(texteditor/plaintexteditor/tests)
154 + add_subdirectory(texteditor/richtexteditor/tests)
155 +- add_subdirectory(texttospeech/autotests)
156 +- add_subdirectory(texttospeech/tests)
157 ++ if (HAVE_TEXT_TO_SPEECH_SUPPORT)
158 ++ add_subdirectory(texttospeech/autotests)
159 ++ add_subdirectory(texttospeech/tests)
160 ++ endif()
161 + add_subdirectory(composer-ng/autotests)
162 + add_subdirectory(composer-ng/tests)
163 + add_subdirectory(grantleebuilder/autotests)
164 +diff --git a/src/texteditor/plaintexteditor/plaintexteditor.cpp b/src/texteditor/plaintexteditor/plaintexteditor.cpp
165 +index cfa0741..4559568 100644
166 +--- a/src/texteditor/plaintexteditor/plaintexteditor.cpp
167 ++++ b/src/texteditor/plaintexteditor/plaintexteditor.cpp
168 +@@ -18,7 +18,9 @@
169 + #include <QActionGroup>
170 + #include <QIcon>
171 +
172 ++#ifdef HAVE_TEXT_TO_SPEECH_SUPPORT
173 + #include "texttospeech/texttospeech.h"
174 ++#endif
175 + #include <Sonnet/Dialog>
176 + #include <sonnet/backgroundchecker.h>
177 +
178 +@@ -181,6 +183,7 @@ void PlainTextEditor::contextMenuEvent(QContextMenuEvent *event)
179 + }
180 + }
181 + if (d->supportFeatures & TextToSpeech) {
182 ++#ifdef HAVE_TEXT_TO_SPEECH_SUPPORT
183 + if (KPIMTextEdit::TextToSpeech::self()->isReady()) {
184 + if (!emptyDocument) {
185 + QAction *speakAction = popup->addAction(i18n("Speak Text"));
186 +@@ -188,6 +191,7 @@ void PlainTextEditor::contextMenuEvent(QContextMenuEvent *event)
187 + connect(speakAction, &QAction::triggered, this, &PlainTextEditor::slotSpeakText);
188 + }
189 + }
190 ++#endif
191 + }
192 + if (webShortcutSupport() && textCursor().hasSelection()) {
193 + popup->addSeparator();
194 +diff --git a/src/texteditor/plaintexteditor/plaintexteditorwidget.cpp b/src/texteditor/plaintexteditor/plaintexteditorwidget.cpp
195 +index 3251ea3..77a9b45 100644
196 +--- a/src/texteditor/plaintexteditor/plaintexteditorwidget.cpp
197 ++++ b/src/texteditor/plaintexteditor/plaintexteditorwidget.cpp
198 +@@ -8,8 +8,9 @@
199 + #include "plaintexteditfindbar.h"
200 + #include "plaintexteditor.h"
201 + #include "slidecontainer.h"
202 ++#ifdef HAVE_TEXT_TO_SPEECH_SUPPORT
203 + #include "texttospeech/texttospeechwidget.h"
204 +-
205 ++#endif
206 + #include <QTextCursor>
207 + #include <QVBoxLayout>
208 +
209 +@@ -21,7 +22,9 @@ public:
210 +
211 + KPIMTextEdit::PlainTextEditFindBar *mFindBar = nullptr;
212 + PlainTextEditor *mEditor = nullptr;
213 ++#ifdef HAVE_TEXT_TO_SPEECH_SUPPORT
214 + KPIMTextEdit::TextToSpeechWidget *mTextToSpeechWidget = nullptr;
215 ++#endif
216 + KPIMTextEdit::SlideContainer *mSliderContainer = nullptr;
217 + };
218 +
219 +@@ -75,16 +78,19 @@ void PlainTextEditorWidget::init(PlainTextEditor *customEditor)
220 + {
221 + auto lay = new QVBoxLayout(this);
222 + lay->setContentsMargins({});
223 ++#ifdef HAVE_TEXT_TO_SPEECH_SUPPORT
224 + d->mTextToSpeechWidget = new KPIMTextEdit::TextToSpeechWidget(this);
225 + lay->addWidget(d->mTextToSpeechWidget);
226 ++#endif
227 + if (customEditor) {
228 + d->mEditor = customEditor;
229 + } else {
230 + d->mEditor = new PlainTextEditor;
231 + }
232 + lay->addWidget(d->mEditor);
233 ++#ifdef HAVE_TEXT_TO_SPEECH_SUPPORT
234 + connect(d->mEditor, &PlainTextEditor::say, d->mTextToSpeechWidget, &KPIMTextEdit::TextToSpeechWidget::say);
235 +-
236 ++#endif
237 + d->mSliderContainer = new KPIMTextEdit::SlideContainer(this);
238 +
239 + d->mFindBar = new KPIMTextEdit::PlainTextEditFindBar(d->mEditor, this);
240 +diff --git a/src/texteditor/richtexteditor/richtexteditor.cpp b/src/texteditor/richtexteditor/richtexteditor.cpp
241 +index dfdf7c5..a004434 100644
242 +--- a/src/texteditor/richtexteditor/richtexteditor.cpp
243 ++++ b/src/texteditor/richtexteditor/richtexteditor.cpp
244 +@@ -26,7 +26,9 @@
245 + #include <sonnet/backgroundchecker.h>
246 + #include <sonnet/spellcheckdecorator.h>
247 + #include <sonnet/speller.h>
248 ++#ifdef HAVE_TEXT_TO_SPEECH_SUPPORT
249 + #include <texttospeech/texttospeech.h>
250 ++#endif
251 +
252 + #include <QApplication>
253 + #include <QClipboard>
254 +@@ -247,7 +249,7 @@ QMenu *RichTextEditor::mousePopupMenu(QPoint pos)
255 + allowTabAction->setChecked(!tabChangesFocus());
256 + connect(allowTabAction, &QAction::triggered, this, &RichTextEditor::slotAllowTab);
257 + }
258 +-
259 ++#ifdef HAVE_TEXT_TO_SPEECH_SUPPORT
260 + if (KPIMTextEdit::TextToSpeech::self()->isReady()) {
261 + if (!emptyDocument) {
262 + QAction *speakAction = popup->addAction(i18n("Speak Text"));
263 +@@ -255,6 +257,7 @@ QMenu *RichTextEditor::mousePopupMenu(QPoint pos)
264 + connect(speakAction, &QAction::triggered, this, &RichTextEditor::slotSpeakText);
265 + }
266 + }
267 ++#endif
268 + if (webShortcutSupport() && textCursor().hasSelection()) {
269 + popup->addSeparator();
270 + const QString selectedText = textCursor().selectedText();
271 +diff --git a/src/texteditor/richtexteditor/richtexteditorwidget.cpp b/src/texteditor/richtexteditor/richtexteditorwidget.cpp
272 +index d0d8e14..d84cf3f 100644
273 +--- a/src/texteditor/richtexteditor/richtexteditorwidget.cpp
274 ++++ b/src/texteditor/richtexteditor/richtexteditorwidget.cpp
275 +@@ -10,8 +10,9 @@
276 +
277 + #include <QTextCursor>
278 + #include <QVBoxLayout>
279 ++#ifdef HAVE_TEXT_TO_SPEECH_SUPPORT
280 + #include <texttospeech/texttospeechwidget.h>
281 +-
282 ++#endif
283 + #include "slidecontainer.h"
284 +
285 + using namespace KPIMTextEdit;
286 +@@ -23,7 +24,9 @@ public:
287 +
288 + KPIMTextEdit::RichTextEditFindBar *mFindBar = nullptr;
289 + RichTextEditor *mEditor = nullptr;
290 ++#ifdef HAVE_TEXT_TO_SPEECH_SUPPORT
291 + KPIMTextEdit::TextToSpeechWidget *mTextToSpeechWidget = nullptr;
292 ++#endif
293 + KPIMTextEdit::SlideContainer *mSliderContainer = nullptr;
294 + };
295 +
296 +@@ -97,14 +100,18 @@ void RichTextEditorWidget::init(RichTextEditor *customEditor)
297 + {
298 + auto lay = new QVBoxLayout(this);
299 + lay->setContentsMargins({});
300 ++#ifdef HAVE_TEXT_TO_SPEECH_SUPPORT
301 + d->mTextToSpeechWidget = new KPIMTextEdit::TextToSpeechWidget(this);
302 + lay->addWidget(d->mTextToSpeechWidget);
303 ++#endif
304 + if (customEditor) {
305 + d->mEditor = customEditor;
306 + } else {
307 + d->mEditor = new RichTextEditor;
308 + }
309 ++#ifdef HAVE_TEXT_TO_SPEECH_SUPPORT
310 + connect(d->mEditor, &RichTextEditor::say, d->mTextToSpeechWidget, &KPIMTextEdit::TextToSpeechWidget::say);
311 ++#endif
312 + lay->addWidget(d->mEditor);
313 +
314 + d->mSliderContainer = new KPIMTextEdit::SlideContainer(this);
315 +--
316 +GitLab
317 +
318
319 diff --git a/kde-apps/kpimtextedit/files/kpimtextedit-21.12.2-speech-optional-2.patch b/kde-apps/kpimtextedit/files/kpimtextedit-21.12.2-speech-optional-2.patch
320 new file mode 100644
321 index 000000000000..a078840af05c
322 --- /dev/null
323 +++ b/kde-apps/kpimtextedit/files/kpimtextedit-21.12.2-speech-optional-2.patch
324 @@ -0,0 +1,25 @@
325 +From 3596c0a90f590c409654a9aec2b087809cff0a79 Mon Sep 17 00:00:00 2001
326 +From: David Faure <faure@×××.org>
327 +Date: Tue, 28 Dec 2021 12:26:25 +0100
328 +Subject: [PATCH] Fix build without TextToSpeech available
329 +
330 +(the linking happens again further down, inside the if)
331 +---
332 + src/CMakeLists.txt | 1 -
333 + 1 file changed, 1 deletion(-)
334 +
335 +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
336 +index 98e2854..a08978e 100644
337 +--- a/src/CMakeLists.txt
338 ++++ b/src/CMakeLists.txt
339 +@@ -167,7 +167,6 @@ target_link_libraries(KF5PimTextEdit
340 + KF5::XmlGui
341 + KF5::I18n
342 + KF5::SyntaxHighlighting
343 +- Qt::TextToSpeech
344 + )
345 + if (HAVE_TEXT_TO_SPEECH_SUPPORT)
346 + target_link_libraries(KF5PimTextEdit
347 +--
348 +GitLab
349 +
350
351 diff --git a/kde-apps/kpimtextedit/kpimtextedit-21.12.2.ebuild b/kde-apps/kpimtextedit/kpimtextedit-21.12.2-r1.ebuild
352 similarity index 80%
353 rename from kde-apps/kpimtextedit/kpimtextedit-21.12.2.ebuild
354 rename to kde-apps/kpimtextedit/kpimtextedit-21.12.2-r1.ebuild
355 index 8ef4a064d94b..e9ea2a17981a 100644
356 --- a/kde-apps/kpimtextedit/kpimtextedit-21.12.2.ebuild
357 +++ b/kde-apps/kpimtextedit/kpimtextedit-21.12.2-r1.ebuild
358 @@ -16,13 +16,12 @@ DESCRIPTION="Extended text editor for PIM applications"
359 LICENSE="LGPL-2.1+"
360 SLOT="5"
361 KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86"
362 -IUSE=""
363 +IUSE="speech"
364
365 RESTRICT="test"
366
367 RDEPEND="
368 >=dev-qt/qtgui-${QTMIN}:5
369 - >=dev-qt/qtspeech-${QTMIN}:5
370 >=dev-qt/qtwidgets-${QTMIN}:5
371 >=kde-frameworks/kcompletion-${KFMIN}:5
372 >=kde-frameworks/kconfig-${KFMIN}:5
373 @@ -35,7 +34,17 @@ RDEPEND="
374 >=kde-frameworks/kxmlgui-${KFMIN}:5
375 >=kde-frameworks/sonnet-${KFMIN}:5
376 >=kde-frameworks/syntax-highlighting-${KFMIN}:5
377 + speech? ( >=dev-qt/qtspeech-${QTMIN}:5 )
378 "
379 DEPEND="${RDEPEND}
380 test? ( >=kde-frameworks/ktextwidgets-${KFMIN}:5 )
381 "
382 +
383 +PATCHES=( "${FILESDIR}"/${PN}-21.12.2-speech-optional-{1,2}.patch )
384 +
385 +src_configure() {
386 + local mycmakeargs=(
387 + $(cmake_use_find_package speech Qt5TextToSpeech)
388 + )
389 + ecm_src_configure
390 +}
391
392 diff --git a/kde-apps/kpimtextedit/metadata.xml b/kde-apps/kpimtextedit/metadata.xml
393 index 0bc83685a440..c28e75b42460 100644
394 --- a/kde-apps/kpimtextedit/metadata.xml
395 +++ b/kde-apps/kpimtextedit/metadata.xml
396 @@ -10,5 +10,6 @@
397 </upstream>
398 <use>
399 <flag name="designer">Build plugins for <pkg>dev-qt/designer</pkg></flag>
400 + <flag name="speech">Enable text-to-speech support</flag>
401 </use>
402 </pkgmetadata>