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, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
10 ;;; Copyright © 2021 Tobias Geerinckx-Rice <me@tobias.gr>
12 ;;; This file is part of GNU Guix.
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27 (define-module (gnu packages rust-apps)
28 #:use-module ((guix licenses) #:prefix license:)
29 #:use-module (guix build-system cargo)
30 #:use-module (guix download)
31 #:use-module (guix packages)
32 #:use-module (gnu packages compression)
33 #:use-module (gnu packages crates-io)
34 #:use-module (gnu packages crates-graphics)
35 #:use-module (gnu packages documentation)
36 #:use-module (gnu packages jemalloc)
37 #:use-module (gnu packages pcre)
38 #:use-module (gnu packages pkg-config)
39 #:use-module (gnu packages tls)
40 #:use-module (gnu packages version-control))
49 (uri (crate-uri "bat" version))
50 (file-name (string-append name "-" version ".tar.gz"))
52 (base32 "1ia12774prjnm3msiaja6qdpxkpyknxswqpgkmwzj0wn9nhkc7nz"))))
53 (build-system cargo-build-system)
56 (("rust-ansi-colours" ,rust-ansi-colours-1)
57 ("rust-ansi-term" ,rust-ansi-term-0.12)
58 ("rust-atty" ,rust-atty-0.2)
59 ("rust-clap" ,rust-clap-2)
60 ("rust-console" ,rust-console-0.13)
61 ("rust-content-inspector" ,rust-content-inspector-0.2)
62 ("rust-dirs" ,rust-dirs-3)
63 ("rust-encoding" ,rust-encoding-0.2)
64 ("rust-error-chain" ,rust-error-chain-0.12)
65 ("rust-git2" ,rust-git2-0.13)
66 ("rust-globset" ,rust-globset-0.4)
67 ("rust-lazy-static" ,rust-lazy-static-1)
68 ("rust-path-abs" ,rust-path-abs-0.5)
69 ("rust-semver" ,rust-semver-0.11)
70 ("rust-serde" ,rust-serde-1)
71 ("rust-serde-yaml" ,rust-serde-yaml-0.8)
72 ("rust-shell-words" ,rust-shell-words-1)
73 ("rust-syntect" ,rust-syntect-4)
74 ("rust-unicode-width" ,rust-unicode-width-0.1)
75 ("rust-wild" ,rust-wild-2))
76 #:cargo-development-inputs
77 (("rust-assert-cmd" ,rust-assert-cmd-1)
78 ("rust-predicates" ,rust-predicates-1)
79 ("rust-tempdir" ,rust-tempdir-0.3))))
81 `(("pkg-config" ,pkg-config)))
83 `(("libgit2" ,libgit2)
85 (home-page "https://github.com/sharkdp/bat")
86 (synopsis "@command{cat} clone with syntax highlighting and git integration")
88 "@command{bat} is a drop-in @command{cat} replacement featuring syntax
89 highlighting for a large number of languages, git integration, and automatic
91 (license (list license:expat license:asl2.0))))
100 (uri (crate-uri "exa" version))
102 (string-append name "-" version ".tar.gz"))
105 "1s902xgplz1167k0r7x235p914lprpsqy2if0kpa1mlb0fswqqq4"))))
106 (build-system cargo-build-system)
109 (("rust-ansi-term" ,rust-ansi-term-0.12)
110 ("rust-datetime" ,rust-datetime-0.4)
111 ("rust-env-logger" ,rust-env-logger-0.6)
112 ("rust-git2" ,rust-git2-0.9)
113 ("rust-glob" ,rust-glob-0.3)
114 ("rust-lazy-static" ,rust-lazy-static-1)
115 ("rust-libc" ,rust-libc-0.2)
116 ("rust-locale" ,rust-locale-0.2)
117 ("rust-log" ,rust-log-0.4)
118 ("rust-natord" ,rust-natord-1.0)
119 ("rust-num-cpus" ,rust-num-cpus-1)
120 ("rust-number-prefix" ,rust-number-prefix-0.3)
121 ("rust-scoped-threadpool" ,rust-scoped-threadpool-0.1)
122 ("rust-term-grid" ,rust-term-grid-0.1)
123 ("rust-term-size" ,rust-term-size-0.3)
124 ("rust-unicode-width" ,rust-unicode-width-0.1)
125 ("rust-users" ,rust-users-0.9)
126 ("rust-zoneinfo-compiled" ,rust-zoneinfo-compiled-0.4))
127 #:cargo-development-inputs
128 (("rust-datetime" ,rust-datetime-0.4))
130 (modify-phases %standard-phases
131 ;; Ignoring failing tests.
132 ;; Reported in https://github.com/ogham/exa/issues/318
133 (add-before 'check 'disable-failing-tests
135 (substitute* "src/options/mod.rs"
136 (("^.*fn oneline_across.*" oneline-across)
137 (string-append "#[ignore]\n" oneline-across)))
139 (substitute* "src/options/view.rs"
140 (("test!\\(across:.*") "")
141 (("test!\\(cr:.*") "")
142 (("test!\\(empty:.*") "")
143 (("test!\\(gracross:.*") "")
144 (("test!\\(grid:.*") "")
145 (("test!\\(icons:.*") "")
146 (("test!\\(just_binary:.*") "")
147 (("test!\\(just_blocks:.*") "")
148 (("test!\\(just_bytes:.*") "")
149 (("test!\\(just_git:.*") "")
150 (("test!\\(just_group:.*") "")
151 (("test!\\(just_header:.*") "")
152 (("test!\\(just_inode:.*") "")
153 (("test!\\(just_links:.*") "")
154 (("test!\\(leg:.*") "")
155 (("test!\\(lid:.*") "")
156 (("test!\\(original_g:.*") ""))
158 (add-after 'install 'install-extras
159 (lambda* (#:key outputs #:allow-other-keys)
160 (let* ((out (assoc-ref outputs "out"))
161 (share (string-append out "/share"))
162 (man1 (string-append share "/man/man1")))
163 (install-file "contrib/man/exa.1" man1)
164 (mkdir-p (string-append out "/etc/bash_completion.d"))
165 (mkdir-p (string-append share "/fish/vendor_completions.d"))
166 (mkdir-p (string-append share "/zsh/site-functions"))
167 (copy-file "contrib/completions.bash"
168 (string-append out "/etc/bash_completion.d/exa"))
169 (copy-file "contrib/completions.fish"
170 (string-append share "/fish/vendor_completions.d/exa.fish"))
171 (copy-file "contrib/completions.zsh"
172 (string-append share "/zsh/site-functions/_exa"))
175 `(("libgit2" ,libgit2)
178 `(("pkg-config" ,pkg-config)))
179 (home-page "https://the.exa.website/")
180 (synopsis "Modern replacement for ls")
181 (description "@code{exa} is a modern replacement for the command-line
182 program @code{ls}. It uses colours to distinguish file types and metadata. It
183 also knows about symlinks, extended attributes, and Git.")
184 (license license:expat)))
193 (uri (crate-uri "fd-find" version))
195 (string-append name "-" version ".tar.gz"))
198 "124a5r8hpk2phs1288jybh34d48yxy44wr7gv5ggchs272gs2jam"))))
199 (build-system cargo-build-system)
202 (("rust-ansi-term" ,rust-ansi-term-0.12)
203 ("rust-anyhow" ,rust-anyhow-1.0)
204 ("rust-atty" ,rust-atty-0.2)
205 ("rust-clap" ,rust-clap-2)
206 ("rust-ctrlc" ,rust-ctrlc-3.1)
207 ("rust-dirs" ,rust-dirs-2.0)
208 ("rust-globset" ,rust-globset-0.4)
209 ("rust-humantime" ,rust-humantime-2)
210 ("rust-ignore" ,rust-ignore-0.4)
211 ("rust-jemallocator" ,rust-jemallocator-0.3)
212 ("rust-lazy-static" ,rust-lazy-static-1)
213 ("rust-libc" ,rust-libc-0.2)
214 ("rust-lscolors" ,rust-lscolors-0.7)
215 ("rust-num-cpus" ,rust-num-cpus-1)
216 ("rust-regex" ,rust-regex-1)
217 ("rust-regex-syntax" ,rust-regex-syntax-0.6)
218 ("rust-users" ,rust-users-0.10)
219 ("rust-version-check" ,rust-version-check-0.9))
220 #:cargo-development-inputs
221 (("rust-diff" ,rust-diff-0.1)
222 ("rust-filetime" ,rust-filetime-0.2)
223 ("rust-tempdir" ,rust-tempdir-0.3))
225 (modify-phases %standard-phases
226 (add-after 'unpack 'override-jemalloc
227 (lambda* (#:key inputs #:allow-other-keys)
228 (let ((jemalloc (assoc-ref inputs "jemalloc")))
229 (setenv "JEMALLOC_OVERRIDE"
230 (string-append jemalloc "/lib/libjemalloc.so")))
232 (add-after 'install 'install-extra
233 (lambda* (#:key outputs #:allow-other-keys)
234 (let* ((out (assoc-ref outputs "out"))
236 (lambda (completion out-dir)
239 (install-file f (string-append out out-dir)))
240 (find-files "target/release/build/" completion)))))
242 (install-file "doc/fd.1" (string-append out "/share/man/man1"))
244 (install-completion "^fd.bash$" "/etc/bash_completion.d")
245 (install-completion "^fd.fish$" "/share/fish/vendor_completions.d")
246 (install-completion "^_fd$" "/share/zsh/site-functions")
247 (rename-file (string-append out "/etc/bash_completion.d/fd.bash")
248 (string-append out "/etc/bash_completion.d/fd"))
250 (inputs `(("jemalloc" ,jemalloc)))
251 (home-page "https://github.com/sharkdp/fd")
252 (synopsis "Simple, fast and user-friendly alternative to find")
254 "@code{fd} is a simple, fast and user-friendly alternative to @code{find}.
255 While it does not seek to mirror all of find's powerful functionality, it
256 provides defaults for 80% of the use cases.")
257 (license (list license:expat license:asl2.0))))
266 (uri (crate-uri "hexyl" version))
268 (string-append name "-" version ".tar.gz"))
271 "0sipag77196467idbznbk5q5lwhqz85zw7y1pwg9b27jxqyk04rp"))))
272 (build-system cargo-build-system)
275 (("rust-ansi-term" ,rust-ansi-term-0.12)
276 ("rust-atty" ,rust-atty-0.2)
277 ("rust-clap" ,rust-clap-2)
278 ("rust-libc" ,rust-libc-0.2))))
279 (home-page "https://github.com/sharkdp/hexyl")
280 (synopsis "Command-line hex viewer")
282 "This package provides a command line hex viewer. It uses a colored output
283 for distinguishing different kinds of bytes such as NULL bytes, printable ASCII
284 characters, ASCII whitespace characters, other ASCII characters and non-ASCII.")
285 (license (list license:expat license:asl2.0))))
287 (define-public ripgrep
294 (uri (crate-uri "ripgrep" version))
296 (string-append name "-" version ".tar.gz"))
299 "1grfi0j9zczzipipc21lkdbqmd2lvy2wlqy65fy4sckqvix5amdr"))))
300 (build-system cargo-build-system)
303 (("rust-bstr" ,rust-bstr-0.2)
304 ("rust-clap" ,rust-clap-2)
305 ("rust-grep" ,rust-grep-0.2)
306 ("rust-ignore" ,rust-ignore-0.4)
307 ("rust-jemallocator" ,rust-jemallocator-0.3)
308 ("rust-lazy-static" ,rust-lazy-static-1)
309 ("rust-log" ,rust-log-0.4)
310 ("rust-num-cpus" ,rust-num-cpus-1)
311 ("rust-regex" ,rust-regex-1)
312 ("rust-serde-json" ,rust-serde-json-1)
313 ("rust-termcolor" ,rust-termcolor-1))
314 #:cargo-development-inputs
315 (("rust-serde" ,rust-serde-1)
316 ("rust-serde-derive" ,rust-serde-derive-1))
317 #:modules ((ice-9 match)
318 (guix build cargo-build-system)
321 (modify-phases %standard-phases
322 (add-after 'build 'install-manpage
323 ;; NOTE: This is done before 'check so that there's only one output
324 ;; directory with the man page.
325 (lambda* (#:key outputs #:allow-other-keys)
326 (match (find-files "target" "^rg\\.1$")
328 (install-file manpage (string-append
329 (assoc-ref outputs "out")
330 "/share/man/man1"))))
332 #:features '("pcre2")))
334 `(("asciidoc" ,asciidoc)
336 ("pkg-config" ,pkg-config)))
337 (home-page "https://github.com/BurntSushi/ripgrep")
338 (synopsis "Line-oriented search tool")
340 "ripgrep is a line-oriented search tool that recursively searches
341 your current directory for a regex pattern while respecting your
343 (license (list license:unlicense license:expat))))
345 (define-public rust-cbindgen
347 (name "rust-cbindgen")
352 (uri (crate-uri "cbindgen" version))
353 (file-name (string-append name "-" version ".crate"))
356 "0673pq96hs7waavkv58v2pakpxpsfyjvbraa5kyl2b44phgdzcid"))))
357 (build-system cargo-build-system)
360 (("clap" ,rust-clap-2)
361 ("log" ,rust-log-0.4)
362 ("proc-macro2" ,rust-proc-macro2-1)
363 ("quote" ,rust-quote-1)
364 ("serde" ,rust-serde-1)
365 ("serde-json" ,rust-serde-json-1)
367 ("tempfile" ,rust-tempfile-3)
368 ("toml" ,rust-toml-0.5))))
369 (home-page "https://github.com/eqrion/cbindgen/")
370 (synopsis "Tool for generating C bindings to Rust code")
372 "This package provides a tool for generating C/C++ bindings to Rust code.")
373 (license license:mpl2.0)))
375 (define-public rust-cbindgen-0.16
377 (inherit rust-cbindgen)
378 (name "rust-cbindgen")
383 (uri (crate-uri "cbindgen" version))
384 (file-name (string-append name "-" version ".tar.gz"))
386 (base32 "049cai626nzw0km03parx4sxwaxgbr7i5ifjbjwnfxkqkj5k2i4k"))))
388 `(#:tests? #false ;missing files
390 (("rust-clap" ,rust-clap-2)
391 ("rust-heck" ,rust-heck-0.3)
392 ("rust-indexmap" ,rust-indexmap-1)
393 ("rust-log" ,rust-log-0.4)
394 ("rust-proc-macro2" ,rust-proc-macro2-1)
395 ("rust-quote" ,rust-quote-1)
396 ("rust-serde" ,rust-serde-1)
397 ("rust-serde-json" ,rust-serde-json-1)
398 ("rust-syn" ,rust-syn-1)
399 ("rust-tempfile" ,rust-tempfile-3)
400 ("rust-toml" ,rust-toml-0.5))
401 #:cargo-development-inputs
402 (("rust-serial-test" ,rust-serial-test-0.5))))))
404 (define-public rust-cbindgen-0.14
406 (inherit rust-cbindgen)
407 (name "rust-cbindgen")
412 (uri (crate-uri "cbindgen" version))
414 (string-append name "-" version ".tar.gz"))
417 "1ppwqbzydxlg9a24lynzfk60xrvqw4k31mpz1wrk6lbf88zf8nxi"))))))
419 (define-public rust-cbindgen-0.12
421 (inherit rust-cbindgen)
422 (name "rust-cbindgen")
427 (uri (crate-uri "cbindgen" version))
429 (string-append name "-" version ".tar.gz"))
432 "13jzbmjz1bmmfr0i80hw6ar484mgabx3hbpb2ynhk0ddqi0yr58m"))))))
441 (uri (crate-uri "tokei" version))
443 (string-append name "-" version ".tar.gz"))
446 "07f5laqw2k9l3k8wrg9h8p2m5d9hkfxngyacwrn3vs7mlnw8l81m"))))
447 (build-system cargo-build-system)
450 (("rust-clap" ,rust-clap-2)
451 ("rust-crossbeam-channel" ,rust-crossbeam-channel-0.4)
452 ("rust-dirs" ,rust-dirs-2.0)
453 ("rust-encoding-rs-io" ,rust-encoding-rs-io-0.1)
454 ("rust-env-logger" ,rust-env-logger-0.7)
455 ("rust-grep-searcher" ,rust-grep-searcher-0.1)
456 ("rust-hex" ,rust-hex-0.4)
457 ("rust-ignore" ,rust-ignore-0.4)
458 ("rust-log" ,rust-log-0.4)
459 ("rust-rayon" ,rust-rayon-1)
460 ("rust-serde" ,rust-serde-1)
461 ("rust-serde-cbor" ,rust-serde-cbor-0.10)
462 ("rust-serde-derive" ,rust-serde-derive-1)
463 ("rust-serde-json" ,rust-serde-json-1)
464 ("rust-serde-yaml" ,rust-serde-yaml-0.8)
465 ("rust-term-size" ,rust-term-size-0.3)
466 ("rust-toml" ,rust-toml-0.5))
467 #:cargo-development-inputs
468 (("rust-git2" ,rust-git2-0.11)
469 ("rust-handlebars" ,rust-handlebars-2.0)
470 ("rust-ignore" ,rust-ignore-0.4)
471 ("rust-lazy-static" ,rust-lazy-static-1)
472 ("rust-regex" ,rust-regex-1)
473 ("rust-serde-json" ,rust-serde-json-1)
474 ("rust-tempfile" ,rust-tempfile-3))))
476 `(("pkg-config" ,pkg-config)))
478 `(("libgit2" ,libgit2)
481 (home-page "https://tokei.rs")
482 (synopsis "Count code, quickly")
484 "Tokei is a program that displays statistics about your code. Tokei will
485 show number of files, total lines within those files and code, comments, and
486 blanks grouped by language.")
487 (license (list license:expat license:asl2.0))))
489 (define-public watchexec
496 (uri (crate-uri "watchexec" version))
498 (string-append name "-" version ".tar.gz"))
500 (base32 "1vqaa462sjpzi0crh12ixqc2wa5bblirc129pnj8jr8iz3xw3gvd"))))
501 (build-system cargo-build-system)
504 (modify-phases %standard-phases
505 (add-after 'install 'install-completions
506 (lambda* (#:key outputs #:allow-other-keys)
507 (let* ((out (assoc-ref outputs "out"))
508 (zsh (string-append out "/share/zsh/site-functions/_watchexec"))
509 (doc (string-append out "/share/doc/watchexec-" ,version)))
510 (mkdir-p (dirname zsh))
511 (copy-file "completions/zsh" zsh)
512 (install-file "README.md" doc)
515 (("rust-embed-resource" ,rust-embed-resource-1.3)
516 ("rust-derive-builder" ,rust-derive-builder-0.9)
517 ("rust-env-logger" ,rust-env-logger-0.7)
518 ("rust-glob" ,rust-glob-0.3)
519 ("rust-globset" ,rust-globset-0.4)
520 ("rust-lazy-static" ,rust-lazy-static-1)
521 ("rust-log" ,rust-log-0.4)
522 ("rust-nix" ,rust-nix-0.17)
523 ("rust-notify" ,rust-notify-4)
524 ("rust-walkdir" ,rust-walkdir-2))))
525 (home-page "https://github.com/watchexec/watchexec")
526 (synopsis "Executes commands in response to file modifications")
528 "@command{watchexec} is a simple, standalone tool that watches a path and runs
529 a command whenever it detects modifications.
533 @item Automatically run unit tests
534 @item Run linters/syntax checkers
539 @item Coalesces multiple file system events into one, for editors that
540 use swap/backup files during saving
541 @item By default, uses @code{.gitignore} and @code{.ignore} to determine which
542 files to ignore notifications for
543 @item Supports watching files with a specific extension
544 @item Supports filtering/ignoring events based on glob patterns
545 @item Launches child processes in a new process group
546 @item Sets environment variables that allow the executed program to learn
547 the details of how it was triggered.
549 (license license:asl2.0)))
551 (define-public rust-cargo-c
553 (name "rust-cargo-c")
558 (uri (crate-uri "cargo-c" version))
560 (string-append name "-" version ".tar.gz"))
563 "0hsag5g4qngm8alfil2dyvl5sagpqi5nb40c7bhwng2z8mv9r41k"))))
564 (build-system cargo-build-system)
567 (("rust-cbindgen" ,rust-cbindgen)
568 ("rust-pretty-env-logger" ,rust-pretty-env-logger-0.4)
569 ("rust-structopt" ,rust-structopt-0.3)
570 ("rust-log" ,rust-log-0.4)
571 ("rust-toml" ,rust-toml-0.5)
572 ("rust-cargo-metadata" ,rust-cargo-metadata-0.9)
573 ("rust-serde" ,rust-serde-1)
574 ("rust-serde-derive" ,rust-serde-derive-1)
575 ("rust-regex" ,rust-regex-1))))
576 (home-page "https://github.com/lu-zero/cargo-c")
577 (synopsis "Build and install C-compatible libraries")
579 "This package produces and installs a correct pkg-config file, a static
580 library and a dynamic library, and a C header to be used by any C (and
581 C-compatible) software.")
582 (license license:expat)))