2020-11-12 09:05:59 +00:00
|
|
|
{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, udev, libusb1
|
2020-04-24 23:36:52 +00:00
|
|
|
, darwin }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "hidapi";
|
2020-12-07 07:45:13 +00:00
|
|
|
version = "0.10.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "libusb";
|
|
|
|
repo = "hidapi";
|
|
|
|
rev = "${pname}-${version}";
|
2020-12-07 07:45:13 +00:00
|
|
|
sha256 = "1nr4z4b10vpbh3ss525r7spz4i43zim2ba5qzfl15dgdxshxxivb";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoreconfHook pkgconfig ];
|
|
|
|
|
|
|
|
buildInputs = [ ]
|
2020-11-12 09:05:59 +00:00
|
|
|
++ stdenv.lib.optionals stdenv.isLinux [ libusb1 udev ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
propagatedBuildInputs = stdenv.lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ IOKit Cocoa ]);
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Library for communicating with USB and Bluetooth HID devices";
|
|
|
|
homepage = "https://github.com/libusb/hidapi";
|
2020-11-12 09:05:59 +00:00
|
|
|
maintainers = with maintainers; [ prusnak ];
|
2020-04-24 23:36:52 +00:00
|
|
|
# Actually, you can chose between GPLv3, BSD or HIDAPI license (more liberal)
|
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|