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

58 lines
1.5 KiB
Nix
Raw Normal View History

{ lib, stdenv
, fetchFromGitHub
, fetchpatch
, autoreconfHook
, pkg-config
, enableUdev ? stdenv.isLinux && !stdenv.hostPlatform.isMusl
, udev
, libobjc
, IOKit
, withStatic ? false
}:
stdenv.mkDerivation rec {
2019-08-29 00:01:16 +01:00
pname = "libusb";
2020-12-12 12:04:49 +00:00
version = "1.0.24";
src = fetchFromGitHub {
owner = "libusb";
repo = "libusb";
rev = "v${version}";
2020-12-12 12:04:49 +00:00
sha256 = "18ri8ky422hw64zry7bpbarb1m0hiljyf64a0a9y093y7aad38i7";
};
2020-05-07 22:25:10 +01:00
outputs = [ "out" "dev" ];
patches = [ (fetchpatch {
# https://bugs.archlinux.org/task/69121
url = "https://github.com/libusb/libusb/commit/f6d2cb561402c3b6d3627c0eb89e009b503d9067.patch";
sha256 = "1dbahikcbwkjhyvks7wbp7fy2bf7nca48vg5z0zqvqzjb9y595cq";
excludes = [ "libusb/version_nano.h" ];
}) ];
nativeBuildInputs = [ pkg-config autoreconfHook ];
2015-06-19 20:56:12 +01:00
propagatedBuildInputs =
lib.optional enableUdev udev ++
lib.optionals stdenv.isDarwin [ libobjc IOKit ];
2013-02-12 22:26:26 +00: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 14:07:05 +01:00
'';
meta = with lib; {
2018-10-11 13:30:10 +01: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 12:03:36 +00:00
maintainers = with maintainers; [ prusnak ];
};
}