Subject: [PATCH v2 3/3] gnu: Add rust-hidapi-2.

From: Giacomo Leidi <[email-masked]>
Date: Mon, 21 Oct 2024 00:56:43 +0200

* gnu/packages/crates-io.scm (rust-hidapi-2): New variable.

Change-Id: I3a8bb6e7d6e555fba8df036053b146d414b14198
---
 gnu/packages/crates-io.scm | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 8bbed8a5a8..43f78234ee 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -32260,6 +32260,36 @@ (define-public rust-hexf-parse-0.2
 provided for each type.")
     (license license:cc0)))
 
+(define-public rust-hidapi-2
+  (package
+    (name "rust-hidapi")
+    (version "2.6.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "hidapi" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "0g62241lsd88blvmnwl4mwa556dljazc3g2ymq6zx27y4082an4y"))))
+    (build-system cargo-build-system)
+    (native-inputs
+     (list pkg-config))
+    (inputs
+     (list eudev hidapi))
+    (arguments
+     `(#:cargo-inputs (("rust-cc" ,rust-cc-1)
+                       ("rust-cfg-if" ,rust-cfg-if-1)
+                       ("rust-libc" ,rust-libc-0.2)
+                       ("rust-nix" ,rust-nix-0.27)
+                       ("rust-pkg-config" ,rust-pkg-config-0.3)
+                       ("rust-udev" ,rust-udev-0.8)
+                       ("rust-windows-sys" ,rust-windows-sys-0.48))))
+    (home-page "https://github.com/ruabmbua/hidapi-rs")
+    (synopsis "Rust-y wrapper around @code{hidapi}")
+    (description "This crate provides a Rust abstraction over the features of
+the C library @code{hidapi}.  Based off of @code{hidapi-rs} by Osspial.")
+    (license license:expat)))
+
 (define-public rust-hexf-parse-0.1
   (package
     (inherit rust-hexf-parse-0.2)
-- 
2.46.0