Merge branch 'master' into core-updates
[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 '(begin
107 (substitute* "Makefile.in"
108 ((".*INSTALL.*sysconfdir.*fish.*") ""))
109 #t))))
110 (build-system gnu-build-system)
111 (native-inputs
112 `(("doxygen" ,doxygen)))
113 (inputs
114 `(("bc" ,bc)
115 ("ncurses" ,ncurses)
116 ("groff" ,groff) ;for 'fish --help'
117 ("pcre2" ,pcre2) ;don't use the bundled PCRE2
118 ("python" ,python-wrapper))) ;for fish_config and manpage completions
119 (arguments
120 '(#:tests? #f ; no check target
121 #:configure-flags '("--sysconfdir=/etc")
122 #:phases
123 (modify-phases %standard-phases
124 ;; Embed absolute paths to store items.
125 (add-after 'unpack 'embed-store-paths
126 (lambda* (#:key inputs outputs #:allow-other-keys)
127 (substitute* '("share/functions/math.fish"
128 "share/functions/seq.fish")
129 (("\\| bc")
130 (string-append "| " (assoc-ref %build-inputs "bc")
131 "/bin/bc")))
132 (substitute* "share/functions/fish_update_completions.fish"
133 (("python") (which "python")))
134 (substitute* "share/functions/__fish_print_help.fish"
135 (("nroff") (which "nroff")))
136 #t)))))
137 (synopsis "The friendly interactive shell")
138 (description
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 @command{help} command gives
144 access to all the fish documentation in your web browser. Other features
145 include smart terminal handling based on terminfo, an easy to search history,
146 and syntax highlighting.")
147 (home-page "https://fishshell.com/")
148 (license gpl2)))
149
150 (define-public rc
151 (package
152 (name "rc")
153 (version "1.7.4")
154 (source (origin
155 (method git-fetch)
156 (uri (git-reference
157 (url "https://github.com/rakitzis/rc.git")
158 ;; commit name 'release: rc-1.7.4'
159 (commit "c884da53a7c885d46ace2b92de78946855b18e92")))
160 (sha256
161 (base32
162 "00mgzvrrh9w96xa85g4gjbsvq02f08k4jwjcdnxq7kyh5xgiw95l"))
163 (file-name (string-append name "-" version "-checkout"))))
164 (build-system gnu-build-system)
165 (arguments
166 `(#:configure-flags
167 '("--with-edit=gnu")
168 #:phases
169 (modify-phases %standard-phases
170 (add-after
171 'unpack 'autoreconf
172 (lambda _ (zero? (system* "autoreconf" "-vfi"))))
173 (add-before
174 'autoreconf 'patch-trip.rc
175 (lambda _
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")) ")")))
181 #t)))))
182 (inputs `(("readline" ,readline)
183 ("perl" ,perl)))
184 (native-inputs `(("autoconf" ,autoconf)
185 ("automake" ,automake)
186 ("libtool" ,libtool)
187 ("pkg-config" ,pkg-config)))
188 (synopsis "Alternative implementation of the rc shell by Byron Rakitzis")
189 (description
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 "https://github.com/rakitzis/rc")
193 (license zlib)))
194
195 (define-public es
196 (package
197 (name "es")
198 (version "0.9.1")
199 (source
200 (origin
201 (method url-fetch)
202 (uri (string-append "https://github.com/wryun/es-shell/releases/"
203 "download/v" version "/es-" version ".tar.gz"))
204 (sha256
205 (base32
206 "1fplzxc6lncz2lv2fyr2ig23rgg5j96rm2bbl1rs28mik771zd5h"))
207 (file-name (string-append name "-" version ".tar.gz"))))
208 (build-system gnu-build-system)
209 (arguments
210 `(#:test-target "test"
211 #:phases
212 (modify-phases %standard-phases
213 (add-before 'configure 're-enter-rootdir
214 ;; The tarball has no folder.
215 (lambda _
216 (chdir ".."))))))
217 (inputs
218 `(("readline" ,readline)))
219 (native-inputs
220 `(("bison" ,bison)))
221 (synopsis "Extensible shell with higher-order functions")
222 (description
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)))
230
231 (define-public tcsh
232 (package
233 (name "tcsh")
234 (version "6.20.00")
235 (source (origin
236 (method url-fetch)
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")))
242 (sha256
243 (base32
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)
249 (native-inputs
250 `(("autoconf" ,autoconf)
251 ("perl" ,perl)))
252 (inputs
253 `(("ncurses" ,ncurses)))
254 (arguments
255 `(#:phases
256 (modify-phases %standard-phases
257 (add-before 'check 'patch-test-scripts
258 (lambda _
259 ;; Take care of pwd
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 (invoke "make" "tests/testsuite")
269
270 ;; This file is ISO-8859-1 encoded.
271 (with-fluids ((%default-port-encoding #f))
272 (substitute* "tests/testsuite"
273 (("/bin/sh") (which "sh"))))
274 #t))
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"))
281 #t))))))
282 (home-page "http://www.tcsh.org/")
283 (synopsis "Unix shell based on csh")
284 (description
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.")
290 (license bsd-4)))
291
292 (define-public zsh
293 (package
294 (name "zsh")
295 (version "5.5.1")
296 (source (origin
297 (method url-fetch)
298 (uri (list (string-append
299 "http://www.zsh.org/pub/zsh-" version
300 ".tar.xz")
301 (string-append
302 "http://www.zsh.org/pub/old/zsh-" version
303 ".tar.xz")))
304 (sha256
305 (base32
306 "105aqkdfsdxc4531anrj2zis2ywz6icagjam9lsc235yzh48ihz1"))))
307 (build-system gnu-build-system)
308 (arguments `(#:configure-flags '("--with-tcsetpgrp" "--enable-pcre")
309 #:phases
310 (modify-phases %standard-phases
311 (add-before 'configure 'fix-sh
312 (lambda _
313 ;; Some of the files are ISO-8859-1 encoded.
314 (with-fluids ((%default-port-encoding #f))
315 (substitute*
316 '("configure"
317 "configure.ac"
318 "Src/exec.c"
319 "Src/mkmakemod.sh"
320 "Config/installfns.sh"
321 "Config/defs.mk.in"
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"
328 "Util/preconfig")
329 (("/bin/sh") (which "sh"))))))
330 (add-before 'check 'patch-test
331 (lambda _
332 ;; In Zsh, `command -p` searches a predefined set of
333 ;; paths that don't exist in the build environment. See
334 ;; the assignment of 'path' in Src/init.c'
335 (substitute* "Test/A01grammar.ztst"
336 (("command -pv") "command -v")
337 (("command -p") "command ")
338 (("'command' -p") "'command' "))
339 #t)))))
340 (native-inputs `(("autoconf" ,autoconf)))
341 (inputs `(("ncurses" ,ncurses)
342 ("pcre" ,pcre)
343 ("perl" ,perl)))
344 (synopsis "Powerful shell for interactive use and scripting")
345 (description "The Z shell (zsh) is a Unix shell that can be used
346 as an interactive login shell and as a powerful command interpreter
347 for shell scripting. Zsh can be thought of as an extended Bourne shell
348 with a large number of improvements, including some features of bash,
349 ksh, and tcsh.")
350 (home-page "http://www.zsh.org/")
351
352 ;; The whole thing is under an MIT/X11-style license, but there's one
353 ;; command, 'Completion/Unix/Command/_darcs', which is under GPLv2+.
354 (license gpl2+)))
355
356 (define-public xonsh
357 (package
358 (name "xonsh")
359 (version "0.6.1")
360 (source
361 (origin
362 (method url-fetch)
363 (uri (pypi-uri "xonsh" version))
364 (sha256
365 (base32
366 "09rrfcwpirbxmjjqnsbyn7lwm1wyn41z5zhkbnv57i5hcgs72kx6"))
367 (modules '((guix build utils)))
368 (snippet
369 `(begin
370 ;; Delete bundled ply.
371 (delete-file-recursively "xonsh/ply")
372 (substitute* '("setup.py")
373 (("'xonsh\\.ply\\.ply',") ""))
374 #t))))
375 (build-system python-build-system)
376 (arguments
377 '(;; TODO Try running run the test suite.
378 ;; See 'requirements-tests.txt' in the source distribution for more
379 ;; information.
380 #:tests? #f))
381 (inputs
382 `(("python-ply" ,python-ply)))
383 (home-page "http://xon.sh/")
384 (synopsis "Python-ish shell")
385 (description
386 "Xonsh is a Python-ish, BASHwards-looking shell language and command
387 prompt. The language is a superset of Python 3.4+ with additional shell
388 primitives that you are used to from Bash and IPython. It works on all major
389 systems including Linux, Mac OSX, and Windows. Xonsh is meant for the daily
390 use of experts and novices alike.")
391 (license bsd-2)))
392
393 (define-public scsh
394 (let ((commit "114432435e4eadd54334df6b37fcae505079b49f")
395 (revision "1"))
396 (package
397 (name "scsh")
398 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
399 (source
400 (origin
401 (method git-fetch)
402 (uri (git-reference
403 (url "https://github.com/scheme/scsh")
404 (commit commit)))
405 (file-name (string-append name "-" version "-checkout"))
406 (sha256
407 (base32
408 "1ghk08akiz7hff1pndi8rmgamgcrn2mv9asbss9l79d3c2iaav3q"))))
409 (build-system gnu-build-system)
410 (arguments
411 `(#:test-target "test"
412 #:phases
413 (modify-phases %standard-phases
414 (add-before 'configure 'replace-rx
415 (lambda* (#:key inputs #:allow-other-keys)
416 (let* ((rx (assoc-ref inputs "scheme48-rx"))
417 (rxpath (string-append rx "/share/scheme48-"
418 ,(package-version scheme48)
419 "/rx")))
420 (delete-file-recursively "rx")
421 (symlink rxpath "rx"))
422 #t))
423 (add-after 'unpack 'autoreconf
424 (lambda _
425 (zero? (system* "autoreconf")))))))
426 (inputs
427 `(("scheme48" ,scheme48)
428 ("scheme48-rx" ,scheme48-rx)))
429 (native-inputs
430 `(("autoconf" ,autoconf)
431 ("automake" ,automake)))
432 (home-page "https://github.com/scheme/scsh")
433 (synopsis "Unix shell embedded in Scheme")
434 (description
435 "Scsh is a Unix shell embedded in Scheme. Scsh has two main
436 components: a process notation for running programs and setting up pipelines
437 and redirections, and a complete syscall library for low-level access to the
438 operating system.")
439 (license bsd-3))))
440
441 (define-public linenoise
442 (let ((commit "2105ce445821381cf1bca87b6d386d4ea88ee20d")
443 (revision "1"))
444 (package
445 (name "linenoise")
446 (version (string-append "1.0-" revision "." (string-take commit 7)))
447 (source
448 (origin
449 (method git-fetch)
450 (uri (git-reference
451 (url "https://github.com/antirez/linenoise")
452 (commit commit)))
453 (file-name (string-append name "-" version "-checkout"))
454 (sha256
455 (base32
456 "1z16qwix8z6a40fskdgxsibkqgdrp4q6ncp4n6hnv4r9iihy2d8r"))))
457 (build-system gnu-build-system)
458 (arguments
459 `(#:tests? #f ;No tests are included
460 #:make-flags (list "CC=gcc")
461 #:phases
462 (modify-phases %standard-phases
463 (delete 'configure)
464 (replace 'install
465 (lambda* (#:key outputs #:allow-other-keys)
466 ;; At the moment there is no 'make install' in upstream.
467 (let* ((out (assoc-ref outputs "out")))
468 (install-file "linenoise.h"
469 (string-append out "/include/linenoise"))
470 (install-file "linenoise.c"
471 (string-append out "/include/linenoise"))
472 #t))))))
473 (home-page "https://github.com/antirez/linenoise")
474 (synopsis "Minimal zero-config readline replacement")
475 (description
476 "Linenoise is a minimal, zero-config, readline replacement.
477 Its features include:
478
479 @enumerate
480 @item Single and multi line editing mode with the usual key bindings
481 @item History handling
482 @item Completion
483 @item Hints (suggestions at the right of the prompt as you type)
484 @item A subset of VT100 escapes, ANSI.SYS compatible
485 @end enumerate\n")
486 (license bsd-2))))
487
488 (define-public s-shell
489 (let ((commit "da2e5c20c0c5f477ec3426dc2584889a789b1659")
490 (revision "2"))
491 (package
492 (name "s-shell")
493 (version (git-version "0.0.0" revision commit))
494 (source
495 (origin
496 (method git-fetch)
497 (uri (git-reference
498 (url "https://github.com/rain-1/s")
499 (commit commit)))
500 (file-name (string-append name "-" version "-checkout"))
501 (sha256
502 (base32
503 "0qiny71ww5nhzy4mnc8652hn0mlxyb67h333gbdxp4j4qxsi13q4"))))
504 (build-system gnu-build-system)
505 (inputs
506 `(("linenoise" ,linenoise)))
507 (arguments
508 `(#:tests? #f
509 #:make-flags (list "CC=gcc"
510 (string-append "PREFIX="
511 (assoc-ref %outputs "out")))
512 #:phases
513 (modify-phases %standard-phases
514 (add-after 'unpack 'install-directory-fix
515 (lambda* (#:key outputs #:allow-other-keys)
516 (let* ((out (assoc-ref outputs "out"))
517 (bin (string-append out "/bin")))
518 (substitute* "Makefile"
519 (("out") bin))
520 #t)))
521 (add-after 'install 'manpage
522 (lambda* (#:key outputs #:allow-other-keys)
523 (install-file "s.1" (string-append (assoc-ref outputs "out")
524 "/share/man/man1"))))
525 (replace 'configure
526 (lambda* (#:key inputs outputs #:allow-other-keys)
527 ;; At this point linenoise is meant to be included,
528 ;; so we have to really copy it into the working directory
529 ;; of s.
530 (let* ((linenoise (assoc-ref inputs "linenoise"))
531 (noisepath (string-append linenoise "/include/linenoise"))
532 (out (assoc-ref outputs "out")))
533 (copy-recursively noisepath "linenoise")
534 (substitute* "s.c"
535 (("/bin/s") (string-append out "/bin/s")))
536 #t))))))
537 (home-page "https://github.com/rain-1/s")
538 (synopsis "Extremely minimal shell with the simplest syntax possible")
539 (description
540 "S is a new shell that aims to be extremely simple.
541 S does not implemnt the POSIX shell standard.
542 There are no globs or \"splatting\" where a variable $FOO turns into multiple
543 command line arguments. One token stays one token forever.
544 This is a \"no surprises\" straightforward approach.
545
546 There are no redirection operators > in the shell language, they are added as
547 extra programs. > is just another unix command, < is essentially cat(1).
548 A @code{andglob} program is also provided along with s.")
549 (license bsd-3))))
550
551 (define-public oksh
552 (package
553 (name "oksh")
554 (version "0.5.9")
555 (source
556 (origin
557 (method url-fetch)
558 (uri (string-append "https://connochaetos.org/oksh/oksh-"
559 version ".tar.gz"))
560 (sha256
561 (base32
562 "0ln9yf6pxngsviqszv8klnnvn8vcpplvj1njdn8xr2y8frkbw8r3"))))
563 (build-system gnu-build-system)
564 (arguments
565 `(; The test files are not part of the distributed tarball.
566 #:tests? #f))
567 (home-page "https://connochaetos.org/oksh")
568 (synopsis "Port of OpenBSD Korn Shell")
569 (description
570 "Oksh is a port of the OpenBSD Korn Shell.
571 The OpenBSD Korn Shell is a cleaned up and enhanced ksh.")
572 (license gpl3+)))
573
574 (define-public loksh
575 (package
576 (name "loksh")
577 (version "6.3")
578 (source
579 (origin
580 (method url-fetch)
581 (uri (string-append "https://github.com/dimkr/loksh/archive/"
582 version ".tar.gz"))
583 (file-name (string-append name "-" version ".tar.gz"))
584 (sha256
585 (base32
586 "0i1b60g1p19s5cnzz0nmjzjnxywm9szzyp1rcwfcx3gmzvrwr2sc"))))
587 (build-system gnu-build-system)
588 (inputs
589 `(("libbsd" ,libbsd)))
590 (native-inputs
591 `(("pkg-config" ,pkg-config)))
592 (arguments
593 `(#:tests? #f ;No tests included
594 #:make-flags (list "CC=gcc" "HAVE_LIBBSD=1"
595 (string-append "DESTDIR="
596 (assoc-ref %outputs "out"))
597 "PREFIX=")
598 #:phases
599 (modify-phases %standard-phases
600 (delete 'configure)))) ;No configure script
601 (home-page "https://github.com/dimkr/loksh")
602 (synopsis "Korn Shell from OpenBSD")
603 (description
604 "loksh is a Linux port of OpenBSD's @command{ksh}. It is a small,
605 interactive POSIX shell targeted at resource-constrained systems.")
606 ;; The file 'LEGAL' says it is the public domain, and the 2
607 ;; exceptions which are listed are not included in this port.
608 (license public-domain)))
609
610 (define-public mksh
611 (package
612 (name "mksh")
613 (version "56")
614 (source
615 (origin
616 (method url-fetch)
617 (uri (string-append "https://www.mirbsd.org/MirOS/dist/mir/mksh/mksh-R"
618 version ".tgz"))
619 (sha256
620 (base32
621 "1x4zjj9259ijpf8jw0nyh1fnr1pbm5fwvylclpvcrlb45xrglf5d"))))
622 (build-system gnu-build-system)
623 (arguments
624 `(#:tests? #f ; tests require access to /dev/tty
625 #:phases
626 (modify-phases %standard-phases
627 (delete 'configure)
628 (replace 'build
629 (lambda _
630 (setenv "CC" "gcc")
631 (zero? (system* (which "sh") "Build.sh"))))
632 (replace 'install
633 (lambda* (#:key outputs #:allow-other-keys)
634 (let* ((out (assoc-ref outputs "out"))
635 (bin (string-append out "/bin"))
636 (man (string-append out "/share/man/man1")))
637 (install-file "mksh" bin)
638 (with-directory-excursion bin
639 (symlink "mksh" "ksh"))
640 (install-file "mksh.1" man)))))))
641 (home-page "https://www.mirbsd.org/mksh.htm")
642 (synopsis "Korn Shell from MirBSD")
643 (description "mksh is an actively developed free implementation of the
644 Korn Shell programming language and a successor to the Public Domain Korn
645 Shell (pdksh).")
646 (license (list miros
647 isc)))) ; strlcpy.c
648
649 (define-public oil-shell
650 (package
651 (name "oil-shell")
652 (version "0.4.0")
653 (source (origin
654 (method url-fetch)
655 (uri (string-append "https://www.oilshell.org/download/oil-"
656 version ".tar.xz"))
657 (sha256
658 (base32
659 "0ca68n46mhibarpfinqfkim6p3xmbz5rrpl4qr3sj9y0q6wm7sa2"))))
660 (build-system gnu-build-system)
661 (arguments
662 '(#:tests? #f ; the tests are not distributed in the tarballs
663 #:strip-binaries? #f ; the binaries cannot be stripped
664 #:phases
665 (modify-phases %standard-phases
666 (add-after 'unpack 'patch-compiler-invocation
667 (lambda _
668 (substitute* "configure"
669 ((" cc ") " gcc "))
670 #t))
671 (replace 'configure
672 (lambda* (#:key outputs #:allow-other-keys)
673 (let ((out (assoc-ref outputs "out")))
674 (setenv "CC" "gcc")
675 ;; The configure script doesn't recognize CONFIG_SHELL.
676 (setenv "CONFIG_SHELL" (which "sh"))
677 (invoke "./configure" (string-append "--prefix=" out)
678 "--with-readline"))))
679 (add-before 'install 'make-destination
680 (lambda _
681 ;; The build scripts don't create the destination directory.
682 (mkdir-p (string-append (assoc-ref %outputs "out") "/bin")))))))
683 (inputs
684 `(("readline" ,readline)))
685 (synopsis "Bash-compatible Unix shell")
686 (description "Oil is a Unix / POSIX shell, compatible with Bash. It
687 implements the Oil language, which is a new shell language to which Bash can be
688 automatically translated. The Oil language is a superset of Bash. It also
689 implements the OSH language, a statically-parseable language based on Bash as it
690 is commonly written.")
691 (home-page "https://www.oilshell.org/")
692 (license (list psfl ; The Oil sources include a patched Python 2 source tree
693 asl2.0))))