347.6. libhangul-0.2.0
Hangul input processing library
| Version | 0.2.0, release 1 |
| Shelf | input — Input-device libraries, keyboard data, input methods and on-screen keyboards |
| Phase | 50_desktop (Desktop), 19 of 92 in build order |
| Licence | LGPL-2.1-or-later |
| Homepage | https://github.com/libhangul/libhangul |
| Build time | 0.1 SBU |
| Installed size | 6.3 MiB in 9 files |
| Recipe | ports/core/input/libhangul/kpkgbuild |
About
libhangul turns keystrokes into Hangul syllables for the Korean keyboard layouts (the two-set layout, the three-set layouts and romaja) and looks up Hanja for a word. In KDOS it is the library under fcitx5-hangul, the Korean engine of the input method; see Input methods. The package also installs the keyboard definitions and the Hanja dictionaries under /usr/share/libhangul, and hangul, a small command-line converter.
Sources
libhangul-0.2.0.tar.gz(2.9 MiB)
sha256ea04e6a0cf4840a2a3b5641c1761068c78691036db839d0838f4e7a6553a5120
upstream: https://github.com/libhangul/libhangul/releases/download/libhangul-0.2.0/libhangul-0.2.0.tar.gz
archive copy: sources-3/input--libhangul-0.2.0.tar.gz
Dependencies
Required by (1): fcitx5-hangul.
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 libhangul'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/input/libhangul.
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/libhangul
echo 'ea04e6a0cf4840a2a3b5641c1761068c78691036db839d0838f4e7a6553a5120 libhangul-0.2.0.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/libhangul
SRC=$SRC_ROOT/libhangul-0.2.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf libhangul-0.2.0.tar.gz -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:
./configure --prefix=/usr --libdir=/usr/lib --disable-static --enable-nls
make
make DESTDIR=$PKG install
The switches, and why each is set:
--enable-nls— Builds the library’s message catalogues, as gettext’s configure does by default. kpkg removes every non-English catalogue from the package afterwards (see Size and language policy), so the image carries no translation of the library’s messages either way.
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/libhangul, 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 libhangul-0.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/libhangul, and runs the triggers its paths call for.
Contents
Installed programs: hangul.
Installed libraries: libhangul.so.
Installed directories: /usr/include/hangul-1.0, /usr/share/libhangul, /usr/share/licenses/libhangul.
Short descriptions
libhangul.pc |
Hangul hanja input support |