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> |
54899414 MJ |
10 | ;;; |
11 | ;;; This file is part of GNU Guix. | |
12 | ;;; | |
13 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
14 | ;;; under the terms of the GNU General Public License as published by | |
15 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
16 | ;;; your option) any later version. | |
17 | ;;; | |
18 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
19 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
21 | ;;; GNU General Public License for more details. | |
22 | ;;; | |
23 | ;;; You should have received a copy of the GNU General Public License | |
24 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
25 | ||
26 | (define-module (gnu packages shellutils) | |
e3e8924d | 27 | #:use-module ((guix licenses) #:prefix license:) |
f0e14975 | 28 | #:use-module (guix utils) |
54899414 MJ |
29 | #:use-module (guix packages) |
30 | #:use-module (guix download) | |
31b61956 | 31 | #:use-module (guix git-download) |
f0e14975 EF |
32 | #:use-module (guix build-system gnu) |
33 | #:use-module (guix build-system go) | |
34 | #:use-module (guix build-system python) | |
f80d6ea2 | 35 | #:use-module (gnu packages autotools) |
f0e14975 EF |
36 | #:use-module (gnu packages base) |
37 | #:use-module (gnu packages golang) | |
f80d6ea2 | 38 | #:use-module (gnu packages ncurses) |
f80d6ea2 | 39 | #:use-module (gnu packages pkg-config) |
f0e14975 EF |
40 | #:use-module (gnu packages python) |
41 | #:use-module (gnu packages readline) | |
8ebd56ea | 42 | #:use-module (gnu packages ruby) |
8ebd56ea | 43 | #:use-module (gnu packages shells) |
f0e14975 | 44 | #:use-module (gnu packages tmux)) |
54899414 | 45 | |
8ebd56ea CD |
46 | (define-public zsh-autosuggestions |
47 | (package | |
48 | (name "zsh-autosuggestions") | |
23e89f91 | 49 | (version "0.6.4") |
8ebd56ea CD |
50 | (source (origin |
51 | (method git-fetch) | |
52 | (uri (git-reference | |
b0e7b699 | 53 | (url "https://github.com/zsh-users/zsh-autosuggestions") |
8ebd56ea CD |
54 | (commit (string-append "v" version)))) |
55 | (file-name (git-file-name name version)) | |
56 | (sha256 | |
57 | (base32 | |
23e89f91 | 58 | "0h52p2waggzfshvy1wvhj4hf06fmzd44bv6j18k3l9rcx6aixzn6")))) |
8ebd56ea CD |
59 | (build-system gnu-build-system) |
60 | (native-inputs | |
61 | `(("ruby" ,ruby) | |
62 | ("ruby-byebug" ,ruby-byebug) | |
63 | ("ruby-pry" ,ruby-pry) | |
64 | ("ruby-rspec" ,ruby-rspec) | |
65 | ("ruby-rspec-wait" ,ruby-rspec-wait) | |
66 | ("tmux" ,tmux) | |
67 | ("zsh" ,zsh))) | |
68 | (arguments | |
69 | '(#:phases | |
70 | (modify-phases %standard-phases | |
71 | (delete 'configure) | |
72 | (replace 'check ; Tests use ruby's bundler; instead execute rspec directly. | |
73 | (lambda _ | |
74 | (setenv "TMUX_TMPDIR" (getenv "TMPDIR")) | |
75 | (setenv "SHELL" (which "zsh")) | |
76 | (invoke "rspec"))) | |
77 | (replace 'install | |
78 | (lambda* (#:key outputs #:allow-other-keys) | |
79 | (let* ((out (assoc-ref outputs "out")) | |
80 | (zsh-plugins | |
81 | (string-append out "/share/zsh/plugins/zsh-autosuggestions"))) | |
82 | (invoke "make" "all") | |
83 | (install-file "zsh-autosuggestions.zsh" zsh-plugins) | |
84 | #t)))))) | |
85 | (home-page "https://github.com/zsh-users/zsh-autosuggestions") | |
86 | (synopsis "Fish-like autosuggestions for zsh") | |
87 | (description | |
88 | "Fish-like fast/unobtrusive autosuggestions for zsh. It suggests commands | |
89 | as you type.") | |
90 | (license license:expat))) | |
91 | ||
f69f37d5 CD |
92 | (define-public sh-z |
93 | (package | |
94 | (name "sh-z") | |
95 | (version "1.11") | |
96 | (source (origin | |
97 | (method git-fetch) | |
98 | (uri (git-reference | |
b0e7b699 | 99 | (url "https://github.com/rupa/z") |
f69f37d5 CD |
100 | (commit (string-append "v" version)))) |
101 | (file-name (git-file-name name version)) | |
102 | (sha256 | |
103 | (base32 | |
104 | "13zbgkj6y0qhvn5jpkrqbd4jjxjr789k228iwma5hjfh1nx7ghyb")))) | |
105 | (build-system gnu-build-system) | |
106 | (arguments | |
107 | `(#:tests? #f ; No tests provided | |
108 | #:phases | |
109 | (modify-phases %standard-phases | |
110 | (delete 'configure) | |
111 | (delete 'build) | |
112 | (replace 'install | |
113 | (lambda* (#:key outputs #:allow-other-keys) | |
114 | (let* ((out (assoc-ref outputs "out")) | |
115 | (man (string-append out "/share/man/man1")) | |
116 | (bin (string-append out "/bin"))) | |
117 | (install-file "z.sh" bin) | |
118 | (chmod (string-append bin "/z.sh") #o755) | |
119 | (install-file "z.1" man) | |
120 | #t)))))) | |
121 | (synopsis "Jump about directories") | |
122 | (description | |
123 | "Tracks your most used directories, based on ``frecency''. After a short | |
124 | learning phase, z will take you to the most ``frecent'' directory that matches | |
125 | all of the regexes given on the command line in order.") | |
126 | (home-page "https://github.com/rupa/z") | |
127 | (license license:expat))) | |
128 | ||
54899414 MJ |
129 | (define-public envstore |
130 | (package | |
131 | (name "envstore") | |
132 | (version "2.1") | |
133 | (source | |
134 | (origin | |
135 | (method url-fetch) | |
136 | (uri (string-append "https://finalrewind.org/projects/" | |
137 | name "/" name "-" version ".tar.bz2")) | |
138 | (sha256 | |
139 | (base32 "1x97lxad80m5blhdfanl5v2qzjwcgbij2i23701bn8mpyxsrqszi")))) | |
140 | (build-system gnu-build-system) | |
141 | (arguments | |
142 | `(#:test-target "test" | |
143 | #:make-flags (list "CC=gcc" | |
144 | (string-append "PREFIX=" (assoc-ref %outputs "out"))) | |
145 | #:phases | |
146 | (modify-phases %standard-phases | |
147 | (delete 'configure)))) | |
148 | (home-page "https://finalrewind.org/projects/envstore/") | |
149 | (synopsis "Save and restore environment variables") | |
150 | (description "Envstore is a program for sharing environment variables | |
151 | between various shells or commands.") | |
ac44b39a | 152 | (license license:wtfpl2))) |
92c2f605 AG |
153 | |
154 | (define-public trash-cli | |
155 | (package | |
156 | (name "trash-cli") | |
33884385 | 157 | (version "0.17.1.14") |
92c2f605 AG |
158 | (source |
159 | (origin | |
160 | (method url-fetch) | |
161 | (uri (pypi-uri "trash-cli" version)) | |
162 | (sha256 | |
163 | (base32 | |
33884385 | 164 | "01q0cl04ljf214z6s3g256gsxx3pqsgaf6ac1zh0vrq5bnhnr85h")))) |
92c2f605 AG |
165 | (build-system python-build-system) |
166 | (arguments | |
167 | `(#:python ,python-2 | |
168 | #:tests? #f ; no tests | |
169 | #:phases | |
170 | (modify-phases %standard-phases | |
171 | (add-before 'build 'patch-path-constants | |
172 | (lambda* (#:key inputs #:allow-other-keys) | |
173 | (let ((libc (assoc-ref inputs "libc")) | |
174 | (coreutils (assoc-ref inputs "coreutils"))) | |
175 | (substitute* "trashcli/list_mount_points.py" | |
176 | (("\"/lib/libc.so.6\".*") | |
177 | (string-append "\"" libc "/lib/libc.so.6\"\n")) | |
178 | (("\"df\"") | |
179 | (string-append "\"" coreutils "/bin/df\""))))))))) | |
180 | (inputs `(("coreutils" ,coreutils))) | |
181 | (home-page "https://github.com/andreafrancia/trash-cli") | |
182 | (synopsis "Trash can management tool") | |
183 | (description | |
184 | "trash-cli is a command line utility for interacting with the | |
185 | FreeDesktop.org trash can used by GNOME, KDE, XFCE, and other common desktop | |
186 | environments. It can move files to the trash, and remove or list files that | |
187 | are already there.") | |
e3e8924d | 188 | (license license:gpl2+))) |
76f31f0b CB |
189 | |
190 | (define-public direnv | |
191 | (package | |
192 | (name "direnv") | |
39ea311c | 193 | (version "2.15.2") |
76f31f0b | 194 | (source |
81aa6c72 CB |
195 | (origin (method git-fetch) |
196 | (uri (git-reference | |
b0e7b699 | 197 | (url "https://github.com/direnv/direnv") |
81aa6c72 CB |
198 | (commit (string-append "v" version)))) |
199 | (file-name (git-file-name name version)) | |
76f31f0b CB |
200 | (sha256 |
201 | (base32 | |
81aa6c72 CB |
202 | "1y18619pmhfl0vrf4w0h75ybkkwgi9wcb7d9kv4n8drg1xp4aw4w")))) |
203 | (build-system go-build-system) | |
76f31f0b | 204 | (arguments |
81aa6c72 | 205 | '(#:import-path "github.com/direnv/direnv" |
39ea311c LF |
206 | #:phases |
207 | (modify-phases %standard-phases | |
81aa6c72 CB |
208 | (add-after 'unpack 'delete-vendor |
209 | (lambda _ | |
210 | ;; Using a snippet causes issues with the name of the directory, | |
211 | ;; so delete the extra source code here. | |
212 | (delete-file-recursively "src/github.com/direnv/direnv/vendor") | |
213 | #t)) | |
214 | (replace 'check | |
215 | (lambda* (#:key tests? #:allow-other-keys) | |
216 | (when tests? | |
217 | (setenv "HOME" "/tmp") | |
218 | (with-directory-excursion "src/github.com/direnv/direnv" | |
219 | ;; The following file needs to be writable so it can be | |
220 | ;; modified by the testsuite. | |
221 | (make-file-writable "test/scenarios/base/.envrc") | |
222 | (invoke "make" "test") | |
223 | ;; Clean up from the tests, especially so that the extra | |
224 | ;; direnv executable that's generated is removed. | |
225 | (invoke "make" "clean"))) | |
226 | #t))))) | |
9729b6ea | 227 | (native-inputs |
81aa6c72 | 228 | `(("go-github-com-burntsushi-toml" ,go-github-com-burntsushi-toml) |
9729b6ea CB |
229 | ("go-github-com-direnv-go-dotenv" ,go-github-com-direnv-go-dotenv) |
230 | ("which" ,which))) | |
6137da88 | 231 | (home-page "https://direnv.net/") |
76f31f0b | 232 | (synopsis "Environment switcher for the shell") |
a6317919 TGR |
233 | (description |
234 | "direnv can hook into the bash, zsh, tcsh, and fish shells to load | |
76f31f0b | 235 | or unload environment variables depending on the current directory. This |
a6317919 | 236 | allows project-specific environment variables without using @file{~/.profile}. |
76f31f0b | 237 | |
a6317919 TGR |
238 | Before each prompt, direnv checks for the existence of a @file{.envrc} file in |
239 | the current and parent directories. This file is then used to alter the | |
240 | environment variables of the current shell.") | |
e3e8924d | 241 | (license license:expat))) |
f3f82d1d SR |
242 | |
243 | (define-public fzy | |
244 | (package | |
245 | (name "fzy") | |
2792d8a8 | 246 | (version "1.0") |
f3f82d1d SR |
247 | (source |
248 | (origin | |
31b61956 TGR |
249 | (method git-fetch) |
250 | (uri (git-reference | |
b0e7b699 | 251 | (url "https://github.com/jhawthorn/fzy") |
31b61956 TGR |
252 | (commit version))) |
253 | (file-name (git-file-name name version)) | |
f3f82d1d SR |
254 | (sha256 |
255 | (base32 | |
2792d8a8 | 256 | "1gkzdvj73f71388jvym47075l9zw61v6l8wdv2lnc0mns6dxig0k")))) |
f3f82d1d SR |
257 | (build-system gnu-build-system) |
258 | (arguments | |
259 | '(#:make-flags (list "CC=gcc" | |
260 | (string-append "PREFIX=" (assoc-ref %outputs "out"))) | |
261 | #:phases | |
262 | (modify-phases %standard-phases | |
263 | (delete 'configure)))) | |
264 | (home-page "https://github.com/jhawthorn/fzy") | |
265 | (synopsis "Fast fuzzy text selector for the terminal with an advanced | |
266 | scoring algorithm") | |
267 | (description | |
268 | "Most other fuzzy matchers sort based on the length of a match. fzy tries | |
269 | to find the result the user intended. It does this by favouring matches on | |
270 | consecutive letters and starts of words. This allows matching using acronyms | |
271 | or different parts of the path. | |
272 | ||
273 | fzy is designed to be used both as an editor plugin and on the command | |
274 | line. Rather than clearing the screen, fzy displays its interface directly | |
275 | below the current cursor position, scrolling the screen if necessary.") | |
e3e8924d | 276 | (license license:expat))) |
f80d6ea2 BS |
277 | |
278 | (define-public hstr | |
279 | (package | |
280 | (name "hstr") | |
ad81708d | 281 | (version "2.2") |
f80d6ea2 | 282 | (source (origin |
2bbda4f0 EF |
283 | (method git-fetch) |
284 | (uri (git-reference | |
b0e7b699 | 285 | (url "https://github.com/dvorka/hstr") |
2bbda4f0 EF |
286 | (commit version))) |
287 | (file-name (git-file-name name version)) | |
f80d6ea2 BS |
288 | (sha256 |
289 | (base32 | |
ad81708d | 290 | "07fkilqlkpygvf9kvxyvl58g3lfq0bwwdp3wczy4hk8qlbhmgihn")))) |
f80d6ea2 BS |
291 | (build-system gnu-build-system) |
292 | (arguments | |
293 | `(#:phases | |
294 | (modify-phases %standard-phases | |
295 | (add-before 'build 'adjust-ncurses-includes | |
296 | (lambda* (#:key make-flags outputs #:allow-other-keys) | |
297 | (let ((out (assoc-ref outputs "out"))) | |
298 | (substitute* "src/include/hstr_curses.h" | |
299 | (("ncursesw\\/curses.h") "ncurses.h")) | |
300 | (substitute* "src/include/hstr.h" | |
301 | (("ncursesw\\/curses.h") "ncurses.h"))) | |
302 | #t))))) | |
303 | (native-inputs | |
304 | `(("autoconf" ,autoconf) | |
305 | ("automake" ,automake) | |
306 | ("pkg-config" ,pkg-config))) | |
307 | (inputs | |
308 | `(("ncurses" ,ncurses) | |
309 | ("readline" ,readline))) | |
310 | (synopsis "Navigate and search command history with shell history suggest box") | |
311 | (description "HSTR (HiSToRy) is a command-line utility that brings | |
312 | improved Bash and Zsh command completion from the history. It aims to make | |
313 | completion easier and more efficient than with @kbd{Ctrl-R}. It allows you to | |
314 | easily view, navigate, and search your command history with suggestion boxes. | |
315 | HSTR can also manage your command history (for instance you can remove | |
316 | commands that are obsolete or contain a piece of sensitive information) or | |
317 | bookmark your favourite commands.") | |
318 | (home-page "http://me.mindforger.com/projects/hh.html") | |
e3e8924d | 319 | (license license:asl2.0))) |
39bf4e0b OP |
320 | |
321 | (define-public shell-functools | |
322 | (package | |
323 | (name "shell-functools") | |
324 | (version "0.3.0") | |
325 | (source (origin | |
326 | (method git-fetch) | |
327 | (uri (git-reference | |
b0e7b699 | 328 | (url "https://github.com/sharkdp/shell-functools") |
39bf4e0b OP |
329 | (commit (string-append "v" version)))) |
330 | (file-name (git-file-name name version)) | |
331 | (sha256 | |
332 | (base32 | |
333 | "0d6zzg7cxfrzwzh1wmpj7q85kz33sak6ac59ncsm6dlbin12h0hi")))) | |
334 | (build-system python-build-system) | |
335 | (home-page "https://github.com/sharkdp/shell-functools/") | |
336 | (synopsis "Functional programming tools for the shell") | |
337 | (description "This package provides higher order functions like map, | |
338 | filter, foldl, sort_by and take_while as simple command-line tools. Following | |
339 | the UNIX philosophy, these commands are designed to be composed via pipes. A | |
340 | large collection of functions such as basename, replace, contains or is_dir | |
341 | are provided as arguments to these commands.") | |
342 | (license license:expat))) |