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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
931 B
Nix
Raw Normal View History

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