285.6. lite-xl-2.1.8
Text editor written in Lua, drawn with SDL3 and no toolkit
| Version | 2.1.8, release 1 |
| Shelf | editors — Text editors, IDEs, notebooks and REPLs |
| Phase | 44_apps (Applications), 81 of 422 in build order |
| Licence | MIT |
| Homepage | https://lite-xl.com |
| Build time | 0.2 SBU |
| Installed size | 1.2 MiB in 96 files |
| Recipe | ports/core/editors/lite-xl/kpkgbuild |
About
Lite XL is a small text editor written mostly in Lua, with a C core that draws through SDL3 and FreeType and needs no toolkit. Its editing commands, syntax highlighting and plugins are all Lua files under /usr/share/lite-xl.
Sources
lite-xl-2.1.8.tar.gz(2.9 MiB)
sha256fcaffb946bc60583369cb040d533a4ac18075a6d474d49a2a5ff4bf87e2e9a10
upstream: https://github.com/lite-xl/lite-xl/archive/v2.1.8/lite-xl-2.1.8.tar.gz
archive copy: sources-2/editors--lite-xl-2.1.8.tar.gz
Dependencies
Depends on: meson, ninja, pkgconf, sdl3, lua54, pcre2, freetype2, librsvg.
Required by: no port names it.
Patches
build.sh applies these; kpkg applies nothing by itself.
cve-2025-12121-remove-legacy-exec-function.patch— Removed legacy exec function.poor-text-rendering-20260312-a17c0455.patch— fix poor text rendering https://github.com/lite-xl/lite-xl/issues/2209
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/44_apps/phase.env && kpkg install lite-xl'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/editors/lite-xl.
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/editors/lite-xl
echo 'fcaffb946bc60583369cb040d533a4ac18075a6d474d49a2a5ff4bf87e2e9a10 lite-xl-2.1.8.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/lite-xl
SRC=$SRC_ROOT/lite-xl-2.1.8
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf lite-xl-2.1.8.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:
patch -p1 -i "$PORT_SRC/cve-2025-12121-remove-legacy-exec-function.patch"
patch -p1 -i "$PORT_SRC/poor-text-rendering-20260312-a17c0455.patch"
meson setup build --prefix=/usr --libdir=lib --buildtype=release \
--wrap-mode=nofallback \
-Duse_system_lua=true \
-Ddirmonitor_backend=inotify
meson compile -C build
DESTDIR=$PKG meson install --no-rebuild -C build
for s in 48 64 128; do
install -d "$PKG/usr/share/icons/hicolor/${s}x${s}/apps"
rsvg-convert -w $s -h $s resources/icons/lite-xl.svg \
-o "$PKG/usr/share/icons/hicolor/${s}x${s}/apps/lite-xl.png"
done
cat > "$PKG/usr/share/applications/org.lite_xl.lite_xl.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=Lite XL
GenericName=Text Editor
Comment=A lightweight text editor written in Lua
TryExec=lite-xl
Exec=lite-xl %F
Icon=lite-xl
Terminal=false
StartupWMClass=com.lite_xl.LiteXL
Categories=Development;TextEditor;
Keywords=text;editor;code;lua;lite;
DESKTOP
chmod 644 "$PKG/usr/share/applications/org.lite_xl.lite_xl.desktop"
The switches, and why each is set:
--wrap-mode=nofallback— Use the system’s Lua, PCRE2 and FreeType and never a meson wrap. The source carries wraps for all three, each of which builds a static copy; with this mode a missing system library is a configure error instead (see meson).-Duse_system_lua=true— Look for Lua by pkg-config name, among themlua5.4from the lua54 port. Off by default upstream, and off, Lua is always built from its wrap, whichnofallbackrefuses.-Ddirmonitor_backend=inotify— Watch the project directory with inotify. Upstream’s default, an empty value, probes for a backend; naming it keeps the choice the same on every build.
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/lite-xl, 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 lite-xl-2.1.8-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/lite-xl, and runs the triggers its paths call for.
Contents
Installed programs: lite-xl.
Installed directories: /usr/share/doc/lite-xl, /usr/share/licenses/lite-xl, /usr/share/lite-xl.
Notes
Both patches are git commits with their own descriptions. cve-2025-12121-remove-legacy-exec-function.patch removes system.exec, which handed a string to system(), and changes core:open-project-folder (data/core/commands/core.lua), the folder drop in rootview.lua and the tree view’s Open in System to start an argument vector through process.start. Its core.lua hunk is cut against 2.1.8 rather than upstream’s tree: it must replace the system.exec call after the already-open check, or any other folder raises a Lua error on a function the C side no longer registers. poor-text-rendering-20260312-a17c0455.patch stops lite-xl setting its own LCD filter weights under slight and full hinting, leaving FreeType’s filter in place; upstream’s issue reports poor text rendering with those weights.
Upstream’s icon is SVG only, which build.sh rasterises to PNG for the panel. Upstream’s menu entry is replaced: SDL3 takes the Wayland app_id from the metadata main.c sets, com.lite_xl.LiteXL, not from the program’s name. The entry claims no MIME types: inode/directory would make Lite XL the folder opener, and mimeapps.list is where the default text editor is chosen.