libudev-azul
A dlopen-based drop-in fork of libudev-sys 0.1.4.
The FFI surface is identical to upstream libudev-sys — the same opaque
structs and the same udev_* functions. The only difference is how libudev
is loaded:
- Upstream
libudev-syslink-bindslibudevat build time (itsbuild.rsrunspkg_config::find_library("libudev").unwrap()), which fails when cross-compiling to a host that has nolibudev(e.g.cargo build --target x86_64-unknown-linux-gnufrom macOS). libudev-azulhas nobuild.rsand nolinks = "libudev". Every function loadslibudev.solazily at runtime vialibloadingand dispatches through a function pointer.
Consequences:
- No build-time native dependency, so anything depending on it
(
gilrs-core→gilrs) cross-compiles to any target whether or notlibudevis present on the build host. - If
libudev.sois not loadable at runtime, every function returns a zeroed value (null pointer /0), so the caller (e.g.gilrs) gracefully observes "no udev / no devices" and reports no gamepads — instead of failing to start.
It exists to let the azul GUI framework
cross-compile its gamepad support (gilrs) without a host libudev.
Usage
As a transparent replacement for libudev-sys (so consumers like gilrs build
unmodified), either rename the dependency:
[]
= { = "libudev-azul", = "0.1" }
or redirect it across your whole dependency graph:
[]
= { = "libudev-azul", = "0.1" }
Credit
This is a fork of libudev-sys by David Cuddeback
(https://github.com/dcuddeback/libudev-sys), used and distributed under its
original MIT license. All of the FFI bindings are his work; this fork only
swaps build-time linking for runtime dlopen. Thank you.
License
MIT — see LICENSE. Original copyright © 2015 David Cuddeback; fork modifications © 2026 Felix Schütt.