summary refs log tree commit diff
path: root/pkgs/development/libraries/hidapi
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-02-14 09:53:03 +0000
committerAlyssa Ross <hi@alyssa.is>2023-02-14 09:53:03 +0000
commit200610b849c0aeb174a63e7526b7376aa8a339bf (patch)
treef57988f969df0344ef355473653daf0939a0d402 /pkgs/development/libraries/hidapi
parentfa169bb239d7b2d860af851573569182ee5e0127 (diff)
parent46cc80cc78abdacca55f036a4f0341b96d660255 (diff)
downloadnixpkgs-200610b849c0aeb174a63e7526b7376aa8a339bf.tar
nixpkgs-200610b849c0aeb174a63e7526b7376aa8a339bf.tar.gz
nixpkgs-200610b849c0aeb174a63e7526b7376aa8a339bf.tar.bz2
nixpkgs-200610b849c0aeb174a63e7526b7376aa8a339bf.tar.lz
nixpkgs-200610b849c0aeb174a63e7526b7376aa8a339bf.tar.xz
nixpkgs-200610b849c0aeb174a63e7526b7376aa8a339bf.tar.zst
nixpkgs-200610b849c0aeb174a63e7526b7376aa8a339bf.zip
Merge remote-tracking branch 'origin/staging-next' into staging
Conflicts:
	pkgs/development/libraries/gtest/default.nix
	pkgs/development/libraries/hidapi/default.nix
Diffstat (limited to 'pkgs/development/libraries/hidapi')
-rw-r--r--pkgs/development/libraries/hidapi/default.nix15
1 files changed, 12 insertions, 3 deletions
diff --git a/pkgs/development/libraries/hidapi/default.nix b/pkgs/development/libraries/hidapi/default.nix
index 2a6483d77b2..89cff8ef427 100644
--- a/pkgs/development/libraries/hidapi/default.nix
+++ b/pkgs/development/libraries/hidapi/default.nix
@@ -7,16 +7,17 @@
 , udev
 , Cocoa
 , IOKit
+, testers
 }:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
   pname = "hidapi";
   version = "0.13.1";
 
   src = fetchFromGitHub {
     owner = "libusb";
     repo = "hidapi";
-    rev = "${pname}-${version}";
+    rev = "${finalAttrs.pname}-${finalAttrs.version}";
     sha256 = "sha256-CEZP5n8qEAzsqn8dz3u1nG0YoT7J1P+WfN7urkRTuVg=";
   };
 
@@ -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;
   };
-}
+})