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 ;;; Copyright © 2016 Stefan Reichör <stefan@xsteve.at>
8 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
9 ;;; Copyright © 2017 ng0 <contact.ng0@cryptolab.net>
10 ;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
12 ;;; This file is part of GNU Guix.
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27 (define-module (gnu packages shells)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages algebra)
30 #:use-module (gnu packages autotools)
31 #:use-module (gnu packages base)
32 #:use-module (gnu packages bison)
33 #:use-module (gnu packages documentation)
34 #:use-module (gnu packages libedit)
35 #:use-module (gnu packages ncurses)
36 #:use-module (gnu packages pcre)
37 #:use-module (gnu packages perl)
38 #:use-module (gnu packages pkg-config)
39 #:use-module (gnu packages python)
40 #:use-module (gnu packages readline)
41 #:use-module (gnu packages scheme)
42 #:use-module (guix build-system gnu)
43 #:use-module (guix build-system python)
44 #:use-module (guix download)
45 #:use-module (guix git-download)
46 #:use-module (guix licenses)
47 #:use-module (guix packages))
55 ;; The canonical source is offline, so we fetch the source code
56 ;; from the Git repository. See:
57 ;; https://www.mail-archive.com/dash@vger.kernel.org/msg01323.html
60 (url "https://git.kernel.org/pub/scm/utils/dash/dash.git/")
61 (commit (string-append "v" version))))
62 (file-name (string-append name "-" version "-checkout"))
65 "0p01vx7rbyf5hyyaff7h8cbhq81bm5fmq1m933484lncl9rafcai"))
66 (modules '((guix build utils)))
69 ;; The man page hails from BSD, where (d)ash is the default shell.
70 ;; This isn't the case on Guix or indeed most other GNU systems.
71 (substitute* "src/dash.1"
72 (("the standard command interpreter for the system")
73 "a command interpreter based on the original Bourne shell"))
75 (build-system gnu-build-system)
77 `(("autoconf" ,autoconf)
78 ("automake" ,automake)))
80 `(("libedit" ,libedit)))
83 (modify-phases %standard-phases
84 (add-before 'configure 'bootstrap
85 (lambda _ (zero? (system* "autoreconf" "-vfi")))))
86 #:configure-flags '("--with-libedit")))
87 (home-page "http://gondor.apana.org.au/~herbert/dash")
88 (synopsis "POSIX-compliant shell optimised for size")
90 "dash is a POSIX-compliant @command{/bin/sh} implementation that aims to be
91 as small as possible, often without sacrificing speed. It is faster than the
92 GNU Bourne-Again Shell (@command{bash}) at most scripted tasks. dash is a
93 direct descendant of NetBSD's Almquist Shell (@command{ash}).")
95 gpl2+)))) ; mksignames.c
103 (uri (string-append "https://fishshell.com/files/"
104 version "/fish-" version ".tar.gz"))
107 "19djav128nkhjxgfhwhc32i5y9d9c3karbh5yg67kqrdranyvh7q"))
108 (modules '((guix build utils)))
109 ;; Don't try to install /etc/fish/config.fish.
111 '(substitute* "Makefile.in"
112 ((".*INSTALL.*sysconfdir.*fish.*") "")))))
113 (build-system gnu-build-system)
115 `(("doxygen" ,doxygen)))
119 ("pcre2" ,pcre2) ;don't use the bundled PCRE2
120 ("python" ,python-wrapper))) ;for fish_config and manpage completions
122 '(#:tests? #f ; no check target
123 #:configure-flags '("--sysconfdir=/etc")
125 (modify-phases %standard-phases
126 ;; Embed absolute paths to store items.
127 (add-after 'unpack 'embed-store-paths
128 (lambda* (#:key inputs outputs #:allow-other-keys)
129 (substitute* '("share/functions/math.fish"
130 "share/functions/seq.fish")
132 (string-append "| " (assoc-ref %build-inputs "bc")
134 (substitute* "share/functions/fish_update_completions.fish"
135 (("python") (which "python")))
137 (synopsis "The friendly interactive shell")
139 "Fish (friendly interactive shell) is a shell focused on interactive use,
140 discoverability, and friendliness. Fish has very user-friendly and powerful
141 tab-completion, including descriptions of every completion, completion of
142 strings with wildcards, and many completions for specific commands. It also
143 has extensive and discoverable help. A special help command gives access to
144 all the fish documentation in your web browser. Other features include smart
145 terminal handling based on terminfo, an easy to search history, and syntax
147 (home-page "https://fishshell.com/")
157 (url "git://github.com/rakitzis/rc.git")
158 ;; commit name 'release: rc-1.7.4'
159 (commit "c884da53a7c885d46ace2b92de78946855b18e92")))
162 "00mgzvrrh9w96xa85g4gjbsvq02f08k4jwjcdnxq7kyh5xgiw95l"))
163 (file-name (string-append name "-" version "-checkout"))))
164 (build-system gnu-build-system)
169 (modify-phases %standard-phases
172 (lambda _ (zero? (system* "autoreconf" "-vfi"))))
174 'autoreconf 'patch-trip.rc
176 (substitute* "trip.rc"
177 (("/bin/pwd") (which "pwd"))
178 (("/bin/sh") (which "sh"))
179 (("/bin/rm") (which "rm"))
180 (("/bin\\)") (string-append (dirname (which "rm")) ")")))
182 (inputs `(("readline" ,readline)
184 (native-inputs `(("autoconf" ,autoconf)
185 ("automake" ,automake)
187 ("pkg-config" ,pkg-config)))
188 (synopsis "Alternative implementation of the rc shell by Byron Rakitzis")
190 "This is a reimplementation by Byron Rakitzis of the Plan 9 shell. It
191 has a small feature set similar to a traditional Bourne shell.")
192 (home-page "http://github.com/rakitzis/rc")
202 (uri (string-append "https://github.com/wryun/es-shell/releases/"
203 "download/v" version "/es-" version ".tar.gz"))
206 "1fplzxc6lncz2lv2fyr2ig23rgg5j96rm2bbl1rs28mik771zd5h"))
207 (file-name (string-append name "-" version ".tar.gz"))))
208 (build-system gnu-build-system)
210 `(#:test-target "test"
212 (modify-phases %standard-phases
213 (add-before 'configure 're-enter-rootdir
214 ;; The tarball has no folder.
218 `(("readline" ,readline)))
221 (synopsis "Extensible shell with higher-order functions")
223 "Es is an extensible shell. The language was derived from the Plan 9
224 shell, rc, and was influenced by functional programming languages, such as
225 Scheme, and the Tcl embeddable programming language. This implementation is
226 derived from Byron Rakitzis's public domain implementation of rc, and was
227 written by Paul Haahr and Byron Rakitzis.")
228 (home-page "https://wryun.github.io/es-shell/")
229 (license public-domain)))
237 ;; Old tarballs are moved to old/.
238 (uri (list (string-append "ftp://ftp.astron.com/pub/tcsh/"
239 "tcsh-" version ".tar.gz")
240 (string-append "ftp://ftp.astron.com/pub/tcsh/"
241 "old/tcsh-" version ".tar.gz")))
244 "17ggxkkn5skl0v1x0j6hbv5l0sgnidfzwv16992sqkdm983fg7dq"))
245 (patches (search-patches "tcsh-fix-autotest.patch"
246 "tcsh-fix-out-of-bounds-read.patch"))
247 (patch-flags '("-p0"))))
248 (build-system gnu-build-system)
250 `(("autoconf" ,autoconf)
253 `(("ncurses" ,ncurses)))
256 (modify-phases %standard-phases
257 (add-before 'check 'patch-test-scripts
260 (substitute* '("tests/commands.at" "tests/variables.at")
261 (("/bin/pwd") (which "pwd")))
262 ;; The .at files create shell scripts without shebangs. Erk.
263 (substitute* "tests/commands.at"
264 (("./output.sh") "/bin/sh output.sh"))
265 (substitute* "tests/syntax.at"
266 (("; other_script.csh") "; /bin/sh other_script.csh"))
267 ;; Now, let's generate the test suite and patch it
268 (system* "make" "tests/testsuite")
270 ;; This file is ISO-8859-1 encoded.
271 (with-fluids ((%default-port-encoding #f))
272 (substitute* "tests/testsuite"
273 (("/bin/sh") (which "sh"))))
275 (add-after 'install 'post-install
276 (lambda* (#:key inputs outputs #:allow-other-keys)
277 (let* ((out (assoc-ref %outputs "out"))
278 (bin (string-append out "/bin")))
279 (with-directory-excursion bin
280 (symlink "tcsh" "csh"))
282 (home-page "http://www.tcsh.org/")
283 (synopsis "Unix shell based on csh")
285 "Tcsh is an enhanced, but completely compatible version of the Berkeley
286 UNIX C shell (csh). It is a command language interpreter usable both as an
287 interactive login shell and a shell script command processor. It includes a
288 command-line editor, programmable word completion, spelling correction, a
289 history mechanism, job control and a C-like syntax.")
298 (uri (list (string-append
299 "http://www.zsh.org/pub/zsh-" version
302 "http://www.zsh.org/pub/old/zsh-" version
306 "0dsr450v8nydvpk8ry276fvbznlrjgddgp7zvhcw4cv69i9lr4ps"))))
307 (build-system gnu-build-system)
308 (arguments `(#:configure-flags '("--with-tcsetpgrp" "--enable-pcre")
310 (modify-phases %standard-phases
311 (add-before 'configure 'fix-sh
313 ;; Some of the files are ISO-8859-1 encoded.
314 (with-fluids ((%default-port-encoding #f))
320 "Config/installfns.sh"
322 "Test/E01options.ztst"
323 "Test/A05execution.ztst"
324 "Test/A01grammar.ztst"
325 "Test/A06assign.ztst"
326 "Test/B02typeset.ztst"
327 "Completion/Unix/Command/_init_d"
329 (("/bin/sh") (which "sh")))))))))
330 (native-inputs `(("autoconf" ,autoconf)))
331 (inputs `(("ncurses" ,ncurses)
334 (synopsis "Powerful shell for interactive use and scripting")
335 (description "The Z shell (zsh) is a Unix shell that can be used
336 as an interactive login shell and as a powerful command interpreter
337 for shell scripting. Zsh can be thought of as an extended Bourne shell
338 with a large number of improvements, including some features of bash,
340 (home-page "http://www.zsh.org/")
342 ;; The whole thing is under an MIT/X11-style license, but there's one
343 ;; command, 'Completion/Unix/Command/_darcs', which is under GPLv2+.
353 (uri (pypi-uri "xonsh" version))
356 "1wa5g1gxk4aw8jazp3fqmr7mlkdmnva83x28i9xd3s99lv0qb3dd"))
357 (modules '((guix build utils)))
360 ;; Delete bundled ply.
361 (delete-file-recursively "xonsh/ply")
362 (substitute* '("setup.py")
363 (("'xonsh\\.ply\\.ply',") ""))
365 (build-system python-build-system)
367 '(;; TODO Try running run the test suite.
368 ;; See 'requirements-tests.txt' in the source distribution for more
372 `(("python-ply" ,python-ply)))
373 (home-page "http://xon.sh/")
374 (synopsis "Python-ish shell")
376 "Xonsh is a Python-ish, BASHwards-looking shell language and command
377 prompt. The language is a superset of Python 3.4+ with additional shell
378 primitives that you are used to from Bash and IPython. It works on all major
379 systems including Linux, Mac OSX, and Windows. Xonsh is meant for the daily
380 use of experts and novices alike.")
384 (let ((commit "114432435e4eadd54334df6b37fcae505079b49f")
388 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
393 (url "https://github.com/scheme/scsh")
395 (file-name (string-append name "-" version "-checkout"))
398 "1ghk08akiz7hff1pndi8rmgamgcrn2mv9asbss9l79d3c2iaav3q"))))
399 (build-system gnu-build-system)
401 `(#:test-target "test"
403 (modify-phases %standard-phases
404 (add-before 'configure 'replace-rx
405 (lambda* (#:key inputs #:allow-other-keys)
406 (let* ((rx (assoc-ref inputs "scheme48-rx"))
407 (rxpath (string-append rx "/share/scheme48-"
408 ,(package-version scheme48)
410 (delete-file-recursively "rx")
411 (symlink rxpath "rx"))
413 (add-before 'configure 'autoreconf
415 (zero? (system* "autoreconf")))))))
417 `(("scheme48" ,scheme48)
418 ("scheme48-rx" ,scheme48-rx)))
420 `(("autoconf" ,autoconf)
421 ("automake" ,automake)))
422 (home-page "https://github.com/scheme/scsh")
423 (synopsis "Unix shell embedded in Scheme")
425 "Scsh is a Unix shell embedded in Scheme. Scsh has two main
426 components: a process notation for running programs and setting up pipelines
427 and redirections, and a complete syscall library for low-level access to the