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
audacity-4.0.0.tar.xz(181.2 MiB)
sha256b29076f99fa5d2f522d001db472a896db81f9effefd15948c940571753858058
upstream: https://github.com/audacity/audacity/releases/download/Audacity-4.0.0/audacity-sources-4.0.0.tar.xz
archive copy: sources-4/studio--audacity-4.0.0.tar.xz
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.
beats-formatter-pow10.patch— Renames the file-localpow10()insrc/uicomponents/components/internal/numeric/beatsformatter.cpptopowerOf10(). musl’s<math.h>declares the GNU extensiondouble pow10(double)under_GNU_SOURCE, which g++ always defines, and every call with asize_targument is then ambiguous between the two (see a project function named like a C library extension).muse-extensions-qml-no-unity.patch— SetsUNITY_BUILD OFFon one target,muse_extensions_qml, the QML module of the framework’s extensions, inmuse/framework/extensions/qml/Muse/Extensions/CMakeLists.txt.MUSE_COMPILE_USE_UNITYis on by default and merges a module’s sources, twelve at a time, into one translation unit; this module’s sources do not compile merged, and with the patch each compiles on its own. No other target’s unity setting changes.sqlite-helpers-cstdint.patch— Adds#include <cstdint>toau3/libraries/au3-sqlite-helpers/sqlite/Statement.h, which namesint64_twithout it. The tree’s GCC C++ library headers do not bring<cstdint>in on the way to their own (see a standard header the source never includes).vst-stub-include.patch— Insrc/stubs/vst/vsteffectsstubmodule.cpp, includes the stub’s own header,vsteffectsstubmodule.h, instead of the real module’svsteffectsmodule.h. WithAU_MODULE_EFFECTS_VST=OFFthe stub is compiled, and the real module’s header is not on its include path; the stub’s header declares the same class (see a stub that includes the real module’s header).wayland-platform.patch— Removes the block ofsrc/app/main.cppthat, on Linux, setsQT_QPA_PLATFORMTHEME=gtk3(unlessAU_QT_QPA_PLATFORMisoffscreen) and, unlessAU_QT_QPA_PLATFORMis set,QT_QPA_PLATFORM=xcb. Unpatched, Audacity is always an Xwayland window with the GTK 3 platform theme; patched, Qt follows the session’sQT_QPA_PLATFORMandQT_QPA_PLATFORMTHEME(see a graphical application), so the window is a native Wayland one in the desktop’s colours.
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:
-D EXTDEPS_CACHE="$SRC/offline-deps"— exported as an environment variable as well. Audacity’s dependency engine,muse_deps, resolves each third-party library by downloading a source or a prebuilt archive into a cache. The release tarball carries every source the engine can fetch underoffline-deps/downloads, and pointing the cache there means nothing is downloaded. The-Dform is read by the configure, the environment variable by the engine’s per-dependency builds.-D EXTDEPS_OVERRIDE_ALL=SYSTEM— take every library dependency the engine would otherwise fetch prebuilt or rebuild from its port instead: expat, the Ogg, Vorbis, FLAC, Opus, LAME, mpg123, WavPack and libsndfile codecs, PortAudio, libpng, zlib, FreeType, HarfBuzz, pugixml and wxWidgets’ base library, each independs. The sources the engine has no system path for are compiled into the program from the tarball’s copies: SQLite, soxr, SoundTouch, SBSMS, twolame, the LV2 host stack, Nyquist, pffft, the VST3 SDK the framework always compiles, the loop-tempo-estimator and tft libraries, and the header-only RapidJSON and picojson.-D EXTDEPS_OVERRIDE_UTFCPP=REBUILD— a per-dependency override, which wins over the_ALLone: utf8cpp is header-only and is rebuilt from the tarball’s copy, whereSYSTEMwould swap it for the CMake package of the utfcpp port.-D CMAKE_SKIP_INSTALL_RPATH=ON— install every binary with noRPATH. The bundled KDDockWidgets setsCMAKE_INSTALL_RPATH_USE_LINK_PATH, which writes the link directories into the installed files; Audacity’s libraries are in/usr/lib, where the loader looks anyway (see what the package lint refuses).-D AU4_BUILD_CONFIGURATION=app— the desktop application, rather than the portable Windows build and the unit-test configuration.-D AU4_BUILD_MODE=release— a stable release. Upstream’s default isdev, which marks the program unstable and names itAudacity4Development.-D MUSE_ENABLE_UNIT_TESTS=OFF— none of the framework’s or the modules’ unit tests, which default to on.-D MUSE_COMPILE_USE_CCACHE=OFF— upstream’s default puts anyccacheit finds in front of the compiler; off, the tree’s compiler is called directly.-D MUSE_MODULE_UPDATE=OFF— no update checker; upstream’s stub module takes its place.-D MUSE_MODULE_DIAGNOSTICS_CRASHPAD_CLIENT=OFF— no Crashpad crash-reporting client. Off by default upstream, which turns it on for its own CI builds.-D AU_BUILD_CLOUD_AUDIOCOM=OFF— no audio.com cloud module;-D AU_BUILD_USAGEINFO_MODULE=OFFleaves out the usage-information module. Both are on by default upstream.-D AU_USE_LIBCURL=OFF— build the network manager without libcurl, which is not independs. This is upstream’s default.-D AU_MODULE_EFFECTS_VST=OFF— no VST3 effect hosting; upstream’s VST stub module is built in its place (seevst-stub-include.patch).-D AU_MODULE_EFFECTS_LV2=ON— and-D AU_MODULE_EFFECTS_NYQUIST=ON: LV2 plugin hosting and the Nyquist effects, both compiled from the tarball’s copies.-D AU_USE_SBSMS=ON— and-D AU_USE_SOUNDTOUCH=ON: the SBSMS time-stretching and SoundTouch pitch-and-tempo effects.-D AU_USE_PORTMIXER=ON— the in-tree PortMixer, which reads and sets the input and output volume of the selected audio device.-D AU_RUN_LRELEASE=OFF— compile no interface translations; the size and language policy keeps the package English only, andbuild.shalso deletes every.qmcatalogue the install puts under alocaledirectory.-D_LARGEFILE64_SOURCE— added toCXXFLAGS. musl declares the 64-bit file-offset names (stat64,off64_t,lseek64) only under this macro, which_GNU_SOURCEdoes not imply (see a glibc-only call on musl).
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).