160.6. liblxi-1.22
Discover and talk to an LXI instrument
| Version | 1.22, release 1 |
| Shelf | eda — Electronics: schematic and PCB, circuit simulation, antenna modelling, FPGA synthesis and simulation, logic analysers and bench instruments |
| Phase | 41_system (System), 435 of 1047 in build order |
| Licence | BSD-3-Clause |
| Homepage | https://lxi-tools.github.io/ |
| Build time | 0.1 SBU |
| Installed size | 60.7 KiB in 13 files |
| Recipe | ports/core/eda/liblxi/kpkgbuild |
About
liblxi talks to LXI test instruments (oscilloscopes, power supplies, signal generators) over the VXI-11 RPC protocol and raw TCP, and finds them on the network with mDNS through avahi. lxi-tools is its one consumer: the lxi command and the lxi-gui window.
Why it is in KDOS
The comment above it in script/phases/41_system/packages.d/eda.txt:
VXI-11 is ONC RPC, hence libtirpc.
Sources
liblxi-1.22.tar.gz(67.2 KiB)
sha256d33ca3990513223880ec238eb2e5aa1cc93aff51c470ef0db9df3e0c332493d5
upstream: https://github.com/lxi-tools/liblxi/archive/refs/tags/v1.22.tar.gz
archive copy: sources-2/eda--liblxi-1.22.tar.gz
Dependencies
Depends on: meson, ninja, pkgconf, avahi, libxml2, libtirpc.
Required by (1): lxi-tools.
Patches
build.sh applies these; kpkg applies nothing by itself.
link-tirpc.patch— Link liblxi against libtirpc on every system that uses itThe XDR and CLNT calls resolve in libtirpc; without it in NEEDED the library fails to relocate on a C library that carries no Sun RPC.
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/41_system/phase.env && kpkg install liblxi'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/eda/liblxi.
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/liblxi
echo 'd33ca3990513223880ec238eb2e5aa1cc93aff51c470ef0db9df3e0c332493d5 liblxi-1.22.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/liblxi
SRC=$SRC_ROOT/liblxi-1.22
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf liblxi-1.22.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/link-tirpc.patch"
meson setup build \
--prefix=/usr \
--libdir=lib \
--buildtype=release \
-Db_lundef=true
grep -q -- -DHAVE_AVAHI build/build.ninja || {
echo 'liblxi: avahi-client/client.h not found, mDNS discovery would be missing' >&2
exit 1
}
meson compile -C build
DESTDIR=$PKG meson install --no-rebuild -C build
The switches, and why each is set:
-Db_lundef=true— Link the library with--no-undefined. Upstream’smeson.buildsetsb_lundef=falsein its default options, which lets a library with unresolved symbols link and fail only when a program loads it; with the switch a missing library stops the build.
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/liblxi, 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 liblxi-1.22-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/liblxi, and runs the triggers its paths call for.
Contents
Installed libraries: liblxi.so.
Installed directories: /usr/share/licenses/liblxi.
Short descriptions
liblxi.pc |
A Library for managing LXI compatible test instruments |
Notes
VXI-11 is Sun RPC. musl carries no RPC, so every xdr_* and clnt_* call resolves in libtirpc, and link-tirpc.patch adds it to the library’s dependencies on every system that uses it; upstream adds it only on Cygwin. Without it the xdr_* and clnt_* calls are left unresolved: with -Db_lundef=true the library’s link stops on them, and without that switch liblxi.so.1 links with no libtirpc.so.3 in NEEDED and lxi stops at load with xdr_u_char: symbol not found.
The grep after setup stops the build when configure did not find avahi-client/client.h: src/meson.build then compiles no mDNS backend, and mDNS discovery finds nothing.