nixpkgs-suyu/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-25 01:35:01 +02:00
stdenv.mkDerivation rec {
2019-08-28 10:58:18 +02:00
pname = "hidapi";
version = "0.11.0";
2014-10-25 01:35:01 +02:00
src = fetchFromGitHub {
2019-08-28 10:58:18 +02:00
owner = "libusb";
2014-10-25 01:35:01 +02:00
repo = "hidapi";
2019-08-28 10:58:18 +02:00
rev = "${pname}-${version}";
sha256 = "0dzigvmwbg20b33xn0sklnf489m8g84yrcm8kqlrsd7x8iymsg63";
2014-10-25 01:35:01 +02:00
};
nativeBuildInputs = [ cmake pkg-config ];
2019-08-28 10:58:18 +02:00
buildInputs = lib.optionals stdenv.isLinux [ libusb1 udev ];
2019-08-28 10:58:18 +02:00
enableParallelBuilding = true;
2017-03-13 19:23:41 +01:00
propagatedBuildInputs = lib.optionals stdenv.isDarwin [ Cocoa IOKit ];
2014-10-25 01:35:01 +02:00
meta = with lib; {
description = "Library for communicating with USB and Bluetooth HID devices";
2019-08-28 10:58:18 +02:00
homepage = "https://github.com/libusb/hidapi";
2020-10-28 14:53:44 +01: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-25 01:35:01 +02:00
platforms = platforms.unix;
};
}