Subject: [PATCH] gnu: add fd.
From: John Soo <[email-masked]>
To: [email-masked]
Date: Fri, 7 Feb 2020 17:27:26 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Guix,

fd is a fast program like find written in rust.

Thanks,

John
From 3a09cdb6cf78eeda6ed0205d9a7dd69e8bc1249e Mon Sep 17 00:00:00 2001
From: John Soo <[email-masked]>
Date: Tue, 21 Jan 2020 09:26:05 -0800
Subject: [PATCH 2/5] gnu: Add rust-ctrlc-3.1.

* gnu/packages/crates-io.scm (rust-ctrlc-3.1): New variable.
---
 gnu/packages/crates-io.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 54cda8afc5..cd729f6a2b 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -2292,6 +2292,35 @@ intrinsics.")
      "Bare bones CSV parsing with no_std support.")
     (license (list license:unlicense license:expat))))
 
+(define-public rust-ctrlc-3.1
+  (package
+    (name "rust-ctrlc")
+    (version "3.1.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "ctrlc" version))
+       (file-name
+        (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "0zz8ad4bk28s111af5vy1c5kii4zw0cgh87ivzgj28f8nkcd5py7"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:skip-build? #t
+       #:cargo-inputs
+       (("rust-nix" ,rust-nix-0.14)
+        ("rust-winapi" ,rust-winapi-0.3))
+       #:cargo-development-inputs
+       (("rust-winapi" ,rust-winapi-0.3))))
+    (home-page
+     "https://github.com/Detegr/rust-ctrlc")
+    (synopsis
+     "Easy Ctrl-C handler for Rust projects")
+    (description
+     "Easy Ctrl-C handler for Rust projects.")
+    (license (list license:expat license:asl2.0))))
+
 (define-public rust-curl-sys-0.4
   (package
     (name "rust-curl-sys")
-- 
2.25.0

From 03e9e2db0f53d94cbfe0507638c5d0688ae992aa Mon Sep 17 00:00:00 2001
From: John Soo <[email-masked]>
Date: Tue, 21 Jan 2020 09:33:33 -0800
Subject: [PATCH 5/5] gnu: Add fd.

* gnu/packages/crates-io.scm (fd): New variable.
---
 gnu/packages/rust-apps.scm | 73 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)

diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm
index 5b61cdc542..5556b1a549 100644
--- a/gnu/packages/rust-apps.scm
+++ b/gnu/packages/rust-apps.scm
@@ -22,8 +22,10 @@
   #:use-module (guix build-system cargo)
   #:use-module (guix download)
   #:use-module (guix packages)
+  #:use-module (gnu packages bash)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crates-io)
+  #:use-module (gnu packages jemalloc)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages version-control))
@@ -125,6 +127,77 @@ program @code{ls}.  It uses colours to distinguish file types and metadata.  It
 also knows about symlinks, extended attributes, and Git.")
     (license license:expat)))
 
