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

135.26. audiofile-0.3.6

SGI's audio file library: reads and writes AIFF, WAVE, NeXT/Sun, IRCAM, AVR, CAF and FLAC through one API

Version 0.3.6, release 1
Shelf audio-codecs — Audio codecs, containers and tagging, including the Bluetooth audio codecs
Phase 41_system (System), 132 of 1047 in build order
Licence LGPL-2.1-or-later AND GPL-2.0-or-later
Homepage https://audiofile.68k.org/
Build time 0.4 SBU
Installed size 421.9 KiB in 44 files
Recipe ports/core/audio-codecs/audiofile/kpkgbuild

About

The Audio File Library reads and writes AIFF, AIFF-C, WAVE, NeXT/Sun, IRCAM, AVR, CAF and FLAC files through one C API, libaudiofile, and installs the sfconvert and sfinfo commands. The patches beside it are Debian’s series for this release: overflow, division-by-zero and out-of-bounds checks in the decoders and in sfconvert and sfinfo, and one change that lets it compile with GCC 6 and later. In KDOS, libspectrum and kwave link it.

Sources

Dependencies

Depends on: autoconf, automake, libtool, pkgconf, flac.

Required by (2): kwave, libspectrum.

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

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/audio-codecs/audiofile.

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/audio-codecs/audiofile
echo 'cdc60df19ab08bfe55344395739bb08f50fc15c92da3962fac334d3bff116965  audiofile-0.3.6.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/audiofile
SRC=$SRC_ROOT/audiofile-0.3.6
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf audiofile-0.3.6.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:

for p in \
	01_gcc6 \
	03_CVE-2015-7747 \
	04_clamp-index-values-to-fix-index-overflow-in-IMA.cpp \
	05_Always-check-the-number-of-coefficients \
	06_Check-for-multiplication-overflow-in-MSADPCM-decodeSam \
	07_Check-for-multiplication-overflow-in-sfconvert \
	08_Fix-signature-of-multiplyCheckOverflow.-It-returns-a-b \
	09_Actually-fail-when-error-occurs-in-parseFormat \
	10_Check-for-division-by-zero-in-BlockCodec-runPull \
	11_CVE-2018-13440 \
	12_CVE-2018-17095 \
	0013-Fix-CVE-2022-24599 \
	0014-Partial-fix-of-CVE-2019-13147 \
	0015-Partial-fix-of-CVE-2019-13147; do
	patch -p1 -i "$PORT_SRC/$p.patch"
done

autoreconf -fi
./configure --prefix=/usr --libdir=/usr/lib --disable-static \
	--enable-flac \
	--disable-examples \
	--disable-werror \
	--disable-coverage \
	--disable-valgrind
make
make DESTDIR=$PKG install

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

Contents

Installed programs: sfconvert, sfinfo.

Installed libraries: libaudiofile.so.

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

Short descriptions

sfconvert convert audio files
sfinfo display information about audio files
audiofile.pc audiofile

Notes