libudev-azul 0.1.4

dlopen-based drop-in fork of libudev-sys: loads libudev at runtime via libloading, with no build-time native link, so dependents (e.g. gilrs) cross-compile to hosts without libudev. API-identical to libudev-sys 0.1.4.
Documentation
  • Coverage
  • 1.18%
    1 out of 85 items documented0 out of 84 items with examples
  • Size
  • Source code size: 17.9 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 511.9 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 3s Average build duration of successful builds.
  • all releases: 3s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • fschutt/libudev-azul
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • fschutt

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-sys link-binds libudev at build time (its build.rs runs pkg_config::find_library("libudev").unwrap()), which fails when cross-compiling to a host that has no libudev (e.g. cargo build --target x86_64-unknown-linux-gnu from macOS).
  • libudev-azul has no build.rs and no links = "libudev". Every function loads libudev.so lazily at runtime via libloading and 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 not libudev is present on the build host.
  • If libudev.so is 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:

[dependencies]
libudev-sys = { package = "libudev-azul", version = "0.1" }

or redirect it across your whole dependency graph:

[patch.crates-io]
libudev-sys = { package = "libudev-azul", version = "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.