gnu: calibre: Wrap QTWEBENGINEPROCESS_PATH.
[jackhill/guix/guix.git] / gnu / packages / rust-apps.scm
CommitLineData
9e225670 1;;; GNU Guix --- Functional package management for GNU
e29315b2 2;;; Copyright © 2019, 2020 John Soo <jsoo1@asu.edu>
89421b7c 3;;; Copyright © 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
16ffc3b6 4;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
9eed0a74 5;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
ca4b5588 6;;; Copyright © 2020 Leo Famulari <leo@famulari.name>
cc2849bc 7;;; Copyright © 2020 Mark H Weaver <mhw@netris.org>
9e225670
JS
8;;;
9;;; This file is part of GNU Guix.
10;;;
11;;; GNU Guix is free software; you can redistribute it and/or modify it
12;;; under the terms of the GNU General Public License as published by
13;;; the Free Software Foundation; either version 3 of the License, or (at
14;;; your option) any later version.
15;;;
16;;; GNU Guix is distributed in the hope that it will be useful, but
17;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;;; GNU General Public License for more details.
20;;;
21;;; You should have received a copy of the GNU General Public License
22;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24(define-module (gnu packages rust-apps)
25 #:use-module ((guix licenses) #:prefix license:)
26 #:use-module (guix build-system cargo)
27 #:use-module (guix download)
28 #:use-module (guix packages)
c40e3d0b
EF
29 #:use-module (gnu packages compression)
30 #:use-module (gnu packages crates-io)
6e18b41e 31 #:use-module (gnu packages documentation)
0f7720d1 32 #:use-module (gnu packages jemalloc)
d883e791 33 #:use-module (gnu packages pcre)
c40e3d0b
EF
34 #:use-module (gnu packages pkg-config)
35 #:use-module (gnu packages tls)
36 #:use-module (gnu packages version-control))
9e225670 37
d42cbbba
JS
38(define-public exa
39 (package
40 (name "exa")
41 (version "0.9.0")
42 (source
43 (origin
44 (method url-fetch)
45 (uri (crate-uri "exa" version))
46 (file-name
47 (string-append name "-" version ".tar.gz"))
48 (sha256
49 (base32
50 "1s902xgplz1167k0r7x235p914lprpsqy2if0kpa1mlb0fswqqq4"))))
51 (build-system cargo-build-system)
52 (arguments
53 `(#:cargo-inputs
54 (("rust-ansi-term" ,rust-ansi-term-0.12)
55 ("rust-datetime" ,rust-datetime-0.4)
56 ("rust-env-logger" ,rust-env-logger-0.6)
57 ("rust-git2" ,rust-git2-0.9)
58 ("rust-glob" ,rust-glob-0.3)
21c8ec75 59 ("rust-lazy-static" ,rust-lazy-static-1)
d42cbbba
JS
60 ("rust-libc" ,rust-libc-0.2)
61 ("rust-locale" ,rust-locale-0.2)
62 ("rust-log" ,rust-log-0.4)
63 ("rust-natord" ,rust-natord-1.0)
c5e879cd 64 ("rust-num-cpus" ,rust-num-cpus-1)
d42cbbba
JS
65 ("rust-number-prefix" ,rust-number-prefix-0.3)
66 ("rust-scoped-threadpool" ,rust-scoped-threadpool-0.1)
67 ("rust-term-grid" ,rust-term-grid-0.1)
68 ("rust-term-size" ,rust-term-size-0.3)
69 ("rust-unicode-width" ,rust-unicode-width-0.1)
70 ("rust-users" ,rust-users-0.9)
71 ("rust-zoneinfo-compiled" ,rust-zoneinfo-compiled-0.4))
72 #:cargo-development-inputs
73 (("rust-datetime" ,rust-datetime-0.4))
74 #:phases
75 (modify-phases %standard-phases
76 (add-after 'configure 'dont-vendor-sources
77 (lambda* (#:key inputs #:allow-other-keys)
78 (let ((openssl (assoc-ref inputs "openssl")))
79 (setenv "OPENSSL_DIR" openssl))
80 #t))
81 ;; Ignoring failing tests.
82 ;; Reported in https://github.com/ogham/exa/issues/318
83 (add-before 'check 'disable-failing-tests
84 (lambda _
85 (substitute* "src/options/mod.rs"
86 (("^.*fn oneline_across.*" oneline-across)
87 (string-append "#[ignore]\n" oneline-across)))
88
89 (substitute* "src/options/view.rs"
90 (("test!\\(across:.*") "")
91 (("test!\\(empty:.*") "")
92 (("test!\\(gracross:.*") "")
93 (("test!\\(grid:.*") "")
94 (("test!\\(icons:.*") "")
95 (("test!\\(just_binary:.*") "")
96 (("test!\\(just_blocks:.*") "")
97 (("test!\\(just_bytes:.*") "")
98 (("test!\\(just_git:.*") "")
99 (("test!\\(just_group:.*") "")
100 (("test!\\(just_header:.*") "")
101 (("test!\\(just_inode:.*") "")
102 (("test!\\(just_links:.*") "")
103 (("test!\\(leg:.*") "")
104 (("test!\\(lid:.*") "")
105 (("test!\\(original_g:.*") ""))
b76473ec
EF
106 #t))
107 (add-after 'install 'install-extras
108 (lambda* (#:key outputs #:allow-other-keys)
109 (let* ((out (assoc-ref outputs "out"))
110 (share (string-append out "/share"))
111 (man1 (string-append share "/man/man1")))
112 (install-file "contrib/man/exa.1" man1)
113 (mkdir-p (string-append out "/etc/bash_completion.d"))
114 (mkdir-p (string-append share "/fish/vendor_completions.d"))
115 (mkdir-p (string-append share "/zsh/site-functions"))
116 (copy-file "contrib/completions.bash"
117 (string-append out "/etc/bash_completion.d/exa"))
118 (copy-file "contrib/completions.fish"
119 (string-append share "/fish/vendor_completions.d/exa.fish"))
120 (copy-file "contrib/completions.zsh"
121 (string-append share "/zsh/site-functions/_exa"))
122 #t))))))
d42cbbba
JS
123 (inputs
124 `(("libgit2" ,libgit2)
125 ("zlib" ,zlib)))
126 (native-inputs
127 `(("pkg-config" ,pkg-config)))
128 (home-page "https://the.exa.website/")
129 (synopsis "Modern replacement for ls")
130 (description "@code{exa} is a modern replacement for the command-line
131program @code{ls}. It uses colours to distinguish file types and metadata. It
132also knows about symlinks, extended attributes, and Git.")
133 (license license:expat)))
134
0f7720d1
JS
135(define-public fd
136 (package
137 (name "fd")
bf2ab0a0 138 (version "8.1.1")
0f7720d1
JS
139 (source
140 (origin
141 (method url-fetch)
142 (uri (crate-uri "fd-find" version))
143 (file-name
144 (string-append name "-" version ".tar.gz"))
145 (sha256
146 (base32
bf2ab0a0 147 "124a5r8hpk2phs1288jybh34d48yxy44wr7gv5ggchs272gs2jam"))))
0f7720d1
JS
148 (build-system cargo-build-system)
149 (arguments
150 `(#:cargo-inputs
151 (("rust-ansi-term" ,rust-ansi-term-0.12)
bf2ab0a0 152 ("rust-anyhow" ,rust-anyhow-1.0)
0f7720d1
JS
153 ("rust-atty" ,rust-atty-0.2)
154 ("rust-clap" ,rust-clap-2)
155 ("rust-ctrlc" ,rust-ctrlc-3.1)
bf2ab0a0 156 ("rust-dirs" ,rust-dirs-2.0)
0f7720d1 157 ("rust-globset" ,rust-globset-0.4)
bf2ab0a0 158 ("rust-humantime" ,rust-humantime-2)
0f7720d1
JS
159 ("rust-ignore" ,rust-ignore-0.4)
160 ("rust-jemallocator" ,rust-jemallocator-0.3)
21c8ec75 161 ("rust-lazy-static" ,rust-lazy-static-1)
0f7720d1 162 ("rust-libc" ,rust-libc-0.2)
bf2ab0a0 163 ("rust-lscolors" ,rust-lscolors-0.7)
c5e879cd 164 ("rust-num-cpus" ,rust-num-cpus-1)
6cd7b355 165 ("rust-regex" ,rust-regex-1)
0f7720d1 166 ("rust-regex-syntax" ,rust-regex-syntax-0.6)
bf2ab0a0 167 ("rust-users" ,rust-users-0.10)
0f7720d1
JS
168 ("rust-version-check" ,rust-version-check-0.9))
169 #:cargo-development-inputs
170 (("rust-diff" ,rust-diff-0.1)
171 ("rust-filetime" ,rust-filetime-0.2)
172 ("rust-tempdir" ,rust-tempdir-0.3))
173 #:phases
174 (modify-phases %standard-phases
175 (add-after 'unpack 'override-jemalloc
176 (lambda* (#:key inputs #:allow-other-keys)
177 (let ((jemalloc (assoc-ref inputs "jemalloc")))
178 (setenv "JEMALLOC_OVERRIDE"
179 (string-append jemalloc "/lib/libjemalloc.so")))
180 #t))
181 (add-after 'install 'install-extra
182 (lambda* (#:key outputs #:allow-other-keys)
183 (let* ((out (assoc-ref outputs "out"))
184 (install-completion
185 (lambda (completion out-dir)
186 (for-each
187 (lambda (f)
188 (install-file f (string-append out out-dir)))
189 (find-files "target/release/build/" completion)))))
190 ;; Manpages
191 (install-file "doc/fd.1" (string-append out "/share/man/man1"))
192 ;; Completions
9eed0a74 193 (install-completion "^fd.bash$" "/etc/bash_completion.d")
0f7720d1
JS
194 (install-completion "^fd.fish$" "/share/fish/vendor_completions.d")
195 (install-completion "^_fd$" "/share/zsh/site-functions")
9eed0a74
MR
196 (rename-file (string-append out "/etc/bash_completion.d/fd.bash")
197 (string-append out "/etc/bash_completion.d/fd"))
0f7720d1
JS
198 #t))))))
199 (inputs `(("jemalloc" ,jemalloc)))
200 (home-page "https://github.com/sharkdp/fd")
201 (synopsis "Simple, fast and user-friendly alternative to find")
202 (description
203 "@code{fd} is a simple, fast and user-friendly alternative to @code{find}.
204While it does not seek to mirror all of find's powerful functionality, it
205provides defaults for 80% of the use cases.")
206 (license (list license:expat license:asl2.0))))
207
9e225670
JS
208(define-public ripgrep
209 (package
210 (name "ripgrep")
e4a26e32 211 (version "12.1.1")
9e225670
JS
212 (source
213 (origin
214 (method url-fetch)
215 (uri (crate-uri "ripgrep" version))
216 (file-name
217 (string-append name "-" version ".tar.gz"))
218 (sha256
219 (base32
e4a26e32 220 "1grfi0j9zczzipipc21lkdbqmd2lvy2wlqy65fy4sckqvix5amdr"))))
9e225670
JS
221 (build-system cargo-build-system)
222 (arguments
223 `(#:cargo-inputs
16ffc3b6 224 (("rust-bstr" ,rust-bstr-0.2)
9e225670
JS
225 ("rust-clap" ,rust-clap-2)
226 ("rust-grep" ,rust-grep-0.2)
227 ("rust-ignore" ,rust-ignore-0.4)
16ffc3b6 228 ("rust-jemallocator" ,rust-jemallocator-0.3)
21c8ec75 229 ("rust-lazy-static" ,rust-lazy-static-1)
9e225670 230 ("rust-log" ,rust-log-0.4)
c5e879cd 231 ("rust-num-cpus" ,rust-num-cpus-1)
6cd7b355 232 ("rust-regex" ,rust-regex-1)
40908e02 233 ("rust-serde-json" ,rust-serde-json-1)
c5e879cd 234 ("rust-termcolor" ,rust-termcolor-1))
9e225670 235 #:cargo-development-inputs
271161db 236 (("rust-serde" ,rust-serde-1)
ef1f71e0 237 ("rust-serde-derive" ,rust-serde-derive-1))
6e18b41e
JK
238 #:modules ((ice-9 match)
239 (guix build cargo-build-system)
240 (guix build utils))
241 #:phases
242 (modify-phases %standard-phases
243 (add-after 'build 'install-manpage
244 ;; NOTE: This is done before 'check so that there's only one output
245 ;; directory with the man page.
246 (lambda* (#:key outputs #:allow-other-keys)
247 (match (find-files "target" "^rg\\.1$")
248 ((manpage)
249 (install-file manpage (string-append
250 (assoc-ref outputs "out")
251 "/share/man/man1"))))
927c2518
JK
252 #t)))
253 #:features '("pcre2")))
6e18b41e 254 (native-inputs
d883e791
JK
255 `(("asciidoc" ,asciidoc)
256 ("pcre2" ,pcre2)
257 ("pkg-config" ,pkg-config)))
9e225670
JS
258 (home-page "https://github.com/BurntSushi/ripgrep")
259 (synopsis "Line-oriented search tool")
260 (description
261 "ripgrep is a line-oriented search tool that recursively searches
262your current directory for a regex pattern while respecting your
263gitignore rules.")
264 (license (list license:unlicense license:expat))))
c5c48761
EF
265
266(define-public rust-cbindgen
267 (package
268 (name "rust-cbindgen")
3a963cdd 269 (version "0.13.2")
c5c48761
EF
270 (source
271 (origin
272 (method url-fetch)
273 (uri (crate-uri "cbindgen" version))
274 (file-name (string-append name "-" version ".crate"))
275 (sha256
276 (base32
3a963cdd 277 "0673pq96hs7waavkv58v2pakpxpsfyjvbraa5kyl2b44phgdzcid"))))
c5c48761
EF
278 (build-system cargo-build-system)
279 (arguments
280 `(#:cargo-inputs
281 (("clap" ,rust-clap-2)
282 ("log" ,rust-log-0.4)
0a568bbc 283 ("proc-macro2" ,rust-proc-macro2-1)
d0faf9c2 284 ("quote" ,rust-quote-1)
271161db 285 ("serde" ,rust-serde-1)
40908e02 286 ("serde-json" ,rust-serde-json-1)
12c6b558 287 ("syn" ,rust-syn-1)
7c6948c7 288 ("tempfile" ,rust-tempfile-3)
ef3827da 289 ("toml" ,rust-toml-0.5))))
c5c48761
EF
290 (home-page "https://github.com/eqrion/cbindgen/")
291 (synopsis "Tool for generating C bindings to Rust code")
292 (description
293 "This package provides a tool for generating C/C++ bindings to Rust code.")
294 (license license:mpl2.0)))
e29315b2 295
cc2849bc
MW
296(define-public rust-cbindgen-0.14
297 (package
298 (inherit rust-cbindgen)
299 (name "rust-cbindgen")
300 (version "0.14.1")
301 (source
302 (origin
303 (method url-fetch)
304 (uri (crate-uri "cbindgen" version))
305 (file-name
306 (string-append name "-" version ".tar.gz"))
307 (sha256
308 (base32
309 "1ppwqbzydxlg9a24lynzfk60xrvqw4k31mpz1wrk6lbf88zf8nxi"))))))
310
ca4b5588
LF
311(define-public rust-cbindgen-0.12
312 (package
313 (inherit rust-cbindgen)
314 (name "rust-cbindgen")
315 (version "0.12.2")
316 (source
317 (origin
318 (method url-fetch)
319 (uri (crate-uri "cbindgen" version))
320 (file-name
321 (string-append name "-" version ".tar.gz"))
322 (sha256
323 (base32
324 "13jzbmjz1bmmfr0i80hw6ar484mgabx3hbpb2ynhk0ddqi0yr58m"))))))
325
e29315b2
JS
326(define-public tokei
327 (package
328 (name "tokei")
329 (version "10.1.1")
330 (source
331 (origin
332 (method url-fetch)
333 (uri (crate-uri "tokei" version))
334 (file-name
335 (string-append name "-" version ".tar.gz"))
336 (sha256
337 (base32
338 "07f5laqw2k9l3k8wrg9h8p2m5d9hkfxngyacwrn3vs7mlnw8l81m"))))
339 (build-system cargo-build-system)
340 (arguments
341 `(#:cargo-inputs
342 (("rust-clap" ,rust-clap-2)
343 ("rust-crossbeam-channel" ,rust-crossbeam-channel-0.4)
344 ("rust-dirs" ,rust-dirs-2.0)
345 ("rust-encoding-rs-io" ,rust-encoding-rs-io-0.1)
346 ("rust-env-logger" ,rust-env-logger-0.7)
347 ("rust-grep-searcher" ,rust-grep-searcher-0.1)
348 ("rust-hex" ,rust-hex-0.4)
349 ("rust-ignore" ,rust-ignore-0.4)
350 ("rust-log" ,rust-log-0.4)
a5630553 351 ("rust-rayon" ,rust-rayon-1)
271161db 352 ("rust-serde" ,rust-serde-1)
e29315b2 353 ("rust-serde-cbor" ,rust-serde-cbor-0.10)
ef1f71e0 354 ("rust-serde-derive" ,rust-serde-derive-1)
40908e02 355 ("rust-serde-json" ,rust-serde-json-1)
e29315b2
JS
356 ("rust-serde-yaml" ,rust-serde-yaml-0.8)
357 ("rust-term-size" ,rust-term-size-0.3)
c40e3d0b 358 ("rust-toml" ,rust-toml-0.5))
e29315b2
JS
359 #:cargo-development-inputs
360 (("rust-git2" ,rust-git2-0.11)
361 ("rust-handlebars" ,rust-handlebars-2.0)
362 ("rust-ignore" ,rust-ignore-0.4)
21c8ec75 363 ("rust-lazy-static" ,rust-lazy-static-1)
6cd7b355 364 ("rust-regex" ,rust-regex-1)
40908e02 365 ("rust-serde-json" ,rust-serde-json-1)
7c6948c7 366 ("rust-tempfile" ,rust-tempfile-3))
c40e3d0b
EF
367 #:phases
368 (modify-phases %standard-phases
369 (add-after 'configure 'unvendor-libraries-from-crates
370 (lambda* (#:key inputs #:allow-other-keys)
371 (let ((openssl (assoc-ref inputs "openssl")))
61b95c15 372 (setenv "OPENSSL_DIR" openssl))
c40e3d0b
EF
373 #t)))))
374 (native-inputs
375 `(("libgit2" ,libgit2)
376 ("openssl" ,openssl)
377 ("pkg-config" ,pkg-config)
378 ("zlib" ,zlib)))
e29315b2
JS
379 (home-page "https://tokei.rs")
380 (synopsis "Count code, quickly")
381 (description
382 "Tokei is a program that displays statistics about your code. Tokei will
383show number of files, total lines within those files and code, comments, and
384blanks grouped by language.")
385 (license (list license:expat license:asl2.0))))
ca4b5588 386
b958e4be
JK
387(define-public watchexec
388 (package
389 (name "watchexec")
390 (version "1.14.0")
391 (source
392 (origin
393 (method url-fetch)
394 (uri (crate-uri "watchexec" version))
395 (file-name
396 (string-append name "-" version ".tar.gz"))
397 (sha256
398 (base32
399 "0bwgqb5fvyqbf2lf0005fxzpbpbwbszc7144g3kg2cmzy5cbrf0w"))))
400 (build-system cargo-build-system)
401 (arguments
402 `(#:phases
403 (modify-phases %standard-phases
404 (add-after 'install 'install-completions
405 (lambda* (#:key outputs #:allow-other-keys)
406 (let* ((out (assoc-ref outputs "out"))
407 (zsh (string-append out "/share/zsh/site-functions/_watchexec"))
408 (doc (string-append out "/share/doc/watchexec-" ,version)))
409 (mkdir-p (dirname zsh))
410 (copy-file "completions/zsh" zsh)
411 (install-file "README.md" doc)
412 #t))))
413 #:cargo-inputs
414 (("rust-clap" ,rust-clap-2)
415 ("rust-derive-builder" ,rust-derive-builder-0.9)
416 ("rust-env-logger" ,rust-env-logger-0.7)
417 ("rust-glob" ,rust-glob-0.3)
418 ("rust-globset" ,rust-globset-0.4)
419 ("rust-lazy-static" ,rust-lazy-static-1)
420 ("rust-log" ,rust-log-0.4)
421 ("rust-nix" ,rust-nix-0.17)
422 ("rust-notify" ,rust-notify-4)
423 ("rust-walkdir" ,rust-walkdir-2)
424 ("rust-winapi" ,rust-winapi-0.3))))
425 (home-page "https://github.com/watchexec/watchexec")
426 (synopsis "Executes commands in response to file modifications")
427 (description
428 "@command{watchexec} is a simple, standalone tool that watches a path and runs
429a command whenever it detects modifications.
430
431Example use cases:
432@itemize @bullet
433@item Automatically run unit tests
434@item Run linters/syntax checkers
435@end itemize
436
437Features:
438@itemize @bullet
439@item Coalesces multiple filesystem events into one, for editors that
440use swap/backup files during saving
441@item By default, uses @code{.gitignore} and @code{.ignore} to determine which
442files to ignore notifications for
443@item Supports watching files with a specific extension
444@item Supports filtering/ignoring events based on glob patterns
445@item Launches child processes in a new process group
446@item Sets environment variables that allow the executed program to learn
447the details of how it was triggered.
448@end itemize")
449 (license license:asl2.0)))
450
ca4b5588
LF
451(define-public rust-cargo-c
452 (package
453 (name "rust-cargo-c")
366a23f8 454 (version "0.5.3")
ca4b5588
LF
455 (source
456 (origin
457 (method url-fetch)
458 (uri (crate-uri "cargo-c" version))
459 (file-name
460 (string-append name "-" version ".tar.gz"))
461 (sha256
462 (base32
366a23f8 463 "0hsag5g4qngm8alfil2dyvl5sagpqi5nb40c7bhwng2z8mv9r41k"))))
ca4b5588
LF
464 (build-system cargo-build-system)
465 (arguments
466 `(#:cargo-inputs
366a23f8
EF
467 (("rust-cbindgen" ,rust-cbindgen)
468 ("rust-pretty-env-logger" ,rust-pretty-env-logger-0.4)
ca4b5588
LF
469 ("rust-structopt" ,rust-structopt-0.3)
470 ("rust-log" ,rust-log-0.4)
471 ("rust-toml" ,rust-toml-0.5)
472 ("rust-cargo-metadata" ,rust-cargo-metadata-0.9)
271161db 473 ("rust-serde" ,rust-serde-1)
ef1f71e0 474 ("rust-serde-derive" ,rust-serde-derive-1)
6cd7b355 475 ("rust-regex" ,rust-regex-1))))
ca4b5588
LF
476 (home-page "https://github.com/lu-zero/cargo-c")
477 (synopsis "Build and install C-compatible libraries")
478 (description
479 "This package produces and installs a correct pkg-config file, a static
480library and a dynamic library, and a C header to be used by any C (and
481C-compatible) software.")
482 (license license:expat)))