135.2. libvorbis-1.3.7
Vorbis audio codec
| Version | 1.3.7, release 1 |
| Shelf | audio-codecs — Audio codecs, containers and tagging, including the Bluetooth audio codecs |
| Phase | 41_system (System), 19 of 1047 in build order |
| Licence | BSD-3-Clause |
| Homepage | https://xiph.org/vorbis/ |
| Build time | 0.2 SBU |
| Installed size | 1.2 MiB in 31 files |
| Recipe | ports/core/audio-codecs/libvorbis/kpkgbuild |
About
libvorbis is the reference Vorbis audio codec: libvorbis, with the libvorbisenc encoder and the libvorbisfile reader on top, over libogg. It is the Vorbis encoder and decoder of ffmpeg, libsndfile, the GStreamer plugins, sdl2-mixer and sdl3-mixer, and through them of most of the players and games of the tree. The oggenc and oggdec commands are in vorbis-tools.
Why it is in KDOS
The comment above the 5 ports from libogg to lame in script/phases/41_system/packages.d/audio-codecs.txt:
ffmpeg, libsndfile and the gst plugin packages are configured against these and are only as capable as what is installed: each of those build systems answers a missing library by disabling the feature rather than failing. One encoder per format — adding a second earns nothing.
Sources
libvorbis-1.3.7.tar.xz(1.1 MiB)
sha256b33cc4934322bcbf6efcbacf49e3ca01aadbea4114ec9589d1b1e9d20f72954b
upstream: https://downloads.xiph.org/releases/vorbis/libvorbis-1.3.7.tar.xz
archive copy: sources-1/audio-codecs--libvorbis-1.3.7.tar.xz
Dependencies
Depends on: libogg.
Required by (42): audacious-plugins, audacity, audiocd-kio, avidemux, cdrdao, cmus, dsda-doom, ffmpeg, goldendict-ng, gst-plugins-base, handbrake, ioquake3, ironwail, k3b, kwave, libcanberra, libopenmpt, libsndfile, lmms, love, luanti, minidlna, mkvtoolnix, mlt, mpd, neverball, openmsx, openrct2, pioneer, scummvm, sdl2-mixer, sdl3-mixer, sox, supertux, supertuxkart, tenacity, vice, vlc, vorbis-tools, warzone2100, wesnoth, xonotic.
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 libvorbis'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/audio-codecs/libvorbis.
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/libvorbis
echo 'b33cc4934322bcbf6efcbacf49e3ca01aadbea4114ec9589d1b1e9d20f72954b libvorbis-1.3.7.tar.xz' | 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/libvorbis
SRC=$SRC_ROOT/libvorbis-1.3.7
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf libvorbis-1.3.7.tar.xz -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:
export CFLAGS="${CFLAGS/-O2/-O3}" CXXFLAGS="${CXXFLAGS/-O2/-O3}"
./configure --prefix=/usr --libdir=/usr/lib --disable-static
make
make DESTDIR=$PKG install
The switches, and why each is set:
${CFLAGS/-O2/-O3}— raise the exportedCFLAGSandCXXFLAGSfrom-O2to-O3. libvorbis’sconfiguresets-O3itself for GCC on Linux, with-ffast-mathamong its flags, but puts the caller’sCFLAGSafter its own, so the tree’s-O2would win. Raised, the codec builds at the level upstream chose; this is the “-O3for a hot port by pattern” case of Every port.
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/libvorbis, 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 libvorbis-1.3.7-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/libvorbis, and runs the triggers its paths call for.
Contents
Installed libraries: libvorbis.so, libvorbisenc.so, libvorbisfile.so.
Installed directories: /usr/include/vorbis, /usr/share/doc/libvorbis-1.3.7, /usr/share/licenses/libvorbis.
Short descriptions
vorbis.pc |
vorbis is the primary Ogg Vorbis library |
vorbisenc.pc |
vorbisenc is a library that provides a convenient API for setting up an encoding environment using libvorbis |
vorbisfile.pc |
vorbisfile is a library that provides a convenient high-level API for decoding and basic manipulation of all Vorbis I audio streams |