gnu: rust-anyhow-1: Don't skip build.
[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>
0a2e80c3 8;;; Copyright © 2020 Gabriel Arazas <foo.dogsquared@gmail.com>
700ee27f 9;;; Copyright © 2020, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
4d047d19 10;;; Copyright © 2021 Tobias Geerinckx-Rice <me@tobias.gr>
9e225670
JS
11;;;
12;;; This file is part of GNU Guix.
13;;;
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.
18;;;
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.
23;;;
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/>.
26
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)
c40e3d0b
EF
32 #:use-module (gnu packages compression)
33 #:use-module (gnu packages crates-io)
9f86a6da 34 #:use-module (gnu packages crates-graphics)
6e18b41e 35 #:use-module (gnu packages documentation)
0f7720d1 36 #:use-module (gnu packages jemalloc)
d883e791 37 #:use-module (gnu packages pcre)
c40e3d0b
EF
38 #:use-module (gnu packages pkg-config)
39 #:use-module (gnu packages tls)
40 #:use-module (gnu packages version-control))
9e225670 41
4e811f56
NG
42(define-public bat
43 (package
44 (name "bat")
45 (version "0.17.1")
46 (source
47 (origin
48 (method url-fetch)
49 (uri (crate-uri "bat" version))
50 (file-name (string-append name "-" version ".tar.gz"))
51 (sha256
52 (base32 "1ia12774prjnm3msiaja6qdpxkpyknxswqpgkmwzj0wn9nhkc7nz"))))
53 (build-system cargo-build-system)
54 (arguments
55 `(#:cargo-inputs
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)
4e811f56
NG
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))))
ee00b7c3
NG
80 (native-inputs
81 `(("pkg-config" ,pkg-config)))
4e811f56 82 (inputs
ee00b7c3
NG
83 `(("libgit2" ,libgit2)
84 ("zlib" ,zlib)))
4e811f56
NG
85 (home-page "https://github.com/sharkdp/bat")
86 (synopsis "@command{cat} clone with syntax highlighting and git integration")
87 (description
88 "@command{bat} is a drop-in @command{cat} replacement featuring syntax
89highlighting for a large number of languages, git integration, and automatic
90paging.")
91 (license (list license:expat license:asl2.0))))
92
d42cbbba
JS
93(define-public exa
94 (package
95 (name "exa")
96 (version "0.9.0")
97 (source
98 (origin
99 (method url-fetch)
100 (uri (crate-uri "exa" version))
101 (file-name
102 (string-append name "-" version ".tar.gz"))
103 (sha256
104 (base32
105 "1s902xgplz1167k0r7x235p914lprpsqy2if0kpa1mlb0fswqqq4"))))
106 (build-system cargo-build-system)
107 (arguments
108 `(#:cargo-inputs
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)
21c8ec75 114 ("rust-lazy-static" ,rust-lazy-static-1)
d42cbbba
JS
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)
c5e879cd 119 ("rust-num-cpus" ,rust-num-cpus-1)
d42cbbba
JS
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))
79caf46a 129 #:phases
d42cbbba 130 (modify-phases %standard-phases
d42cbbba
JS
131 ;; Ignoring failing tests.
132 ;; Reported in https://github.com/ogham/exa/issues/318
133 (add-before 'check 'disable-failing-tests
134 (lambda _
135 (substitute* "src/options/mod.rs"
136 (("^.*fn oneline_across.*" oneline-across)
137 (string-append "#[ignore]\n" oneline-across)))
138
139 (substitute* "src/options/view.rs"
140 (("test!\\(across:.*") "")
e827f404 141 (("test!\\(cr:.*") "")
d42cbbba
JS
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:.*") ""))
b76473ec
EF
157 #t))
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"))
173 #t))))))
d42cbbba
JS
174 (inputs
175 `(("libgit2" ,libgit2)
176 ("zlib" ,zlib)))
177 (native-inputs
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
182program @code{ls}. It uses colours to distinguish file types and metadata. It
183also knows about symlinks, extended attributes, and Git.")
184 (license license:expat)))
185
0f7720d1
JS
186(define-public fd
187 (package
188 (name "fd")
bf2ab0a0 189 (version "8.1.1")
0f7720d1
JS
190 (source
191 (origin
192 (method url-fetch)
193 (uri (crate-uri "fd-find" version))
194 (file-name
195 (string-append name "-" version ".tar.gz"))
196 (sha256
197 (base32
bf2ab0a0 198 "124a5r8hpk2phs1288jybh34d48yxy44wr7gv5ggchs272gs2jam"))))
0f7720d1
JS
199 (build-system cargo-build-system)
200 (arguments
201 `(#:cargo-inputs
202 (("rust-ansi-term" ,rust-ansi-term-0.12)
bf2ab0a0 203 ("rust-anyhow" ,rust-anyhow-1.0)
0f7720d1
JS
204 ("rust-atty" ,rust-atty-0.2)
205 ("rust-clap" ,rust-clap-2)
206 ("rust-ctrlc" ,rust-ctrlc-3.1)
bf2ab0a0 207 ("rust-dirs" ,rust-dirs-2.0)
0f7720d1 208 ("rust-globset" ,rust-globset-0.4)
bf2ab0a0 209 ("rust-humantime" ,rust-humantime-2)
0f7720d1
JS
210 ("rust-ignore" ,rust-ignore-0.4)
211 ("rust-jemallocator" ,rust-jemallocator-0.3)
21c8ec75 212 ("rust-lazy-static" ,rust-lazy-static-1)
0f7720d1 213 ("rust-libc" ,rust-libc-0.2)
bf2ab0a0 214 ("rust-lscolors" ,rust-lscolors-0.7)
c5e879cd 215 ("rust-num-cpus" ,rust-num-cpus-1)
6cd7b355 216 ("rust-regex" ,rust-regex-1)
0f7720d1 217 ("rust-regex-syntax" ,rust-regex-syntax-0.6)
bf2ab0a0 218 ("rust-users" ,rust-users-0.10)
0f7720d1
JS
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))
224 #:phases
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")))
231 #t))
232 (add-after 'install 'install-extra
233 (lambda* (#:key outputs #:allow-other-keys)
234 (let* ((out (assoc-ref outputs "out"))
235 (install-completion
236 (lambda (completion out-dir)
237 (for-each
238 (lambda (f)
239 (install-file f (string-append out out-dir)))
240 (find-files "target/release/build/" completion)))))
241 ;; Manpages
242 (install-file "doc/fd.1" (string-append out "/share/man/man1"))
243 ;; Completions
9eed0a74 244 (install-completion "^fd.bash$" "/etc/bash_completion.d")
0f7720d1
JS
245 (install-completion "^fd.fish$" "/share/fish/vendor_completions.d")
246 (install-completion "^_fd$" "/share/zsh/site-functions")
9eed0a74
MR
247 (rename-file (string-append out "/etc/bash_completion.d/fd.bash")
248 (string-append out "/etc/bash_completion.d/fd"))
0f7720d1
JS
249 #t))))))
250 (inputs `(("jemalloc" ,jemalloc)))
251 (home-page "https://github.com/sharkdp/fd")
252 (synopsis "Simple, fast and user-friendly alternative to find")
253 (description
254 "@code{fd} is a simple, fast and user-friendly alternative to @code{find}.
255While it does not seek to mirror all of find's powerful functionality, it
256provides defaults for 80% of the use cases.")
257 (license (list license:expat license:asl2.0))))
258
0a2e80c3
GA
259(define-public hexyl
260 (package
261 (name "hexyl")
262 (version "0.8.0")
263 (source
264 (origin
265 (method url-fetch)
266 (uri (crate-uri "hexyl" version))
267 (file-name
268 (string-append name "-" version ".tar.gz"))
269 (sha256
270 (base32
271 "0sipag77196467idbznbk5q5lwhqz85zw7y1pwg9b27jxqyk04rp"))))
272 (build-system cargo-build-system)
273 (arguments
274 `(#:cargo-inputs
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")
281 (description
282 "This package provides a command line hex viewer. It uses a colored output
283for distinguishing different kinds of bytes such as NULL bytes, printable ASCII
284characters, ASCII whitespace characters, other ASCII characters and non-ASCII.")
285 (license (list license:expat license:asl2.0))))
286
9e225670
JS
287(define-public ripgrep
288 (package
289 (name "ripgrep")
e4a26e32 290 (version "12.1.1")
9e225670
JS
291 (source
292 (origin
293 (method url-fetch)
294 (uri (crate-uri "ripgrep" version))
295 (file-name
296 (string-append name "-" version ".tar.gz"))
297 (sha256
298 (base32
e4a26e32 299 "1grfi0j9zczzipipc21lkdbqmd2lvy2wlqy65fy4sckqvix5amdr"))))
9e225670
JS
300 (build-system cargo-build-system)
301 (arguments
302 `(#:cargo-inputs
16ffc3b6 303 (("rust-bstr" ,rust-bstr-0.2)
9e225670
JS
304 ("rust-clap" ,rust-clap-2)
305 ("rust-grep" ,rust-grep-0.2)
306 ("rust-ignore" ,rust-ignore-0.4)
16ffc3b6 307 ("rust-jemallocator" ,rust-jemallocator-0.3)
21c8ec75 308 ("rust-lazy-static" ,rust-lazy-static-1)
9e225670 309 ("rust-log" ,rust-log-0.4)
c5e879cd 310 ("rust-num-cpus" ,rust-num-cpus-1)
6cd7b355 311 ("rust-regex" ,rust-regex-1)
40908e02 312 ("rust-serde-json" ,rust-serde-json-1)
c5e879cd 313 ("rust-termcolor" ,rust-termcolor-1))
9e225670 314 #:cargo-development-inputs
271161db 315 (("rust-serde" ,rust-serde-1)
ef1f71e0 316 ("rust-serde-derive" ,rust-serde-derive-1))
6e18b41e
JK
317 #:modules ((ice-9 match)
318 (guix build cargo-build-system)
319 (guix build utils))
320 #:phases
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$")
327 ((manpage)
328 (install-file manpage (string-append
329 (assoc-ref outputs "out")
330 "/share/man/man1"))))
927c2518
JK
331 #t)))
332 #:features '("pcre2")))
6e18b41e 333 (native-inputs
d883e791
JK
334 `(("asciidoc" ,asciidoc)
335 ("pcre2" ,pcre2)
336 ("pkg-config" ,pkg-config)))
9e225670
JS
337 (home-page "https://github.com/BurntSushi/ripgrep")
338 (synopsis "Line-oriented search tool")
339 (description
340 "ripgrep is a line-oriented search tool that recursively searches
341your current directory for a regex pattern while respecting your
342gitignore rules.")
343 (license (list license:unlicense license:expat))))
c5c48761
EF
344
345(define-public rust-cbindgen
346 (package
347 (name "rust-cbindgen")
3a963cdd 348 (version "0.13.2")
c5c48761
EF
349 (source
350 (origin
351 (method url-fetch)
352 (uri (crate-uri "cbindgen" version))
353 (file-name (string-append name "-" version ".crate"))
354 (sha256
355 (base32
3a963cdd 356 "0673pq96hs7waavkv58v2pakpxpsfyjvbraa5kyl2b44phgdzcid"))))
c5c48761
EF
357 (build-system cargo-build-system)
358 (arguments
359 `(#:cargo-inputs
360 (("clap" ,rust-clap-2)
361 ("log" ,rust-log-0.4)
0a568bbc 362 ("proc-macro2" ,rust-proc-macro2-1)
d0faf9c2 363 ("quote" ,rust-quote-1)
271161db 364 ("serde" ,rust-serde-1)
40908e02 365 ("serde-json" ,rust-serde-json-1)
12c6b558 366 ("syn" ,rust-syn-1)
7c6948c7 367 ("tempfile" ,rust-tempfile-3)
ef3827da 368 ("toml" ,rust-toml-0.5))))
c5c48761
EF
369 (home-page "https://github.com/eqrion/cbindgen/")
370 (synopsis "Tool for generating C bindings to Rust code")
371 (description
372 "This package provides a tool for generating C/C++ bindings to Rust code.")
373 (license license:mpl2.0)))
e29315b2 374
700ee27f
NG
375(define-public rust-cbindgen-0.16
376 (package
377 (inherit rust-cbindgen)
378 (name "rust-cbindgen")
379 (version "0.16.0")
380 (source
381 (origin
382 (method url-fetch)
383 (uri (crate-uri "cbindgen" version))
384 (file-name (string-append name "-" version ".tar.gz"))
385 (sha256
386 (base32 "049cai626nzw0km03parx4sxwaxgbr7i5ifjbjwnfxkqkj5k2i4k"))))
387 (arguments
388 `(#:tests? #false ;missing files
389 #:cargo-inputs
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))))))
403
cc2849bc
MW
404(define-public rust-cbindgen-0.14
405 (package
406 (inherit rust-cbindgen)
407 (name "rust-cbindgen")
408 (version "0.14.1")
409 (source
410 (origin
411 (method url-fetch)
412 (uri (crate-uri "cbindgen" version))
413 (file-name
414 (string-append name "-" version ".tar.gz"))
415 (sha256
416 (base32
417 "1ppwqbzydxlg9a24lynzfk60xrvqw4k31mpz1wrk6lbf88zf8nxi"))))))
418
ca4b5588
LF
419(define-public rust-cbindgen-0.12
420 (package
421 (inherit rust-cbindgen)
422 (name "rust-cbindgen")
423 (version "0.12.2")
424 (source
425 (origin
426 (method url-fetch)
427 (uri (crate-uri "cbindgen" version))
428 (file-name
429 (string-append name "-" version ".tar.gz"))
430 (sha256
431 (base32
432 "13jzbmjz1bmmfr0i80hw6ar484mgabx3hbpb2ynhk0ddqi0yr58m"))))))
433
e29315b2
JS
434(define-public tokei
435 (package
436 (name "tokei")
437 (version "10.1.1")
438 (source
439 (origin
440 (method url-fetch)
441 (uri (crate-uri "tokei" version))
442 (file-name
443 (string-append name "-" version ".tar.gz"))
444 (sha256
445 (base32
446 "07f5laqw2k9l3k8wrg9h8p2m5d9hkfxngyacwrn3vs7mlnw8l81m"))))
447 (build-system cargo-build-system)
448 (arguments
449 `(#:cargo-inputs
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)
a5630553 459 ("rust-rayon" ,rust-rayon-1)
271161db 460 ("rust-serde" ,rust-serde-1)
e29315b2 461 ("rust-serde-cbor" ,rust-serde-cbor-0.10)
ef1f71e0 462 ("rust-serde-derive" ,rust-serde-derive-1)
40908e02 463 ("rust-serde-json" ,rust-serde-json-1)
e29315b2
JS
464 ("rust-serde-yaml" ,rust-serde-yaml-0.8)
465 ("rust-term-size" ,rust-term-size-0.3)
c40e3d0b 466 ("rust-toml" ,rust-toml-0.5))
e29315b2
JS
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)
21c8ec75 471 ("rust-lazy-static" ,rust-lazy-static-1)
6cd7b355 472 ("rust-regex" ,rust-regex-1)
40908e02 473 ("rust-serde-json" ,rust-serde-json-1)
3dbf3a7f 474 ("rust-tempfile" ,rust-tempfile-3))))
c40e3d0b 475 (native-inputs
3dbf3a7f
EF
476 `(("pkg-config" ,pkg-config)))
477 (inputs
c40e3d0b
EF
478 `(("libgit2" ,libgit2)
479 ("openssl" ,openssl)
c40e3d0b 480 ("zlib" ,zlib)))
e29315b2
JS
481 (home-page "https://tokei.rs")
482 (synopsis "Count code, quickly")
483 (description
484 "Tokei is a program that displays statistics about your code. Tokei will
485show number of files, total lines within those files and code, comments, and
486blanks grouped by language.")
487 (license (list license:expat license:asl2.0))))
ca4b5588 488
b958e4be
JK
489(define-public watchexec
490 (package
491 (name "watchexec")
4d047d19 492 (version "1.14.1")
b958e4be
JK
493 (source
494 (origin
495 (method url-fetch)
496 (uri (crate-uri "watchexec" version))
497 (file-name
498 (string-append name "-" version ".tar.gz"))
499 (sha256
4d047d19 500 (base32 "1vqaa462sjpzi0crh12ixqc2wa5bblirc129pnj8jr8iz3xw3gvd"))))
b958e4be
JK
501 (build-system cargo-build-system)
502 (arguments
503 `(#:phases
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)
513 #t))))
514 #:cargo-inputs
4d047d19 515 (("rust-embed-resource" ,rust-embed-resource-1.3)
b958e4be
JK
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)
4d047d19 524 ("rust-walkdir" ,rust-walkdir-2))))
b958e4be
JK
525 (home-page "https://github.com/watchexec/watchexec")
526 (synopsis "Executes commands in response to file modifications")
527 (description
528 "@command{watchexec} is a simple, standalone tool that watches a path and runs
529a command whenever it detects modifications.
530
531Example use cases:
532@itemize @bullet
533@item Automatically run unit tests
534@item Run linters/syntax checkers
535@end itemize
536
537Features:
538@itemize @bullet
7230f6d5 539@item Coalesces multiple file system events into one, for editors that
b958e4be
JK
540use swap/backup files during saving
541@item By default, uses @code{.gitignore} and @code{.ignore} to determine which
542files 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
547the details of how it was triggered.
548@end itemize")
549 (license license:asl2.0)))
550
ca4b5588
LF
551(define-public rust-cargo-c
552 (package
553 (name "rust-cargo-c")
366a23f8 554 (version "0.5.3")
ca4b5588
LF
555 (source
556 (origin
557 (method url-fetch)
558 (uri (crate-uri "cargo-c" version))
559 (file-name
560 (string-append name "-" version ".tar.gz"))
561 (sha256
562 (base32
366a23f8 563 "0hsag5g4qngm8alfil2dyvl5sagpqi5nb40c7bhwng2z8mv9r41k"))))
ca4b5588
LF
564 (build-system cargo-build-system)
565 (arguments
566 `(#:cargo-inputs
366a23f8
EF
567 (("rust-cbindgen" ,rust-cbindgen)
568 ("rust-pretty-env-logger" ,rust-pretty-env-logger-0.4)
ca4b5588
LF
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)
271161db 573 ("rust-serde" ,rust-serde-1)
ef1f71e0 574 ("rust-serde-derive" ,rust-serde-derive-1)
6cd7b355 575 ("rust-regex" ,rust-regex-1))))
ca4b5588
LF
576 (home-page "https://github.com/lu-zero/cargo-c")
577 (synopsis "Build and install C-compatible libraries")
578 (description
579 "This package produces and installs a correct pkg-config file, a static
580library and a dynamic library, and a C header to be used by any C (and
581C-compatible) software.")
582 (license license:expat)))