gnu: Add libusbmuxd.
[jackhill/guix/guix.git] / gnu / packages / shellutils.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016 Matthew Jordan <matthewjordandevops@yandex.com>
3 ;;; Copyright © 2016, 2017 Alex Griffin <a@ajgrf.com>
4 ;;; Copyright © 2016 Christopher Baines <mail@cbaines.net>
5 ;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
6 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2018 Benjamin Slade <slade@jnanam.net>
8 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
15 ;;;
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
20 ;;;
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24 (define-module (gnu packages shellutils)
25 #:use-module (gnu packages base)
26 #:use-module (gnu packages golang)
27 #:use-module (gnu packages python)
28 #:use-module (guix licenses)
29 #:use-module (guix packages)
30 #:use-module (guix download)
31 #:use-module (guix git-download)
32 #:use-module (gnu packages autotools)
33 #:use-module (gnu packages ncurses)
34 #:use-module (gnu packages readline)
35 #:use-module (gnu packages pkg-config)
36 #:use-module (guix utils)
37 #:use-module (guix build-system gnu)
38 #:use-module (guix build-system python))
39
40 (define-public envstore
41 (package
42 (name "envstore")
43 (version "2.1")
44 (source
45 (origin
46 (method url-fetch)
47 (uri (string-append "https://finalrewind.org/projects/"
48 name "/" name "-" version ".tar.bz2"))
49 (sha256
50 (base32 "1x97lxad80m5blhdfanl5v2qzjwcgbij2i23701bn8mpyxsrqszi"))))
51 (build-system gnu-build-system)
52 (arguments
53 `(#:test-target "test"
54 #:make-flags (list "CC=gcc"
55 (string-append "PREFIX=" (assoc-ref %outputs "out")))
56 #:phases
57 (modify-phases %standard-phases
58 (delete 'configure))))
59 (home-page "https://finalrewind.org/projects/envstore/")
60 (synopsis "Save and restore environment variables")
61 (description "Envstore is a program for sharing environment variables
62 between various shells or commands.")
63 (license
64 (non-copyleft "http://www.wtfpl.net/txt/copying/"))))
65
66 (define-public trash-cli
67 (package
68 (name "trash-cli")
69 (version "0.17.1.14")
70 (source
71 (origin
72 (method url-fetch)
73 (uri (pypi-uri "trash-cli" version))
74 (sha256
75 (base32
76 "01q0cl04ljf214z6s3g256gsxx3pqsgaf6ac1zh0vrq5bnhnr85h"))))
77 (build-system python-build-system)
78 (arguments
79 `(#:python ,python-2
80 #:tests? #f ; no tests
81 #:phases
82 (modify-phases %standard-phases
83 (add-before 'build 'patch-path-constants
84 (lambda* (#:key inputs #:allow-other-keys)
85 (let ((libc (assoc-ref inputs "libc"))
86 (coreutils (assoc-ref inputs "coreutils")))
87 (substitute* "trashcli/list_mount_points.py"
88 (("\"/lib/libc.so.6\".*")
89 (string-append "\"" libc "/lib/libc.so.6\"\n"))
90 (("\"df\"")
91 (string-append "\"" coreutils "/bin/df\"")))))))))
92 (inputs `(("coreutils" ,coreutils)))
93 (home-page "https://github.com/andreafrancia/trash-cli")
94 (synopsis "Trash can management tool")
95 (description
96 "trash-cli is a command line utility for interacting with the
97 FreeDesktop.org trash can used by GNOME, KDE, XFCE, and other common desktop
98 environments. It can move files to the trash, and remove or list files that
99 are already there.")
100 (license gpl2+)))
101
102 (define-public direnv
103 (package
104 (name "direnv")
105 (version "2.11.3")
106 (source
107 (origin (method url-fetch)
108 (uri (string-append "https://github.com/direnv/" name
109 "/archive/v" version ".tar.gz"))
110 (file-name (string-append name "-" version ".tar.gz"))
111 (sha256
112 (base32
113 "01mhwzq9ss2qlnn8aahvwsgnspq8hbz0qfknf290aicngwx10d1d"))))
114 (build-system gnu-build-system)
115 (arguments
116 '(#:test-target "test"
117 #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out")))
118 #:phases (modify-phases %standard-phases (delete 'configure))))
119 (inputs
120 `(("go" ,go-1.9)))
121 (native-inputs
122 `(("which" ,which)))
123 (home-page "https://direnv.net/")
124 (synopsis "Environment switcher for the shell")
125 (description
126 "direnv can hook into the bash, zsh, tcsh, and fish shells to load
127 or unload environment variables depending on the current directory. This
128 allows project-specific environment variables without using @file{~/.profile}.
129
130 Before each prompt, direnv checks for the existence of a @file{.envrc} file in
131 the current and parent directories. This file is then used to alter the
132 environment variables of the current shell.")
133 (license expat)))
134
135 (define-public fzy
136 (package
137 (name "fzy")
138 (version "1.0")
139 (source
140 (origin
141 (method git-fetch)
142 (uri (git-reference
143 (url "https://github.com/jhawthorn/fzy.git")
144 (commit version)))
145 (file-name (git-file-name name version))
146 (sha256
147 (base32
148 "1gkzdvj73f71388jvym47075l9zw61v6l8wdv2lnc0mns6dxig0k"))))
149 (build-system gnu-build-system)
150 (arguments
151 '(#:make-flags (list "CC=gcc"
152 (string-append "PREFIX=" (assoc-ref %outputs "out")))
153 #:phases
154 (modify-phases %standard-phases
155 (delete 'configure))))
156 (home-page "https://github.com/jhawthorn/fzy")
157 (synopsis "Fast fuzzy text selector for the terminal with an advanced
158 scoring algorithm")
159 (description
160 "Most other fuzzy matchers sort based on the length of a match. fzy tries
161 to find the result the user intended. It does this by favouring matches on
162 consecutive letters and starts of words. This allows matching using acronyms
163 or different parts of the path.
164
165 fzy is designed to be used both as an editor plugin and on the command
166 line. Rather than clearing the screen, fzy displays its interface directly
167 below the current cursor position, scrolling the screen if necessary.")
168 (license expat)))
169
170 (define-public hstr
171 (package
172 (name "hstr")
173 (version "2.0")
174 (source (origin
175 (method url-fetch)
176 (uri (string-append "https://github.com/dvorka/" name "/archive/"
177 version ".tar.gz"))
178 (sha256
179 (base32
180 "0yk2008bl48hv0v3c90ngq4y45h3nxif2ik6s3l7kag1zs5yv4wd"))
181 (file-name (string-append name "-" version ".tar.gz"))))
182 (build-system gnu-build-system)
183 (arguments
184 `(#:phases
185 (modify-phases %standard-phases
186 (add-before 'build 'adjust-ncurses-includes
187 (lambda* (#:key make-flags outputs #:allow-other-keys)
188 (let ((out (assoc-ref outputs "out")))
189 (substitute* "src/include/hstr_curses.h"
190 (("ncursesw\\/curses.h") "ncurses.h"))
191 (substitute* "src/include/hstr.h"
192 (("ncursesw\\/curses.h") "ncurses.h")))
193 #t)))))
194 (native-inputs
195 `(("autoconf" ,autoconf)
196 ("automake" ,automake)
197 ("pkg-config" ,pkg-config)))
198 (inputs
199 `(("ncurses" ,ncurses)
200 ("readline" ,readline)))
201 (synopsis "Navigate and search command history with shell history suggest box")
202 (description "HSTR (HiSToRy) is a command-line utility that brings
203 improved Bash and Zsh command completion from the history. It aims to make
204 completion easier and more efficient than with @kbd{Ctrl-R}. It allows you to
205 easily view, navigate, and search your command history with suggestion boxes.
206 HSTR can also manage your command history (for instance you can remove
207 commands that are obsolete or contain a piece of sensitive information) or
208 bookmark your favourite commands.")
209 (home-page "http://me.mindforger.com/projects/hh.html")
210 (license asl2.0)))