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

318.2. audacity-4.0.0

Multitrack audio editor and recorder — the Qt 6 Audacity 4, with LV2 and Nyquist effects

Version 4.0.0, release 3
Shelf studio — Music production: DAWs, audio editors, trackers, drum machines and notation
Phase 44_apps (Applications), 372 of 422 in build order
Licence GPL-3.0-only
Homepage https://www.audacityteam.org/
Build time 32.7 SBU
Installed size 47.3 MiB in 92 files
Recipe ports/core/studio/audacity/kpkgbuild

About

Audacity is a multitrack audio editor and recorder. This is Audacity 4, whose interface is rewritten in Qt 6 and QML on the framework MuseScore Studio also uses (“muse”), over the audio engine and libraries of Audacity 3 (the tree’s au3/). It records, edits and mixes tracks and runs its built-in effects, LV2 plugins and Nyquist effects; the tree carries Audacity 3’s LADSPA host, but no build file compiles it. FFmpeg import and export loads the libraries of the ffmpeg port at run time.

Sources

Dependencies

Depends on: cmake, ninja, pkgconf, git, qt6-qtbase, qt6-qtdeclarative, qt6-qtsvg, qt6-qtshadertools, qt6-qt5compat, qt6-qtnetworkauth, qt6-qttools, qt6-qtwayland, wxwidgets, zlib, expat, libpng, freetype2, harfbuzz, pugixml, libogg, libvorbis, flac, opus, opusfile, lame, mpg123, wavpack, libsndfile, portaudio, alsa-lib, ffmpeg.

Required by: no port names it.

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/44_apps/phase.env && kpkg install audacity'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/studio/audacity.

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/studio/audacity
echo 'b29076f99fa5d2f522d001db472a896db81f9effefd15948c940571753858058  audacity-4.0.0.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/audacity
SRC=$SRC_ROOT/audacity-4.0.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf audacity-4.0.0.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:

patch -p1 -i "$PORT_SRC/sqlite-helpers-cstdint.patch"
patch -p1 -i "$PORT_SRC/beats-formatter-pow10.patch"
patch -p1 -i "$PORT_SRC/vst-stub-include.patch"
patch -p1 -i "$PORT_SRC/wayland-platform.patch"
patch -p1 -i "$PORT_SRC/muse-extensions-qml-no-unity.patch"
export EXTDEPS_CACHE="$SRC/offline-deps"
export CXXFLAGS="$CXXFLAGS -D_LARGEFILE64_SOURCE"
cmake -S . -B build -G Ninja \
	-D CMAKE_INSTALL_PREFIX=/usr \
	-D CMAKE_INSTALL_LIBDIR=lib \
	-D CMAKE_BUILD_TYPE=Release \
	-D CMAKE_SKIP_INSTALL_RPATH=ON \
	-D EXTDEPS_CACHE="$SRC/offline-deps" \
	-D EXTDEPS_OVERRIDE_ALL=SYSTEM \
	-D EXTDEPS_OVERRIDE_UTFCPP=REBUILD \
	-D AU4_BUILD_CONFIGURATION=app \
	-D AU4_BUILD_MODE=release \
	-D MUSE_ENABLE_UNIT_TESTS=OFF \
	-D MUSE_COMPILE_USE_CCACHE=OFF \
	-D MUSE_MODULE_UPDATE=OFF \
	-D MUSE_MODULE_DIAGNOSTICS_CRASHPAD_CLIENT=OFF \
	-D AU_BUILD_CLOUD_AUDIOCOM=OFF \
	-D AU_BUILD_USAGEINFO_MODULE=OFF \
	-D AU_USE_LIBCURL=OFF \
	-D AU_MODULE_EFFECTS_VST=OFF \
	-D AU_MODULE_EFFECTS_LV2=ON \
	-D AU_MODULE_EFFECTS_NYQUIST=ON \
	-D AU_USE_SBSMS=ON \
	-D AU_USE_SOUNDTOUCH=ON \
	-D AU_USE_PORTMIXER=ON \
	-D AU_RUN_LRELEASE=OFF \
	-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build

find "$PKG/usr/share" -path '*/locale/*.qm' -delete

cat > "$PKG/usr/share/applications/org.audacityteam.Audacity.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=Audacity
GenericName=Sound Editor
Comment=Record and edit audio files
TryExec=audacity
Exec=audacity %U
Icon=audacity
Terminal=false
StartupNotify=true
StartupWMClass=org.audacityteam.Audacity
MimeType=application/x-audacity;
Categories=AudioVideo;Audio;AudioVideoEditing;Recorder;Qt;
Keywords=sound;audio;editor;record;recorder;multitrack;mixing;noise reduction;wav;flac;mp3;audacity;
DESKTOP
chmod 644 "$PKG/usr/share/applications/org.audacityteam.Audacity.desktop"

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/audacity, 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 audacity-4.0.0-3.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/audacity, and runs the triggers its paths call for.

Contents

Installed programs: audacity.

Installed directories: /usr/share/audacity, /usr/share/audacity-4.0, /usr/share/licenses/audacity.

Notes

The engine applies its own patches to the dependency sources with git apply, so git is a build dependency.

build.sh writes its own org.audacityteam.Audacity.desktop. Audacity sets its desktop file name to org.audacityteam.Audacity.desktop, so its Wayland app id is org.audacityteam.Audacity, which the entry repeats in StartupWMClass. The entry claims only application/x-audacity, Audacity’s own project type, and leaves audio files to the music player.

On a machine with no capture device, Audacity shows “Error opening recording device … Invalid sample rate” whenever a project opens: it starts input monitoring through PortAudio, and no switch or system default turns that off (see Known gaps).