about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/hidapi/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/hidapi/default.nix')
-rw-r--r--nixpkgs/pkgs/development/libraries/hidapi/default.nix19
1 files changed, 14 insertions, 5 deletions
diff --git a/nixpkgs/pkgs/development/libraries/hidapi/default.nix b/nixpkgs/pkgs/development/libraries/hidapi/default.nix
index b29b64c2a757..dfba7f4e1171 100644
--- a/nixpkgs/pkgs/development/libraries/hidapi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/hidapi/default.nix
@@ -7,17 +7,18 @@
 , udev
 , Cocoa
 , IOKit
+, testers
 }:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
   pname = "hidapi";
-  version = "0.12.0";
+  version = "0.14.0";
 
   src = fetchFromGitHub {
     owner = "libusb";
     repo = "hidapi";
-    rev = "${pname}-${version}";
-    sha256 = "sha256-SMhlcB7LcViC6UFVYACjunxsGkvSOKC3mbLBH4XQSzM=";
+    rev = "${finalAttrs.pname}-${finalAttrs.version}";
+    sha256 = "sha256-p3uzBq5VxxQbVuy1lEHEEQdxXwnhQgJDIyAAWjVWNIg=";
   };
 
   nativeBuildInputs = [ cmake pkg-config ];
@@ -28,12 +29,20 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = lib.optionals stdenv.isDarwin [ Cocoa IOKit ];
 
+  passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
+
   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 ] ;
+    pkgConfigModules = lib.optionals stdenv.isDarwin [
+      "hidapi"
+    ] ++ lib.optionals stdenv.isLinux [
+      "hidapi-hidraw"
+      "hidapi-libusb"
+    ];
     platforms = platforms.unix;
   };
-}
+})