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

40 lines
932 B
Nix
Raw Normal View History

{ 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";
version = "0.11.0";
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}";
sha256 = "0dzigvmwbg20b33xn0sklnf489m8g84yrcm8kqlrsd7x8iymsg63";
2014-10-24 23:35:01 +00:00
};
nativeBuildInputs = [ cmake pkg-config ];
2019-08-28 08:58:18 +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
propagatedBuildInputs = lib.optionals stdenv.isDarwin [ Cocoa IOKit ];
2014-10-24 23:35:01 +00:00
meta = with lib; {
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 ];
# 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;
};
}