Subject: Re: bug#45293: [PATCH] gnu: Add skim.

From: Z572 <[email-masked]>
Date: Mon, 25 Jan 2021 17:21:24 +0800

This is new patch.
>From 0cdaab0fcdadd8603641e5d28120e91462323cee Mon Sep 17 00:00:00 2001
From: Zheng Junjie <[email-masked]>
Date: Mon, 25 Jan 2021 13:21:12 +0800
Subject: [PATCH 1/4] gnu: Add rust-tuikit-0.4.

---
 gnu/packages/crates-io.scm | 35 +++++++++++++++++++++++++++++++----
 1 file changed, 31 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 36f0b98112..39b3fb5189 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -12,6 +12,7 @@
 ;;; Copyright © 2020 André Batista <[email-masked]>
 ;;; Copyright © 2020 Arun Isaac <[email-masked]>
 ;;; Copyright © 2020 Antoine Côté <[email-masked]>
+;;; Copyright @ 2021 Zheng Junjie <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -38719,10 +38720,10 @@ extension for the Trust-DNS client to use rustls for TLS.")
      "Test harness for ui tests of compiler diagnostics.")
     (license (list license:expat license:asl2.0))))
 
-(define-public rust-tuikit-0.2
+(define-public rust-tuikit-0.4
   (package
     (name "rust-tuikit")
-    (version "0.2.9")
+    (version "0.4.3")
     (source
       (origin
         (method url-fetch)
@@ -38731,7 +38732,7 @@ extension for the Trust-DNS client to use rustls for TLS.")
          (string-append name "-" version ".tar.gz"))
         (sha256
          (base32
-          "19f3jp12kqcx7aaykxbaj1j17zahd4drv049agpxaminr63w2sw4"))))
+          "1hf6pgclb2lj08jzb45q0mpjq2a9zw27h7kwyi5cibjz5skd054b"))))
     (build-system cargo-build-system)
     (arguments
      `(#:tests? #f  ; tests fail in the build environment.
@@ -38740,7 +38741,7 @@ extension for the Trust-DNS client to use rustls for TLS.")
         ("rust-lazy-static" ,rust-lazy-static-1)
         ("rust-log" ,rust-log-0.4)
         ("rust-nix" ,rust-nix-0.14)
-        ("rust-term" ,rust-term-0.5)
+        ("rust-term" ,rust-term-0.6)
         ("rust-unicode-width" ,rust-unicode-width-0.1))
        #:cargo-development-inputs
        (("rust-env-logger" ,rust-env-logger-0.6))))
@@ -38750,6 +38751,32 @@ extension for the Trust-DNS client to use rustls for TLS.")
      "This package provides a toolkit for writing TUI applications in Rust.")
     (license license:expat)))
 
+(define-public rust-tuikit-0.2
+  (package
+    (inherit rust-tuikit-0.4)
+    (name "rust-tuikit")
+    (version "0.2.9")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "tuikit" version))
+       (file-name
+        (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "19f3jp12kqcx7aaykxbaj1j17zahd4drv049agpxaminr63w2sw4"))))
+    (arguments
+     `(#:tests? #f  ; tests fail in the build environment.
+       #:cargo-inputs
+       (("rust-bitflags" ,rust-bitflags-1)
+        ("rust-lazy-static" ,rust-lazy-static-1)
+        ("rust-log" ,rust-log-0.4)
+        ("rust-nix" ,rust-nix-0.14)
+        ("rust-term" ,rust-term-0.5)
+        ("rust-unicode-width" ,rust-unicode-width-0.1))
+       #:cargo-development-inputs
+       (("rust-env-logger" ,rust-env-logger-0.6))))))
+
 (define-public rust-typeable-0.1
   (package
     (name "rust-typeable")
-- 
2.30.0

>From f7b63404e89889ab2f9a59fc1786744091949812 Mon Sep 17 00:00:00 2001
From: Zheng Junjie <[email-masked]>
Date: Mon, 25 Jan 2021 13:34:04 +0800
Subject: [PATCH 2/4] gnu: Add rust-defer-drop-1.

---
 gnu/packages/crates-io.scm | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 39b3fb5189..1357f52c19 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -8815,6 +8815,33 @@ sizes.  Big-endian order is used.  WARNING: Block must be aligned!")
      "Decimal floating point arithmetic for Rust.")
     (license license:asl2.0)))
 
