256.7. ktextaddons-2.2.0
KDE text add-ons: translation, grammar check, autocorrection, emoji and text-to-speech for text editors
| Version | 2.2.0, release 1 |
| Shelf | qt-extra — Third-party and KDE-hosted Qt add-on libraries that are not in KF6 |
| Phase | 43_toolkits (Toolkits), 208 of 344 in build order |
| Licence | LGPL-2.0-or-later AND LGPL-2.0-only AND LGPL-2.1-or-later AND GPL-2.0-or-later AND BSD-3-Clause AND MIT AND CC0-1.0 |
| Homepage | https://invent.kde.org/libraries/ktextaddons |
| Build time | 8.9 SBU |
| Installed size | 14.1 MiB in 868 files |
| Recipe | ports/core/qt-extra/ktextaddons/kpkgbuild |
About
KTextAddons is the set of text-editing add-ons that KDE PIM and other KDE applications share: a translator with network engines (Google, Bing, DeepL, LibreTranslate, Lingva, Yandex), grammar checking through LanguageTool or Grammalecte, autocorrection, an emoji and emoticon picker, text-to-speech and speech-to-text (Google’s service or a local Whisper model) for text fields, a custom rich-text editor, and TextAutoGenerateText, a chat client for large language models. KMail, the sieve editor and the rest of the KDE PIM stack link it, so the port is built before that stack.
Sources
ktextaddons-2.2.0.tar.xz(1.4 MiB)
sha25626b78fab82ce76fa19d8d2a47757631d21dcaddb6814442b6dd2853e65cd5a81
upstream: https://download.kde.org/stable/ktextaddons/ktextaddons-2.2.0.tar.xz
archive copy: sources-4/qt-extra--ktextaddons-2.2.0.tar.xz
Dependencies
Depends on: cmake, ninja, extra-cmake-modules, qt6-qtbase, qt6-qtmultimedia, qt6-qtspeech, qtkeychain, ki18n, kconfig, kcolorscheme, karchive, kcoreaddons, sonnet, kservice, syntax-highlighting, kwidgetsaddons, ktextwidgets, kitemviews, kiconthemes, kio.
Required by (20): akonadi-contacts, akonadi-search, akregator, calendarsupport, grantlee-editor, kaddressbook, kalarm, kdepim-addons, kdepim-runtime, kidentitymanagement, kmail, kontact, korganizer, kpimtextedit, libksieve, mailcommon, messagelib, pim-data-exporter, pim-sieve-editor, pimcommon.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/43_toolkits/phase.env && kpkg install ktextaddons'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/qt-extra/ktextaddons.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/qt-extra/ktextaddons
echo '26b78fab82ce76fa19d8d2a47757631d21dcaddb6814442b6dd2853e65cd5a81 ktextaddons-2.2.0.tar.xz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/ktextaddons
SRC=$SRC_ROOT/ktextaddons-2.2.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf ktextaddons-2.2.0.tar.xz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
cmake -S . -B build -G Ninja \
-D CMAKE_INSTALL_PREFIX=/usr \
-D KDE_INSTALL_LIBDIR=lib \
-D CMAKE_BUILD_TYPE=Release \
-D BUILD_TESTING=OFF \
-D KDE_INSTALL_USE_QT_SYS_PATHS=ON \
-D KF_SKIP_PO_PROCESSING=ON \
-D BUILD_KIO_SUPPORT=ON \
-D BUILD_DESIGNERPLUGIN=OFF \
-D ENABLE_WARN_OUTDATED=OFF \
-D USE_FASTER_LINKER=OFF \
-D BERGAMOT_TRANSLATOR_PLUGIN=OFF \
-D SPEAK_TO_TEXT_VOSK_PLUGIN=OFF \
-D CMAKE_REQUIRE_FIND_PACKAGE_Qt6TextToSpeech=ON \
-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
The switches, and why each is set:
-D BUILD_KIO_SUPPORT=ON— Link kio for the add-ons that open or save files through KIO. On is upstream’s default; the recipe names it, so the KIO-backed parts cannot drop out of the package unnoticed.-D BUILD_DESIGNERPLUGIN=OFF— Build no Qt Designer plugin for the widgets. Upstream builds one by default, and the configure then requires Qt’sUiPluginmodule from qt6-qttools, which this port’sdependsdoes not name.-D ENABLE_WARN_OUTDATED=OFF— Compile out the banner that tells the user their version is more than six months old and asks them to upgrade. It measures age from the compile date, while KDOS updates the whole system as one release; the banner would appear on a current system half a year after its packages were built.-D USE_FASTER_LINKER=OFF— Link with the toolchain’s own linker. Upstream’s default looks forwildand thenmoldand switches to the first one installed, so the linker would depend on what happened to be present in the build root.-D BERGAMOT_TRANSLATOR_PLUGIN=OFF— No offline Bergamot translator. It needsslimt, which is not a port, and upstream builds it only from a source checkout downloaded separately. Off is upstream’s default; the recipe names it.-D SPEAK_TO_TEXT_VOSK_PLUGIN=OFF— No Vosk speech recogniser. It needs the Vosk library, which is not a port; upstream points the builder at Vosk’s prebuilt release archives. Off is upstream’s default; the recipe names it.-D CMAKE_REQUIRE_FIND_PACKAGE_Qt6TextToSpeech=ON— Make Qt Text-to-Speech from qt6-qtspeech a requirement. Upstream looks for it as optional and buildsKF6TextEditTextToSpeech, the read-aloud add-on for text fields, only when it is found.-D KF_SKIP_PO_PROCESSING=ON— Skips building the interface translations, which the package-wide English-only rule would remove anyway (see Size and language policy).
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/ktextaddons, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf ktextaddons-2.2.0-1.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/ktextaddons, and runs the triggers its paths call for.
Contents
Installed programs: kokoro_helper.py, whisper_helper.py.
Installed libraries: libKF6TextAddonsWidgets.so, libKF6TextAutoCorrectionCore.so, libKF6TextAutoCorrectionWidgets.so, libKF6TextAutoGenerateText.so, libKF6TextAutoGenerateTextMcpProtocolCore.so, libKF6TextAutoGenerateTextMcpProtocolWidgets.so, libKF6TextCustomEditor.so, libKF6TextEditTextToSpeech.so, libKF6TextEmoticonsCore.so, libKF6TextEmoticonsWidgets.so, libKF6TextGrammarCheck.so, libKF6TextSpeechToText.so, libKF6TextTranslator.so, libKF6TextUtils.so, libkokoroinstalltexttospeech.so, libkokorotexttospeech.so, libmcpprotocolclientplugin.so, libmcpprotocolserverplugin.so, libspeechtotextwhisper.so, libspeechtotextwhisperinstall.so, libtextautogenerategenericnetwork.so, libtextautogeneratellamacpp.so, libtextautogeneratelmstudio.so, libtextautogenerateollama.so, libtextautogenerateollamacloud.so, libtextautogenerateollamacommon.so, libtextautogenerateollamaonline.so, libtextautogenerateplugincommon.so, libtextutils-cmark-rc-copy.so.
Installed directories: /usr/include/KF6/TextAddonsWidgets, /usr/include/KF6/TextAutoCorrectionCore, /usr/include/KF6/TextAutoCorrectionWidgets, /usr/include/KF6/TextAutoGenerateText, /usr/include/KF6/TextAutoGenerateTextMcpProtocolCore, /usr/include/KF6/TextAutoGenerateTextMcpProtocolWidgets, /usr/include/KF6/TextCustomEditor, /usr/include/KF6/TextEditTextToSpeech, /usr/include/KF6/TextEmoticonsCore, /usr/include/KF6/TextEmoticonsWidgets, /usr/include/KF6/TextGrammarCheck, /usr/include/KF6/TextSpeechToText, /usr/include/KF6/TextTranslator, /usr/include/KF6/TextUtils, /usr/lib/cmake/KF6TextAddonsWidgets, /usr/lib/cmake/KF6TextAutoCorrectionCore, /usr/lib/cmake/KF6TextAutoCorrectionWidgets, /usr/lib/cmake/KF6TextAutoGenerateText, /usr/lib/cmake/KF6TextAutoGenerateTextMcpProtocolCore, /usr/lib/cmake/KF6TextAutoGenerateTextMcpProtocolWidgets, /usr/lib/cmake/KF6TextCustomEditor, /usr/lib/cmake/KF6TextEditTextToSpeech, /usr/lib/cmake/KF6TextEmoticonsCore, /usr/lib/cmake/KF6TextEmoticonsWidgets, /usr/lib/cmake/KF6TextGrammarCheck, /usr/lib/cmake/KF6TextSpeechToText, /usr/lib/cmake/KF6TextTranslator, /usr/lib/cmake/KF6TextUtils, /usr/lib/cmake/textutils-cmark-rc-copy, /usr/lib/qt6/plugins/kf6/speechtotext, /usr/lib/qt6/plugins/kf6/textautogeneratetext, /usr/lib/qt6/plugins/kf6/translator, /usr/share/licenses/ktextaddons.
Notes
TextAutoGenerateText has no switch in this release: the library and its back-end plugins (Ollama, Ollama Cloud, LM Studio, llama.cpp and a generic network endpoint) are built every time. They do nothing until an application exposes them, and the PIM consumers are built with that client off (OPTION_ADD_AUTOGENERATETEXT=OFF in libksieve, KMail and the sieve editor).
The network translators, LanguageTool and Google’s speech-to-text send text to a remote service only when the user selects one and configures it. Qt Keychain from qtkeychain, which the configure requires, keeps DeepL’s and the language-model plugins’ API keys in the secret store, and Qt Multimedia from qt6-qtmultimedia, which the configure requires, records the audio for speech-to-text.
Two engines are built every time and install their Python helpers in /usr/bin: Kokoro, a Qt Text-to-Speech engine plugin (texttospeech/KokoroTextToSpeechPlugin.so) driven by kokoro_helper.py, and Whisper speech-to-text, driven by whisper_helper.py. Neither has a switch. Each runs its helper with the Python of a virtual environment in the user’s home, which the add-on offers to create and fill with pip from the network (PyTorch and kokoro, or faster-whisper), and the models are downloaded from Hugging Face into ~/.cache/huggingface on first use. Until the user does that, the engine reports itself unavailable; the package carries no Python dependency for them.
KF6TextUtils renders Markdown with a copy of cmark that the release carries in textutils/cmark-rc/ and installs as libtextutils-cmark-rc-copy.so; there is no switch to use cmark instead, so a security fix in cmark reaches this copy only through a KTextAddons release.