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
surfer-0.7.0.tar.gz(11.4 MiB)
sha25632652e576113fa98fd714aadd91455991aa61a036cb94604264faa74719b119d
upstream: https://gitlab.com/surfer-project/surfer/-/archive/v0.7.0/surfer-v0.7.0.tar.gz
archive copy: sources-2/eda--surfer-0.7.0.tar.gzsurfer-f128-e60de39.tar.gz(13.1 KiB)
sha256e43e3ae7a6d24ac51aaa4203b932762d4a37e75e7e65ffe02825e80b0ad6e9d0
upstream: https://github.com/jkarns275/f128/archive/e60de395f0d6454c1dc546b87f06a6358425b6b6.tar.gz
archive copy: sources-2/eda--surfer-f128-e60de39.tar.gzsurfer-instruction-decoder-02bdcbf.tar.gz(1.1 MiB)
sha2564667363a946eb903c509bbc407de56e731c9d8bcc24935a32de2cd3a53b6bc17
upstream: https://github.com/ics-jku/instruction-decoder/archive/02bdcbfd5663a72e4a0b1b9d54519412d417fab1.tar.gz
archive copy: sources-2/eda--surfer-instruction-decoder-02bdcbf.tar.gzsurfer-vendor-0.7.0.tar.xz(54.4 MiB)
sha256ad908f696d9bcedf95717d016944f0629c17ebaecaf9bb054a63acef627e51dd
a vendor bundle: the dependencies upstream’s own tool would download, packed once
archive copy: sources-2/eda--surfer-vendor-0.7.0.tar.xz
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
- Two submodules are sources of their own. The release archive carries the
f128andinstruction-decodersubmodules empty, and both are path dependencies of the workspace, so cargo cannot resolve it without them. The recipe pins each to a commit (_f128,_idecoder), andbuild.shcopies their trees into the empty directories before anything else. - The vendor bundle is made by hand.
ports/fetchvendors from the first source alone, where those path dependencies are missing andcargo vendorfails, so the bundle iscargo vendorrun by the fetch container’s cargo over the tag tree with both submodules unpacked in place, packed the wayports/fetchpacks one; itssha256 =line is its identity. How to rebuild it is in A bundle no tool writes. The build itself is the canonical Rust shape, with-p surfer -p surverselecting the two binaries. - zstd is the system’s. The tree’s build environment sets
ZSTD_SYS_USE_PKG_CONFIG=1in every phase from40_langon, sozstd-syslinks zstd instead of compiling its own copy. Thereadelfline aftercargo buildmakes that a condition of the build:surfermust namelibzstd.so.1among the shared libraries it needs. - The menu entry is KDOS’s own. Surfer sets its window’s app_id to
org.surfer-project.surferinmain.rs, which the entry names asStartupWMClassand is named after,org.surfer-project.surfer.desktop: KWin finds a Wayland window’s icon only in the entry whose file name is the window’s app id. Upstream’s entry claimsapplication/vnd.gtkwave-vcd,-fstand-ghw, GTKWave’s own MIME types, which no MIME database here defines, so KDOS’s entry claims none. The icon is upstream’s PNG.