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

328.14. dosbox-x-2026.08.31

x86 PC emulator for DOS, Windows 3.x/9x, PC-98 and PCjr/Tandy software

Version 2026.08.31, release 1
Shelf emulators — Standalone emulators of computers and consoles, and compatibility layers
Phase 44_apps (Applications), 121 of 422 in build order
Licence GPL-2.0-or-later
Homepage https://dosbox-x.com/
Build time 15.4 SBU
Installed size 45.5 MiB in 61 files
Recipe ports/core/emulators/dosbox-x/kpkgbuild

About

DOSBox-X is an x86 PC emulator for DOS software, for Windows 3.x and 9x, and for the NEC PC-98 and the PCjr and Tandy machines. It aims to emulate the hardware of the period accurately rather than only what games need. The port builds its SDL 2 front end on sdl2-compat.

Sources

Dependencies

Depends on: autoconf, automake, pkgconf, librsvg, sdl2-compat, sdl2-net, libglvnd, mesa, freetype2, libpng, zlib, alsa-lib, fluidsynth, libslirp, libpcap, ffmpeg, duktape.

Required by: no port names it.

Optional, off in KDOS

These switches in build.sh turn off a feature whose library is a port here. The recipe may turn each off on purpose, or because the library was not yet a port when the recipe was written; this list cannot tell which.

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 dosbox-x'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/emulators/dosbox-x.

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/emulators/dosbox-x
echo '992ea538ea858f9fb196b39de2276ce3048c731965e144e6288202abed109782  dosbox-x-2026.08.31.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/dosbox-x
SRC=$SRC_ROOT/dosbox-x-2026.08.31
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf dosbox-x-2026.08.31.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:

./autogen.sh

./configure --prefix=/usr --libdir=/usr/lib \
	--enable-sdl2 \
	--disable-x11 \
	--enable-opengl \
	--enable-freetype \
	--enable-printer \
	--enable-avcodec \
	--enable-libfluidsynth \
	--enable-libslirp \
	--enable-alsa-midi \
	--enable-mt32 \
	--enable-screenshots \
	--enable-xbrz \
	--enable-dynamic-core \
	--enable-dynrec
make
make DESTDIR=$PKG install

find "$PKG/usr/share/dosbox-x/languages" -name '*.lng' ! -name 'en_US.lng' -delete

for _size in 32 48 64 128 256; do
	install -d "$PKG/usr/share/icons/hicolor/${_size}x${_size}/apps"
	rsvg-convert -w "$_size" -h "$_size" \
		-o "$PKG/usr/share/icons/hicolor/${_size}x${_size}/apps/dosbox-x.png" \
		contrib/icons/dosbox-x.svg
done

cat > "$PKG/usr/share/applications/com.dosbox_x.DOSBox-X.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=DOSBox-X
GenericName=DOS Emulator
Comment=Run DOS, Windows 3.x and 9x, and PC-98 software
TryExec=dosbox-x
Exec=dosbox-x
Icon=dosbox-x
Terminal=false
StartupWMClass=dosbox-x
Categories=Game;Emulator;
Keywords=dos;msdos;emulator;pcjr;tandy;pc98;pc-98;windows 3.1;windows 95;retro;
DESKTOP
chmod 644 "$PKG/usr/share/applications/com.dosbox_x.DOSBox-X.desktop"

The switches, and why each is set:

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/dosbox-x, 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 dosbox-x-2026.08.31-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/dosbox-x, and runs the triggers its paths call for.

Contents

Installed programs: dosbox-x.

Installed directories: /usr/share/dosbox-x, /usr/share/licenses/dosbox-x.

Short descriptions

dosbox-x a x86/DOS and PC98 emulator

Notes

The tag archive carries no configure script, so build.sh runs upstream’s ./autogen.sh first, which is why autoconf and automake are in depends.

Every optional library is found by a probe that drops the feature, at most with a warning, when the library is missing: the ones above, and also sdl2-net for the modem and IPX emulation, libpcap for Ethernet pass-through to the host, and duktape, the ECMAScript engine sdlmain.cpp starts a heap of. Each is in depends, which is all that keeps the feature in the build.

build.sh deletes every interface translation in /usr/share/dosbox-x/languages but en_US.lng; DOSBox-X falls back to its built-in English strings. These .lng files are not message catalogs, so the package-wide English-only rule (see Size and language policy) does not reach them.

Upstream installs its icon as SVG only, in hicolor/scalable. build.sh renders contrib/icons/dosbox-x.svg with rsvg-convert from librsvg into five PNG sizes in the hicolor theme.

Upstream’s desktop entry is replaced: its StartupWMClass ends in a space, which no app_id matches. SDL’s Wayland app_id is the executable’s name, dosbox-x.