2021-10-17 17:13:58 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, libusb1
|
|
|
|
, udev
|
|
|
|
, Cocoa
|
|
|
|
, IOKit
|
|
|
|
}:
|
2014-10-24 23:35:01 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-28 08:58:18 +00:00
|
|
|
pname = "hidapi";
|
2022-01-11 12:48:37 +00:00
|
|
|
version = "0.11.2";
|
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}";
|
2022-01-11 12:48:37 +00:00
|
|
|
sha256 = "sha256-zSAhnvnDI3+q8VwZ8fIx/YmvwTpL87PBJ2C1mTmD7Ko=";
|
2014-10-24 23:35:01 +00:00
|
|
|
};
|
|
|
|
|
2021-10-17 17:13:58 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2019-08-28 08:58:18 +00:00
|
|
|
|
2021-10-17 17:13:58 +00:00
|
|
|
buildInputs = 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-10-17 17:13:58 +00:00
|
|
|
propagatedBuildInputs = lib.optionals stdenv.isDarwin [ Cocoa IOKit ];
|
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 ];
|
2021-10-17 17:13:58 +00:00
|
|
|
# You can choose between GPLv3, BSD or HIDAPI license (even more liberal)
|
|
|
|
license = with licenses; [ bsd3 /* or */ gpl3Only ] ;
|
2014-10-24 23:35:01 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|