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
fcitx5-5.1.22.tar.zst(9.5 MiB)
sha2567274a903c6aea8cfe479df3439ee31c72cb69c948973cf7d8896be907f2af6af
upstream: https://download.fcitx-im.org/fcitx5/fcitx5/fcitx5-5.1.22.tar.zst
archive copy: sources-3/input--fcitx5-5.1.22.tar.zsten_dict-20121020.tar.gz(615.7 KiB)
sha256c44a5d7847925eea9e4d2d04748d442cd28dd9299a0b572ef7d91eac4f5a6ceb
upstream: https://download.fcitx-im.org/data/en_dict-20121020.tar.gz
archive copy: sources-3/input--en_dict-20121020.tar.gz
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:
-D ENABLE_X11=Off— Builds no X11 support: no XIM frontend and no X11 parts of the classic user interface. With it on, fcitx5 needsxcb-imdkit,cairo-xcb,xkbfileand a set of xcb libraries (xcb-icccm,xcb-ewmh,xcb-keysymsand others) on the host. The cost is that an X11 application under Xwayland, on the host or in a box, has no input method, because XIM is the only route an X client has to an engine.-D ENABLE_WAYLAND=On— Builds the Wayland frontend, which speaksinput-method-v1to KWin (andinput-method-v2andvirtual-keyboardto compositors that offer them), and the Wayland half of the classic interface.-D ENABLE_DBUS=On— Builds the D-Bus modules: the kimpanel interface through which Plasma’s input-method panel draws the candidate window, the virtual-keyboard interface, and the D-Bus, fcitx4 and IBus frontends, through which fcitx5-qt and fcitx5-configtool reach it. Without it fcitx5 draws its own panel.-D ENABLE_KEYBOARD=On— Builds the XKB key translation and the keyboard engine that ordinary layouts use. Upstream’s configure refuses Wayland support without it.-D ENABLE_EMOJI=On— Builds the emoji module, which needs zlib.-D ENABLE_LIBUUID=On— Takes UUIDs from libuuid, part of util-linux, for the core and the IBus frontend.-D ENABLE_SERVER=On— Builds thefcitx5program itself, not only the libraries for embedding it.-D USE_SYSTEM_YOGA=Off— Builds the copy of the Yoga layout library inthird_party/, which the classic interface lays out with. No yoga port exists.-D ENABLE_ENCHANT=On— Gives the spell module enchant as a second word provider beside fcitx5’s own English list. Upstream’s check for it isREQUIREDonce the option is on.-D ENABLE_TESTING_ADDONS=On— Builds the testing addons, a test frontend, a test engine and a test interface, althoughENABLE_TESTis off. This is upstream’s default. fcitx5-anthy and fcitx5-hangul ask for theTestFrontendmodule with an unconditionalREQUIREDfind_package, so without these addons neither engine configures.-D ENABLE_XDGAUTOSTART=Off— Installs no.desktopfile under/etc/xdg/autostart. Nothing starts it from that directory: KWin starts fcitx5 itself as the session’s input method, fromkwinrc[Wayland] InputMethod, and an autostart entry would start a second copy.-D BUILD_SPELL_DICT=On— Compilesen_dict.fscd, the English word list the spell module uses for hints, from theen_dictarchive the recipe carries (see Notes).-D EVENT_LOOP_BACKEND=libuv— Runs fcitx5’s event loop on libuv, and with it D-Bus through libdbus. The default,auto, tries sd-event first and takes libuv only when no libsystemd is found; naming the backend means a libsystemd in the build root could never be chosen. KDOS has no systemd.-D USE_SYSTEMD=Off— Takes sd-event out of theautosearch. Upstream reads it only when the backend isauto, so besideEVENT_LOOP_BACKEND=libuvit changes nothing in this build.-D USE_SYSTEM_PLASMA_WAYLAND_PROTOCOLS=On— Generates the Plasma window-management protocol code from the XML plasma-wayland-protocols installs, instead of the copy in fcitx5’s own tree. This is upstream’s default, and it is why that port is a dependency.
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.