projects/guix·blob version-1.0.1 · refs

230 lines · 9.2 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2016 Matthew Jordan <[email protected]>
3;;; Copyright © 2016, 2017 Alex Griffin <[email protected]>
4;;; Copyright © 2016 Christopher Baines <[email protected]>
5;;; Copyright © 2017 Stefan Reichör <[email protected]>
6;;; Copyright © 2018 Tobias Geerinckx-Rice <[email protected]>
7;;; Copyright © 2018 Benjamin Slade <[email protected]>
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) #:prefix license:)
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
63between various shells or commands.")
64 (license license:wtfpl2)))
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
97FreeDesktop.org trash can used by GNOME, KDE, XFCE, and other common desktop
98environments. It can move files to the trash, and remove or list files that
99are already there.")
100 (license license:gpl2+)))
101
102(define-public direnv
103 (package
104 (name "direnv")
105 (version "2.15.2")
106 (source
107 (origin (method git-fetch)
108 (uri (git-reference
109 (url "https://github.com/direnv/direnv.git")
110 (commit (string-append "v" version))))
111 (file-name (git-file-name name version))
112 (sha256
113 (base32
114 "1y18619pmhfl0vrf4w0h75ybkkwgi9wcb7d9kv4n8drg1xp4aw4w"))))
115 (build-system go-build-system)
116 (arguments
117 '(#:import-path "github.com/direnv/direnv"
118 #:phases
119 (modify-phases %standard-phases
120 (add-after 'unpack 'delete-vendor
121 (lambda _
122 ;; Using a snippet causes issues with the name of the directory,
123 ;; so delete the extra source code here.
124 (delete-file-recursively "src/github.com/direnv/direnv/vendor")
125 #t))
126 (replace 'check
127 (lambda* (#:key tests? #:allow-other-keys)
128 (when tests?
129 (setenv "HOME" "/tmp")
130 (with-directory-excursion "src/github.com/direnv/direnv"
131 ;; The following file needs to be writable so it can be
132 ;; modified by the testsuite.
133 (make-file-writable "test/scenarios/base/.envrc")
134 (invoke "make" "test")
135 ;; Clean up from the tests, especially so that the extra
136 ;; direnv executable that's generated is removed.
137 (invoke "make" "clean")))
138 #t)))))
139 (native-inputs
140 `(("go-github-com-burntsushi-toml" ,go-github-com-burntsushi-toml)
141 ("go-github-com-direnv-go-dotenv" ,go-github-com-direnv-go-dotenv)
142 ("which" ,which)))
143 (home-page "https://direnv.net/")
144 (synopsis "Environment switcher for the shell")
145 (description
146 "direnv can hook into the bash, zsh, tcsh, and fish shells to load
147or unload environment variables depending on the current directory. This
148allows project-specific environment variables without using @file{~/.profile}.
149
150Before each prompt, direnv checks for the existence of a @file{.envrc} file in
151the current and parent directories. This file is then used to alter the
152environment variables of the current shell.")
153 (license license:expat)))
154
155(define-public fzy
156 (package
157 (name "fzy")
158 (version "1.0")
159 (source
160 (origin
161 (method git-fetch)
162 (uri (git-reference
163 (url "https://github.com/jhawthorn/fzy.git")
164 (commit version)))
165 (file-name (git-file-name name version))
166 (sha256
167 (base32
168 "1gkzdvj73f71388jvym47075l9zw61v6l8wdv2lnc0mns6dxig0k"))))
169 (build-system gnu-build-system)
170 (arguments
171 '(#:make-flags (list "CC=gcc"
172 (string-append "PREFIX=" (assoc-ref %outputs "out")))
173 #:phases
174 (modify-phases %standard-phases
175 (delete 'configure))))
176 (home-page "https://github.com/jhawthorn/fzy")
177 (synopsis "Fast fuzzy text selector for the terminal with an advanced
178scoring algorithm")
179 (description
180 "Most other fuzzy matchers sort based on the length of a match. fzy tries
181to find the result the user intended. It does this by favouring matches on
182consecutive letters and starts of words. This allows matching using acronyms
183or different parts of the path.
184
185fzy is designed to be used both as an editor plugin and on the command
186line. Rather than clearing the screen, fzy displays its interface directly
187below the current cursor position, scrolling the screen if necessary.")
188 (license license:expat)))
189
190(define-public hstr
191 (package
192 (name "hstr")
193 (version "2.0")
194 (source (origin
195 (method url-fetch)
196 (uri (string-append "https://github.com/dvorka/" name "/archive/"
197 version ".tar.gz"))
198 (sha256
199 (base32
200 "0yk2008bl48hv0v3c90ngq4y45h3nxif2ik6s3l7kag1zs5yv4wd"))
201 (file-name (string-append name "-" version ".tar.gz"))))
202 (build-system gnu-build-system)
203 (arguments
204 `(#:phases
205 (modify-phases %standard-phases
206 (add-before 'build 'adjust-ncurses-includes
207 (lambda* (#:key make-flags outputs #:allow-other-keys)
208 (let ((out (assoc-ref outputs "out")))
209 (substitute* "src/include/hstr_curses.h"
210 (("ncursesw\\/curses.h") "ncurses.h"))
211 (substitute* "src/include/hstr.h"
212 (("ncursesw\\/curses.h") "ncurses.h")))
213 #t)))))
214 (native-inputs
215 `(("autoconf" ,autoconf)
216 ("automake" ,automake)
217 ("pkg-config" ,pkg-config)))
218 (inputs
219 `(("ncurses" ,ncurses)
220 ("readline" ,readline)))
221 (synopsis "Navigate and search command history with shell history suggest box")
222 (description "HSTR (HiSToRy) is a command-line utility that brings
223improved Bash and Zsh command completion from the history. It aims to make
224completion easier and more efficient than with @kbd{Ctrl-R}. It allows you to
225easily view, navigate, and search your command history with suggestion boxes.
226HSTR can also manage your command history (for instance you can remove
227commands that are obsolete or contain a piece of sensitive information) or
228bookmark your favourite commands.")
229 (home-page "http://me.mindforger.com/projects/hh.html")
230 (license license:asl2.0)))