+(define-public fd
+  (package
+    (name "fd")
+    (version "7.4.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "fd-find" version))
+       (file-name
+        (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "147m872zff0srwq9vaxkkbab06g3fkklbk1g2lx90vdhgs37f5xj"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs
+       (("rust-ansi-term" ,rust-ansi-term-0.12)
+        ("rust-atty" ,rust-atty-0.2)
+        ("rust-clap" ,rust-clap-2)
+        ("rust-ctrlc" ,rust-ctrlc-3.1)
+        ("rust-globset" ,rust-globset-0.4)
+        ("rust-humantime" ,rust-humantime-1.3)
+        ("rust-ignore" ,rust-ignore-0.4)
+        ("rust-jemallocator" ,rust-jemallocator-0.3)
+        ("rust-lazy-static" ,rust-lazy-static-1.4)
+        ("rust-libc" ,rust-libc-0.2)
+        ("rust-lscolors" ,rust-lscolors-0.6)
+        ("rust-num-cpus" ,rust-num-cpus-1.10)
+        ("rust-regex" ,rust-regex-1.3)
+        ("rust-regex-syntax" ,rust-regex-syntax-0.6))
+       #:cargo-development-inputs
+       (("rust-clap" ,rust-clap-2)
+        ("rust-diff" ,rust-diff-0.1)
+        ("rust-filetime" ,rust-filetime-0.2)
+        ("rust-tempdir" ,rust-tempdir-0.3)
+        ("rust-version-check" ,rust-version-check-0.9))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'override-jemalloc
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let ((jemalloc (assoc-ref inputs "jemalloc")))
+               (setenv "JEMALLOC_OVERRIDE"
+                       (string-append jemalloc "/lib/libjemalloc_pic.a")))
+             #t))
+         (add-after 'install 'install-extra
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (install-completion
+                     (lambda (completion out-dir)
+                       (for-each
+                        (lambda (f)
+                          (install-file f (string-append out out-dir)))
+                        (find-files "target/release/build/" completion)))))
+               ;; Manpages
+               (install-file "doc/fd.1" (string-append out "/share/man/man1"))
+               ;; Completions
+               (install-completion
+                "^fd.bash$" "/etc/bash-completion.d")
+               (install-completion
+                "^fd.fish$" "/share/fish/vendor_completions.d")
+               (install-completion
+                "^_fd$" "/share/zsh/site-functions")
+               #t))))))
+    (inputs `(("jemalloc" ,jemalloc)))
+    (home-page "https://github.com/sharkdp/fd")
+    (synopsis
+     "Simple, fast and user-friendly alternative to find")
+    (description
+     "fd is a simple, fast and user-friendly alternative to find.")
+    (license (list license:expat license:asl2.0))))
+
 (define-public ripgrep
   (package
     (name "ripgrep")
-- 
2.25.0

From 5319c4e96ca8115e068475fc36ca3b697cdc636d Mon Sep 17 00:00:00 2001
From: John Soo <[email-masked]>
Date: Tue, 21 Jan 2020 09:55:21 -0800
Subject: [PATCH 4/5] gnu: rust-regex-1.1: Update to 1.1.9.

* gnu/packages/crates-io.scm (rust-regex-1.1): Update it.
---
 gnu/packages/crates-io.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 386bf84b8f..c19ff52059 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -9686,7 +9686,7 @@ uses finite automata and guarantees linear time matching on all inputs.")
   (package
     (inherit rust-regex-1.3)
     (name "rust-regex")
-    (version "1.1.7")
+    (version "1.1.9")
     (source
      (origin
        (method url-fetch)
@@ -9695,7 +9695,7 @@ uses finite automata and guarantees linear time matching on all inputs.")
         (string-append name "-" version ".tar.gz"))
        (sha256
         (base32
-         "1pabajpp0wzb7dm2x32gy8w7k0mwykr6zsvzn0fgpr6pww40hbqb"))))
+         "1ba47ivq8l1yikiwikjnq5barag6iqfgcpxlz2263fqbq9y2kn6r"))))
     (arguments
      `(#:skip-build? #t
        #:cargo-inputs
@@ -9708,7 +9708,7 @@ uses finite automata and guarantees linear time matching on all inputs.")
        (("rust-doc-comment" ,rust-doc-comment-0.3)
         ("rust-lazy-static" ,rust-lazy-static-1.3)
         ("rust-quickcheck" ,rust-quickcheck-0.8)
-        ("rust-rand" ,rust-rand-0.4))))))
+        ("rust-rand" ,rust-rand-0.6))))))
 
 (define-public rust-regex-0.2
   (package
-- 
2.25.0

From f3d5bc404ee67b2e3523aef264d74222cfcf2c8d Mon Sep 17 00:00:00 2001
From: John Soo <[email-masked]>
Date: Tue, 21 Jan 2020 10:10:29 -0800
Subject: [PATCH 1/5] gnu: Add rust-nix-0.14.

* gnu/packages/crates-io.scm (rust-nix-0.14): Add it.
---
 gnu/packages/crates-io.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index d51b63675a..54cda8afc5 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -6939,6 +6939,37 @@ release (fork of debug_unreachable)")
 prove a function can't ever panic.")
     (license (list license:expat license:asl2.0))))
 
+(define-public rust-nix-0.14
+  (package
+    (inherit rust-nix-0.15)
+    (version "0.14.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "nix" version))
+       (file-name
+        (string-append (package-name rust-nix-0.15)
+                       "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "1kmxdlmvnmq8cfpmr3g6wk37rwi2ybdvp1z6z3831m1p23p2nwkc"))))
+    (arguments
+     `(#:skip-build? #t
+       #:cargo-inputs
+       (("rust-bitflags" ,rust-bitflags-1)
+        ("rust-cc" ,rust-cc-1.0)
+        ("rust-cfg-if" ,rust-cfg-if-0.1)
+        ("rust-libc" ,rust-libc-0.2)
+        ("rust-void" ,rust-void-1.0))
+       #:cargo-development-inputs
+       (("rust-bytes" ,rust-bytes-0.4)
+        ("rust-caps" ,rust-caps-0.3)
+        ("rust-cc" ,rust-cc-1.0)
+        ("rust-lazy-static" ,rust-lazy-static-1.3)
+        ("rust-rand" ,rust-rand-0.6)
+        ("rust-sysctl" ,rust-sysctl-0.4)
+        ("rust-tempfile" ,rust-tempfile-3.0))))))
+
 (define-public rust-nodrop-0.1
   (package
     (name "rust-nodrop")
-- 
2.25.0

From 43a155c8703f32c9b3e9c4d61d1400074245446f Mon Sep 17 00:00:00 2001
From: John Soo <[email-masked]>
Date: Tue, 21 Jan 2020 09:28:49 -0800
Subject: [PATCH 3/5] gnu: Add rust-lscolors-0.6.

* gnu/packages/crates-io.scm (rust-lscolors-0.6): New variable.
---
 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 cd729f6a2b..386bf84b8f 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -6881,6 +6881,33 @@ pairs in insertion order.")
         ("rust-serde" ,rust-serde-0.8)
         ("rust-serde-test" ,rust-serde-test-0.8))))))
 
+(define-public rust-lscolors-0.6
+  (package
+    (name "rust-lscolors")
+    (version "0.6.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "lscolors" version))
+       (file-name
+        (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "0jxsgkn378kxkiqdshdjdclw5wwp2xaz45cqd3yw85fhn8a38fza"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:skip-build? #t
+       #:cargo-inputs
+       (("rust-ansi-term" ,rust-ansi-term-0.11))
+       #:cargo-development-inputs
+       (("rust-tempfile" ,rust-tempfile-3.1))))
+    (home-page "https://github.com/sharkdp/lscolors")
+    (synopsis
+     "Colorize paths using the LS_COLORS environment variable")
+    (description
+     "Colorize paths using the LS_COLORS environment variable.")
+    (license (list license:expat license:asl2.0))))
+
 (define-public rust-new-debug-unreachable-1.0
   (package
     (name "rust-new-debug-unreachable")
-- 
2.25.0