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>
8 ;;; This file is part of GNU Guix.
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23 (define-module (gnu packages rust-apps)
24 #:use-module ((guix licenses) #:prefix license:)
25 #:use-module (guix build-system cargo)
26 #:use-module (guix download)
27 #:use-module (guix packages)
28 #:use-module (gnu packages compression)
29 #:use-module (gnu packages crates-io)
30 #:use-module (gnu packages documentation)
31 #:use-module (gnu packages jemalloc)
32 #:use-module (gnu packages pcre)
33 #:use-module (gnu packages pkg-config)
34 #:use-module (gnu packages tls)
35 #:use-module (gnu packages version-control))
44 (uri (crate-uri "exa" version))
46 (string-append name "-" version ".tar.gz"))
49 "1s902xgplz1167k0r7x235p914lprpsqy2if0kpa1mlb0fswqqq4"))))
50 (build-system cargo-build-system)
53 (("rust-ansi-term" ,rust-ansi-term-0.12)
54 ("rust-datetime" ,rust-datetime-0.4)
55 ("rust-env-logger" ,rust-env-logger-0.6)
56 ("rust-git2" ,rust-git2-0.9)
57 ("rust-glob" ,rust-glob-0.3)
58 ("rust-lazy-static" ,rust-lazy-static-1)
59 ("rust-libc" ,rust-libc-0.2)
60 ("rust-locale" ,rust-locale-0.2)
61 ("rust-log" ,rust-log-0.4)
62 ("rust-natord" ,rust-natord-1.0)
63 ("rust-num-cpus" ,rust-num-cpus-1)
64 ("rust-number-prefix" ,rust-number-prefix-0.3)
65 ("rust-scoped-threadpool" ,rust-scoped-threadpool-0.1)
66 ("rust-term-grid" ,rust-term-grid-0.1)
67 ("rust-term-size" ,rust-term-size-0.3)
68 ("rust-unicode-width" ,rust-unicode-width-0.1)
69 ("rust-users" ,rust-users-0.9)
70 ("rust-zoneinfo-compiled" ,rust-zoneinfo-compiled-0.4))
71 #:cargo-development-inputs
72 (("rust-datetime" ,rust-datetime-0.4))
74 (modify-phases %standard-phases
75 (add-after 'configure 'dont-vendor-sources
76 (lambda* (#:key inputs #:allow-other-keys)
77 (let ((openssl (assoc-ref inputs "openssl")))
78 (setenv "OPENSSL_DIR" openssl))
80 ;; Ignoring failing tests.
81 ;; Reported in https://github.com/ogham/exa/issues/318
82 (add-before 'check 'disable-failing-tests
84 (substitute* "src/options/mod.rs"
85 (("^.*fn oneline_across.*" oneline-across)
86 (string-append "#[ignore]\n" oneline-across)))
88 (substitute* "src/options/view.rs"
89 (("test!\\(across:.*") "")
90 (("test!\\(empty:.*") "")
91 (("test!\\(gracross:.*") "")
92 (("test!\\(grid:.*") "")
93 (("test!\\(icons:.*") "")
94 (("test!\\(just_binary:.*") "")
95 (("test!\\(just_blocks:.*") "")
96 (("test!\\(just_bytes:.*") "")
97 (("test!\\(just_git:.*") "")
98 (("test!\\(just_group:.*") "")
99 (("test!\\(just_header:.*") "")
100 (("test!\\(just_inode:.*") "")
101 (("test!\\(just_links:.*") "")
102 (("test!\\(leg:.*") "")
103 (("test!\\(lid:.*") "")
104 (("test!\\(original_g:.*") ""))
106 (add-after 'install 'install-extras
107 (lambda* (#:key outputs #:allow-other-keys)
108 (let* ((out (assoc-ref outputs "out"))
109 (share (string-append out "/share"))
110 (man1 (string-append share "/man/man1")))
111 (install-file "contrib/man/exa.1" man1)
112 (mkdir-p (string-append out "/etc/bash_completion.d"))
113 (mkdir-p (string-append share "/fish/vendor_completions.d"))
114 (mkdir-p (string-append share "/zsh/site-functions"))
115 (copy-file "contrib/completions.bash"
116 (string-append out "/etc/bash_completion.d/exa"))
117 (copy-file "contrib/completions.fish"
118 (string-append share "/fish/vendor_completions.d/exa.fish"))
119 (copy-file "contrib/completions.zsh"
120 (string-append share "/zsh/site-functions/_exa"))
123 `(("libgit2" ,libgit2)
126 `(("pkg-config" ,pkg-config)))
127 (home-page "https://the.exa.website/")
128 (synopsis "Modern replacement for ls")
129 (description "@code{exa} is a modern replacement for the command-line
130 program @code{ls}. It uses colours to distinguish file types and metadata. It
131 also knows about symlinks, extended attributes, and Git.")
132 (license license:expat)))
141 (uri (crate-uri "fd-find" version))
143 (string-append name "-" version ".tar.gz"))
146 "124a5r8hpk2phs1288jybh34d48yxy44wr7gv5ggchs272gs2jam"))))
147 (build-system cargo-build-system)
150 (("rust-ansi-term" ,rust-ansi-term-0.12)
151 ("rust-anyhow" ,rust-anyhow-1.0)
152 ("rust-atty" ,rust-atty-0.2)
153 ("rust-clap" ,rust-clap-2)
154 ("rust-ctrlc" ,rust-ctrlc-3.1)
155 ("rust-dirs" ,rust-dirs-2.0)
156 ("rust-globset" ,rust-globset-0.4)
157 ("rust-humantime" ,rust-humantime-2)
158 ("rust-ignore" ,rust-ignore-0.4)
159 ("rust-jemallocator" ,rust-jemallocator-0.3)
160 ("rust-lazy-static" ,rust-lazy-static-1)
161 ("rust-libc" ,rust-libc-0.2)
162 ("rust-lscolors" ,rust-lscolors-0.7)
163 ("rust-num-cpus" ,rust-num-cpus-1)
164 ("rust-regex" ,rust-regex-1)
165 ("rust-regex-syntax" ,rust-regex-syntax-0.6)
166 ("rust-users" ,rust-users-0.10)
167 ("rust-version-check" ,rust-version-check-0.9))
168 #:cargo-development-inputs
169 (("rust-diff" ,rust-diff-0.1)
170 ("rust-filetime" ,rust-filetime-0.2)
171 ("rust-tempdir" ,rust-tempdir-0.3))
173 (modify-phases %standard-phases
174 (add-after 'unpack 'override-jemalloc
175 (lambda* (#:key inputs #:allow-other-keys)
176 (let ((jemalloc (assoc-ref inputs "jemalloc")))
177 (setenv "JEMALLOC_OVERRIDE"
178 (string-append jemalloc "/lib/libjemalloc.so")))
180 (add-after 'install 'install-extra
181 (lambda* (#:key outputs #:allow-other-keys)
182 (let* ((out (assoc-ref outputs "out"))
184 (lambda (completion out-dir)
187 (install-file f (string-append out out-dir)))
188 (find-files "target/release/build/" completion)))))
190 (install-file "doc/fd.1" (string-append out "/share/man/man1"))
192 (install-completion "^fd.bash$" "/etc/bash_completion.d")
193 (install-completion "^fd.fish$" "/share/fish/vendor_completions.d")
194 (install-completion "^_fd$" "/share/zsh/site-functions")
195 (rename-file (string-append out "/etc/bash_completion.d/fd.bash")
196 (string-append out "/etc/bash_completion.d/fd"))
198 (inputs `(("jemalloc" ,jemalloc)))
199 (home-page "https://github.com/sharkdp/fd")
200 (synopsis "Simple, fast and user-friendly alternative to find")
202 "@code{fd} is a simple, fast and user-friendly alternative to @code{find}.
203 While it does not seek to mirror all of find's powerful functionality, it
204 provides defaults for 80% of the use cases.")
205 (license (list license:expat license:asl2.0))))
207 (define-public ripgrep
214 (uri (crate-uri "ripgrep" version))
216 (string-append name "-" version ".tar.gz"))
219 "1grfi0j9zczzipipc21lkdbqmd2lvy2wlqy65fy4sckqvix5amdr"))))
220 (build-system cargo-build-system)
223 (("rust-bstr" ,rust-bstr-0.2)
224 ("rust-clap" ,rust-clap-2)
225 ("rust-grep" ,rust-grep-0.2)
226 ("rust-ignore" ,rust-ignore-0.4)
227 ("rust-jemallocator" ,rust-jemallocator-0.3)
228 ("rust-lazy-static" ,rust-lazy-static-1)
229 ("rust-log" ,rust-log-0.4)
230 ("rust-num-cpus" ,rust-num-cpus-1)
231 ("rust-regex" ,rust-regex-1)
232 ("rust-serde-json" ,rust-serde-json-1)
233 ("rust-termcolor" ,rust-termcolor-1))
234 #:cargo-development-inputs
235 (("rust-serde" ,rust-serde-1)
236 ("rust-serde-derive" ,rust-serde-derive-1))
237 #:modules ((ice-9 match)
238 (guix build cargo-build-system)
241 (modify-phases %standard-phases
242 (add-after 'build 'install-manpage
243 ;; NOTE: This is done before 'check so that there's only one output
244 ;; directory with the man page.
245 (lambda* (#:key outputs #:allow-other-keys)
246 (match (find-files "target" "^rg\\.1$")
248 (install-file manpage (string-append
249 (assoc-ref outputs "out")
250 "/share/man/man1"))))
252 #:features '("pcre2")))
254 `(("asciidoc" ,asciidoc)
256 ("pkg-config" ,pkg-config)))
257 (home-page "https://github.com/BurntSushi/ripgrep")
258 (synopsis "Line-oriented search tool")
260 "ripgrep is a line-oriented search tool that recursively searches
261 your current directory for a regex pattern while respecting your
263 (license (list license:unlicense license:expat))))
265 (define-public rust-cbindgen
267 (name "rust-cbindgen")
272 (uri (crate-uri "cbindgen" version))
273 (file-name (string-append name "-" version ".crate"))
276 "0673pq96hs7waavkv58v2pakpxpsfyjvbraa5kyl2b44phgdzcid"))))
277 (build-system cargo-build-system)
280 (("clap" ,rust-clap-2)
281 ("log" ,rust-log-0.4)
282 ("proc-macro2" ,rust-proc-macro2-1)
283 ("quote" ,rust-quote-1)
284 ("serde" ,rust-serde-1)
285 ("serde-json" ,rust-serde-json-1)
287 ("tempfile" ,rust-tempfile-3)
288 ("toml" ,rust-toml-0.5))))
289 (home-page "https://github.com/eqrion/cbindgen/")
290 (synopsis "Tool for generating C bindings to Rust code")
292 "This package provides a tool for generating C/C++ bindings to Rust code.")
293 (license license:mpl2.0)))
295 (define-public rust-cbindgen-0.12
297 (inherit rust-cbindgen)
298 (name "rust-cbindgen")
303 (uri (crate-uri "cbindgen" version))
305 (string-append name "-" version ".tar.gz"))
308 "13jzbmjz1bmmfr0i80hw6ar484mgabx3hbpb2ynhk0ddqi0yr58m"))))))
317 (uri (crate-uri "tokei" version))
319 (string-append name "-" version ".tar.gz"))
322 "07f5laqw2k9l3k8wrg9h8p2m5d9hkfxngyacwrn3vs7mlnw8l81m"))))
323 (build-system cargo-build-system)
326 (("rust-clap" ,rust-clap-2)
327 ("rust-crossbeam-channel" ,rust-crossbeam-channel-0.4)
328 ("rust-dirs" ,rust-dirs-2.0)
329 ("rust-encoding-rs-io" ,rust-encoding-rs-io-0.1)
330 ("rust-env-logger" ,rust-env-logger-0.7)
331 ("rust-grep-searcher" ,rust-grep-searcher-0.1)
332 ("rust-hex" ,rust-hex-0.4)
333 ("rust-ignore" ,rust-ignore-0.4)
334 ("rust-log" ,rust-log-0.4)
335 ("rust-rayon" ,rust-rayon-1)
336 ("rust-serde" ,rust-serde-1)
337 ("rust-serde-cbor" ,rust-serde-cbor-0.10)
338 ("rust-serde-derive" ,rust-serde-derive-1)
339 ("rust-serde-json" ,rust-serde-json-1)
340 ("rust-serde-yaml" ,rust-serde-yaml-0.8)
341 ("rust-term-size" ,rust-term-size-0.3)
342 ("rust-toml" ,rust-toml-0.5))
343 #:cargo-development-inputs
344 (("rust-git2" ,rust-git2-0.11)
345 ("rust-handlebars" ,rust-handlebars-2.0)
346 ("rust-ignore" ,rust-ignore-0.4)
347 ("rust-lazy-static" ,rust-lazy-static-1)
348 ("rust-regex" ,rust-regex-1)
349 ("rust-serde-json" ,rust-serde-json-1)
350 ("rust-tempfile" ,rust-tempfile-3))
352 (modify-phases %standard-phases
353 (add-after 'configure 'unvendor-libraries-from-crates
354 (lambda* (#:key inputs #:allow-other-keys)
355 (let ((openssl (assoc-ref inputs "openssl")))
356 (setenv "OPENSSL_DIR" openssl))
359 `(("libgit2" ,libgit2)
361 ("pkg-config" ,pkg-config)
363 (home-page "https://tokei.rs")
364 (synopsis "Count code, quickly")
366 "Tokei is a program that displays statistics about your code. Tokei will
367 show number of files, total lines within those files and code, comments, and
368 blanks grouped by language.")
369 (license (list license:expat license:asl2.0))))
371 (define-public watchexec
378 (uri (crate-uri "watchexec" version))
380 (string-append name "-" version ".tar.gz"))
383 "0bwgqb5fvyqbf2lf0005fxzpbpbwbszc7144g3kg2cmzy5cbrf0w"))))
384 (build-system cargo-build-system)
387 (modify-phases %standard-phases
388 (add-after 'install 'install-completions
389 (lambda* (#:key outputs #:allow-other-keys)
390 (let* ((out (assoc-ref outputs "out"))
391 (zsh (string-append out "/share/zsh/site-functions/_watchexec"))
392 (doc (string-append out "/share/doc/watchexec-" ,version)))
393 (mkdir-p (dirname zsh))
394 (copy-file "completions/zsh" zsh)
395 (install-file "README.md" doc)
398 (("rust-clap" ,rust-clap-2)
399 ("rust-derive-builder" ,rust-derive-builder-0.9)
400 ("rust-env-logger" ,rust-env-logger-0.7)
401 ("rust-glob" ,rust-glob-0.3)
402 ("rust-globset" ,rust-globset-0.4)
403 ("rust-lazy-static" ,rust-lazy-static-1)
404 ("rust-log" ,rust-log-0.4)
405 ("rust-nix" ,rust-nix-0.17)
406 ("rust-notify" ,rust-notify-4)
407 ("rust-walkdir" ,rust-walkdir-2)
408 ("rust-winapi" ,rust-winapi-0.3))))
409 (home-page "https://github.com/watchexec/watchexec")
410 (synopsis "Executes commands in response to file modifications")
412 "@command{watchexec} is a simple, standalone tool that watches a path and runs
413 a command whenever it detects modifications.
417 @item Automatically run unit tests
418 @item Run linters/syntax checkers
423 @item Coalesces multiple filesystem events into one, for editors that
424 use swap/backup files during saving
425 @item By default, uses @code{.gitignore} and @code{.ignore} to determine which
426 files to ignore notifications for
427 @item Supports watching files with a specific extension
428 @item Supports filtering/ignoring events based on glob patterns
429 @item Launches child processes in a new process group
430 @item Sets environment variables that allow the executed program to learn
431 the details of how it was triggered.
433 (license license:asl2.0)))
435 (define-public rust-cargo-c
437 (name "rust-cargo-c")
442 (uri (crate-uri "cargo-c" version))
444 (string-append name "-" version ".tar.gz"))
447 "0hsag5g4qngm8alfil2dyvl5sagpqi5nb40c7bhwng2z8mv9r41k"))))
448 (build-system cargo-build-system)
451 (("rust-cbindgen" ,rust-cbindgen)
452 ("rust-pretty-env-logger" ,rust-pretty-env-logger-0.4)
453 ("rust-structopt" ,rust-structopt-0.3)
454 ("rust-log" ,rust-log-0.4)
455 ("rust-toml" ,rust-toml-0.5)
456 ("rust-cargo-metadata" ,rust-cargo-metadata-0.9)
457 ("rust-serde" ,rust-serde-1)
458 ("rust-serde-derive" ,rust-serde-derive-1)
459 ("rust-regex" ,rust-regex-1))))
460 (home-page "https://github.com/lu-zero/cargo-c")
461 (synopsis "Build and install C-compatible libraries")
463 "This package produces and installs a correct pkg-config file, a static
464 library and a dynamic library, and a C header to be used by any C (and
465 C-compatible) software.")
466 (license license:expat)))