summary refs log tree commit diff
path: root/pkgs/development/libraries/hidapi/default.nix
blob: 80085759a76a0fd71a8c7071e1af9a0c684dd026 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, udev, libusb
, darwin }:

stdenv.mkDerivation rec {
  name = "hidapi-0.8.0-rc1";

  src = fetchFromGitHub {
    owner = "signal11";
    repo = "hidapi";
    rev = name;
    sha256 = "13d5jkmh9nh4c2kjch8k8amslnxapa9vkqzrk1z6rqmw8qgvzbkj";
  };

  buildInputs = [ autoreconfHook pkgconfig ]
    ++ stdenv.lib.optionals stdenv.isLinux [ udev libusb ];

  propagatedBuildInputs = stdenv.lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ IOKit Cocoa ]);

  meta = with stdenv.lib; {
    homepage = https://github.com/signal11/hidapi;
    description = "Library for communicating with USB and Bluetooth HID devices";
    # Actually, you can chose between GPLv3, BSD or HIDAPI license (more liberal)
    license = licenses.bsd3;
    platforms = platforms.unix;
    maintainers = with maintainers; [ wkennington ];
  };
}