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>
6 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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)
26 #:use-module (gnu packages compression)
27 #:use-module (gnu packages crates-io)
28 #:use-module (gnu packages jemalloc)
29 #:use-module (gnu packages pkg-config)
30 #:use-module (gnu packages tls)
31 #:use-module (gnu packages version-control))
40 (uri (crate-uri "exa" version))
42 (string-append name "-" version ".tar.gz"))
45 "1s902xgplz1167k0r7x235p914lprpsqy2if0kpa1mlb0fswqqq4"))))
46 (build-system cargo-build-system)
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)
54 ("rust-lazy-static" ,rust-lazy-static-1)
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))
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))
76 ;; Ignoring failing tests.
77 ;; Reported in https://github.com/ogham/exa/issues/318
78 (add-before 'check 'disable-failing-tests
80 (substitute* "src/options/mod.rs"
81 (("^.*fn oneline_across.*" oneline-across)
82 (string-append "#[ignore]\n" oneline-across)))
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:.*") ""))
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"))
119 `(("libgit2" ,libgit2)
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
126 program @code{ls}. It uses colours to distinguish file types and metadata. It
127 also knows about symlinks, extended attributes, and Git.")
128 (license license:expat)))
137 (uri (crate-uri "fd-find" version))
139 (string-append name "-" version ".tar.gz"))
142 "147m872zff0srwq9vaxkkbab06g3fkklbk1g2lx90vdhgs37f5xj"))))
143 (build-system cargo-build-system)
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)
154 ("rust-lazy-static" ,rust-lazy-static-1)
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))
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")))
173 (add-after 'install 'install-extra
174 (lambda* (#:key outputs #:allow-other-keys)
175 (let* ((out (assoc-ref outputs "out"))
177 (lambda (completion out-dir)
180 (install-file f (string-append out out-dir)))
181 (find-files "target/release/build/" completion)))))
183 (install-file "doc/fd.1" (string-append out "/share/man/man1"))
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"))
191 (inputs `(("jemalloc" ,jemalloc)))
192 (home-page "https://github.com/sharkdp/fd")
193 (synopsis "Simple, fast and user-friendly alternative to find")
195 "@code{fd} is a simple, fast and user-friendly alternative to @code{find}.
196 While it does not seek to mirror all of find's powerful functionality, it
197 provides defaults for 80% of the use cases.")
198 (license (list license:expat license:asl2.0))))
200 (define-public ripgrep
207 (uri (crate-uri "ripgrep" version))
209 (string-append name "-" version ".tar.gz"))
212 "0vqjr96s2rs45715hzf0g0wjahig4zjyiqfijmzzg4jyh9ni80yr"))))
213 (build-system cargo-build-system)
216 (("rust-bstr" ,rust-bstr-0.2)
217 ("rust-clap" ,rust-clap-2)
218 ("rust-grep" ,rust-grep-0.2)
219 ("rust-ignore" ,rust-ignore-0.4)
220 ("rust-jemallocator" ,rust-jemallocator-0.3)
221 ("rust-lazy-static" ,rust-lazy-static-1)
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
228 (("rust-serde" ,rust-serde-1.0)
229 ("rust-serde-derive" ,rust-serde-derive-1.0))))
230 (home-page "https://github.com/BurntSushi/ripgrep")
231 (synopsis "Line-oriented search tool")
233 "ripgrep is a line-oriented search tool that recursively searches
234 your current directory for a regex pattern while respecting your
236 (license (list license:unlicense license:expat))))
238 (define-public rust-cbindgen
240 (name "rust-cbindgen")
245 (uri (crate-uri "cbindgen" version))
246 (file-name (string-append name "-" version ".crate"))
249 "1kywaz62cglg8fv0p7mp1m946gwmrf62s8ffndd5zpf1mz21j472"))))
250 (build-system cargo-build-system)
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)
261 ("toml" ,rust-toml-0.5))))
262 (home-page "https://github.com/eqrion/cbindgen/")
263 (synopsis "Tool for generating C bindings to Rust code")
265 "This package provides a tool for generating C/C++ bindings to Rust code.")
266 (license license:mpl2.0)))
275 (uri (crate-uri "tokei" version))
277 (string-append name "-" version ".tar.gz"))
280 "07f5laqw2k9l3k8wrg9h8p2m5d9hkfxngyacwrn3vs7mlnw8l81m"))))
281 (build-system cargo-build-system)
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)
300 ("rust-toml" ,rust-toml-0.5))
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)
305 ("rust-lazy-static" ,rust-lazy-static-1)
306 ("rust-regex" ,rust-regex-1.3)
307 ("rust-serde-json" ,rust-serde-json-1.0)
308 ("rust-tempfile" ,rust-tempfile-3.0))
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")))
314 (setenv "OPENSSL_DIR" openssl))
317 `(("libgit2" ,libgit2)
319 ("pkg-config" ,pkg-config)
321 (home-page "https://tokei.rs")
322 (synopsis "Count code, quickly")
324 "Tokei is a program that displays statistics about your code. Tokei will
325 show number of files, total lines within those files and code, comments, and
326 blanks grouped by language.")
327 (license (list license:expat license:asl2.0))))