Correct name and Email for ng0.
[jackhill/guix/guix.git] / gnu / packages / shells.scm
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, 2017, 2018 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, 2018 Nils Gillmann <ng0@n0.is>
10 ;;; Copyright © 2017, 2018 Leo Famulari <leo@famulari.name>
11 ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
12 ;;;
13 ;;; This file is part of GNU Guix.
14 ;;;
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
19 ;;;
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
24 ;;;
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27
28 (define-module (gnu packages shells)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages algebra)
31 #:use-module (gnu packages autotools)
32 #:use-module (gnu packages base)
33 #:use-module (gnu packages bison)
34 #:use-module (gnu packages documentation)
35 #:use-module (gnu packages groff)
36 #:use-module (gnu packages libbsd)
37 #:use-module (gnu packages libedit)
38 #:use-module (gnu packages ncurses)
39 #:use-module (gnu packages pcre)
40 #:use-module (gnu packages perl)
41 #:use-module (gnu packages pkg-config)
42 #:use-module (gnu packages python)
43 #:use-module (gnu packages readline)
44 #:use-module (gnu packages scheme)
45 #:use-module (guix build-system gnu)
46 #:use-module (guix build-system python)
47 #:use-module (guix download)
48 #:use-module (guix git-download)
49 #:use-module (guix licenses)
50 #:use-module (guix packages))
51
52 (define-public dash
53 (package
54 (name "dash")
55 (version "0.5.9.1")
56 (source
57 (origin
58 (method url-fetch)
59 (uri (string-append "http://gondor.apana.org.au/~herbert/dash/files/"
60 "dash-" version ".tar.gz"))
61 (sha256
62 (base32
63 "0ng695mq5ngg43h7ljhxvbjm46ym3nayj6ssn47d2gm9fbm5pkay"))
64 (modules '((guix build utils)))
65 (snippet
66 '(begin
67 ;; The man page hails from BSD, where (d)ash is the default shell.
68 ;; This isn't the case on Guix or indeed most other GNU systems.
69 (substitute* "src/dash.1"
70 (("the standard command interpreter for the system")
71 "a command interpreter based on the original Bourne shell"))
72 #t))))
73 (build-system gnu-build-system)
74 (inputs
75 `(("libedit" ,libedit)))
76 (arguments
77 '(#:configure-flags '("--with-libedit")))
78 (home-page "http://gondor.apana.org.au/~herbert/dash")
79 (synopsis "POSIX-compliant shell optimised for size")
80 (description
81 "dash is a POSIX-compliant @command{/bin/sh} implementation that aims to be
82 as small as possible, often without sacrificing speed. It is faster than the
83 GNU Bourne-Again Shell (@command{bash}) at most scripted tasks. dash is a
84 direct descendant of NetBSD's Almquist Shell (@command{ash}).")
85 (license (list bsd-3
86 gpl2+)))) ; mksignames.c
87
88 (define-public fish
89 (package
90 (name "fish")
91 (version "2.7.1")
92 (source (origin
93 (method url-fetch)
94 (uri
95 (list
96 (string-append "https://fishshell.com/files/"
97 version "/fish-" version ".tar.gz")
98 (string-append "https://github.com/fish-shell/fish-shell/"
99 "releases/download/" version "/"
100 name "-" version ".tar.gz")))
101 (sha256
102 (base32
103 "0nhc3yc5lnnan7zmxqqxm07rdpwjww5ijy45ll2njdc6fnfb2az4"))
104 (modules '((guix build utils)))
105 ;; Don't try to install /etc/fish/config.fish.
106 (snippet
107 '(substitute* "Makefile.in"
108 ((".*INSTALL.*sysconfdir.*fish.*") "")))))
109 (build-system gnu-build-system)
110 (native-inputs
111 `(("doxygen" ,doxygen)))
112 (inputs
113 `(("bc" ,bc)
114 ("ncurses" ,ncurses)
115 ("groff" ,groff) ;for 'fish --help'
116 ("pcre2" ,pcre2) ;don't use the bundled PCRE2
117 ("python" ,python-wrapper))) ;for fish_config and manpage completions
118 (arguments
119 '(#:tests? #f ; no check target
120 #:configure-flags '("--sysconfdir=/etc")
121 #:phases
122 (modify-phases %standard-phases
123 ;; Embed absolute paths to store items.
124 (add-after 'unpack 'embed-store-paths
125 (lambda* (#:key inputs outputs #:allow-other-keys)
126 (substitute* '("share/functions/math.fish"
127 "share/functions/seq.fish")
128 (("\\| bc")
129 (string-append "| " (assoc-ref %build-inputs "bc")
130 "/bin/bc")))
131 (substitute* "share/functions/fish_update_completions.fish"
132 (("python") (which "python")))
133 (substitute* "share/functions/__fish_print_help.fish"
134 (("nroff") (which "nroff")))
135 #t)))))
136 (synopsis "The friendly interactive shell")
137 (description
138 "Fish (friendly interactive shell) is a shell focused on interactive use,
139 discoverability, and friendliness. Fish has very user-friendly and powerful
140 tab-completion, including descriptions of every completion, completion of
141 strings with wildcards, and many completions for specific commands. It also
142 has extensive and discoverable help. A special @command{help} command gives
143 access to all the fish documentation in your web browser. Other features
144 include smart terminal handling based on terminfo, an easy to search history,
145 and syntax highlighting.")
146 (home-page "https://fishshell.com/")
147 (license gpl2)))
148
149 (define-public rc
150 (package
151 (name "rc")
152 (version "1.7.4")
153 (source (origin
154 (method git-fetch)
155 (uri (git-reference
156 (url "https://github.com/rakitzis/rc.git")
157 ;; commit name 'release: rc-1.7.4'
158 (commit "c884da53a7c885d46ace2b92de78946855b18e92")))
159 (sha256
160 (base32
161 "00mgzvrrh9w96xa85g4gjbsvq02f08k4jwjcdnxq7kyh5xgiw95l"))
162 (file-name (string-append name "-" version "-checkout"))))
163 (build-system gnu-build-system)
164 (arguments
165 `(#:configure-flags
166 '("--with-edit=gnu")
167 #:phases
168 (modify-phases %standard-phases
169 (add-after
170 'unpack 'autoreconf
171 (lambda _ (zero? (system* "autoreconf" "-vfi"))))
172 (add-before
173 'autoreconf 'patch-trip.rc
174 (lambda _
175 (substitute* "trip.rc"
176 (("/bin/pwd") (which "pwd"))
177 (("/bin/sh") (which "sh"))
178 (("/bin/rm") (which "rm"))
179 (("/bin\\)") (string-append (dirname (which "rm")) ")")))
180 #t)))))
181 (inputs `(("readline" ,readline)
182 ("perl" ,perl)))
183 (native-inputs `(("autoconf" ,autoconf)
184 ("automake" ,automake)
185 ("libtool" ,libtool)
186 ("pkg-config" ,pkg-config)))
187 (synopsis "Alternative implementation of the rc shell by Byron Rakitzis")
188 (description
189 "This is a reimplementation by Byron Rakitzis of the Plan 9 shell. It
190 has a small feature set similar to a traditional Bourne shell.")
191 (home-page "https://github.com/rakitzis/rc")
192 (license zlib)))
193
194 (define-public es
195 (package
196 (name "es")
197 (version "0.9.1")
198 (source
199 (origin
200 (method url-fetch)
201 (uri (string-append "https://github.com/wryun/es-shell/releases/"
202 "download/v" version "/es-" version ".tar.gz"))
203 (sha256
204 (base32
205 "1fplzxc6lncz2lv2fyr2ig23rgg5j96rm2bbl1rs28mik771zd5h"))
206 (file-name (string-append name "-" version ".tar.gz"))))
207 (build-system gnu-build-system)
208 (arguments
209 `(#:test-target "test"
210 #:phases
211 (modify-phases %standard-phases
212 (add-before 'configure 're-enter-rootdir
213 ;; The tarball has no folder.
214 (lambda _
215 (chdir ".."))))))
216 (inputs
217 `(("readline" ,readline)))
218 (native-inputs
219 `(("bison" ,bison)))
220 (synopsis "Extensible shell with higher-order functions")
221 (description
222 "Es is an extensible shell. The language was derived from the Plan 9
223 shell, rc, and was influenced by functional programming languages, such as
224 Scheme, and the Tcl embeddable programming language. This implementation is
225 derived from Byron Rakitzis's public domain implementation of rc, and was
226 written by Paul Haahr and Byron Rakitzis.")
227 (home-page "https://wryun.github.io/es-shell/")
228 (license public-domain)))
229
230 (define-public tcsh
231 (package
232 (name "tcsh")
233 (version "6.20.00")
234 (source (origin
235 (method url-fetch)
236 ;; Old tarballs are moved to old/.
237 (uri (list (string-append "ftp://ftp.astron.com/pub/tcsh/"
238 "tcsh-" version ".tar.gz")
239 (string-append "ftp://ftp.astron.com/pub/tcsh/"
240 "old/tcsh-" version ".tar.gz")))
241 (sha256
242 (base32
243 "17ggxkkn5skl0v1x0j6hbv5l0sgnidfzwv16992sqkdm983fg7dq"))
244 (patches (search-patches "tcsh-fix-autotest.patch"
245 "tcsh-fix-out-of-bounds-read.patch"))
246 (patch-flags '("-p0"))))
247 (build-system gnu-build-system)
248 (native-inputs
249 `(("autoconf" ,autoconf)
250 ("perl" ,perl)))
251 (inputs
252 `(("ncurses" ,ncurses)))
253 (arguments
254 `(#:phases
255 (modify-phases %standard-phases
256 (add-before 'check 'patch-test-scripts
257 (lambda _
258 ;; Take care of pwd
259 (substitute* '("tests/commands.at" "tests/variables.at")
260 (("/bin/pwd") (which "pwd")))
261 ;; The .at files create shell scripts without shebangs. Erk.
262 (substitute* "tests/commands.at"
263 (("./output.sh") "/bin/sh output.sh"))
264 (substitute* "tests/syntax.at"
265 (("; other_script.csh") "; /bin/sh other_script.csh"))
266 ;; Now, let's generate the test suite and patch it
267 (system* "make" "tests/testsuite")
268
269 ;; This file is ISO-8859-1 encoded.
270 (with-fluids ((%default-port-encoding #f))
271 (substitute* "tests/testsuite"
272 (("/bin/sh") (which "sh"))))
273 #t))
274 (add-after 'install 'post-install
275 (lambda* (#:key inputs outputs #:allow-other-keys)
276 (let* ((out (assoc-ref %outputs "out"))
277 (bin (string-append out "/bin")))
278 (with-directory-excursion bin
279 (symlink "tcsh" "csh"))
280 #t))))))
281 (home-page "http://www.tcsh.org/")
282 (synopsis "Unix shell based on csh")
283 (description
284 "Tcsh is an enhanced, but completely compatible version of the Berkeley
285 UNIX C shell (csh). It is a command language interpreter usable both as an
286 interactive login shell and a shell script command processor. It includes a
287 command-line editor, programmable word completion, spelling correction, a
288 history mechanism, job control and a C-like syntax.")
289 (license bsd-4)))
290
291 (define-public zsh
292 (package
293 (name "zsh")
294 (version "5.4.2")
295 (source (origin
296 (method url-fetch)
297 (uri (list (string-append
298 "http://www.zsh.org/pub/zsh-" version
299 ".tar.gz")
300 (string-append
301 "http://www.zsh.org/pub/old/zsh-" version
302 ".tar.gz")))
303 (patches (search-patches "zsh-CVE-2018-7548.patch"
304 "zsh-CVE-2018-7549.patch"))
305 (sha256
306 (base32
307 "1jdcfinzmki2w963msvsanv29vqqfmdfm4rncwpw0r3zqnrcsywm"))))
308 (build-system gnu-build-system)
309 (arguments `(#:configure-flags '("--with-tcsetpgrp" "--enable-pcre")
310 #:phases
311 (modify-phases %standard-phases
312 (add-before 'configure 'fix-sh
313 (lambda _
314 ;; Some of the files are ISO-8859-1 encoded.
315 (with-fluids ((%default-port-encoding #f))
316 (substitute*
317 '("configure"
318 "configure.ac"
319 "Src/exec.c"
320 "Src/mkmakemod.sh"
321 "Config/installfns.sh"
322 "Config/defs.mk.in"
323 "Test/E01options.ztst"
324 "Test/A05execution.ztst"
325 "Test/A01grammar.ztst"
326 "Test/A06assign.ztst"
327 "Test/B02typeset.ztst"
328 "Completion/Unix/Command/_init_d"
329 "Util/preconfig")
330 (("/bin/sh") (which "sh"))))))
331 (add-before 'check 'patch-test
332 (lambda _
333 ;; In Zsh, `command -p` searches a predefined set of
334 ;; paths that don't exist in the build environment. See
335 ;; the assignment of 'path' in Src/init.c'
336 (substitute* "Test/A01grammar.ztst"
337 (("command -pv") "command -v")
338 (("command -p") "command ")
339 (("'command' -p") "'command' "))
340 #t)))))
341 (native-inputs `(("autoconf" ,autoconf)))
342 (inputs `(("ncurses" ,ncurses)
343 ("pcre" ,pcre)
344 ("perl" ,perl)))
345 (synopsis "Powerful shell for interactive use and scripting")
346 (description "The Z shell (zsh) is a Unix shell that can be used
347 as an interactive login shell and as a powerful command interpreter
348 for shell scripting. Zsh can be thought of as an extended Bourne shell
349 with a large number of improvements, including some features of bash,
350 ksh, and tcsh.")
351 (home-page "http://www.zsh.org/")
352
353 ;; The whole thing is under an MIT/X11-style license, but there's one
354 ;; command, 'Completion/Unix/Command/_darcs', which is under GPLv2+.
355 (license gpl2+)))
356
357 (define-public xonsh
358 (package
359 (name "xonsh")
360 (version "0.6.0")
361 (source
362 (origin
363 (method url-fetch)
364 (uri (pypi-uri "xonsh" version))
365 (sha256
366 (base32
367 "1ikd1xg4iyjqp51y8g8n6c4y39bgx85xnb4bdd3zibkqac3lrahr"))
368 (modules '((guix build utils)))
369 (snippet
370 `(begin
371 ;; Delete bundled ply.
372 (delete-file-recursively "xonsh/ply")
373 (substitute* '("setup.py")
374 (("'xonsh\\.ply\\.ply',") ""))
375 #t))))
376 (build-system python-build-system)
377 (arguments
378 '(;; TODO Try running run the test suite.
379 ;; See 'requirements-tests.txt' in the source distribution for more
380 ;; information.
381 #:tests? #f))
382 (inputs
383 `(("python-ply" ,python-ply)))
384 (home-page "http://xon.sh/")
385 (synopsis "Python-ish shell")
386 (description
387 "Xonsh is a Python-ish, BASHwards-looking shell language and command
388 prompt. The language is a superset of Python 3.4+ with additional shell
389 primitives that you are used to from Bash and IPython. It works on all major
390 systems including Linux, Mac OSX, and Windows. Xonsh is meant for the daily
391 use of experts and novices alike.")
392 (license bsd-2)))
393
394 (define-public scsh
395 (let ((commit "114432435e4eadd54334df6b37fcae505079b49f")
396 (revision "1"))
397 (package
398 (name "scsh")
399 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
400 (source
401 (origin
402 (method git-fetch)
403 (uri (git-reference
404 (url "https://github.com/scheme/scsh")
405 (commit commit)))
406 (file-name (string-append name "-" version "-checkout"))
407 (sha256
408 (base32
409 "1ghk08akiz7hff1pndi8rmgamgcrn2mv9asbss9l79d3c2iaav3q"))))
410 (build-system gnu-build-system)
411 (arguments
412 `(#:test-target "test"
413 #:phases
414 (modify-phases %standard-phases
415 (add-before 'configure 'replace-rx
416 (lambda* (#:key inputs #:allow-other-keys)
417 (let* ((rx (assoc-ref inputs "scheme48-rx"))
418 (rxpath (string-append rx "/share/scheme48-"
419 ,(package-version scheme48)
420 "/rx")))
421 (delete-file-recursively "rx")
422 (symlink rxpath "rx"))
423 #t))
424 (add-after 'unpack 'autoreconf
425 (lambda _
426 (zero? (system* "autoreconf")))))))
427 (inputs
428 `(("scheme48" ,scheme48)
429 ("scheme48-rx" ,scheme48-rx)))
430 (native-inputs
431 `(("autoconf" ,autoconf)
432 ("automake" ,automake)))
433 (home-page "https://github.com/scheme/scsh")
434 (synopsis "Unix shell embedded in Scheme")
435 (description
436 "Scsh is a Unix shell embedded in Scheme. Scsh has two main
437 components: a process notation for running programs and setting up pipelines
438 and redirections, and a complete syscall library for low-level access to the
439 operating system.")
440 (license bsd-3))))
441
442 (define-public linenoise
443 (let ((commit "2105ce445821381cf1bca87b6d386d4ea88ee20d")
444 (revision "1"))
445 (package
446 (name "linenoise")
447 (version (string-append "1.0-" revision "." (string-take commit 7)))
448 (source
449 (origin
450 (method git-fetch)
451 (uri (git-reference
452 (url "https://github.com/antirez/linenoise")
453 (commit commit)))
454 (file-name (string-append name "-" version "-checkout"))
455 (sha256
456 (base32
457 "1z16qwix8z6a40fskdgxsibkqgdrp4q6ncp4n6hnv4r9iihy2d8r"))))
458 (build-system gnu-build-system)
459 (arguments
460 `(#:tests? #f ;No tests are included
461 #:make-flags (list "CC=gcc")
462 #:phases
463 (modify-phases %standard-phases
464 (delete 'configure)
465 (replace 'install
466 (lambda* (#:key outputs #:allow-other-keys)
467 ;; At the moment there is no 'make install' in upstream.
468 (let* ((out (assoc-ref outputs "out")))
469 (install-file "linenoise.h"
470 (string-append out "/include/linenoise"))
471 (install-file "linenoise.c"
472 (string-append out "/include/linenoise"))
473 #t))))))
474 (home-page "https://github.com/antirez/linenoise")
475 (synopsis "Minimal zero-config readline replacement")
476 (description
477 "Linenoise is a minimal, zero-config, readline replacement.
478 Its features include:
479
480 @enumerate
481 @item Single and multi line editing mode with the usual key bindings
482 @item History handling
483 @item Completion
484 @item Hints (suggestions at the right of the prompt as you type)
485 @item A subset of VT100 escapes, ANSI.SYS compatible
486 @end enumerate\n")
487 (license bsd-2))))
488
489 (define-public s-shell
490 (let ((commit "da2e5c20c0c5f477ec3426dc2584889a789b1659")
491 (revision "2"))
492 (package
493 (name "s-shell")
494 (version (git-version "0.0.0" revision commit))
495 (source
496 (origin
497 (method git-fetch)
498 (uri (git-reference
499 (url "https://github.com/rain-1/s")
500 (commit commit)))
501 (file-name (string-append name "-" version "-checkout"))
502 (sha256
503 (base32
504 "0qiny71ww5nhzy4mnc8652hn0mlxyb67h333gbdxp4j4qxsi13q4"))))
505 (build-system gnu-build-system)
506 (inputs
507 `(("linenoise" ,linenoise)))
508 (arguments
509 `(#:tests? #f
510 #:make-flags (list "CC=gcc"
511 (string-append "PREFIX="
512 (assoc-ref %outputs "out")))
513 #:phases
514 (modify-phases %standard-phases
515 (add-after 'unpack 'install-directory-fix
516 (lambda* (#:key outputs #:allow-other-keys)
517 (let* ((out (assoc-ref outputs "out"))
518 (bin (string-append out "/bin")))
519 (substitute* "Makefile"
520 (("out") bin))
521 #t)))
522 (add-after 'install 'manpage
523 (lambda* (#:key outputs #:allow-other-keys)
524 (install-file "s.1" (string-append (assoc-ref outputs "out")
525 "/share/man/man1"))))
526 (replace 'configure
527 (lambda* (#:key inputs outputs #:allow-other-keys)
528 ;; At this point linenoise is meant to be included,
529 ;; so we have to really copy it into the working directory
530 ;; of s.
531 (let* ((linenoise (assoc-ref inputs "linenoise"))
532 (noisepath (string-append linenoise "/include/linenoise"))
533 (out (assoc-ref outputs "out")))
534 (copy-recursively noisepath "linenoise")
535 (substitute* "s.c"
536 (("/bin/s") (string-append out "/bin/s")))
537 #t))))))
538 (home-page "https://github.com/rain-1/s")
539 (synopsis "Extremely minimal shell with the simplest syntax possible")
540 (description
541 "S is a new shell that aims to be extremely simple.
542 S does not implemnt the POSIX shell standard.
543 There are no globs or \"splatting\" where a variable $FOO turns into multiple
544 command line arguments. One token stays one token forever.
545 This is a \"no surprises\" straightforward approach.
546
547 There are no redirection operators > in the shell language, they are added as
548 extra programs. > is just another unix command, < is essentially cat(1).
549 A @code{andglob} program is also provided along with s.")
550 (license bsd-3))))
551
552 (define-public oksh
553 (package
554 (name "oksh")
555 (version "0.5.9")
556 (source
557 (origin
558 (method url-fetch)
559 (uri (string-append "https://connochaetos.org/oksh/oksh-"
560 version ".tar.gz"))
561 (sha256
562 (base32
563 "0ln9yf6pxngsviqszv8klnnvn8vcpplvj1njdn8xr2y8frkbw8r3"))))
564 (build-system gnu-build-system)
565 (arguments
566 `(; The test files are not part of the distributed tarball.
567 #:tests? #f))
568 (home-page "https://connochaetos.org/oksh")
569 (synopsis "Port of OpenBSD Korn Shell")
570 (description
571 "Oksh is a port of the OpenBSD Korn Shell.
572 The OpenBSD Korn Shell is a cleaned up and enhanced ksh.")
573 (license gpl3+)))
574
575 (define-public loksh
576 (package
577 (name "loksh")
578 (version "6.2")
579 (source
580 (origin
581 (method url-fetch)
582 (uri (string-append "https://github.com/dimkr/loksh/archive/"
583 version ".tar.gz"))
584 (file-name (string-append name "-" version ".tar.gz"))
585 (sha256
586 (base32
587 "16mgxby77wgjg1ybp4fb9cvi7a4a387xmfivdxnhphg0vhyr8qd3"))))
588 (build-system gnu-build-system)
589 (inputs
590 `(("libbsd" ,libbsd)))
591 (native-inputs
592 `(("pkg-config" ,pkg-config)))
593 (arguments
594 `(#:tests? #f ;No tests included
595 #:make-flags (list "CC=gcc" "HAVE_LIBBSD=1"
596 (string-append "DESTDIR="
597 (assoc-ref %outputs "out"))
598 "PREFIX=")
599 #:phases
600 (modify-phases %standard-phases
601 (delete 'configure)))) ;No configure script
602 (home-page "https://github.com/dimkr/loksh")
603 (synopsis "Korn Shell from OpenBSD")
604 (description
605 "loksh is a Linux port of OpenBSD's @command{ksh}. It is a small,
606 interactive POSIX shell targeted at resource-constrained systems.")
607 ;; The file 'LEGAL' says it is the public domain, and the 2
608 ;; exceptions which are listed are not included in this port.
609 (license public-domain)))
610
611 (define-public mksh
612 (package
613 (name "mksh")
614 (version "56")
615 (source
616 (origin
617 (method url-fetch)
618 (uri (string-append "https://www.mirbsd.org/MirOS/dist/mir/mksh/mksh-R"
619 version ".tgz"))
620 (sha256
621 (base32
622 "1x4zjj9259ijpf8jw0nyh1fnr1pbm5fwvylclpvcrlb45xrglf5d"))))
623 (build-system gnu-build-system)
624 (arguments
625 `(#:tests? #f ; tests require access to /dev/tty
626 #:phases
627 (modify-phases %standard-phases
628 (delete 'configure)
629 (replace 'build
630 (lambda _
631 (setenv "CC" "gcc")
632 (zero? (system* (which "sh") "Build.sh"))))
633 (replace 'install
634 (lambda* (#:key outputs #:allow-other-keys)
635 (let* ((out (assoc-ref outputs "out"))
636 (bin (string-append out "/bin"))
637 (man (string-append out "/share/man/man1")))
638 (install-file "mksh" bin)
639 (with-directory-excursion bin
640 (symlink "mksh" "ksh"))
641 (install-file "mksh.1" man)))))))
642 (home-page "https://www.mirbsd.org/mksh.htm")
643 (synopsis "Korn Shell from MirBSD")
644 (description "mksh is an actively developed free implementation of the
645 Korn Shell programming language and a successor to the Public Domain Korn
646 Shell (pdksh).")
647 (license (list miros
648 isc)))) ; strlcpy.c
649
650 (define-public oil-shell
651 (package
652 (name "oil-shell")
653 (version "0.4.0")
654 (source (origin
655 (method url-fetch)
656 (uri (string-append "https://www.oilshell.org/download/oil-"
657 version ".tar.xz"))
658 (sha256
659 (base32
660 "0ca68n46mhibarpfinqfkim6p3xmbz5rrpl4qr3sj9y0q6wm7sa2"))))
661 (build-system gnu-build-system)
662 (arguments
663 '(#:tests? #f ; the tests are not distributed in the tarballs
664 #:strip-binaries? #f ; the binaries cannot be stripped
665 #:phases
666 (modify-phases %standard-phases
667 (add-after 'unpack 'patch-compiler-invocation
668 (lambda _
669 (substitute* "configure"
670 ((" cc ") " gcc "))
671 #t))
672 (replace 'configure
673 (lambda* (#:key outputs #:allow-other-keys)
674 (let ((out (assoc-ref outputs "out")))
675 (setenv "CC" "gcc")
676 ;; The configure script doesn't recognize CONFIG_SHELL.
677 (setenv "CONFIG_SHELL" (which "sh"))
678 (invoke "./configure" (string-append "--prefix=" out)
679 "--with-readline"))))
680 (add-before 'install 'make-destination
681 (lambda _
682 ;; The build scripts don't create the destination directory.
683 (mkdir-p (string-append (assoc-ref %outputs "out") "/bin")))))))
684 (inputs
685 `(("readline" ,readline)))
686 (synopsis "Bash-compatible Unix shell")
687 (description "Oil is a Unix / POSIX shell, compatible with Bash. It
688 implements the Oil language, which is a new shell language to which Bash can be
689 automatically translated. The Oil language is a superset of Bash. It also
690 implements the OSH language, a statically-parseable language based on Bash as it
691 is commonly written.")
692 (home-page "https://www.oilshell.org/")
693 (license (list psfl ; The Oil sources include a patched Python 2 source tree
694 asl2.0))))