Subject: [bug#75206] [PATCH rust-team 09/10] gnu: rust-rustls-ffi-0.8: Use snippet.

From: Herman Rimm <[email-masked]>
Date: Mon, 30 Dec 2024 18:57:44 +0100

* gnu/packages/crates-tls.scm (rust-rustls-ffi-0.8): Add snippet.
[arguments]: Remove adjust-cbindgen-requirement phase.

Change-Id: Ia7434a8a6e46425e331c19a510846c78074fd46a
---
 gnu/packages/crates-tls.scm | 28 +++++++++++++---------------
 1 file changed, 13 insertions(+), 15 deletions(-)

diff --git a/gnu/packages/crates-tls.scm b/gnu/packages/crates-tls.scm
index 36737998a9c..f66445487f8 100644
--- a/gnu/packages/crates-tls.scm
+++ b/gnu/packages/crates-tls.scm
@@ -1675,12 +1675,18 @@ (define-public rust-rustls-ffi-0.8
     (inherit rust-rustls-ffi-0.14)
     (name "rust-rustls-ffi")
     (version "0.8.2")
-    (source (origin
-              (method url-fetch)
-              (uri (crate-uri "rustls-ffi" version))
-              (file-name (string-append name "-" version ".tar.gz"))
-              (sha256
-               (base32 "06kqrvm1d5ps9pml26zdd2hm8hh20j6svwvqibpnx7m5rh3jg9cx"))))
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "rustls-ffi" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "06kqrvm1d5ps9pml26zdd2hm8hh20j6svwvqibpnx7m5rh3jg9cx"))
+       (modules '((guix build utils)))
+       ;; The Cargo.toml in the git repository doesn't specify a version
+       ;; requirement for cbindgen.
+       (snippet #~(substitute* "Cargo.toml"
+                    (("0\\.19\\.0") "*")))))
     (arguments
      `(#:cargo-inputs
        (("rust-libc" ,rust-libc-0.2)
@@ -1691,15 +1697,7 @@ (define-public rust-rustls-ffi-0.8
         ("rust-sct" ,rust-sct-0.7)
         ("rust-webpki" ,rust-webpki-0.22))
         #:cargo-development-inputs
-        (("rust-cbindgen" ,rust-cbindgen-0.26))
-        #:phases
-        (modify-phases %standard-phases
-          (add-after 'unpack 'adjust-cbindgen-requirement
-            ;; The Cargo.toml in the git repository doesn't specify
-            ;; a version requirement for cbindgen.
-            (lambda _
-              (substitute* "Cargo.toml"
-                (("0\\.19\\.0") "*")))))))))
+        (("rust-cbindgen" ,rust-cbindgen-0.26))))))
 
 (define-public rust-rustls-native-certs-0.8
   (package
-- 
2.45.2