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

137.3. libmikmod-3.3.14

Tracker module player library — S3M, XM, IT, MOD

Version 3.3.14, release 1
Shelf music-libs — Music-format libraries: tracker modules, chip emulation, MIDI, OSC, synthesis and soundfonts
Phase 41_system (System), 765 of 1047 in build order
Licence LGPL-2.0-or-later
Homepage https://mikmod.sourceforge.net/
Build time 0.2 SBU
Installed size 522.1 KiB in 11 files
Recipe ports/core/music-libs/libmikmod/kpkgbuild

About

libmikmod plays tracker modules: MOD, S3M, XM, IT and the other formats of the tracker programs, songs stored as patterns of notes plus the instrument samples. It is the music of kdos-bb, and cmus and mpd link it for module playback. The recipe builds it for ALSA alone: on a bare console there is no PipeWire, and a desktop session’s PipeWire is reached through ALSA’s default device anyway.

Why it is in KDOS

The comment above it in script/phases/41_system/packages.d/music-libs.txt:

Tracker-module playback for kdos-bb, ALSA only — on a bare TTY there is no pipewire, and kdos is already in the audio group.

Sources

Dependencies

Depends on: alsa-lib.

Required by (3): cmus, kdos-bb, mpd.

Patches

build.sh applies these; kpkg applies nothing by itself.

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 libmikmod'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/music-libs/libmikmod.

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/music-libs/libmikmod
echo 'dffd82b8f254c3489c32098da831f33eac7136843d1e7ccb802f1254ad5b4219  libmikmod-3.3.14.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/libmikmod
SRC=$SRC_ROOT/libmikmod-3.3.14
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf libmikmod-3.3.14.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/alsa-null-close.patch
patch -p1 -i $PORT_SRC/alsa-nonblocking-update.patch

./configure --prefix=/usr \
            --sysconfdir=/etc \
            --libdir=/usr/lib \
            --mandir=/usr/share/man \
            --disable-static \
            --disable-alldrv \
            --enable-alsa \
            --enable-wav \
            --enable-raw \
            --enable-aiff \
            --enable-stdout \
            --enable-pipe \
            --enable-threads \
            --disable-dl
make
make DESTDIR=$PKG install

rm -f $PKG/usr/share/info/dir

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/libmikmod, 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 libmikmod-3.3.14-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/libmikmod, and runs the triggers its paths call for.

Contents

Installed programs: libmikmod-config.

Installed libraries: libmikmod.so.

Installed directories: /usr/share/licenses/libmikmod.

Short descriptions

libmikmod-config script to get information about the installed version of libmikmod.
libmikmod.pc Library for playing Module Files and for Sound Effects

Notes

The ALSA driver opens the PCM named default and takes no options, so it plays wherever that name points: PipeWire in a desktop session, and nothing in a login with no session unless KDOS_ALSA_DEFAULT names the card; see Audio on a bare console.