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

218.3. surfer-0.7.0

Waveform viewer for VCD, FST and GHW simulation traces, drawn with egui

Version 0.7.0, release 1
Shelf eda — Electronics: schematic and PCB, circuit simulation, antenna modelling, FPGA synthesis and simulation, logic analysers and bench instruments
Phase 42_graphics (Graphics Stack), 88 of 189 in build order
Licence EUPL-1.2
Homepage https://surfer-project.org
Build time 32.0 SBU
Installed size 41.3 MiB in 5 files
Recipe ports/core/eda/surfer/kpkgbuild

About

Surfer is a waveform viewer for the traces digital simulations write, VCD, FST and GHW, drawn with egui. The port builds two programs from the Cargo workspace: surfer, the viewer, and surver, the waveform server a remote machine runs so that surfer <url> can browse a trace that stays where it was simulated. The window is eframe on OpenGL through glow, built with its Wayland and X11 backends.

Sources

Dependencies

Depends on: rust, cmake, pkgconf, libxkbcommon, wayland, mesa, libglvnd, zstd.

Required by: no port names it.

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/42_graphics/phase.env && kpkg install surfer'

What kpkg does

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

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/eda/surfer
echo '32652e576113fa98fd714aadd91455991aa61a036cb94604264faa74719b119d  surfer-0.7.0.tar.gz' | sha256sum -c -
echo 'e43e3ae7a6d24ac51aaa4203b932762d4a37e75e7e65ffe02825e80b0ad6e9d0  surfer-f128-e60de39.tar.gz' | sha256sum -c -
echo '4667363a946eb903c509bbc407de56e731c9d8bcc24935a32de2cd3a53b6bc17  surfer-instruction-decoder-02bdcbf.tar.gz' | sha256sum -c -
echo 'ad908f696d9bcedf95717d016944f0629c17ebaecaf9bb054a63acef627e51dd  surfer-vendor-0.7.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/surfer
SRC=$SRC_ROOT/surfer-0.7.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf surfer-0.7.0.tar.gz -C "$SRC" --strip-components=1
tar --no-same-permissions --warning=no-unknown-keyword -xf surfer-f128-e60de39.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf surfer-instruction-decoder-02bdcbf.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 _f128, _idecoder and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

cp -a "$SRC_ROOT/f128-$_f128/." f128/
cp -a "$SRC_ROOT/instruction-decoder-$_idecoder/." instruction-decoder/

tar xf $PORT_SRC/${name}-vendor-${version}.tar.xz
export CARGO_HOME="$SRC_ROOT/.cargo"
export RUSTFLAGS="-C target-feature=-crt-static"
export LIBCLANG_PATH=/usr/lib
export CARGO_NET_OFFLINE=true
cargo build --release --frozen --offline -p surfer -p surver
readelf -d target/release/surfer | grep -q 'NEEDED.*\[libzstd\.so\.1\]'
install -Dm755 target/release/surfer "$PKG/usr/bin/surfer"
install -Dm755 target/release/surver "$PKG/usr/bin/surver"

install -Dm644 surfer/assets/com.gitlab.surferproject.surfer.png \
	"$PKG/usr/share/icons/hicolor/256x256/apps/surfer.png"

install -d "$PKG/usr/share/applications"
cat > "$PKG/usr/share/applications/org.surfer-project.surfer.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=Surfer
GenericName=Waveform Viewer
Comment=View VCD, FST and GHW waveforms from digital simulations
TryExec=surfer
Exec=surfer %f
Icon=surfer
Terminal=false
StartupWMClass=org.surfer-project.surfer
Categories=Development;Electronics;Engineering;
Keywords=waveform;vcd;fst;ghw;simulation;verilog;vhdl;fpga;gtkwave;
DESKTOP
chmod 644 "$PKG/usr/share/applications/org.surfer-project.surfer.desktop"

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

Contents

Installed programs: surfer, surver.

Installed directories: /usr/share/licenses/surfer.

Notes