Subject: [bug#71076] [PATCH 57/81] gnu: Add rust-reqwest-0.12.

From: Herman Rimm <[email-masked]>
Date: Mon, 20 May 2024 10:59:02 +0200

* gnu/packages/crates-web.scm (rust-reqwest-0.12): Add variable.
(rust-reqwest-0.11): Inherit from rust-reqwest-0.12.

Change-Id: Ib43e1c0f0cb51d956289c50e968119a5a343abea
---
 gnu/packages/crates-web.scm | 108 ++++++++++++++++++++++++++++++++----
 1 file changed, 98 insertions(+), 10 deletions(-)

diff --git a/gnu/packages/crates-web.scm b/gnu/packages/crates-web.scm
index 88d73d8b73..771aae94b5 100644
--- a/gnu/packages/crates-web.scm
+++ b/gnu/packages/crates-web.scm
@@ -4812,8 +4812,105 @@ (define-public rust-poem-derive-1
     (description "This package provides macros for poem.")
     (license (list license:expat license:asl2.0))))
 
+(define-public rust-reqwest-0.12
+  (package
+    (name "rust-reqwest")
+    (version "0.12.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "reqwest" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "047aa0qnngnlnf9i0abrs6pgmz15vk81p5pvscwhk3l6jbfsyv2n"))
+       (modules '((guix build utils)))
+       (snippet '(begin
+                   (substitute* "Cargo.toml.orig"
+                     (("hyper-rustls = \\{ version = \"0.26.0\"")
+                      "hyper-rustls = { version = \"0.27.1\""))
+                   (copy-file "Cargo.toml.orig" "Cargo.toml")))))
+    (build-system cargo-build-system)
+    (arguments
+     (list
+      #:cargo-test-flags `(list "release" "--"
+                                ;; Tests require network access.
+                                "--skip=test_badssl_modern"
+                                "--skip=test_badssl_self_signed")
+      #:cargo-inputs (list rust-async-compression-0.4
+                           rust-base64-0.22
+                           rust-bytes-1
+                           rust-cookie-0.17
+                           rust-cookie-store-0.20
+                           rust-encoding-rs-0.8
+                           rust-futures-channel-0.3
+                           rust-futures-core-0.3
+                           rust-futures-util-0.3
+                           rust-h2-0.4
+                           rust-h3-0.0.4
+                           rust-h3-quinn-0.0.5
+                           rust-hickory-resolver-0.24
+                           rust-http-1
+                           rust-http-body-1
+                           rust-http-body-util-0.1
+                           rust-hyper-1
+                           rust-hyper-rustls-0.27 ; actually 0.26
+                           rust-hyper-tls-0.6
+                           rust-hyper-util-0.1
+                           rust-ipnet-2
+                           rust-js-sys-0.3
+                           rust-log-0.4
+                           rust-mime-0.3
+                           rust-mime-guess-2
+                           rust-native-tls-0.2
+                           rust-once-cell-1
+                           rust-percent-encoding-2
+                           rust-pin-project-lite-0.2
+                           rust-quinn-0.10
+                           rust-rustls-0.22
+                           rust-rustls-native-certs-0.7
+                           rust-rustls-pemfile-2
+                           rust-rustls-pki-types-1
+                           rust-serde-1
+                           rust-serde-json-1
+                           rust-serde-urlencoded-0.7
+                           rust-sync-wrapper-0.1
+                           rust-system-configuration-0.5
+                           rust-tokio-1
+                           rust-tokio-native-tls-0.3
+                           rust-tokio-rustls-0.25
+                           rust-tokio-socks-0.5
+                           rust-tokio-util-0.7
+                           rust-tower-service-0.3
+                           rust-url-2
+                           rust-wasm-bindgen-0.2
+                           rust-wasm-bindgen-futures-0.4
+                           rust-wasm-streams-0.4
+                           rust-web-sys-0.3
+                           rust-webpki-roots-0.26
+                           rust-winreg-0.52)
+      #:cargo-development-inputs (list rust-brotli-3
+                                       rust-doc-comment-0.3
+                                       rust-env-logger-0.10
+                                       rust-futures-util-0.3
+                                       rust-hyper-1
+                                       rust-hyper-util-0.1
+                                       rust-libflate-1
+                                       rust-serde-1
+                                       rust-tokio-1
+                                       rust-wasm-bindgen-0.2
+                                       rust-wasm-bindgen-test-0.3
+                                       rust-zstd-0.13)))
+    (inputs (list openssl (list zstd "lib")))
+    (native-inputs (list pkg-config))
+    (home-page "https://github.com/seanmonstar/reqwest")
+    (synopsis "Higher level HTTP client library")
+    (description
+      "This package provides a higher level HTTP client library.")
+    (license (list license:expat license:asl2.0))))
+
 (define-public rust-reqwest-0.11
   (package
+    (inherit rust-reqwest-0.12)
     (name "rust-reqwest")
     (version "0.11.23")
     (source
@@ -4823,7 +4920,6 @@ (define-public rust-reqwest-0.11
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
         (base32 "0hgvzb7r46656r9vqhl5qk1kbr2xzjb91yr2cb321160ka6sxc9p"))))
-    (build-system cargo-build-system)
     (arguments
      `(#:cargo-test-flags
        '("--release" "--"
@@ -4892,15 +4988,7 @@ (define-public rust-reqwest-0.11
         ("rust-serde" ,rust-serde-1)
         ("rust-tokio" ,rust-tokio-1)
         ("rust-wasm-bindgen" ,rust-wasm-bindgen-0.2)
-        ("rust-wasm-bindgen-test" ,rust-wasm-bindgen-test-0.3))))
-    (inputs
-     (list openssl))
-    (native-inputs
-     (list pkg-config))
-    (home-page "https://github.com/seanmonstar/reqwest")
-    (synopsis "High level HTTP client library")
-    (description "This package provides a high level HTTP client library.")
-    (license (list license:expat license:asl2.0))))
+        ("rust-wasm-bindgen-test" ,rust-wasm-bindgen-test-0.3))))))
 
 (define-public rust-reqwest-0.10
   (package
-- 
2.41.0