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