gnu: Add guile-sdl2.
[jackhill/guix/guix.git] / gnu / packages / shells.scm
CommitLineData
c356339d 1;;; GNU Guix --- Functional package management for GNU
d754347c 2;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
618977ae 3;;; Copyright © 2014, 2015 David Thompson <davet@gnu.org>
7ccb874a 4;;; Copyright © 2014 Kevin Lemonnier <lemonnierk@ulrar.net>
9a57d3e6 5;;; Copyright © 2015 Jeff Mickey <j@codemac.net>
c356339d 6;;; Copyright © 2016 Tobias Geerinckx-Rice <me@tobias.gr>
572ee05c 7;;; Copyright © 2016 Stefan Reichör <stefan@xsteve.at>
c356339d
TGR
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 shells)
d754347c 25 #:use-module (gnu packages)
a8d3bc47 26 #:use-module (gnu packages algebra)
9a57d3e6 27 #:use-module (gnu packages autotools)
d754347c 28 #:use-module (gnu packages base)
618977ae 29 #:use-module (gnu packages documentation)
c356339d 30 #:use-module (gnu packages libedit)
618977ae 31 #:use-module (gnu packages ncurses)
7ccb874a 32 #:use-module (gnu packages pcre)
9a57d3e6
TGR
33 #:use-module (gnu packages perl)
34 #:use-module (gnu packages pkg-config)
618977ae 35 #:use-module (gnu packages python)
9a57d3e6 36 #:use-module (gnu packages readline)
c356339d 37 #:use-module (guix build-system gnu)
1d515855 38 #:use-module (guix build-system python)
c356339d 39 #:use-module (guix download)
9a57d3e6 40 #:use-module (guix git-download)
c356339d
TGR
41 #:use-module (guix licenses)
42 #:use-module (guix packages))
43
44(define-public dash
45 (package
46 (name "dash")
47 (version "0.5.9")
48 (source
49 (origin
50 (method url-fetch)
51 (uri (string-append "http://gondor.apana.org.au/~herbert/dash/files/"
52 name "-" version ".tar.gz"))
53 (sha256
54 (base32
55 "17328wd9n5krr5wd37smrk0y7fdf8aa3hmhm02br5mqpq0a3nycj"))
56 (modules '((guix build utils)))
57 (snippet
58 '(begin
59 ;; The man page hails from BSD, where (d)ash is the default shell.
60 ;; This isn't the case on Guix or indeed most other GNU systems.
61 (substitute* "src/dash.1"
62 (("the standard command interpreter for the system")
63 "a command interpreter based on the original Bourne shell"))
64 #t))))
65 (build-system gnu-build-system)
66 (inputs
67 `(("libedit" ,libedit)))
68 (arguments
69 `(#:configure-flags '("--with-libedit")))
70 (home-page "http://gondor.apana.org.au/~herbert/dash")
71 (synopsis "POSIX-compliant shell optimised for size")
72 (description
73 "dash is a POSIX-compliant @command{/bin/sh} implementation that aims to be
74as small as possible, often without sacrificing speed. It is faster than the
75GNU Bourne-Again Shell (@command{bash}) at most scripted tasks. dash is a
76direct descendant of NetBSD's Almquist Shell (@command{ash}).")
77 (license (list bsd-3
78 gpl2+)))) ; mksignames.c
618977ae
TGR
79
80(define-public fish
81 (package
82 (name "fish")
1f781865 83 (version "2.4.0")
618977ae
TGR
84 (source (origin
85 (method url-fetch)
86 (uri (string-append "https://fishshell.com/files/"
87 version "/fish-" version ".tar.gz"))
88 (sha256
89 (base32
1f781865 90 "1iggr6ah0siyak073v2w4sx1man19q8jsxns8i09qhv06crb5fq6"))
618977ae
TGR
91 (modules '((guix build utils)))
92 ;; Don't try to install /etc/fish/config.fish.
93 (snippet
94 '(substitute* "Makefile.in"
95 ((".*INSTALL.*sysconfdir.*fish.*") "")))))
96 (build-system gnu-build-system)
97 (native-inputs
98 `(("doxygen" ,doxygen)))
99 (inputs
a8d3bc47
AI
100 `(("bc" ,bc)
101 ("ncurses" ,ncurses)
47c14714 102 ("pcre2" ,pcre2) ;don't use the bundled PCRE2
618977ae
TGR
103 ("python" ,python-wrapper))) ;for fish_config and manpage completions
104 (arguments
105 '(#:tests? #f ; no check target
a8d3bc47
AI
106 #:configure-flags '("--sysconfdir=/etc")
107 #:phases
108 (modify-phases %standard-phases
109 ;; Replace 'bc' by its absolute file name in the store.
110 (add-after 'unpack 'patch-bc
111 (lambda* (#:key inputs outputs #:allow-other-keys)
112 (substitute* '("share/functions/math.fish"
113 "share/functions/seq.fish")
114 (("\\| bc")
115 (string-append "| " (assoc-ref %build-inputs "bc")
116 "/bin/bc"))))))))
618977ae
TGR
117 (synopsis "The friendly interactive shell")
118 (description
119 "Fish (friendly interactive shell) is a shell focused on interactive use,
120discoverability, and friendliness. Fish has very user-friendly and powerful
121tab-completion, including descriptions of every completion, completion of
122strings with wildcards, and many completions for specific commands. It also
123has extensive and discoverable help. A special help command gives access to
124all the fish documentation in your web browser. Other features include smart
125terminal handling based on terminfo, an easy to search history, and syntax
126highlighting.")
127 (home-page "https://fishshell.com/")
128 (license gpl2)))
9a57d3e6
TGR
129
130(define-public rc
131 (package
132 (name "rc")
133 (version "1.7.4")
134 (source (origin
135 (method git-fetch)
136 (uri (git-reference
137 (url "git://github.com/rakitzis/rc.git")
138 ;; commit name 'release: rc-1.7.4'
139 (commit "c884da53a7c885d46ace2b92de78946855b18e92")))
140 (sha256
141 (base32
142 "00mgzvrrh9w96xa85g4gjbsvq02f08k4jwjcdnxq7kyh5xgiw95l"))
143 (file-name (string-append name "-" version "-checkout"))))
144 (build-system gnu-build-system)
145 (arguments
146 `(#:configure-flags
147 '("--with-edit=gnu")
148 #:phases
149 (modify-phases %standard-phases
150 (add-after
151 'unpack 'autoreconf
152 (lambda _ (zero? (system* "autoreconf" "-vfi"))))
153 (add-before
154 'autoreconf 'patch-trip.rc
155 (lambda _
156 (substitute* "trip.rc"
157 (("/bin/pwd") (which "pwd"))
158 (("/bin/sh") (which "sh"))
159 (("/bin/rm") (which "rm"))
160 (("/bin\\)") (string-append (dirname (which "rm")) ")")))
161 #t)))))
162 (inputs `(("readline" ,readline)
163 ("perl" ,perl)))
164 (native-inputs `(("autoconf" ,autoconf)
165 ("automake" ,automake)
166 ("libtool" ,libtool)
167 ("pkg-config" ,pkg-config)))
168 (synopsis "Alternative implementation of the rc shell by Byron Rakitzis")
169 (description
170 "This is a reimplementation by Byron Rakitzis of the Plan 9 shell. It
171has a small feature set similar to a traditional Bourne shell.")
172 (home-page "http://github.com/rakitzis/rc")
173 (license zlib)))
d754347c
TGR
174
175(define-public tcsh
176 (package
177 (name "tcsh")
57513498 178 (replacement tcsh/fixed)
d754347c
TGR
179 (version "6.18.01")
180 (source (origin
181 (method url-fetch)
182 ;; Old tarballs are moved to old/.
183 (uri (list (string-append "ftp://ftp.astron.com/pub/tcsh/"
184 "tcsh-" version ".tar.gz")
185 (string-append "ftp://ftp.astron.com/pub/tcsh/"
186 "old/tcsh-" version ".tar.gz")))
187 (sha256
188 (base32
189 "1a4z9kwgx1iqqzvv64si34m60gj34p7lp6rrcrb59s7ka5wa476q"))
6f83d224
RW
190 (patches (search-patches "tcsh-fix-autotest.patch"
191 "tcsh-do-not-define-BSDWAIT.patch"))
d754347c
TGR
192 (patch-flags '("-p0"))))
193 (build-system gnu-build-system)
194 (inputs
195 `(("autoconf" ,autoconf)
196 ("coreutils" ,coreutils)
197 ("ncurses" ,ncurses)))
198 (arguments
199 `(#:phases
200 (alist-cons-before
201 'check 'patch-test-scripts
202 (lambda _
203 ;; Take care of pwd
204 (substitute* '("tests/commands.at" "tests/variables.at")
205 (("/bin/pwd") (which "pwd")))
206 ;; The .at files create shell scripts without shebangs. Erk.
207 (substitute* "tests/commands.at"
208 (("./output.sh") "/bin/sh output.sh"))
209 (substitute* "tests/syntax.at"
210 (("; other_script.csh") "; /bin/sh other_script.csh"))
211 ;; Now, let's generate the test suite and patch it
212 (system* "make" "tests/testsuite")
213
214 ;; This file is ISO-8859-1 encoded.
215 (with-fluids ((%default-port-encoding #f))
216 (substitute* "tests/testsuite"
217 (("/bin/sh") (which "sh")))))
218 (alist-cons-after
219 'install 'post-install
220 (lambda* (#:key inputs outputs #:allow-other-keys)
221 (let* ((out (assoc-ref %outputs "out"))
222 (bin (string-append out "/bin")))
223 (with-directory-excursion bin
224 (symlink "tcsh" "csh"))))
225 %standard-phases))))
226 (home-page "http://www.tcsh.org/")
227 (synopsis "Unix shell based on csh")
228 (description
229 "Tcsh is an enhanced, but completely compatible version of the Berkeley
230UNIX C shell (csh). It is a command language interpreter usable both as an
231interactive login shell and a shell script command processor. It includes a
232command-line editor, programmable word completion, spelling correction, a
233history mechanism, job control and a C-like syntax.")
234 (license bsd-4)))
7ccb874a 235
57513498
LF
236(define tcsh/fixed
237 (package
238 (inherit tcsh)
239 (name "tcsh")
240 (source (origin
241 (inherit (package-source tcsh))
242 (patches (cons (search-patch "tcsh-fix-out-of-bounds-read.patch")
243 (origin-patches (package-source tcsh))))))))
244
7ccb874a
TGR
245(define-public zsh
246 (package
247 (name "zsh")
248 (version "5.2")
249 (source (origin
250 (method url-fetch)
251 (uri (list (string-append
252 "http://www.zsh.org/pub/zsh-" version
253 ".tar.gz")
254 (string-append
255 "http://www.zsh.org/pub/old/zsh-" version
256 ".tar.gz")))
257 (sha256
258 (base32
259 "0dsr450v8nydvpk8ry276fvbznlrjgddgp7zvhcw4cv69i9lr4ps"))))
260 (build-system gnu-build-system)
261 (arguments `(#:configure-flags '("--with-tcsetpgrp" "--enable-pcre")
ddee9a6e
TGR
262 #:phases
263 (modify-phases %standard-phases
264 (add-before 'configure 'fix-sh
265 (lambda _
266 ;; Some of the files are ISO-8859-1 encoded.
267 (with-fluids ((%default-port-encoding #f))
268 (substitute*
269 '("configure"
270 "configure.ac"
271 "Src/exec.c"
272 "Src/mkmakemod.sh"
273 "Config/installfns.sh"
274 "Config/defs.mk.in"
275 "Test/E01options.ztst"
276 "Test/A05execution.ztst"
277 "Test/A01grammar.ztst"
278 "Test/A06assign.ztst"
279 "Test/B02typeset.ztst"
280 "Completion/Unix/Command/_init_d"
281 "Util/preconfig")
282 (("/bin/sh") (which "sh")))))))))
7ccb874a
TGR
283 (native-inputs `(("autoconf" ,autoconf)))
284 (inputs `(("ncurses" ,ncurses)
285 ("pcre" ,pcre)
286 ("perl" ,perl)))
287 (synopsis "Powerful shell for interactive use and scripting")
288 (description "The Z shell (zsh) is a Unix shell that can be used
289as an interactive login shell and as a powerful command interpreter
290for shell scripting. Zsh can be thought of as an extended Bourne shell
291with a large number of improvements, including some features of bash,
292ksh, and tcsh.")
293 (home-page "http://www.zsh.org/")
294
295 ;; The whole thing is under an MIT/X11-style license, but there's one
296 ;; command, 'Completion/Unix/Command/_darcs', which is under GPLv2+.
297 (license gpl2+)))
1d515855
SR
298
299(define-public xonsh
300 (package
301 (name "xonsh")
9a443cf9 302 (version "0.5.2")
1d515855
SR
303 (source
304 (origin
305 (method url-fetch)
306 (uri (pypi-uri "xonsh" version))
307 (sha256
308 (base32
9a443cf9 309 "13ndyq9cal2j93qqbjyp2jn3cshiavdxsaj2qjzm6mas0gzywmf0"))
cfb7e269
DM
310 (modules '((guix build utils)))
311 (snippet
312 `(begin
313 ;; Delete bundled ply.
314 (delete-file-recursively "xonsh/ply")
315 (substitute* '("setup.py")
572ee05c 316 (("'xonsh\\.ply\\.ply',") ""))
cfb7e269 317 #t))))
1d515855 318 (build-system python-build-system)
792e6079
LF
319 (arguments
320 '(;; TODO Try running run the test suite.
321 ;; See 'requirements-tests.txt' in the source distribution for more
322 ;; information.
323 #:tests? #f))
cfb7e269
DM
324 (inputs
325 `(("python-ply" ,python-ply)))
1d515855
SR
326 (home-page "http://xon.sh/")
327 (synopsis "Python-ish shell")
328 (description
329 "Xonsh is a Python-ish, BASHwards-looking shell language and command
e813f395
KK
330prompt. The language is a superset of Python 3.4+ with additional shell
331primitives that you are used to from Bash and IPython. It works on all major
332systems including Linux, Mac OSX, and Windows. Xonsh is meant for the daily
1d515855
SR
333use of experts and novices alike.")
334 (license bsd-2)))