13 stdenv.mkDerivation (finalAttrs: {
17 src = fetchFromGitHub {
20 rev = "${finalAttrs.pname}-${finalAttrs.version}";
21 sha256 = "sha256-p3uzBq5VxxQbVuy1lEHEEQdxXwnhQgJDIyAAWjVWNIg=";
24 nativeBuildInputs = [ cmake pkg-config ];
26 buildInputs = lib.optionals stdenv.isLinux [ libusb1 udev ];
28 enableParallelBuilding = true;
30 propagatedBuildInputs = lib.optionals stdenv.isDarwin [ Cocoa IOKit ];
32 passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
35 description = "Library for communicating with USB and Bluetooth HID devices";
36 homepage = "https://github.com/libusb/hidapi";
37 maintainers = with maintainers; [ prusnak ];
38 # You can choose between GPLv3, BSD or HIDAPI license (even more liberal)
39 license = with licenses; [ bsd3 /* or */ gpl3Only ] ;
40 pkgConfigModules = lib.optionals stdenv.isDarwin [
42 ] ++ lib.optionals stdenv.isLinux [
46 platforms = platforms.unix;