Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

347.1. fcitx5-5.1.22

Input method framework, Wayland only on KDOS

Version 5.1.22, release 1
Shelf input — Input-device libraries, keyboard data, input methods and on-screen keyboards
Phase 50_desktop (Desktop), 14 of 92 in build order
Licence LGPL-2.1-or-later AND Unicode-DFS-2016 AND MIT
Homepage https://fcitx-im.org
Build time 1.8 SBU
Installed size 21.6 MiB in 426 files
Recipe ports/core/input/fcitx5/kpkgbuild

About

fcitx5 is an input method framework: the engine that turns keystrokes into text a keyboard cannot type directly, such as Chinese, Japanese or Korean. On KDOS KWin starts it as the session’s input method (InputMethod= in kwinrc) and relays what it produces to applications over the text-input protocols, so a boxed application reaches it through the compositor and never directly. The language engines are separate ports built on this one: fcitx5-chinese-addons over libime, fcitx5-anthy for Japanese and fcitx5-hangul for Korean; fcitx5-qt carries it into Qt applications and fcitx5-configtool is its System Settings page. The whole arrangement is in Input methods.

The build is Wayland only: no X11 frontend, no systemd, no autostart entry, and every helper archive the build would download already in place.

Why it is in KDOS

The comment above it in script/phases/50_desktop/packages.txt:

The input method, which KWin starts for the session and speaks to over input-method-v1. Built Wayland-only — no X11 frontend, no cloud pinyin — and the engines are one per language: chinese-addons (pinyin, shuangpin, tables) over libime, anthy for Japanese, hangul for Korean.

Sources

Dependencies

Depends on: cmake, extra-cmake-modules, nlohmann-json, plasma-wayland-protocols, libxkbcommon, xkeyboard-config, iso-codes, wayland, wayland-protocols, cairo, pango, gdk-pixbuf, librsvg, glib, expat, gettext, libuv, dbus, util-linux, zstd, zlib, enchant, libintl.

Required by (7): fcitx5-anthy, fcitx5-chinese-addons, fcitx5-configtool, fcitx5-hangul, fcitx5-qt, kde-plasma, libime.

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/50_desktop/phase.env && kpkg install fcitx5'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/input/fcitx5.

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/input/fcitx5
echo '7274a903c6aea8cfe479df3439ee31c72cb69c948973cf7d8896be907f2af6af  fcitx5-5.1.22.tar.zst' | sha256sum -c -
echo 'c44a5d7847925eea9e4d2d04748d442cd28dd9299a0b572ef7d91eac4f5a6ceb  en_dict-20121020.tar.gz' | 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/fcitx5
SRC=$SRC_ROOT/fcitx5-5.1.22
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
cp fcitx5-5.1.22.tar.zst "$SRC"
tar --no-same-permissions --warning=no-unknown-keyword -xf en_dict-20121020.tar.gz -C "$SRC_ROOT"

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 recipe’s helpers _endict and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

tar -xf "$PORT_SRC/$name-$version.tar.zst" --strip-components=1
cp "$PORT_SRC/$_endict" src/modules/spell/

cmake -S . -B build -G Ninja \
	-D CMAKE_INSTALL_PREFIX=/usr \
	-D CMAKE_INSTALL_LIBDIR=lib \
	-D CMAKE_INSTALL_SYSCONFDIR=/etc \
	-D CMAKE_BUILD_TYPE=Release \
	-D ENABLE_X11=Off \
	-D ENABLE_WAYLAND=On \
	-D ENABLE_DBUS=On \
	-D ENABLE_KEYBOARD=On \
	-D ENABLE_EMOJI=On \
	-D ENABLE_LIBUUID=On \
	-D ENABLE_SERVER=On \
	-D USE_SYSTEM_YOGA=Off \
	-D ENABLE_ENCHANT=On \
	-D ENABLE_DOC=Off \
	-D ENABLE_TEST=Off \
	-D ENABLE_TESTING_ADDONS=On \
	-D ENABLE_XDGAUTOSTART=Off \
	-D BUILD_SPELL_DICT=On \
	-D USE_SYSTEMD=Off \
	-D EVENT_LOOP_BACKEND=libuv \
	-D USE_SYSTEM_PLASMA_WAYLAND_PROTOCOLS=On \
	-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build

