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>
8 ;;; This file is part of GNU Guix.
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.
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.
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/>.
23 (define-module (gnu packages shells)
24 #:use-module (gnu packages)
25 #:use-module (gnu packages algebra)
26 #:use-module (gnu packages autotools)
27 #:use-module (gnu packages base)
28 #:use-module (gnu packages documentation)
29 #:use-module (gnu packages libedit)
30 #:use-module (gnu packages ncurses)
31 #:use-module (gnu packages pcre)
32 #:use-module (gnu packages perl)
33 #:use-module (gnu packages pkg-config)
34 #:use-module (gnu packages python)
35 #:use-module (gnu packages readline)
36 #:use-module (guix build-system gnu)
37 #:use-module (guix build-system python)
38 #:use-module (guix download)
39 #:use-module (guix git-download)
40 #:use-module (guix licenses)
41 #:use-module (guix packages))
50 (uri (string-append "http://gondor.apana.org.au/~herbert/dash/files/"
51 name "-" version ".tar.gz"))
54 "17328wd9n5krr5wd37smrk0y7fdf8aa3hmhm02br5mqpq0a3nycj"))
55 (modules '((guix build utils)))
58 ;; The man page hails from BSD, where (d)ash is the default shell.
59 ;; This isn't the case on Guix or indeed most other GNU systems.
60 (substitute* "src/dash.1"
61 (("the standard command interpreter for the system")
62 "a command interpreter based on the original Bourne shell"))
64 (build-system gnu-build-system)
66 `(("libedit" ,libedit)))
68 `(#:configure-flags '("--with-libedit")))
69 (home-page "http://gondor.apana.org.au/~herbert/dash")
70 (synopsis "POSIX-compliant shell optimised for size")
72 "dash is a POSIX-compliant @command{/bin/sh} implementation that aims to be
73 as small as possible, often without sacrificing speed. It is faster than the
74 GNU Bourne-Again Shell (@command{bash}) at most scripted tasks. dash is a
75 direct descendant of NetBSD's Almquist Shell (@command{ash}).")
77 gpl2+)))) ; mksignames.c
85 (uri (string-append "https://fishshell.com/files/"
86 version "/fish-" version ".tar.gz"))
89 "0r46p64lg6da3v6chsa4gisvl04kd3rpy60yih8r870kbp9wm2ij"))
90 (modules '((guix build utils)))
91 ;; Don't try to install /etc/fish/config.fish.
93 '(substitute* "Makefile.in"
94 ((".*INSTALL.*sysconfdir.*fish.*") "")))))
95 (build-system gnu-build-system)
97 `(("doxygen" ,doxygen)))
101 ("pcre2" ,pcre2) ;don't use the bundled PCRE2
102 ("python" ,python-wrapper))) ;for fish_config and manpage completions
104 '(#:tests? #f ; no check target
105 #:configure-flags '("--sysconfdir=/etc")
107 (modify-phases %standard-phases
108 ;; Replace 'bc' by its absolute file name in the store.
109 (add-after 'unpack 'patch-bc
110 (lambda* (#:key inputs outputs #:allow-other-keys)
111 (substitute* '("share/functions/math.fish"
112 "share/functions/seq.fish")
114 (string-append "| " (assoc-ref %build-inputs "bc")
116 (synopsis "The friendly interactive shell")
118 "Fish (friendly interactive shell) is a shell focused on interactive use,
119 discoverability, and friendliness. Fish has very user-friendly and powerful
120 tab-completion, including descriptions of every completion, completion of
121 strings with wildcards, and many completions for specific commands. It also
122 has extensive and discoverable help. A special help command gives access to
123 all the fish documentation in your web browser. Other features include smart
124 terminal handling based on terminfo, an easy to search history, and syntax
126 (home-page "https://fishshell.com/")
136 (url "git://github.com/rakitzis/rc.git")
137 ;; commit name 'release: rc-1.7.4'
138 (commit "c884da53a7c885d46ace2b92de78946855b18e92")))
141 "00mgzvrrh9w96xa85g4gjbsvq02f08k4jwjcdnxq7kyh5xgiw95l"))
142 (file-name (string-append name "-" version "-checkout"))))
143 (build-system gnu-build-system)
148 (modify-phases %standard-phases
151 (lambda _ (zero? (system* "autoreconf" "-vfi"))))
153 'autoreconf 'patch-trip.rc
155 (substitute* "trip.rc"
156 (("/bin/pwd") (which "pwd"))
157 (("/bin/sh") (which "sh"))
158 (("/bin/rm") (which "rm"))
159 (("/bin\\)") (string-append (dirname (which "rm")) ")")))
161 (inputs `(("readline" ,readline)
163 (native-inputs `(("autoconf" ,autoconf)
164 ("automake" ,automake)
166 ("pkg-config" ,pkg-config)))
167 (synopsis "Alternative implementation of the rc shell by Byron Rakitzis")
169 "This is a reimplementation by Byron Rakitzis of the Plan 9 shell. It
170 has a small feature set similar to a traditional Bourne shell.")
171 (home-page "http://github.com/rakitzis/rc")
180 ;; Old tarballs are moved to old/.
181 (uri (list (string-append "ftp://ftp.astron.com/pub/tcsh/"
182 "tcsh-" version ".tar.gz")
183 (string-append "ftp://ftp.astron.com/pub/tcsh/"
184 "old/tcsh-" version ".tar.gz")))
187 "1a4z9kwgx1iqqzvv64si34m60gj34p7lp6rrcrb59s7ka5wa476q"))
188 (patches (search-patches "tcsh-fix-autotest.patch"))
189 (patch-flags '("-p0"))))
190 (build-system gnu-build-system)
192 `(("autoconf" ,autoconf)
193 ("coreutils" ,coreutils)
194 ("ncurses" ,ncurses)))
198 'check 'patch-test-scripts
201 (substitute* '("tests/commands.at" "tests/variables.at")
202 (("/bin/pwd") (which "pwd")))
203 ;; The .at files create shell scripts without shebangs. Erk.
204 (substitute* "tests/commands.at"
205 (("./output.sh") "/bin/sh output.sh"))
206 (substitute* "tests/syntax.at"
207 (("; other_script.csh") "; /bin/sh other_script.csh"))
208 ;; Now, let's generate the test suite and patch it
209 (system* "make" "tests/testsuite")
211 ;; This file is ISO-8859-1 encoded.
212 (with-fluids ((%default-port-encoding #f))
213 (substitute* "tests/testsuite"
214 (("/bin/sh") (which "sh")))))
216 'install 'post-install
217 (lambda* (#:key inputs outputs #:allow-other-keys)
218 (let* ((out (assoc-ref %outputs "out"))
219 (bin (string-append out "/bin")))
220 (with-directory-excursion bin
221 (symlink "tcsh" "csh"))))
223 (home-page "http://www.tcsh.org/")
224 (synopsis "Unix shell based on csh")
226 "Tcsh is an enhanced, but completely compatible version of the Berkeley
227 UNIX C shell (csh). It is a command language interpreter usable both as an
228 interactive login shell and a shell script command processor. It includes a
229 command-line editor, programmable word completion, spelling correction, a
230 history mechanism, job control and a C-like syntax.")
239 (uri (list (string-append
240 "http://www.zsh.org/pub/zsh-" version
243 "http://www.zsh.org/pub/old/zsh-" version
247 "0dsr450v8nydvpk8ry276fvbznlrjgddgp7zvhcw4cv69i9lr4ps"))))
248 (build-system gnu-build-system)
249 (arguments `(#:configure-flags '("--with-tcsetpgrp" "--enable-pcre")
251 (modify-phases %standard-phases
252 (add-before 'configure 'fix-sh
254 ;; Some of the files are ISO-8859-1 encoded.
255 (with-fluids ((%default-port-encoding #f))
261 "Config/installfns.sh"
263 "Test/E01options.ztst"
264 "Test/A05execution.ztst"
265 "Test/A01grammar.ztst"
266 "Test/A06assign.ztst"
267 "Test/B02typeset.ztst"
268 "Completion/Unix/Command/_init_d"
270 (("/bin/sh") (which "sh")))))))))
271 (native-inputs `(("autoconf" ,autoconf)))
272 (inputs `(("ncurses" ,ncurses)
275 (synopsis "Powerful shell for interactive use and scripting")
276 (description "The Z shell (zsh) is a Unix shell that can be used
277 as an interactive login shell and as a powerful command interpreter
278 for shell scripting. Zsh can be thought of as an extended Bourne shell
279 with a large number of improvements, including some features of bash,
281 (home-page "http://www.zsh.org/")
283 ;; The whole thing is under an MIT/X11-style license, but there's one
284 ;; command, 'Completion/Unix/Command/_darcs', which is under GPLv2+.
294 (uri (pypi-uri "xonsh" version))
297 "0byxd9kjl99q2pyvjh9jy18l0di1i35wr0qqgnw4i6jh6ig3zcki"))
298 (modules '((guix build utils)))
301 ;; Delete bundled ply.
302 (delete-file-recursively "xonsh/ply")
303 (substitute* '("setup.py")
304 (("'xonsh\\.ply',") ""))
306 (build-system python-build-system)
308 `(("python-ply" ,python-ply)))
309 (home-page "http://xon.sh/")
310 (synopsis "Python-ish shell")
312 "Xonsh is a Python-ish, BASHwards-looking shell language and command
313 prompt. The language is a superset of Python 3.4+ with additional shell
314 primitives that you are used to from Bash and IPython. It works on all major
315 systems including Linux, Mac OSX, and Windows. Xonsh is meant for the daily
316 use of experts and novices alike.")