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

154.5. tesseract-5.5.3

OCR engine — text from scanned images

5.5.3-1 · Apache-2.0 · 2.0 SBU · 5.1 MiB, 57 files · 41_system, 856 of 1047 · ports/core/printing/tesseract

Homepage: https://github.com/tesseract-ocr/tesseract

Tesseract is the optical character recognition (OCR) engine: it reads the text in a scanned or photographed page. It installs the tesseract command and the libtesseract library that skanpage and gimagereader recognise text with. It recognises a language only when that language’s trained data is installed; tessdata-eng provides English.

Depends on: cmake, ninja, pkgconf, leptonica, libarchive, curl, icu, libtiff, asciidoctor, tessdata-eng.

Required by (6): ffmpeg, gimagereader, mupdf, ocrmypdf, skanpage, spectacle.

Sources: tesseract-5.5.3.tar.gz (1.8 MiB). Every step kpkg takes applies to this port.

Install: script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install tesseract'

build.sh:

mkdir -p build && cd build
cmake .. -G Ninja \
	-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DCMAKE_INSTALL_LIBDIR=lib \
	-DBUILD_SHARED_LIBS=ON \
	-DBUILD_TRAINING_TOOLS=OFF \
	-DDISABLE_TIFF=OFF \
	-DDISABLE_ARCHIVE=OFF \
	-DDISABLE_CURL=OFF \
	-DGRAPHICS_DISABLED=ON \
	-DUSE_SYSTEM_ICU=ON \
	-DTESSDATA_PREFIX=/usr/share
for def in HAVE_TIFFIO_H HAVE_LIBARCHIVE HAVE_LIBCURL TESSDATA_PREFIX; do
	grep -q "^#define $def " config_auto.h || { echo "tesseract: $def not configured" >&2; exit 1; }
done
ninja
DESTDIR=$PKG ninja install

mkdir -p man
for page in tesseract.1 unicharset.5; do
	asciidoctor -b manpage -o man/$page ../doc/$page.asc
	install -Dm644 man/$page -t "$PKG/usr/share/man/man${page##*.}"
done

Programs: tesseract.

Libraries: libtesseract.so.

Directories: /usr/include/tesseract, /usr/lib/cmake/tesseract, /usr/share/licenses/tesseract, /usr/share/tessdata/configs, /usr/share/tessdata/tessconfigs.