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

342.1. freedv-gui-2.4.0

HF digital voice for amateur radio: RADE, 700D, 700E and 1600 modes over a sound card

Version 2.4.0, release 2
Shelf hamradio — Amateur-radio operation: rig control, digital modes, logging, packet and APRS, propagation, and mesh radio
Phase 44_apps (Applications), 243 of 422 in build order
Licence LGPL-2.1-only AND BSD-2-Clause AND BSD-3-Clause
Homepage https://freedv.org/
Build time 7.4 SBU
Installed size 45.5 MiB in 16 files
Recipe ports/core/hamradio/freedv-gui/kpkgbuild

About

FreeDV is digital voice for HF amateur radio over a sound card: it encodes speech into the RADE, 700D, 700E and 1600 modes, keys the transmitter through hamlib, and decodes the received signal back to speech. The GUI is built on wxwidgets with GTK 3. Its modem and codec code is freedv-backend, which in turn builds RADE (the machine-learning voice mode), its own Opus with the FARGAN vocoder, and RNNoise for noise suppression.

Sources

Dependencies

Depends on: cmake, pkgconf, autoconf, automake, libtool, wxwidgets, gtk3, libpulse, hamlib, libsndfile, libsamplerate, libebur128, openssl, dbus.

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 freedv-gui'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/hamradio/freedv-gui.

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/hamradio/freedv-gui
echo '9e4b1bcf5d4ce3b18a1b120acb4d4483d4f635990b18a97b98174fc51fae5678  freedv-gui-2.4.0.tar.gz' | sha256sum -c -
echo 'cdab91c479653eb6595c2f94461565e8a23603db246b5c9a578ea8d8c404c216  freedv-backend-1.0.0.tar.gz' | sha256sum -c -
echo '3d51bc21c823898531be932dcfff684904b6090db1b98dbd39a4fb8a2771c10b  rade_c-cc17222acc597339199bdfd7253c3e6cf147f953.tar.gz' | sha256sum -c -
echo '285c74f5130ee074f123aaad81cd52c2fc8db653ee130941afafe3ee0ae8cec2  opus-940d4e5af64351ca8ba8390df3f555484c567fbb.tar.gz' | sha256sum -c -
echo '4ed9445b96698bad25d852e912b41495ddfa30c8dbc8a55f9cde5826ed793453  opus_data-4ed9445b96698bad25d852e912b41495ddfa30c8dbc8a55f9cde5826ed793453.tar.gz' | sha256sum -c -
echo 'f61ee0b3f4c4cd337303e003d333357c5eaf25ef5d75a742109ee59e9a0a3932  rnnoise-70f1d256acd4b34a572f999a05c87bf00b67730d.tar.gz' | sha256sum -c -
echo '0a8755f8e2d834eff6a54714ecc7d75f9932e845df35f8b59bc52a7cfe6e8b37  rnnoise_data-0a8755f8e2d834eff6a54714ecc7d75f9932e845df35f8b59bc52a7cfe6e8b37.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/freedv-gui
SRC=$SRC_ROOT/freedv-gui-2.4.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf freedv-gui-2.4.0.tar.gz -C "$SRC" --strip-components=1
tar --no-same-permissions --warning=no-unknown-keyword -xf freedv-backend-1.0.0.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf rade_c-cc17222acc597339199bdfd7253c3e6cf147f953.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf opus-940d4e5af64351ca8ba8390df3f555484c567fbb.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf opus_data-4ed9445b96698bad25d852e912b41495ddfa30c8dbc8a55f9cde5826ed793453.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf rnnoise-70f1d256acd4b34a572f999a05c87bf00b67730d.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf rnnoise_data-0a8755f8e2d834eff6a54714ecc7d75f9932e845df35f8b59bc52a7cfe6e8b37.tar.gz -C "$SRC_ROOT"

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 recipe’s helpers _backend, _rade, _opus, _opusdata, _rnnoise, _rnnoisedata and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

