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>
10 ;;; This file is part of GNU Guix.
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25 (define-module (gnu packages rust-apps)
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module (guix build-system cargo)
28 #:use-module (guix download)
29 #:use-module (guix packages)
30 #:use-module (gnu packages compression)
31 #:use-module (gnu packages crates-io)
32 #:use-module (gnu packages documentation)
33 #:use-module (gnu packages jemalloc)
34 #:use-module (gnu packages pcre)
35 #:use-module (gnu packages pkg-config)
36 #:use-module (gnu packages tls)
37 #:use-module (gnu packages version-control))
46 (uri (crate-uri "exa" version))
48 (string-append name "-" version ".tar.gz"))
51 "1s902xgplz1167k0r7x235p914lprpsqy2if0kpa1mlb0fswqqq4"))))
52 (build-system cargo-build-system)
55 (("rust-ansi-term" ,rust-ansi-term-0.12)
56 ("rust-datetime" ,rust-datetime-0.4)
57 ("rust-env-logger" ,rust-env-logger-0.6)
58 ("rust-git2" ,rust-git2-0.9)
59 ("rust-glob" ,rust-glob-0.3)
60 ("rust-lazy-static" ,rust-lazy-static-1)
61 ("rust-libc" ,rust-libc-0.2)
62 ("rust-locale" ,rust-locale-0.2)
63 ("rust-log" ,rust-log-0.4)
64 ("rust-natord" ,rust-natord-1.0)
65 ("rust-num-cpus" ,rust-num-cpus-1)
66 ("rust-number-prefix" ,rust-number-prefix-0.3)
67 ("rust-scoped-threadpool" ,rust-scoped-threadpool-0.1)
68 ("rust-term-grid" ,rust-term-grid-0.1)
69 ("rust-term-size" ,rust-term-size-0.3)
70 ("rust-unicode-width" ,rust-unicode-width-0.1)
71 ("rust-users" ,rust-users-0.9)
72 ("rust-zoneinfo-compiled" ,rust-zoneinfo-compiled-0.4))
73 #:cargo-development-inputs
74 (("rust-datetime" ,rust-datetime-0.4))
76 (modify-phases %standard-phases
77 (add-after 'configure 'dont-vendor-sources
78 (lambda* (#:key inputs #:allow-other-keys)
79 (let ((openssl (assoc-ref inputs "openssl")))
80 (setenv "OPENSSL_DIR" openssl))
82 ;; Ignoring failing tests.
83 ;; Reported in https://github.com/ogham/exa/issues/318
84 (add-before 'check 'disable-failing-tests
86 (substitute* "src/options/mod.rs"
87 (("^.*fn oneline_across.*" oneline-across)
88 (string-append "#[ignore]\n" oneline-across)))
90 (substitute* "src/options/view.rs"
91 (("test!\\(across:.*") "")
92 (("test!\\(empty:.*") "")
93 (("test!\\(gracross:.*") "")
94 (("test!\\(grid:.*") "")
95 (("test!\\(icons:.*") "")
96 (("test!\\(just_binary:.*") "")
97 (("test!\\(just_blocks:.*") "")
98 (("test!\\(just_bytes:.*") "")
99 (("test!\\(just_git:.*") "")
100 (("test!\\(just_group:.*") "")
101 (("test!\\(just_header:.*") "")
102 (("test!\\(just_inode:.*") "")
103 (("test!\\(just_links:.*") "")
104 (("test!\\(leg:.*") "")
105 (("test!\\(lid:.*") "")
106 (("test!\\(original_g:.*") ""))
108 (add-after 'install 'install-extras
109 (lambda* (#:key outputs #:allow-other-keys)
110 (let* ((out (assoc-ref outputs "out"))
111 (share (string-append out "/share"))
112 (man1 (string-append share "/man/man1")))
113 (install-file "contrib/man/exa.1" man1)
114 (mkdir-p (string-append out "/etc/bash_completion.d"))
115 (mkdir-p (string-append share "/fish/vendor_completions.d"))
116 (mkdir-p (string-append share "/zsh/site-functions"))
117 (copy-file "contrib/completions.bash"
118 (string-append out "/etc/bash_completion.d/exa"))
119 (copy-file "contrib/completions.fish"
120 (string-append share "/fish/vendor_completions.d/exa.fish"))
121 (copy-file "contrib/completions.zsh"
122 (string-append share "/zsh/site-functions/_exa"))
125 `(("libgit2" ,libgit2)
128 `(("pkg-config" ,pkg-config)))
129 (home-page "https://the.exa.website/")
130 (synopsis "Modern replacement for ls")
131 (description "@code{exa} is a modern replacement for the command-line
132 program @code{ls}. It uses colours to distinguish file types and metadata. It
133 also knows about symlinks, extended attributes, and Git.")
134 (license license:expat)))
143 (uri (crate-uri "fd-find" version))
145 (string-append name "-" version ".tar.gz"))
148 "124a5r8hpk2phs1288jybh34d48yxy44wr7gv5ggchs272gs2jam"))))
149 (build-system cargo-build-system)
152 (("rust-ansi-term" ,rust-ansi-term-0.12)
153 ("rust-anyhow" ,rust-anyhow-1.0)
154 ("rust-atty" ,rust-atty-0.2)
155 ("rust-clap" ,rust-clap-2)
156 ("rust-ctrlc" ,rust-ctrlc-3.1)
157 ("rust-dirs" ,rust-dirs-2.0)
158 ("rust-globset" ,rust-globset-0.4)
159 ("rust-humantime" ,rust-humantime-2)
160 ("rust-ignore" ,rust-ignore-0.4)
161 ("rust-jemallocator" ,rust-jemallocator-0.3)
162 ("rust-lazy-static" ,rust-lazy-static-1)
163 ("rust-libc" ,rust-libc-0.2)
164 ("rust-lscolors" ,rust-lscolors-0.7)
165 ("rust-num-cpus" ,rust-num-cpus-1)
166 ("rust-regex" ,rust-regex-1)
167 ("rust-regex-syntax" ,rust-regex-syntax-0.6)
168 ("rust-users" ,rust-users-0.10)
169 ("rust-version-check" ,rust-version-check-0.9))
170 #:cargo-development-inputs
171 (("rust-diff" ,rust-diff-0.1)
172 ("rust-filetime" ,rust-filetime-0.2)
173 ("rust-tempdir" ,rust-tempdir-0.3))
175 (modify-phases %standard-phases
176 (add-after 'unpack 'override-jemalloc
177 (lambda* (#:key inputs #:allow-other-keys)
178 (let ((jemalloc (assoc-ref inputs "jemalloc")))
179 (setenv "JEMALLOC_OVERRIDE"
180 (string-append jemalloc "/lib/libjemalloc.so")))
182 (add-after 'install 'install-extra
183 (lambda* (#:key outputs #:allow-other-keys)
184 (let* ((out (assoc-ref outputs "out"))
186 (lambda (completion out-dir)
189 (install-file f (string-append out out-dir)))
190 (find-files "target/release/build/" completion)))))
192 (install-file "doc/fd.1" (string-append out "/share/man/man1"))
194 (install-completion "^fd.bash$" "/etc/bash_completion.d")
195 (install-completion "^fd.fish$" "/share/fish/vendor_completions.d")
196 (install-completion "^_fd$" "/share/zsh/site-functions")
197 (rename-file (string-append out "/etc/bash_completion.d/fd.bash")
198 (string-append out "/etc/bash_completion.d/fd"))
200 (inputs `(("jemalloc" ,jemalloc)))
201 (home-page "https://github.com/sharkdp/fd")
202 (synopsis "Simple, fast and user-friendly alternative to find")
204 "@code{fd} is a simple, fast and user-friendly alternative to @code{find}.
205 While it does not seek to mirror all of find's powerful functionality, it
206 provides defaults for 80% of the use cases.")
207 (license (list license:expat license:asl2.0))))
216 (uri (crate-uri "hexyl" version))
218 (string-append name "-" version ".tar.gz"))
221 "0sipag77196467idbznbk5q5lwhqz85zw7y1pwg9b27jxqyk04rp"))))
222 (build-system cargo-build-system)
225 (("rust-ansi-term" ,rust-ansi-term-0.12)
226 ("rust-atty" ,rust-atty-0.2)
227 ("rust-clap" ,rust-clap-2)
228 ("rust-libc" ,rust-libc-0.2))))
229 (home-page "https://github.com/sharkdp/hexyl")
230 (synopsis "Command-line hex viewer")
232 "This package provides a command line hex viewer. It uses a colored output
233 for distinguishing different kinds of bytes such as NULL bytes, printable ASCII
234 characters, ASCII whitespace characters, other ASCII characters and non-ASCII.")
235 (license (list license:expat license:asl2.0))))
237 (define-public ripgrep
244 (uri (crate-uri "ripgrep" version))
246 (string-append name "-" version ".tar.gz"))
249 "1grfi0j9zczzipipc21lkdbqmd2lvy2wlqy65fy4sckqvix5amdr"))))
250 (build-system cargo-build-system)
253 (("rust-bstr" ,rust-bstr-0.2)
254 ("rust-clap" ,rust-clap-2)
255 ("rust-grep" ,rust-grep-0.2)
256 ("rust-ignore" ,rust-ignore-0.4)
257 ("rust-jemallocator" ,rust-jemallocator-0.3)
258 ("rust-lazy-static" ,rust-lazy-static-1)
259 ("rust-log" ,rust-log-0.4)
260 ("rust-num-cpus" ,rust-num-cpus-1)
261 ("rust-regex" ,rust-regex-1)
262 ("rust-serde-json" ,rust-serde-json-1)
263 ("rust-termcolor" ,rust-termcolor-1))
264 #:cargo-development-inputs
265 (("rust-serde" ,rust-serde-1)
266 ("rust-serde-derive" ,rust-serde-derive-1))
267 #:modules ((ice-9 match)
268 (guix build cargo-build-system)
271 (modify-phases %standard-phases
272 (add-after 'build 'install-manpage
273 ;; NOTE: This is done before 'check so that there's only one output
274 ;; directory with the man page.
275 (lambda* (#:key outputs #:allow-other-keys)
276 (match (find-files "target" "^rg\\.1$")
278 (install-file manpage (string-append
279 (assoc-ref outputs "out")
280 "/share/man/man1"))))
282 #:features '("pcre2")))
284 `(("asciidoc" ,asciidoc)
286 ("pkg-config" ,pkg-config)))
287 (home-page "https://github.com/BurntSushi/ripgrep")
288 (synopsis "Line-oriented search tool")
290 "ripgrep is a line-oriented search tool that recursively searches
291 your current directory for a regex pattern while respecting your
293 (license (list license:unlicense license:expat))))
295 (define-public rust-cbindgen
297 (name "rust-cbindgen")
302 (uri (crate-uri "cbindgen" version))
303 (file-name (string-append name "-" version ".crate"))
306 "0673pq96hs7waavkv58v2pakpxpsfyjvbraa5kyl2b44phgdzcid"))))
307 (build-system cargo-build-system)
310 (("clap" ,rust-clap-2)
311 ("log" ,rust-log-0.4)
312 ("proc-macro2" ,rust-proc-macro2-1)
313 ("quote" ,rust-quote-1)
314 ("serde" ,rust-serde-1)
315 ("serde-json" ,rust-serde-json-1)
317 ("tempfile" ,rust-tempfile-3)
318 ("toml" ,rust-toml-0.5))))
319 (home-page "https://github.com/eqrion/cbindgen/")
320 (synopsis "Tool for generating C bindings to Rust code")
322 "This package provides a tool for generating C/C++ bindings to Rust code.")
323 (license license:mpl2.0)))
325 (define-public rust-cbindgen-0.14
327 (inherit rust-cbindgen)
328 (name "rust-cbindgen")
333 (uri (crate-uri "cbindgen" version))
335 (string-append name "-" version ".tar.gz"))
338 "1ppwqbzydxlg9a24lynzfk60xrvqw4k31mpz1wrk6lbf88zf8nxi"))))))
340 (define-public rust-cbindgen-0.12
342 (inherit rust-cbindgen)
343 (name "rust-cbindgen")
348 (uri (crate-uri "cbindgen" version))
350 (string-append name "-" version ".tar.gz"))
353 "13jzbmjz1bmmfr0i80hw6ar484mgabx3hbpb2ynhk0ddqi0yr58m"))))))
362 (uri (crate-uri "tokei" version))
364 (string-append name "-" version ".tar.gz"))
367 "07f5laqw2k9l3k8wrg9h8p2m5d9hkfxngyacwrn3vs7mlnw8l81m"))))
368 (build-system cargo-build-system)
371 (("rust-clap" ,rust-clap-2)
372 ("rust-crossbeam-channel" ,rust-crossbeam-channel-0.4)
373 ("rust-dirs" ,rust-dirs-2.0)
374 ("rust-encoding-rs-io" ,rust-encoding-rs-io-0.1)
375 ("rust-env-logger" ,rust-env-logger-0.7)
376 ("rust-grep-searcher" ,rust-grep-searcher-0.1)
377 ("rust-hex" ,rust-hex-0.4)
378 ("rust-ignore" ,rust-ignore-0.4)
379 ("rust-log" ,rust-log-0.4)
380 ("rust-rayon" ,rust-rayon-1)
381 ("rust-serde" ,rust-serde-1)
382 ("rust-serde-cbor" ,rust-serde-cbor-0.10)
383 ("rust-serde-derive" ,rust-serde-derive-1)
384 ("rust-serde-json" ,rust-serde-json-1)
385 ("rust-serde-yaml" ,rust-serde-yaml-0.8)
386 ("rust-term-size" ,rust-term-size-0.3)
387 ("rust-toml" ,rust-toml-0.5))
388 #:cargo-development-inputs
389 (("rust-git2" ,rust-git2-0.11)
390 ("rust-handlebars" ,rust-handlebars-2.0)
391 ("rust-ignore" ,rust-ignore-0.4)
392 ("rust-lazy-static" ,rust-lazy-static-1)
393 ("rust-regex" ,rust-regex-1)
394 ("rust-serde-json" ,rust-serde-json-1)
395 ("rust-tempfile" ,rust-tempfile-3))
397 (modify-phases %standard-phases
398 (add-after 'configure 'unvendor-libraries-from-crates
399 (lambda* (#:key inputs #:allow-other-keys)
400 (let ((openssl (assoc-ref inputs "openssl")))
401 (setenv "OPENSSL_DIR" openssl))
404 `(("libgit2" ,libgit2)
406 ("pkg-config" ,pkg-config)
408 (home-page "https://tokei.rs")
409 (synopsis "Count code, quickly")
411 "Tokei is a program that displays statistics about your code. Tokei will
412 show number of files, total lines within those files and code, comments, and
413 blanks grouped by language.")
414 (license (list license:expat license:asl2.0))))
416 (define-public watchexec
423 (uri (crate-uri "watchexec" version))
425 (string-append name "-" version ".tar.gz"))
428 "0bwgqb5fvyqbf2lf0005fxzpbpbwbszc7144g3kg2cmzy5cbrf0w"))))
429 (build-system cargo-build-system)
432 (modify-phases %standard-phases
433 (add-after 'install 'install-completions
434 (lambda* (#:key outputs #:allow-other-keys)
435 (let* ((out (assoc-ref outputs "out"))
436 (zsh (string-append out "/share/zsh/site-functions/_watchexec"))
437 (doc (string-append out "/share/doc/watchexec-" ,version)))
438 (mkdir-p (dirname zsh))
439 (copy-file "completions/zsh" zsh)
440 (install-file "README.md" doc)
443 (("rust-clap" ,rust-clap-2)
444 ("rust-derive-builder" ,rust-derive-builder-0.9)
445 ("rust-env-logger" ,rust-env-logger-0.7)
446 ("rust-glob" ,rust-glob-0.3)
447 ("rust-globset" ,rust-globset-0.4)
448 ("rust-lazy-static" ,rust-lazy-static-1)
449 ("rust-log" ,rust-log-0.4)
450 ("rust-nix" ,rust-nix-0.17)
451 ("rust-notify" ,rust-notify-4)
452 ("rust-walkdir" ,rust-walkdir-2)
453 ("rust-winapi" ,rust-winapi-0.3))))
454 (home-page "https://github.com/watchexec/watchexec")
455 (synopsis "Executes commands in response to file modifications")
457 "@command{watchexec} is a simple, standalone tool that watches a path and runs
458 a command whenever it detects modifications.
462 @item Automatically run unit tests
463 @item Run linters/syntax checkers
468 @item Coalesces multiple filesystem events into one, for editors that
469 use swap/backup files during saving
470 @item By default, uses @code{.gitignore} and @code{.ignore} to determine which
471 files to ignore notifications for
472 @item Supports watching files with a specific extension
473 @item Supports filtering/ignoring events based on glob patterns
474 @item Launches child processes in a new process group
475 @item Sets environment variables that allow the executed program to learn
476 the details of how it was triggered.
478 (license license:asl2.0)))
480 (define-public rust-cargo-c
482 (name "rust-cargo-c")
487 (uri (crate-uri "cargo-c" version))
489 (string-append name "-" version ".tar.gz"))
492 "0hsag5g4qngm8alfil2dyvl5sagpqi5nb40c7bhwng2z8mv9r41k"))))
493 (build-system cargo-build-system)
496 (("rust-cbindgen" ,rust-cbindgen)
497 ("rust-pretty-env-logger" ,rust-pretty-env-logger-0.4)
498 ("rust-structopt" ,rust-structopt-0.3)
499 ("rust-log" ,rust-log-0.4)
500 ("rust-toml" ,rust-toml-0.5)
501 ("rust-cargo-metadata" ,rust-cargo-metadata-0.9)
502 ("rust-serde" ,rust-serde-1)
503 ("rust-serde-derive" ,rust-serde-derive-1)
504 ("rust-regex" ,rust-regex-1))))
505 (home-page "https://github.com/lu-zero/cargo-c")
506 (synopsis "Build and install C-compatible libraries")
508 "This package produces and installs a correct pkg-config file, a static
509 library and a dynamic library, and a C header to be used by any C (and
510 C-compatible) software.")
511 (license license:expat)))