Subject: [bug#66563] [PATCH v2 1/1] gnu: Add rust-bzip2-rs

From: Steve George <[email-masked]>
Date: Thu, 9 Nov 2023 11:35:16 +0000

From: Stefan <[email-masked]>

* gnu/packages/crates-io.scm (rust-bzip2-rs-0.1): New variable.
* gnu/packages/crates-io.scm (rust-bytesize-1): Moved bzip2 alphabetically.

Change-Id: I41a7e5a00cb2feec6dcda0360044fb5a91b9e1fe
---
 gnu/packages/crates-io.scm | 84 ++++++++++++++++++++++++++------------
 1 file changed, 59 insertions(+), 25 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index b15c1e5d9ab..606ed5aa297 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -35,6 +35,7 @@
 ;;; Copyright © 2023 Wilko Meyer <[email-masked]>
 ;;; Copyright © 2023 Jaeme Sifat <[email-masked]>
 ;;; Copyright © 2023 Steve George <[email-masked]>
+;;; Copyright © 2023 Stefan <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -10748,6 +10749,31 @@ (define-public rust-bytes-0.3
        #:cargo-development-inputs
        (("rust-rand" ,rust-rand-0.3))))))
 
+(define-public rust-bytesize-1
+  (package
+    (name "rust-bytesize")
+    (version "1.3.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "bytesize" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "1k3aak70iwz4s2gsjbxf0ws4xnixqbdz6p2ha96s06748fpniqx3"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs
+       (("rust-serde" ,rust-serde-1))
+       #:cargo-development-inputs
+       (("rust-serde" ,rust-serde-1)
+        ("rust-serde-json" ,rust-serde-json-1)
+        ("rust-toml" ,rust-toml-0.7))))
+    (home-page "https://github.com/hyunsik/bytesize/")
+    (synopsis "Human-readable byte count representation library for Rust")
+    (description "ByteSize is an utility for human-readable byte count
+representation, with support for both SI and binary units.")
+    (license license:asl2.0)))
+
 (define-public rust-bytestring-0.1
   (package
     (name "rust-bytestring")
@@ -10805,31 +10831,6 @@ (define-public rust-bzip2-0.4
 exposed as Reader/Writer streams.")
     (license (list license:expat license:asl2.0))))
 
-(define-public rust-bytesize-1
-  (package
-    (name "rust-bytesize")
-    (version "1.3.0")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (crate-uri "bytesize" version))
-       (file-name (string-append name "-" version ".tar.gz"))
-       (sha256
-        (base32 "1k3aak70iwz4s2gsjbxf0ws4xnixqbdz6p2ha96s06748fpniqx3"))))
-    (build-system cargo-build-system)
-    (arguments
-     `(#:cargo-inputs
-       (("rust-serde" ,rust-serde-1))
-       #:cargo-development-inputs
-       (("rust-serde" ,rust-serde-1)
-        ("rust-serde-json" ,rust-serde-json-1)
-        ("rust-toml" ,rust-toml-0.7))))
-    (home-page "https://github.com/hyunsik/bytesize/")
-    (synopsis "Human-readable byte count representation library for Rust")
-    (description "ByteSize is an utility for human-readable byte count
-representation, with support for both SI and binary units.")
-    (license license:asl2.0)))
-
 (define-public rust-bzip2-0.3
   (package
     (inherit rust-bzip2-0.4)
@@ -10857,6 +10858,39 @@ (define-public rust-bzip2-0.3
         ("rust-rand" ,rust-rand-0.3)
         ("rust-tokio-core" ,rust-tokio-core-0.1))))))
 
+(define-public rust-bzip2-rs-0.1
+  (package
+    (name "rust-bzip2-rs")
+    (version "0.1.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "bzip2-rs" version))
+       (file-name
+        (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "0dgp83kixqrqj6q6574qr5zsfpbsiiwhqs3krhvsn4f8wkkmksxy"))
+       (modules '((guix build utils)))
+       (snippet
+         '(begin
+           (substitute* "Cargo.toml"
+           (("nightly = .*") ""))))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs
+       (("rust-crc32fast" ,rust-crc32fast-1)
+        ("rust-tinyvec" ,rust-tinyvec-1)
+        ("rust-rayon-core" ,rust-rayon-core-1))
+       #:cargo-development-inputs
+       (("rust-bzip2" ,rust-bzip2-0.4)
+        ("rust-criterion" ,rust-criterion-0.3)
+        ("rust-pretty_assertions" ,rust-pretty-assertions-0.6))))
+    (home-page "https://github.com/paolobarbolini/bzip2-rs")
+    (synopsis "Pure Rust bzip2 decompressor")
+    (description "Pure Rust 100% safe bzip2 decompressor.")
+    (license (list license:expat license:asl2.0))))
+
 (define-public rust-bzip2-sys-0.1
   (package
     (name "rust-bzip2-sys")
-- 
2.41.0