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>
9 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
41 (define-public envstore
48 (uri (string-append "https://finalrewind.org/projects/"
49 name "/" name "-" version ".tar.bz2"))
51 (base32 "1x97lxad80m5blhdfanl5v2qzjwcgbij2i23701bn8mpyxsrqszi"))))
52 (build-system gnu-build-system)
54 `(#:test-target "test"
55 #:make-flags (list "CC=gcc"
56 (string-append "PREFIX=" (assoc-ref %outputs "out")))
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.")
65 (non-copyleft "http://www.wtfpl.net/txt/copying/"))))
67 (define-public trash-cli
74 (uri (pypi-uri "trash-cli" version))
77 "01q0cl04ljf214z6s3g256gsxx3pqsgaf6ac1zh0vrq5bnhnr85h"))))
78 (build-system python-build-system)
81 #:tests? #f ; no tests
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"))
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")
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
103 (define-public direnv
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"))
114 "1hhmc6rb7b1d4s4kgb4blrq35h388ax37ap88dq3dgfcw9w6j1rm"))))
115 (build-system gnu-build-system)
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:)
122 #:imported-modules (,@%gnu-build-system-modules
123 (guix build go-build-system))
125 (modify-phases %standard-phases
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)))))
132 ("go-github-com-burntsushi-toml" ,go-github-com-burntsushi-toml)
133 ("go-github-com-direnv-go-dotenv" ,go-github-com-direnv-go-dotenv)))
136 (home-page "https://direnv.net/")
137 (synopsis "Environment switcher for the shell")
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}.
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.")
156 (url "https://github.com/jhawthorn/fzy.git")
158 (file-name (git-file-name name version))
161 "1gkzdvj73f71388jvym47075l9zw61v6l8wdv2lnc0mns6dxig0k"))))
162 (build-system gnu-build-system)
164 '(#:make-flags (list "CC=gcc"
165 (string-append "PREFIX=" (assoc-ref %outputs "out")))
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
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.
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.")
189 (uri (string-append "https://github.com/dvorka/" name "/archive/"
193 "0yk2008bl48hv0v3c90ngq4y45h3nxif2ik6s3l7kag1zs5yv4wd"))
194 (file-name (string-append name "-" version ".tar.gz"))))
195 (build-system gnu-build-system)
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")))
208 `(("autoconf" ,autoconf)
209 ("automake" ,automake)
210 ("pkg-config" ,pkg-config)))
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")