gnu: libtasn1: Remove obsolete patch.
[jackhill/guix/guix.git] / gnu / packages / shells.scm
CommitLineData
c356339d 1;;; GNU Guix --- Functional package management for GNU
d754347c 2;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
618977ae 3;;; Copyright © 2014, 2015 David Thompson <davet@gnu.org>
7ccb874a 4;;; Copyright © 2014 Kevin Lemonnier <lemonnierk@ulrar.net>
9a57d3e6 5;;; Copyright © 2015 Jeff Mickey <j@codemac.net>
c356339d 6;;; Copyright © 2016 Tobias Geerinckx-Rice <me@tobias.gr>
572ee05c 7;;; Copyright © 2016 Stefan Reichör <stefan@xsteve.at>
79f3e82b 8;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
1dc0a665 9;;; Copyright © 2017 ng0 <ng0@no-reply.pragmatique.xyz>
06e8d0c8 10;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
c356339d
TGR
11;;;
12;;; This file is part of GNU Guix.
13;;;
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.
18;;;
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.
23;;;
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/>.
26
27(define-module (gnu packages shells)
d754347c 28 #:use-module (gnu packages)
a8d3bc47 29 #:use-module (gnu packages algebra)
9a57d3e6 30 #:use-module (gnu packages autotools)
d754347c 31 #:use-module (gnu packages base)
e6880040 32 #:use-module (gnu packages bison)
618977ae 33 #:use-module (gnu packages documentation)
28a671ed 34 #:use-module (gnu packages groff)
cc5a76a7 35 #:use-module (gnu packages libbsd)
c356339d 36 #:use-module (gnu packages libedit)
618977ae 37 #:use-module (gnu packages ncurses)
7ccb874a 38 #:use-module (gnu packages pcre)
9a57d3e6
TGR
39 #:use-module (gnu packages perl)
40 #:use-module (gnu packages pkg-config)
618977ae 41 #:use-module (gnu packages python)
9a57d3e6 42 #:use-module (gnu packages readline)
52ddeaa0 43 #:use-module (gnu packages scheme)
c356339d 44 #:use-module (guix build-system gnu)
1d515855 45 #:use-module (guix build-system python)
c356339d 46 #:use-module (guix download)
9a57d3e6 47 #:use-module (guix git-download)
c356339d
TGR
48 #:use-module (guix licenses)
49 #:use-module (guix packages))
50
51(define-public dash
52 (package
53 (name "dash")
06e8d0c8 54 (version "0.5.9.1")
c356339d
TGR
55 (source
56 (origin
06e8d0c8
LF
57 ;; The canonical source is offline, so we fetch the source code
58 ;; from the Git repository. See:
59 ;; https://www.mail-archive.com/dash@vger.kernel.org/msg01323.html
60 (method git-fetch)
61 (uri (git-reference
62 (url "https://git.kernel.org/pub/scm/utils/dash/dash.git/")
63 (commit (string-append "v" version))))
64 (file-name (string-append name "-" version "-checkout"))
c356339d
TGR
65 (sha256
66 (base32
06e8d0c8 67 "0p01vx7rbyf5hyyaff7h8cbhq81bm5fmq1m933484lncl9rafcai"))
c356339d
TGR
68 (modules '((guix build utils)))
69 (snippet
70 '(begin
71 ;; The man page hails from BSD, where (d)ash is the default shell.
72 ;; This isn't the case on Guix or indeed most other GNU systems.
73 (substitute* "src/dash.1"
74 (("the standard command interpreter for the system")
75 "a command interpreter based on the original Bourne shell"))
76 #t))))
77 (build-system gnu-build-system)
06e8d0c8
LF
78 (native-inputs
79 `(("autoconf" ,autoconf)
80 ("automake" ,automake)))
c356339d
TGR
81 (inputs
82 `(("libedit" ,libedit)))
83 (arguments
06e8d0c8
LF
84 `(#:phases
85 (modify-phases %standard-phases
86 (add-before 'configure 'bootstrap
87 (lambda _ (zero? (system* "autoreconf" "-vfi")))))
88 #:configure-flags '("--with-libedit")))
c356339d
TGR
89 (home-page "http://gondor.apana.org.au/~herbert/dash")
90 (synopsis "POSIX-compliant shell optimised for size")
91 (description
92 "dash is a POSIX-compliant @command{/bin/sh} implementation that aims to be
93as small as possible, often without sacrificing speed. It is faster than the
94GNU Bourne-Again Shell (@command{bash}) at most scripted tasks. dash is a
95direct descendant of NetBSD's Almquist Shell (@command{ash}).")
96 (license (list bsd-3
97 gpl2+)))) ; mksignames.c
618977ae
TGR
98
99(define-public fish
100 (package
101 (name "fish")
89eb56f0 102 (version "2.5.0")
618977ae
TGR
103 (source (origin
104 (method url-fetch)
105 (uri (string-append "https://fishshell.com/files/"
106 version "/fish-" version ".tar.gz"))
107 (sha256
108 (base32
4f4bca0f 109 "19djav128nkhjxgfhwhc32i5y9d9c3karbh5yg67kqrdranyvh7q"))
618977ae
TGR
110 (modules '((guix build utils)))
111 ;; Don't try to install /etc/fish/config.fish.
112 (snippet
113 '(substitute* "Makefile.in"
114 ((".*INSTALL.*sysconfdir.*fish.*") "")))))
115 (build-system gnu-build-system)
116 (native-inputs
4f4bca0f 117 `(("doxygen" ,doxygen)))
618977ae 118 (inputs
a8d3bc47
AI
119 `(("bc" ,bc)
120 ("ncurses" ,ncurses)
28a671ed 121 ("groff" ,groff) ;for 'fish --help'
47c14714 122 ("pcre2" ,pcre2) ;don't use the bundled PCRE2
618977ae
TGR
123 ("python" ,python-wrapper))) ;for fish_config and manpage completions
124 (arguments
125 '(#:tests? #f ; no check target
a8d3bc47
AI
126 #:configure-flags '("--sysconfdir=/etc")
127 #:phases
128 (modify-phases %standard-phases
79f3e82b
RW
129 ;; Embed absolute paths to store items.
130 (add-after 'unpack 'embed-store-paths
a8d3bc47
AI
131 (lambda* (#:key inputs outputs #:allow-other-keys)
132 (substitute* '("share/functions/math.fish"
133 "share/functions/seq.fish")
134 (("\\| bc")
135 (string-append "| " (assoc-ref %build-inputs "bc")
79f3e82b
RW
136 "/bin/bc")))
137 (substitute* "share/functions/fish_update_completions.fish"
138 (("python") (which "python")))
28a671ed 139 (substitute* "share/functions/__fish_print_help.fish"
140 (("nroff") (which "nroff")))
4f4bca0f 141 #t)))))
618977ae
TGR
142 (synopsis "The friendly interactive shell")
143 (description
144 "Fish (friendly interactive shell) is a shell focused on interactive use,
145discoverability, and friendliness. Fish has very user-friendly and powerful
146tab-completion, including descriptions of every completion, completion of
147strings with wildcards, and many completions for specific commands. It also
148has extensive and discoverable help. A special help command gives access to
149all the fish documentation in your web browser. Other features include smart
150terminal handling based on terminfo, an easy to search history, and syntax
151highlighting.")
152 (home-page "https://fishshell.com/")
153 (license gpl2)))
9a57d3e6 154
1dc0a665 155(define-public fish-guix
156 (package
157 (name "fish-guix")
158 (version "0.1.1")
159 (source
160 (origin
161 (method url-fetch)
162 (uri (string-append "https://dist.pragmatique.xyz/fish-guix/"
163 name "-" version ".tar.xz"))
164 (sha256
165 (base32
166 "0xi0j9lvzh43lrj82gz52n2cjln0i0pgayngrg4hy5w4449biy0z"))))
167 (build-system gnu-build-system)
168 (arguments
169 `(#:tests? #f ; No checks.
170 #:make-flags (list
171 (string-append "PREFIX=" %output))
172 #:phases
173 (modify-phases %standard-phases
174 (delete 'configure)))) ; No configure script.
4032dd81 175 (home-page "https://pragmatique.xyz/software/fish-guix.html")
1dc0a665 176 (synopsis "Fish completions for Guix")
177 (description
178 "Fish-guix provides completions for Guix for users of the fish shell.")
179 (license public-domain)))
180
9a57d3e6
TGR
181(define-public rc
182 (package
183 (name "rc")
184 (version "1.7.4")
185 (source (origin
186 (method git-fetch)
187 (uri (git-reference
188 (url "git://github.com/rakitzis/rc.git")
189 ;; commit name 'release: rc-1.7.4'
190 (commit "c884da53a7c885d46ace2b92de78946855b18e92")))
191 (sha256
192 (base32
193 "00mgzvrrh9w96xa85g4gjbsvq02f08k4jwjcdnxq7kyh5xgiw95l"))
194 (file-name (string-append name "-" version "-checkout"))))
195 (build-system gnu-build-system)
196 (arguments
197 `(#:configure-flags
198 '("--with-edit=gnu")
199 #:phases
200 (modify-phases %standard-phases
201 (add-after
202 'unpack 'autoreconf
203 (lambda _ (zero? (system* "autoreconf" "-vfi"))))
204 (add-before
205 'autoreconf 'patch-trip.rc
206 (lambda _
207 (substitute* "trip.rc"
208 (("/bin/pwd") (which "pwd"))
209 (("/bin/sh") (which "sh"))
210 (("/bin/rm") (which "rm"))
211 (("/bin\\)") (string-append (dirname (which "rm")) ")")))
212 #t)))))
213 (inputs `(("readline" ,readline)
214 ("perl" ,perl)))
215 (native-inputs `(("autoconf" ,autoconf)
216 ("automake" ,automake)
217 ("libtool" ,libtool)
218 ("pkg-config" ,pkg-config)))
219 (synopsis "Alternative implementation of the rc shell by Byron Rakitzis")
220 (description
221 "This is a reimplementation by Byron Rakitzis of the Plan 9 shell. It
222has a small feature set similar to a traditional Bourne shell.")
7bf837fd 223 (home-page "https://github.com/rakitzis/rc")
9a57d3e6 224 (license zlib)))
d754347c 225
e6880040 226(define-public es
227 (package
228 (name "es")
229 (version "0.9.1")
230 (source
231 (origin
232 (method url-fetch)
233 (uri (string-append "https://github.com/wryun/es-shell/releases/"
234 "download/v" version "/es-" version ".tar.gz"))
235 (sha256
236 (base32
237 "1fplzxc6lncz2lv2fyr2ig23rgg5j96rm2bbl1rs28mik771zd5h"))
238 (file-name (string-append name "-" version ".tar.gz"))))
239 (build-system gnu-build-system)
240 (arguments
241 `(#:test-target "test"
242 #:phases
243 (modify-phases %standard-phases
244 (add-before 'configure 're-enter-rootdir
245 ;; The tarball has no folder.
246 (lambda _
247 (chdir ".."))))))
248 (inputs
249 `(("readline" ,readline)))
250 (native-inputs
251 `(("bison" ,bison)))
252 (synopsis "Extensible shell with higher-order functions")
253 (description
254 "Es is an extensible shell. The language was derived from the Plan 9
255shell, rc, and was influenced by functional programming languages, such as
256Scheme, and the Tcl embeddable programming language. This implementation is
257derived from Byron Rakitzis's public domain implementation of rc, and was
258written by Paul Haahr and Byron Rakitzis.")
259 (home-page "https://wryun.github.io/es-shell/")
260 (license public-domain)))
261
d754347c
TGR
262(define-public tcsh
263 (package
264 (name "tcsh")
816417f5 265 (version "6.20.00")
d754347c
TGR
266 (source (origin
267 (method url-fetch)
268 ;; Old tarballs are moved to old/.
269 (uri (list (string-append "ftp://ftp.astron.com/pub/tcsh/"
270 "tcsh-" version ".tar.gz")
271 (string-append "ftp://ftp.astron.com/pub/tcsh/"
272 "old/tcsh-" version ".tar.gz")))
273 (sha256
274 (base32
816417f5 275 "17ggxkkn5skl0v1x0j6hbv5l0sgnidfzwv16992sqkdm983fg7dq"))
6f83d224 276 (patches (search-patches "tcsh-fix-autotest.patch"
00864960 277 "tcsh-fix-out-of-bounds-read.patch"))
d754347c
TGR
278 (patch-flags '("-p0"))))
279 (build-system gnu-build-system)
816417f5 280 (native-inputs
d754347c 281 `(("autoconf" ,autoconf)
816417f5
LF
282 ("perl" ,perl)))
283 (inputs
284 `(("ncurses" ,ncurses)))
d754347c
TGR
285 (arguments
286 `(#:phases
c71011f8
LF
287 (modify-phases %standard-phases
288 (add-before 'check 'patch-test-scripts
289 (lambda _
290 ;; Take care of pwd
291 (substitute* '("tests/commands.at" "tests/variables.at")
292 (("/bin/pwd") (which "pwd")))
293 ;; The .at files create shell scripts without shebangs. Erk.
294 (substitute* "tests/commands.at"
295 (("./output.sh") "/bin/sh output.sh"))
296 (substitute* "tests/syntax.at"
297 (("; other_script.csh") "; /bin/sh other_script.csh"))
298 ;; Now, let's generate the test suite and patch it
299 (system* "make" "tests/testsuite")
d754347c 300
c71011f8
LF
301 ;; This file is ISO-8859-1 encoded.
302 (with-fluids ((%default-port-encoding #f))
303 (substitute* "tests/testsuite"
304 (("/bin/sh") (which "sh"))))
305 #t))
306 (add-after 'install 'post-install
307 (lambda* (#:key inputs outputs #:allow-other-keys)
308 (let* ((out (assoc-ref %outputs "out"))
309 (bin (string-append out "/bin")))
310 (with-directory-excursion bin
311 (symlink "tcsh" "csh"))
312 #t))))))
d754347c
TGR
313 (home-page "http://www.tcsh.org/")
314 (synopsis "Unix shell based on csh")
315 (description
316 "Tcsh is an enhanced, but completely compatible version of the Berkeley
317UNIX C shell (csh). It is a command language interpreter usable both as an
318interactive login shell and a shell script command processor. It includes a
319command-line editor, programmable word completion, spelling correction, a
320history mechanism, job control and a C-like syntax.")
321 (license bsd-4)))
7ccb874a
TGR
322
323(define-public zsh
324 (package
325 (name "zsh")
326 (version "5.2")
327 (source (origin
328 (method url-fetch)
329 (uri (list (string-append
330 "http://www.zsh.org/pub/zsh-" version
331 ".tar.gz")
332 (string-append
333 "http://www.zsh.org/pub/old/zsh-" version
334 ".tar.gz")))
335 (sha256
336 (base32
337 "0dsr450v8nydvpk8ry276fvbznlrjgddgp7zvhcw4cv69i9lr4ps"))))
338 (build-system gnu-build-system)
339 (arguments `(#:configure-flags '("--with-tcsetpgrp" "--enable-pcre")
ddee9a6e
TGR
340 #:phases
341 (modify-phases %standard-phases
342 (add-before 'configure 'fix-sh
343 (lambda _
344 ;; Some of the files are ISO-8859-1 encoded.
345 (with-fluids ((%default-port-encoding #f))
346 (substitute*
347 '("configure"
348 "configure.ac"
349 "Src/exec.c"
350 "Src/mkmakemod.sh"
351 "Config/installfns.sh"
352 "Config/defs.mk.in"
353 "Test/E01options.ztst"
354 "Test/A05execution.ztst"
355 "Test/A01grammar.ztst"
356 "Test/A06assign.ztst"
357 "Test/B02typeset.ztst"
358 "Completion/Unix/Command/_init_d"
359 "Util/preconfig")
360 (("/bin/sh") (which "sh")))))))))
7ccb874a
TGR
361 (native-inputs `(("autoconf" ,autoconf)))
362 (inputs `(("ncurses" ,ncurses)
363 ("pcre" ,pcre)
364 ("perl" ,perl)))
365 (synopsis "Powerful shell for interactive use and scripting")
366 (description "The Z shell (zsh) is a Unix shell that can be used
367as an interactive login shell and as a powerful command interpreter
368for shell scripting. Zsh can be thought of as an extended Bourne shell
369with a large number of improvements, including some features of bash,
370ksh, and tcsh.")
371 (home-page "http://www.zsh.org/")
372
373 ;; The whole thing is under an MIT/X11-style license, but there's one
374 ;; command, 'Completion/Unix/Command/_darcs', which is under GPLv2+.
375 (license gpl2+)))
1d515855
SR
376
377(define-public xonsh
378 (package
379 (name "xonsh")
32ea6537 380 (version "0.5.9")
1d515855
SR
381 (source
382 (origin
383 (method url-fetch)
384 (uri (pypi-uri "xonsh" version))
385 (sha256
386 (base32
32ea6537 387 "09s5k7fh4p0vkq0fha4ikwqlqsyv84vmlbqn8ggn0ymd47ajv38z"))
cfb7e269
DM
388 (modules '((guix build utils)))
389 (snippet
390 `(begin
391 ;; Delete bundled ply.
392 (delete-file-recursively "xonsh/ply")
393 (substitute* '("setup.py")
572ee05c 394 (("'xonsh\\.ply\\.ply',") ""))
cfb7e269 395 #t))))
1d515855 396 (build-system python-build-system)
792e6079
LF
397 (arguments
398 '(;; TODO Try running run the test suite.
399 ;; See 'requirements-tests.txt' in the source distribution for more
400 ;; information.
401 #:tests? #f))
cfb7e269
DM
402 (inputs
403 `(("python-ply" ,python-ply)))
1d515855
SR
404 (home-page "http://xon.sh/")
405 (synopsis "Python-ish shell")
406 (description
407 "Xonsh is a Python-ish, BASHwards-looking shell language and command
e813f395
KK
408prompt. The language is a superset of Python 3.4+ with additional shell
409primitives that you are used to from Bash and IPython. It works on all major
410systems including Linux, Mac OSX, and Windows. Xonsh is meant for the daily
1d515855
SR
411use of experts and novices alike.")
412 (license bsd-2)))
52ddeaa0 413
414(define-public scsh
415 (let ((commit "114432435e4eadd54334df6b37fcae505079b49f")
416 (revision "1"))
417 (package
418 (name "scsh")
419 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
420 (source
421 (origin
422 (method git-fetch)
423 (uri (git-reference
424 (url "https://github.com/scheme/scsh")
425 (commit commit)))
426 (file-name (string-append name "-" version "-checkout"))
427 (sha256
428 (base32
429 "1ghk08akiz7hff1pndi8rmgamgcrn2mv9asbss9l79d3c2iaav3q"))))
430 (build-system gnu-build-system)
431 (arguments
432 `(#:test-target "test"
433 #:phases
434 (modify-phases %standard-phases
435 (add-before 'configure 'replace-rx
436 (lambda* (#:key inputs #:allow-other-keys)
437 (let* ((rx (assoc-ref inputs "scheme48-rx"))
438 (rxpath (string-append rx "/share/scheme48-"
439 ,(package-version scheme48)
440 "/rx")))
441 (delete-file-recursively "rx")
442 (symlink rxpath "rx"))
443 #t))
444 (add-before 'configure 'autoreconf
445 (lambda _
446 (zero? (system* "autoreconf")))))))
447 (inputs
448 `(("scheme48" ,scheme48)
449 ("scheme48-rx" ,scheme48-rx)))
450 (native-inputs
451 `(("autoconf" ,autoconf)
452 ("automake" ,automake)))
453 (home-page "https://github.com/scheme/scsh")
454 (synopsis "Unix shell embedded in Scheme")
455 (description
456 "Scsh is a Unix shell embedded in Scheme. Scsh has two main
457components: a process notation for running programs and setting up pipelines
458and redirections, and a complete syscall library for low-level access to the
459operating system.")
460 (license bsd-3))))
cc5a76a7 461
462(define-public loksh
463 (package
464 (name "loksh")
465 (version "6.1")
466 (source
467 (origin
468 (method url-fetch)
469 (uri (string-append "https://github.com/dimkr/loksh/archive/"
470 version ".tar.gz"))
471 (file-name (string-append name "-" version ".tar.gz"))
472 (sha256
473 (base32
474 "1wg7ds56yr8fgg1m149bi53bvrwccwiashmwknggza1sqgj9m2lq"))))
475 (build-system gnu-build-system)
476 (inputs
477 `(("libbsd" ,libbsd)))
478 (native-inputs
479 `(("pkg-config" ,pkg-config)))
480 (arguments
481 `(#:tests? #f ;No tests included
482 #:make-flags (list "CC=gcc" "HAVE_LIBBSD=1"
483 (string-append "DESTDIR="
484 (assoc-ref %outputs "out"))
485 "PREFIX=")
486 #:phases
487 (modify-phases %standard-phases
488 (delete 'configure)))) ;No configure script
489 (home-page "https://github.com/dimkr/loksh")
490 (synopsis "Korn Shell from OpenBSD")
491 (description
492 "loksh is a Linux port of OpenBSD's @command{ksh}. It is a small,
493interactive POSIX shell targeted at resource-constrained systems.")
494 ;; The file 'LEGAL' says it is the public domain, and the 2
495 ;; exceptions which are listed are not included in this port.
496 (license public-domain)))