gnu: Add enet.
[jackhill/guix/guix.git] / gnu / packages / shells.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
3 ;;; Copyright © 2014, 2015 David Thompson <davet@gnu.org>
4 ;;; Copyright © 2014 Kevin Lemonnier <lemonnierk@ulrar.net>
5 ;;; Copyright © 2015 Jeff Mickey <j@codemac.net>
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)
24 #:use-module (gnu packages)
25 #:use-module (gnu packages autotools)
26 #:use-module (gnu packages base)
27 #:use-module (gnu packages documentation)
28 #:use-module (gnu packages libedit)
29 #:use-module (gnu packages ncurses)
30 #:use-module (gnu packages pcre)
31 #:use-module (gnu packages perl)
32 #:use-module (gnu packages pkg-config)
33 #:use-module (gnu packages python)
34 #:use-module (gnu packages readline)
35 #:use-module (guix build-system gnu)
36 #:use-module (guix download)
37 #:use-module (guix git-download)
38 #:use-module (guix licenses)
39 #:use-module (guix packages))
40
41 (define-public dash
42 (package
43 (name "dash")
44 (version "0.5.9")
45 (source
46 (origin
47 (method url-fetch)
48 (uri (string-append "http://gondor.apana.org.au/~herbert/dash/files/"
49 name "-" version ".tar.gz"))
50 (sha256
51 (base32
52 "17328wd9n5krr5wd37smrk0y7fdf8aa3hmhm02br5mqpq0a3nycj"))
53 (modules '((guix build utils)))
54 (snippet
55 '(begin
56 ;; The man page hails from BSD, where (d)ash is the default shell.
57 ;; This isn't the case on Guix or indeed most other GNU systems.
58 (substitute* "src/dash.1"
59 (("the standard command interpreter for the system")
60 "a command interpreter based on the original Bourne shell"))
61 #t))))
62 (build-system gnu-build-system)
63 (inputs
64 `(("libedit" ,libedit)))
65 (arguments
66 `(#:configure-flags '("--with-libedit")))
67 (home-page "http://gondor.apana.org.au/~herbert/dash")
68 (synopsis "POSIX-compliant shell optimised for size")
69 (description
70 "dash is a POSIX-compliant @command{/bin/sh} implementation that aims to be
71 as small as possible, often without sacrificing speed. It is faster than the
72 GNU Bourne-Again Shell (@command{bash}) at most scripted tasks. dash is a
73 direct descendant of NetBSD's Almquist Shell (@command{ash}).")
74 (license (list bsd-3
75 gpl2+)))) ; mksignames.c
76
77 (define-public fish
78 (package
79 (name "fish")
80 (version "2.3.1")
81 (source (origin
82 (method url-fetch)
83 (uri (string-append "https://fishshell.com/files/"
84 version "/fish-" version ".tar.gz"))
85 (sha256
86 (base32
87 "0r46p64lg6da3v6chsa4gisvl04kd3rpy60yih8r870kbp9wm2ij"))
88 (modules '((guix build utils)))
89 ;; Don't try to install /etc/fish/config.fish.
90 (snippet
91 '(substitute* "Makefile.in"
92 ((".*INSTALL.*sysconfdir.*fish.*") "")))))
93 (build-system gnu-build-system)
94 (native-inputs
95 `(("doxygen" ,doxygen)))
96 (inputs
97 `(("ncurses" ,ncurses)
98 ("python" ,python-wrapper))) ;for fish_config and manpage completions
99 (arguments
100 '(#:tests? #f ; no check target
101 #:configure-flags '("--sysconfdir=/etc")))
102 (synopsis "The friendly interactive shell")
103 (description
104 "Fish (friendly interactive shell) is a shell focused on interactive use,
105 discoverability, and friendliness. Fish has very user-friendly and powerful
106 tab-completion, including descriptions of every completion, completion of
107 strings with wildcards, and many completions for specific commands. It also
108 has extensive and discoverable help. A special help command gives access to
109 all the fish documentation in your web browser. Other features include smart
110 terminal handling based on terminfo, an easy to search history, and syntax
111 highlighting.")
112 (home-page "https://fishshell.com/")
113 (license gpl2)))
114
115 (define-public rc
116 (package
117 (name "rc")
118 (version "1.7.4")
119 (source (origin
120 (method git-fetch)
121 (uri (git-reference
122 (url "git://github.com/rakitzis/rc.git")
123 ;; commit name 'release: rc-1.7.4'
124 (commit "c884da53a7c885d46ace2b92de78946855b18e92")))
125 (sha256
126 (base32
127 "00mgzvrrh9w96xa85g4gjbsvq02f08k4jwjcdnxq7kyh5xgiw95l"))
128 (file-name (string-append name "-" version "-checkout"))))
129 (build-system gnu-build-system)
130 (arguments
131 `(#:configure-flags
132 '("--with-edit=gnu")
133 #:phases
134 (modify-phases %standard-phases
135 (add-after
136 'unpack 'autoreconf
137 (lambda _ (zero? (system* "autoreconf" "-vfi"))))
138 (add-before
139 'autoreconf 'patch-trip.rc
140 (lambda _
141 (substitute* "trip.rc"
142 (("/bin/pwd") (which "pwd"))
143 (("/bin/sh") (which "sh"))
144 (("/bin/rm") (which "rm"))
145 (("/bin\\)") (string-append (dirname (which "rm")) ")")))
146 #t)))))
147 (inputs `(("readline" ,readline)
148 ("perl" ,perl)))
149 (native-inputs `(("autoconf" ,autoconf)
150 ("automake" ,automake)
151 ("libtool" ,libtool)
152 ("pkg-config" ,pkg-config)))
153 (synopsis "Alternative implementation of the rc shell by Byron Rakitzis")
154 (description
155 "This is a reimplementation by Byron Rakitzis of the Plan 9 shell. It
156 has a small feature set similar to a traditional Bourne shell.")
157 (home-page "http://github.com/rakitzis/rc")
158 (license zlib)))
159
160 (define-public tcsh
161 (package
162 (name "tcsh")
163 (version "6.18.01")
164 (source (origin
165 (method url-fetch)
166 ;; Old tarballs are moved to old/.
167 (uri (list (string-append "ftp://ftp.astron.com/pub/tcsh/"
168 "tcsh-" version ".tar.gz")
169 (string-append "ftp://ftp.astron.com/pub/tcsh/"
170 "old/tcsh-" version ".tar.gz")))
171 (sha256
172 (base32
173 "1a4z9kwgx1iqqzvv64si34m60gj34p7lp6rrcrb59s7ka5wa476q"))
174 (patches (search-patches "tcsh-fix-autotest.patch"))
175 (patch-flags '("-p0"))))
176 (build-system gnu-build-system)
177 (inputs
178 `(("autoconf" ,autoconf)
179 ("coreutils" ,coreutils)
180 ("ncurses" ,ncurses)))
181 (arguments
182 `(#:phases
183 (alist-cons-before
184 'check 'patch-test-scripts
185 (lambda _
186 ;; Take care of pwd
187 (substitute* '("tests/commands.at" "tests/variables.at")
188 (("/bin/pwd") (which "pwd")))
189 ;; The .at files create shell scripts without shebangs. Erk.
190 (substitute* "tests/commands.at"
191 (("./output.sh") "/bin/sh output.sh"))
192 (substitute* "tests/syntax.at"
193 (("; other_script.csh") "; /bin/sh other_script.csh"))
194 ;; Now, let's generate the test suite and patch it
195 (system* "make" "tests/testsuite")
196
197 ;; This file is ISO-8859-1 encoded.
198 (with-fluids ((%default-port-encoding #f))
199 (substitute* "tests/testsuite"
200 (("/bin/sh") (which "sh")))))
201 (alist-cons-after
202 'install 'post-install
203 (lambda* (#:key inputs outputs #:allow-other-keys)
204 (let* ((out (assoc-ref %outputs "out"))
205 (bin (string-append out "/bin")))
206 (with-directory-excursion bin
207 (symlink "tcsh" "csh"))))
208 %standard-phases))))
209 (home-page "http://www.tcsh.org/")
210 (synopsis "Unix shell based on csh")
211 (description
212 "Tcsh is an enhanced, but completely compatible version of the Berkeley
213 UNIX C shell (csh). It is a command language interpreter usable both as an
214 interactive login shell and a shell script command processor. It includes a
215 command-line editor, programmable word completion, spelling correction, a
216 history mechanism, job control and a C-like syntax.")
217 (license bsd-4)))
218
219 (define-public zsh
220 (package
221 (name "zsh")
222 (version "5.2")
223 (source (origin
224 (method url-fetch)
225 (uri (list (string-append
226 "http://www.zsh.org/pub/zsh-" version
227 ".tar.gz")
228 (string-append
229 "http://www.zsh.org/pub/old/zsh-" version
230 ".tar.gz")))
231 (sha256
232 (base32
233 "0dsr450v8nydvpk8ry276fvbznlrjgddgp7zvhcw4cv69i9lr4ps"))))
234 (build-system gnu-build-system)
235 (arguments `(#:configure-flags '("--with-tcsetpgrp" "--enable-pcre")
236 #:phases
237 (modify-phases %standard-phases
238 (add-before 'configure 'fix-sh
239 (lambda _
240 ;; Some of the files are ISO-8859-1 encoded.
241 (with-fluids ((%default-port-encoding #f))
242 (substitute*
243 '("configure"
244 "configure.ac"
245 "Src/exec.c"
246 "Src/mkmakemod.sh"
247 "Config/installfns.sh"
248 "Config/defs.mk.in"
249 "Test/E01options.ztst"
250 "Test/A05execution.ztst"
251 "Test/A01grammar.ztst"
252 "Test/A06assign.ztst"
253 "Test/B02typeset.ztst"
254 "Completion/Unix/Command/_init_d"
255 "Util/preconfig")
256 (("/bin/sh") (which "sh")))))))))
257 (native-inputs `(("autoconf" ,autoconf)))
258 (inputs `(("ncurses" ,ncurses)
259 ("pcre" ,pcre)
260 ("perl" ,perl)))
261 (synopsis "Powerful shell for interactive use and scripting")
262 (description "The Z shell (zsh) is a Unix shell that can be used
263 as an interactive login shell and as a powerful command interpreter
264 for shell scripting. Zsh can be thought of as an extended Bourne shell
265 with a large number of improvements, including some features of bash,
266 ksh, and tcsh.")
267 (home-page "http://www.zsh.org/")
268
269 ;; The whole thing is under an MIT/X11-style license, but there's one
270 ;; command, 'Completion/Unix/Command/_darcs', which is under GPLv2+.
271 (license gpl2+)))