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