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 <ng0@no-reply.pragmatique.xyz>
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 groff)
35 #:use-module (gnu packages libedit)
36 #:use-module (gnu packages ncurses)
37 #:use-module (gnu packages pcre)
38 #:use-module (gnu packages perl)
39 #:use-module (gnu packages pkg-config)
40 #:use-module (gnu packages python)
41 #:use-module (gnu packages readline)
42 #:use-module (gnu packages scheme)
43 #:use-module (guix build-system gnu)
44 #:use-module (guix build-system python)
45 #:use-module (guix download)
46 #:use-module (guix git-download)
47 #:use-module (guix licenses)
48 #:use-module (guix packages))
56 ;; The canonical source is offline, so we fetch the source code
57 ;; from the Git repository. See:
58 ;; https://www.mail-archive.com/dash@vger.kernel.org/msg01323.html
61 (url "https://git.kernel.org/pub/scm/utils/dash/dash.git/")
62 (commit (string-append "v" version))))
63 (file-name (string-append name "-" version "-checkout"))
66 "0p01vx7rbyf5hyyaff7h8cbhq81bm5fmq1m933484lncl9rafcai"))
67 (modules '((guix build utils)))
70 ;; The man page hails from BSD, where (d)ash is the default shell.
71 ;; This isn't the case on Guix or indeed most other GNU systems.
72 (substitute* "src/dash.1"
73 (("the standard command interpreter for the system")
74 "a command interpreter based on the original Bourne shell"))
76 (build-system gnu-build-system)
78 `(("autoconf" ,autoconf)
79 ("automake" ,automake)))
81 `(("libedit" ,libedit)))
84 (modify-phases %standard-phases
85 (add-before 'configure 'bootstrap
86 (lambda _ (zero? (system* "autoreconf" "-vfi")))))
87 #:configure-flags '("--with-libedit")))
88 (home-page "http://gondor.apana.org.au/~herbert/dash")
89 (synopsis "POSIX-compliant shell optimised for size")
91 "dash is a POSIX-compliant @command{/bin/sh} implementation that aims to be
92 as small as possible, often without sacrificing speed. It is faster than the
93 GNU Bourne-Again Shell (@command{bash}) at most scripted tasks. dash is a
94 direct descendant of NetBSD's Almquist Shell (@command{ash}).")
96 gpl2+)))) ; mksignames.c
104 (uri (string-append "https://fishshell.com/files/"
105 version "/fish-" version ".tar.gz"))
108 "19djav128nkhjxgfhwhc32i5y9d9c3karbh5yg67kqrdranyvh7q"))
109 (modules '((guix build utils)))
110 ;; Don't try to install /etc/fish/config.fish.
112 '(substitute* "Makefile.in"
113 ((".*INSTALL.*sysconfdir.*fish.*") "")))))
114 (build-system gnu-build-system)
116 `(("doxygen" ,doxygen)))
120 ("groff" ,groff) ;for 'fish --help'
121 ("pcre2" ,pcre2) ;don't use the bundled PCRE2
122 ("python" ,python-wrapper))) ;for fish_config and manpage completions
124 '(#:tests? #f ; no check target
125 #:configure-flags '("--sysconfdir=/etc")
127 (modify-phases %standard-phases
128 ;; Embed absolute paths to store items.
129 (add-after 'unpack 'embed-store-paths
130 (lambda* (#:key inputs outputs #:allow-other-keys)
131 (substitute* '("share/functions/math.fish"
132 "share/functions/seq.fish")
134 (string-append "| " (assoc-ref %build-inputs "bc")
136 (substitute* "share/functions/fish_update_completions.fish"
137 (("python") (which "python")))
138 (substitute* "share/functions/__fish_print_help.fish"
139 (("nroff") (which "nroff")))
141 (synopsis "The friendly interactive shell")
143 "Fish (friendly interactive shell) is a shell focused on interactive use,
144 discoverability, and friendliness. Fish has very user-friendly and powerful
145 tab-completion, including descriptions of every completion, completion of
146 strings with wildcards, and many completions for specific commands. It also
147 has extensive and discoverable help. A special help command gives access to
148 all the fish documentation in your web browser. Other features include smart
149 terminal handling based on terminfo, an easy to search history, and syntax
151 (home-page "https://fishshell.com/")
154 (define-public fish-guix
161 (uri (string-append "https://dist.pragmatique.xyz/fish-guix/"
162 name "-" version ".tar.xz"))
165 "0xi0j9lvzh43lrj82gz52n2cjln0i0pgayngrg4hy5w4449biy0z"))))
166 (build-system gnu-build-system)
168 `(#:tests? #f ; No checks.
170 (string-append "PREFIX=" %output))
172 (modify-phases %standard-phases
173 (delete 'configure)))) ; No configure script.
174 (home-page "https://pragmatique.xyz/software/fish-guix.html")
175 (synopsis "Fish completions for Guix")
177 "Fish-guix provides completions for Guix for users of the fish shell.")
178 (license public-domain)))
187 (url "git://github.com/rakitzis/rc.git")
188 ;; commit name 'release: rc-1.7.4'
189 (commit "c884da53a7c885d46ace2b92de78946855b18e92")))
192 "00mgzvrrh9w96xa85g4gjbsvq02f08k4jwjcdnxq7kyh5xgiw95l"))
193 (file-name (string-append name "-" version "-checkout"))))
194 (build-system gnu-build-system)
199 (modify-phases %standard-phases
202 (lambda _ (zero? (system* "autoreconf" "-vfi"))))
204 'autoreconf 'patch-trip.rc
206 (substitute* "trip.rc"
207 (("/bin/pwd") (which "pwd"))
208 (("/bin/sh") (which "sh"))
209 (("/bin/rm") (which "rm"))
210 (("/bin\\)") (string-append (dirname (which "rm")) ")")))
212 (inputs `(("readline" ,readline)
214 (native-inputs `(("autoconf" ,autoconf)
215 ("automake" ,automake)
217 ("pkg-config" ,pkg-config)))
218 (synopsis "Alternative implementation of the rc shell by Byron Rakitzis")
220 "This is a reimplementation by Byron Rakitzis of the Plan 9 shell. It
221 has a small feature set similar to a traditional Bourne shell.")
222 (home-page "https://github.com/rakitzis/rc")
232 (uri (string-append "https://github.com/wryun/es-shell/releases/"
233 "download/v" version "/es-" version ".tar.gz"))
236 "1fplzxc6lncz2lv2fyr2ig23rgg5j96rm2bbl1rs28mik771zd5h"))
237 (file-name (string-append name "-" version ".tar.gz"))))
238 (build-system gnu-build-system)
240 `(#:test-target "test"
242 (modify-phases %standard-phases
243 (add-before 'configure 're-enter-rootdir
244 ;; The tarball has no folder.
248 `(("readline" ,readline)))
251 (synopsis "Extensible shell with higher-order functions")
253 "Es is an extensible shell. The language was derived from the Plan 9
254 shell, rc, and was influenced by functional programming languages, such as
255 Scheme, and the Tcl embeddable programming language. This implementation is
256 derived from Byron Rakitzis's public domain implementation of rc, and was
257 written by Paul Haahr and Byron Rakitzis.")
258 (home-page "https://wryun.github.io/es-shell/")
259 (license public-domain)))
267 ;; Old tarballs are moved to old/.
268 (uri (list (string-append "ftp://ftp.astron.com/pub/tcsh/"
269 "tcsh-" version ".tar.gz")
270 (string-append "ftp://ftp.astron.com/pub/tcsh/"
271 "old/tcsh-" version ".tar.gz")))
274 "17ggxkkn5skl0v1x0j6hbv5l0sgnidfzwv16992sqkdm983fg7dq"))
275 (patches (search-patches "tcsh-fix-autotest.patch"
276 "tcsh-fix-out-of-bounds-read.patch"))
277 (patch-flags '("-p0"))))
278 (build-system gnu-build-system)
280 `(("autoconf" ,autoconf)
283 `(("ncurses" ,ncurses)))
286 (modify-phases %standard-phases
287 (add-before 'check 'patch-test-scripts
290 (substitute* '("tests/commands.at" "tests/variables.at")
291 (("/bin/pwd") (which "pwd")))
292 ;; The .at files create shell scripts without shebangs. Erk.
293 (substitute* "tests/commands.at"
294 (("./output.sh") "/bin/sh output.sh"))
295 (substitute* "tests/syntax.at"
296 (("; other_script.csh") "; /bin/sh other_script.csh"))
297 ;; Now, let's generate the test suite and patch it
298 (system* "make" "tests/testsuite")
300 ;; This file is ISO-8859-1 encoded.
301 (with-fluids ((%default-port-encoding #f))
302 (substitute* "tests/testsuite"
303 (("/bin/sh") (which "sh"))))
305 (add-after 'install 'post-install
306 (lambda* (#:key inputs outputs #:allow-other-keys)
307 (let* ((out (assoc-ref %outputs "out"))
308 (bin (string-append out "/bin")))
309 (with-directory-excursion bin
310 (symlink "tcsh" "csh"))
312 (home-page "http://www.tcsh.org/")
313 (synopsis "Unix shell based on csh")
315 "Tcsh is an enhanced, but completely compatible version of the Berkeley
316 UNIX C shell (csh). It is a command language interpreter usable both as an
317 interactive login shell and a shell script command processor. It includes a
318 command-line editor, programmable word completion, spelling correction, a
319 history mechanism, job control and a C-like syntax.")
328 (uri (list (string-append
329 "http://www.zsh.org/pub/zsh-" version
332 "http://www.zsh.org/pub/old/zsh-" version
336 "0dsr450v8nydvpk8ry276fvbznlrjgddgp7zvhcw4cv69i9lr4ps"))))
337 (build-system gnu-build-system)
338 (arguments `(#:configure-flags '("--with-tcsetpgrp" "--enable-pcre")
340 (modify-phases %standard-phases
341 (add-before 'configure 'fix-sh
343 ;; Some of the files are ISO-8859-1 encoded.
344 (with-fluids ((%default-port-encoding #f))
350 "Config/installfns.sh"
352 "Test/E01options.ztst"
353 "Test/A05execution.ztst"
354 "Test/A01grammar.ztst"
355 "Test/A06assign.ztst"
356 "Test/B02typeset.ztst"
357 "Completion/Unix/Command/_init_d"
359 (("/bin/sh") (which "sh")))))))))
360 (native-inputs `(("autoconf" ,autoconf)))
361 (inputs `(("ncurses" ,ncurses)
364 (synopsis "Powerful shell for interactive use and scripting")
365 (description "The Z shell (zsh) is a Unix shell that can be used
366 as an interactive login shell and as a powerful command interpreter
367 for shell scripting. Zsh can be thought of as an extended Bourne shell
368 with a large number of improvements, including some features of bash,
370 (home-page "http://www.zsh.org/")
372 ;; The whole thing is under an MIT/X11-style license, but there's one
373 ;; command, 'Completion/Unix/Command/_darcs', which is under GPLv2+.
383 (uri (pypi-uri "xonsh" version))
386 "09s5k7fh4p0vkq0fha4ikwqlqsyv84vmlbqn8ggn0ymd47ajv38z"))
387 (modules '((guix build utils)))
390 ;; Delete bundled ply.
391 (delete-file-recursively "xonsh/ply")
392 (substitute* '("setup.py")
393 (("'xonsh\\.ply\\.ply',") ""))
395 (build-system python-build-system)
397 '(;; TODO Try running run the test suite.
398 ;; See 'requirements-tests.txt' in the source distribution for more
402 `(("python-ply" ,python-ply)))
403 (home-page "http://xon.sh/")
404 (synopsis "Python-ish shell")
406 "Xonsh is a Python-ish, BASHwards-looking shell language and command
407 prompt. The language is a superset of Python 3.4+ with additional shell
408 primitives that you are used to from Bash and IPython. It works on all major
409 systems including Linux, Mac OSX, and Windows. Xonsh is meant for the daily
410 use of experts and novices alike.")
414 (let ((commit "114432435e4eadd54334df6b37fcae505079b49f")
418 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
423 (url "https://github.com/scheme/scsh")
425 (file-name (string-append name "-" version "-checkout"))
428 "1ghk08akiz7hff1pndi8rmgamgcrn2mv9asbss9l79d3c2iaav3q"))))
429 (build-system gnu-build-system)
431 `(#:test-target "test"
433 (modify-phases %standard-phases
434 (add-before 'configure 'replace-rx
435 (lambda* (#:key inputs #:allow-other-keys)
436 (let* ((rx (assoc-ref inputs "scheme48-rx"))
437 (rxpath (string-append rx "/share/scheme48-"
438 ,(package-version scheme48)
440 (delete-file-recursively "rx")
441 (symlink rxpath "rx"))
443 (add-before 'configure 'autoreconf
445 (zero? (system* "autoreconf")))))))
447 `(("scheme48" ,scheme48)
448 ("scheme48-rx" ,scheme48-rx)))
450 `(("autoconf" ,autoconf)
451 ("automake" ,automake)))
452 (home-page "https://github.com/scheme/scsh")
453 (synopsis "Unix shell embedded in Scheme")
455 "Scsh is a Unix shell embedded in Scheme. Scsh has two main
456 components: a process notation for running programs and setting up pipelines
457 and redirections, and a complete syscall library for low-level access to the