The switches, and why each is set:

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/fcitx5, 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 fcitx5-5.1.22-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/fcitx5, and runs the triggers its paths call for.

Contents

Installed programs: fcitx5, fcitx5-configtool, fcitx5-diagnose, fcitx5-remote.

Installed libraries: libFcitx5Config.so, libFcitx5Core.so, libFcitx5Utils.so.

Installed directories: /usr/include/Fcitx5/Config, /usr/include/Fcitx5/Core, /usr/include/Fcitx5/Module/fcitx-module/clipboard, /usr/include/Fcitx5/Module/fcitx-module/dbus, /usr/include/Fcitx5/Module/fcitx-module/emoji, /usr/include/Fcitx5/Module/fcitx-module/notificationitem, /usr/include/Fcitx5/Module/fcitx-module/notifications, /usr/include/Fcitx5/Module/fcitx-module/quickphrase, /usr/include/Fcitx5/Module/fcitx-module/spell, /usr/include/Fcitx5/Module/fcitx-module/testfrontend, /usr/include/Fcitx5/Module/fcitx-module/testim, /usr/include/Fcitx5/Module/fcitx-module/unicode, /usr/include/Fcitx5/Module/fcitx-module/wayland, /usr/include/Fcitx5/Module/fcitx-module/xcb, /usr/include/Fcitx5/Utils, /usr/lib/cmake/Fcitx5Config, /usr/lib/cmake/Fcitx5Core, /usr/lib/cmake/Fcitx5Module, /usr/lib/cmake/Fcitx5ModuleClipboard, /usr/lib/cmake/Fcitx5ModuleDBus, /usr/lib/cmake/Fcitx5ModuleEmoji, /usr/lib/cmake/Fcitx5ModuleNotificationItem, /usr/lib/cmake/Fcitx5ModuleNotifications, /usr/lib/cmake/Fcitx5ModuleQuickPhrase, /usr/lib/cmake/Fcitx5ModuleSpell, /usr/lib/cmake/Fcitx5ModuleTestFrontend, /usr/lib/cmake/Fcitx5ModuleTestIM, /usr/lib/cmake/Fcitx5ModuleUnicode, /usr/lib/cmake/Fcitx5ModuleWayland, /usr/lib/cmake/Fcitx5ModuleXCB, /usr/lib/cmake/Fcitx5Utils, /usr/lib/fcitx5/libexec, /usr/share/fcitx5/data, /usr/share/fcitx5/default, /usr/share/fcitx5/emoji, /usr/share/fcitx5/spell, /usr/share/fcitx5/testing, /usr/share/fcitx5/themes, /usr/share/fcitx5/unicode, /usr/share/licenses/fcitx5.

Short descriptions

Fcitx5Config.pc Fcitx Config Library
Fcitx5Core.pc Fcitx Core Library
Fcitx5Module.pc Fcitx Public Module Library
Fcitx5Utils.pc Fcitx Utils Library

Notes

kpkg unpacks only the archive types it recognises and copies any other source file, and .tar.zst is not one it unpacks, so build.sh unpacks the fcitx5 archive itself, with --strip-components=1, before configuring.

The spell module’s CMake fetches the en_dict archive with file(DOWNLOAD) at build time, and the build runs with no network. Upstream’s download step does nothing when a file with the expected sha256 already sits where it would write it, and it resolves that place against the module’s source directory, so the recipe declares the archive as a second source and copies it, still packed, into src/modules/spell/. It must be the archive itself: the check hashes the .tar.gz, not its contents. libime and fcitx5-chinese-addons carry their data the same way.

The archive’s name and sha256 are written twice, in kpkgbuild and in the spell module’s CMakeLists.txt. A release that moves to a newer word list changes the CMake side, and the recipe has to follow it. Otherwise the build has no word list: upstream’s step deletes a copy whose hash does not match without fetching another, and tries the network for a file name it does not find.