9 stdenv.mkDerivation rec {
10 pname = "libusb-compat";
13 outputs = [ "out" "dev" ]; # get rid of propagating systemd closure
16 src = fetchFromGitHub {
18 repo = "libusb-compat-0.1";
20 sha256 = "1nybccgjs14b3phhaycq2jx1gym4nf6sghvnv9qdfmlqxacx0jz5";
23 patches = lib.optional stdenv.hostPlatform.isMusl ./fix-headers.patch;
25 nativeBuildInputs = [ autoreconfHook pkg-config ];
27 buildInputs = [ libusb1 ];
29 # without this, libusb-compat is unable to find libusb1
31 find $out/lib -name \*.so\* -type f -exec \
32 patchelf --set-rpath ${lib.makeLibraryPath buildInputs} {} \;
36 homepage = "https://libusb.info/";
37 description = "cross-platform user-mode USB device library";
39 libusb is a cross-platform user-mode library that provides access to USB devices.
40 The current API is of 1.0 version (libusb-1.0 API), this library is a wrapper exposing the legacy API.
42 license = licenses.lgpl2Plus;
43 platforms = platforms.unix;