projects/guix·blob librewolf-updates · refs

1226 lines · 49.8 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 python) #:select (pypi-uri))
54 #:use-module (guix build-system pyproject)
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 flex)
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.0")
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 "1g3pij5qn2j7v7jjac2a63lxd97mcsgw6xq6k5p7835q9fjiid98"))))
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.34.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 "0jjgvzj3v31yibjmq50s80s3sqi4d91yin45pvn3fpnihcrinam9"))))
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.0.2")
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 "0y8va5kc2ram38hbk2cibkk64ffrabfv1sh4xm7pjspsba9n5p1y"))))
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.24.2")
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 "0q57nb66fww6c8kwfyl5dpv9c2gr721nbbqcpsrh9c6wd6c26339"))))
522 (build-system cargo-build-system)
523 (arguments
524 (list
525 #:install-source? #f
526 #:modules
527 '((guix build cargo-build-system)
528 (guix build utils)
529 (ice-9 match))
530 #:phases
531 #~(modify-phases %standard-phases
532 (add-after 'install 'install-completions
533 (lambda* (#:key native-inputs #:allow-other-keys)
534 (for-each
535 (match-lambda
536 ((shell . path)
537 (mkdir-p (in-vicinity #$output (dirname path)))
538 (let ((binary
539 (if #$(%current-target-system)
540 (search-input-file native-inputs "bin/starship")
541 (in-vicinity #$output "bin/starship"))))
542 (with-output-to-file (in-vicinity #$output path)
543 (lambda _
544 (invoke binary "completions" shell))))))
545 '(("bash" . "share/bash-completion/completions/starship")
546 ("elvish" . "share/elvish/lib/starship")
547 ("fish" . "share/fish/vendor_completions.d/starship.fish")
548 ("nushell" . "share/nushell/vendor/autoload/starship")
549 ("zsh" . "share/zsh/site-functions/_starship")))))
550 (add-after 'unpack 'patch-test-shell
551 (lambda* (#:key tests? inputs #:allow-other-keys)
552 ;; Search through the rust files and then replace `/bin/sh'
553 ;; with the full path for the tests.
554 (let ((rust-files (find-files "." "\\.rs$")))
555 (when tests?
556 (for-each (lambda (file)
557 (substitute* file
558 (("/bin/sh")
559 (search-input-file inputs "/bin/sh"))))
560 rust-files)))))
561 ;; Some tests require a writable home directory
562 ;; Set "HOME" to be located inside the cwd so it is writable
563 ;; for tests checking for user-configs
564 (add-before 'check 'set-test-env-vars
565 (lambda _
566 (setenv "HOME"
567 (string-append (getcwd) "/.test-home")))))))
568 (inputs (cargo-inputs 'starship))
569 (native-inputs
570 (append
571 (if (%current-target-system)
572 (list this-package)
573 '())
574 (list git-minimal)))
575 (home-page "https://starship.rs")
576 (synopsis
577 "The minimal, blazing-fast, and infinitely customizable prompt for any shell!")
578 (description
579 "This package provides The minimal, blazing-fast, and infinitely customizable
580prompt for any shell!
581
582@itemize
583@item Fast: it's fast - *really really* fast :rocket:
584@item Customizable: configure every aspect of your prompt
585@item Universal: works on any shell, on any operating system
586@item Intelligent: shows relevant information at a glance
587@item Feature rich: support for all your favorite tools
588@item Easy: quick to install - start using it in minutes
589@end itemize
590
591Note: users must have a nerd font installed and enabled in their terminal")
592 (license license:isc)))
593
594(define-public envstore
595 (package
596 (name "envstore")
597 (version "2.1")
598 (source
599 (origin
600 (method url-fetch)
601 (uri (string-append "https://finalrewind.org/projects/"
602 name "/" name "-" version ".tar.bz2"))
603 (sha256
604 (base32 "1x97lxad80m5blhdfanl5v2qzjwcgbij2i23701bn8mpyxsrqszi"))))
605 (build-system gnu-build-system)
606 (arguments
607 `(#:test-target "test"
608 #:make-flags (list "CC=gcc"
609 (string-append "PREFIX=" (assoc-ref %outputs "out")))
610 #:phases
611 (modify-phases %standard-phases
612 (delete 'configure))))
613 (home-page "https://finalrewind.org/projects/envstore/")
614 (synopsis "Save and restore environment variables")
615 (description "Envstore is a program for sharing environment variables
616between various shells or commands.")
617 (license license:wtfpl2)))
618
619(define-public trash-cli
620 (package
621 (name "trash-cli")
622 (version "0.24.5.26")
623 (source
624 (origin
625 (method git-fetch)
626 (uri (git-reference
627 (url "https://github.com/andreafrancia/trash-cli")
628 (commit version)))
629 (file-name (git-file-name name version))
630 (sha256
631 (base32 "1mqs3y9vbph33jsaa5hc0fhk80pklmsn8ylp979k9qj63fgqrnwn"))))
632 (build-system pyproject-build-system)
633 (arguments
634 (list
635 #:modules `((guix build pyproject-build-system)
636 (guix build utils)
637 (ice-9 match))
638 #:phases #~(modify-phases %standard-phases
639 (add-before 'build 'fix-setup.py
640 (lambda* (#:key outputs #:allow-other-keys)
641 (let ((bin (string-append #$output "/bin")))
642 (mkdir-p bin)
643 (substitute* "setup.py"
644 (("add_script\\('")
645 (string-append "add_script('" bin "/"))))))
646 (add-before 'wrap 'install-completions
647 (lambda _
648 (for-each
649 (lambda (binary)
650 (for-each
651 (match-lambda
652 ((shell . path)
653 (mkdir-p (dirname path))
654 (with-output-to-file path
655 (lambda _
656 (invoke
657 (string-append #$output "/bin/" binary)
658 "--print-completion" shell)))))
659 `(("bash" .
660 ,(format ;format string must be literal
661 #f "~a/share/bash-completion/completions/~a"
662 #$output binary))
663 ("zsh" .
664 ,(format #f "~a/share/zsh/site-functions/_~a"
665 #$output binary))
666 ("tcsh" .
667 ,(format #f "~a/etc/profile.d/~a.completion.csh"
668 #$output binary)))))
669 (list "trash"
670 "trash-empty"
671 "trash-list"
672 "trash-put"
673 "trash-restore"
674 "trash-rm")))))))
675 (native-inputs (list python-flexmock
676 python-mock
677 python-parameterized
678 python-pytest
679 python-setuptools
680 python-shtab
681 python-six
682 python-wheel))
683 (inputs (list coreutils))
684 (propagated-inputs (list python-psutil))
685 (home-page "https://github.com/andreafrancia/trash-cli")
686 (synopsis "Trash can management tool")
687 (description
688 "trash-cli is a command line utility for interacting with the
689FreeDesktop.org trash can used by GNOME, KDE, XFCE, and other common desktop
690environments. It can move files to the trash, and remove or list files that
691are already there.")
692 (license license:gpl2+)))
693
694(define-public tran
695 ;; There is no new release yet, but there are some changes in master brunch,
696 ;; see <https://github.com/kilobyte/tran/issues/4>.
697 (let ((commit "039df9529d5dfb8283edfb3c8b3cc16c01f0bfce")
698 (revision "0"))
699 (package
700 (name "tran")
701 ;; The latest upstream version seems to be "v5".
702 (version (git-version "5.0.0" revision commit))
703 (source
704 (origin
705 (method git-fetch)
706 (uri (git-reference
707 (url "https://github.com/kilobyte/tran")
708 (commit commit)))
709 (file-name (string-append name "-" version "-checkout"))
710 (sha256
711 (base32 "1kzr3lfhi5f8wpwjzrzlwkxjv9rasdr9ndjdns9kd16vsh0gl2rd"))))
712 (build-system gnu-build-system)
713 (arguments
714 (list
715 #:tests? #f ;no tests
716 #:phases
717 #~(modify-phases %standard-phases
718 (delete 'configure) ;no configure provided
719 (add-after 'unpack 'patch
720 (lambda _
721 (substitute* "tran"
722 (("my \\$DATA=\"data\"")
723 (format #f "my $DATA=\"~a/share/tran/data\"" #$output)))))
724 (replace 'build
725 (lambda _
726 (invoke "make")))
727 (delete 'strip)
728 (replace 'install
729 (lambda _
730 (install-file "tran" (string-append #$output "/bin/"))
731 (install-file "tran.1" (string-append
732 #$output "/share/man/man1/"))
733 (copy-recursively "data" (string-append
734 #$output "/share/tran/data/")))))))
735 (inputs (list perl))
736 (home-page "https://github.com/kilobyte/tran")
737 (synopsis "Transcription between character scripts")
738 (description
739 "This tool can transliterate/transcribe text both ways between the
740Latin script and other languages.")
741 (license license:expat))))
742
743(define-public direnv
744 (package
745 (name "direnv")
746 (version "2.37.1")
747 (source
748 (origin (method git-fetch)
749 (uri (git-reference
750 (url "https://github.com/direnv/direnv")
751 (commit (string-append "v" version))))
752 (file-name (git-file-name name version))
753 (sha256
754 (base32
755 "08wywbj5niqhpy6m4y8xw065w3rgpi8khfy5qzqfxr6752h66v7p"))))
756 (build-system go-build-system)
757 (arguments
758 (list #:install-source? #f
759 #:import-path "github.com/direnv/direnv"
760 #:phases
761 #~(modify-phases %standard-phases
762 (add-after 'install 'install-manpages
763 (lambda _
764 (let* ((man (string-append #$output "/share/man/man1")))
765 (mkdir-p man)
766 (with-directory-excursion "src/github.com/direnv/direnv"
767 (install-file "man/direnv.1" man)
768 (install-file "man/direnv-stdlib.1" man)
769 (install-file "man/direnv.toml.1" man)))))
770 (replace 'check
771 (lambda* (#:key tests? #:allow-other-keys)
772 (when tests?
773 (setenv "HOME" "/tmp")
774 (with-directory-excursion "src/github.com/direnv/direnv"
775 ;; The following file needs to be writable so it can be
776 ;; modified by the testsuite.
777 (make-file-writable "test/scenarios/base/.envrc")
778 ;; We need to manually run test because make test
779 ;; tries to use go modules
780 (invoke "go" "test" "./...")
781 ;; Clean up from the tests, especially so that the extra
782 ;; direnv executable that's generated is removed.
783 (invoke "make" "clean"))))))))
784 (native-inputs
785 (list go-github-com-burntsushi-toml
786 go-github-com-mattn-go-isatty
787 go-golang-org-x-mod
788 which))
789 (home-page "https://direnv.net/")
790 (synopsis "Environment switcher for the shell")
791 (description
792 "direnv can hook into the bash, zsh, tcsh, and fish shells to load
793or unload environment variables depending on the current directory. This
794allows project-specific environment variables without using @file{~/.profile}.
795
796Before each prompt, direnv checks for the existence of a @file{.envrc} file in
797the current and parent directories. This file is then used to alter the
798environment variables of the current shell.")
799 (license license:expat)))
800
801(define-public fzy
802 (package
803 (name "fzy")
804 (version "1.0")
805 (source
806 (origin
807 (method git-fetch)
808 (uri (git-reference
809 (url "https://github.com/jhawthorn/fzy")
810 (commit version)))
811 (file-name (git-file-name name version))
812 (sha256
813 (base32
814 "1gkzdvj73f71388jvym47075l9zw61v6l8wdv2lnc0mns6dxig0k"))))
815 (build-system gnu-build-system)
816 (arguments
817 (list #:make-flags
818 #~(list (string-append "CC=" #$(cc-for-target))
819 (string-append "PREFIX=" #$output))
820 #:phases
821 #~(modify-phases %standard-phases
822 (delete 'configure))))
823 (home-page "https://github.com/jhawthorn/fzy")
824 (synopsis "Fast fuzzy text selector for the terminal with an advanced
825scoring algorithm")
826 (description
827 "Most other fuzzy matchers sort based on the length of a match. fzy tries
828to find the result the user intended. It does this by favouring matches on
829consecutive letters and starts of words. This allows matching using acronyms
830or different parts of the path.
831
832fzy is designed to be used both as an editor plugin and on the command
833line. Rather than clearing the screen, fzy displays its interface directly
834below the current cursor position, scrolling the screen if necessary.")
835 (license license:expat)))
836
837(define-public hstr
838 (package
839 (name "hstr")
840 (version "3.1")
841 (source (origin
842 (method git-fetch)
843 (uri (git-reference
844 (url "https://github.com/dvorka/hstr")
845 (commit version)))
846 (file-name (git-file-name name version))
847 (sha256
848 (base32
849 "1w1xr0ddf34i46b8wwz2snf7ap6m0mv53zid3d1l5hc4m3az5qis"))))
850 (build-system gnu-build-system)
851 (arguments
852 `(#:phases
853 (modify-phases %standard-phases
854 (add-before 'build 'adjust-ncurses-includes
855 (lambda* (#:key make-flags outputs #:allow-other-keys)
856 (let ((out (assoc-ref outputs "out")))
857 (substitute* "src/include/hstr_curses.h"
858 (("ncursesw\\/curses.h") "ncurses.h"))
859 (substitute* "src/include/hstr.h"
860 (("ncursesw\\/curses.h") "ncurses.h")))
861 #t)))))
862 (native-inputs
863 (list autoconf automake pkg-config))
864 (inputs
865 (list ncurses readline))
866 (synopsis "Navigate and search command history with shell history suggest box")
867 (description "HSTR (HiSToRy) is a command-line utility that brings
868improved Bash and Zsh command completion from the history. It aims to make
869completion easier and more efficient than with @kbd{Ctrl-R}. It allows you to
870easily view, navigate, and search your command history with suggestion boxes.
871HSTR can also manage your command history (for instance you can remove
872commands that are obsolete or contain a piece of sensitive information) or
873bookmark your favourite commands.")
874 (home-page "https://me.mindforger.com/projects/hh.html")
875 (license license:asl2.0)))
876
877(define-public shell-functools
878 ;; v0.3.0 was released in 2018, there are changes providing fixes to the
879 ;; test suite, use the latest commit.
880 (let ((commit "530e3b6f098c41869f9dc47d1a3005e12ce300c0")
881 (revision "0"))
882 (package
883 (name "shell-functools")
884 (version (git-version "0.3.0" revision commit))
885 (source (origin
886 (method git-fetch)
887 (uri (git-reference
888 (url "https://github.com/sharkdp/shell-functools")
889 (commit commit)))
890 (file-name (git-file-name name version))
891 (sha256
892 (base32
893 "0l23n5anppxds4678qnh84mykbdb7qxyjrxxjzm7kin7izfzczpa"))))
894 (build-system pyproject-build-system)
895 (native-inputs
896 (list python-pytest
897 python-hatchling))
898 (home-page "https://github.com/sharkdp/shell-functools/")
899 (synopsis "Functional programming tools for the shell")
900 (description
901 "This package provides higher order functions like map,filter, foldl,
902sort_by and take_while as simple command-line tools. Following the UNIX
903philosophy, these commands are designed to be composed via pipes. A large
904collection of functions such as basename, replace, contains or is_dir are
905provided as arguments to these commands.")
906 (license license:expat))))
907
908(define-public rig
909 (package
910 (name "rig")
911 (version "1.11")
912 (source (origin
913 (method url-fetch)
914 (uri (string-append "mirror://sourceforge/rig/rig/"
915 version "/rig-"
916 version ".tar.gz"))
917 (sha256
918 (base32
919 "1f3snysjqqlpk2kgvm5p2icrj4lsdymccmn3igkc2f60smqckgq0"))))
920 (build-system gnu-build-system)
921 (arguments `(#:make-flags
922 (list (string-append "CXX=" ,(cxx-for-target))
923 (string-append "PREFIX=" %output))
924 #:phases
925 (modify-phases %standard-phases
926 (delete 'configure)
927 (add-after 'unpack 'fix-build
928 (lambda _
929 (substitute* "rig.cc"
930 (("^#include <string>")
931 "#include <cstring>"))
932 (substitute* "Makefile"
933 (("g\\+\\+")
934 "${CXX} -O2")
935 (("install -g 0 -m 755 -o 0 -s rig \\$\\(BINDIR\\)")
936 "install -m 755 -d $(DESTDIR)$(BINDIR)\n\t\
937install -m 755 rig $(DESTDIR)$(BINDIR)/rig")
938 (("install -g 0 -m 644 -o 0 rig.6 \\$\\(MANDIR\\)/man6/rig.6")
939 "install -m 755 -d $(DESTDIR)$(MANDIR)/man6/\n\t\
940install -m 644 rig.6 $(DESTDIR)$(MANDIR)/man6/rig.6")
941 (("install -g 0 -m 755 -o 0 -d \\$\\(DATADIR\\)")
942 "install -m 755 -d $(DESTDIR)$(DATADIR)")
943 (("install -g 0 -m 644 -o 0 data/\\*.idx \\$\\(DATADIR\\)")
944 "install -m 644 data/*.idx $(DESTDIR)$(DATADIR)")))))
945 #:tests? #f))
946 (home-page "https://rig.sourceforge.net")
947 (synopsis "Random identity generator")
948 (description
949 "RIG (Random Identity Generator) generates random, yet real-looking,
950personal data. It is useful if you need to feed a name to a Web site, BBS, or
951real person, and are too lazy to think of one yourself. Also, if the Web
952site/BBS/person you are giving the information to tries to cross-check the
953city, state, zip, or area code, it will check out.")
954 (license license:gpl2+)))
955
956(define-public conflict
957 (package
958 (name "conflict")
959 (version "20221002")
960 (source (origin
961 (method url-fetch)
962 (uri (string-append
963 "https://invisible-mirror.net/archives/conflict/conflict-"
964 version ".tgz"))
965 (sha256
966 (base32
967 "1z6z61yiss9m45m3agqs92l569r55w9nsqaap56kh568mcy3y64c"))))
968 (build-system gnu-build-system)
969 (arguments
970 `(#:phases
971 (modify-phases %standard-phases
972 (add-after 'unpack 'fix-paths
973 (lambda _
974 (substitute* "run_test.sh"
975 (("PATH=\".:\\$BIN:/bin\"")
976 "PATH=\".:$BIN:$PATH\"")))))))
977 (home-page "https://invisible-island.net/conflict/conflict.html")
978 (synopsis "Displays conflicting filenames in your execution path")
979 (description
980 "@code{conflict} examines the user-specifiable list of programs, looking
981for instances in the user's path which conflict (i.e., the name appears in
982more than one point in the path).")
983 (license (license:x11-style "file://COPYING"))))
984
985(define-public renameutils
986 (package
987 (name "renameutils")
988 (version "0.12.0")
989 (source
990 (origin
991 (method url-fetch)
992 (uri (string-append "mirror://savannah/renameutils/"
993 "renameutils-" version ".tar.gz"))
994 (sha256
995 (base32
996 "18xlkr56jdyajjihcmfqlyyanzyiqqlzbhrm6695mkvw081g1lnb"))
997 (modules '((guix build utils)))
998 (snippet '(begin
999 (substitute* "src/Makefile.in"
1000 (("\\(\\$bindir\\)") "$(bindir)"))
1001 #t))))
1002 (build-system gnu-build-system)
1003 (inputs
1004 (list readline))
1005 (home-page "https://www.nongnu.org/renameutils/")
1006 (synopsis "File renaming utilities")
1007 (description "The file renaming utilities (renameutils for short) are a
1008set of programs designed to make renaming of files faster and less cumbersome.
1009The file renaming utilities consists of five programs: @command{qmv},
1010@command{qcp}, @command{imv}, @command{icp}, and @command{deurlname}.")
1011 (license license:gpl3+)))
1012
1013(define-public grc
1014 (package
1015 (name "grc")
1016 (version "1.13")
1017 (source
1018 (origin
1019 (method git-fetch)
1020 (uri (git-reference
1021 (url "https://github.com/garabik/grc")
1022 (commit (string-append "v" version))))
1023 (file-name (git-file-name name version))
1024 (sha256
1025 (base32 "1h0h88h484a9796hai0wasi1xmjxxhpyxgixn6fgdyc5h69gv8nl"))))
1026 (build-system gnu-build-system)
1027 (inputs
1028 (list python))
1029 (arguments
1030 (list
1031 #:phases
1032 #~(modify-phases %standard-phases
1033 (delete 'configure)
1034 (replace 'build
1035 (lambda _
1036 (substitute* "grc"
1037 (("conffilenames = \\[.*\\]")
1038 (string-append
1039 "conffilenames = ["
1040 "os.environ.get('GUIX_ENVIRONMENT', '" #$output "') "
1041 "+ '/etc/grc.conf']")))
1042 (substitute* "grcat"
1043 (("conffilepath \\+= \\['/usr/.*\\]")
1044 (string-append
1045 "conffilepath += ["
1046 "os.environ.get('GUIX_ENVIRONMENT', '" #$output "') "
1047 "+ '/share/grc/']"))))) ;; trailing slash!
1048 (delete 'check)
1049 (replace 'install
1050 (lambda _
1051 (invoke "sh" "install.sh" #$output #$output))))))
1052 (home-page "http://kassiopeia.juls.savba.sk/~garabik/software/grc.html")
1053 (synopsis "Generic colouriser for everything")
1054 (description "@code{grc} can be used to colourise logfiles, output of
1055shell commands, arbitrary text, etc. Many shell commands are supported out of
1056the box.
1057
1058You might want to add these lines you your @code{~/.bashrc}:
1059@example
1060GRC_ALIASES=true
1061source ${GUIX_ENVIRONMENT:-$HOME/.guix-profile}/etc/profile.d/grc.sh
1062@end example
1063")
1064 (license license:gpl2)))
1065
1066(define-public liquidprompt
1067 (package
1068 (name "liquidprompt")
1069 (version "2.2.1")
1070 (home-page "https://github.com/liquidprompt/liquidprompt")
1071 (source
1072 (origin
1073 (method git-fetch)
1074 (uri (git-reference
1075 (url "https://github.com/liquidprompt/liquidprompt")
1076 (commit (string-append "v" version))))
1077 (file-name (git-file-name name version))
1078 (sha256
1079 (base32 "1xm3cb2dinn0zqqqya4qz2v8mp8hb6f1mckqvc6npdf8xlcwap35"))))
1080 (build-system copy-build-system)
1081 (arguments
1082 (list
1083 #:install-plan #~'(("example.bashrc" "share/liquidprompt/examples/")
1084 ("liquidprompt" "share/liquidprompt/")
1085 ("contrib" "share/liquidprompt/")
1086 ("templates" "share/liquidprompt/")
1087 ("themes" "share/liquidprompt/")
1088 ("liquidprompt.plugin.zsh"
1089 "share/zsh/plugins/liquidprompt/")
1090 ("docs" #$(string-append "share/doc/" name "-"
1091 version "/")))
1092 #:phases #~(modify-phases %standard-phases
1093 (add-after 'unpack 'fix-plugin
1094 (lambda _
1095 (substitute* "liquidprompt.plugin.zsh"
1096 (("source(.*)$")
1097 (string-append "source "
1098 #$output
1099 "/share/liquidprompt/liquidprompt")))))
1100 (add-after 'fix-plugin 'fix-utils-path
1101 (lambda* (#:key inputs #:allow-other-keys)
1102 (substitute* "liquidprompt"
1103 (("([ (])\\\\?(tput|hostname|cksum|uname|tty|grep)([) ])"
1104 all beginning command ending)
1105 (string-append beginning
1106 (search-input-file
1107 inputs
1108 (string-append "bin/" command))
1109 ending)))))
1110 (add-after 'install 'install-generated-config
1111 (lambda* (#:key outputs #:allow-other-keys)
1112 (let* ((out (assoc-ref outputs "out"))
1113 (etc (string-append out "/etc"))
1114 (config (string-append etc "/liquidpromptrc")))
1115 (mkdir etc)
1116 (with-output-to-file config
1117 (lambda _
1118 (invoke "./tools/config-from-doc.sh")))))))))
1119 (inputs (list ncurses
1120 coreutils
1121 inetutils))
1122 (synopsis "Full-featured prompt for Bash & Zsh")
1123 (description
1124 "Liquidprompt is an adaptive prompt for Bash and Zsh that gives
1125you a nicely displayed prompt with useful information when you need it. It
1126does this with a powerful theming engine and a large array of data sources.
1127
1128In order to use liquidprompt with Zsh, you should use the following snippet
1129with Guix Home:
1130
1131@example
1132(service home-zsh-service-type
1133 (home-zsh-configuration
1134 (zshrc (list ;;...
1135 ;; This loads liquidprompt
1136 (mixed-text-file \"liquidprompt\"
1137 \"[[ $- = *i* ]] && source \" liquidprompt \"/share/liquidprompt/liquidprompt\")
1138 ;; This loads the powerline theme available in liquidprompt
1139 (mixed-text-file \"powerline-theme\"
1140 \"source \" liquidprompt \"/share/liquidprompt/themes/powerline/powerline.theme\"))))))
1141@end example\n")
1142 (license license:agpl3+)))
1143
1144(define-public fzf-tab
1145 (package
1146 (name "fzf-tab")
1147 (version "1.1.2")
1148 (home-page "https://github.com/Aloxaf/fzf-tab")
1149 (source (origin
1150 (method git-fetch)
1151 (uri (git-reference
1152 (url "https://github.com/Aloxaf/fzf-tab")
1153 (commit (string-append "v" version))))
1154 (file-name (git-file-name name version))
1155 (sha256
1156 (base32
1157 "061jjpgghn8d5q2m2cd2qdjwbz38qrcarldj16xvxbid4c137zs2"))))
1158 (build-system copy-build-system)
1159 (arguments
1160 '(#:install-plan '(("lib" "/share/zsh/plugins/fzf-tab/")
1161 ("modules" "/share/zsh/plugins/fzf-tab/")
1162 ("fzf-tab.plugin.zsh" "/share/zsh/plugins/fzf-tab/")
1163 ("fzf-tab.zsh" "/share/zsh/plugins/fzf-tab/")
1164 ("README.md" "/share/doc/fzf-tab/"))))
1165 (synopsis "Replace the zsh default completion menu with fzf")
1166 (description
1167 "The fzf-tab package replaces the default completion menu of the zsh
1168shell with fzf, enabling fuzzy finding and multi-selection.")
1169 (license license:expat)))
1170
1171(define-public pay-respects
1172 (package
1173 (name "pay-respects")
1174 (version "0.7.12")
1175 (source
1176 (origin
1177 (method url-fetch)
1178 (uri (crate-uri "pay-respects" version))
1179 (file-name (string-append name "-" version ".tar.gz"))
1180 (sha256
1181 (base32 "0nmh5kkjhsrmhwlb09wvg6chzpl7w7xq1qr1yy9gc202yrv6cnmk"))))
1182 (build-system cargo-build-system)
1183 (arguments
1184 (list
1185 #:install-source? #f
1186 #:modules
1187 '((guix build cargo-build-system)
1188 (guix build utils)
1189 (ice-9 match))
1190 #:phases
1191 #~(modify-phases %standard-phases
1192 (add-after 'install 'install-completions
1193 (lambda* (#:key native-inputs #:allow-other-keys)
1194 (for-each
1195 (match-lambda
1196 ((shell . path)
1197 (mkdir-p (in-vicinity #$output (dirname path)))
1198 (let ((binary
1199 (if #$(%current-target-system)
1200 (search-input-file native-inputs "bin/pay-respects")
1201 (in-vicinity #$output "bin/pay-respects"))))
1202 (with-output-to-file (in-vicinity #$output path)
1203 (lambda _
1204 (invoke binary shell)))
1205 ;; The shell completions call the binary so we make sure
1206 ;; that we call the correct binary.
1207 (when #$(%current-target-system)
1208 (substitute* (in-vicinity #$output path)
1209 (((search-input-file native-inputs "bin/pay-respects"))
1210 (in-vicinity #$output "bin/pay-respects")))))))
1211 '(("bash" . "share/bash-completion/completions/pay-respects")
1212 ("fish" . "share/fish/vendor_completions.d/pay-respects.fish")
1213 ("nushell" . "share/nushell/vendor/autoload/pay-respects")
1214 ("zsh" . "share/zsh/site-functions/_pay-respects"))))))))
1215 (native-inputs
1216 (if (%current-target-system)
1217 (list this-package)
1218 '()))
1219 (inputs (cargo-inputs 'pay-respects))
1220 (home-page "https://codeberg.org/iff/pay-respects")
1221 (synopsis "Suggest correction for mistyped console commands")
1222 (description
1223 "@command{pay-respects} provides a shell helper to suggest correction for
1224mistyped commands, with @command{guix locate} integration and an alias (default
1225to @command{f}) to correct the previous command.")
1226 (license license:agpl3+)))