gnu: igt-gpu-tools: Don't use NAME in source URI.
[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 go)
39 #:use-module (guix build-system python))
40
41 (define-public envstore
42 (package
43 (name "envstore")
44 (version "2.1")
45 (source
46 (origin
47 (method url-fetch)
48 (uri (string-append "https://finalrewind.org/projects/"
49 name "/" name "-" version ".tar.bz2"))
50 (sha256
51 (base32 "1x97lxad80m5blhdfanl5v2qzjwcgbij2i23701bn8mpyxsrqszi"))))
52 (build-system gnu-build-system)
53 (arguments
54 `(#:test-target "test"
55 #:make-flags (list "CC=gcc"
56 (string-append "PREFIX=" (assoc-ref %outputs "out")))
57 #:phases
58 (modify-phases %standard-phases
59 (delete 'configure))))
60 (home-page "https://finalrewind.org/projects/envstore/")
61 (synopsis "Save and restore environment variables")
62 (description "Envstore is a program for sharing environment variables
63 between various shells or commands.")
64 (license
65 (non-copyleft "http://www.wtfpl.net/txt/copying/"))))
66
67 (define-public trash-cli
68 (package
69 (name "trash-cli")
70 (version "0.17.1.14")
71 (source
72 (origin
73 (method url-fetch)
74 (uri (pypi-uri "trash-cli" version))
75 (sha256
76 (base32
77 "01q0cl04ljf214z6s3g256gsxx3pqsgaf6ac1zh0vrq5bnhnr85h"))))
78 (build-system python-build-system)
79 (arguments
80 `(#:python ,python-2
81 #:tests? #f ; no tests
82 #:phases
83 (modify-phases %standard-phases
84 (add-before 'build 'patch-path-constants
85 (lambda* (#:key inputs #:allow-other-keys)
86 (let ((libc (assoc-ref inputs "libc"))
87 (coreutils (assoc-ref inputs "coreutils")))
88 (substitute* "trashcli/list_mount_points.py"
89 (("\"/lib/libc.so.6\".*")
90 (string-append "\"" libc "/lib/libc.so.6\"\n"))
91 (("\"df\"")
92 (string-append "\"" coreutils "/bin/df\"")))))))))
93 (inputs `(("coreutils" ,coreutils)))
94 (home-page "https://github.com/andreafrancia/trash-cli")
95 (synopsis "Trash can management tool")
96 (description
97 "trash-cli is a command line utility for interacting with the
98 FreeDesktop.org trash can used by GNOME, KDE, XFCE, and other common desktop
99 environments. It can move files to the trash, and remove or list files that
100 are already there.")
101 (license gpl2+)))
102
103 (define-public direnv
104 (package
105 (name "direnv")
106 (version "2.15.2")
107 (source
108 (origin (method url-fetch)
109 (uri (string-append "https://github.com/direnv/" name
110 "/archive/v" version ".tar.gz"))
111 (file-name (string-append name "-" version ".tar.gz"))
112 (sha256
113 (base32
114 "1hhmc6rb7b1d4s4kgb4blrq35h388ax37ap88dq3dgfcw9w6j1rm"))))
115 (build-system gnu-build-system)
116 (arguments
117 `(#:test-target "test"
118 #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out")))
119 #:modules ((guix build gnu-build-system)
120 ((guix build go-build-system) #:prefix go:)
121 (guix build utils))
122 #:imported-modules (,@%gnu-build-system-modules
123 (guix build go-build-system))
124 #:phases
125 (modify-phases %standard-phases
126 (delete 'configure)
127 ;; Help the build scripts find the Go language dependencies.
128 (add-after 'unpack 'setup-go-environment
129 (assoc-ref go:%standard-phases 'setup-environment)))))
130 (inputs
131 `(("go" ,go)
132 ("go-github-com-burntsushi-toml" ,go-github-com-burntsushi-toml)
133 ("go-github-com-direnv-go-dotenv" ,go-github-com-direnv-go-dotenv)))
134 (native-inputs
135 `(("which" ,which)))
136 (home-page "https://direnv.net/")
137 (synopsis "Environment switcher for the shell")
138 (description
139 "direnv can hook into the bash, zsh, tcsh, and fish shells to load
140 or unload environment variables depending on the current directory. This
141 allows project-specific environment variables without using @file{~/.profile}.
142
143 Before each prompt, direnv checks for the existence of a @file{.envrc} file in
144 the current and parent directories. This file is then used to alter the
145 environment variables of the current shell.")
146 (license expat)))
147
148 (define-public fzy
149 (package
150 (name "fzy")
151 (version "1.0")
152 (source
153 (origin
154 (method git-fetch)
155 (uri (git-reference
156 (url "https://github.com/jhawthorn/fzy.git")
157 (commit version)))
158 (file-name (git-file-name name version))
159 (sha256
160 (base32
161 "1gkzdvj73f71388jvym47075l9zw61v6l8wdv2lnc0mns6dxig0k"))))
162 (build-system gnu-build-system)
163 (arguments
164 '(#:make-flags (list "CC=gcc"
165 (string-append "PREFIX=" (assoc-ref %outputs "out")))
166 #:phases
167 (modify-phases %standard-phases
168 (delete 'configure))))
169 (home-page "https://github.com/jhawthorn/fzy")
170 (synopsis "Fast fuzzy text selector for the terminal with an advanced
171 scoring algorithm")
172 (description
173 "Most other fuzzy matchers sort based on the length of a match. fzy tries
174 to find the result the user intended. It does this by favouring matches on
175 consecutive letters and starts of words. This allows matching using acronyms
176 or different parts of the path.
177
178 fzy is designed to be used both as an editor plugin and on the command
179 line. Rather than clearing the screen, fzy displays its interface directly
180 below the current cursor position, scrolling the screen if necessary.")
181 (license expat)))
182
183 (define-public hstr
184 (package
185 (name "hstr")
186 (version "2.0")
187 (source (origin
188 (method url-fetch)
189 (uri (string-append "https://github.com/dvorka/" name "/archive/"
190 version ".tar.gz"))
191 (sha256
192 (base32
193 "0yk2008bl48hv0v3c90ngq4y45h3nxif2ik6s3l7kag1zs5yv4wd"))
194 (file-name (string-append name "-" version ".tar.gz"))))
195 (build-system gnu-build-system)
196 (arguments
197 `(#:phases
198 (modify-phases %standard-phases
199 (add-before 'build 'adjust-ncurses-includes
200 (lambda* (#:key make-flags outputs #:allow-other-keys)
201 (let ((out (assoc-ref outputs "out")))
202 (substitute* "src/include/hstr_curses.h"
203 (("ncursesw\\/curses.h") "ncurses.h"))
204 (substitute* "src/include/hstr.h"
205 (("ncursesw\\/curses.h") "ncurses.h")))
206 #t)))))
207 (native-inputs
208 `(("autoconf" ,autoconf)
209 ("automake" ,automake)
210 ("pkg-config" ,pkg-config)))
211 (inputs
212 `(("ncurses" ,ncurses)
213 ("readline" ,readline)))
214 (synopsis "Navigate and search command history with shell history suggest box")
215 (description "HSTR (HiSToRy) is a command-line utility that brings
216 improved Bash and Zsh command completion from the history. It aims to make
217 completion easier and more efficient than with @kbd{Ctrl-R}. It allows you to
218 easily view, navigate, and search your command history with suggestion boxes.
219 HSTR can also manage your command history (for instance you can remove
220 commands that are obsolete or contain a piece of sensitive information) or
221 bookmark your favourite commands.")
222 (home-page "http://me.mindforger.com/projects/hh.html")
223 (license asl2.0)))