Subject: [rust-team v3 8/9] gnu: Bumps rust-rocket-0.4 to 0.4.11

From: Aaron Covrig <[email-masked]>
Date: Sun, 24 Mar 2024 11:20:00 -0400

* gnu/packages/crates-web.scm (rust-rocket-0.4): Bumps to 0.4.11 and
  enables building
---
 gnu/packages/crates-web.scm | 56 ++++++++++++++++++++++++-------------
 1 file changed, 37 insertions(+), 19 deletions(-)

diff --git a/gnu/packages/crates-web.scm b/gnu/packages/crates-web.scm
index fbdce9e9f6..bf848a9f54 100644
--- a/gnu/packages/crates-web.scm
+++ b/gnu/packages/crates-web.scm
@@ -4634,31 +4634,49 @@ (define-public rust-rocket-0.4
   (package
     (inherit rust-rocket-0.5)
     (name "rust-rocket")
-    (version "0.4.7")
+    (version "0.4.11")
     (source
      (origin
        (method url-fetch)
        (uri (crate-uri "rocket" version))
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
-        (base32 "04ybnhjw92zaan92lsmx6mkhqc9cpsg3885svb3wzyj39pyzvsvz"))))
-    (arguments
-     `(#:skip-build? #t
-       #:cargo-inputs
-       (("rust-atty" ,rust-atty-0.2)
-        ("rust-base64" ,rust-base64-0.12)
-        ("rust-log" ,rust-log-0.4)
-        ("rust-memchr" ,rust-memchr-2)
-        ("rust-num-cpus" ,rust-num-cpus-1)
-        ("rust-pear" ,rust-pear-0.1)
-        ("rust-rocket-codegen" ,rust-rocket-codegen-0.4)
-        ("rust-rocket-http" ,rust-rocket-http-0.4)
-        ("rust-state" ,rust-state-0.4)
-        ("rust-time" ,rust-time-0.1)
-        ("rust-toml" ,rust-toml-0.4)
-        ("rust-version-check" ,rust-version-check-0.9)
-        ("rust-yansi" ,rust-yansi-0.5)
-        ("rust-yansi" ,rust-yansi-0.5))))))
+        (base32 "0pimz9v0737dvz487j0kij7kasjyahaxd7ba2bcc3p6513fdkfc3"))
+       (modules '((guix build utils)))
+       (snippet '(begin
+                   ;; enable nightly/dev in build.rs for RUSTC_BOOTSTRAP build
+                   (substitute* "build.rs"
+                     (("if !channel.supports_features")
+                      "/* if !channel.supports_features")
+                     (("if !version.at_least")
+                      "*/ \nif !version.at_least"))
+                   ;; Add missing development dependency (for tests)
+                   (substitute* "Cargo.toml"
+                     (("\\[features\\]" all)
+                      (string-append "[dev-dependencies.lazy_static]" "\n"
+                                     "version = \"1\"" "\n" all))) #t))))
+    (arguments
+     `(#:cargo-inputs (("rust-atty" ,rust-atty-0.2)
+                       ("rust-base64" ,rust-base64-0.12)
+                       ("rust-log" ,rust-log-0.4)
+                       ("rust-memchr" ,rust-memchr-2)
+                       ("rust-num-cpus" ,rust-num-cpus-1)
+                       ("rust-pear" ,rust-pear-0.1)
+                       ("rust-rocket-codegen" ,rust-rocket-codegen-0.4)
+                       ("rust-rocket-http" ,rust-rocket-http-0.4)
+                       ("rust-state" ,rust-state-0.4)
+                       ("rust-time" ,rust-time-0.1)
+                       ("rust-toml" ,rust-toml-0.4)
+                       ("rust-version-check" ,rust-version-check-0.9)
+                       ("rust-yansi" ,rust-yansi-0.5)
+                       ("rust-yansi" ,rust-yansi-0.5))
+       ;; Adding in missing dev dependency
+       #:cargo-development-inputs (("rust-lazy-static" ,rust-lazy-static-1))
+       #:phases (modify-phases %standard-phases
+                  ;; Enable using nightly/dev features
+                  (add-after 'unpack 'enable-unstable-features
+                    (lambda _
+                      (setenv "RUSTC_BOOTSTRAP" "1"))))))))
 
 (define-public rust-rocket-codegen-0.5
   (package
-- 
2.41.0