1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2019, 2020 John Soo <jsoo1@asu.edu>
3 ;;; Copyright © 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
5 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
6 ;;; Copyright © 2020 Leo Famulari <leo@famulari.name>
7 ;;; Copyright © 2020 Mark H Weaver <mhw@netris.org>
8 ;;; Copyright © 2020 Gabriel Arazas <foo.dogsquared@gmail.com>
9 ;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
11 ;;; This file is part of GNU Guix.
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26 (define-module (gnu packages rust-apps)
27 #:use-module ((guix licenses) #:prefix license:)
28 #:use-module (guix build-system cargo)
29 #:use-module (guix download)
30 #:use-module (guix packages)
31 #:use-module (gnu packages compression)
32 #:use-module (gnu packages crates-io)
33 #:use-module (gnu packages crates-graphics)
34 #:use-module (gnu packages documentation)
35 #:use-module (gnu packages jemalloc)
36 #:use-module (gnu packages pcre)
37 #:use-module (gnu packages pkg-config)
38 #:use-module (gnu packages tls)
39 #:use-module (gnu packages version-control))
48 (uri (crate-uri "bat" version))
49 (file-name (string-append name "-" version ".tar.gz"))
51 (base32 "1ia12774prjnm3msiaja6qdpxkpyknxswqpgkmwzj0wn9nhkc7nz"))))
52 (build-system cargo-build-system)
55 (("rust-ansi-colours" ,rust-ansi-colours-1)
56 ("rust-ansi-term" ,rust-ansi-term-0.12)
57 ("rust-atty" ,rust-atty-0.2)
58 ("rust-clap" ,rust-clap-2)
59 ("rust-console" ,rust-console-0.13)
60 ("rust-content-inspector" ,rust-content-inspector-0.2)
61 ("rust-dirs" ,rust-dirs-3)
62 ("rust-encoding" ,rust-encoding-0.2)
63 ("rust-error-chain" ,rust-error-chain-0.12)
64 ("rust-git2" ,rust-git2-0.13)
65 ("rust-globset" ,rust-globset-0.4)
66 ("rust-lazy-static" ,rust-lazy-static-1)
67 ("rust-path-abs" ,rust-path-abs-0.5)
68 ("rust-semver" ,rust-semver-0.11)
69 ("rust-serde" ,rust-serde-1)
70 ("rust-serde-yaml" ,rust-serde-yaml-0.8)
71 ("rust-shell-words" ,rust-shell-words-1)
72 ("rust-syntect" ,rust-syntect-4)
73 ("rust-unicode-width" ,rust-unicode-width-0.1)
74 ("rust-wild" ,rust-wild-2))
75 #:cargo-development-inputs
76 (("rust-assert-cmd" ,rust-assert-cmd-1)
77 ("rust-predicates" ,rust-predicates-1)
78 ("rust-tempdir" ,rust-tempdir-0.3))))
80 `(("pkg-config" ,pkg-config)))
82 `(("libgit2" ,libgit2)
84 (home-page "https://github.com/sharkdp/bat")
85 (synopsis "@command{cat} clone with syntax highlighting and git integration")
87 "@command{bat} is a drop-in @command{cat} replacement featuring syntax
88 highlighting for a large number of languages, git integration, and automatic
90 (license (list license:expat license:asl2.0))))
99 (uri (crate-uri "exa" version))
101 (string-append name "-" version ".tar.gz"))
104 "1s902xgplz1167k0r7x235p914lprpsqy2if0kpa1mlb0fswqqq4"))))
105 (build-system cargo-build-system)
108 (("rust-ansi-term" ,rust-ansi-term-0.12)
109 ("rust-datetime" ,rust-datetime-0.4)
110 ("rust-env-logger" ,rust-env-logger-0.6)
111 ("rust-git2" ,rust-git2-0.9)
112 ("rust-glob" ,rust-glob-0.3)
113 ("rust-lazy-static" ,rust-lazy-static-1)
114 ("rust-libc" ,rust-libc-0.2)
115 ("rust-locale" ,rust-locale-0.2)
116 ("rust-log" ,rust-log-0.4)
117 ("rust-natord" ,rust-natord-1.0)
118 ("rust-num-cpus" ,rust-num-cpus-1)
119 ("rust-number-prefix" ,rust-number-prefix-0.3)
120 ("rust-scoped-threadpool" ,rust-scoped-threadpool-0.1)
121 ("rust-term-grid" ,rust-term-grid-0.1)
122 ("rust-term-size" ,rust-term-size-0.3)
123 ("rust-unicode-width" ,rust-unicode-width-0.1)
124 ("rust-users" ,rust-users-0.9)
125 ("rust-zoneinfo-compiled" ,rust-zoneinfo-compiled-0.4))
126 #:cargo-development-inputs
127 (("rust-datetime" ,rust-datetime-0.4))
129 (modify-phases %standard-phases
130 ;; Ignoring failing tests.
131 ;; Reported in https://github.com/ogham/exa/issues/318
132 (add-before 'check 'disable-failing-tests
134 (substitute* "src/options/mod.rs"
135 (("^.*fn oneline_across.*" oneline-across)
136 (string-append "#[ignore]\n" oneline-across)))
138 (substitute* "src/options/view.rs"
139 (("test!\\(across:.*") "")
140 (("test!\\(cr:.*") "")
141 (("test!\\(empty:.*") "")
142 (("test!\\(gracross:.*") "")
143 (("test!\\(grid:.*") "")
144 (("test!\\(icons:.*") "")
145 (("test!\\(just_binary:.*") "")
146 (("test!\\(just_blocks:.*") "")
147 (("test!\\(just_bytes:.*") "")
148 (("test!\\(just_git:.*") "")
149 (("test!\\(just_group:.*") "")
150 (("test!\\(just_header:.*") "")
151 (("test!\\(just_inode:.*") "")
152 (("test!\\(just_links:.*") "")
153 (("test!\\(leg:.*") "")
154 (("test!\\(lid:.*") "")
155 (("test!\\(original_g:.*") ""))
157 (add-after 'install 'install-extras
158 (lambda* (#:key outputs #:allow-other-keys)
159 (let* ((out (assoc-ref outputs "out"))
160 (share (string-append out "/share"))
161 (man1 (string-append share "/man/man1")))
162 (install-file "contrib/man/exa.1" man1)
163 (mkdir-p (string-append out "/etc/bash_completion.d"))
164 (mkdir-p (string-append share "/fish/vendor_completions.d"))
165 (mkdir-p (string-append share "/zsh/site-functions"))
166 (copy-file "contrib/completions.bash"
167 (string-append out "/etc/bash_completion.d/exa"))
168 (copy-file "contrib/completions.fish"
169 (string-append share "/fish/vendor_completions.d/exa.fish"))
170 (copy-file "contrib/completions.zsh"
171 (string-append share "/zsh/site-functions/_exa"))
174 `(("libgit2" ,libgit2)
177 `(("pkg-config" ,pkg-config)))
178 (home-page "https://the.exa.website/")
179 (synopsis "Modern replacement for ls")
180 (description "@code{exa} is a modern replacement for the command-line
181 program @code{ls}. It uses colours to distinguish file types and metadata. It
182 also knows about symlinks, extended attributes, and Git.")
183 (license license:expat)))
192 (uri (crate-uri "fd-find" version))
194 (string-append name "-" version ".tar.gz"))
197 "124a5r8hpk2phs1288jybh34d48yxy44wr7gv5ggchs272gs2jam"))))
198 (build-system cargo-build-system)
201 (("rust-ansi-term" ,rust-ansi-term-0.12)
202 ("rust-anyhow" ,rust-anyhow-1.0)
203 ("rust-atty" ,rust-atty-0.2)
204 ("rust-clap" ,rust-clap-2)
205 ("rust-ctrlc" ,rust-ctrlc-3.1)
206 ("rust-dirs" ,rust-dirs-2.0)
207 ("rust-globset" ,rust-globset-0.4)
208 ("rust-humantime" ,rust-humantime-2)
209 ("rust-ignore" ,rust-ignore-0.4)
210 ("rust-jemallocator" ,rust-jemallocator-0.3)
211 ("rust-lazy-static" ,rust-lazy-static-1)
212 ("rust-libc" ,rust-libc-0.2)
213 ("rust-lscolors" ,rust-lscolors-0.7)
214 ("rust-num-cpus" ,rust-num-cpus-1)
215 ("rust-regex" ,rust-regex-1)
216 ("rust-regex-syntax" ,rust-regex-syntax-0.6)
217 ("rust-users" ,rust-users-0.10)
218 ("rust-version-check" ,rust-version-check-0.9))
219 #:cargo-development-inputs
220 (("rust-diff" ,rust-diff-0.1)
221 ("rust-filetime" ,rust-filetime-0.2)
222 ("rust-tempdir" ,rust-tempdir-0.3))
224 (modify-phases %standard-phases
225 (add-after 'unpack 'override-jemalloc
226 (lambda* (#:key inputs #:allow-other-keys)
227 (let ((jemalloc (assoc-ref inputs "jemalloc")))
228 (setenv "JEMALLOC_OVERRIDE"
229 (string-append jemalloc "/lib/libjemalloc.so")))
231 (add-after 'install 'install-extra
232 (lambda* (#:key outputs #:allow-other-keys)
233 (let* ((out (assoc-ref outputs "out"))
235 (lambda (completion out-dir)
238 (install-file f (string-append out out-dir)))
239 (find-files "target/release/build/" completion)))))
241 (install-file "doc/fd.1" (string-append out "/share/man/man1"))
243 (install-completion "^fd.bash$" "/etc/bash_completion.d")
244 (install-completion "^fd.fish$" "/share/fish/vendor_completions.d")
245 (install-completion "^_fd$" "/share/zsh/site-functions")
246 (rename-file (string-append out "/etc/bash_completion.d/fd.bash")
247 (string-append out "/etc/bash_completion.d/fd"))
249 (inputs `(("jemalloc" ,jemalloc)))
250 (home-page "https://github.com/sharkdp/fd")
251 (synopsis "Simple, fast and user-friendly alternative to find")
253 "@code{fd} is a simple, fast and user-friendly alternative to @code{find}.
254 While it does not seek to mirror all of find's powerful functionality, it
255 provides defaults for 80% of the use cases.")
256 (license (list license:expat license:asl2.0))))
265 (uri (crate-uri "hexyl" version))
267 (string-append name "-" version ".tar.gz"))
270 "0sipag77196467idbznbk5q5lwhqz85zw7y1pwg9b27jxqyk04rp"))))
271 (build-system cargo-build-system)
274 (("rust-ansi-term" ,rust-ansi-term-0.12)
275 ("rust-atty" ,rust-atty-0.2)
276 ("rust-clap" ,rust-clap-2)
277 ("rust-libc" ,rust-libc-0.2))))
278 (home-page "https://github.com/sharkdp/hexyl")
279 (synopsis "Command-line hex viewer")
281 "This package provides a command line hex viewer. It uses a colored output
282 for distinguishing different kinds of bytes such as NULL bytes, printable ASCII
283 characters, ASCII whitespace characters, other ASCII characters and non-ASCII.")
284 (license (list license:expat license:asl2.0))))
286 (define-public ripgrep
293 (uri (crate-uri "ripgrep" version))
295 (string-append name "-" version ".tar.gz"))
298 "1grfi0j9zczzipipc21lkdbqmd2lvy2wlqy65fy4sckqvix5amdr"))))
299 (build-system cargo-build-system)
302 (("rust-bstr" ,rust-bstr-0.2)
303 ("rust-clap" ,rust-clap-2)
304 ("rust-grep" ,rust-grep-0.2)
305 ("rust-ignore" ,rust-ignore-0.4)
306 ("rust-jemallocator" ,rust-jemallocator-0.3)
307 ("rust-lazy-static" ,rust-lazy-static-1)
308 ("rust-log" ,rust-log-0.4)
309 ("rust-num-cpus" ,rust-num-cpus-1)
310 ("rust-regex" ,rust-regex-1)
311 ("rust-serde-json" ,rust-serde-json-1)
312 ("rust-termcolor" ,rust-termcolor-1))
313 #:cargo-development-inputs
314 (("rust-serde" ,rust-serde-1)
315 ("rust-serde-derive" ,rust-serde-derive-1))
316 #:modules ((ice-9 match)
317 (guix build cargo-build-system)
320 (modify-phases %standard-phases
321 (add-after 'build 'install-manpage
322 ;; NOTE: This is done before 'check so that there's only one output
323 ;; directory with the man page.
324 (lambda* (#:key outputs #:allow-other-keys)
325 (match (find-files "target" "^rg\\.1$")
327 (install-file manpage (string-append
328 (assoc-ref outputs "out")
329 "/share/man/man1"))))
331 #:features '("pcre2")))
333 `(("asciidoc" ,asciidoc)
335 ("pkg-config" ,pkg-config)))
336 (home-page "https://github.com/BurntSushi/ripgrep")
337 (synopsis "Line-oriented search tool")
339 "ripgrep is a line-oriented search tool that recursively searches
340 your current directory for a regex pattern while respecting your
342 (license (list license:unlicense license:expat))))
344 (define-public rust-cbindgen
346 (name "rust-cbindgen")
351 (uri (crate-uri "cbindgen" version))
352 (file-name (string-append name "-" version ".crate"))
355 "0673pq96hs7waavkv58v2pakpxpsfyjvbraa5kyl2b44phgdzcid"))))
356 (build-system cargo-build-system)
359 (("clap" ,rust-clap-2)
360 ("log" ,rust-log-0.4)
361 ("proc-macro2" ,rust-proc-macro2-1)
362 ("quote" ,rust-quote-1)
363 ("serde" ,rust-serde-1)
364 ("serde-json" ,rust-serde-json-1)
366 ("tempfile" ,rust-tempfile-3)
367 ("toml" ,rust-toml-0.5))))
368 (home-page "https://github.com/eqrion/cbindgen/")
369 (synopsis "Tool for generating C bindings to Rust code")
371 "This package provides a tool for generating C/C++ bindings to Rust code.")
372 (license license:mpl2.0)))
374 (define-public rust-cbindgen-0.14
376 (inherit rust-cbindgen)
377 (name "rust-cbindgen")
382 (uri (crate-uri "cbindgen" version))
384 (string-append name "-" version ".tar.gz"))
387 "1ppwqbzydxlg9a24lynzfk60xrvqw4k31mpz1wrk6lbf88zf8nxi"))))))
389 (define-public rust-cbindgen-0.12
391 (inherit rust-cbindgen)
392 (name "rust-cbindgen")
397 (uri (crate-uri "cbindgen" version))
399 (string-append name "-" version ".tar.gz"))
402 "13jzbmjz1bmmfr0i80hw6ar484mgabx3hbpb2ynhk0ddqi0yr58m"))))))
411 (uri (crate-uri "tokei" version))
413 (string-append name "-" version ".tar.gz"))
416 "07f5laqw2k9l3k8wrg9h8p2m5d9hkfxngyacwrn3vs7mlnw8l81m"))))
417 (build-system cargo-build-system)
420 (("rust-clap" ,rust-clap-2)
421 ("rust-crossbeam-channel" ,rust-crossbeam-channel-0.4)
422 ("rust-dirs" ,rust-dirs-2.0)
423 ("rust-encoding-rs-io" ,rust-encoding-rs-io-0.1)
424 ("rust-env-logger" ,rust-env-logger-0.7)
425 ("rust-grep-searcher" ,rust-grep-searcher-0.1)
426 ("rust-hex" ,rust-hex-0.4)
427 ("rust-ignore" ,rust-ignore-0.4)
428 ("rust-log" ,rust-log-0.4)
429 ("rust-rayon" ,rust-rayon-1)
430 ("rust-serde" ,rust-serde-1)
431 ("rust-serde-cbor" ,rust-serde-cbor-0.10)
432 ("rust-serde-derive" ,rust-serde-derive-1)
433 ("rust-serde-json" ,rust-serde-json-1)
434 ("rust-serde-yaml" ,rust-serde-yaml-0.8)
435 ("rust-term-size" ,rust-term-size-0.3)
436 ("rust-toml" ,rust-toml-0.5))
437 #:cargo-development-inputs
438 (("rust-git2" ,rust-git2-0.11)
439 ("rust-handlebars" ,rust-handlebars-2.0)
440 ("rust-ignore" ,rust-ignore-0.4)
441 ("rust-lazy-static" ,rust-lazy-static-1)
442 ("rust-regex" ,rust-regex-1)
443 ("rust-serde-json" ,rust-serde-json-1)
444 ("rust-tempfile" ,rust-tempfile-3))))
446 `(("pkg-config" ,pkg-config)))
448 `(("libgit2" ,libgit2)
451 (home-page "https://tokei.rs")
452 (synopsis "Count code, quickly")
454 "Tokei is a program that displays statistics about your code. Tokei will
455 show number of files, total lines within those files and code, comments, and
456 blanks grouped by language.")
457 (license (list license:expat license:asl2.0))))
459 (define-public watchexec
466 (uri (crate-uri "watchexec" version))
468 (string-append name "-" version ".tar.gz"))
471 "0bwgqb5fvyqbf2lf0005fxzpbpbwbszc7144g3kg2cmzy5cbrf0w"))))
472 (build-system cargo-build-system)
475 (modify-phases %standard-phases
476 (add-after 'install 'install-completions
477 (lambda* (#:key outputs #:allow-other-keys)
478 (let* ((out (assoc-ref outputs "out"))
479 (zsh (string-append out "/share/zsh/site-functions/_watchexec"))
480 (doc (string-append out "/share/doc/watchexec-" ,version)))
481 (mkdir-p (dirname zsh))
482 (copy-file "completions/zsh" zsh)
483 (install-file "README.md" doc)
486 (("rust-clap" ,rust-clap-2)
487 ("rust-derive-builder" ,rust-derive-builder-0.9)
488 ("rust-env-logger" ,rust-env-logger-0.7)
489 ("rust-glob" ,rust-glob-0.3)
490 ("rust-globset" ,rust-globset-0.4)
491 ("rust-lazy-static" ,rust-lazy-static-1)
492 ("rust-log" ,rust-log-0.4)
493 ("rust-nix" ,rust-nix-0.17)
494 ("rust-notify" ,rust-notify-4)
495 ("rust-walkdir" ,rust-walkdir-2)
496 ("rust-winapi" ,rust-winapi-0.3))))
497 (home-page "https://github.com/watchexec/watchexec")
498 (synopsis "Executes commands in response to file modifications")
500 "@command{watchexec} is a simple, standalone tool that watches a path and runs
501 a command whenever it detects modifications.
505 @item Automatically run unit tests
506 @item Run linters/syntax checkers
511 @item Coalesces multiple file system events into one, for editors that
512 use swap/backup files during saving
513 @item By default, uses @code{.gitignore} and @code{.ignore} to determine which
514 files to ignore notifications for
515 @item Supports watching files with a specific extension
516 @item Supports filtering/ignoring events based on glob patterns
517 @item Launches child processes in a new process group
518 @item Sets environment variables that allow the executed program to learn
519 the details of how it was triggered.
521 (license license:asl2.0)))
523 (define-public rust-cargo-c
525 (name "rust-cargo-c")
530 (uri (crate-uri "cargo-c" version))
532 (string-append name "-" version ".tar.gz"))
535 "0hsag5g4qngm8alfil2dyvl5sagpqi5nb40c7bhwng2z8mv9r41k"))))
536 (build-system cargo-build-system)
539 (("rust-cbindgen" ,rust-cbindgen)
540 ("rust-pretty-env-logger" ,rust-pretty-env-logger-0.4)
541 ("rust-structopt" ,rust-structopt-0.3)
542 ("rust-log" ,rust-log-0.4)
543 ("rust-toml" ,rust-toml-0.5)
544 ("rust-cargo-metadata" ,rust-cargo-metadata-0.9)
545 ("rust-serde" ,rust-serde-1)
546 ("rust-serde-derive" ,rust-serde-derive-1)
547 ("rust-regex" ,rust-regex-1))))
548 (home-page "https://github.com/lu-zero/cargo-c")
549 (synopsis "Build and install C-compatible libraries")
551 "This package produces and installs a correct pkg-config file, a static
552 library and a dynamic library, and a C header to be used by any C (and
553 C-compatible) software.")
554 (license license:expat)))