commit:     b908e33f2f63f30a36b86fa5e727c9eafb718f2b
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 24 16:57:58 2022 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Thu Feb 24 17:04:23 2022 +0000
URL:        https://gitweb.gentoo.org/proj/kde.git/commit/?id=b908e33f

kde-apps/akregator: Add IUSE speech

Bug: https://bugs.gentoo.org/832776
Bug: https://bugs.gentoo.org/832845
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 kde-apps/akregator/akregator-21.12.49.9999.ebuild  |   6 +-
 kde-apps/akregator/akregator-9999.ebuild           |   4 +-
 .../akregator-21.12.3-speech-optional-1.patch      | 144 +++++++++++++++++++++
 .../akregator-21.12.3-speech-optional-2.patch      |  25 ++++
 kde-apps/akregator/metadata.xml                    |   3 +
 5 files changed, 178 insertions(+), 4 deletions(-)

diff --git a/kde-apps/akregator/akregator-21.12.49.9999.ebuild 
b/kde-apps/akregator/akregator-21.12.49.9999.ebuild
index d8e5047a64..c0b30e8b75 100644
--- a/kde-apps/akregator/akregator-21.12.49.9999.ebuild
+++ b/kde-apps/akregator/akregator-21.12.49.9999.ebuild
@@ -16,7 +16,7 @@ HOMEPAGE="https://apps.kde.org/akregator/";
 LICENSE="GPL-2+ handbook? ( FDL-1.2+ )"
 SLOT="5"
 KEYWORDS=""
-IUSE="telemetry"
+IUSE="speech telemetry"
 
 RDEPEND="
        >=dev-qt/qtdbus-${QTMIN}:5
@@ -27,7 +27,7 @@ RDEPEND="
        >=dev-qt/qtxml-${QTMIN}:5
        >=kde-apps/grantleetheme-${PVCUT}:5
        >=kde-apps/kontactinterface-${PVCUT}:5
-       >=kde-apps/kpimtextedit-${PVCUT}:5
+       >=kde-apps/kpimtextedit-${PVCUT}:5[speech=]
        >=kde-apps/libkdepim-${PVCUT}:5
        >=kde-apps/messagelib-${PVCUT}:5
        >=kde-apps/pimcommon-${PVCUT}:5
@@ -55,6 +55,8 @@ DEPEND="${RDEPEND}
        dev-libs/grantlee:5
 "
 
