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

40 lines
931 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";
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
};
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;
};
}