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>
11 ;;; This file is part of GNU Guix.
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26 (define-module (gnu packages shells)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages algebra)
29 #:use-module (gnu packages autotools)
30 #:use-module (gnu packages base)
31 #:use-module (gnu packages bison)
32 #:use-module (gnu packages documentation)
33 #:use-module (gnu packages libedit)
34 #:use-module (gnu packages ncurses)
35 #:use-module (gnu packages pcre)
36 #:use-module (gnu packages perl)
37 #:use-module (gnu packages pkg-config)
38 #:use-module (gnu packages python)
39 #:use-module (gnu packages readline)
40 #:use-module (gnu packages scheme)
41 #:use-module (guix build-system gnu)
42 #:use-module (guix build-system python)
43 #:use-module (guix download)
44 #:use-module (guix git-download)
45 #:use-module (guix licenses)
46 #:use-module (guix packages))
55 (uri (string-append "http://gondor.apana.org.au/~herbert/dash/files/"
56 name "-" version ".tar.gz"))
59 "17328wd9n5krr5wd37smrk0y7fdf8aa3hmhm02br5mqpq0a3nycj"))
60 (modules '((guix build utils)))
63 ;; The man page hails from BSD, where (d)ash is the default shell.
64 ;; This isn't the case on Guix or indeed most other GNU systems.
65 (substitute* "src/dash.1"
66 (("the standard command interpreter for the system")
67 "a command interpreter based on the original Bourne shell"))
69 (build-system gnu-build-system)
71 `(("libedit" ,libedit)))
73 `(#:configure-flags '("--with-libedit")))
74 (home-page "http://gondor.apana.org.au/~herbert/dash")
75 (synopsis "POSIX-compliant shell optimised for size")
77 "dash is a POSIX-compliant @command{/bin/sh} implementation that aims to be
78 as small as possible, often without sacrificing speed. It is faster than the
79 GNU Bourne-Again Shell (@command{bash}) at most scripted tasks. dash is a
80 direct descendant of NetBSD's Almquist Shell (@command{ash}).")
82 gpl2+)))) ; mksignames.c
90 (uri (string-append "https://fishshell.com/files/"
91 version "/fish-" version ".tar.gz"))
94 "19djav128nkhjxgfhwhc32i5y9d9c3karbh5yg67kqrdranyvh7q"))
95 (modules '((guix build utils)))
96 ;; Don't try to install /etc/fish/config.fish.
98 '(substitute* "Makefile.in"
99 ((".*INSTALL.*sysconfdir.*fish.*") "")))))
100 (build-system gnu-build-system)
102 `(("doxygen" ,doxygen)))
106 ("pcre2" ,pcre2) ;don't use the bundled PCRE2
107 ("python" ,python-wrapper))) ;for fish_config and manpage completions
109 '(#:tests? #f ; no check target
110 #:configure-flags '("--sysconfdir=/etc")
112 (modify-phases %standard-phases
113 ;; Embed absolute paths to store items.
114 (add-after 'unpack 'embed-store-paths
115 (lambda* (#:key inputs outputs #:allow-other-keys)
116 (substitute* '("share/functions/math.fish"
117 "share/functions/seq.fish")
119 (string-append "| " (assoc-ref %build-inputs "bc")
121 (substitute* "share/functions/fish_update_completions.fish"
122 (("python") (which "python")))
124 (synopsis "The friendly interactive shell")
126 "Fish (friendly interactive shell) is a shell focused on interactive use,
127 discoverability, and friendliness. Fish has very user-friendly and powerful
128 tab-completion, including descriptions of every completion, completion of
129 strings with wildcards, and many completions for specific commands. It also
130 has extensive and discoverable help. A special help command gives access to
131 all the fish documentation in your web browser. Other features include smart
132 terminal handling based on terminfo, an easy to search history, and syntax
134 (home-page "https://fishshell.com/")
144 (url "git://github.com/rakitzis/rc.git")
145 ;; commit name 'release: rc-1.7.4'
146 (commit "c884da53a7c885d46ace2b92de78946855b18e92")))
149 "00mgzvrrh9w96xa85g4gjbsvq02f08k4jwjcdnxq7kyh5xgiw95l"))
150 (file-name (string-append name "-" version "-checkout"))))
151 (build-system gnu-build-system)
156 (modify-phases %standard-phases
159 (lambda _ (zero? (system* "autoreconf" "-vfi"))))
161 'autoreconf 'patch-trip.rc
163 (substitute* "trip.rc"
164 (("/bin/pwd") (which "pwd"))
165 (("/bin/sh") (which "sh"))
166 (("/bin/rm") (which "rm"))
167 (("/bin\\)") (string-append (dirname (which "rm")) ")")))
169 (inputs `(("readline" ,readline)
171 (native-inputs `(("autoconf" ,autoconf)
172 ("automake" ,automake)
174 ("pkg-config" ,pkg-config)))
175 (synopsis "Alternative implementation of the rc shell by Byron Rakitzis")
177 "This is a reimplementation by Byron Rakitzis of the Plan 9 shell. It
178 has a small feature set similar to a traditional Bourne shell.")
179 (home-page "http://github.com/rakitzis/rc")
189 (uri (string-append "https://github.com/wryun/es-shell/releases/"
190 "download/v" version "/es-" version ".tar.gz"))
193 "1fplzxc6lncz2lv2fyr2ig23rgg5j96rm2bbl1rs28mik771zd5h"))
194 (file-name (string-append name "-" version ".tar.gz"))))
195 (build-system gnu-build-system)
197 `(#:test-target "test"
199 (modify-phases %standard-phases
200 (add-before 'configure 're-enter-rootdir
201 ;; The tarball has no folder.
205 `(("readline" ,readline)))
208 (synopsis "Extensible shell with higher-order functions")
210 "Es is an extensible shell. The language was derived from the Plan 9
211 shell, rc, and was influenced by functional programming languages, such as
212 Scheme, and the Tcl embeddable programming language. This implementation is
213 derived from Byron Rakitzis's public domain implementation of rc, and was
214 written by Paul Haahr and Byron Rakitzis.")
215 (home-page "https://wryun.github.io/es-shell/")
216 (license public-domain)))
221 (replacement tcsh/fixed)
225 ;; Old tarballs are moved to old/.
226 (uri (list (string-append "ftp://ftp.astron.com/pub/tcsh/"
227 "tcsh-" version ".tar.gz")
228 (string-append "ftp://ftp.astron.com/pub/tcsh/"
229 "old/tcsh-" version ".tar.gz")))
232 "1a4z9kwgx1iqqzvv64si34m60gj34p7lp6rrcrb59s7ka5wa476q"))
233 (patches (search-patches "tcsh-fix-autotest.patch"
234 "tcsh-do-not-define-BSDWAIT.patch"))
235 (patch-flags '("-p0"))))
236 (build-system gnu-build-system)
238 `(("autoconf" ,autoconf)
239 ("coreutils" ,coreutils)
240 ("ncurses" ,ncurses)))
244 'check 'patch-test-scripts
247 (substitute* '("tests/commands.at" "tests/variables.at")
248 (("/bin/pwd") (which "pwd")))
249 ;; The .at files create shell scripts without shebangs. Erk.
250 (substitute* "tests/commands.at"
251 (("./output.sh") "/bin/sh output.sh"))
252 (substitute* "tests/syntax.at"
253 (("; other_script.csh") "; /bin/sh other_script.csh"))
254 ;; Now, let's generate the test suite and patch it
255 (system* "make" "tests/testsuite")
257 ;; This file is ISO-8859-1 encoded.
258 (with-fluids ((%default-port-encoding #f))
259 (substitute* "tests/testsuite"
260 (("/bin/sh") (which "sh")))))
262 'install 'post-install
263 (lambda* (#:key inputs outputs #:allow-other-keys)
264 (let* ((out (assoc-ref %outputs "out"))
265 (bin (string-append out "/bin")))
266 (with-directory-excursion bin
267 (symlink "tcsh" "csh"))))
269 (home-page "http://www.tcsh.org/")
270 (synopsis "Unix shell based on csh")
272 "Tcsh is an enhanced, but completely compatible version of the Berkeley
273 UNIX C shell (csh). It is a command language interpreter usable both as an
274 interactive login shell and a shell script command processor. It includes a
275 command-line editor, programmable word completion, spelling correction, a
276 history mechanism, job control and a C-like syntax.")
284 (inherit (package-source tcsh))
285 (patches (cons (search-patch "tcsh-fix-out-of-bounds-read.patch")
286 (origin-patches (package-source tcsh))))))))
294 (uri (list (string-append
295 "http://www.zsh.org/pub/zsh-" version
298 "http://www.zsh.org/pub/old/zsh-" version
302 "0dsr450v8nydvpk8ry276fvbznlrjgddgp7zvhcw4cv69i9lr4ps"))))
303 (build-system gnu-build-system)
304 (arguments `(#:configure-flags '("--with-tcsetpgrp" "--enable-pcre")
306 (modify-phases %standard-phases
307 (add-before 'configure 'fix-sh
309 ;; Some of the files are ISO-8859-1 encoded.
310 (with-fluids ((%default-port-encoding #f))
316 "Config/installfns.sh"
318 "Test/E01options.ztst"
319 "Test/A05execution.ztst"
320 "Test/A01grammar.ztst"
321 "Test/A06assign.ztst"
322 "Test/B02typeset.ztst"
323 "Completion/Unix/Command/_init_d"
325 (("/bin/sh") (which "sh")))))))))
326 (native-inputs `(("autoconf" ,autoconf)))
327 (inputs `(("ncurses" ,ncurses)
330 (synopsis "Powerful shell for interactive use and scripting")
331 (description "The Z shell (zsh) is a Unix shell that can be used
332 as an interactive login shell and as a powerful command interpreter
333 for shell scripting. Zsh can be thought of as an extended Bourne shell
334 with a large number of improvements, including some features of bash,
336 (home-page "http://www.zsh.org/")
338 ;; The whole thing is under an MIT/X11-style license, but there's one
339 ;; command, 'Completion/Unix/Command/_darcs', which is under GPLv2+.
349 (uri (pypi-uri "xonsh" version))
352 "1wa5g1gxk4aw8jazp3fqmr7mlkdmnva83x28i9xd3s99lv0qb3dd"))
353 (modules '((guix build utils)))
356 ;; Delete bundled ply.
357 (delete-file-recursively "xonsh/ply")
358 (substitute* '("setup.py")
359 (("'xonsh\\.ply\\.ply',") ""))
361 (build-system python-build-system)
363 '(;; TODO Try running run the test suite.
364 ;; See 'requirements-tests.txt' in the source distribution for more
368 `(("python-ply" ,python-ply)))
369 (home-page "http://xon.sh/")
370 (synopsis "Python-ish shell")
372 "Xonsh is a Python-ish, BASHwards-looking shell language and command
373 prompt. The language is a superset of Python 3.4+ with additional shell
374 primitives that you are used to from Bash and IPython. It works on all major
375 systems including Linux, Mac OSX, and Windows. Xonsh is meant for the daily
376 use of experts and novices alike.")
380 (let ((commit "114432435e4eadd54334df6b37fcae505079b49f")
384 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
389 (url "https://github.com/scheme/scsh")
391 (file-name (string-append name "-" version "-checkout"))
394 "1ghk08akiz7hff1pndi8rmgamgcrn2mv9asbss9l79d3c2iaav3q"))))
395 (build-system gnu-build-system)
397 `(#:test-target "test"
399 (modify-phases %standard-phases
400 (add-before 'configure 'replace-rx
401 (lambda* (#:key inputs #:allow-other-keys)
402 (let* ((rx (assoc-ref inputs "scheme48-rx"))
403 (rxpath (string-append rx "/share/scheme48-"
404 ,(package-version scheme48)
406 (delete-file-recursively "rx")
407 (symlink rxpath "rx"))
409 (add-before 'configure 'autoreconf
411 (zero? (system* "autoreconf")))))))
413 `(("scheme48" ,scheme48)
414 ("scheme48-rx" ,scheme48-rx)))
416 `(("autoconf" ,autoconf)
417 ("automake" ,automake)))
418 (home-page "https://github.com/scheme/scsh")
419 (synopsis "Unix shell embedded in Scheme")
421 "Scsh is a Unix shell embedded in Scheme. Scsh has two main
422 components: a process notation for running programs and setting up pipelines
423 and redirections, and a complete syscall library for low-level access to the