Commit | Line | Data |
---|---|---|
54899414 MJ |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2016 Matthew Jordan <matthewjordandevops@yandex.com> | |
8efd807f | 3 | ;;; Copyright © 2016, 2017 Alex Griffin <a@ajgrf.com> |
76f31f0b | 4 | ;;; Copyright © 2016 Christopher Baines <mail@cbaines.net> |
f3f82d1d | 5 | ;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at> |
23e89f91 | 6 | ;;; Copyright © 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr> |
f80d6ea2 | 7 | ;;; Copyright © 2018 Benjamin Slade <slade@jnanam.net> |
f69f37d5 | 8 | ;;; Copyright © 2019 Collin J. Doering <collin@rekahsoft.ca> |
ad81708d | 9 | ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de> |
729f582a | 10 | ;;; Copyright © 2020 aecepoglu <aecepoglu@fastmail.fm> |
862a8861 | 11 | ;;; Copyright © 2020 Dion Mendel <guix@dm9.info> |
348c70f3 | 12 | ;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re> |
b0e8ccbe AV |
13 | ;;; Copyright © 2021 Alexandr Vityazev <avityazev@posteo.org> |
14 | ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz> | |
bcce83c7 | 15 | ;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com> |
d0313cdf | 16 | ;;; Copyright © 2021 Wiktor Żelazny <wzelazny@vurv.cz> |
dbebe6c0 | 17 | ;;; Copyright © 2022 Jose G Perez Taveras <josegpt27@gmail.com> |
54899414 MJ |
18 | ;;; |
19 | ;;; This file is part of GNU Guix. | |
20 | ;;; | |
21 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
22 | ;;; under the terms of the GNU General Public License as published by | |
23 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
24 | ;;; your option) any later version. | |
25 | ;;; | |
26 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
27 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
28 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
29 | ;;; GNU General Public License for more details. | |
30 | ;;; | |
31 | ;;; You should have received a copy of the GNU General Public License | |
32 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
33 | ||
34 | (define-module (gnu packages shellutils) | |
e3e8924d | 35 | #:use-module ((guix licenses) #:prefix license:) |
483731c8 | 36 | #:use-module (guix gexp) |
f0e14975 | 37 | #:use-module (guix utils) |
54899414 MJ |
38 | #:use-module (guix packages) |
39 | #:use-module (guix download) | |
31b61956 | 40 | #:use-module (guix git-download) |
97cccd34 | 41 | #:use-module (guix build-system copy) |
f0e14975 EF |
42 | #:use-module (guix build-system gnu) |
43 | #:use-module (guix build-system go) | |
44 | #:use-module (guix build-system python) | |
f80d6ea2 | 45 | #:use-module (gnu packages autotools) |
f0e14975 | 46 | #:use-module (gnu packages base) |
729f582a | 47 | #:use-module (gnu packages bison) |
39510d5a | 48 | #:use-module (gnu packages check) |
729f582a | 49 | #:use-module (gnu packages flex) |
f0e14975 | 50 | #:use-module (gnu packages golang) |
b5602ef7 | 51 | #:use-module (gnu packages libunistring) |
f80d6ea2 | 52 | #:use-module (gnu packages ncurses) |
b5602ef7 | 53 | #:use-module (gnu packages pcre) |
f80d6ea2 | 54 | #:use-module (gnu packages pkg-config) |
f0e14975 | 55 | #:use-module (gnu packages python) |
39510d5a | 56 | #:use-module (gnu packages python-xyz) |
f0e14975 | 57 | #:use-module (gnu packages readline) |
8ebd56ea | 58 | #:use-module (gnu packages ruby) |
8ebd56ea | 59 | #:use-module (gnu packages shells) |
9877fb03 | 60 | #:use-module (gnu packages textutils) |
b5602ef7 TGR |
61 | #:use-module (gnu packages tmux) |
62 | #:use-module (gnu packages vim)) | |
54899414 | 63 | |
ea18b4c5 FCW |
64 | (define-public ascii |
65 | (package | |
66 | (name "ascii") | |
67 | (version "3.18") | |
68 | (source (origin | |
69 | (method url-fetch) | |
70 | (uri (string-append "http://www.catb.org/~esr/ascii/" | |
71 | "ascii-" version ".tar.gz")) | |
72 | (sha256 | |
73 | (base32 | |
74 | "0b87vy06s8s3a8q70pqavsbk4m4ff034sdml2xxa6qfsykaj513j")))) | |
75 | (build-system gnu-build-system) | |
76 | (arguments `(#:make-flags | |
77 | (list (string-append "CC=" ,(cc-for-target)) | |
78 | (string-append "PREFIX=" %output)) | |
79 | #:phases | |
80 | (modify-phases %standard-phases | |
81 | (delete 'configure) | |
82 | (add-before 'install 'create-directories | |
83 | (lambda* (#:key outputs #:allow-other-keys) | |
84 | (let* ((out (assoc-ref outputs "out")) | |
85 | (bin (string-append out "/bin")) | |
86 | (man1 (string-append out "/share/man/man1"))) | |
87 | (mkdir-p bin) | |
88 | (mkdir-p man1))))) | |
89 | #:tests? #f)) | |
90 | (home-page "http://www.catb.org/~esr/ascii/") | |
91 | (synopsis "ASCII name and synonym chart") | |
92 | (description | |
93 | "The @code{ascii} utility provides easy conversion between various byte | |
94 | representations and the American Standard Code for Information Interchange | |
95 | (ASCII) character table. It knows about a wide variety of hex, binary, octal, | |
96 | Teletype mnemonic, ISO/ECMA code point, slang names, XML entity names, and | |
97 | other representations. Given any one on the command line, it will try to | |
98 | display all others. Called with no arguments it displays a handy small ASCII | |
99 | chart.") | |
100 | (license license:bsd-2))) | |
101 | ||
729f582a | 102 | (define-public boxes |
103 | (package | |
104 | (name "boxes") | |
b5602ef7 | 105 | (version "2.1.1") |
729f582a | 106 | (source (origin |
107 | (method git-fetch) | |
108 | (uri (git-reference | |
109 | (url "https://github.com/ascii-boxes/boxes") | |
110 | (commit (string-append "v" version)))) | |
111 | (file-name (git-file-name name version)) | |
112 | (sha256 | |
6054b7d8 | 113 | (base32 |
b5602ef7 | 114 | "1bf5rnfiw04ffs1l17zhbg4wvq2vfn2qbz1xmd250xqj15lysw88")))) |
729f582a | 115 | (build-system gnu-build-system) |
116 | (arguments | |
117 | `(#:test-target "test" | |
118 | #:make-flags (list (string-append "GLOBALCONF=" | |
119 | (assoc-ref %outputs "out") | |
120 | "/etc/boxes-config")) | |
98014663 TGR |
121 | #:modules |
122 | ((ice-9 match) | |
123 | ,@%gnu-build-system-modules) | |
729f582a | 124 | #:phases |
125 | (modify-phases %standard-phases | |
126 | (delete 'configure) | |
127 | (replace 'install | |
128 | (lambda* (#:key outputs #:allow-other-keys) | |
98014663 TGR |
129 | (let ((out (assoc-ref outputs "out"))) |
130 | (for-each (match-lambda | |
131 | ((source target) | |
132 | (install-file source | |
133 | (string-append out "/" target)))) | |
134 | '(("out/boxes" "bin/") | |
135 | ("doc/boxes.1" "share/man/man1/") | |
136 | ("boxes-config" "etc/"))))))))) | |
b5602ef7 | 137 | (native-inputs |
8394619b LC |
138 | (list bison flex |
139 | ;; For the tests. | |
140 | xxd)) | |
b5602ef7 | 141 | (inputs |
8394619b | 142 | (list libunistring pcre2)) |
ed0215d3 | 143 | (home-page "https://boxes.thomasjensen.com") |
729f582a | 144 | (synopsis "Command line ASCII boxes") |
145 | (description | |
146 | "This command-line filter program draws ASCII-art boxes around your input | |
147 | text.") | |
729f582a | 148 | (license license:gpl2))) |
149 | ||
97cccd34 | 150 | (define-public zsh-autopair |
151 | (package | |
152 | (name "zsh-autopair") | |
153 | (version "1.0") | |
154 | (home-page "https://github.com/hlissner/zsh-autopair") | |
155 | (source (origin | |
156 | (method git-fetch) | |
157 | (uri (git-reference | |
158 | (url "https://github.com/hlissner/zsh-autopair.git") | |
159 | (commit (string-append "v" version)))) | |
160 | (file-name (git-file-name name version)) | |
161 | (sha256 | |
162 | (base32 | |
163 | "1h0vm2dgrmb8i2pvsgis3lshc5b0ad846836m62y8h3rdb3zmpy1")))) | |
164 | (build-system copy-build-system) | |
165 | (arguments | |
166 | '(#:install-plan '(("autopair.zsh" | |
167 | "/share/zsh/plugins/zsh-autopair/zsh-autopair.zsh")))) | |
168 | (synopsis "Auto-close and delete matching delimiters in Zsh") | |
169 | (description | |
170 | "This Zsh plugin auto-closes, deletes, and skips over matching delimiters | |
171 | in Zsh intelligently.") | |
172 | (license license:expat))) | |
173 | ||
8ebd56ea CD |
174 | (define-public zsh-autosuggestions |
175 | (package | |
176 | (name "zsh-autosuggestions") | |
ae004cea | 177 | (version "0.7.0") |
8ebd56ea CD |
178 | (source (origin |
179 | (method git-fetch) | |
180 | (uri (git-reference | |
b0e7b699 | 181 | (url "https://github.com/zsh-users/zsh-autosuggestions") |
8ebd56ea CD |
182 | (commit (string-append "v" version)))) |
183 | (file-name (git-file-name name version)) | |
184 | (sha256 | |
185 | (base32 | |
ae004cea | 186 | "1g3pij5qn2j7v7jjac2a63lxd97mcsgw6xq6k5p7835q9fjiid98")))) |
8ebd56ea CD |
187 | (build-system gnu-build-system) |
188 | (native-inputs | |
8394619b LC |
189 | (list ruby |
190 | ruby-byebug | |
191 | ruby-pry | |
192 | ruby-rspec | |
193 | ruby-rspec-wait | |
194 | tmux | |
195 | zsh)) | |
8ebd56ea CD |
196 | (arguments |
197 | '(#:phases | |
198 | (modify-phases %standard-phases | |
348c70f3 BW |
199 | (add-after 'unpack 'patch-tests |
200 | (lambda _ | |
201 | ;; Failing tests since tmux-3.2a | |
202 | (delete-file "spec/options/buffer_max_size_spec.rb"))) | |
8ebd56ea CD |
203 | (delete 'configure) |
204 | (replace 'check ; Tests use ruby's bundler; instead execute rspec directly. | |
205 | (lambda _ | |
206 | (setenv "TMUX_TMPDIR" (getenv "TMPDIR")) | |
207 | (setenv "SHELL" (which "zsh")) | |
208 | (invoke "rspec"))) | |
209 | (replace 'install | |
210 | (lambda* (#:key outputs #:allow-other-keys) | |
211 | (let* ((out (assoc-ref outputs "out")) | |
212 | (zsh-plugins | |
213 | (string-append out "/share/zsh/plugins/zsh-autosuggestions"))) | |
214 | (invoke "make" "all") | |
215 | (install-file "zsh-autosuggestions.zsh" zsh-plugins) | |
216 | #t)))))) | |
217 | (home-page "https://github.com/zsh-users/zsh-autosuggestions") | |
218 | (synopsis "Fish-like autosuggestions for zsh") | |
219 | (description | |
220 | "Fish-like fast/unobtrusive autosuggestions for zsh. It suggests commands | |
221 | as you type.") | |
222 | (license license:expat))) | |
223 | ||
b0e8ccbe AV |
224 | (define-public zsh-syntax-highlighting |
225 | (package | |
226 | (name "zsh-syntax-highlighting") | |
227 | (version "0.7.1") | |
228 | (source (origin | |
229 | (method git-fetch) | |
230 | (uri (git-reference | |
231 | (url "https://github.com/zsh-users/zsh-syntax-highlighting") | |
232 | (commit version))) | |
233 | (file-name (git-file-name name version)) | |
234 | (sha256 | |
235 | (base32 | |
236 | "039g3n59drk818ylcyvkciv8k9mf739cv6v4vis1h9fv9whbcmwl")))) | |
237 | (build-system gnu-build-system) | |
238 | (native-inputs | |
8394619b | 239 | (list zsh)) |
b0e8ccbe AV |
240 | (arguments |
241 | ;; FIXME: Tests fail when running test regexp | |
242 | ;; there is no pcre module in the Guix zsh package | |
243 | `(#:tests? #f | |
244 | #:phases | |
245 | (modify-phases %standard-phases | |
246 | (delete 'configure) | |
247 | (add-after 'unpack 'patch-paths | |
248 | (lambda* (#:key outputs #:allow-other-keys) | |
249 | (let ((out (assoc-ref outputs "out"))) | |
250 | (substitute* "Makefile" | |
251 | (("/usr/local") out) | |
252 | (("share/\\$\\(NAME\\)") "share/zsh/plugins/$(NAME)"))))) | |
253 | (add-after 'patch-paths 'make-writable | |
254 | (lambda _ | |
255 | (for-each make-file-writable | |
256 | '("docs/highlighters.md" | |
257 | "README.md")))) | |
258 | (add-before 'build 'add-all-md | |
259 | (lambda _ | |
260 | (invoke "make" "all"))) | |
261 | (replace 'check | |
262 | (lambda* (#:key tests? #:allow-other-keys) | |
263 | (when tests? | |
264 | (invoke "make" "test") | |
265 | (invoke "make" "perf"))))))) | |
266 | (home-page "https://github.com/zsh-users/zsh-syntax-highlighting") | |
267 | (synopsis "Fish shell-like syntax highlighting for Zsh") | |
268 | (description | |
269 | "This package provides syntax highlighting for Zsh. It enables | |
270 | highlighting of commands whilst they are typed at a Zsh prompt into an | |
271 | interactive terminal. This helps in reviewing commands before running them, | |
272 | particularly in catching syntax errors.") | |
273 | (license license:bsd-3))) | |
274 | ||
9877fb03 | 275 | (define-public grml-zsh-config |
276 | (package | |
277 | (name "grml-zsh-config") | |
278 | (version "0.19.3") | |
279 | (source (origin | |
280 | (method url-fetch) | |
281 | (uri (string-append | |
282 | "https://deb.grml.org/pool/main/g/grml-etc-core/grml-etc-core_" | |
283 | version ".tar.gz")) | |
284 | (sha256 | |
285 | (base32 | |
286 | "05fri77028znjnvmh8mz3424rn8ilysj7hn8br2hk1qwkp4zzwp9")))) | |
287 | (build-system copy-build-system) | |
288 | (arguments | |
289 | (list | |
290 | #:phases | |
291 | #~(modify-phases | |
292 | %standard-phases | |
293 | (add-before 'install 'make-doc | |
294 | (lambda _ (with-directory-excursion "doc" (invoke "make"))))) | |
295 | #:install-plan | |
296 | #~'(("etc/skel/.zshrc" "etc/skel/.zshrc") | |
297 | ("etc/zsh/keephack" "etc/zsh/keephack") | |
298 | ("etc/zsh/zshrc" "etc/zsh/zshrc") | |
299 | ("doc/grmlzshrc.5" "share/man/man5/grmlzshrc.5")))) | |
300 | (native-inputs (list txt2tags)) | |
301 | (home-page "https://grml.org/zsh/") | |
302 | (synopsis "Grml's zsh configuration") | |
303 | (description "This package provides an interactive setup for zsh | |
304 | preconfigured by the Grml project.") | |
305 | (license license:gpl2))) | |
306 | ||
f69f37d5 CD |
307 | (define-public sh-z |
308 | (package | |
309 | (name "sh-z") | |
310 | (version "1.11") | |
311 | (source (origin | |
312 | (method git-fetch) | |
313 | (uri (git-reference | |
b0e7b699 | 314 | (url "https://github.com/rupa/z") |
f69f37d5 CD |
315 | (commit (string-append "v" version)))) |
316 | (file-name (git-file-name name version)) | |
317 | (sha256 | |
318 | (base32 | |
319 | "13zbgkj6y0qhvn5jpkrqbd4jjxjr789k228iwma5hjfh1nx7ghyb")))) | |
320 | (build-system gnu-build-system) | |
321 | (arguments | |
322 | `(#:tests? #f ; No tests provided | |
323 | #:phases | |
324 | (modify-phases %standard-phases | |
325 | (delete 'configure) | |
326 | (delete 'build) | |
327 | (replace 'install | |
328 | (lambda* (#:key outputs #:allow-other-keys) | |
329 | (let* ((out (assoc-ref outputs "out")) | |
330 | (man (string-append out "/share/man/man1")) | |
331 | (bin (string-append out "/bin"))) | |
332 | (install-file "z.sh" bin) | |
333 | (chmod (string-append bin "/z.sh") #o755) | |
334 | (install-file "z.1" man) | |
335 | #t)))))) | |
336 | (synopsis "Jump about directories") | |
337 | (description | |
338 | "Tracks your most used directories, based on ``frecency''. After a short | |
339 | learning phase, z will take you to the most ``frecent'' directory that matches | |
340 | all of the regexes given on the command line in order.") | |
341 | (home-page "https://github.com/rupa/z") | |
342 | (license license:expat))) | |
343 | ||
54899414 MJ |
344 | (define-public envstore |
345 | (package | |
346 | (name "envstore") | |
347 | (version "2.1") | |
348 | (source | |
349 | (origin | |
350 | (method url-fetch) | |
351 | (uri (string-append "https://finalrewind.org/projects/" | |
352 | name "/" name "-" version ".tar.bz2")) | |
353 | (sha256 | |
354 | (base32 "1x97lxad80m5blhdfanl5v2qzjwcgbij2i23701bn8mpyxsrqszi")))) | |
355 | (build-system gnu-build-system) | |
356 | (arguments | |
357 | `(#:test-target "test" | |
358 | #:make-flags (list "CC=gcc" | |
359 | (string-append "PREFIX=" (assoc-ref %outputs "out"))) | |
360 | #:phases | |
361 | (modify-phases %standard-phases | |
362 | (delete 'configure)))) | |
363 | (home-page "https://finalrewind.org/projects/envstore/") | |
364 | (synopsis "Save and restore environment variables") | |
365 | (description "Envstore is a program for sharing environment variables | |
366 | between various shells or commands.") | |
ac44b39a | 367 | (license license:wtfpl2))) |
92c2f605 AG |
368 | |
369 | (define-public trash-cli | |
370 | (package | |
371 | (name "trash-cli") | |
39510d5a | 372 | (version "0.21.10.24") |
92c2f605 AG |
373 | (source |
374 | (origin | |
39510d5a BW |
375 | (method git-fetch) |
376 | (uri (git-reference | |
377 | (url "https://github.com/andreafrancia/trash-cli") | |
378 | (commit version))) | |
379 | (file-name (git-file-name name version)) | |
92c2f605 AG |
380 | (sha256 |
381 | (base32 | |
39510d5a | 382 | "01is32lk6prwhajvlmgn3xs4fcpmiqivizcqkj9k80jx6mqjifzs")))) |
92c2f605 AG |
383 | (build-system python-build-system) |
384 | (arguments | |
39510d5a | 385 | `(#:phases |
92c2f605 AG |
386 | (modify-phases %standard-phases |
387 | (add-before 'build 'patch-path-constants | |
388 | (lambda* (#:key inputs #:allow-other-keys) | |
389 | (let ((libc (assoc-ref inputs "libc")) | |
390 | (coreutils (assoc-ref inputs "coreutils"))) | |
391 | (substitute* "trashcli/list_mount_points.py" | |
392 | (("\"/lib/libc.so.6\".*") | |
393 | (string-append "\"" libc "/lib/libc.so.6\"\n")) | |
394 | (("\"df\"") | |
39510d5a BW |
395 | (string-append "\"" coreutils "/bin/df\"")))))) |
396 | (add-before 'build 'fix-setup.py | |
397 | (lambda* (#:key outputs #:allow-other-keys) | |
398 | (let* ((out (assoc-ref outputs "out")) | |
399 | (bin (string-append out "/bin"))) | |
400 | (mkdir-p bin) | |
401 | (substitute* "setup.py" | |
402 | (("add_script\\('") | |
b5853e08 LDB |
403 | (string-append "add_script('" bin "/" )))))) |
404 | ;; Whenever setup.py is invoked, scripts in out/bin/ are | |
405 | ;; replaced. Thus we cannot invoke setup.py for testing. | |
406 | ;; Upstream also uses pytest. | |
407 | (replace 'check | |
408 | (lambda* (#:key tests? #:allow-other-keys) | |
409 | (when tests? | |
410 | (invoke "pytest"))))))) | |
39510d5a BW |
411 | (native-inputs |
412 | (list python-pytest | |
413 | python-mock | |
414 | python-six)) | |
8394619b | 415 | (inputs (list coreutils)) |
39510d5a BW |
416 | (propagated-inputs |
417 | (list python-psutil)) | |
92c2f605 AG |
418 | (home-page "https://github.com/andreafrancia/trash-cli") |
419 | (synopsis "Trash can management tool") | |
420 | (description | |
421 | "trash-cli is a command line utility for interacting with the | |
422 | FreeDesktop.org trash can used by GNOME, KDE, XFCE, and other common desktop | |
423 | environments. It can move files to the trash, and remove or list files that | |
424 | are already there.") | |
e3e8924d | 425 | (license license:gpl2+))) |
76f31f0b CB |
426 | |
427 | (define-public direnv | |
428 | (package | |
429 | (name "direnv") | |
dbebe6c0 | 430 | (version "2.32.1") |
76f31f0b | 431 | (source |
81aa6c72 CB |
432 | (origin (method git-fetch) |
433 | (uri (git-reference | |
b0e7b699 | 434 | (url "https://github.com/direnv/direnv") |
81aa6c72 CB |
435 | (commit (string-append "v" version)))) |
436 | (file-name (git-file-name name version)) | |
76f31f0b CB |
437 | (sha256 |
438 | (base32 | |
dbebe6c0 | 439 | "1i473j7j4sx8p83zqlnakskqk0jyd3byajp7jmv2gym9s4k841y7")))) |
81aa6c72 | 440 | (build-system go-build-system) |
76f31f0b | 441 | (arguments |
81aa6c72 | 442 | '(#:import-path "github.com/direnv/direnv" |
39ea311c LF |
443 | #:phases |
444 | (modify-phases %standard-phases | |
862a8861 DM |
445 | (add-after 'install 'install-manpages |
446 | (lambda* (#:key outputs #:allow-other-keys) | |
447 | (let* ((out (assoc-ref outputs "out")) | |
448 | (man (string-append out "/share/man/man1"))) | |
449 | (mkdir-p man) | |
450 | (with-directory-excursion "src/github.com/direnv/direnv" | |
451 | (install-file "man/direnv.1" man) | |
452 | (install-file "man/direnv-stdlib.1" man) | |
453 | (install-file "man/direnv.toml.1" man))))) | |
81aa6c72 CB |
454 | (replace 'check |
455 | (lambda* (#:key tests? #:allow-other-keys) | |
456 | (when tests? | |
457 | (setenv "HOME" "/tmp") | |
458 | (with-directory-excursion "src/github.com/direnv/direnv" | |
459 | ;; The following file needs to be writable so it can be | |
460 | ;; modified by the testsuite. | |
461 | (make-file-writable "test/scenarios/base/.envrc") | |
f5a7a42d AC |
462 | ;; We need to manually run test because make test |
463 | ;; tries to use go modules | |
464 | (invoke "go" "test" "./...") | |
81aa6c72 CB |
465 | ;; Clean up from the tests, especially so that the extra |
466 | ;; direnv executable that's generated is removed. | |
c09cc717 | 467 | (invoke "make" "clean")))))))) |
9729b6ea | 468 | (native-inputs |
8394619b LC |
469 | (list go-github-com-burntsushi-toml go-github-com-direnv-go-dotenv |
470 | go-github-com-mattn-go-isatty go-golang-org-x-mod which)) | |
6137da88 | 471 | (home-page "https://direnv.net/") |
76f31f0b | 472 | (synopsis "Environment switcher for the shell") |
a6317919 TGR |
473 | (description |
474 | "direnv can hook into the bash, zsh, tcsh, and fish shells to load | |
76f31f0b | 475 | or unload environment variables depending on the current directory. This |
a6317919 | 476 | allows project-specific environment variables without using @file{~/.profile}. |
76f31f0b | 477 | |
a6317919 TGR |
478 | Before each prompt, direnv checks for the existence of a @file{.envrc} file in |
479 | the current and parent directories. This file is then used to alter the | |
480 | environment variables of the current shell.") | |
e3e8924d | 481 | (license license:expat))) |
f3f82d1d SR |
482 | |
483 | (define-public fzy | |
484 | (package | |
485 | (name "fzy") | |
2792d8a8 | 486 | (version "1.0") |
f3f82d1d SR |
487 | (source |
488 | (origin | |
31b61956 TGR |
489 | (method git-fetch) |
490 | (uri (git-reference | |
b0e7b699 | 491 | (url "https://github.com/jhawthorn/fzy") |
31b61956 TGR |
492 | (commit version))) |
493 | (file-name (git-file-name name version)) | |
f3f82d1d SR |
494 | (sha256 |
495 | (base32 | |
2792d8a8 | 496 | "1gkzdvj73f71388jvym47075l9zw61v6l8wdv2lnc0mns6dxig0k")))) |
f3f82d1d SR |
497 | (build-system gnu-build-system) |
498 | (arguments | |
499 | '(#:make-flags (list "CC=gcc" | |
500 | (string-append "PREFIX=" (assoc-ref %outputs "out"))) | |
501 | #:phases | |
502 | (modify-phases %standard-phases | |
503 | (delete 'configure)))) | |
504 | (home-page "https://github.com/jhawthorn/fzy") | |
505 | (synopsis "Fast fuzzy text selector for the terminal with an advanced | |
506 | scoring algorithm") | |
507 | (description | |
508 | "Most other fuzzy matchers sort based on the length of a match. fzy tries | |
509 | to find the result the user intended. It does this by favouring matches on | |
510 | consecutive letters and starts of words. This allows matching using acronyms | |
511 | or different parts of the path. | |
512 | ||
513 | fzy is designed to be used both as an editor plugin and on the command | |
514 | line. Rather than clearing the screen, fzy displays its interface directly | |
515 | below the current cursor position, scrolling the screen if necessary.") | |
e3e8924d | 516 | (license license:expat))) |
f80d6ea2 BS |
517 | |
518 | (define-public hstr | |
519 | (package | |
520 | (name "hstr") | |
8afa0090 | 521 | (version "2.5") |
f80d6ea2 | 522 | (source (origin |
2bbda4f0 EF |
523 | (method git-fetch) |
524 | (uri (git-reference | |
b0e7b699 | 525 | (url "https://github.com/dvorka/hstr") |
2bbda4f0 EF |
526 | (commit version))) |
527 | (file-name (git-file-name name version)) | |
f80d6ea2 BS |
528 | (sha256 |
529 | (base32 | |
8afa0090 | 530 | "0xg10jyiq12bcygi6aa9qq9pki7bipdsvsza037p2iqix19jg0x8")))) |
f80d6ea2 BS |
531 | (build-system gnu-build-system) |
532 | (arguments | |
533 | `(#:phases | |
534 | (modify-phases %standard-phases | |
535 | (add-before 'build 'adjust-ncurses-includes | |
536 | (lambda* (#:key make-flags outputs #:allow-other-keys) | |
537 | (let ((out (assoc-ref outputs "out"))) | |
538 | (substitute* "src/include/hstr_curses.h" | |
539 | (("ncursesw\\/curses.h") "ncurses.h")) | |
540 | (substitute* "src/include/hstr.h" | |
541 | (("ncursesw\\/curses.h") "ncurses.h"))) | |
542 | #t))))) | |
543 | (native-inputs | |
8394619b | 544 | (list autoconf automake pkg-config)) |
f80d6ea2 | 545 | (inputs |
8394619b | 546 | (list ncurses readline)) |
f80d6ea2 BS |
547 | (synopsis "Navigate and search command history with shell history suggest box") |
548 | (description "HSTR (HiSToRy) is a command-line utility that brings | |
549 | improved Bash and Zsh command completion from the history. It aims to make | |
550 | completion easier and more efficient than with @kbd{Ctrl-R}. It allows you to | |
551 | easily view, navigate, and search your command history with suggestion boxes. | |
552 | HSTR can also manage your command history (for instance you can remove | |
553 | commands that are obsolete or contain a piece of sensitive information) or | |
554 | bookmark your favourite commands.") | |
555 | (home-page "http://me.mindforger.com/projects/hh.html") | |
e3e8924d | 556 | (license license:asl2.0))) |
39bf4e0b OP |
557 | |
558 | (define-public shell-functools | |
559 | (package | |
560 | (name "shell-functools") | |
561 | (version "0.3.0") | |
562 | (source (origin | |
563 | (method git-fetch) | |
564 | (uri (git-reference | |
b0e7b699 | 565 | (url "https://github.com/sharkdp/shell-functools") |
39bf4e0b OP |
566 | (commit (string-append "v" version)))) |
567 | (file-name (git-file-name name version)) | |
568 | (sha256 | |
569 | (base32 | |
570 | "0d6zzg7cxfrzwzh1wmpj7q85kz33sak6ac59ncsm6dlbin12h0hi")))) | |
571 | (build-system python-build-system) | |
572 | (home-page "https://github.com/sharkdp/shell-functools/") | |
573 | (synopsis "Functional programming tools for the shell") | |
574 | (description "This package provides higher order functions like map, | |
575 | filter, foldl, sort_by and take_while as simple command-line tools. Following | |
576 | the UNIX philosophy, these commands are designed to be composed via pipes. A | |
577 | large collection of functions such as basename, replace, contains or is_dir | |
578 | are provided as arguments to these commands.") | |
579 | (license license:expat))) | |
bcce83c7 FCW |
580 | |
581 | (define-public rig | |
582 | (package | |
583 | (name "rig") | |
584 | (version "1.11") | |
585 | (source (origin | |
586 | (method url-fetch) | |
587 | (uri (string-append "mirror://sourceforge/rig/rig/" | |
588 | version "/rig-" | |
589 | version ".tar.gz")) | |
590 | (sha256 | |
591 | (base32 | |
592 | "1f3snysjqqlpk2kgvm5p2icrj4lsdymccmn3igkc2f60smqckgq0")))) | |
593 | (build-system gnu-build-system) | |
594 | (arguments `(#:make-flags | |
595 | (list (string-append "CXX=" ,(cxx-for-target)) | |
596 | (string-append "PREFIX=" %output)) | |
597 | #:phases | |
598 | (modify-phases %standard-phases | |
599 | (delete 'configure) | |
600 | (add-after 'unpack 'fix-build | |
601 | (lambda _ | |
602 | (substitute* "rig.cc" | |
603 | (("^#include <string>") | |
604 | "#include <cstring>")) | |
605 | (substitute* "Makefile" | |
606 | (("g\\+\\+") | |
607 | "${CXX} -O2") | |
608 | (("install -g 0 -m 755 -o 0 -s rig \\$\\(BINDIR\\)") | |
609 | "install -m 755 -d $(DESTDIR)$(BINDIR)\n\t\ | |
610 | install -m 755 rig $(DESTDIR)$(BINDIR)/rig") | |
611 | (("install -g 0 -m 644 -o 0 rig.6 \\$\\(MANDIR\\)/man6/rig.6") | |
612 | "install -m 755 -d $(DESTDIR)$(MANDIR)/man6/\n\t\ | |
613 | install -m 644 rig.6 $(DESTDIR)$(MANDIR)/man6/rig.6") | |
614 | (("install -g 0 -m 755 -o 0 -d \\$\\(DATADIR\\)") | |
615 | "install -m 755 -d $(DESTDIR)$(DATADIR)") | |
616 | (("install -g 0 -m 644 -o 0 data/\\*.idx \\$\\(DATADIR\\)") | |
617 | "install -m 644 data/*.idx $(DESTDIR)$(DATADIR)"))))) | |
618 | #:tests? #f)) | |
619 | (home-page "http://rig.sourceforge.net") | |
620 | (synopsis "Random identity generator") | |
621 | (description | |
622 | "RIG (Random Identity Generator) generates random, yet real-looking, | |
623 | personal data. It is useful if you need to feed a name to a Web site, BBS, or | |
624 | real person, and are too lazy to think of one yourself. Also, if the Web | |
625 | site/BBS/person you are giving the information to tries to cross-check the | |
626 | city, state, zip, or area code, it will check out.") | |
627 | (license license:gpl2+))) | |
d0313cdf | 628 | |
3443942c FCW |
629 | (define-public conflict |
630 | (package | |
631 | (name "conflict") | |
632 | (version "20210108") | |
633 | (source (origin | |
634 | (method url-fetch) | |
635 | (uri (string-append | |
636 | "https://invisible-mirror.net/archives/conflict/conflict-" | |
637 | version ".tgz")) | |
638 | (sha256 | |
639 | (base32 | |
640 | "0mls4climvp7v9hnc3zh01mh270kqcj797ng0xslwb027lipis4h")))) | |
641 | (build-system gnu-build-system) | |
642 | (arguments | |
643 | `(#:phases | |
644 | (modify-phases %standard-phases | |
645 | (add-after 'unpack 'fix-paths | |
646 | (lambda _ | |
647 | (substitute* "run_test.sh" | |
648 | (("PATH=\".:\\$BIN:/bin\"") | |
649 | "PATH=\".:$BIN:$PATH\""))))))) | |
650 | (home-page "https://invisible-island.net/conflict/conflict.html") | |
651 | (synopsis "Displays conflicting filenames in your execution path") | |
652 | (description | |
653 | "@code{conflict} examines the user-specifiable list of programs, looking | |
654 | for instances in the user's path which conflict (i.e., the name appears in | |
655 | more than one point in the path).") | |
656 | (license (license:x11-style "file://COPYING")))) | |
657 | ||
d0313cdf WŻ |
658 | (define-public renameutils |
659 | (package | |
660 | (name "renameutils") | |
661 | (version "0.12.0") | |
662 | (source | |
663 | (origin | |
664 | (method url-fetch) | |
2bb0d8bf LC |
665 | (uri (string-append "mirror://savannah/renameutils/" |
666 | "renameutils-" version ".tar.gz")) | |
d0313cdf WŻ |
667 | (sha256 |
668 | (base32 | |
669 | "18xlkr56jdyajjihcmfqlyyanzyiqqlzbhrm6695mkvw081g1lnb")) | |
670 | (modules '((guix build utils))) | |
671 | (snippet '(begin | |
672 | (substitute* "src/Makefile.in" | |
673 | (("\\(\\$bindir\\)") "$(bindir)")) | |
674 | #t)))) | |
675 | (build-system gnu-build-system) | |
676 | (inputs | |
8394619b | 677 | (list readline)) |
d0313cdf WŻ |
678 | (home-page "https://www.nongnu.org/renameutils/") |
679 | (synopsis "File renaming utilities") | |
2bb0d8bf LC |
680 | (description "The file renaming utilities (renameutils for short) are a |
681 | set of programs designed to make renaming of files faster and less cumbersome. | |
682 | The file renaming utilities consists of five programs: @command{qmv}, | |
683 | @command{qcp}, @command{imv}, @command{icp}, and @command{deurlname}.") | |
684 | (license license:gpl3+))) | |
483731c8 HG |
685 | |
686 | (define-public grc | |
687 | (package | |
688 | (name "grc") | |
689 | (version "1.13") | |
690 | (source | |
691 | (origin | |
692 | (method git-fetch) | |
693 | (uri (git-reference | |
694 | (url "https://github.com/garabik/grc") | |
695 | (commit (string-append "v" version)))) | |
696 | (file-name (git-file-name name version)) | |
697 | (sha256 | |
698 | (base32 "1h0h88h484a9796hai0wasi1xmjxxhpyxgixn6fgdyc5h69gv8nl")))) | |
699 | (build-system gnu-build-system) | |
700 | (inputs | |
701 | (list python)) | |
702 | (arguments | |
703 | (list | |
704 | #:phases | |
705 | #~(modify-phases %standard-phases | |
706 | (delete 'configure) | |
707 | (replace 'build | |
708 | (lambda _ | |
709 | (substitute* "grc" | |
710 | (("conffilenames = \\[.*\\]") | |
711 | (string-append | |
712 | "conffilenames = [" | |
713 | "os.environ.get('GUIX_ENVIRONMENT', '" #$output "') " | |
714 | "+ '/etc/grc.conf']"))) | |
715 | (substitute* "grcat" | |
716 | (("conffilepath \\+= \\['/usr/.*\\]") | |
717 | (string-append | |
718 | "conffilepath += [" | |
719 | "os.environ.get('GUIX_ENVIRONMENT', '" #$output "') " | |
720 | "+ '/share/grc/']"))))) ;; trailing slash! | |
721 | (delete 'check) | |
722 | (replace 'install | |
723 | (lambda _ | |
724 | (invoke "sh" "install.sh" #$output #$output)))))) | |
725 | (home-page "http://kassiopeia.juls.savba.sk/~garabik/software/grc.html") | |
726 | (synopsis "Generic colouriser for everything") | |
727 | (description "@code{grc} can be used to colourise logfiles, output of | |
728 | shell commands, arbitrary text, etc. Many shell commands are supported out of | |
729 | the box. | |
730 | ||
731 | You might want to add these lines you your @code{~/.bashrc}: | |
732 | @example | |
733 | GRC_ALIASES=true | |
734 | source ${GUIX_ENVIRONMENT:-$HOME/.guix-profile}/etc/profile.d/grc.sh | |
735 | @end example | |
736 | ") | |
737 | (license license:gpl2))) |