gnu: protobuf: Update to 3.11.3.
[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>
9e225670
JS
5;;;
6;;; This file is part of GNU Guix.
7;;;
8;;; GNU Guix is free software; you can redistribute it and/or modify it
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
13;;; GNU Guix is distributed in the hope that it will be useful, but
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21(define-module (gnu packages rust-apps)
22 #:use-module ((guix licenses) #:prefix license:)
23 #:use-module (guix build-system cargo)
24 #:use-module (guix download)
25 #:use-module (guix packages)
c40e3d0b
EF
26 #:use-module (gnu packages compression)
27 #:use-module (gnu packages crates-io)
0f7720d1 28 #:use-module (gnu packages jemalloc)
c40e3d0b
EF
29 #:use-module (gnu packages pkg-config)
30 #:use-module (gnu packages tls)
31 #:use-module (gnu packages version-control))
9e225670 32
d42cbbba
JS
33(define-public exa
34 (package
35 (name "exa")
36 (version "0.9.0")
37 (source
38 (origin
39 (method url-fetch)
40 (uri (crate-uri "exa" version))
41 (file-name
42 (string-append name "-" version ".tar.gz"))
43 (sha256
44 (base32
45 "1s902xgplz1167k0r7x235p914lprpsqy2if0kpa1mlb0fswqqq4"))))
46 (build-system cargo-build-system)
47 (arguments
48 `(#:cargo-inputs
49 (("rust-ansi-term" ,rust-ansi-term-0.12)
50 ("rust-datetime" ,rust-datetime-0.4)
51 ("rust-env-logger" ,rust-env-logger-0.6)
52 ("rust-git2" ,rust-git2-0.9)
53 ("rust-glob" ,rust-glob-0.3)
21c8ec75 54 ("rust-lazy-static" ,rust-lazy-static-1)
d42cbbba
JS
55 ("rust-libc" ,rust-libc-0.2)
56 ("rust-locale" ,rust-locale-0.2)
57 ("rust-log" ,rust-log-0.4)
58 ("rust-natord" ,rust-natord-1.0)
59 ("rust-num-cpus" ,rust-num-cpus-1.11)
60 ("rust-number-prefix" ,rust-number-prefix-0.3)
61 ("rust-scoped-threadpool" ,rust-scoped-threadpool-0.1)
62 ("rust-term-grid" ,rust-term-grid-0.1)
63 ("rust-term-size" ,rust-term-size-0.3)
64 ("rust-unicode-width" ,rust-unicode-width-0.1)
65 ("rust-users" ,rust-users-0.9)
66 ("rust-zoneinfo-compiled" ,rust-zoneinfo-compiled-0.4))
67 #:cargo-development-inputs
68 (("rust-datetime" ,rust-datetime-0.4))
69 #:phases
70 (modify-phases %standard-phases
71 (add-after 'configure 'dont-vendor-sources
72 (lambda* (#:key inputs #:allow-other-keys)
73 (let ((openssl (assoc-ref inputs "openssl")))
74 (setenv "OPENSSL_DIR" openssl))
75 #t))
76 ;; Ignoring failing tests.
77 ;; Reported in https://github.com/ogham/exa/issues/318
78 (add-before 'check 'disable-failing-tests
79 (lambda _
80 (substitute* "src/options/mod.rs"
81 (("^.*fn oneline_across.*" oneline-across)
82 (string-append "#[ignore]\n" oneline-across)))
83
84 (substitute* "src/options/view.rs"
85 (("test!\\(across:.*") "")
86 (("test!\\(empty:.*") "")
87 (("test!\\(gracross:.*") "")
88 (("test!\\(grid:.*") "")
89 (("test!\\(icons:.*") "")
90 (("test!\\(just_binary:.*") "")
91 (("test!\\(just_blocks:.*") "")
92 (("test!\\(just_bytes:.*") "")
93 (("test!\\(just_git:.*") "")
94 (("test!\\(just_group:.*") "")
95 (("test!\\(just_header:.*") "")
96 (("test!\\(just_inode:.*") "")
97 (("test!\\(just_links:.*") "")
98 (("test!\\(leg:.*") "")
99 (("test!\\(lid:.*") "")
100 (("test!\\(original_g:.*") ""))
b76473ec
EF
101 #t))
102 (add-after 'install 'install-extras
103 (lambda* (#:key outputs #:allow-other-keys)
104 (let* ((out (assoc-ref outputs "out"))
105 (share (string-append out "/share"))
106 (man1 (string-append share "/man/man1")))
107 (install-file "contrib/man/exa.1" man1)
108 (mkdir-p (string-append out "/etc/bash_completion.d"))
109 (mkdir-p (string-append share "/fish/vendor_completions.d"))
110 (mkdir-p (string-append share "/zsh/site-functions"))
111 (copy-file "contrib/completions.bash"
112 (string-append out "/etc/bash_completion.d/exa"))
113 (copy-file "contrib/completions.fish"
114 (string-append share "/fish/vendor_completions.d/exa.fish"))
115 (copy-file "contrib/completions.zsh"
116 (string-append share "/zsh/site-functions/_exa"))
117 #t))))))
d42cbbba
JS
118 (inputs
119 `(("libgit2" ,libgit2)
120 ("zlib" ,zlib)))
121 (native-inputs
122 `(("pkg-config" ,pkg-config)))
123 (home-page "https://the.exa.website/")
124 (synopsis "Modern replacement for ls")
125 (description "@code{exa} is a modern replacement for the command-line
126program @code{ls}. It uses colours to distinguish file types and metadata. It
127also knows about symlinks, extended attributes, and Git.")
128 (license license:expat)))
129
0f7720d1
JS
130(define-public fd
131 (package
132 (name "fd")
133 (version "7.4.0")
134 (source
135 (origin
136 (method url-fetch)
137 (uri (crate-uri "fd-find" version))
138 (file-name
139 (string-append name "-" version ".tar.gz"))
140 (sha256
141 (base32
142 "147m872zff0srwq9vaxkkbab06g3fkklbk1g2lx90vdhgs37f5xj"))))
143 (build-system cargo-build-system)
144 (arguments
145 `(#:cargo-inputs
146 (("rust-ansi-term" ,rust-ansi-term-0.12)
147 ("rust-atty" ,rust-atty-0.2)
148 ("rust-clap" ,rust-clap-2)
149 ("rust-ctrlc" ,rust-ctrlc-3.1)
150 ("rust-globset" ,rust-globset-0.4)
151 ("rust-humantime" ,rust-humantime-1.3)
152 ("rust-ignore" ,rust-ignore-0.4)
153 ("rust-jemallocator" ,rust-jemallocator-0.3)
21c8ec75 154 ("rust-lazy-static" ,rust-lazy-static-1)
0f7720d1
JS
155 ("rust-libc" ,rust-libc-0.2)
156 ("rust-lscolors" ,rust-lscolors-0.6)
157 ("rust-num-cpus" ,rust-num-cpus-1.10)
158 ("rust-regex" ,rust-regex-1.3)
159 ("rust-regex-syntax" ,rust-regex-syntax-0.6)
160 ("rust-version-check" ,rust-version-check-0.9))
161 #:cargo-development-inputs
162 (("rust-diff" ,rust-diff-0.1)
163 ("rust-filetime" ,rust-filetime-0.2)
164 ("rust-tempdir" ,rust-tempdir-0.3))
165 #:phases
166 (modify-phases %standard-phases
167 (add-after 'unpack 'override-jemalloc
168 (lambda* (#:key inputs #:allow-other-keys)
169 (let ((jemalloc (assoc-ref inputs "jemalloc")))
170 (setenv "JEMALLOC_OVERRIDE"
171 (string-append jemalloc "/lib/libjemalloc.so")))
172 #t))
173 (add-after 'install 'install-extra
174 (lambda* (#:key outputs #:allow-other-keys)
175 (let* ((out (assoc-ref outputs "out"))
176 (install-completion
177 (lambda (completion out-dir)
178 (for-each
179 (lambda (f)
180 (install-file f (string-append out out-dir)))
181 (find-files "target/release/build/" completion)))))
182 ;; Manpages
183 (install-file "doc/fd.1" (string-append out "/share/man/man1"))
184 ;; Completions
185 (install-completion "^fd.bash$" "/etc/bash-completion.d")
186 (install-completion "^fd.fish$" "/share/fish/vendor_completions.d")
187 (install-completion "^_fd$" "/share/zsh/site-functions")
188 (rename-file (string-append out "/etc/bash-completion.d/fd.bash")
189 (string-append out "/etc/bash-completion.d/fd"))
190 #t))))))
191 (inputs `(("jemalloc" ,jemalloc)))
192 (home-page "https://github.com/sharkdp/fd")
193 (synopsis "Simple, fast and user-friendly alternative to find")
194 (description
195 "@code{fd} is a simple, fast and user-friendly alternative to @code{find}.
196While it does not seek to mirror all of find's powerful functionality, it
197provides defaults for 80% of the use cases.")
198 (license (list license:expat license:asl2.0))))
199
9e225670
JS
200(define-public ripgrep
201 (package
202 (name "ripgrep")
16ffc3b6 203 (version "11.0.2")
9e225670
JS
204 (source
205 (origin
206 (method url-fetch)
207 (uri (crate-uri "ripgrep" version))
208 (file-name
209 (string-append name "-" version ".tar.gz"))
210 (sha256
211 (base32
16ffc3b6 212 "0vqjr96s2rs45715hzf0g0wjahig4zjyiqfijmzzg4jyh9ni80yr"))))
9e225670
JS
213 (build-system cargo-build-system)
214 (arguments
215 `(#:cargo-inputs
16ffc3b6 216 (("rust-bstr" ,rust-bstr-0.2)
9e225670
JS
217 ("rust-clap" ,rust-clap-2)
218 ("rust-grep" ,rust-grep-0.2)
219 ("rust-ignore" ,rust-ignore-0.4)
16ffc3b6 220 ("rust-jemallocator" ,rust-jemallocator-0.3)
21c8ec75 221 ("rust-lazy-static" ,rust-lazy-static-1)
9e225670
JS
222 ("rust-log" ,rust-log-0.4)
223 ("rust-num-cpus" ,rust-num-cpus-1.10)
224 ("rust-regex" ,rust-regex-1.1)
225 ("rust-serde-json" ,rust-serde-json-1.0)
226 ("rust-termcolor" ,rust-termcolor-1.0))
227 #:cargo-development-inputs
16ffc3b6 228 (("rust-serde" ,rust-serde-1.0)
9e225670
JS
229 ("rust-serde-derive" ,rust-serde-derive-1.0))))
230 (home-page "https://github.com/BurntSushi/ripgrep")
231 (synopsis "Line-oriented search tool")
232 (description
233 "ripgrep is a line-oriented search tool that recursively searches
234your current directory for a regex pattern while respecting your
235gitignore rules.")
236 (license (list license:unlicense license:expat))))
c5c48761
EF
237
238(define-public rust-cbindgen
239 (package
240 (name "rust-cbindgen")
c153010b 241 (version "0.13.0")
c5c48761
EF
242 (source
243 (origin
244 (method url-fetch)
245 (uri (crate-uri "cbindgen" version))
246 (file-name (string-append name "-" version ".crate"))
247 (sha256
248 (base32
c153010b 249 "1kywaz62cglg8fv0p7mp1m946gwmrf62s8ffndd5zpf1mz21j472"))))
c5c48761
EF
250 (build-system cargo-build-system)
251 (arguments
252 `(#:cargo-inputs
253 (("clap" ,rust-clap-2)
254 ("log" ,rust-log-0.4)
255 ("proc-macro2" ,rust-proc-macro2-1.0)
256 ("quote" ,rust-quote-1.0)
257 ("serde" ,rust-serde-1.0)
258 ("serde-json" ,rust-serde-json-1.0)
259 ("syn" ,rust-syn-1.0)
260 ("tempfile" ,rust-tempfile-3.0)
ef3827da 261 ("toml" ,rust-toml-0.5))))
c5c48761
EF
262 (home-page "https://github.com/eqrion/cbindgen/")
263 (synopsis "Tool for generating C bindings to Rust code")
264 (description
265 "This package provides a tool for generating C/C++ bindings to Rust code.")
266 (license license:mpl2.0)))
e29315b2
JS
267
268(define-public tokei
269 (package
270 (name "tokei")
271 (version "10.1.1")
272 (source
273 (origin
274 (method url-fetch)
275 (uri (crate-uri "tokei" version))
276 (file-name
277 (string-append name "-" version ".tar.gz"))
278 (sha256
279 (base32
280 "07f5laqw2k9l3k8wrg9h8p2m5d9hkfxngyacwrn3vs7mlnw8l81m"))))
281 (build-system cargo-build-system)
282 (arguments
283 `(#:cargo-inputs
284 (("rust-clap" ,rust-clap-2)
285 ("rust-crossbeam-channel" ,rust-crossbeam-channel-0.4)
286 ("rust-dirs" ,rust-dirs-2.0)
287 ("rust-encoding-rs-io" ,rust-encoding-rs-io-0.1)
288 ("rust-env-logger" ,rust-env-logger-0.7)
289 ("rust-grep-searcher" ,rust-grep-searcher-0.1)
290 ("rust-hex" ,rust-hex-0.4)
291 ("rust-ignore" ,rust-ignore-0.4)
292 ("rust-log" ,rust-log-0.4)
293 ("rust-rayon" ,rust-rayon-1.3)
294 ("rust-serde" ,rust-serde-1.0)
295 ("rust-serde-cbor" ,rust-serde-cbor-0.10)
296 ("rust-serde-derive" ,rust-serde-derive-1.0)
297 ("rust-serde-json" ,rust-serde-json-1.0)
298 ("rust-serde-yaml" ,rust-serde-yaml-0.8)
299 ("rust-term-size" ,rust-term-size-0.3)
c40e3d0b 300 ("rust-toml" ,rust-toml-0.5))
e29315b2
JS
301 #:cargo-development-inputs
302 (("rust-git2" ,rust-git2-0.11)
303 ("rust-handlebars" ,rust-handlebars-2.0)
304 ("rust-ignore" ,rust-ignore-0.4)
21c8ec75 305 ("rust-lazy-static" ,rust-lazy-static-1)
e29315b2
JS
306 ("rust-regex" ,rust-regex-1.3)
307 ("rust-serde-json" ,rust-serde-json-1.0)
c40e3d0b
EF
308 ("rust-tempfile" ,rust-tempfile-3.0))
309 #:phases
310 (modify-phases %standard-phases
311 (add-after 'configure 'unvendor-libraries-from-crates
312 (lambda* (#:key inputs #:allow-other-keys)
313 (let ((openssl (assoc-ref inputs "openssl")))
61b95c15 314 (setenv "OPENSSL_DIR" openssl))
c40e3d0b
EF
315 #t)))))
316 (native-inputs
317 `(("libgit2" ,libgit2)
318 ("openssl" ,openssl)
319 ("pkg-config" ,pkg-config)
320 ("zlib" ,zlib)))
e29315b2
JS
321 (home-page "https://tokei.rs")
322 (synopsis "Count code, quickly")
323 (description
324 "Tokei is a program that displays statistics about your code. Tokei will
325show number of files, total lines within those files and code, comments, and
326blanks grouped by language.")
327 (license (list license:expat license:asl2.0))))