164.2. hamlib-4.7.2
Radio and rotator control library
4.7.2-1 · LGPL-2.1-or-later AND GPL-2.0-or-later · 2.3 SBU · 14.5 MiB, 63 files · 41_system, 631 of 1047 · ports/core/hamradio/hamlib
Homepage: https://hamlib.github.io/
Why it is in KDOS. The comment above it in script/phases/41_system/packages.d/hamradio.txt:
One control protocol for 200 radios — the program the CP210x/FTDI udev rules exist for on the radio side, as picocom is on the console side.
Hamlib is the common control library for amateur radio equipment: one API, and one command-line program per kind of device (rigctl for radios, rotctl for antenna rotators, ampctl for amplifiers), over backends for a few hundred models. The radio-control features of wsjtx, fldigi, gpredict, direwolf and the other SDR and digital-mode ports go through it. A radio is usually on a USB serial adapter, which the dialout group and the FTDI, Prolific, CP210x and CH341 rules in /etc/udev/rules.d/70-kdos-serial.rules already give a user access to; hamlib is the program those rules are there for on the radio side.
The C library and its programs are the whole package: every language binding is off.
Depends on: autoconf, automake, libtool, pkgconf, libusb, readline, libxml2.
Required by (11): cubicsdr, direwolf, fldigi, freedv-gui, gpredict, js8call, klog, qsstv, sdrangel, tlf, wsjtx.
Sources: hamlib-4.7.2.tar.gz (3.0 MiB). Every step kpkg takes applies to this port.
Install: script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install hamlib'
build.sh:
export CFLAGS="$CFLAGS -include sys/types.h"
ac_cv_func_select=yes \
./configure \
--prefix=/usr \
--libdir=/usr/lib \
--disable-static \
--without-cxx-binding \
--without-python-binding \
--without-tcl-binding \
--without-perl-binding \
--without-lua-binding \
--with-libusb \
--with-readline \
--with-xml-support \
--without-indi \
--disable-html-matrix \
--disable-pytest
grep -q '^#define HAVE_SELECT 1' include/hamlib/config.h
make
make DESTDIR=$PKG install
-include sys/types.h— Compile every file as though it began with#include <sys/types.h>. The Harris backend’sharris.hdeclares a function taking amode_tand includes no header that defines the type. glibc defines it through another header on the way; musl does not, so without this that backend fails to compile.ac_cv_func_select=yes— Tellconfigurethatselect()exists instead of letting it probe.configurechecks for a function by compiling a program that declares it aschar select ();. With<sys/types.h>forced into every compile, musl’ssys/types.hincludes<sys/select.h>, whose real declaration ofselect()conflicts with that one, so the probe fails to compile andconfigureconcludes there is noselect(). Thegrepfor#define HAVE_SELECT 1ininclude/hamlib/config.hafterconfigurestops the build if the answer is ever not yes.--without-cxx-binding,--without-python-binding,--without-tcl-binding,--without-perl-binding,--without-lua-binding— Build none of hamlib’s language bindings. The C++ one is built by default whenever a C++ compiler is found; the others go through SWIG.--with-libusb— Build the backends for USB-attached devices, linking libusb.--with-xml-support— Buildrigmemwith XML support, through libxml2, so it can save a radio’s memory channels to a file and load them back. It is off by default.--without-indi— Build no INDI rotator backend; the INDI library is not a port. Its default is to detect it.--disable-html-matrix— Do not generate the HTML feature matrix of the supported radios, which needs libgd.--disable-pytest— Changes nothing in this release:configure.achandles the option by setting it tocheckwhatever value is given, soconfigurestill looks forpytest. The result is harmless here, becausepytestonly runs the Python binding’s tests undermake check, the binding is off, andbuild.shruns nomake check.
Programs: ampctl, ampctld, rigctl, rigctlcom, rigctld, rigctlsync, rigctltcp, rigmem, rigsmtr, rigswr, rigtestlibusb, rigtestmcast, rigtestmcastrx, rotctl, rotctld.
Libraries: libhamlib.so.
Directories: /usr/include/hamlib, /usr/share/doc/hamlib, /usr/share/licenses/hamlib.