Subject: [bug#70705] [PATCH v2 2/3] gnu: rust-udev: Update to 0.8.

From: Giacomo Leidi <[email-masked]>
Date: Wed, 4 Sep 2024 22:59:47 +0200

* gnu/packages/crates-io.scm (rust-udev-0.7): Rename to rust-udev-0.8;
[native-inputs]: add pkg-config;
[inputs]: add eudev;
[arguments]<tests?>: disable tests as they are supposed to run on a real
machine and not in the Guix build sandbox;
<cargo-inputs>: add rust-io-lifetimes and rust-libc;
[description]: expand description to match Guix project standards;
[synopsis]: ditto.

Change-Id: I77687eadda6348d589970aef8e45a986b8651166
---
 gnu/packages/crates-io.scm | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index d04e4a11c4..37b50d3b69 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -85865,28 +85865,38 @@ (define-public rust-ucd-util-0.1
     (license (list license:asl2.0
                    license:expat))))
 
-(define-public rust-udev-0.7
+(define-public rust-udev-0.8
   (package
     (name "rust-udev")
-    (version "0.7.0")
+    (version "0.8.0")
     (source
      (origin
        (method url-fetch)
        (uri (crate-uri "udev" version))
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
-        (base32 "06hr927z0fdn7ay0p817b9x19i5fagmpmvz95yhl4d1pf3bbpgaf"))))
+        (base32 "18f5vkhjcljw1p5gfvy61p1837n27d7h2l3x45pywa5y49p1q1ah"))))
     (build-system cargo-build-system)
+    (native-inputs
+     (list pkg-config))
+    (inputs
+     (list eudev))
     (arguments
-     `(#:cargo-inputs (("rust-libc" ,rust-libc-0.2)
+     `(#:tests? #f ;tests are supposed to be run on real hardware
+       #:cargo-inputs (("rust-io-lifetimes" ,rust-io-lifetimes-1)
+                       ("rust-libc" ,rust-libc-0.2)
                        ("rust-libudev-sys" ,rust-libudev-sys-0.1)
                        ("rust-mio" ,rust-mio-0.6)
                        ("rust-mio" ,rust-mio-0.7)
                        ("rust-mio" ,rust-mio-0.8)
                        ("rust-pkg-config" ,rust-pkg-config-0.3))))
     (home-page "https://github.com/Smithay/udev-rs")
-    (synopsis "libudev bindings for Rust")
-    (description "This package provides libudev bindings for Rust.")
+    (synopsis "Safe @code{libudev} bindings for Rust")
+    (description "This crate provides a safe wrapper around the native
+@code{libudev} library.  It applies the RAII pattern and Rust lifetimes to
+ensure safe usage of all @code{libudev} functionality.  The RAII pattern ensures
+that all acquired resources are released when they're no longer needed, and Rust
+lifetimes ensure that resources are released in a proper order.")
     (license license:expat)))
 
 (define-public rust-ufmt-0.2
-- 
2.45.2