+(define-public rust-defer-drop-1
+  (package
+    (name "rust-defer-drop")
+    (version "1.0.1")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (crate-uri "defer-drop" version))
+        (file-name
+          (string-append name "-" version ".tar.gz"))
+        (sha256
+          (base32
+            "1d3pmmn5k2ir3yv8z8fnv4jprs5aijkz5pbdyl8x8kp18m90bbhq"))))
+    (build-system cargo-build-system)
+    (arguments
+      `(#:skip-build? #t
+        #:cargo-inputs
+        (("rust-crossbeam-channel"
+          ,rust-crossbeam-channel-0.4)
+         ("rust-once-cell" ,rust-once-cell-1))))
+    (home-page "https://github.com/Lucretiel/defer-drop")
+    (synopsis
+     "Defer dropping large types to a background thread")
+    (description
+     "This package provides a defer dropping large types to a background thread.")
+    (license license:mpl2.0)))
+
 (define-public rust-deflate-0.8
   (package
     (name "rust-deflate")
-- 
2.30.0

>From 3f85f899095a7664b778942f588c0622715c2db4 Mon Sep 17 00:00:00 2001
From: Zheng Junjie <[email-masked]>
Date: Mon, 25 Jan 2021 13:53:37 +0800
Subject: [PATCH 3/4] gnu: Add rust-beef-0.4.

---
 gnu/packages/crates-io.scm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 1357f52c19..02ba3c1ecb 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -3034,6 +3034,29 @@ c6e7d37.  However, this package works only up to 128 bytes.")
     (description "This library provides for encoding and decoding any base.")
     (license license:expat)))
 
+(define-public rust-beef-0.4
+  (package
+    (name "rust-beef")
+    (version "0.4.4")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (crate-uri "beef" version))
+        (file-name
+          (string-append name "-" version ".tar.gz"))
+        (sha256
+          (base32
+            "0hva1rmbx2a54q4ncs8i5lbr26669wyvnya1sh3x22r0cxm64jj7"))))
+    (build-system cargo-build-system)
+    (arguments
+      `(#:skip-build? #t
+        #:cargo-inputs
+        (("rust-serde" ,rust-serde-1))))
+    (home-page "https://github.com/maciejhirsz/beef")
+    (synopsis "More compact Cow")
+    (description "This package provides a More compact Cow.")
+    (license (list license:expat license:asl2.0))))
+
 (define-public rust-bencher-0.1
   (package
     (name "rust-bencher")
-- 
2.30.0

>From c7d9525e5197a34d4a5c2fbfeb790c2a91bfd01f Mon Sep 17 00:00:00 2001
From: Zheng Junjie <[email-masked]>
Date: Mon, 25 Jan 2021 16:57:31 +0800
Subject: [PATCH 4/4] gnu: Add rust-skim-0.9.

---
 gnu/packages/crates-io.scm | 92 +++++++++++++++++++++++++++++++++++---
 1 file changed, 86 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 02ba3c1ecb..16a59589a3 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -32725,8 +32725,93 @@ variants in pure Rust.")
      "Test your Rust markdown documentation via Cargo.")
     (license (list license:expat license:asl2.0))))
 
