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

95.1. libusb-1.0.30

User-space USB device access library

Version 1.0.30, release 1
Shelf hardware — Device access, bus and sensor tools, power management, and Bluetooth
Phase 41_system (System), 35 of 1047 in build order
Licence LGPL-2.1-or-later
Homepage https://libusb.info/
Build time 0.7 SBU
Installed size 503.8 KiB in 7 files
Recipe ports/core/hardware/libusb/kpkgbuild

About

libusb is the user-space USB library: a program uses it to find a USB device and talk to it directly, with control, bulk, interrupt and isochronous transfers, without a kernel driver of its own. On KDOS it is what the software-defined-radio receivers (airspy and the rest), the device flashers and debuggers, android-tools, the UPS drivers of nut and many more use to reach their hardware.

It enumerates devices and receives hotplug events through libudev, which on KDOS is eudev’s. Upstream’s configure makes udev the default on Linux and stops when libudev is missing, so eudev is a dependency.

Sources

Dependencies

Depends on: eudev.

Required by (70): airspy, airspyhf, android-tools, ardour, avrdude, bladerf, calibre, ccid, chromium, cups, dfu-util, flashrom, freerdp, fwupd, gnupg, gpsd, gr-funcube, gutenprint, gvfs, hackrf, hamlib, hplip, ipp-usb, keepassxc, kinfocenter, libfobos, libfprint, libftdi, libgphoto2, libgpod, libgusb, libiio, libjaylink, libmirisdr, libmtp, libperseus-sdr, libsidplayfp, libsigrok, libusb-compat, limesuite, limesuite-gui, linuxcnc, lirc, nut, opencpn, openfpgaloader, openocd, picotool, pipewire, ptouch-print, python3-pyusb, qemu, retroarch, rtl-433, rtl-sdr, sane-backends, satdump, sdl3, sdrangel, spice-gtk, stlink, stlink-gui, tpm2-tss, uhd, usbmuxd, usbredir, usbutils, vice, wine, wsjtx.

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

What kpkg does

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

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/hardware/libusb
echo 'fea36f34f9156400209595e300840767ab1a385ede1dc7ee893015aea9c6dbaf  libusb-1.0.30.tar.bz2' | 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/libusb
SRC=$SRC_ROOT/libusb-1.0.30
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf libusb-1.0.30.tar.bz2 -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:

./configure --prefix=/usr
make -j1
make DESTDIR=$PKG install

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

Contents

Installed libraries: libusb-1.0.a, libusb-1.0.so.

Installed directories: /usr/include/libusb-1.0, /usr/share/licenses/libusb.

Short descriptions

libusb-1.0.pc C API for USB device access from Linux, Mac OS X, Windows, OpenBSD/NetBSD and Solaris userspace