about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/hidapi
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/hidapi')
-rw-r--r--nixpkgs/pkgs/development/libraries/hidapi/default.nix39
1 files changed, 39 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/hidapi/default.nix b/nixpkgs/pkgs/development/libraries/hidapi/default.nix
new file mode 100644
index 000000000000..b29b64c2a757
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/hidapi/default.nix
@@ -0,0 +1,39 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, pkg-config
+, libusb1
+, udev
+, Cocoa
+, IOKit
+}:
+
+stdenv.mkDerivation rec {
+  pname = "hidapi";
+  version = "0.12.0";
+
+  src = fetchFromGitHub {
+    owner = "libusb";
+    repo = "hidapi";
+    rev = "${pname}-${version}";
+    sha256 = "sha256-SMhlcB7LcViC6UFVYACjunxsGkvSOKC3mbLBH4XQSzM=";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  buildInputs = lib.optionals stdenv.isLinux [ libusb1 udev ];
+
+  enableParallelBuilding = true;
+
+  propagatedBuildInputs = lib.optionals stdenv.isDarwin [ Cocoa IOKit ];
+
+  meta = with lib; {
+    description = "Library for communicating with USB and Bluetooth HID devices";
+    homepage = "https://github.com/libusb/hidapi";
+    maintainers = with maintainers; [ prusnak ];
+    # You can choose between GPLv3, BSD or HIDAPI license (even more liberal)
+    license = with licenses; [ bsd3 /* or */ gpl3Only ] ;
+    platforms = platforms.unix;
+  };
+}