10 stdenv.mkDerivation rec {
11 pname = "libusb-compat";
14 outputs = [ "out" "dev" ]; # get rid of propagating systemd closure
17 nativeBuildInputs = [ autoreconfHook patchelf pkg-config ];
19 buildInputs = [ libusb1 ];
21 src = fetchFromGitHub {
23 repo = "libusb-compat-0.1";
25 sha256 = "1nybccgjs14b3phhaycq2jx1gym4nf6sghvnv9qdfmlqxacx0jz5";
28 patches = lib.optional stdenv.hostPlatform.isMusl ./fix-headers.patch;
30 # without this, libusb-compat is unable to find libusb1
32 find $out/lib -name \*.so\* -type f -exec \
33 patchelf --set-rpath ${lib.makeLibraryPath buildInputs} {} \;
37 homepage = "https://libusb.info/";
38 repositories.git = "https://github.com/libusb/libusb-compat-0.1";
39 description = "cross-platform user-mode USB device library";
41 libusb is a cross-platform user-mode library that provides access to USB devices.
42 The current API is of 1.0 version (libusb-1.0 API), this library is a wrapper exposing the legacy API.
44 license = licenses.lgpl2Plus;
45 platforms = platforms.unix;