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 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))
48 (uri (string-append "http://gondor.apana.org.au/~herbert/dash/files/"
49 name "-" version ".tar.gz"))
52 "17328wd9n5krr5wd37smrk0y7fdf8aa3hmhm02br5mqpq0a3nycj"))
53 (modules '((guix build utils)))
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"))
62 (build-system gnu-build-system)
64 `(("libedit" ,libedit)))
66 `(#:configure-flags '("--with-libedit")))
67 (home-page "http://gondor.apana.org.au/~herbert/dash")
68 (synopsis "POSIX-compliant shell optimised for size")
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}).")
75 gpl2+)))) ; mksignames.c
83 (uri (string-append "https://fishshell.com/files/"
84 version "/fish-" version ".tar.gz"))
87 "0r46p64lg6da3v6chsa4gisvl04kd3rpy60yih8r870kbp9wm2ij"))
88 (modules '((guix build utils)))
89 ;; Don't try to install /etc/fish/config.fish.
91 '(substitute* "Makefile.in"
92 ((".*INSTALL.*sysconfdir.*fish.*") "")))))
93 (build-system gnu-build-system)
95 `(("doxygen" ,doxygen)))
97 `(("ncurses" ,ncurses)
98 ("python" ,python-wrapper))) ;for fish_config and manpage completions
100 '(#:tests? #f ; no check target
101 #:configure-flags '("--sysconfdir=/etc")))
102 (synopsis "The friendly interactive shell")
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
112 (home-page "https://fishshell.com/")
122 (url "git://github.com/rakitzis/rc.git")
123 ;; commit name 'release: rc-1.7.4'
124 (commit "c884da53a7c885d46ace2b92de78946855b18e92")))
127 "00mgzvrrh9w96xa85g4gjbsvq02f08k4jwjcdnxq7kyh5xgiw95l"))
128 (file-name (string-append name "-" version "-checkout"))))
129 (build-system gnu-build-system)
134 (modify-phases %standard-phases
137 (lambda _ (zero? (system* "autoreconf" "-vfi"))))
139 'autoreconf 'patch-trip.rc
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")) ")")))
147 (inputs `(("readline" ,readline)
149 (native-inputs `(("autoconf" ,autoconf)
150 ("automake" ,automake)
152 ("pkg-config" ,pkg-config)))
153 (synopsis "Alternative implementation of the rc shell by Byron Rakitzis")
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")
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")))
173 "1a4z9kwgx1iqqzvv64si34m60gj34p7lp6rrcrb59s7ka5wa476q"))
174 (patches (search-patches "tcsh-fix-autotest.patch"))
175 (patch-flags '("-p0"))))
176 (build-system gnu-build-system)
178 `(("autoconf" ,autoconf)
179 ("coreutils" ,coreutils)
180 ("ncurses" ,ncurses)))
184 'check 'patch-test-scripts
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")
197 ;; This file is ISO-8859-1 encoded.
198 (with-fluids ((%default-port-encoding #f))
199 (substitute* "tests/testsuite"
200 (("/bin/sh") (which "sh")))))
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"))))
209 (home-page "http://www.tcsh.org/")
210 (synopsis "Unix shell based on csh")
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.")
225 (uri (list (string-append
226 "http://www.zsh.org/pub/zsh-" version
229 "http://www.zsh.org/pub/old/zsh-" version
233 "0dsr450v8nydvpk8ry276fvbznlrjgddgp7zvhcw4cv69i9lr4ps"))))
234 (build-system gnu-build-system)
235 (arguments `(#:configure-flags '("--with-tcsetpgrp" "--enable-pcre")
237 (modify-phases %standard-phases
238 (add-before 'configure 'fix-sh
240 ;; Some of the files are ISO-8859-1 encoded.
241 (with-fluids ((%default-port-encoding #f))
247 "Config/installfns.sh"
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"
256 (("/bin/sh") (which "sh")))))))))
257 (native-inputs `(("autoconf" ,autoconf)))
258 (inputs `(("ncurses" ,ncurses)
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,
267 (home-page "http://www.zsh.org/")
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+.