From cefc29423b72bf03dd5f548d0da560cef04f2635 Mon Sep 17 00:00:00 2001 From: Andreas Sturmlechner Date: Sun, 6 Feb 2022 11:39:10 +0100 Subject: kde-apps/kpimtextedit: Re-add IUSE=speech Backporting upstream commits 2fb145fd9132c0f3cc589c8030eda8f536a45812 and 3596c0a90f590c409654a9aec2b087809cff0a79. Closes: https://bugs.gentoo.org/832776 Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Andreas Sturmlechner --- .../kpimtextedit-21.12.2-speech-optional-1.patch | 289 +++++++++++++++++++++ .../kpimtextedit-21.12.2-speech-optional-2.patch | 25 ++ .../kpimtextedit/kpimtextedit-21.12.2-r1.ebuild | 50 ++++ kde-apps/kpimtextedit/kpimtextedit-21.12.2.ebuild | 41 --- kde-apps/kpimtextedit/metadata.xml | 1 + 5 files changed, 365 insertions(+), 41 deletions(-) create mode 100644 kde-apps/kpimtextedit/files/kpimtextedit-21.12.2-speech-optional-1.patch create mode 100644 kde-apps/kpimtextedit/files/kpimtextedit-21.12.2-speech-optional-2.patch create mode 100644 kde-apps/kpimtextedit/kpimtextedit-21.12.2-r1.ebuild delete mode 100644 kde-apps/kpimtextedit/kpimtextedit-21.12.2.ebuild (limited to 'kde-apps') 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 new file mode 100644 index 000000000000..d7fa7474a4bf --- /dev/null +++ b/kde-apps/kpimtextedit/files/kpimtextedit-21.12.2-speech-optional-1.patch @@ -0,0 +1,289 @@ +From 53f187315f51e7d53a03c4ed464812b388465c10 Mon Sep 17 00:00:00 2001 +From: Laurent Montel +Date: Mon, 27 Dec 2021 07:53:16 +0100 +Subject: [PATCH] Add support for building without texttospeech as for the + moment we don't + +have it in qt6 +--- + CMakeLists.txt | 10 +++++- + src/CMakeLists.txt | 34 ++++++++++++++----- + .../plaintexteditor/plaintexteditor.cpp | 4 +++ + .../plaintexteditor/plaintexteditorwidget.cpp | 10 ++++-- + .../richtexteditor/richtexteditor.cpp | 5 ++- + .../richtexteditor/richtexteditorwidget.cpp | 9 ++++- + 6 files changed, 59 insertions(+), 13 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ae59804..d1a0181 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -76,7 +76,15 @@ add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f02) + add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055A00) + + +-find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED COMPONENTS TextToSpeech) ++find_package(Qt5TextToSpeech ${QT_REQUIRED_VERSION} CONFIG) ++set_package_properties(Qt5TextToSpeech PROPERTIES DESCRIPTION ++ "Add support for texttospeed" ++ TYPE OPTIONAL ++) ++if(TARGET Qt5::TextToSpeech) ++ set(HAVE_TEXT_TO_SPEECH_SUPPORT TRUE) ++ add_definitions(-DHAVE_TEXT_TO_SPEECH_SUPPORT) ++endif() + + if(BUILD_TESTING) + find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED COMPONENTS Test) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 2720e0a..98e2854 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -53,7 +53,7 @@ target_sources(KF5PimTextEdit PRIVATE + composer-ng/richtextcomposeremailquotehighlighter.h + composer-ng/richtextcomposerwidget.h + ) +- ++if (HAVE_TEXT_TO_SPEECH_SUPPORT) + target_sources(KF5PimTextEdit PRIVATE + texttospeech/texttospeech.cpp + texttospeech/texttospeechwidget.cpp +@@ -76,6 +76,7 @@ target_sources(KF5PimTextEdit PRIVATE + texttospeech/texttospeechlanguagecombobox.h + texttospeech/texttospeechactions.h + ) ++endif() + + target_sources(KF5PimTextEdit PRIVATE + grantleebuilder/plaintextmarkupbuilder.cpp +@@ -168,7 +169,12 @@ target_link_libraries(KF5PimTextEdit + KF5::SyntaxHighlighting + Qt::TextToSpeech + ) +- ++if (HAVE_TEXT_TO_SPEECH_SUPPORT) ++ target_link_libraries(KF5PimTextEdit ++ PRIVATE ++ Qt::TextToSpeech ++ ) ++endif() + set_target_properties(KF5PimTextEdit PROPERTIES + VERSION ${KPIMTEXTEDIT_VERSION} + SOVERSION ${KPIMTEXTEDIT_SOVERSION} +@@ -240,7 +246,7 @@ ecm_generate_headers(KPimTextEdit_CamelCasetexteditor_commonwidget_HEADERS + ) + + +- ++if (HAVE_TEXT_TO_SPEECH_SUPPORT) + ecm_generate_headers(KPimTextEdit_CamelCasetexttospeechs_HEADERS + HEADER_NAMES + TextToSpeech +@@ -252,7 +258,7 @@ ecm_generate_headers(KPimTextEdit_CamelCasetexttospeechs_HEADERS + PREFIX KPIMTextEdit + RELATIVE texttospeech + ) +- ++endif() + ecm_generate_headers(KPimTextEdit_Camelcasecomposerng_HEADERS + HEADER_NAMES + RichTextComposer +@@ -269,11 +275,22 @@ ecm_generate_headers(KPimTextEdit_Camelcasecomposerng_HEADERS + + + ########### install files ############### ++if (HAVE_TEXT_TO_SPEECH_SUPPORT) ++ install(FILES ++ ${KPimTextEdit_texttospeechs_HEADERS} ++ DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/KPIMTextEdit/kpimtextedit ++ COMPONENT Devel ++ ) ++ install(FILES ++ ${KPimTextEdit_CamelCasetexttospeechs_HEADERS} ++ DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/KPIMTextEdit/KPIMTextEdit/ ++ COMPONENT Devel ++ ) ++endif() + + install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/kpimtextedit_export.h + ${kpimtextedit_HEADERS} +- ${KPimTextEdit_texttospeechs_HEADERS} + ${KPimTextEdit_richtexteditor_HEADERS} + ${KPimTextEdit_texteditor_commonwidget_HEADERS} + ${KPimTextEdit_plaintexteditor_HEADERS} +@@ -288,7 +305,6 @@ install(FILES + ${KPimTextEdit_CamelCase_HEADERS} + ${KPimTextEdit_CamelCasetextrichtexteditor_HEADERS} + ${KPimTextEdit_CamelCaseplaintexteditor_HEADERS} +- ${KPimTextEdit_CamelCasetexttospeechs_HEADERS} + ${KPimTextEdit_CamelCasetexteditor_commonwidget_HEADERS} + ${KPimTextEdit_Camelcasecomposerng_HEADERS} + ${KPimTextEdit_CamelCaseemoticon_HEADERS} +@@ -306,8 +322,10 @@ if (BUILD_TESTING) + add_subdirectory(texteditor/commonwidget/autotests) + add_subdirectory(texteditor/plaintexteditor/tests) + add_subdirectory(texteditor/richtexteditor/tests) +- add_subdirectory(texttospeech/autotests) +- add_subdirectory(texttospeech/tests) ++ if (HAVE_TEXT_TO_SPEECH_SUPPORT) ++ add_subdirectory(texttospeech/autotests) ++ add_subdirectory(texttospeech/tests) ++ endif() + add_subdirectory(composer-ng/autotests) + add_subdirectory(composer-ng/tests) + add_subdirectory(grantleebuilder/autotests) +diff --git a/src/texteditor/plaintexteditor/plaintexteditor.cpp b/src/texteditor/plaintexteditor/plaintexteditor.cpp +index cfa0741..4559568 100644 +--- a/src/texteditor/plaintexteditor/plaintexteditor.cpp ++++ b/src/texteditor/plaintexteditor/plaintexteditor.cpp +@@ -18,7 +18,9 @@ + #include + #include + ++#ifdef HAVE_TEXT_TO_SPEECH_SUPPORT + #include "texttospeech/texttospeech.h" ++#endif + #include + #include + +@@ -181,6 +183,7 @@ void PlainTextEditor::contextMenuEvent(QContextMenuEvent *event) + } + } + if (d->supportFeatures & TextToSpeech) { ++#ifdef HAVE_TEXT_TO_SPEECH_SUPPORT + if (KPIMTextEdit::TextToSpeech::self()->isReady()) { + if (!emptyDocument) { + QAction *speakAction = popup->addAction(i18n("Speak Text")); +@@ -188,6 +191,7 @@ void PlainTextEditor::contextMenuEvent(QContextMenuEvent *event) + connect(speakAction, &QAction::triggered, this, &PlainTextEditor::slotSpeakText); + } + } ++#endif + } + if (webShortcutSupport() && textCursor().hasSelection()) { + popup->addSeparator(); +diff --git a/src/texteditor/plaintexteditor/plaintexteditorwidget.cpp b/src/texteditor/plaintexteditor/plaintexteditorwidget.cpp +index 3251ea3..77a9b45 100644 +--- a/src/texteditor/plaintexteditor/plaintexteditorwidget.cpp ++++ b/src/texteditor/plaintexteditor/plaintexteditorwidget.cpp +@@ -8,8 +8,9 @@ + #include "plaintexteditfindbar.h" + #include "plaintexteditor.h" + #include "slidecontainer.h" ++#ifdef HAVE_TEXT_TO_SPEECH_SUPPORT + #include "texttospeech/texttospeechwidget.h" +- ++#endif + #include + #include + +@@ -21,7 +22,9 @@ public: + + KPIMTextEdit::PlainTextEditFindBar *mFindBar = nullptr; + PlainTextEditor *mEditor = nullptr; ++#ifdef HAVE_TEXT_TO_SPEECH_SUPPORT + KPIMTextEdit::TextToSpeechWidget *mTextToSpeechWidget = nullptr; ++#endif + KPIMTextEdit::SlideContainer *mSliderContainer = nullptr; + }; + +@@ -75,16 +78,19 @@ void PlainTextEditorWidget::init(PlainTextEditor *customEditor) + { + auto lay = new QVBoxLayout(this); + lay->setContentsMargins({}); ++#ifdef HAVE_TEXT_TO_SPEECH_SUPPORT + d->mTextToSpeechWidget = new KPIMTextEdit::TextToSpeechWidget(this); + lay->addWidget(d->mTextToSpeechWidget); ++#endif + if (customEditor) { + d->mEditor = customEditor; + } else { + d->mEditor = new PlainTextEditor; + } + lay->addWidget(d->mEditor); ++#ifdef HAVE_TEXT_TO_SPEECH_SUPPORT + connect(d->mEditor, &PlainTextEditor::say, d->mTextToSpeechWidget, &KPIMTextEdit::TextToSpeechWidget::say); +- ++#endif + d->mSliderContainer = new KPIMTextEdit::SlideContainer(this); + + d->mFindBar = new KPIMTextEdit::PlainTextEditFindBar(d->mEditor, this); +diff --git a/src/texteditor/richtexteditor/richtexteditor.cpp b/src/texteditor/richtexteditor/richtexteditor.cpp +index dfdf7c5..a004434 100644 +--- a/src/texteditor/richtexteditor/richtexteditor.cpp ++++ b/src/texteditor/richtexteditor/richtexteditor.cpp +@@ -26,7 +26,9 @@ + #include + #include + #include ++#ifdef HAVE_TEXT_TO_SPEECH_SUPPORT + #include ++#endif + + #include + #include +@@ -247,7 +249,7 @@ QMenu *RichTextEditor::mousePopupMenu(QPoint pos) + allowTabAction->setChecked(!tabChangesFocus()); + connect(allowTabAction, &QAction::triggered, this, &RichTextEditor::slotAllowTab); + } +- ++#ifdef HAVE_TEXT_TO_SPEECH_SUPPORT + if (KPIMTextEdit::TextToSpeech::self()->isReady()) { + if (!emptyDocument) { + QAction *speakAction = popup->addAction(i18n("Speak Text")); +@@ -255,6 +257,7 @@ QMenu *RichTextEditor::mousePopupMenu(QPoint pos) + connect(speakAction, &QAction::triggered, this, &RichTextEditor::slotSpeakText); + } + } ++#endif + if (webShortcutSupport() && textCursor().hasSelection()) { + popup->addSeparator(); + const QString selectedText = textCursor().selectedText(); +diff --git a/src/texteditor/richtexteditor/richtexteditorwidget.cpp b/src/texteditor/richtexteditor/richtexteditorwidget.cpp +index d0d8e14..d84cf3f 100644 +--- a/src/texteditor/richtexteditor/richtexteditorwidget.cpp ++++ b/src/texteditor/richtexteditor/richtexteditorwidget.cpp +@@ -10,8 +10,9 @@ + + #include + #include ++#ifdef HAVE_TEXT_TO_SPEECH_SUPPORT + #include +- ++#endif + #include "slidecontainer.h" + + using namespace KPIMTextEdit; +@@ -23,7 +24,9 @@ public: + + KPIMTextEdit::RichTextEditFindBar *mFindBar = nullptr; + RichTextEditor *mEditor = nullptr; ++#ifdef HAVE_TEXT_TO_SPEECH_SUPPORT + KPIMTextEdit::TextToSpeechWidget *mTextToSpeechWidget = nullptr; ++#endif + KPIMTextEdit::SlideContainer *mSliderContainer = nullptr; + }; + +@@ -97,14 +100,18 @@ void RichTextEditorWidget::init(RichTextEditor *customEditor) + { + auto lay = new QVBoxLayout(this); + lay->setContentsMargins({}); ++#ifdef HAVE_TEXT_TO_SPEECH_SUPPORT + d->mTextToSpeechWidget = new KPIMTextEdit::TextToSpeechWidget(this); + lay->addWidget(d->mTextToSpeechWidget); ++#endif + if (customEditor) { + d->mEditor = customEditor; + } else { + d->mEditor = new RichTextEditor; + } ++#ifdef HAVE_TEXT_TO_SPEECH_SUPPORT + connect(d->mEditor, &RichTextEditor::say, d->mTextToSpeechWidget, &KPIMTextEdit::TextToSpeechWidget::say); ++#endif + lay->addWidget(d->mEditor); + + d->mSliderContainer = new KPIMTextEdit::SlideContainer(this); +-- +GitLab + 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 new file mode 100644 index 000000000000..a078840af05c --- /dev/null +++ b/kde-apps/kpimtextedit/files/kpimtextedit-21.12.2-speech-optional-2.patch @@ -0,0 +1,25 @@ +From 3596c0a90f590c409654a9aec2b087809cff0a79 Mon Sep 17 00:00:00 2001 +From: David Faure +Date: Tue, 28 Dec 2021 12:26:25 +0100 +Subject: [PATCH] Fix build without TextToSpeech available + +(the linking happens again further down, inside the if) +--- + src/CMakeLists.txt | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 98e2854..a08978e 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -167,7 +167,6 @@ target_link_libraries(KF5PimTextEdit + KF5::XmlGui + KF5::I18n + KF5::SyntaxHighlighting +- Qt::TextToSpeech + ) + if (HAVE_TEXT_TO_SPEECH_SUPPORT) + target_link_libraries(KF5PimTextEdit +-- +GitLab + diff --git a/kde-apps/kpimtextedit/kpimtextedit-21.12.2-r1.ebuild b/kde-apps/kpimtextedit/kpimtextedit-21.12.2-r1.ebuild new file mode 100644 index 000000000000..e9ea2a17981a --- /dev/null +++ b/kde-apps/kpimtextedit/kpimtextedit-21.12.2-r1.ebuild @@ -0,0 +1,50 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +ECM_DESIGNERPLUGIN="true" +ECM_QTHELP="true" +ECM_TEST="true" +KFMIN=5.88.0 +QTMIN=5.15.2 +VIRTUALX_REQUIRED="test" +inherit ecm kde.org + +DESCRIPTION="Extended text editor for PIM applications" + +LICENSE="LGPL-2.1+" +SLOT="5" +KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86" +IUSE="speech" + +RESTRICT="test" + +RDEPEND=" + >=dev-qt/qtgui-${QTMIN}:5 + >=dev-qt/qtwidgets-${QTMIN}:5 + >=kde-frameworks/kcompletion-${KFMIN}:5 + >=kde-frameworks/kconfig-${KFMIN}:5 + >=kde-frameworks/kconfigwidgets-${KFMIN}:5 + >=kde-frameworks/kcoreaddons-${KFMIN}:5 + >=kde-frameworks/ki18n-${KFMIN}:5 + >=kde-frameworks/kiconthemes-${KFMIN}:5 + >=kde-frameworks/kio-${KFMIN}:5 + >=kde-frameworks/kwidgetsaddons-${KFMIN}:5 + >=kde-frameworks/kxmlgui-${KFMIN}:5 + >=kde-frameworks/sonnet-${KFMIN}:5 + >=kde-frameworks/syntax-highlighting-${KFMIN}:5 + speech? ( >=dev-qt/qtspeech-${QTMIN}:5 ) +" +DEPEND="${RDEPEND} + test? ( >=kde-frameworks/ktextwidgets-${KFMIN}:5 ) +" + +PATCHES=( "${FILESDIR}"/${PN}-21.12.2-speech-optional-{1,2}.patch ) + +src_configure() { + local mycmakeargs=( + $(cmake_use_find_package speech Qt5TextToSpeech) + ) + ecm_src_configure +} diff --git a/kde-apps/kpimtextedit/kpimtextedit-21.12.2.ebuild b/kde-apps/kpimtextedit/kpimtextedit-21.12.2.ebuild deleted file mode 100644 index 8ef4a064d94b..000000000000 --- a/kde-apps/kpimtextedit/kpimtextedit-21.12.2.ebuild +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -ECM_DESIGNERPLUGIN="true" -ECM_QTHELP="true" -ECM_TEST="true" -KFMIN=5.88.0 -QTMIN=5.15.2 -VIRTUALX_REQUIRED="test" -inherit ecm kde.org - -DESCRIPTION="Extended text editor for PIM applications" - -LICENSE="LGPL-2.1+" -SLOT="5" -KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86" -IUSE="" - -RESTRICT="test" - -RDEPEND=" - >=dev-qt/qtgui-${QTMIN}:5 - >=dev-qt/qtspeech-${QTMIN}:5 - >=dev-qt/qtwidgets-${QTMIN}:5 - >=kde-frameworks/kcompletion-${KFMIN}:5 - >=kde-frameworks/kconfig-${KFMIN}:5 - >=kde-frameworks/kconfigwidgets-${KFMIN}:5 - >=kde-frameworks/kcoreaddons-${KFMIN}:5 - >=kde-frameworks/ki18n-${KFMIN}:5 - >=kde-frameworks/kiconthemes-${KFMIN}:5 - >=kde-frameworks/kio-${KFMIN}:5 - >=kde-frameworks/kwidgetsaddons-${KFMIN}:5 - >=kde-frameworks/kxmlgui-${KFMIN}:5 - >=kde-frameworks/sonnet-${KFMIN}:5 - >=kde-frameworks/syntax-highlighting-${KFMIN}:5 -" -DEPEND="${RDEPEND} - test? ( >=kde-frameworks/ktextwidgets-${KFMIN}:5 ) -" diff --git a/kde-apps/kpimtextedit/metadata.xml b/kde-apps/kpimtextedit/metadata.xml index 0bc83685a440..c28e75b42460 100644 --- a/kde-apps/kpimtextedit/metadata.xml +++ b/kde-apps/kpimtextedit/metadata.xml @@ -10,5 +10,6 @@ Build plugins for dev-qt/designer + Enable text-to-speech support -- cgit v1.2.3-65-gdbad