126.5. brltty-6.9.1
Braille display and console speech — the screen reader
| Version | 6.9.1, release 1 |
| Shelf | accessibility — Screen readers, speech, braille and alternative input |
| Phase | 41_system (System), 53 of 1047 in build order |
| Licence | LGPL-2.1-or-later |
| Homepage | https://brltty.app/ |
| Build time | 1.0 SBU |
| Installed size | 9.0 MiB in 955 files |
| Recipe | ports/core/accessibility/brltty/kpkgbuild |
About
BRLTTY is the screen reader of the text console: it drives a refreshable braille display, speaks through a speech synthesiser, or both. It reads the Linux console through /dev/vcsa, so what it covers is the login prompt, a shell on another virtual terminal and the installer. It does not read the graphical session. There the reader is Orca, which reads the native applications and reaches a braille display through BRLTTY’s API, BrlAPI, and its Python module. What is and is not read, how to turn it on and how its speech reaches the sound card are in Braille and speech at a text console.
The package installs the brltty daemon, with its three screen drivers and the eSpeak NG speech driver built in; its braille drivers and its other speech drivers as loadable modules under /usr/lib/brltty; libbrlapi with its Python module; the polkit action and rule that admit a BrlAPI client; and a service script, 65_brltty.
Why it is in KDOS
The comment above it in script/phases/41_system/packages.d/accessibility.txt:
BRLTTY reads /dev/vcsa, so what it covers is the text consoles: the tty1 login prompt before the desktop starts, tty2 and the installer — grids of cells it takes verbatim, with none of the guessing a toolkit tree needs. Once the desktop runs on tty1, that console gives it nothing. It does not read the graphical session: its AtSpi2 screen driver is not built, and the session's reader is Orca, which reaches a braille display through BrlAPI. The statement of record is docs/kdos/02-user-guide/accessibility.md.
Sources
brltty-6.9.1.tar.xz(12.3 MiB)
sha256cf4619ce1471690e4ecc5544ee6289cef6c5bdf5855a1ac8dcc63f5beedf108d
upstream: https://brltty.app/archive/brltty-6.9.1.tar.xz
archive copy: sources-1/accessibility--brltty-6.9.1.tar.xz
Dependencies
Depends on: autoconf, automake, libtool, pkgconf, ncurses, alsa-lib, eudev, espeak-ng, coreutils, doxygen, speech-dispatcher, bluez, dbus, polkit, icu, libcap, pcre2, expat, gettext, tmux, liblouis, python3, python3-cython, python3-setuptools.
Required by: no port names it.
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/41_system/phase.env && kpkg install brltty'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/accessibility/brltty.
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/accessibility/brltty
echo 'cf4619ce1471690e4ecc5544ee6289cef6c5bdf5855a1ac8dcc63f5beedf108d brltty-6.9.1.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/brltty
SRC=$SRC_ROOT/brltty-6.9.1
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf brltty-6.9.1.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:
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--libdir=/usr/lib \
--localstatedir=/var \
--disable-x \
--disable-java-bindings \
--disable-ocaml-bindings \
--disable-tcl-bindings \
--enable-python-bindings \
--disable-lua-bindings \
--disable-emacs-bindings \
--disable-lisp-bindings \
--enable-liblouis \
--disable-gpm \
--enable-i18n \
--enable-icu \
--enable-polkit \
--enable-expat \
--with-curses=ncurses \
--with-rgx-package=libpcre2-32 \
--with-pcm-package=alsa \
--with-midi-package=alsa \
--with-service-package=no \
--without-libbraille \
--without-espeak \
--without-flite \
--without-mikropuhe \
--without-swift \
--without-theta \
ac_cv_header_eci_h=no \
ac_cv_lib_intl_main=no \
--with-screen-driver=lx,em,tx,-all \
--with-speech-driver=eSpeak-NG
make
make install INSTALL_ROOT=$PKG CONFLIBDIR=:
compgen -G "$PKG/usr/lib/python3*/site-packages/brlapi*.so" >/dev/null || {
echo 'brltty: the Python brlapi module was not built; Orca would have no braille' >&2
exit 1
}
make install-polkit INSTALL_ROOT=$PKG
install -d "$PKG/etc/init.d"
cat > "$PKG/etc/init.d/65_brltty.sh" <<'KDOS_SH'
#!/bin/bash
. /etc/init.d/service_helper
NAME="brltty"
DAEMON="/usr/bin/brltty"
case "$1" in
start)
[ ! -x "$DAEMON" ] && { echo "[SKIP] $NAME: $DAEMON not found"; exit 0; }
# The configuration is the only opt-in. An attached serial or USB
# device is no sign of a braille display — most are something else —
# and nothing installs /etc/brltty.conf: a machine starts BRLTTY once
# somebody writes one naming the display driver or speech path.
if [ ! -s /etc/brltty.conf ]; then
echo "[SKIP] $NAME: no /etc/brltty.conf"
exit 0
fi
echo "[KDOS] Starting $NAME..."
# Speech plays through ALSA `default`, which is the session's
# PipeWire, and init starts no PipeWire: without this the voice is
# "Host is down" and silence. kdos_card is the card itself and is
# exclusive, and eSpeak NG holds it only while an utterance plays:
# while a desktop session's PipeWire holds the card this cannot
# speak, and while this speaks PipeWire cannot play.
export KDOS_ALSA_DEFAULT=kdos_card
supervise "$NAME" "$DAEMON" -n
;;
stop) stop_service "$NAME" ;;
status) check_status "$NAME" ;;
*) echo "Usage: $0 {start|stop|status}"; exit 1 ;;
esac
KDOS_SH
chmod 755 "$PKG/etc/init.d/65_brltty.sh"
The switches, and why each is set:
--disable-x— leave out BRLTTY’s X11 support:xbrlapi, the helper that tells BrlAPI which X window has the focus, and theXWindowbraille driver, which draws a braille display in an X window. This desktop is not an X desktop, and no Xorg server is part of KDOS (see No Xorg server, and one carve-out).--enable-python-bindings— build thebrlapiPython module, which is how Orca drives a braille display. It is Cython, compiled with python3-cython. configure answers a missing Cython or Python environment with a warning and builds without the module, sobuild.shchecks forbrlapi*.soafter the install and fails the build when it is absent.--disable-java-bindings— and the OCaml, Tcl, Lua, Emacs and Lisp bindings after it: the other languages BrlAPI can be called from, none of which anything in the tree uses.--enable-liblouis— let a contraction table be a liblouis table, named with thelouis:prefix, as in-c louis:en-ueb-g2.ctb. Grade 2 and every other contracted braille comes from liblouis; without it only BRLTTY’s own few contraction tables exist (see Contracted braille).--disable-gpm— no mouse support through GPM, which is not a port.--enable-i18n— with--enable-icu,--enable-polkitand--enable-expat: translated messages, Unicode character handling through icu, BrlAPI authorisation through polkit, and the XML parser for the CLDR tables through expat. Each of these allows a feature and does not require it: configure builds without one whose library is missing. What makes each certain is its port independs.--with-curses=ncurses— the curses library the TTY braille driver andbrltty-ptyuse. BRLTTY’sncurseswchoice includes<ncursesw/ncurses.h>, and this tree’s ncurses installs its wide-character headers straight into/usr/include.--with-rgx-package=libpcre2-32— the regular expression library, PCRE2’s library for 32-bit code units, named rather than taken first-found from configure’s list,libpcre2-32 libpcre32.--with-pcm-package=alsa— with--with-midi-package=alsa: play BRLTTY’s alert tunes through ALSA, as PCM and as MIDI, rather than through OSS, the list’s other entry.--with-service-package=no— no system-service integration. Its one candidate on Linux is libsystemd, which KDOS does not have (see No systemd); without it the daemon is an ordinary one that the service script supervises.--without-libbraille— keep out the driver for Libbraille, a third-party braille library that is not a port. configure registers that driver only when the library is found.--without-espeak— with--without-flite,--without-mikropuhe,--without-swiftand--without-theta: keep out the speech drivers for engines this tree does not carry. The old eSpeak driver needs this switch most, because it links-lespeakand would otherwise be registered on the strength of the compatibility header espeak-ng installs in/usr/include/espeak.ac_cv_header_eci_h=no— keep out the ViaVoice speech driver, which has no switch and is registered whenever aneci.hheader is found.ac_cv_lib_intl_main=no— answer configure’s probe for a separatelibintlwith no, so the build never links the libintl port when it happens to be installed. musl’s own gettext functions carry the translations.--with-screen-driver=lx,em,tx,-all— build the three screen drivers into the daemon:lxreads the Linux console,em(TerminalEmulator) a terminal run underbrltty-pty, andtxatmuxsession. A driver the list does not name is built as a loadable module unless the list ends in-all, which leaves every other one out; among them is FileViewer, which links-ltinfo, a library this tree’s ncurses does not build. The AtSpi2 driver, which would read a graphical desktop, is left out with them.--with-speech-driver=eSpeak-NG— build the eSpeak NG driver into the daemon. The name is matched case-sensitively against the directory underDrivers/Speech, and anything else isunknown speech driver. The list has no-all, so every other speech driver configure registered is built as a module; among them is SpeechDispatcher, which speaks through speech-dispatcher.INSTALL_ROOT=$PKG— the staging directory. BRLTTY’s makefiles read their own variable for it and notDESTDIR; givenDESTDIRinstead, the install would write into the live root, outside the package.CONFLIBDIR=:— the command run on the library directory after the API library is installed. configure writes/sbin/ldconfig -nfor every Linux host without looking;:, the value it gives every other host, runs nothing, and musl’s loader keeps no cache forldconfigto rebuild.
The braille driver list is left at its default, which builds every driver configure registered as a loadable module under /usr/lib/brltty; almost all of them speak to the display through BRLTTY’s own serial, USB, HID and Bluetooth code and need no library.
The common switches of each build system are explained in the Flag glossary.
postinstall.sh runs on the installed system after the package is adopted:
# Everything is written under PKG_ROOT, the root kpkgadd is installing into:
# --root and an A/B update install into a tree that is not the running one.
#
# BrlAPI admits a client through polkit's org.a11y.brlapi.write-display, and
# the rule build.sh installs grants that action to the brlapi group and to
# nobody else: without the group every BrlAPI client — brltty-clip included —
# is refused by the running daemon. The desktop account joins it only when the
# group is first made, so a user who later leaves it stays out across
# reinstalls. The guard reads PKG_ROOT's files, because getent answers for the
# running root and not the tree being installed.
root="${PKG_ROOT:-/}"
if ! grep -q '^brlapi:' "$root/etc/group" 2>/dev/null; then
groupadd -R "$root" -r brlapi
grep -q '^kdos:' "$root/etc/passwd" 2>/dev/null && \
usermod -R "$root" -a -G brlapi kdos
fi
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/brltty, 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 brltty-6.9.1-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/brltty, and runs the triggers its paths call for.
Contents
Installed programs: brltty, brltty-atb, brltty-cldr, brltty-clip, brltty-cmdref, brltty-config.sh, brltty-ctb, brltty-genkey, brltty-hid, brltty-ktb, brltty-lsinc, brltty-mkuser, brltty-morse, brltty-prologue.bash, brltty-prologue.lua, brltty-prologue.sh, brltty-prologue.tcl, brltty-setcaps, brltty-term, brltty-tmux, brltty-trtxt, brltty-ttb, brltty-ttysize, brltty-tune, eutp, vstp.
Installed libraries: libbrlapi.a, libbrlapi.so.
Installed directories: /etc/brltty, /usr/include/brltty, /usr/lib/brltty, /usr/lib/python3.14/site-packages/Brlapi-0.8.8-py3.14.egg-info, /usr/libexec/brltty, /usr/share/licenses/brltty, /var/lib/BrlAPI.
Short descriptions
brltty |
refreshable braille display driver for Linux/Unix |
eutp |
EuroBraille file transferring |
vstp |
VisioBraille file transferring |
brltty.pc |
Braille Device Daemon |
Notes
The source is the release archive from brltty.app, not the tag archive from GitHub. The release carries upstream’s generated configure; the tag archive has none and needs ./autogen, which would generate it with this tree’s autoconf and run Tools/gendeps, a Tcl script that opens every source file to follow its includes. Upstream’s configure calls expr length, a GNU extension that POSIX expr does not have, so coreutils is in depends.
BrlAPI admits a client only when it may: its default is a key file plus polkit, and make install writes neither half. The key file would be one secret copied into every image, so the port installs only the polkit half, with make install-polkit: the action org.a11y.brlapi.write-display and upstream’s rule, which grants it to members of the brlapi group and tests no session. postinstall.sh creates that group the first time the package is installed and adds the desktop account, kdos, to it; a user later removed from the group stays out across reinstalls. Without the group every BrlAPI client is refused, Orca and brltty-clip included (see Programs that talk to BRLTTY).
The service script, /etc/init.d/65_brltty.sh, starts nothing until /etc/brltty.conf exists and is not empty, and nothing installs that file: an attached serial or USB device is no sign of a braille display. It runs the daemon as root, because /dev/vcsa belongs to root and the tty group, and sets KDOS_ALSA_DEFAULT=kdos_card, so speech goes straight to the sound card when no session’s PipeWire is running. The eSpeak NG driver links espeak-ng, which opens the card for each utterance and closes it once the utterance has played, so BRLTTY holds the card only while it speaks (see Turning BRLTTY on and Speech and the sound card).