[PATCH] gnu: add fd.

  • Done
  • quality assurance status badge
Details
2 participants
  • Efraim Flashner
  • John Soo
Owner
unassigned
Submitted by
John Soo
Severity
normal

Debbugs page

John Soo wrote 5 years ago
(address . guix-patches@gnu.org)
CAKf5CqVPS+_mtKTp4i7QH2pnBk31xnvSSHngfZqzYGwe3Z76UA@mail.gmail.com
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 <jsoo1@asu.edu>
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(+)

Toggle diff (42 lines)
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 <jsoo1@asu.edu>
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(+)

Toggle diff (95 lines)
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 <jsoo1@asu.edu>
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(-)

Toggle diff (33 lines)
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 <jsoo1@asu.edu>
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(+)

Toggle diff (44 lines)
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 <jsoo1@asu.edu>
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(+)

Toggle diff (40 lines)
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
Efraim Flashner wrote 5 years ago
(name . John Soo)(address . jsoo1@asu.edu)(address . 39488-done@debbugs.gnu.org)
20200208190505.GA1133@E5400
A couple of notes:

rust-nix-0.14: rust-sysctl should be 0.1, not 0.4. I added 0.1 and
switched the dependency.

rust-ctrlc-3.1: It builds with no problems so I removed skip-build

rust-lscolors-0.6: rust-ansi-term should be 0.12, not 0.11. I changed it
and removed skip-build.

fd: rust-clap is a dependency and build dependency and version-check a
build-dependency so I put them in cargo-dependencies. I flushed out the
description a bit. I checked the cargo.toml and I wasn't sure if
jemalloc was used or not (it looked like not windows or not musl) but I
see it building jemalloc-sys so I see it is. fd.bash should be renamed
to just 'fd' so I added a rename-file after the installation. As a last
thing I changed the jemalloc reference to jemalloc.so and now 'guix gc
--references' retains a reference to jemalloc.


--
Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAl4/BmEACgkQQarn3Mo9
g1FuahAAwaQJPkkSGhVBP1oIPaxudKJ5bAChSSkiTEirM1J6gqyrnuXWNuKSeRwS
aOmwRyBBky9hCXmpesPKDHOtN+c6iA2XdN3pKH/y+xSFcdnnf9AEKNyYRfJf1Rif
KvHSGlRifOo9h76OGZE2CvNwQmi7gGdNydulEKYLSdE6uTLwqgfi9W+7d1bu0NNK
kFrhhCUpiqkSAlHr9ei+n9QN1/aKgm3eg2fat3IFDo5b6eMosh381Q93al8zIdbw
7Uk7YdlSBhVra5Tx3qjZIQa4VRt4o92n5fX09mpB/YsCT/vPHy7puyYRpLDqAOz2
da5LKGWcSAPlKsjzI7t/juVUSgIMmHevhzmBJxaKjA0eTavoP1Ozqbrbx4pv/lAa
NGRN3glD+JoWLI7qp0XdKdPCkrOpVFAAJ3DeK+amrqAsz1+lmPg4M6axKtNH5ZMk
YyOCTVaHbb3KC5vhktopc04pZ61RXbrYbPiWBRc/FMZIDukPPvxAAt81zy35/rOT
Adc23smwrtqILvlQ1ybZ3dQlJMXfP21LSSIOuKsSBCMttKVzvSXmbBZBlbDDqGqk
XgWejx9YRYa7pBogKOQAK5aI5wbjvDBRXM7CekUXXm0Xn71x4AHfWRCgn3oDkNoL
zwx1U7H3HKfSYVgi2ieYCFT7NEw/JaBfzXF9NGyiw39WBqXB98Q=
=7v/X
-----END PGP SIGNATURE-----


Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 39488@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 39488
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help