nixpkgs-suyu/pkgs/development/libraries/libusb1/default.nix

52 lines
1.3 KiB
Nix
Raw Normal View History

{ lib, stdenv
, fetchFromGitHub
, autoreconfHook
, pkg-config
, enableUdev ? stdenv.isLinux && !stdenv.hostPlatform.isMusl
, udev ? null
, libobjc
, IOKit
, withStatic ? false
}:
assert enableUdev -> udev != null;
stdenv.mkDerivation rec {
2019-08-29 01:01:16 +02:00
pname = "libusb";
2020-12-12 13:04:49 +01:00
version = "1.0.24";
src = fetchFromGitHub {
owner = "libusb";
repo = "libusb";
rev = "v${version}";
2020-12-12 13:04:49 +01:00
sha256 = "18ri8ky422hw64zry7bpbarb1m0hiljyf64a0a9y093y7aad38i7";
};
2020-05-07 23:25:10 +02:00
outputs = [ "out" "dev" ];
nativeBuildInputs = [ pkg-config autoreconfHook ];
2015-06-19 21:56:12 +02:00
propagatedBuildInputs =
lib.optional enableUdev udev ++
lib.optionals stdenv.isDarwin [ libobjc IOKit ];
2013-02-12 23:26:26 +01:00
dontDisableStatic = withStatic;
configureFlags = lib.optional (!enableUdev) "--disable-udev";
preFixup = lib.optionalString enableUdev ''
sed 's,-ludev,-L${lib.getLib udev}/lib -ludev,' -i $out/lib/libusb-1.0.la
2015-06-25 15:07:05 +02:00
'';
meta = with lib; {
2018-10-11 14:30:10 +02:00
homepage = "https://libusb.info/";
repositories.git = "https://github.com/libusb/libusb";
description = "cross-platform user-mode USB device library";
longDescription = ''
libusb is a cross-platform user-mode library that provides access to USB devices.
'';
platforms = platforms.all;
license = licenses.lgpl21Plus;
2020-12-14 13:03:36 +01:00
maintainers = with maintainers; [ prusnak ];
};
}