Subject: [bug#69257] [PATCH 061/228] gnu: Add rust-tower-http-0.5.

From: Herman Rimm <[email-masked]>
Date: Sun, 18 Feb 2024 22:02:59 +0100

* gnu/packages/crates-web.scm (rust-tower-http-0.5): Add variable.
(rust-tower-http-0.4): Inherit from rust-tower-http-0.5.

Change-Id: I03d03c7ce34b0fbd38c0bdef08b691a9ee4c8e81
---
 gnu/packages/crates-web.scm | 73 +++++++++++++++++++++++++++++++++----
 1 file changed, 66 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/crates-web.scm b/gnu/packages/crates-web.scm
index 0e4f2c5536..3c7ba43903 100644
--- a/gnu/packages/crates-web.scm
+++ b/gnu/packages/crates-web.scm
@@ -4012,8 +4012,73 @@ (define-public rust-tower-0.4
 robust clients and servers.")
     (license license:expat)))
 
+(define-public rust-tower-http-0.5
+  (package
+    (name "rust-tower-http")
+    (version "0.5.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "tower-http" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "0bmgfh1hr92blw7kv2636ykd0gf3h0aqdd89kvjk6b2fg8kr788d"))
+       (modules '((guix build utils)))
+       (snippet '(begin
+                   ;; Remove disabled doctests with unresolved imports.
+                   (substitute* "src/lib.rs" (("//!.*") ""))
+                   (substitute* "src/classify/status_in_range_is_error.rs"
+                                (("///.*") ""))))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs (("rust-async-compression" ,rust-async-compression-0.4)
+                       ("rust-base64" ,rust-base64-0.21)
+                       ("rust-bitflags" ,rust-bitflags-2)
+                       ("rust-bytes" ,rust-bytes-1)
+                       ("rust-futures-core" ,rust-futures-core-0.3)
+                       ("rust-futures-util" ,rust-futures-util-0.3)
+                       ("rust-http" ,rust-http-1)
+                       ("rust-http-body" ,rust-http-body-1)
+                       ("rust-http-body-util" ,rust-http-body-util-0.1)
+                       ("rust-http-range-header" ,rust-http-range-header-0.4)
+                       ("rust-httpdate" ,rust-httpdate-1)
+                       ("rust-iri-string" ,rust-iri-string-0.7)
+                       ("rust-mime" ,rust-mime-0.3)
+                       ("rust-mime-guess" ,rust-mime-guess-2)
+                       ("rust-percent-encoding" ,rust-percent-encoding-2)
+                       ("rust-pin-project-lite" ,rust-pin-project-lite-0.2)
+                       ("rust-tokio" ,rust-tokio-1)
+                       ("rust-tokio-util" ,rust-tokio-util-0.7)
+                       ("rust-tower" ,rust-tower-0.4)
+                       ("rust-tower-layer" ,rust-tower-layer-0.3)
+                       ("rust-tower-service" ,rust-tower-service-0.3)
+                       ("rust-tracing" ,rust-tracing-0.1)
+                       ("rust-uuid" ,rust-uuid-1))
+       #:cargo-development-inputs
+       (("rust-async-trait" ,rust-async-trait-0.1)
+        ("rust-brotli" ,rust-brotli-3)
+        ("rust-bytes" ,rust-bytes-1)
+        ("rust-flate2" ,rust-flate2-1)
+        ("rust-futures-util" ,rust-futures-util-0.3)
+        ("rust-hyper-util" ,rust-hyper-util-0.1)
+        ("rust-once-cell" ,rust-once-cell-1)
+        ("rust-serde-json" ,rust-serde-json-1)
+        ("rust-sync-wrapper" ,rust-sync-wrapper-0.1)
+        ("rust-tokio" ,rust-tokio-1)
+        ("rust-tower" ,rust-tower-0.4)
+        ("rust-tracing-subscriber" ,rust-tracing-subscriber-0.3)
+        ("rust-uuid" ,rust-uuid-1)
+        ("rust-zstd" ,rust-zstd-0.12))))
+    (home-page "https://github.com/tower-rs/tower-http")
+    (synopsis "Tower middleware and utilities for HTTP clients and servers")
+    (description
+      "This package provides Tower middleware and utilities for HTTP
+clients and servers.")
+    (license license:expat)))
+
 (define-public rust-tower-http-0.4
   (package
+    (inherit rust-tower-http-0.5)
     (name "rust-tower-http")
     (version "0.4.4")
     (source
@@ -4023,7 +4088,6 @@ (define-public rust-tower-http-0.4
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
         (base32 "0h0i2flrw25zwxv72sifq4v5mwcb030spksy7r2a4xl2d4fvpib1"))))
-    (build-system cargo-build-system)
     (arguments
      `(#:cargo-test-flags (list "--release"
                                 ;; Not the doc tests.
@@ -4062,12 +4126,7 @@ (define-public rust-tower-http-0.4
         ("rust-tower" ,rust-tower-0.4)
         ("rust-tracing-subscriber" ,rust-tracing-subscriber-0.3)
         ("rust-uuid" ,rust-uuid-1)
-        ("rust-zstd" ,rust-zstd-0.12))))
-    (home-page "https://github.com/tower-rs/tower-http")
-    (synopsis "Tower middleware and utilities for HTTP clients and servers")
-    (description "This package provides the tower middleware and utilities for
-HTTP clients and servers.")
-    (license license:expat)))
+        ("rust-zstd" ,rust-zstd-0.12))))))
 
 (define-public rust-tower-layer-0.3
   (package
-- 
2.41.0