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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

61 lines
1.5 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, autoreconfHook
, pkg-config
, enableUdev ? stdenv.isLinux && !stdenv.targetPlatform.isStatic
, udev
, libobjc
, IOKit
2022-02-22 17:56:27 +00:00
, Security
, withExamples ? false
, withStatic ? false
}:
stdenv.mkDerivation rec {
2019-08-28 23:01:16 +00:00
pname = "libusb";
2022-06-07 06:58:18 +00:00
version = "1.0.26";
src = fetchFromGitHub {
owner = "libusb";
repo = "libusb";
rev = "v${version}";
2022-06-07 06:58:18 +00:00
sha256 = "sha256-LEy45YiFbueCCi8d2hguujMsxBezaTUERHUpFsTKGZQ=";
};
2020-05-07 21:25:10 +00:00
outputs = [ "out" "dev" ];
nativeBuildInputs = [ pkg-config autoreconfHook ];
2015-06-19 19:56:12 +00:00
propagatedBuildInputs =
lib.optional enableUdev udev ++
2022-02-22 17:56:27 +00:00
lib.optionals stdenv.isDarwin [ libobjc IOKit Security ];
2013-02-12 22:26:26 +00:00
dontDisableStatic = withStatic;
configureFlags =
lib.optional (!enableUdev) "--disable-udev"
++ lib.optional (withExamples) "--enable-examples-build";
preFixup = lib.optionalString enableUdev ''
sed 's,-ludev,-L${lib.getLib udev}/lib -ludev,' -i $out/lib/libusb-1.0.la
2015-06-25 13:07:05 +00:00
'';
postInstall = lib.optionalString withExamples ''
mkdir -p $out/{bin,sbin,examples/bin}
cp -r examples/.libs/* $out/examples/bin
ln -s $out/examples/bin/fxload $out/sbin/fxload
'';
meta = with lib; {
2018-10-11 12:30:10 +00:00
homepage = "https://libusb.info/";
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;
maintainers = with maintainers; [ prusnak realsnick ];
};
}