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

135.27. id3lib-3.8.3

ID3v1 and ID3v2 tag library, with the id3tag, id3info, id3convert and id3cp commands

Version 3.8.3, release 1
Shelf audio-codecs — Audio codecs, containers and tagging, including the Bluetooth audio codecs
Phase 41_system (System), 133 of 1047 in build order
Licence LGPL-2.0-or-later
Homepage https://id3lib.sourceforge.net/
Build time 0.5 SBU
Installed size 587.2 KiB in 22 files
Recipe ports/core/audio-codecs/id3lib/kpkgbuild

About

id3lib is a C++ library for reading, writing and stripping ID3 v1 and v2 tags in MP3 files, with a C interface, and it installs the id3tag, id3info, id3convert and id3cp commands. The patches beside it are Alpine’s set for this release: standard C++ headers, the iomanip.h check, a bool typedef that C23 rejects, the UTF-16 writer, a null-pointer check, a stack overrun and an insecure temporary file. In KDOS, kwave links it.

Sources

Dependencies

Depends on: autoconf, automake, libtool, zlib.

Required by (1): kwave.

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

What kpkg does

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

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/id3lib
echo '2749cc3c0cd7280b299518b1ddf5a5bcfe2d1100614519b68702230e26c7d079  id3lib-3.8.3.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/id3lib
SRC=$SRC_ROOT/id3lib-3.8.3
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf id3lib-3.8.3.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 10-fix-compilation-with-cpp-headers 30-fix-utf16 \
	50-remove-outdated-check 60-id3lib-missing-nullpointer-check \
	61-fix_vbr_stack_smash CVE-2007-4460 bool-typedef; do
	patch -p1 -i "$PORT_SRC/$p.patch"
done

libtoolize --force --copy --install
aclocal -I m4
autoconf
automake --add-missing --copy

./configure --prefix=/usr --libdir=/usr/lib --disable-static
make
make DESTDIR=$PKG install
nm -D "$PKG/usr/lib/libid3-3.8.so.3" | grep -q " U iconv_open"

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

Contents

Installed programs: id3convert, id3cp, id3info, id3tag.

Installed libraries: libid3-3.8.so, libid3.so.

Installed directories: /usr/include/id3, /usr/share/licenses/id3lib.

Notes