projects/guix·blob onnx · refs

1220 lines · 49.7 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2016 Matthew Jordan <[email protected]>
3;;; Copyright © 2016, 2017 Alex Griffin <[email protected]>
4;;; Copyright © 2016 Christopher Baines <[email protected]>
5;;; Copyright © 2017 Stefan Reichör <[email protected]>
6;;; Copyright © 2018, 2020 Tobias Geerinckx-Rice <[email protected]>
7;;; Copyright © 2018 Benjamin Slade <[email protected]>
8;;; Copyright © 2019 Collin J. Doering <[email protected]>
9;;; Copyright © 2020, 2022 Michael Rohleder <[email protected]>
10;;; Copyright © 2020 aecepoglu <[email protected]>
11;;; Copyright © 2020 Dion Mendel <[email protected]>
12;;; Copyright © 2021 Brice Waegeneire <[email protected]>
13;;; Copyright © 2021 Alexandr Vityazev <[email protected]>
14;;; Copyright © 2021 Xinglu Chen <[email protected]>
15;;; Copyright © 2021 Foo Chuan Wei <[email protected]>
16;;; Copyright © 2021 Wiktor Żelazny <[email protected]>
17;;; Copyright © 2022 Jose G Perez Taveras <[email protected]>
18;;; Copyright © 2023 Timo Wilken <[email protected]>
19;;; Copyright © 2023, 2025 Camilo Q.S. (Distopico) <[email protected]>
20;;; Copyright © 2023 Zheng Junjie <[email protected]>
21;;; Copyright © 2024 Artyom V. Poptsov <[email protected]>
22;;; Copyright © 2024 Brian Kubisiak <[email protected]>
23;;; Copyright © 2024 Jordan Moore <[email protected]>
24;;; Copyright © 2025 Gabriel Santos <[email protected]>
25;;; Copyright © 2025 Skylar Hill <[email protected]>
26;;;
27;;; This file is part of GNU Guix.
28;;;
29;;; GNU Guix is free software; you can redistribute it and/or modify it
30;;; under the terms of the GNU General Public License as published by
31;;; the Free Software Foundation; either version 3 of the License, or (at
32;;; your option) any later version.
33;;;
34;;; GNU Guix is distributed in the hope that it will be useful, but
35;;; WITHOUT ANY WARRANTY; without even the implied warranty of
36;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
37;;; GNU General Public License for more details.
38;;;
39;;; You should have received a copy of the GNU General Public License
40;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
41
42(define-module (gnu packages shellutils)
43 #:use-module ((guix licenses) #:prefix license:)
44 #:use-module (guix gexp)
45 #:use-module (guix utils)
46 #:use-module (guix packages)
47 #:use-module (guix download)
48 #:use-module (guix git-download)
49 #:use-module (guix build-system cargo)
50 #:use-module (guix build-system copy)
51 #:use-module (guix build-system gnu)
52 #:use-module (guix build-system go)
53 #:use-module (guix build-system pyproject)
54 #:use-module (gnu packages)
55 #:use-module (gnu packages admin)
56 #:use-module (gnu packages autotools)
57 #:use-module (gnu packages base)
58 #:use-module (gnu packages bison)
59 #:use-module (gnu packages check)
60 #:use-module (gnu packages cmake)
61 #:use-module (gnu packages compiler-tools)
62 #:use-module (gnu packages golang-build)
63 #:use-module (gnu packages golang-check)
64 #:use-module (gnu packages golang-xyz)
65 #:use-module (gnu packages libunistring)
66 #:use-module (gnu packages ncurses)
67 #:use-module (gnu packages perl)
68 #:use-module (gnu packages pcre)
69 #:use-module (gnu packages pkg-config)
70 #:use-module (gnu packages python)
71 #:use-module (gnu packages python-build)
72 #:use-module (gnu packages python-check)
73 #:use-module (gnu packages python-xyz)
74 #:use-module (gnu packages readline)
75 #:use-module (gnu packages ruby)
76 #:use-module (gnu packages ruby-check)
77 #:use-module (gnu packages ruby-xyz)
78 #:use-module (gnu packages shells)
79 #:use-module (gnu packages textutils)
80 #:use-module (gnu packages tmux)
81 #:use-module (gnu packages version-control)
82 #:use-module (gnu packages vim))
83
84(define-public ascii
85 (package
86 (name "ascii")
87 (version "3.31")
88 (source (origin
89 (method url-fetch)
90 (uri (string-append "http://www.catb.org/~esr/ascii/"
91 "ascii-" version ".tar.gz"))
92 (sha256
93 (base32
94 "0g0159sbw9a6arclhnza56ah8hz3wr16famvq4x1p4j6rigsg6ih"))))
95 (build-system gnu-build-system)
96 (arguments
97 (list #:make-flags
98 #~(list (string-append "CC=" #$(cc-for-target))
99 (string-append "PREFIX=" #$output))
100 #:phases
101 #~(modify-phases %standard-phases
102 (delete 'configure)
103 (add-before 'install 'create-directories
104 (lambda* (#:key outputs #:allow-other-keys)
105 (let* ((out (assoc-ref outputs "out"))
106 (bin (string-append out "/bin"))
107 (man1 (string-append out "/share/man/man1")))
108 (mkdir-p bin)
109 (mkdir-p man1)))))
110 #:tests? #f))
111 (home-page "http://www.catb.org/~esr/ascii/")
112 (synopsis "ASCII name and synonym chart")
113 (description
114 "The @code{ascii} utility provides easy conversion between various byte
115representations and the American Standard Code for Information Interchange
116(ASCII) character table. It knows about a wide variety of hex, binary, octal,
117Teletype mnemonic, ISO/ECMA code point, slang names, XML entity names, and
118other representations. Given any one on the command line, it will try to
119display all others. Called with no arguments it displays a handy small ASCII
120chart.")
121 (license license:bsd-2)))
122
123(define-public boxes
124 (package
125 (name "boxes")
126 (version "2.3.1")
127 (source (origin
128 (method git-fetch)
129 (uri (git-reference
130 (url "https://github.com/ascii-boxes/boxes")
131 (commit (string-append "v" version))))
132 (file-name (git-file-name name version))
133 (sha256
134 (base32
135 "028vg9h3vxz3icy7hmxgyqhn62953h1ls6bxwbhdwhl1lpj5py3n"))))
136 (build-system gnu-build-system)
137 (arguments
138 `(#:test-target "utest"
139 #:make-flags (list (string-append "GLOBALCONF="
140 (assoc-ref %outputs "out")
141 "/etc/boxes-config"))
142 #:modules
143 ((ice-9 match)
144 ,@%default-gnu-modules)
145 #:phases
146 (modify-phases %standard-phases
147 (delete 'configure)
148 (replace 'install
149 (lambda* (#:key outputs #:allow-other-keys)
150 (let ((out (assoc-ref outputs "out")))
151 (for-each (match-lambda
152 ((source target)
153 (install-file source
154 (string-append out "/" target))))
155 '(("out/boxes" "bin/")
156 ("doc/boxes.1" "share/man/man1/")
157 ("boxes-config" "etc/")))))))))
158 (native-inputs
159 (list bison flex cmocka
160 ;; For the tests.
161 xxd))
162 (inputs
163 (list ncurses libunistring pcre2))
164 (home-page "https://boxes.thomasjensen.com")
165 (synopsis "Command line ASCII boxes")
166 (description
167 "This command-line filter program draws ASCII-art boxes around your input
168text.")
169 (license license:gpl2)))
170
171(define-public zsh-autopair
172 (package
173 (name "zsh-autopair")
174 (version "1.0")
175 (home-page "https://github.com/hlissner/zsh-autopair")
176 (source (origin
177 (method git-fetch)
178 (uri (git-reference
179 (url "https://github.com/hlissner/zsh-autopair.git")
180 (commit (string-append "v" version))))
181 (file-name (git-file-name name version))
182 (sha256
183 (base32
184 "1h0vm2dgrmb8i2pvsgis3lshc5b0ad846836m62y8h3rdb3zmpy1"))))
185 (build-system copy-build-system)
186 (arguments
187 '(#:install-plan '(("autopair.zsh"
188 "/share/zsh/plugins/zsh-autopair/zsh-autopair.zsh"))))
189 (synopsis "Auto-close and delete matching delimiters in Zsh")
190 (description
191 "This Zsh plugin auto-closes, deletes, and skips over matching delimiters
192in Zsh intelligently.")
193 (license license:expat)))
194
195(define-public zsh-autosuggestions
196 (package
197 (name "zsh-autosuggestions")
198 (version "0.7.1")
199 (source (origin
200 (method git-fetch)
201 (uri (git-reference
202 (url "https://github.com/zsh-users/zsh-autosuggestions")
203 (commit (string-append "v" version))))
204 (file-name (git-file-name name version))
205 (sha256
206 (base32
207 "02p5wq93i12w41cw6b00hcgmkc8k80aqzcy51qfzi0armxig555y"))))
208 (build-system gnu-build-system)
209 (native-inputs
210 (list ruby
211 ruby-pry
212 ruby-rspec
213 ruby-rspec-wait
214 tmux
215 zsh))
216 (arguments
217 (list
218 #:phases
219 #~(modify-phases %standard-phases
220 (add-after 'unpack 'patch-tests
221 (lambda _
222 ;; Failing tests since tmux-3.2a
223 (delete-file "spec/options/buffer_max_size_spec.rb")))
224 (delete 'configure)
225 (replace 'check ; Tests use ruby's bundler; instead execute rspec directly.
226 (lambda _
227 (setenv "TMUX_TMPDIR" (getenv "TMPDIR"))
228 (setenv "SHELL" (which "zsh"))
229 (invoke "rspec")))
230 (replace 'install
231 (lambda* (#:key outputs #:allow-other-keys)
232 (let* ((out (assoc-ref outputs "out"))
233 (zsh-plugins
234 (string-append out "/share/zsh/plugins/zsh-autosuggestions")))
235 (invoke "make" "all")
236 (install-file "zsh-autosuggestions.zsh" zsh-plugins)))))))
237 (home-page "https://github.com/zsh-users/zsh-autosuggestions")
238 (synopsis "Fish-like autosuggestions for zsh")
239 (description
240 "Fish-like fast/unobtrusive autosuggestions for zsh. It suggests commands
241as you type.")
242 (license license:expat)))
243
244(define-public zsh-completions
245 (package
246 (name "zsh-completions")
247 (version "0.36.0")
248 (home-page "https://github.com/zsh-users/zsh-completions")
249 (source (origin
250 (method git-fetch)
251 (uri (git-reference
252 (url home-page)
253 (commit version)))
254 (file-name (git-file-name name version))
255 (sha256
256 (base32
257 "0ah3q756f1aahinzfb0mxbqv177ypg5pcnrv59rpqzm17kn8492w"))))
258 (build-system copy-build-system)
259 (arguments
260 '(#:install-plan '(("src/" "share/zsh/site-functions/")
261 ("README.md" "share/doc/zsh-completions/"))))
262 (synopsis "Additional completion definitions for Zsh")
263 (description
264 "This projects aims at gathering/developing new completion scripts that
265are not available in Zsh yet. The scripts may be contributed to the Zsh
266project when stable enough.")
267 (license (license:non-copyleft "file://LICENSE"
268 "Custom BSD-like, permissive, non-copyleft license."))))
269
270(define-public zsh-history-substring-search
271 (package
272 (name "zsh-history-substring-search")
273 (version "1.1.0")
274 (home-page "https://github.com/zsh-users/zsh-history-substring-search")
275 (source (origin
276 (method git-fetch)
277 (uri (git-reference
278 (url home-page)
279 (commit (string-append "v" version))))
280 (file-name (git-file-name name version))
281 (sha256
282 (base32
283 "0vjw4s0h4sams1a1jg9jx92d6hd2swq4z908nbmmm2qnz212y88r"))))
284 (build-system copy-build-system)
285 (arguments
286 '(#:install-plan '(("zsh-history-substring-search.plugin.zsh"
287 "share/zsh/plugins/zsh-history-substring-search/")
288 ("zsh-history-substring-search.zsh"
289 "share/zsh/plugins/zsh-history-substring-search/")
290 ("README.md" "share/doc/zsh-history-substring-search/"))))
291 (synopsis "ZSH port of Fish history search (up arrow)")
292 (description
293 "This is a clean-room implementation of the Fish shell's history search
294feature, where you can type in any part of any command from history and then
295press chosen keys, such as the UP and DOWN arrows, to cycle through matches.")
296 (license license:bsd-3)))
297
298(define-public zsh-syntax-highlighting
299 (package
300 (name "zsh-syntax-highlighting")
301 (version "0.8.0")
302 (source (origin
303 (method git-fetch)
304 (uri (git-reference
305 (url "https://github.com/zsh-users/zsh-syntax-highlighting")
306 (commit version)))
307 (file-name (git-file-name name version))
308 (sha256
309 (base32
310 "0f482llznpkdg3kv92mjq53djpi4023bdmq06lk1qh05gnp2qg46"))))
311 (build-system gnu-build-system)
312 (native-inputs
313 (list zsh coreutils grep))
314 (arguments
315 ;; FIXME: Tests have expected failures (easy way to skip just those tests?)
316 (list
317 #:tests? #f
318 #:phases
319 #~(modify-phases %standard-phases
320 (delete 'configure)
321 (add-after 'unpack 'patch-paths
322 (lambda _
323 (substitute* "Makefile"
324 (("/usr/local") #$output)
325 (("share/\\$\\(NAME\\)") "share/zsh/plugins/$(NAME)")
326 (("env -i") "env -i PATH=$$PATH"))))
327 (add-after 'patch-paths 'make-writable
328 (lambda _
329 (for-each make-file-writable
330 '("docs/highlighters.md"
331 "README.md"))))
332 (add-before 'build 'add-all-md
333 (lambda _
334 (invoke "make" "all")))
335 (replace 'check
336 (lambda* (#:key tests? #:allow-other-keys)
337 (when tests?
338 (invoke "make" "test" (string-append "ZSH=" #$zsh "/bin/zsh"))
339 (invoke "make" "perf" (string-append "ZSH=" #$zsh "/bin/zsh"))))))))
340 (home-page "https://github.com/zsh-users/zsh-syntax-highlighting")
341 (synopsis "Fish shell-like syntax highlighting for Zsh")
342 (description
343 "This package provides syntax highlighting for Zsh. It enables
344highlighting of commands whilst they are typed at a Zsh prompt into an
345interactive terminal. This helps in reviewing commands before running them,
346particularly in catching syntax errors.")
347 (license license:bsd-3)))
348
349(define-public zsh-vi-mode
350 (package
351 (name "zsh-vi-mode")
352 (version "0.11.0")
353 (home-page "https://github.com/jeffreytse/zsh-vi-mode")
354 (source
355 (origin
356 (method git-fetch)
357 (uri (git-reference
358 (url "https://github.com/jeffreytse/zsh-vi-mode")
359 (commit (string-append "v" version))))
360 (file-name (git-file-name name version))
361 (sha256
362 "0bs5p6p5846hcgf3rb234yzq87rfjs18gfha9w0y0nf5jif23dy5")))
363 (build-system copy-build-system)
364 (arguments
365 (list
366 #:install-plan
367 #~'(("zsh-vi-mode.zsh" "share/zsh/plugins/zsh-vi-mode/")
368 ("zsh-vi-mode.plugin.zsh" "share/zsh/plugins/zsh-vi-mode/"))))
369 (synopsis "Plugin to improve vi keybindings in zsh")
370 (description "This package provides a zsh vimkey plugin with more features,
371which more closely matches the standard behavior of vim.")
372 (license license:expat)))
373
374(define-public grml-zsh-config
375 (package
376 (name "grml-zsh-config")
377 (version "0.19.6")
378 (source (origin
379 (method url-fetch)
380 (uri (string-append
381 "https://deb.grml.org/pool/main/g/grml-etc-core/grml-etc-core_"
382 version ".tar.gz"))
383 (sha256
384 (base32
385 "1k1m2fbmvw73qy9mc6k2ygjg6zz8h7nn3d9pvj6jbjadnx4pz770"))))
386 (build-system copy-build-system)
387 (arguments
388 (list
389 #:phases
390 #~(modify-phases
391 %standard-phases
392 (add-before 'install 'make-doc
393 (lambda _ (with-directory-excursion "doc" (invoke "make")))))
394 #:install-plan
395 #~'(("etc/skel/.zshrc" "etc/skel/.zshrc")
396 ("etc/zsh/keephack" "etc/zsh/keephack")
397 ("etc/zsh/zshrc" "etc/zsh/zshrc")
398 ("doc/grmlzshrc.5" "share/man/man5/grmlzshrc.5"))))
399 (native-inputs (list txt2tags))
400 (home-page "https://grml.org/zsh/")
401 (synopsis "Grml's zsh configuration")
402 (description "This package provides an interactive setup for zsh
403preconfigured by the Grml project.")
404 (license license:gpl2)))
405
406(define-public sh-z
407 (package
408 (name "sh-z")
409 (version "1.11")
410 (source (origin
411 (method git-fetch)
412 (uri (git-reference
413 (url "https://github.com/rupa/z")
414 (commit (string-append "v" version))))
415 (file-name (git-file-name name version))
416 (sha256
417 (base32
418 "13zbgkj6y0qhvn5jpkrqbd4jjxjr789k228iwma5hjfh1nx7ghyb"))))
419 (build-system gnu-build-system)
420 (arguments
421 `(#:tests? #f ; No tests provided
422 #:phases
423 (modify-phases %standard-phases
424 (delete 'configure)
425 (delete 'build)
426 (replace 'install
427 (lambda* (#:key outputs #:allow-other-keys)
428 (let* ((out (assoc-ref outputs "out"))
429 (man (string-append out "/share/man/man1"))
430 (bin (string-append out "/bin")))
431 (install-file "z.sh" bin)
432 (chmod (string-append bin "/z.sh") #o755)
433 (install-file "z.1" man)
434 #t))))))
435 (synopsis "Jump about directories")
436 (description
437 "Tracks your most used directories, based on ``frecency''. After a short
438learning phase, z will take you to the most ``frecent'' directory that matches
439all of the regexes given on the command line in order.")
440 (home-page "https://github.com/rupa/z")
441 (license license:expat)))
442
443(define-public shfmt
444 (package
445 (name "shfmt")
446 (version "3.12.0")
447 (source
448 (origin
449 (method git-fetch)
450 (uri (git-reference
451 (url "https://github.com/mvdan/sh")
452 (commit (string-append "v" version))))
453 (file-name (git-file-name name version))
454 (sha256
455 (base32 "11rlx3l37aspd9674xdisw394bdly0yb38asqxaz4riadgj0vbfx"))
456 (modules '((guix build utils)))
457 (snippet
458 #~(begin
459 ;; It fails during check phase, looks like a MVP: gosh is a proof
460 ;; of concept shell built on top of [interp].
461 (delete-file-recursively "cmd/gosh")))))
462 (build-system go-build-system)
463 (arguments
464 (list
465 #:install-source? #f
466 #:import-path "mvdan.cc/sh/v3/cmd/shfmt"
467 #:unpack-path "mvdan.cc/sh/v3"
468 #:test-flags
469 ;; Tests fail for these groups unable to set locale.
470 #~(list "-skip" (string-join
471 (list "FuzzQuote"
472 "TestKillTimeout"
473 "TestParseBashConfirm"
474 "TestParseErrBashConfirm"
475 "TestRunnerRun"
476 "TestRunnerRunConfirm")
477 "|"))
478 #:test-subdirs #~(list "../../...") ;test the whole library
479 #:phases
480 #~(modify-phases %standard-phases
481 (add-after 'unpack 'set-version
482 (lambda* (#:key unpack-path #:allow-other-keys)
483 (with-directory-excursion (string-append "src/" unpack-path)
484 (let ((fixed-version (string-append #$version " (GNU Guix)")))
485 ;; shfmt uses modules to look up the version at runtime;
486 ;; since our build system does not yet support modules,
487 ;; inject the version string here instead
488 (substitute* "cmd/shfmt/main.go"
489 (("version = \"\\(devel\\)\"")
490 (format #f "version = \"~a\"" fixed-version)))
491 (substitute* "cmd/shfmt/testdata/script/flags.txtar"
492 (("devel\\|v3") #$version)))))))))
493 (native-inputs
494 (list go-github-com-creack-pty
495 go-github-com-go-quicktest-qt
496 go-github-com-google-go-cmp
497 go-github-com-google-renameio-v2
498 go-github-com-rogpeppe-go-internal-1.14
499 go-golang-org-x-sys
500 go-golang-org-x-term
501 go-mvdan-cc-editorconfig))
502 (home-page "https://github.com/mvdan/sh")
503 (synopsis "Shell formatter with bash support")
504 (description
505 "This package provides a shell formatter. Supports
506@url{https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html,
507POSIX Shell}, @url{https://www.gnu.org/software/bash/, Bash}, and
508@url{http://www.mirbsd.org/mksh.htm, mksh}.")
509 (license license:bsd-3)))
510
511(define-public starship
512 (package
513 (name "starship")
514 (version "1.26.0")
515 (source
516 (origin
517 (method url-fetch)
518 (uri (crate-uri "starship" version))
519 (file-name (string-append name "-" version ".tar.gz"))
520 (sha256
521 (base32 "15jm2frr3l946drv1lazc9pa8fxpf324zcdwgya2p6h8r0505zv6"))
522 (patches
523 (search-patches "starship-test-timezone-fix.patch"))))
524 (build-system cargo-build-system)
525 (arguments
526 (list
527 #:install-source? #f
528 #:modules
529 '((guix build cargo-build-system)
530 (guix build utils)
531 (ice-9 match))
532 #:phases
533 #~(modify-phases %standard-phases
534 (add-after 'install 'install-completions
535 (lambda* (#:key native-inputs #:allow-other-keys)
536 (for-each
537 (match-lambda
538 ((shell . path)
539 (mkdir-p (in-vicinity #$output (dirname path)))
540 (let ((binary
541 (if #$(%current-target-system)
542 (search-input-file native-inputs "bin/starship")
543 (in-vicinity #$output "bin/starship"))))
544 (with-output-to-file (in-vicinity #$output path)
545 (lambda _
546 (invoke binary "completions" shell))))))
547 '(("bash" . "share/bash-completion/completions/starship")
548 ("elvish" . "share/elvish/lib/starship")
549 ("fish" . "share/fish/vendor_completions.d/starship.fish")
550 ("nushell" . "share/nushell/vendor/autoload/starship")
551 ("zsh" . "share/zsh/site-functions/_starship")))))
552 (add-after 'unpack 'patch-test-shell
553 (lambda* (#:key tests? inputs #:allow-other-keys)
554 ;; Search through the rust files and then replace `/bin/sh'
555 ;; with the full path for the tests.
556 (let ((rust-files (find-files "." "\\.rs$")))
557 (when tests?
558 (for-each (lambda (file)
559 (substitute* file
560 (("/bin/sh")
561 (search-input-file inputs "/bin/sh"))))
562 rust-files)))))
563 ;; Some tests require a writable home directory
564 ;; Set "HOME" to be located inside the cwd so it is writable
565 ;; for tests checking for user-configs
566 (add-before 'check 'set-test-env-vars
567 (lambda _
568 (setenv "HOME"
569 (string-append (getcwd) "/.test-home")))))))
570 (inputs (cargo-inputs 'starship))
571 (native-inputs
572 (append
573 (if (%current-target-system)
574 (list this-package)
575 '())
576 (list git-minimal/pinned)))
577 (home-page "https://starship.rs")
578 (synopsis "Fast and customizable shell prompt")
579 (description
580 "Starship is a shell prompt that is fast and configurable, and works on
581most common shells. It shows information from various sources in a way easy to
582grasp at a glance, including but not limited to: the hostname/username/cwd trio,
583git, project language and runtime.
584
585Note: Users must have a nerd font installed and enabled in their terminal.")
586 (license license:isc)))
587
588(define-public envstore
589 (package
590 (name "envstore")
591 (version "2.1")
592 (source
593 (origin
594 (method url-fetch)
595 (uri (string-append "https://finalrewind.org/projects/"
596 name "/" name "-" version ".tar.bz2"))
597 (sha256
598 (base32 "1x97lxad80m5blhdfanl5v2qzjwcgbij2i23701bn8mpyxsrqszi"))))
599 (build-system gnu-build-system)
600 (arguments
601 `(#:test-target "test"
602 #:make-flags (list "CC=gcc"
603 (string-append "PREFIX=" (assoc-ref %outputs "out")))
604 #:phases
605 (modify-phases %standard-phases
606 (delete 'configure))))
607 (home-page "https://finalrewind.org/projects/envstore/")
608 (synopsis "Save and restore environment variables")
609 (description "Envstore is a program for sharing environment variables
610between various shells or commands.")
611 (license license:wtfpl2)))
612
613(define-public trash-cli
614 (package
615 (name "trash-cli")
616 (version "0.24.5.26")
617 (source
618 (origin
619 (method git-fetch)
620 (uri (git-reference
621 (url "https://github.com/andreafrancia/trash-cli")
622 (commit version)))
623 (file-name (git-file-name name version))
624 (sha256
625 (base32 "1mqs3y9vbph33jsaa5hc0fhk80pklmsn8ylp979k9qj63fgqrnwn"))))
626 (build-system pyproject-build-system)
627 (arguments
628 (list
629 #:modules `((guix build pyproject-build-system)
630 (guix build utils)
631 (ice-9 match))
632 #:phases #~(modify-phases %standard-phases
633 (add-before 'build 'fix-setup.py
634 (lambda* (#:key outputs #:allow-other-keys)
635 (let ((bin (string-append #$output "/bin")))
636 (mkdir-p bin)
637 (substitute* "setup.py"
638 (("add_script\\('")
639 (string-append "add_script('" bin "/"))))))
640 (add-before 'wrap 'install-completions
641 (lambda _
642 (for-each
643 (lambda (binary)
644 (for-each
645 (match-lambda
646 ((shell . path)
647 (mkdir-p (dirname path))
648 (with-output-to-file path
649 (lambda _
650 (invoke
651 (string-append #$output "/bin/" binary)
652 "--print-completion" shell)))))
653 `(("bash" .
654 ,(format ;format string must be literal
655 #f "~a/share/bash-completion/completions/~a"
656 #$output binary))
657 ("zsh" .
658 ,(format #f "~a/share/zsh/site-functions/_~a"
659 #$output binary))
660 ("tcsh" .
661 ,(format #f "~a/etc/profile.d/~a.completion.csh"
662 #$output binary)))))
663 (list "trash"
664 "trash-empty"
665 "trash-list"
666 "trash-put"
667 "trash-restore"
668 "trash-rm")))))))
669 (native-inputs (list python-flexmock
670 python-mock
671 python-parameterized
672 python-pytest
673 python-setuptools
674 python-shtab
675 python-six
676 python-wheel))
677 (inputs (list coreutils))
678 (propagated-inputs (list python-psutil))
679 (home-page "https://github.com/andreafrancia/trash-cli")
680 (synopsis "Trash can management tool")
681 (description
682 "trash-cli is a command line utility for interacting with the
683FreeDesktop.org trash can used by GNOME, KDE, XFCE, and other common desktop
684environments. It can move files to the trash, and remove or list files that
685are already there.")
686 (license license:gpl2+)))
687
688(define-public tran
689 ;; There is no new release yet, but there are some changes in master brunch,
690 ;; see <https://github.com/kilobyte/tran/issues/4>.
691 (let ((commit "039df9529d5dfb8283edfb3c8b3cc16c01f0bfce")
692 (revision "0"))
693 (package
694 (name "tran")
695 ;; The latest upstream version seems to be "v5".
696 (version (git-version "5.0.0" revision commit))
697 (source
698 (origin
699 (method git-fetch)
700 (uri (git-reference
701 (url "https://github.com/kilobyte/tran")
702 (commit commit)))
703 (file-name (string-append name "-" version "-checkout"))
704 (sha256
705 (base32 "1kzr3lfhi5f8wpwjzrzlwkxjv9rasdr9ndjdns9kd16vsh0gl2rd"))))
706 (build-system gnu-build-system)
707 (arguments
708 (list
709 #:tests? #f ;no tests
710 #:phases
711 #~(modify-phases %standard-phases
712 (delete 'configure) ;no configure provided
713 (add-after 'unpack 'patch
714 (lambda _
715 (substitute* "tran"
716 (("my \\$DATA=\"data\"")
717 (format #f "my $DATA=\"~a/share/tran/data\"" #$output)))))
718 (replace 'build
719 (lambda _
720 (invoke "make")))
721 (delete 'strip)
722 (replace 'install
723 (lambda _
724 (install-file "tran" (string-append #$output "/bin/"))
725 (install-file "tran.1" (string-append
726 #$output "/share/man/man1/"))
727 (copy-recursively "data" (string-append
728 #$output "/share/tran/data/")))))))
729 (inputs (list perl))
730 (home-page "https://github.com/kilobyte/tran")
731 (synopsis "Transcription between character scripts")
732 (description
733 "This tool can transliterate/transcribe text both ways between the
734Latin script and other languages.")
735 (license license:expat))))
736
737(define-public direnv
738 (package
739 (name "direnv")
740 (version "2.37.1")
741 (source
742 (origin (method git-fetch)
743 (uri (git-reference
744 (url "https://github.com/direnv/direnv")
745 (commit (string-append "v" version))))
746 (file-name (git-file-name name version))
747 (sha256
748 (base32
749 "08wywbj5niqhpy6m4y8xw065w3rgpi8khfy5qzqfxr6752h66v7p"))))
750 (build-system go-build-system)
751 (arguments
752 (list #:install-source? #f
753 #:import-path "github.com/direnv/direnv"
754 #:phases
755 #~(modify-phases %standard-phases
756 (add-after 'install 'install-manpages
757 (lambda _
758 (let* ((man (string-append #$output "/share/man/man1")))
759 (mkdir-p man)
760 (with-directory-excursion "src/github.com/direnv/direnv"
761 (install-file "man/direnv.1" man)
762 (install-file "man/direnv-stdlib.1" man)
763 (install-file "man/direnv.toml.1" man)))))
764 (replace 'check
765 (lambda* (#:key tests? #:allow-other-keys)
766 (when tests?
767 (setenv "HOME" "/tmp")
768 (with-directory-excursion "src/github.com/direnv/direnv"
769 ;; The following file needs to be writable so it can be
770 ;; modified by the testsuite.
771 (make-file-writable "test/scenarios/base/.envrc")
772 ;; We need to manually run test because make test
773 ;; tries to use go modules
774 (invoke "go" "test" "./...")
775 ;; Clean up from the tests, especially so that the extra
776 ;; direnv executable that's generated is removed.
777 (invoke "make" "clean"))))))))
778 (native-inputs
779 (list go-github-com-burntsushi-toml
780 go-github-com-mattn-go-isatty
781 go-golang-org-x-mod
782 which))
783 (home-page "https://direnv.net/")
784 (synopsis "Environment switcher for the shell")
785 (description
786 "direnv can hook into the bash, zsh, tcsh, and fish shells to load
787or unload environment variables depending on the current directory. This
788allows project-specific environment variables without using @file{~/.profile}.
789
790Before each prompt, direnv checks for the existence of a @file{.envrc} file in
791the current and parent directories. This file is then used to alter the
792environment variables of the current shell.")
793 (license license:expat)))
794
795(define-public fzy
796 (package
797 (name "fzy")
798 (version "1.0")
799 (source
800 (origin
801 (method git-fetch)
802 (uri (git-reference
803 (url "https://github.com/jhawthorn/fzy")
804 (commit version)))
805 (file-name (git-file-name name version))
806 (sha256
807 (base32
808 "1gkzdvj73f71388jvym47075l9zw61v6l8wdv2lnc0mns6dxig0k"))))
809 (build-system gnu-build-system)
810 (arguments
811 (list #:make-flags
812 #~(list (string-append "CC=" #$(cc-for-target))
813 (string-append "PREFIX=" #$output))
814 #:phases
815 #~(modify-phases %standard-phases
816 (delete 'configure))))
817 (home-page "https://github.com/jhawthorn/fzy")
818 (synopsis "Fast fuzzy text selector for the terminal with an advanced
819scoring algorithm")
820 (description
821 "Most other fuzzy matchers sort based on the length of a match. fzy tries
822to find the result the user intended. It does this by favouring matches on
823consecutive letters and starts of words. This allows matching using acronyms
824or different parts of the path.
825
826fzy is designed to be used both as an editor plugin and on the command
827line. Rather than clearing the screen, fzy displays its interface directly
828below the current cursor position, scrolling the screen if necessary.")
829 (license license:expat)))
830
831(define-public hstr
832 (package
833 (name "hstr")
834 (version "3.1")
835 (source (origin
836 (method git-fetch)
837 (uri (git-reference
838 (url "https://github.com/dvorka/hstr")
839 (commit version)))
840 (file-name (git-file-name name version))
841 (sha256
842 (base32
843 "1w1xr0ddf34i46b8wwz2snf7ap6m0mv53zid3d1l5hc4m3az5qis"))))
844 (build-system gnu-build-system)
845 (arguments
846 `(#:phases
847 (modify-phases %standard-phases
848 (add-before 'build 'adjust-ncurses-includes
849 (lambda* (#:key make-flags outputs #:allow-other-keys)
850 (let ((out (assoc-ref outputs "out")))
851 (substitute* "src/include/hstr_curses.h"
852 (("ncursesw\\/curses.h") "ncurses.h"))
853 (substitute* "src/include/hstr.h"
854 (("ncursesw\\/curses.h") "ncurses.h")))
855 #t)))))
856 (native-inputs
857 (list autoconf automake pkg-config))
858 (inputs
859 (list ncurses readline))
860 (synopsis "Navigate and search command history with shell history suggest box")
861 (description "HSTR (HiSToRy) is a command-line utility that brings
862improved Bash and Zsh command completion from the history. It aims to make
863completion easier and more efficient than with @kbd{Ctrl-R}. It allows you to
864easily view, navigate, and search your command history with suggestion boxes.
865HSTR can also manage your command history (for instance you can remove
866commands that are obsolete or contain a piece of sensitive information) or
867bookmark your favourite commands.")
868 (home-page "https://me.mindforger.com/projects/hh.html")
869 (license license:asl2.0)))
870
871(define-public shell-functools
872 ;; v0.3.0 was released in 2018, there are changes providing fixes to the
873 ;; test suite, use the latest commit.
874 (let ((commit "530e3b6f098c41869f9dc47d1a3005e12ce300c0")
875 (revision "0"))
876 (package
877 (name "shell-functools")
878 (version (git-version "0.3.0" revision commit))
879 (source (origin
880 (method git-fetch)
881 (uri (git-reference
882 (url "https://github.com/sharkdp/shell-functools")
883 (commit commit)))
884 (file-name (git-file-name name version))
885 (sha256
886 (base32
887 "0l23n5anppxds4678qnh84mykbdb7qxyjrxxjzm7kin7izfzczpa"))))
888 (build-system pyproject-build-system)
889 (native-inputs
890 (list python-pytest
891 python-hatchling))
892 (home-page "https://github.com/sharkdp/shell-functools/")
893 (synopsis "Functional programming tools for the shell")
894 (description
895 "This package provides higher order functions like map,filter, foldl,
896sort_by and take_while as simple command-line tools. Following the UNIX
897philosophy, these commands are designed to be composed via pipes. A large
898collection of functions such as basename, replace, contains or is_dir are
899provided as arguments to these commands.")
900 (license license:expat))))
901
902(define-public rig
903 (package
904 (name "rig")
905 (version "1.11")
906 (source (origin
907 (method url-fetch)
908 (uri (string-append "mirror://sourceforge/rig/rig/"
909 version "/rig-"
910 version ".tar.gz"))
911 (sha256
912 (base32
913 "1f3snysjqqlpk2kgvm5p2icrj4lsdymccmn3igkc2f60smqckgq0"))))
914 (build-system gnu-build-system)
915 (arguments `(#:make-flags
916 (list (string-append "CXX=" ,(cxx-for-target))
917 (string-append "PREFIX=" %output))
918 #:phases
919 (modify-phases %standard-phases
920 (delete 'configure)
921 (add-after 'unpack 'fix-build
922 (lambda _
923 (substitute* "rig.cc"
924 (("^#include <string>")
925 "#include <cstring>"))
926 (substitute* "Makefile"
927 (("g\\+\\+")
928 "${CXX} -O2")
929 (("install -g 0 -m 755 -o 0 -s rig \\$\\(BINDIR\\)")
930 "install -m 755 -d $(DESTDIR)$(BINDIR)\n\t\
931install -m 755 rig $(DESTDIR)$(BINDIR)/rig")
932 (("install -g 0 -m 644 -o 0 rig.6 \\$\\(MANDIR\\)/man6/rig.6")
933 "install -m 755 -d $(DESTDIR)$(MANDIR)/man6/\n\t\
934install -m 644 rig.6 $(DESTDIR)$(MANDIR)/man6/rig.6")
935 (("install -g 0 -m 755 -o 0 -d \\$\\(DATADIR\\)")
936 "install -m 755 -d $(DESTDIR)$(DATADIR)")
937 (("install -g 0 -m 644 -o 0 data/\\*.idx \\$\\(DATADIR\\)")
938 "install -m 644 data/*.idx $(DESTDIR)$(DATADIR)")))))
939 #:tests? #f))
940 (home-page "https://rig.sourceforge.net")
941 (synopsis "Random identity generator")
942 (description
943 "RIG (Random Identity Generator) generates random, yet real-looking,
944personal data. It is useful if you need to feed a name to a Web site, BBS, or
945real person, and are too lazy to think of one yourself. Also, if the Web
946site/BBS/person you are giving the information to tries to cross-check the
947city, state, zip, or area code, it will check out.")
948 (license license:gpl2+)))
949
950(define-public conflict
951 (package
952 (name "conflict")
953 (version "20221002")
954 (source (origin
955 (method url-fetch)
956 (uri (string-append
957 "https://invisible-mirror.net/archives/conflict/conflict-"
958 version ".tgz"))
959 (sha256
960 (base32
961 "1z6z61yiss9m45m3agqs92l569r55w9nsqaap56kh568mcy3y64c"))))
962 (build-system gnu-build-system)
963 (arguments
964 `(#:phases
965 (modify-phases %standard-phases
966 (add-after 'unpack 'fix-paths
967 (lambda _
968 (substitute* "run_test.sh"
969 (("PATH=\".:\\$BIN:/bin\"")
970 "PATH=\".:$BIN:$PATH\"")))))))
971 (home-page "https://invisible-island.net/conflict/conflict.html")
972 (synopsis "Displays conflicting filenames in your execution path")
973 (description
974 "@code{conflict} examines the user-specifiable list of programs, looking
975for instances in the user's path which conflict (i.e., the name appears in
976more than one point in the path).")
977 (license (license:x11-style "file://COPYING"))))
978
979(define-public renameutils
980 (package
981 (name "renameutils")
982 (version "0.12.0")
983 (source
984 (origin
985 (method url-fetch)
986 (uri (string-append "mirror://savannah/renameutils/"
987 "renameutils-" version ".tar.gz"))
988 (sha256
989 (base32
990 "18xlkr56jdyajjihcmfqlyyanzyiqqlzbhrm6695mkvw081g1lnb"))
991 (modules '((guix build utils)))
992 (snippet '(begin
993 (substitute* "src/Makefile.in"
994 (("\\(\\$bindir\\)") "$(bindir)"))
995 #t))))
996 (build-system gnu-build-system)
997 (inputs
998 (list readline))
999 (home-page "https://www.nongnu.org/renameutils/")
1000 (synopsis "File renaming utilities")
1001 (description "The file renaming utilities (renameutils for short) are a
1002set of programs designed to make renaming of files faster and less cumbersome.
1003The file renaming utilities consists of five programs: @command{qmv},
1004@command{qcp}, @command{imv}, @command{icp}, and @command{deurlname}.")
1005 (license license:gpl3+)))
1006
1007(define-public grc
1008 (package
1009 (name "grc")
1010 (version "1.13")
1011 (source
1012 (origin
1013 (method git-fetch)
1014 (uri (git-reference
1015 (url "https://github.com/garabik/grc")
1016 (commit (string-append "v" version))))
1017 (file-name (git-file-name name version))
1018 (sha256
1019 (base32 "1h0h88h484a9796hai0wasi1xmjxxhpyxgixn6fgdyc5h69gv8nl"))))
1020 (build-system gnu-build-system)
1021 (inputs
1022 (list python))
1023 (arguments
1024 (list
1025 #:phases
1026 #~(modify-phases %standard-phases
1027 (delete 'configure)
1028 (replace 'build
1029 (lambda _
1030 (substitute* "grc"
1031 (("conffilenames = \\[.*\\]")
1032 (string-append
1033 "conffilenames = ["
1034 "os.environ.get('GUIX_ENVIRONMENT', '" #$output "') "
1035 "+ '/etc/grc.conf']")))
1036 (substitute* "grcat"
1037 (("conffilepath \\+= \\['/usr/.*\\]")
1038 (string-append
1039 "conffilepath += ["
1040 "os.environ.get('GUIX_ENVIRONMENT', '" #$output "') "
1041 "+ '/share/grc/']"))))) ;; trailing slash!
1042 (delete 'check)
1043 (replace 'install
1044 (lambda _
1045 (invoke "sh" "install.sh" #$output #$output))))))
1046 (home-page "http://kassiopeia.juls.savba.sk/~garabik/software/grc.html")
1047 (synopsis "Generic colouriser for everything")
1048 (description "@code{grc} can be used to colourise logfiles, output of
1049shell commands, arbitrary text, etc. Many shell commands are supported out of
1050the box.
1051
1052You might want to add these lines you your @code{~/.bashrc}:
1053@example
1054GRC_ALIASES=true
1055source ${GUIX_ENVIRONMENT:-$HOME/.guix-profile}/etc/profile.d/grc.sh
1056@end example
1057")
1058 (license license:gpl2)))
1059
1060(define-public liquidprompt
1061 (package
1062 (name "liquidprompt")
1063 (version "2.2.1")
1064 (home-page "https://github.com/liquidprompt/liquidprompt")
1065 (source
1066 (origin
1067 (method git-fetch)
1068 (uri (git-reference
1069 (url "https://github.com/liquidprompt/liquidprompt")
1070 (commit (string-append "v" version))))
1071 (file-name (git-file-name name version))
1072 (sha256
1073 (base32 "1xm3cb2dinn0zqqqya4qz2v8mp8hb6f1mckqvc6npdf8xlcwap35"))))
1074 (build-system copy-build-system)
1075 (arguments
1076 (list
1077 #:install-plan #~'(("example.bashrc" "share/liquidprompt/examples/")
1078 ("liquidprompt" "share/liquidprompt/")
1079 ("contrib" "share/liquidprompt/")
1080 ("templates" "share/liquidprompt/")
1081 ("themes" "share/liquidprompt/")
1082 ("liquidprompt.plugin.zsh"
1083 "share/zsh/plugins/liquidprompt/")
1084 ("docs" #$(string-append "share/doc/" name "-"
1085 version "/")))
1086 #:phases #~(modify-phases %standard-phases
1087 (add-after 'unpack 'fix-plugin
1088 (lambda _
1089 (substitute* "liquidprompt.plugin.zsh"
1090 (("source(.*)$")
1091 (string-append "source "
1092 #$output
1093 "/share/liquidprompt/liquidprompt")))))
1094 (add-after 'fix-plugin 'fix-utils-path
1095 (lambda* (#:key inputs #:allow-other-keys)
1096 (substitute* "liquidprompt"
1097 (("([ (])\\\\?(tput|hostname|cksum|uname|tty|grep)([) ])"
1098 all beginning command ending)
1099 (string-append beginning
1100 (search-input-file
1101 inputs
1102 (string-append "bin/" command))
1103 ending)))))
1104 (add-after 'install 'install-generated-config
1105 (lambda* (#:key outputs #:allow-other-keys)
1106 (let* ((out (assoc-ref outputs "out"))
1107 (etc (string-append out "/etc"))
1108 (config (string-append etc "/liquidpromptrc")))
1109 (mkdir etc)
1110 (with-output-to-file config
1111 (lambda _
1112 (invoke "./tools/config-from-doc.sh")))))))))
1113 (inputs (list ncurses
1114 coreutils
1115 inetutils))
1116 (synopsis "Full-featured prompt for Bash & Zsh")
1117 (description
1118 "Liquidprompt is an adaptive prompt for Bash and Zsh that gives
1119you a nicely displayed prompt with useful information when you need it. It
1120does this with a powerful theming engine and a large array of data sources.
1121
1122In order to use liquidprompt with Zsh, you should use the following snippet
1123with Guix Home:
1124
1125@example
1126(service home-zsh-service-type
1127 (home-zsh-configuration
1128 (zshrc (list ;;...
1129 ;; This loads liquidprompt
1130 (mixed-text-file \"liquidprompt\"
1131 \"[[ $- = *i* ]] && source \" liquidprompt \"/share/liquidprompt/liquidprompt\")
1132 ;; This loads the powerline theme available in liquidprompt
1133 (mixed-text-file \"powerline-theme\"
1134 \"source \" liquidprompt \"/share/liquidprompt/themes/powerline/powerline.theme\"))))))
1135@end example\n")
1136 (license license:agpl3+)))
1137
1138(define-public fzf-tab
1139 (package
1140 (name "fzf-tab")
1141 (version "1.1.2")
1142 (home-page "https://github.com/Aloxaf/fzf-tab")
1143 (source (origin
1144 (method git-fetch)
1145 (uri (git-reference
1146 (url "https://github.com/Aloxaf/fzf-tab")
1147 (commit (string-append "v" version))))
1148 (file-name (git-file-name name version))
1149 (sha256
1150 (base32
1151 "061jjpgghn8d5q2m2cd2qdjwbz38qrcarldj16xvxbid4c137zs2"))))
1152 (build-system copy-build-system)
1153 (arguments
1154 '(#:install-plan '(("lib" "/share/zsh/plugins/fzf-tab/")
1155 ("modules" "/share/zsh/plugins/fzf-tab/")
1156 ("fzf-tab.plugin.zsh" "/share/zsh/plugins/fzf-tab/")
1157 ("fzf-tab.zsh" "/share/zsh/plugins/fzf-tab/")
1158 ("README.md" "/share/doc/fzf-tab/"))))
1159 (synopsis "Replace the zsh default completion menu with fzf")
1160 (description
1161 "The fzf-tab package replaces the default completion menu of the zsh
1162shell with fzf, enabling fuzzy finding and multi-selection.")
1163 (license license:expat)))
1164
1165(define-public pay-respects
1166 (package
1167 (name "pay-respects")
1168 (version "0.7.12")
1169 (source
1170 (origin
1171 (method url-fetch)
1172 (uri (crate-uri "pay-respects" version))
1173 (file-name (string-append name "-" version ".tar.gz"))
1174 (sha256
1175 (base32 "0nmh5kkjhsrmhwlb09wvg6chzpl7w7xq1qr1yy9gc202yrv6cnmk"))))
1176 (build-system cargo-build-system)
1177 (arguments
1178 (list
1179 #:install-source? #f
1180 #:modules
1181 '((guix build cargo-build-system)
1182 (guix build utils)
1183 (ice-9 match))
1184 #:phases
1185 #~(modify-phases %standard-phases
1186 (add-after 'install 'install-completions
1187 (lambda* (#:key native-inputs #:allow-other-keys)
1188 (for-each
1189 (match-lambda
1190 ((shell . path)
1191 (mkdir-p (in-vicinity #$output (dirname path)))
1192 (let ((binary
1193 (if #$(%current-target-system)
1194 (search-input-file native-inputs "bin/pay-respects")
1195 (in-vicinity #$output "bin/pay-respects"))))
1196 (with-output-to-file (in-vicinity #$output path)
1197 (lambda _
1198 (invoke binary shell)))
1199 ;; The shell completions call the binary so we make sure
1200 ;; that we call the correct binary.
1201 (when #$(%current-target-system)
1202 (substitute* (in-vicinity #$output path)
1203 (((search-input-file native-inputs "bin/pay-respects"))
1204 (in-vicinity #$output "bin/pay-respects")))))))
1205 '(("bash" . "share/bash-completion/completions/pay-respects")
1206 ("fish" . "share/fish/vendor_completions.d/pay-respects.fish")
1207 ("nushell" . "share/nushell/vendor/autoload/pay-respects")
1208 ("zsh" . "share/zsh/site-functions/_pay-respects"))))))))
1209 (native-inputs
1210 (if (%current-target-system)
1211 (list this-package)
1212 '()))
1213 (inputs (cargo-inputs 'pay-respects))
1214 (home-page "https://codeberg.org/iff/pay-respects")
1215 (synopsis "Suggest correction for mistyped console commands")
1216 (description
1217 "@command{pay-respects} provides a shell helper to suggest correction for
1218mistyped commands, with @command{guix locate} integration and an alias (default
1219to @command{f}) to correct the previous command.")
1220 (license license:agpl3+)))