gnu: Remove rust-num-cpus-1.10.
[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>
9e225670
JS
7;;;
8;;; This file is part of GNU Guix.
9;;;
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.
14;;;
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.
19;;;
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/>.
22
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)
c40e3d0b
EF
28 #:use-module (gnu packages compression)
29 #:use-module (gnu packages crates-io)
6e18b41e 30 #:use-module (gnu packages documentation)
0f7720d1 31 #:use-module (gnu packages jemalloc)
d883e791 32 #:use-module (gnu packages pcre)
c40e3d0b
EF
33 #:use-module (gnu packages pkg-config)
34 #:use-module (gnu packages tls)
35 #:use-module (gnu packages version-control))
9e225670 36
d42cbbba
JS
37(define-public exa
38 (package
39 (name "exa")
40 (version "0.9.0")
41 (source
42 (origin
43 (method url-fetch)
44 (uri (crate-uri "exa" version))
45 (file-name
46 (string-append name "-" version ".tar.gz"))
47 (sha256
48 (base32
49 "1s902xgplz1167k0r7x235p914lprpsqy2if0kpa1mlb0fswqqq4"))))
50 (build-system cargo-build-system)
51 (arguments
52 `(#:cargo-inputs
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)
21c8ec75 58 ("rust-lazy-static" ,rust-lazy-static-1)
d42cbbba
JS
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.11)
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))
73 #:phases
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))
79 #t))
80 ;; Ignoring failing tests.
81 ;; Reported in https://github.com/ogham/exa/issues/318
82 (add-before 'check 'disable-failing-tests
83 (lambda _
84 (substitute* "src/options/mod.rs"
85 (("^.*fn oneline_across.*" oneline-across)
86 (string-append "#[ignore]\n" oneline-across)))
87
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:.*") ""))
b76473ec
EF
105 #t))
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"))
121 #t))))))
d42cbbba
JS
122 (inputs
123 `(("libgit2" ,libgit2)
124 ("zlib" ,zlib)))
125 (native-inputs
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
130program @code{ls}. It uses colours to distinguish file types and metadata. It
131also knows about symlinks, extended attributes, and Git.")
132 (license license:expat)))
133
0f7720d1
JS
134(define-public fd
135 (package
136 (name "fd")
bf2ab0a0 137 (version "8.1.1")
0f7720d1
JS
138 (source
139 (origin
140 (method url-fetch)
141 (uri (crate-uri "fd-find" version))
142 (file-name
143 (string-append name "-" version ".tar.gz"))
144 (sha256
145 (base32
bf2ab0a0 146 "124a5r8hpk2phs1288jybh34d48yxy44wr7gv5ggchs272gs2jam"))))
0f7720d1
JS
147 (build-system cargo-build-system)
148 (arguments
149 `(#:cargo-inputs
150 (("rust-ansi-term" ,rust-ansi-term-0.12)
bf2ab0a0 151 ("rust-anyhow" ,rust-anyhow-1.0)
0f7720d1
JS
152 ("rust-atty" ,rust-atty-0.2)
153 ("rust-clap" ,rust-clap-2)
154 ("rust-ctrlc" ,rust-ctrlc-3.1)
bf2ab0a0 155 ("rust-dirs" ,rust-dirs-2.0)
0f7720d1 156 ("rust-globset" ,rust-globset-0.4)
bf2ab0a0 157 ("rust-humantime" ,rust-humantime-2)
0f7720d1
JS
158 ("rust-ignore" ,rust-ignore-0.4)
159 ("rust-jemallocator" ,rust-jemallocator-0.3)
21c8ec75 160 ("rust-lazy-static" ,rust-lazy-static-1)
0f7720d1 161 ("rust-libc" ,rust-libc-0.2)
bf2ab0a0
JK
162 ("rust-lscolors" ,rust-lscolors-0.7)
163 ("rust-num-cpus" ,rust-num-cpus-1.11)
6cd7b355 164 ("rust-regex" ,rust-regex-1)
0f7720d1 165 ("rust-regex-syntax" ,rust-regex-syntax-0.6)
bf2ab0a0 166 ("rust-users" ,rust-users-0.10)
0f7720d1
JS
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))
172 #:phases
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")))
179 #t))
180 (add-after 'install 'install-extra
181 (lambda* (#:key outputs #:allow-other-keys)
182 (let* ((out (assoc-ref outputs "out"))
183 (install-completion
184 (lambda (completion out-dir)
185 (for-each
186 (lambda (f)
187 (install-file f (string-append out out-dir)))
188 (find-files "target/release/build/" completion)))))
189 ;; Manpages
190 (install-file "doc/fd.1" (string-append out "/share/man/man1"))
191 ;; Completions
9eed0a74 192 (install-completion "^fd.bash$" "/etc/bash_completion.d")
0f7720d1
JS
193 (install-completion "^fd.fish$" "/share/fish/vendor_completions.d")
194 (install-completion "^_fd$" "/share/zsh/site-functions")
9eed0a74
MR
195 (rename-file (string-append out "/etc/bash_completion.d/fd.bash")
196 (string-append out "/etc/bash_completion.d/fd"))
0f7720d1
JS
197 #t))))))
198 (inputs `(("jemalloc" ,jemalloc)))
199 (home-page "https://github.com/sharkdp/fd")
200 (synopsis "Simple, fast and user-friendly alternative to find")
201 (description
202 "@code{fd} is a simple, fast and user-friendly alternative to @code{find}.
203While it does not seek to mirror all of find's powerful functionality, it
204provides defaults for 80% of the use cases.")
205 (license (list license:expat license:asl2.0))))
206
9e225670
JS
207(define-public ripgrep
208 (package
209 (name "ripgrep")
16ffc3b6 210 (version "11.0.2")
9e225670
JS
211 (source
212 (origin
213 (method url-fetch)
214 (uri (crate-uri "ripgrep" version))
215 (file-name
216 (string-append name "-" version ".tar.gz"))
217 (sha256
218 (base32
16ffc3b6 219 "0vqjr96s2rs45715hzf0g0wjahig4zjyiqfijmzzg4jyh9ni80yr"))))
9e225670
JS
220 (build-system cargo-build-system)
221 (arguments
222 `(#:cargo-inputs
16ffc3b6 223 (("rust-bstr" ,rust-bstr-0.2)
9e225670
JS
224 ("rust-clap" ,rust-clap-2)
225 ("rust-grep" ,rust-grep-0.2)
226 ("rust-ignore" ,rust-ignore-0.4)
16ffc3b6 227 ("rust-jemallocator" ,rust-jemallocator-0.3)
21c8ec75 228 ("rust-lazy-static" ,rust-lazy-static-1)
9e225670 229 ("rust-log" ,rust-log-0.4)
24973fc5 230 ("rust-num-cpus" ,rust-num-cpus-1.11)
6cd7b355 231 ("rust-regex" ,rust-regex-1)
9e225670
JS
232 ("rust-serde-json" ,rust-serde-json-1.0)
233 ("rust-termcolor" ,rust-termcolor-1.0))
234 #:cargo-development-inputs
16ffc3b6 235 (("rust-serde" ,rust-serde-1.0)
6e18b41e
JK
236 ("rust-serde-derive" ,rust-serde-derive-1.0))
237 #:modules ((ice-9 match)
238 (guix build cargo-build-system)
239 (guix build utils))
240 #:phases
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$")
247 ((manpage)
248 (install-file manpage (string-append
249 (assoc-ref outputs "out")
250 "/share/man/man1"))))
927c2518
JK
251 #t)))
252 #:features '("pcre2")))
6e18b41e 253 (native-inputs
d883e791
JK
254 `(("asciidoc" ,asciidoc)
255 ("pcre2" ,pcre2)
256 ("pkg-config" ,pkg-config)))
9e225670
JS
257 (home-page "https://github.com/BurntSushi/ripgrep")
258 (synopsis "Line-oriented search tool")
259 (description
260 "ripgrep is a line-oriented search tool that recursively searches
261your current directory for a regex pattern while respecting your
262gitignore rules.")
263 (license (list license:unlicense license:expat))))
c5c48761
EF
264
265(define-public rust-cbindgen
266 (package
267 (name "rust-cbindgen")
eab07e78 268 (version "0.13.1")
c5c48761
EF
269 (source
270 (origin
271 (method url-fetch)
272 (uri (crate-uri "cbindgen" version))
273 (file-name (string-append name "-" version ".crate"))
274 (sha256
275 (base32
eab07e78 276 "0w70bnwwqyf9fr6z3rcs7m7ad791fmfmhxy828va0dkfwvamp59c"))))
c5c48761
EF
277 (build-system cargo-build-system)
278 (arguments
279 `(#:cargo-inputs
280 (("clap" ,rust-clap-2)
281 ("log" ,rust-log-0.4)
282 ("proc-macro2" ,rust-proc-macro2-1.0)
283 ("quote" ,rust-quote-1.0)
284 ("serde" ,rust-serde-1.0)
285 ("serde-json" ,rust-serde-json-1.0)
286 ("syn" ,rust-syn-1.0)
7c6948c7 287 ("tempfile" ,rust-tempfile-3)
ef3827da 288 ("toml" ,rust-toml-0.5))))
c5c48761
EF
289 (home-page "https://github.com/eqrion/cbindgen/")
290 (synopsis "Tool for generating C bindings to Rust code")
291 (description
292 "This package provides a tool for generating C/C++ bindings to Rust code.")
293 (license license:mpl2.0)))
e29315b2 294
ca4b5588
LF
295(define-public rust-cbindgen-0.12
296 (package
297 (inherit rust-cbindgen)
298 (name "rust-cbindgen")
299 (version "0.12.2")
300 (source
301 (origin
302 (method url-fetch)
303 (uri (crate-uri "cbindgen" version))
304 (file-name
305 (string-append name "-" version ".tar.gz"))
306 (sha256
307 (base32
308 "13jzbmjz1bmmfr0i80hw6ar484mgabx3hbpb2ynhk0ddqi0yr58m"))))))
309
e29315b2
JS
310(define-public tokei
311 (package
312 (name "tokei")
313 (version "10.1.1")
314 (source
315 (origin
316 (method url-fetch)
317 (uri (crate-uri "tokei" version))
318 (file-name
319 (string-append name "-" version ".tar.gz"))
320 (sha256
321 (base32
322 "07f5laqw2k9l3k8wrg9h8p2m5d9hkfxngyacwrn3vs7mlnw8l81m"))))
323 (build-system cargo-build-system)
324 (arguments
325 `(#:cargo-inputs
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)
a5630553 335 ("rust-rayon" ,rust-rayon-1)
e29315b2
JS
336 ("rust-serde" ,rust-serde-1.0)
337 ("rust-serde-cbor" ,rust-serde-cbor-0.10)
338 ("rust-serde-derive" ,rust-serde-derive-1.0)
339 ("rust-serde-json" ,rust-serde-json-1.0)
340 ("rust-serde-yaml" ,rust-serde-yaml-0.8)
341 ("rust-term-size" ,rust-term-size-0.3)
c40e3d0b 342 ("rust-toml" ,rust-toml-0.5))
e29315b2
JS
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)
21c8ec75 347 ("rust-lazy-static" ,rust-lazy-static-1)
6cd7b355 348 ("rust-regex" ,rust-regex-1)
e29315b2 349 ("rust-serde-json" ,rust-serde-json-1.0)
7c6948c7 350 ("rust-tempfile" ,rust-tempfile-3))
c40e3d0b
EF
351 #:phases
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")))
61b95c15 356 (setenv "OPENSSL_DIR" openssl))
c40e3d0b
EF
357 #t)))))
358 (native-inputs
359 `(("libgit2" ,libgit2)
360 ("openssl" ,openssl)
361 ("pkg-config" ,pkg-config)
362 ("zlib" ,zlib)))
e29315b2
JS
363 (home-page "https://tokei.rs")
364 (synopsis "Count code, quickly")
365 (description
366 "Tokei is a program that displays statistics about your code. Tokei will
367show number of files, total lines within those files and code, comments, and
368blanks grouped by language.")
369 (license (list license:expat license:asl2.0))))
ca4b5588
LF
370
371(define-public rust-cargo-c
372 (package
373 (name "rust-cargo-c")
374 (version "0.5.2")
375 (source
376 (origin
377 (method url-fetch)
378 (uri (crate-uri "cargo-c" version))
379 (file-name
380 (string-append name "-" version ".tar.gz"))
381 (sha256
382 (base32
383 "1is72jm0r73pqx2g3h1n6lvrcirwd91mmajsmb3jjg4jnayfkp0w"))))
384 (build-system cargo-build-system)
385 (arguments
386 `(#:cargo-inputs
387 (("rust-cbindgen" ,rust-cbindgen-0.12)
388 ("rust-pretty-env-logger" ,rust-pretty-env-logger-0.3)
389 ("rust-structopt" ,rust-structopt-0.3)
390 ("rust-log" ,rust-log-0.4)
391 ("rust-toml" ,rust-toml-0.5)
392 ("rust-cargo-metadata" ,rust-cargo-metadata-0.9)
393 ("rust-serde" ,rust-serde-1.0)
394 ("rust-serde-derive" ,rust-serde-derive-1.0)
6cd7b355 395 ("rust-regex" ,rust-regex-1))))
ca4b5588
LF
396 (home-page "https://github.com/lu-zero/cargo-c")
397 (synopsis "Build and install C-compatible libraries")
398 (description
399 "This package produces and installs a correct pkg-config file, a static
400library and a dynamic library, and a C header to be used by any C (and
401C-compatible) software.")
402 (license license:expat)))