6 , enableUdev ? stdenv.isLinux && !stdenv.targetPlatform.isStatic
14 stdenv.mkDerivation rec {
18 src = fetchFromGitHub {
22 sha256 = "sha256-LEy45YiFbueCCi8d2hguujMsxBezaTUERHUpFsTKGZQ=";
25 outputs = [ "out" "dev" ];
27 nativeBuildInputs = [ pkg-config autoreconfHook ];
28 propagatedBuildInputs =
29 lib.optional enableUdev udev ++
30 lib.optionals stdenv.isDarwin [ libobjc IOKit Security ];
32 dontDisableStatic = withStatic;
34 configureFlags = lib.optional (!enableUdev) "--disable-udev";
36 preFixup = lib.optionalString enableUdev ''
37 sed 's,-ludev,-L${lib.getLib udev}/lib -ludev,' -i $out/lib/libusb-1.0.la
41 homepage = "https://libusb.info/";
42 description = "cross-platform user-mode USB device library";
44 libusb is a cross-platform user-mode library that provides access to USB devices.
46 platforms = platforms.all;
47 license = licenses.lgpl21Plus;
48 maintainers = with maintainers; [ prusnak ];