build-system/r: Update to Bioconductor 3.7.
[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.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
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.5.1")
295 (source (origin
296 (method url-fetch)
297 (uri (list (string-append
298 "http://www.zsh.org/pub/zsh-" version
299 ".tar.xz")
300 (string-append
301 "http://www.zsh.org/pub/old/zsh-" version
302 ".tar.xz")))
303 (sha256
304 (base32
305 "105aqkdfsdxc4531anrj2zis2ywz6icagjam9lsc235yzh48ihz1"))))
306 (build-system gnu-build-system)
307 (arguments `(#:configure-flags '("--with-tcsetpgrp" "--enable-pcre")
308 #:phases
309 (modify-phases %standard-phases
310 (add-before 'configure 'fix-sh
311 (lambda _
312 ;; Some of the files are ISO-8859-1 encoded.
313 (with-fluids ((%default-port-encoding #f))
314 (substitute*
315 '("configure"
316 "configure.ac"
317 "Src/exec.c"
318 "Src/mkmakemod.sh"
319 "Config/installfns.sh"
320 "Config/defs.mk.in"
321 "Test/E01options.ztst"
322 "Test/A05execution.ztst"
323 "Test/A01grammar.ztst"
324 "Test/A06assign.ztst"
325 "Test/B02typeset.ztst"
326 "Completion/Unix/Command/_init_d"
327 "Util/preconfig")
328 (("/bin/sh") (which "sh"))))))
329 (add-before 'check 'patch-test
330 (lambda _
331 ;; In Zsh, `command -p` searches a predefined set of
332 ;; paths that don't exist in the build environment. See
333 ;; the assignment of 'path' in Src/init.c'
334 (substitute* "Test/A01grammar.ztst"
335 (("command -pv") "command -v")
336 (("command -p") "command ")
337 (("'command' -p") "'command' "))
338 #t)))))
339 (native-inputs `(("autoconf" ,autoconf)))
340 (inputs `(("ncurses" ,ncurses)
341 ("pcre" ,pcre)
342 ("perl" ,perl)))
343 (synopsis "Powerful shell for interactive use and scripting")
344 (description "The Z shell (zsh) is a Unix shell that can be used
345 as an interactive login shell and as a powerful command interpreter
346 for shell scripting. Zsh can be thought of as an extended Bourne shell
347 with a large number of improvements, including some features of bash,
348 ksh, and tcsh.")
349 (home-page "http://www.zsh.org/")
350
351 ;; The whole thing is under an MIT/X11-style license, but there's one
352 ;; command, 'Completion/Unix/Command/_darcs', which is under GPLv2+.
353 (license gpl2+)))
354
355 (define-public xonsh
356 (package
357 (name "xonsh")
358 (version "0.6.2")
359 (source
360 (origin
361 (method url-fetch)
362 (uri (pypi-uri "xonsh" version))
363 (sha256
364 (base32
365 "0c2bbmdg0n10q54vq9k1z5n53l0mh1hb1q5xprfhilvrbr6hlcwr"))
366 (modules '((guix build utils)))
367 (snippet
368 `(begin
369 ;; Delete bundled ply.
370 (delete-file-recursively "xonsh/ply")
371 (substitute* '("setup.py")
372 (("'xonsh\\.ply\\.ply',") ""))
373 #t))))
374 (build-system python-build-system)
375 (arguments
376 '(;; TODO Try running run the test suite.
377 ;; See 'requirements-tests.txt' in the source distribution for more
378 ;; information.
379 #:tests? #f))
380 (inputs
381 `(("python-ply" ,python-ply)))
382 (home-page "http://xon.sh/")
383 (synopsis "Python-ish shell")
384 (description
385 "Xonsh is a Python-ish, BASHwards-looking shell language and command
386 prompt. The language is a superset of Python 3.4+ with additional shell
387 primitives that you are used to from Bash and IPython. It works on all major
388 systems including Linux, Mac OSX, and Windows. Xonsh is meant for the daily
389 use of experts and novices alike.")
390 (license bsd-2)))
391
392 (define-public scsh
393 (let ((commit "114432435e4eadd54334df6b37fcae505079b49f")
394 (revision "1"))
395 (package
396 (name "scsh")
397 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
398 (source
399 (origin
400 (method git-fetch)
401 (uri (git-reference
402 (url "https://github.com/scheme/scsh")
403 (commit commit)))
404 (file-name (string-append name "-" version "-checkout"))
405 (sha256
406 (base32
407 "1ghk08akiz7hff1pndi8rmgamgcrn2mv9asbss9l79d3c2iaav3q"))))
408 (build-system gnu-build-system)
409 (arguments
410 `(#:test-target "test"
411 #:phases
412 (modify-phases %standard-phases
413 (add-before 'configure 'replace-rx
414 (lambda* (#:key inputs #:allow-other-keys)
415 (let* ((rx (assoc-ref inputs "scheme48-rx"))
416 (rxpath (string-append rx "/share/scheme48-"
417 ,(package-version scheme48)
418 "/rx")))
419 (delete-file-recursively "rx")
420 (symlink rxpath "rx"))
421 #t))
422 (add-after 'unpack 'autoreconf
423 (lambda _
424 (zero? (system* "autoreconf")))))))
425 (inputs
426 `(("scheme48" ,scheme48)
427 ("scheme48-rx" ,scheme48-rx)))
428 (native-inputs
429 `(("autoconf" ,autoconf)
430 ("automake" ,automake)))
431 (home-page "https://github.com/scheme/scsh")
432 (synopsis "Unix shell embedded in Scheme")
433 (description
434 "Scsh is a Unix shell embedded in Scheme. Scsh has two main
435 components: a process notation for running programs and setting up pipelines
436 and redirections, and a complete syscall library for low-level access to the
437 operating system.")
438 (license bsd-3))))
439
440 (define-public linenoise
441 (let ((commit "2105ce445821381cf1bca87b6d386d4ea88ee20d")
442 (revision "1"))
443 (package
444 (name "linenoise")
445 (version (string-append "1.0-" revision "." (string-take commit 7)))
446 (source
447 (origin
448 (method git-fetch)
449 (uri (git-reference
450 (url "https://github.com/antirez/linenoise")
451 (commit commit)))
452 (file-name (string-append name "-" version "-checkout"))
453 (sha256
454 (base32
455 "1z16qwix8z6a40fskdgxsibkqgdrp4q6ncp4n6hnv4r9iihy2d8r"))))
456 (build-system gnu-build-system)
457 (arguments
458 `(#:tests? #f ;No tests are included
459 #:make-flags (list "CC=gcc")
460 #:phases
461 (modify-phases %standard-phases
462 (delete 'configure)
463 (replace 'install
464 (lambda* (#:key outputs #:allow-other-keys)
465 ;; At the moment there is no 'make install' in upstream.
466 (let* ((out (assoc-ref outputs "out")))
467 (install-file "linenoise.h"
468 (string-append out "/include/linenoise"))
469 (install-file "linenoise.c"
470 (string-append out "/include/linenoise"))
471 #t))))))
472 (home-page "https://github.com/antirez/linenoise")
473 (synopsis "Minimal zero-config readline replacement")
474 (description
475 "Linenoise is a minimal, zero-config, readline replacement.
476 Its features include:
477
478 @enumerate
479 @item Single and multi line editing mode with the usual key bindings
480 @item History handling
481 @item Completion
482 @item Hints (suggestions at the right of the prompt as you type)
483 @item A subset of VT100 escapes, ANSI.SYS compatible
484 @end enumerate\n")
485 (license bsd-2))))
486
487 (define-public s-shell
488 (let ((commit "da2e5c20c0c5f477ec3426dc2584889a789b1659")
489 (revision "2"))
490 (package
491 (name "s-shell")
492 (version (git-version "0.0.0" revision commit))
493 (source
494 (origin
495 (method git-fetch)
496 (uri (git-reference
497 (url "https://github.com/rain-1/s")
498 (commit commit)))
499 (file-name (string-append name "-" version "-checkout"))
500 (sha256
501 (base32
502 "0qiny71ww5nhzy4mnc8652hn0mlxyb67h333gbdxp4j4qxsi13q4"))))
503 (build-system gnu-build-system)
504 (inputs
505 `(("linenoise" ,linenoise)))
506 (arguments
507 `(#:tests? #f
508 #:make-flags (list "CC=gcc"
509 (string-append "PREFIX="
510 (assoc-ref %outputs "out")))
511 #:phases
512 (modify-phases %standard-phases
513 (add-after 'unpack 'install-directory-fix
514 (lambda* (#:key outputs #:allow-other-keys)
515 (let* ((out (assoc-ref outputs "out"))
516 (bin (string-append out "/bin")))
517 (substitute* "Makefile"
518 (("out") bin))
519 #t)))
520 (add-after 'install 'manpage
521 (lambda* (#:key outputs #:allow-other-keys)
522 (install-file "s.1" (string-append (assoc-ref outputs "out")
523 "/share/man/man1"))))
524 (replace 'configure
525 (lambda* (#:key inputs outputs #:allow-other-keys)
526 ;; At this point linenoise is meant to be included,
527 ;; so we have to really copy it into the working directory
528 ;; of s.
529 (let* ((linenoise (assoc-ref inputs "linenoise"))
530 (noisepath (string-append linenoise "/include/linenoise"))
531 (out (assoc-ref outputs "out")))
532 (copy-recursively noisepath "linenoise")
533 (substitute* "s.c"
534 (("/bin/s") (string-append out "/bin/s")))
535 #t))))))
536 (home-page "https://github.com/rain-1/s")
537 (synopsis "Extremely minimal shell with the simplest syntax possible")
538 (description
539 "S is a new shell that aims to be extremely simple.
540 S does not implemnt the POSIX shell standard.
541 There are no globs or \"splatting\" where a variable $FOO turns into multiple
542 command line arguments. One token stays one token forever.
543 This is a \"no surprises\" straightforward approach.
544
545 There are no redirection operators > in the shell language, they are added as
546 extra programs. > is just another unix command, < is essentially cat(1).
547 A @code{andglob} program is also provided along with s.")
548 (license bsd-3))))
549
550 (define-public oksh
551 (package
552 (name "oksh")
553 (version "0.5.9")
554 (source
555 (origin
556 (method url-fetch)
557 (uri (string-append "https://connochaetos.org/oksh/oksh-"
558 version ".tar.gz"))
559 (sha256
560 (base32
561 "0ln9yf6pxngsviqszv8klnnvn8vcpplvj1njdn8xr2y8frkbw8r3"))))
562 (build-system gnu-build-system)
563 (arguments
564 `(; The test files are not part of the distributed tarball.
565 #:tests? #f))
566 (home-page "https://connochaetos.org/oksh")
567 (synopsis "Port of OpenBSD Korn Shell")
568 (description
569 "Oksh is a port of the OpenBSD Korn Shell.
570 The OpenBSD Korn Shell is a cleaned up and enhanced ksh.")
571 (license gpl3+)))
572
573 (define-public loksh
574 (package
575 (name "loksh")
576 (version "6.3")
577 (source
578 (origin
579 (method url-fetch)
580 (uri (string-append "https://github.com/dimkr/loksh/archive/"
581 version ".tar.gz"))
582 (file-name (string-append name "-" version ".tar.gz"))
583 (sha256
584 (base32
585 "0i1b60g1p19s5cnzz0nmjzjnxywm9szzyp1rcwfcx3gmzvrwr2sc"))))
586 (build-system gnu-build-system)
587 (inputs
588 `(("libbsd" ,libbsd)))
589 (native-inputs
590 `(("pkg-config" ,pkg-config)))
591 (arguments
592 `(#:tests? #f ;No tests included
593 #:make-flags (list "CC=gcc" "HAVE_LIBBSD=1"
594 (string-append "DESTDIR="
595 (assoc-ref %outputs "out"))
596 "PREFIX=")
597 #:phases
598 (modify-phases %standard-phases
599 (delete 'configure)))) ;No configure script
600 (home-page "https://github.com/dimkr/loksh")
601 (synopsis "Korn Shell from OpenBSD")
602 (description
603 "loksh is a Linux port of OpenBSD's @command{ksh}. It is a small,
604 interactive POSIX shell targeted at resource-constrained systems.")
605 ;; The file 'LEGAL' says it is the public domain, and the 2
606 ;; exceptions which are listed are not included in this port.
607 (license public-domain)))
608
609 (define-public mksh
610 (package
611 (name "mksh")
612 (version "56")
613 (source
614 (origin
615 (method url-fetch)
616 (uri (string-append "https://www.mirbsd.org/MirOS/dist/mir/mksh/mksh-R"
617 version ".tgz"))
618 (sha256
619 (base32
620 "1x4zjj9259ijpf8jw0nyh1fnr1pbm5fwvylclpvcrlb45xrglf5d"))))
621 (build-system gnu-build-system)
622 (arguments
623 `(#:tests? #f ; tests require access to /dev/tty
624 #:phases
625 (modify-phases %standard-phases
626 (delete 'configure)
627 (replace 'build
628 (lambda _
629 (setenv "CC" "gcc")
630 (zero? (system* (which "sh") "Build.sh"))))
631 (replace 'install
632 (lambda* (#:key outputs #:allow-other-keys)
633 (let* ((out (assoc-ref outputs "out"))
634 (bin (string-append out "/bin"))
635 (man (string-append out "/share/man/man1")))
636 (install-file "mksh" bin)
637 (with-directory-excursion bin
638 (symlink "mksh" "ksh"))
639 (install-file "mksh.1" man)))))))
640 (home-page "https://www.mirbsd.org/mksh.htm")
641 (synopsis "Korn Shell from MirBSD")
642 (description "mksh is an actively developed free implementation of the
643 Korn Shell programming language and a successor to the Public Domain Korn
644 Shell (pdksh).")
645 (license (list miros
646 isc)))) ; strlcpy.c
647
648 (define-public oil-shell
649 (package
650 (name "oil-shell")
651 (version "0.4.0")
652 (source (origin
653 (method url-fetch)
654 (uri (string-append "https://www.oilshell.org/download/oil-"
655 version ".tar.xz"))
656 (sha256
657 (base32
658 "0ca68n46mhibarpfinqfkim6p3xmbz5rrpl4qr3sj9y0q6wm7sa2"))))
659 (build-system gnu-build-system)
660 (arguments
661 '(#:tests? #f ; the tests are not distributed in the tarballs
662 #:strip-binaries? #f ; the binaries cannot be stripped
663 #:phases
664 (modify-phases %standard-phases
665 (add-after 'unpack 'patch-compiler-invocation
666 (lambda _
667 (substitute* "configure"
668 ((" cc ") " gcc "))
669 #t))
670 (replace 'configure
671 (lambda* (#:key outputs #:allow-other-keys)
672 (let ((out (assoc-ref outputs "out")))
673 (setenv "CC" "gcc")
674 ;; The configure script doesn't recognize CONFIG_SHELL.
675 (setenv "CONFIG_SHELL" (which "sh"))
676 (invoke "./configure" (string-append "--prefix=" out)
677 "--with-readline"))))
678 (add-before 'install 'make-destination
679 (lambda _
680 ;; The build scripts don't create the destination directory.
681 (mkdir-p (string-append (assoc-ref %outputs "out") "/bin")))))))
682 (inputs
683 `(("readline" ,readline)))
684 (synopsis "Bash-compatible Unix shell")
685 (description "Oil is a Unix / POSIX shell, compatible with Bash. It
686 implements the Oil language, which is a new shell language to which Bash can be
687 automatically translated. The Oil language is a superset of Bash. It also
688 implements the OSH language, a statically-parseable language based on Bash as it
689 is commonly written.")
690 (home-page "https://www.oilshell.org/")
691 (license (list psfl ; The Oil sources include a patched Python 2 source tree
692 asl2.0))))