+PATCHES=( "${FILESDIR}"/${PN}-21.12.3-speech-optional-{1,2}.patch )
+
 src_configure() {
        local mycmakeargs=(
                $(cmake_use_find_package telemetry KUserFeedback)

diff --git a/kde-apps/akregator/akregator-9999.ebuild 
b/kde-apps/akregator/akregator-9999.ebuild
index d8e5047a64..5e387437aa 100644
--- a/kde-apps/akregator/akregator-9999.ebuild
+++ b/kde-apps/akregator/akregator-9999.ebuild
@@ -16,7 +16,7 @@ HOMEPAGE="https://apps.kde.org/akregator/";
 LICENSE="GPL-2+ handbook? ( FDL-1.2+ )"
 SLOT="5"
 KEYWORDS=""
-IUSE="telemetry"
+IUSE="speech telemetry"
 
 RDEPEND="
        >=dev-qt/qtdbus-${QTMIN}:5
@@ -27,7 +27,7 @@ RDEPEND="
        >=dev-qt/qtxml-${QTMIN}:5
        >=kde-apps/grantleetheme-${PVCUT}:5
        >=kde-apps/kontactinterface-${PVCUT}:5
-       >=kde-apps/kpimtextedit-${PVCUT}:5
+       >=kde-apps/kpimtextedit-${PVCUT}:5[speech=]
        >=kde-apps/libkdepim-${PVCUT}:5
        >=kde-apps/messagelib-${PVCUT}:5
        >=kde-apps/pimcommon-${PVCUT}:5

diff --git a/kde-apps/akregator/files/akregator-21.12.3-speech-optional-1.patch 
b/kde-apps/akregator/files/akregator-21.12.3-speech-optional-1.patch
new file mode 100644
index 0000000000..f8ebe576b8
--- /dev/null
+++ b/kde-apps/akregator/files/akregator-21.12.3-speech-optional-1.patch
@@ -0,0 +1,144 @@
+From cb0ddc563482ccbad9331d944c711cd180f38400 Mon Sep 17 00:00:00 2001
+From: Laurent Montel <mon...@kde.org>
+Date: Thu, 24 Feb 2022 17:30:26 +0100
+Subject: [PATCH] Make it compile without texttospeach
+
+---
+ .../webengine/articleviewerwebengine.cpp             |  5 +++++
+ .../webengine/articleviewerwebenginewidgetng.cpp     | 12 ++++++++----
+ .../webengine/articleviewerwebenginewidgetng.h       |  4 ++++
+ src/frame/webengine/akrwebengineviewer.cpp           |  5 +++++
+ 4 files changed, 22 insertions(+), 4 deletions(-)
+
+diff --git a/src/articleviewer-ng/webengine/articleviewerwebengine.cpp 
b/src/articleviewer-ng/webengine/articleviewerwebengine.cpp
+index 787efefc..e308df8a 100644
+--- a/src/articleviewer-ng/webengine/articleviewerwebengine.cpp
++++ b/src/articleviewer-ng/webengine/articleviewerwebengine.cpp
+@@ -12,7 +12,10 @@
+ #include "articleviewerwebenginepage.h"
+ #include "urlhandler/webengine/urlhandlerwebengine.h"
+ #include "webengine/urlhandlerwebenginemanager.h"
++#include <kpimtextedit/kpimtextedit-texttospeech.h>
++#if KPIMTEXTEDIT_TEXT_TO_SPEECH
+ #include <KPIMTextEdit/TextToSpeech>
++#endif
+ #include <WebEngineViewer/InterceptorManager>
+ #include <WebEngineViewer/WebEngineAccessKey>
+ #include <WebEngineViewer/WebEngineManageScript>
+@@ -305,10 +308,12 @@ void ArticleViewerWebEngine::slotWebHitFinished(const 
WebEngineViewer::WebHitTes
+     
popup.addAction(ActionManager::getInstance()->action(QStringLiteral("tab_unmute")));
+     popup.addSeparator();
+     
popup.addAction(ActionManager::getInstance()->action(QStringLiteral("find_in_messages")));
++#if KPIMTEXTEDIT_TEXT_TO_SPEECH
+     if (KPIMTextEdit::TextToSpeech::self()->isReady()) {
+         popup.addSeparator();
+         
popup.addAction(ActionManager::getInstance()->action(QStringLiteral("speak_text")));
+     }
++#endif
+     popup.exec(mapToGlobal(result.pos()));
+ }
+ 
+diff --git a/src/articleviewer-ng/webengine/articleviewerwebenginewidgetng.cpp 
b/src/articleviewer-ng/webengine/articleviewerwebenginewidgetng.cpp
+index e806b343..3784894e 100644
+--- a/src/articleviewer-ng/webengine/articleviewerwebenginewidgetng.cpp
++++ b/src/articleviewer-ng/webengine/articleviewerwebenginewidgetng.cpp
+@@ -12,9 +12,9 @@
+ #include <KLocalizedString>
+ #include <QVBoxLayout>
+ #include <viewerplugintoolmanager.h>
+-
++#if KPIMTEXTEDIT_TEXT_TO_SPEECH
+ #include <KPIMTextEdit/kpimtextedit/texttospeechwidget.h>
+-
++#endif
+ #include <KPIMTextEdit/SlideContainer>
+ 
+ #include <WebEngineViewer/FindBarWebEngineView>
+@@ -45,7 +45,9 @@ template<typename Arg, typename R, typename C> 
InvokeWrapper<Arg, R, C> invoke(R
+ 
ArticleViewerWebEngineWidgetNg::ArticleViewerWebEngineWidgetNg(ArticleViewerWebEngine
 *customViewer, KActionCollection *ac, QWidget *parent)
+     : QWidget(parent)
+     , mArticleViewerNg(customViewer)
++#if KPIMTEXTEDIT_TEXT_TO_SPEECH
+     , mTextToSpeechWidget(new KPIMTextEdit::TextToSpeechWidget(this))
++#endif
+     , mSliderContainer(new KPIMTextEdit::SlideContainer(this))
+     , mTrackingWarningWidget(new WebEngineViewer::TrackingWarningWidget(this))
+ 
+@@ -62,10 +64,10 @@ void 
ArticleViewerWebEngineWidgetNg::initializeLayout(KActionCollection *ac)
+ {
+     auto layout = new QVBoxLayout(this);
+     layout->setContentsMargins({});
+-
++#if KPIMTEXTEDIT_TEXT_TO_SPEECH
+     mTextToSpeechWidget->setObjectName(QStringLiteral("texttospeechwidget"));
+     layout->addWidget(mTextToSpeechWidget);
+-
++#endif
+     
mTrackingWarningWidget->setObjectName(QStringLiteral("mTrackingWarningWidget"));
+     layout->addWidget(mTrackingWarningWidget);
+ 
+@@ -107,7 +109,9 @@ void ArticleViewerWebEngineWidgetNg::slotFind()
+ void ArticleViewerWebEngineWidgetNg::slotSpeakText()
+ {
+     const QString text = mArticleViewerNg->selectedText();
++#if KPIMTEXTEDIT_TEXT_TO_SPEECH
+     mTextToSpeechWidget->say(text);
++#endif
+ }
+ 
+ void ArticleViewerWebEngineWidgetNg::saveCurrentPosition()
+diff --git a/src/articleviewer-ng/webengine/articleviewerwebenginewidgetng.h 
b/src/articleviewer-ng/webengine/articleviewerwebenginewidgetng.h
+index a9ff9eea..f4834d2e 100644
+--- a/src/articleviewer-ng/webengine/articleviewerwebenginewidgetng.h
++++ b/src/articleviewer-ng/webengine/articleviewerwebenginewidgetng.h
+@@ -8,6 +8,8 @@
+ 
+ #include "akregator_export.h"
+ #include "articleviewerwebengine.h"
++#include <kpimtextedit/kpimtextedit-texttospeech.h>
++
+ #include <QWidget>
+ class QPrinter;
+ class KActionCollection;
+@@ -55,7 +57,9 @@ private:
+     void printRequested(QWebEnginePage *page);
+     WebEngineViewer::FindBarWebEngineView *mFindBarWebView = nullptr;
+     ArticleViewerWebEngine *mArticleViewerNg = nullptr;
++#if KPIMTEXTEDIT_TEXT_TO_SPEECH
+     KPIMTextEdit::TextToSpeechWidget *const mTextToSpeechWidget;
++#endif
+     KPIMTextEdit::SlideContainer *const mSliderContainer;
+     WebEngineViewer::TrackingWarningWidget *const mTrackingWarningWidget;
+     QPrinter *mCurrentPrinter = nullptr;
+diff --git a/src/frame/webengine/akrwebengineviewer.cpp 
b/src/frame/webengine/akrwebengineviewer.cpp
+index 53b5e5f8..d49e0a8c 100644
+--- a/src/frame/webengine/akrwebengineviewer.cpp
++++ b/src/frame/webengine/akrwebengineviewer.cpp
+@@ -15,7 +15,10 @@
+ #include <KActionCollection>
+ #include <KActionMenu>
+ #include <KIO/KUriFilterSearchProviderActions>
++#include <kpimtextedit/kpimtextedit-texttospeech.h>
++#if KPIMTEXTEDIT_TEXT_TO_SPEECH
+ #include <KPIMTextEdit/TextToSpeech>
++#endif
+ #include <QContextMenuEvent>
+ #include <QMenu>
+ #include <QWebEngineHistory>
+@@ -138,11 +141,13 @@ void AkrWebEngineViewer::slotWebHitFinished(const 
WebEngineViewer::WebHitTestRes
+         popup.addActions(interceptorUrlActions);
+     }
+     popup.addSeparator();
++#if KPIMTEXTEDIT_TEXT_TO_SPEECH
+     
popup.addAction(ActionManager::getInstance()->action(QStringLiteral("find_in_messages")));
+     if (KPIMTextEdit::TextToSpeech::self()->isReady()) {
+         popup.addSeparator();
+         
popup.addAction(ActionManager::getInstance()->action(QStringLiteral("speak_text")));
+     }
++#endif
+     popup.exec(mapToGlobal(result.pos()));
+ }
+ 
+-- 
+GitLab
+

diff --git a/kde-apps/akregator/files/akregator-21.12.3-speech-optional-2.patch 
b/kde-apps/akregator/files/akregator-21.12.3-speech-optional-2.patch
new file mode 100644
index 0000000000..0f3dfe0594
--- /dev/null
+++ b/kde-apps/akregator/files/akregator-21.12.3-speech-optional-2.patch
@@ -0,0 +1,25 @@
+From 49aa0675d5d84e3286e9879ceb2333cb83f1d824 Mon Sep 17 00:00:00 2001
+From: Laurent Montel <mon...@kde.org>
+Date: Thu, 24 Feb 2022 17:33:56 +0100
+Subject: [PATCH] Fix include
+
+---
+ .../webengine/articleviewerwebenginewidgetng.cpp                | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/articleviewer-ng/webengine/articleviewerwebenginewidgetng.cpp 
b/src/articleviewer-ng/webengine/articleviewerwebenginewidgetng.cpp
+index 3784894e..20e33120 100644
+--- a/src/articleviewer-ng/webengine/articleviewerwebenginewidgetng.cpp
++++ b/src/articleviewer-ng/webengine/articleviewerwebenginewidgetng.cpp
+@@ -13,7 +13,7 @@
+ #include <MessageViewer/ViewerPluginToolManager>
+ #include <QVBoxLayout>
+ #if KPIMTEXTEDIT_TEXT_TO_SPEECH
+-#include <KPIMTextEdit/kpimtextedit/texttospeechwidget.h>
++#include <kpimtextedit/texttospeechwidget.h>
+ #endif
+ #include <KPIMTextEdit/SlideContainer>
+ 
+-- 
+GitLab
+

diff --git a/kde-apps/akregator/metadata.xml b/kde-apps/akregator/metadata.xml
index d925f24397..fa80953797 100644
--- a/kde-apps/akregator/metadata.xml
+++ b/kde-apps/akregator/metadata.xml
@@ -8,4 +8,7 @@
        <upstream>
                <bugs-to>https://bugs.kde.org/</bugs-to>
        </upstream>
+       <use>
+               <flag name="speech">Enable text-to-speech support</flag>
+       </use>
 </pkgmetadata>

Reply via email to