2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, udev, libusb1
|
2017-03-13 18:23:41 +00:00
|
|
|
, darwin }:
|
2014-10-24 23:35:01 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-28 08:58:18 +00:00
|
|
|
pname = "hidapi";
|
2020-11-26 07:02:19 +00:00
|
|
|
version = "0.10.1";
|
2014-10-24 23:35:01 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2019-08-28 08:58:18 +00:00
|
|
|
owner = "libusb";
|
2014-10-24 23:35:01 +00:00
|
|
|
repo = "hidapi";
|
2019-08-28 08:58:18 +00:00
|
|
|
rev = "${pname}-${version}";
|
2020-11-26 07:02:19 +00:00
|
|
|
sha256 = "1nr4z4b10vpbh3ss525r7spz4i43zim2ba5qzfl15dgdxshxxivb";
|
2014-10-24 23:35:01 +00:00
|
|
|
};
|
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkg-config ];
|
2019-08-28 08:58:18 +00:00
|
|
|
|
2017-09-05 21:26:13 +00:00
|
|
|
buildInputs = [ ]
|
2021-01-21 17:00:13 +00:00
|
|
|
++ lib.optionals stdenv.isLinux [ libusb1 udev ];
|
2019-08-28 08:58:18 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2017-03-13 18:23:41 +00:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
propagatedBuildInputs = lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ IOKit Cocoa ]);
|
2014-10-24 23:35:01 +00:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2014-12-07 15:14:07 +00:00
|
|
|
description = "Library for communicating with USB and Bluetooth HID devices";
|
2019-08-28 08:58:18 +00:00
|
|
|
homepage = "https://github.com/libusb/hidapi";
|
2020-10-28 13:53:44 +00:00
|
|
|
maintainers = with maintainers; [ prusnak ];
|
2014-12-07 15:15:52 +00:00
|
|
|
# Actually, you can chose between GPLv3, BSD or HIDAPI license (more liberal)
|
2014-10-24 23:35:01 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|