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