+(define-public rust-skim-0.9
+  (package
+    (name "rust-skim")
+    (version "0.9.3")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (crate-uri "skim" version))
+        (file-name
+          (string-append name "-" version ".tar.gz"))
+        (sha256
+          (base32
+            "0qir6m4cpd63bnp0lqq4si1ccgd6rbv4m1662v771fkyynrdrj0s"))))
+    (build-system cargo-build-system)
+    (arguments
+      `(#:cargo-inputs
+        (("rust-beef" ,rust-beef-0.4)
+         ("rust-bitflags" ,rust-bitflags-1)
+         ("rust-chrono" ,rust-chrono-0.4)
+         ("rust-clap" ,rust-clap-2)
+         ("rust-crossbeam" ,rust-crossbeam-0.7)
+         ("rust-defer-drop" ,rust-defer-drop-1)
+         ("rust-derive-builder" ,rust-derive-builder-0.9)
+         ("rust-env-logger" ,rust-env-logger-0.6)
+         ("rust-fuzzy-matcher" ,rust-fuzzy-matcher-0.3)
+         ("rust-lazy-static" ,rust-lazy-static-1)
+         ("rust-log" ,rust-log-0.4)
+         ("rust-nix" ,rust-nix-0.14)
+         ("rust-rayon" ,rust-rayon-1)
+         ("rust-regex" ,rust-regex-1)
+         ("rust-shlex" ,rust-shlex-0.1)
+         ("rust-time" ,rust-time-0.1)
+         ("rust-timer" ,rust-timer-0.2)
+         ("rust-tuikit" ,rust-tuikit-0.4)
+         ("rust-unicode-width" ,rust-unicode-width-0.1)
+         ("rust-vte" ,rust-vte-0.3))
+        #:phases
+        (modify-phases %standard-phases
+          (add-after 'install 'install-extras
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let* ((out (assoc-ref outputs "out"))
+                     (bin (string-append out "/bin"))
+                     (share (string-append out "/share"))
+                     (man (string-append out "/share/man"))
+                     (vimfiles (string-append share "/vim/vimfiles/plugin"))
+                     (bash-completion
+                      (string-append share "/bash-completions/completions"))
+                     (zsh-site (string-append share "/zsh/site-functions"))
+                     (fish-vendor
+                      (string-append share "/fish/vendor-completions.d")))
+                ;; Binaries
+                (for-each
+                 (lambda (binary) (install-file binary bin))
+                 (find-files "bin"))
+                (mkdir-p share)
+                ;; Manpages
+                (copy-recursively "man" man)
+                ;; Vim plugins
+                (mkdir-p vimfiles)
+                (copy-recursively "plugin" vimfiles)
+                ;; Completions
+                (mkdir-p bash-completion)
+                (copy-file
+                 "shell/completion.bash"
+                 (string-append bash-completion "/skim"))
+                (copy-file
+                 "shell/key-bindings.bash"
+                 (string-append bash-completion "/skim-bindings"))
+                (mkdir-p zsh-site)
+                (copy-file
+                 "shell/completion.zsh"
+                 (string-append zsh-site "/_skim"))
+                (copy-file
+                 "shell/key-bindings.zsh"
+                 (string-append zsh-site "/_skim-bindings"))
+                (mkdir-p fish-vendor)
+                (copy-file
+                 "shell/key-bindings.fish"
+                 (string-append fish-vendor "/skim-bindings.fish"))))))))
+    (home-page "https://github.com/lotabout/skim")
+    (synopsis "Fuzzy Finder in Rust")
+    (description "This package provides a fuzzy finder in Rust.")
+    (license license:expat)))
+
 (define-public rust-skim-0.7
   (package
+    (inherit rust-skim-0.9)
     (name "rust-skim")
     (version "0.7.0")
     (source
@@ -32738,7 +32823,6 @@ variants in pure Rust.")
         (sha256
          (base32
           "1yiyd6fml5hd2l811sckkzmiiq9bd7018ajk4qk3ai4wyvqnw8mv"))))
-    (build-system cargo-build-system)
     (arguments
      `(#:cargo-inputs
        (("rust-bitflags" ,rust-bitflags-1)
@@ -32757,11 +32841,7 @@ variants in pure Rust.")
         ("rust-timer" ,rust-timer-0.2)
         ("rust-tuikit" ,rust-tuikit-0.2)
         ("rust-unicode-width" ,rust-unicode-width-0.1)
-        ("rust-vte" ,rust-vte-0.3))))
-    (home-page "https://github.com/lotabout/skim")
-    (synopsis "Fuzzy Finder in Rust")
-    (description "This package provides a fuzzy finder in Rust.")
-    (license license:expat)))
+        ("rust-vte" ,rust-vte-0.3))))))
 
 (define-public rust-slab-0.4
   (package
-- 
2.30.0