Subject: [PATCH] gnu: Add rust-bzip2-rs

From: Stefan <[email-masked]>
Date: Sun, 15 Oct 2023 18:06:42 +0200

* gnu/packages/crates-io.scm (rust-bzip2-rs-0.1): New variable.
* gnu/packages/crates-io.scm (rust-bytesize-1): Moved to group bzip2 related
packages.
---
  gnu/packages/crates-io.scm | 80 +++++++++++++++++++++++++++-----------
  1 file changed, 57 insertions(+), 23 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 80fb92ec82..0271dba14a 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -32,6 +32,7 @@
  ;;; Copyright © 2022 Paul A. Patience <[email-masked]>
  ;;; Copyright © 2022 Paul Alesius <[email-masked]>
  ;;; Copyright © 2023 Arnav Andrew Jose <[email-masked]>
+;;; Copyright © 2023 Stefan <[email-masked]>
  ;;;
  ;;; This file is part of GNU Guix.
  ;;;
@@ -9932,6 +9933,29 @@ (define-public rust-bytestring-0.1
       "This package provides a UTF-8 encoded string with Bytes as a storage.")
      (license (list license:expat license:asl2.0))))
  
+(define-public rust-bytesize-1
+  (package
+    (name "rust-bytesize")
+    (version "1.1.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "bytesize" version))
+       (file-name
+        (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "0w7wmmbcirxp5isza0i1lxq5d7r7f0z1pxbxl5f6s1n5m8vfqn3c"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs
+       (("rust-serde" ,rust-serde-1))))
+    (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.4
    (package
      (name "rust-bzip2")
@@ -9965,29 +9989,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.1.0")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (crate-uri "bytesize" version))
-       (file-name
-        (string-append name "-" version ".tar.gz"))
-       (sha256
-        (base32
-         "0w7wmmbcirxp5isza0i1lxq5d7r7f0z1pxbxl5f6s1n5m8vfqn3c"))))
-    (build-system cargo-build-system)
-    (arguments
-     `(#:cargo-inputs
-       (("rust-serde" ,rust-serde-1))))
-    (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)
@@ -10015,6 +10016,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")

base-commit: a0d2ecde943bd1854ddbb7c0cad35a1fc64dc5ab
-- 
2.41.0