Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/kde:master commit in: kde-apps/kalarm/files/, kde-apps/kalarm/
Date: Sun, 27 Feb 2022 23:22:18
Message-Id: 1646004049.32a86d5ca4fe16e46a1acf2777bd16d5ea38557d.asturm@gentoo
1 commit: 32a86d5ca4fe16e46a1acf2777bd16d5ea38557d
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 27 23:19:37 2022 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 27 23:20:49 2022 +0000
6 URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=32a86d5c
7
8 kde-apps/kalarm: Add IUSE speech
9
10 Bug: https://bugs.gentoo.org/832776
11 Bug: https://bugs.gentoo.org/832845
12 Package-Manager: Portage-3.0.30, Repoman-3.0.3
13 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
14
15 .../files/kalarm-21.12.3-speech-optional.patch | 124 +++++++++++++++++++++
16 kde-apps/kalarm/kalarm-21.12.49.9999.ebuild | 6 +-
17 kde-apps/kalarm/kalarm-9999.ebuild | 4 +-
18 kde-apps/kalarm/metadata.xml | 3 +
19 4 files changed, 133 insertions(+), 4 deletions(-)
20
21 diff --git a/kde-apps/kalarm/files/kalarm-21.12.3-speech-optional.patch b/kde-apps/kalarm/files/kalarm-21.12.3-speech-optional.patch
22 new file mode 100644
23 index 0000000000..ce4f45c376
24 --- /dev/null
25 +++ b/kde-apps/kalarm/files/kalarm-21.12.3-speech-optional.patch
26 @@ -0,0 +1,124 @@
27 +From 53a299c513c447afc57c7f520ac35aea2dffc277 Mon Sep 17 00:00:00 2001
28 +From: Laurent Montel <montel@×××.org>
29 +Date: Fri, 25 Feb 2022 07:29:19 +0100
30 +Subject: [PATCH] Make build without texttospeech support
31 +
32 +---
33 + src/commandoptions.cpp | 7 +++++++
34 + src/messagedisplayhelper.cpp | 5 +++++
35 + src/prefdlg.cpp | 5 +++++
36 + src/soundpicker.cpp | 5 +++++
37 + 4 files changed, 22 insertions(+)
38 +
39 +diff --git a/src/commandoptions.cpp b/src/commandoptions.cpp
40 +index a564fbb3..a6bbded1 100644
41 +--- a/src/commandoptions.cpp
42 ++++ b/src/commandoptions.cpp
43 +@@ -14,7 +14,10 @@
44 + #include "kalarm_debug.h"
45 +
46 + #include <KAlarmCal/Identities>
47 ++#include <kpimtextedit/kpimtextedit-texttospeech.h>
48 ++#if KPIMTEXTEDIT_TEXT_TO_SPEECH
49 + #include <KPIMTextEdit/TextToSpeech>
50 ++#endif
51 + #include <KLocalizedString>
52 +
53 + #include <QCommandLineParser>
54 +@@ -570,7 +573,11 @@ void CommandOptions::process()
55 + {
56 + if (mParser->isSet(*mOptions.at(BEEP)))
57 + setErrorIncompatible(BEEP, SPEAK);
58 ++#if KPIMTEXTEDIT_TEXT_TO_SPEECH
59 + else if (!KPIMTextEdit::TextToSpeech::self()->isReady())
60 ++#else
61 ++ else
62 ++#endif
63 + setError(xi18nc("@info:shell", "<icode>%1</icode> requires KAlarm to be compiled with QTextToSpeech support", optionName(SPEAK)));
64 + }
65 + const bool onceOnly = mParser->isSet(*mOptions.at(REMINDER_ONCE));
66 +diff --git a/src/messagedisplayhelper.cpp b/src/messagedisplayhelper.cpp
67 +index 0f6b9680..6e80e8ca 100644
68 +--- a/src/messagedisplayhelper.cpp
69 ++++ b/src/messagedisplayhelper.cpp
70 +@@ -21,7 +21,10 @@
71 + #include "lib/synchtimer.h"
72 + #include "kalarm_debug.h"
73 +
74 ++#include <kpimtextedit/kpimtextedit-texttospeech.h>
75 ++#if KPIMTEXTEDIT_TEXT_TO_SPEECH
76 + #include <KPIMTextEdit/TextToSpeech>
77 ++#endif
78 +
79 + #include <KLocalizedString>
80 + #include <KConfig>
81 +@@ -831,6 +834,7 @@ void MessageDisplayHelper::playAudio()
82 + */
83 + void MessageDisplayHelper::slotSpeak()
84 + {
85 ++#if KPIMTEXTEDIT_TEXT_TO_SPEECH
86 + KPIMTextEdit::TextToSpeech* tts = KPIMTextEdit::TextToSpeech::self();
87 + if (!tts->isReady())
88 + {
89 +@@ -840,6 +844,7 @@ void MessageDisplayHelper::slotSpeak()
90 + }
91 +
92 + tts->say(mMessage);
93 ++#endif
94 + }
95 +
96 + /******************************************************************************
97 +diff --git a/src/prefdlg.cpp b/src/prefdlg.cpp
98 +index ea32116e..d3cf48ae 100644
99 +--- a/src/prefdlg.cpp
100 ++++ b/src/prefdlg.cpp
101 +@@ -48,7 +48,10 @@
102 + #include <KHolidays/HolidayRegion>
103 + using namespace KHolidays;
104 +
105 ++#include <kpimtextedit/kpimtextedit-texttospeech.h>
106 ++#if KPIMTEXTEDIT_TEXT_TO_SPEECH
107 + #include <KPIMTextEdit/TextToSpeech>
108 ++#endif
109 +
110 + #include <KLocalizedString>
111 + #include <KShell>
112 +@@ -1355,8 +1358,10 @@ EditPrefTab::EditPrefTab(StackedScrollGroup* scrollGroup)
113 + mSound->addItem(SoundPicker::i18n_combo_None()); // index 0
114 + mSound->addItem(SoundPicker::i18n_combo_Beep()); // index 1
115 + mSound->addItem(SoundPicker::i18n_combo_File()); // index 2
116 ++#if KPIMTEXTEDIT_TEXT_TO_SPEECH
117 + if (KPIMTextEdit::TextToSpeech::self()->isReady())
118 + mSound->addItem(SoundPicker::i18n_combo_Speak()); // index 3
119 ++#endif
120 + mSound->setMinimumSize(mSound->sizeHint());
121 + mSound->setWhatsThis(defsetting.subs(SoundPicker::i18n_label_Sound()).toString());
122 + hlayout->addWidget(mSound);
123 +diff --git a/src/soundpicker.cpp b/src/soundpicker.cpp
124 +index 426baf96..f85071ea 100644
125 +--- a/src/soundpicker.cpp
126 ++++ b/src/soundpicker.cpp
127 +@@ -16,7 +16,10 @@
128 + #include "lib/pushbutton.h"
129 + #include "kalarm_debug.h"
130 +
131 ++#include <kpimtextedit/kpimtextedit-texttospeech.h>
132 ++#if KPIMTEXTEDIT_TEXT_TO_SPEECH
133 + #include <KPIMTextEdit/TextToSpeech>
134 ++#endif
135 +
136 + #include <KLocalizedString>
137 + #include <phonon/backendcapabilities.h>
138 +@@ -130,7 +133,9 @@ void SoundPicker::showFile(bool show)
139 + */
140 + void SoundPicker::showSpeak(bool show)
141 + {
142 ++#if KPIMTEXTEDIT_TEXT_TO_SPEECH
143 + if (!KPIMTextEdit::TextToSpeech::self()->isReady())
144 ++#endif
145 + show = false; // speech capability is not installed or configured
146 + if (show != mSpeakShowing)
147 + {
148 +--
149 +GitLab
150 +
151
152 diff --git a/kde-apps/kalarm/kalarm-21.12.49.9999.ebuild b/kde-apps/kalarm/kalarm-21.12.49.9999.ebuild
153 index 8ff08c36c0..96894ed98f 100644
154 --- a/kde-apps/kalarm/kalarm-21.12.49.9999.ebuild
155 +++ b/kde-apps/kalarm/kalarm-21.12.49.9999.ebuild
156 @@ -15,7 +15,7 @@ HOMEPAGE="https://apps.kde.org/kalarm/ https://userbase.kde.org/KAlarm"
157 LICENSE="GPL-2+ handbook? ( FDL-1.2+ )"
158 SLOT="5"
159 KEYWORDS=""
160 -IUSE="X"
161 +IUSE="speech X"
162
163 DEPEND="
164 >=dev-qt/qtdbus-${QTMIN}:5
165 @@ -31,7 +31,7 @@ DEPEND="
166 >=kde-apps/kmailtransport-${PVCUT}:5
167 >=kde-apps/kmime-${PVCUT}:5
168 >=kde-apps/kontactinterface-${PVCUT}:5
169 - >=kde-apps/kpimtextedit-${PVCUT}:5
170 + >=kde-apps/kpimtextedit-${PVCUT}:5[speech=]
171 >=kde-apps/pimcommon-${PVCUT}:5
172 >=kde-frameworks/kauth-${KFMIN}:5
173 >=kde-frameworks/kcalendarcore-${KFMIN}:5
174 @@ -70,6 +70,8 @@ RDEPEND="${DEPEND}
175 >=kde-apps/kdepim-runtime-${PVCUT}:5
176 "
177
178 +PATCHES=( "${FILESDIR}"/${PN}-21.12.3-speech-optional.patch )
179 +
180 src_configure() {
181 local mycmakeargs=(
182 $(cmake_use_find_package X Qt5X11Extras)
183
184 diff --git a/kde-apps/kalarm/kalarm-9999.ebuild b/kde-apps/kalarm/kalarm-9999.ebuild
185 index 8ff08c36c0..7578bf3b12 100644
186 --- a/kde-apps/kalarm/kalarm-9999.ebuild
187 +++ b/kde-apps/kalarm/kalarm-9999.ebuild
188 @@ -15,7 +15,7 @@ HOMEPAGE="https://apps.kde.org/kalarm/ https://userbase.kde.org/KAlarm"
189 LICENSE="GPL-2+ handbook? ( FDL-1.2+ )"
190 SLOT="5"
191 KEYWORDS=""
192 -IUSE="X"
193 +IUSE="speech X"
194
195 DEPEND="
196 >=dev-qt/qtdbus-${QTMIN}:5
197 @@ -31,7 +31,7 @@ DEPEND="
198 >=kde-apps/kmailtransport-${PVCUT}:5
199 >=kde-apps/kmime-${PVCUT}:5
200 >=kde-apps/kontactinterface-${PVCUT}:5
201 - >=kde-apps/kpimtextedit-${PVCUT}:5
202 + >=kde-apps/kpimtextedit-${PVCUT}:5[speech=]
203 >=kde-apps/pimcommon-${PVCUT}:5
204 >=kde-frameworks/kauth-${KFMIN}:5
205 >=kde-frameworks/kcalendarcore-${KFMIN}:5
206
207 diff --git a/kde-apps/kalarm/metadata.xml b/kde-apps/kalarm/metadata.xml
208 index d925f24397..fa80953797 100644
209 --- a/kde-apps/kalarm/metadata.xml
210 +++ b/kde-apps/kalarm/metadata.xml
211 @@ -8,4 +8,7 @@
212 <upstream>
213 <bugs-to>https://bugs.kde.org/</bugs-to>
214 </upstream>
215 + <use>
216 + <flag name="speech">Enable text-to-speech support</flag>
217 + </use>
218 </pkgmetadata>