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

137.15. libgig-4.6.0

Gigasampler, DLS, SoundFont 2 and KORG sample-library file access, with the gigextract and dlsdump tools

Version 4.6.0, release 1
Shelf music-libs — Music-format libraries: tracker modules, chip emulation, MIDI, OSC, synthesis and soundfonts
Phase 41_system (System), 777 of 1047 in build order
Licence GPL-2.0-or-later
Homepage https://www.linuxsampler.org/libgig/
Build time 1.9 SBU
Installed size 2.7 MiB in 45 files
Recipe ports/core/music-libs/libgig/kpkgbuild

About

libgig reads and writes the sample-library formats of hardware and software samplers: Gigasampler (.gig), DLS, SoundFont 2 and KORG, with libakai for Akai sampler disks. It installs the gigextract, gigdump, dlsdump, sf2dump, korgdump, akaidump and related tools. LMMS loads Gigasampler instruments through it.

Sources

Dependencies

Depends on: libsndfile, util-linux, pkgconf.

Required by (1): lmms.

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

What kpkg does

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

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/libgig
echo 'fc331202210919e3172c4d36ab24231dea3667d8722141f0c7939ca545119d01  libgig-4.6.0.tar.bz2' | 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/libgig
SRC=$SRC_ROOT/libgig-4.6.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf libgig-4.6.0.tar.bz2 -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/pc-libdir.patch"
./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --disable-static
make pkglibdir=/usr/lib
make pkglibdir=/usr/lib DESTDIR=$PKG install

test -e "$PKG/usr/lib/libgig.so"
test -e "$PKG/usr/lib/libakai.so"
grep -q "^libdir=/usr/lib$" "$PKG/usr/lib/pkgconfig/gig.pc"

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

Contents

Installed programs: akaidump, akaiextract, dlsdump, gig2mono, gig2stereo, gigdump, gigextract, gigmerge, korg2gig, korgdump, rifftree, sf2dump, sf2extract, wav2gig.

Installed libraries: libakai.so, libgig.so.

Installed directories: /usr/include/libgig, /usr/share/licenses/libgig.

Short descriptions

akaidump Dump an AKAI media (i.e. CDROM) as disk image file to your HD.
akaiextract Extract audio samples from an AKAI media or AKAI disk image file.
dlsdump List information about a DLS (Downloadable Sound) file.
gig2mono Converts Gigasampler (.gig) files from stereo to mono.
gig2stereo Converts Gigasampler (.gig) files from mono pairs to true stereo.
gigdump List information about a Gigasampler (.gig) file.
gigextract Extract samples from Gigasampler (.gig) files.
gigmerge Merges several Gigasampler (.gig) files to one Gigasampler file.
korg2gig Convert sound files from KORG to GigaStudio format.
korgdump List information about sound files in KORG synthesizer format.
rifftree Print RIFF tree structure of an arbitrary RIFF file.
sf2dump Parses SoundFont v2 (.sf2) files and prints out the content.
sf2extract Extract samples from SoundFont version 2 (.sf2) files.
wav2gig Create GigaStudio (.gig) file from a set of WAV files.
akai.pc C++ library for accessing AKAI disk images
gig.pc C++ library for accessing Gigasampler/GigaStudio, DLS, SoundFont and KORG sound files

Notes

The configure script stops unless it finds libsndfile or libaudiofile, which gigextract, sf2extract, akaiextract and wav2gig read and write audio files with. It searches for libaudiofile only when libsndfile is missing, so the audiofile port is not a dependency. uuid_generate(), which gives a new DLS or gig file its DLSID, comes from util-linux’s libuuid; without it configure stops. build.sh checks that both libraries were installed in /usr/lib and that gig.pc says libdir=/usr/lib.