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

302.1. baresip-4.11.0

SIP softphone for voice calls

Version 4.11.0, release 4
Shelf chat — Instant messaging, IRC, XMPP, Matrix, fediverse and voice clients, with their protocol and E2E libraries
Phase 44_apps (Applications), 28 of 422 in build order
Licence BSD-3-Clause
Homepage https://github.com/baresip/baresip
Build time 0.4 SBU
Installed size 2.6 MiB in 90 files
Recipe ports/core/chat/baresip/kpkgbuild

About

baresip is a SIP softphone: it registers with a SIP account and makes and takes voice and video calls, with its features in loadable modules (codecs, audio and video devices, NAT traversal, media encryption, user interfaces). It runs in a terminal, and its desktop entry, Telephone, opens it in one. It is built on libre, the SIP and media library from the same project.

Why it is in KDOS

The comment above it in script/phases/44_apps/packages.d/chat.txt:

VOICE, which is what people default to under stress: this tree carries text, serves documents and stands up a network with no router, and this is the way for two people on it to talk.

Sources

Dependencies

Depends on: cmake, ninja, pkgconf, libre, openssl, alsa-lib, pipewire, opus, libvpx, ffmpeg, zlib, sdl2-compat, glib, libsndfile, libpng, fdk-aac, v4l-utils.

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

What kpkg does

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

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/chat/baresip
echo 'e170ad5857994dfed0c84c4c04eb904fa410f3ec2d5a6c789b50b3fda47ba98c  baresip-4.11.0.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/baresip
SRC=$SRC_ROOT/baresip-4.11.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf baresip-4.11.0.tar.gz -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/default-modules.patch"

modules=(
	account alsa aubridge auconv aufile augain auresamp ausine
	avcodec avfilter avformat swscale
	cons contact ctrl_dbus ctrl_tcp debug_cmd dtls_srtp echo evdev
	fakevideo g711 aac httpd httpreq ice in_band_dtmf l16 menu
	mixausrc mixminus mwi natpmp netroam opus opus_multistream pcp
	pipewire presence rtcpsummary sdl selfview serreg snapshot sndfile
	srtp stdio stun syslog turn uuid v4l2 vidbridge vidinfo vp8 vp9 vumeter
)

mkdir -p build && cd build
cmake .. -G Ninja \
	-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DCMAKE_INSTALL_LIBDIR=lib \
	-DSTATIC=OFF \
	-DDEFAULT_AUDIO_DEVICE=pipewire,default \
	"-DMODULES=$(IFS=';'; echo "${modules[*]}")"
ninja
DESTDIR=$PKG ninja install

rm -f "$PKG/usr/share/applications/com.github.baresip.desktop"
install -d "$PKG/usr/share/applications"
cat > "$PKG/usr/share/applications/baresip.desktop" <<'EOF'
[Desktop Entry]
Type=Application
Name=Telephone
GenericName=SIP Softphone
Comment=Voice calls over SIP
Exec=baresip
Icon=call-start
Terminal=true
Categories=Network;Telephony;
Keywords=sip;voip;call;phone;telephone;baresip;
EOF
chmod 644 "$PKG/usr/share/applications/baresip.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/baresip, 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 baresip-4.11.0-4.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/baresip, and runs the triggers its paths call for.

Contents

Installed programs: baresip.

Installed libraries: libbaresip.so.

Installed directories: /usr/lib/baresip, /usr/share/baresip, /usr/share/licenses/baresip.

Short descriptions

Notes

A module named in MODULES whose library is missing is still skipped without an error, because each module’s own CMakeLists.txt returns quietly when its find_package fails. So every library a listed module links is in depends, and a module added to the list needs its library added there too.

build.sh deletes upstream’s com.github.baresip.desktop and writes baresip.desktop with Terminal=true: the interface the generated configuration loads is the stdio and menu modules, which read keys from the terminal.