_be="$SRC_ROOT/freedv-backend-$_backend"
_rade_src="$SRC_ROOT/rade_c-$_rade"
_opus_src="$SRC_ROOT/opus-$_opus"
_rnnoise_src="$SRC_ROOT/rnnoise-$_rnnoise"
patch -p1 -i "$PORT_SRC/musl.patch"
patch -d "$_be" -p1 -i "$PORT_SRC/backend-local-sources.patch"
patch -d "$_be" -p1 -i "$PORT_SRC/backend-musl.patch"
patch -d "$_rade_src" -p1 -i "$PORT_SRC/rade-opus-no-model-download.patch"
cp -a "$SRC_ROOT/dnn/." "$_opus_src/dnn/"
cp -a "$SRC_ROOT"/src/rnnoise_data* "$_rnnoise_src/src/"

export X86_AVX2_CFLAGS="-mavx -mfma -mavx2 -Wno-error=incompatible-pointer-types"
export LDFLAGS="$LDFLAGS -Wl,--strip-debug"
cmake -B build \
	-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DFETCHCONTENT_FULLY_DISCONNECTED=ON \
	-DFETCHCONTENT_SOURCE_DIR_FREEDV_BACKEND="$_be" \
	-DRADE_C_URL="$_rade_src" \
	-DOPUS_URL="$_opus_src" \
	-DRNNOISE_URL="$_rnnoise_src" \
	-DUSE_NATIVE_AUDIO=TRUE \
	-DUSE_STATIC_DEPS=FALSE \
	-DBOOTSTRAP_WXWIDGETS=FALSE \
	-DDISABLE_TLS_SUPPORT=FALSE \
	-DUSE_STATIC_LIBRESSL=FALSE \
	-DUNITTEST=OFF \
	-DBUILD_BACKEND_UNITTESTS=OFF \
	-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build

install -d "$PKG/usr/lib"
cp -a build/_deps/freedv_backend-build/rade_build/src/librade.so* "$PKG/usr/lib/"

cat > "$PKG/usr/share/applications/freedv.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=FreeDV
GenericName=HF Digital Voice
Comment=Digital voice for HF amateur radio over a sound card: RADE, 700D, 700E and 1600
Exec=freedv
Icon=freedv
Terminal=false
StartupWMClass=freedv
Categories=Network;HamRadio;AudioVideo;Audio;
Keywords=ham;radio;digital;voice;hf;codec2;rade;freedv;
DESKTOP
chmod 644 "$PKG/usr/share/applications/freedv.desktop"

test -x "$PKG/usr/bin/freedv"
test -e "$PKG/usr/lib/librade.so.0.1"
test -e "$PKG/usr/share/icons/hicolor/48x48/apps/freedv.png"

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/freedv-gui, 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 freedv-gui-2.4.0-2.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/freedv-gui, and runs the triggers its paths call for.

Contents

Installed programs: freedv.

Installed libraries: librade.so.

Installed directories: /usr/share/freedv-gui, /usr/share/licenses/freedv-gui.

Notes

Nothing is fetched at build time. Every tree upstream would download is a later source, and the two model weight archives (opus_data-*, rnnoise_data-*) unpack into $SRC_ROOT, from where build.sh copies dnn/ into the Opus tree and src/rnnoise_data* into the RNNoise tree before the configure. Each commit and weight hash is a helper in the recipe.

The generator is CMake’s default, Unix Makefiles, never Ninja: the Opus and RNNoise ExternalProjects build with a literal $(MAKE), which Ninja cannot run.

RADE is a shared library that the backend builds and upstream installs only in its macOS bundle. freedv links it by soname, so build.sh copies librade.so* from the build tree into /usr/lib, and the test lines at the end fail the build if it, the program or the icon is missing.

The desktop entry replaces upstream’s to carry StartupWMClass=freedv: wxGTK names the GTK program after the command, so that is the Wayland app id.