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