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, 2019, 2020 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 ng0 <ng0@n0.is>
10 ;;; Copyright © 2017, 2018 Leo Famulari <leo@famulari.name>
11 ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
12 ;;; Copyright © 2019 Meiyo Peng <meiyo.peng@gmail.com>
13 ;;; Copyright © 2019 Timothy Sample <samplet@ngyro.com>
14 ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
15 ;;; Copyright © 2019, 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
16 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
17 ;;;
18 ;;; This file is part of GNU Guix.
19 ;;;
20 ;;; GNU Guix is free software; you can redistribute it and/or modify it
21 ;;; under the terms of the GNU General Public License as published by
22 ;;; the Free Software Foundation; either version 3 of the License, or (at
23 ;;; your option) any later version.
24 ;;;
25 ;;; GNU Guix is distributed in the hope that it will be useful, but
26 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
27 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 ;;; GNU General Public License for more details.
29 ;;;
30 ;;; You should have received a copy of the GNU General Public License
31 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
32
33 (define-module (gnu packages shells)
34 #:use-module (gnu packages)
35 #:use-module (gnu packages autotools)
36 #:use-module (gnu packages base)
37 #:use-module (gnu packages bash)
38 #:use-module (gnu packages bison)
39 #:use-module (gnu packages documentation)
40 #:use-module (gnu packages groff)
41 #:use-module (gnu packages guile)
42 #:use-module (gnu packages libbsd)
43 #:use-module (gnu packages libedit)
44 #:use-module (gnu packages ncurses)
45 #:use-module (gnu packages pcre)
46 #:use-module (gnu packages perl)
47 #:use-module (gnu packages pkg-config)
48 #:use-module (gnu packages python)
49 #:use-module (gnu packages python-xyz)
50 #:use-module (gnu packages readline)
51 #:use-module (gnu packages scheme)
52 #:use-module (guix build-system gnu)
53 #:use-module (guix build-system python)
54 #:use-module (guix build-system trivial)
55 #:use-module (guix download)
56 #:use-module (guix git-download)
57 #:use-module (guix licenses)
58 #:use-module (guix packages))
59
60 (define-public dash
61 (package
62 (name "dash")
63 (version "0.5.10.2")
64 (source
65 (origin
66 (method url-fetch)
67 (uri (string-append "http://gondor.apana.org.au/~herbert/dash/files/"
68 "dash-" version ".tar.gz"))
69 (sha256
70 (base32
71 "0wb0bwmqc661hylqcfdp7l7x12myw3vpqk513ncyqrjwvhckjriw"))
72 (modules '((guix build utils)))
73 (snippet
74 '(begin
75 ;; The man page hails from BSD, where (d)ash is the default shell.
76 ;; This isn't the case on Guix or indeed most other GNU systems.
77 (substitute* "src/dash.1"
78 (("the standard command interpreter for the system")
79 "a command interpreter based on the original Bourne shell"))
80 #t))))
81 (build-system gnu-build-system)
82 (inputs
83 `(("libedit" ,libedit)))
84 (arguments
85 '(#:configure-flags '("--with-libedit")))
86 (home-page "http://gondor.apana.org.au/~herbert/dash")
87 (synopsis "POSIX-compliant shell optimised for size")
88 (description
89 "dash is a POSIX-compliant @command{/bin/sh} implementation that aims to be
90 as small as possible, often without sacrificing speed. It is faster than the
91 GNU Bourne-Again Shell (@command{bash}) at most scripted tasks. dash is a
92 direct descendant of NetBSD's Almquist Shell (@command{ash}).")
93 (license (list bsd-3
94 gpl2+)))) ; mksignames.c
95
96 (define-public fish
97 (package
98 (name "fish")
99 (version "3.0.2")
100 (source
101 (origin
102 (method url-fetch)
103 (uri (string-append "https://github.com/fish-shell/fish-shell/"
104 "releases/download/" version "/"
105 "fish-" version ".tar.gz"))
106 (sha256
107 (base32 "03j3jl9jzlnhq4p86zj8wqsh5sx45j1d1fvfa80ks1cfdg68qwhl"))))
108 (build-system gnu-build-system)
109 (inputs
110 `(("fish-foreign-env" ,fish-foreign-env)
111 ("groff" ,groff) ; for 'fish --help'
112 ("ncurses" ,ncurses)
113 ("pcre2" ,pcre2) ; don't use the bundled PCRE2
114 ("python" ,python))) ; for fish_config and manpage completions
115 (native-inputs
116 `(("doxygen" ,doxygen)))
117 (arguments
118 '(#:tests? #f ; no check target
119 #:phases
120 (modify-phases %standard-phases
121 (add-after 'unpack 'patch-source
122 (lambda _
123 (substitute* '("build_tools/build_commands_hdr.sh"
124 "build_tools/build_user_doc.sh")
125 (("/usr/bin/env") "env"))
126 #t))
127 ;; Embed absolute paths.
128 (add-before 'install 'embed-absolute-paths
129 (lambda _
130 (substitute* '("share/functions/__fish_config_interactive.fish"
131 "share/functions/fish_config.fish"
132 "share/functions/fish_update_completions.fish")
133 (("python3") (which "python3")))
134 (substitute* "share/functions/__fish_print_help.fish"
135 (("nroff") (which "nroff")))
136 #t))
137 ;; Source /etc/fish/config.fish from $__fish_sysconf_dir/config.fish.
138 (add-before 'install 'patch-fish-config
139 (lambda _
140 (let ((port (open-file "etc/config.fish" "a")))
141 (display (string-append
142 "\n\n"
143 "# Patched by Guix.\n"
144 "# Source /etc/fish/config.fish.\n"
145 "if test -f /etc/fish/config.fish\n"
146 " source /etc/fish/config.fish\n"
147 "end\n")
148 port)
149 (close-port port))
150 #t))
151 ;; Enable completions, functions and configurations in user's and
152 ;; system's guix profiles by adding them to __extra_* variables.
153 (add-before 'install 'patch-fish-extra-paths
154 (lambda _
155 (let ((port (open-file "share/__fish_build_paths.fish" "a")))
156 (display
157 (string-append
158 "\n\n"
159 "# Patched by Guix.\n"
160 "# Enable completions, functions and configurations in user's"
161 " and system's guix profiles by adding them to __extra_*"
162 " variables.\n"
163 "set -l __guix_profile_paths ~/.guix-profile"
164 " /run/current-system/profile\n"
165 "set __extra_completionsdir"
166 " $__guix_profile_paths\"/etc/fish/completions\""
167 " $__guix_profile_paths\"/share/fish/vendor_completions.d\""
168 " $__extra_completionsdir\n"
169 "set __extra_functionsdir"
170 " $__guix_profile_paths\"/etc/fish/functions\""
171 " $__guix_profile_paths\"/share/fish/vendor_functions.d\""
172 " $__extra_functionsdir\n"
173 "set __extra_confdir"
174 " $__guix_profile_paths\"/etc/fish/conf.d\""
175 " $__guix_profile_paths\"/share/fish/vendor_conf.d\""
176 " $__extra_confdir\n")
177 port)
178 (close-port port))
179 #t))
180 ;; Use fish-foreign-env to source /etc/profile.
181 (add-before 'install 'source-etc-profile
182 (lambda* (#:key inputs #:allow-other-keys)
183 (let ((port (open-file "share/__fish_build_paths.fish" "a")))
184 (display
185 (string-append
186 "\n\n"
187 "# Patched by Guix.\n"
188 "# Use fish-foreign-env to source /etc/profile.\n"
189 "if status is-login\n"
190 " set fish_function_path "
191 (assoc-ref inputs "fish-foreign-env") "/share/fish/functions"
192 " $__fish_datadir/functions\n"
193 " fenv source /etc/profile\n"
194 " set -e fish_function_path\n"
195 "end\n")
196 port)
197 (close-port port))
198 #t)))))
199 (synopsis "The friendly interactive shell")
200 (description
201 "Fish (friendly interactive shell) is a shell focused on interactive use,
202 discoverability, and friendliness. Fish has very user-friendly and powerful
203 tab-completion, including descriptions of every completion, completion of
204 strings with wildcards, and many completions for specific commands. It also
205 has extensive and discoverable help. A special @command{help} command gives
206 access to all the fish documentation in your web browser. Other features
207 include smart terminal handling based on terminfo, an easy to search history,
208 and syntax highlighting.")
209 (home-page "https://fishshell.com/")
210 (license gpl2)))
211
212 (define-public fish-foreign-env
213 (package
214 (name "fish-foreign-env")
215 (version "0.20190116")
216 (source
217 (origin
218 (method git-fetch)
219 (uri (git-reference
220 (url "https://github.com/oh-my-fish/plugin-foreign-env.git")
221 (commit "dddd9213272a0ab848d474d0cbde12ad034e65bc")))
222 (file-name (git-file-name name version))
223 (sha256
224 (base32 "00xqlyl3lffc5l0viin1nyp819wf81fncqyz87jx8ljjdhilmgbs"))))
225 (build-system trivial-build-system)
226 (arguments
227 '(#:modules ((guix build utils))
228 #:builder
229 (begin
230 (use-modules (guix build utils))
231 (let* ((source (assoc-ref %build-inputs "source"))
232 (out (assoc-ref %outputs "out"))
233 (func-path (string-append out "/share/fish/functions")))
234 (mkdir-p func-path)
235 (copy-recursively (string-append source "/functions")
236 func-path)
237
238 ;; Embed absolute paths.
239 (substitute* `(,(string-append func-path "/fenv.fish")
240 ,(string-append func-path "/fenv.apply.fish")
241 ,(string-append func-path "/fenv.main.fish"))
242 (("bash")
243 (string-append (assoc-ref %build-inputs "bash") "/bin/bash"))
244 (("sed")
245 (string-append (assoc-ref %build-inputs "sed") "/bin/sed"))
246 ((" tr ")
247 (string-append " " (assoc-ref %build-inputs "coreutils")
248 "/bin/tr ")))))))
249 (inputs
250 `(("bash" ,bash)
251 ("coreutils" ,coreutils)
252 ("sed" ,sed)))
253 (home-page "https://github.com/oh-my-fish/plugin-foreign-env")
254 (synopsis "Foreign environment interface for fish shell")
255 (description "@code{fish-foreign-env} wraps bash script execution in a way
256 that environment variables that are exported or modified get imported back
257 into fish.")
258 (license expat)))
259
260 (define-public rc
261 (package
262 (name "rc")
263 (version "1.7.4")
264 (source (origin
265 (method git-fetch)
266 (uri (git-reference
267 (url "https://github.com/rakitzis/rc.git")
268 (commit (string-append "v" version))))
269 (sha256
270 (base32
271 "0vj1h4pcg13vxsiydmmk87dr2sra9h4gwx0c4q6fjsiw4in78rrd"))
272 (file-name (git-file-name name version))))
273 (build-system gnu-build-system)
274 (arguments
275 `(#:configure-flags
276 '("--with-edit=gnu")
277 #:phases
278 (modify-phases %standard-phases
279 (add-before 'bootstrap 'patch-trip.rc
280 (lambda _
281 (substitute* "trip.rc"
282 (("/bin/pwd") (which "pwd"))
283 (("/bin/sh") (which "sh"))
284 (("/bin/rm") (which "rm"))
285 (("/bin\\)") (string-append (dirname (which "rm")) ")")))
286 #t)))))
287 (inputs `(("readline" ,readline)
288 ("perl" ,perl)))
289 (native-inputs `(("autoconf" ,autoconf)
290 ("automake" ,automake)
291 ("libtool" ,libtool)
292 ("pkg-config" ,pkg-config)))
293 (synopsis "Alternative implementation of the rc shell by Byron Rakitzis")
294 (description
295 "This is a reimplementation by Byron Rakitzis of the Plan 9 shell. It
296 has a small feature set similar to a traditional Bourne shell.")
297 (home-page "https://github.com/rakitzis/rc")
298 (license zlib)))
299
300 (define-public es
301 (package
302 (name "es")
303 (version "0.9.1")
304 (source
305 (origin
306 (method url-fetch)
307 (uri (string-append "https://github.com/wryun/es-shell/releases/"
308 "download/v" version "/es-" version ".tar.gz"))
309 (sha256
310 (base32
311 "1fplzxc6lncz2lv2fyr2ig23rgg5j96rm2bbl1rs28mik771zd5h"))
312 (file-name (string-append name "-" version ".tar.gz"))))
313 (build-system gnu-build-system)
314 (arguments
315 `(#:test-target "test"
316 #:phases
317 (modify-phases %standard-phases
318 (add-before 'configure 're-enter-rootdir
319 ;; The tarball has no folder.
320 (lambda _
321 (chdir ".."))))))
322 (inputs
323 `(("readline" ,readline)))
324 (native-inputs
325 `(("bison" ,bison)))
326 (synopsis "Extensible shell with higher-order functions")
327 (description
328 "Es is an extensible shell. The language was derived from the Plan 9
329 shell, rc, and was influenced by functional programming languages, such as
330 Scheme, and the Tcl embeddable programming language. This implementation is
331 derived from Byron Rakitzis's public domain implementation of rc, and was
332 written by Paul Haahr and Byron Rakitzis.")
333 (home-page "https://wryun.github.io/es-shell/")
334 (license public-domain)))
335
336 (define-public tcsh
337 (package
338 (name "tcsh")
339 (version "6.22.02")
340 (source (origin
341 (method url-fetch)
342 ;; Old tarballs are moved to old/.
343 (uri (list (string-append "ftp://ftp.astron.com/pub/tcsh/"
344 "tcsh-" version ".tar.gz")
345 (string-append "ftp://ftp.astron.com/pub/tcsh/"
346 "old/tcsh-" version ".tar.gz")))
347 (sha256
348 (base32
349 "0nw8prz1n0lmr82wnpyhrzmki630afn7p9cfgr3vl00vr9c72a7d"))
350 (patches (search-patches "tcsh-fix-autotest.patch"))
351 (patch-flags '("-p0"))))
352 (build-system gnu-build-system)
353 (native-inputs
354 `(("autoconf" ,autoconf)
355 ("perl" ,perl)))
356 (inputs
357 `(("ncurses" ,ncurses)))
358 (arguments
359 `(#:phases
360 (modify-phases %standard-phases
361 ,@(if (%current-target-system)
362 '((add-before 'configure 'set-cross-cc
363 (lambda _
364 (substitute* "configure"
365 (("CC_FOR_GETHOST=\"cc\"")
366 "CC_FOR_GETHOST=\"gcc\""))
367 #t)))
368 '())
369 (add-before 'check 'patch-test-scripts
370 (lambda _
371 ;; Take care of pwd
372 (substitute* '("tests/commands.at" "tests/variables.at")
373 (("/bin/pwd") (which "pwd")))
374 ;; The .at files create shell scripts without shebangs. Erk.
375 (substitute* "tests/commands.at"
376 (("./output.sh") "/bin/sh output.sh"))
377 (substitute* "tests/syntax.at"
378 (("; other_script.csh") "; /bin/sh other_script.csh"))
379 ;; Now, let's generate the test suite and patch it
380 (invoke "make" "tests/testsuite")
381
382 ;; This file is ISO-8859-1 encoded.
383 (with-fluids ((%default-port-encoding #f))
384 (substitute* "tests/testsuite"
385 (("/bin/sh") (which "sh"))))
386 #t))
387 (add-after 'install 'post-install
388 (lambda* (#:key inputs outputs #:allow-other-keys)
389 (let* ((out (assoc-ref %outputs "out"))
390 (bin (string-append out "/bin")))
391 (with-directory-excursion bin
392 (symlink "tcsh" "csh"))
393 #t))))))
394 (home-page "https://www.tcsh.org/")
395 (synopsis "Unix shell based on csh")
396 (description
397 "Tcsh is an enhanced, but completely compatible version of the Berkeley
398 UNIX C shell (csh). It is a command language interpreter usable both as an
399 interactive login shell and a shell script command processor. It includes a
400 command-line editor, programmable word completion, spelling correction, a
401 history mechanism, job control and a C-like syntax.")
402 (license bsd-4)))
403
404 (define-public zsh
405 (package
406 (name "zsh")
407 (version "5.8")
408 (source (origin
409 (method url-fetch)
410 (uri (list (string-append
411 "https://www.zsh.org/pub/zsh-" version
412 ".tar.xz")
413 (string-append
414 "https://www.zsh.org/pub/old/zsh-" version
415 ".tar.xz")))
416 (sha256
417 (base32
418 "09yyaadq738zlrnlh1hd3ycj1mv3q5hh4xl1ank70mjnqm6bbi6w"))))
419 (build-system gnu-build-system)
420 (arguments `(#:configure-flags '("--with-tcsetpgrp" "--enable-pcre"
421 "--enable-maildir-support")
422 #:phases
423 (modify-phases %standard-phases
424 (add-before 'configure 'fix-sh
425 (lambda _
426 ;; Some of the files are ISO-8859-1 encoded.
427 (with-fluids ((%default-port-encoding #f))
428 (substitute*
429 '("configure"
430 "configure.ac"
431 "Src/exec.c"
432 "Src/mkmakemod.sh"
433 "Config/installfns.sh"
434 "Config/defs.mk.in"
435 "Test/E01options.ztst"
436 "Test/A05execution.ztst"
437 "Test/A01grammar.ztst"
438 "Test/A06assign.ztst"
439 "Test/B02typeset.ztst"
440 "Completion/Unix/Command/_init_d"
441 "Util/preconfig")
442 (("/bin/sh") (which "sh"))))))
443 (add-before 'check 'patch-test
444 (lambda _
445 ;; In Zsh, `command -p` searches a predefined set of
446 ;; paths that don't exist in the build environment. See
447 ;; the assignment of 'path' in Src/init.c'
448 (substitute* "Test/A01grammar.ztst"
449 (("command -pv") "command -v")
450 (("command -p") "command ")
451 (("'command' -p") "'command' "))
452 #t)))))
453 (native-inputs `(("autoconf" ,autoconf)))
454 (inputs `(("ncurses" ,ncurses)
455 ("pcre" ,pcre)
456 ("perl" ,perl)))
457 (synopsis "Powerful shell for interactive use and scripting")
458 (description "The Z shell (zsh) is a Unix shell that can be used
459 as an interactive login shell and as a powerful command interpreter
460 for shell scripting. Zsh can be thought of as an extended Bourne shell
461 with a large number of improvements, including some features of bash,
462 ksh, and tcsh.")
463 (home-page "https://www.zsh.org/")
464
465 ;; The whole thing is under an MIT/X11-style license, but there's one
466 ;; command, 'Completion/Unix/Command/_darcs', which is under GPLv2+.
467 (license gpl2+)))
468
469 (define-public xonsh
470 (package
471 (name "xonsh")
472 (version "0.6.2")
473 (source
474 (origin
475 (method url-fetch)
476 (uri (pypi-uri "xonsh" version))
477 (sha256
478 (base32
479 "0c2bbmdg0n10q54vq9k1z5n53l0mh1hb1q5xprfhilvrbr6hlcwr"))
480 (modules '((guix build utils)))
481 (snippet
482 `(begin
483 ;; Delete bundled ply.
484 (delete-file-recursively "xonsh/ply")
485 (substitute* '("setup.py")
486 (("'xonsh\\.ply\\.ply',") ""))
487 #t))))
488 (build-system python-build-system)
489 (arguments
490 '(;; TODO Try running run the test suite.
491 ;; See 'requirements-tests.txt' in the source distribution for more
492 ;; information.
493 #:tests? #f))
494 (inputs
495 `(("python-ply" ,python-ply)))
496 (home-page "https://xon.sh/")
497 (synopsis "Python-ish shell")
498 (description
499 "Xonsh is a Python-ish, BASHwards-looking shell language and command
500 prompt. The language is a superset of Python 3.4+ with additional shell
501 primitives that you are used to from Bash and IPython. It works on all major
502 systems including Linux, Mac OSX, and Windows. Xonsh is meant for the daily
503 use of experts and novices alike.")
504 (license bsd-2)))
505
506 (define-public scsh
507 (let ((commit "114432435e4eadd54334df6b37fcae505079b49f")
508 (revision "1"))
509 (package
510 (name "scsh")
511 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
512 (source
513 (origin
514 (method git-fetch)
515 (uri (git-reference
516 (url "https://github.com/scheme/scsh")
517 (commit commit)))
518 (file-name (string-append name "-" version "-checkout"))
519 (sha256
520 (base32
521 "1ghk08akiz7hff1pndi8rmgamgcrn2mv9asbss9l79d3c2iaav3q"))))
522 (build-system gnu-build-system)
523 (arguments
524 `(#:test-target "test"
525 #:phases
526 (modify-phases %standard-phases
527 (add-before 'configure 'replace-rx
528 (lambda* (#:key inputs #:allow-other-keys)
529 (let* ((rx (assoc-ref inputs "scheme48-rx"))
530 (rxpath (string-append rx "/share/scheme48-"
531 ,(package-version scheme48)
532 "/rx")))
533 (delete-file-recursively "rx")
534 (symlink rxpath "rx"))
535 #t)))))
536 (inputs
537 `(("scheme48" ,scheme48)
538 ("scheme48-rx" ,scheme48-rx)))
539 (native-inputs
540 `(("autoconf" ,autoconf)
541 ("automake" ,automake)))
542 (home-page "https://github.com/scheme/scsh")
543 (synopsis "Unix shell embedded in Scheme")
544 (description
545 "Scsh is a Unix shell embedded in Scheme. Scsh has two main
546 components: a process notation for running programs and setting up pipelines
547 and redirections, and a complete syscall library for low-level access to the
548 operating system.")
549 (license bsd-3))))
550
551 (define-public linenoise
552 (let ((commit "2105ce445821381cf1bca87b6d386d4ea88ee20d")
553 (revision "1"))
554 (package
555 (name "linenoise")
556 (version (string-append "1.0-" revision "." (string-take commit 7)))
557 (source
558 (origin
559 (method git-fetch)
560 (uri (git-reference
561 (url "https://github.com/antirez/linenoise")
562 (commit commit)))
563 (file-name (string-append name "-" version "-checkout"))
564 (sha256
565 (base32
566 "1z16qwix8z6a40fskdgxsibkqgdrp4q6ncp4n6hnv4r9iihy2d8r"))))
567 (build-system gnu-build-system)
568 (arguments
569 `(#:tests? #f ;No tests are included
570 #:make-flags (list "CC=gcc")
571 #:phases
572 (modify-phases %standard-phases
573 (delete 'configure)
574 (replace 'install
575 (lambda* (#:key outputs #:allow-other-keys)
576 ;; At the moment there is no 'make install' in upstream.
577 (let* ((out (assoc-ref outputs "out")))
578 (install-file "linenoise.h"
579 (string-append out "/include/linenoise"))
580 (install-file "linenoise.c"
581 (string-append out "/include/linenoise"))
582 #t))))))
583 (home-page "https://github.com/antirez/linenoise")
584 (synopsis "Minimal zero-config readline replacement")
585 (description
586 "Linenoise is a minimal, zero-config, readline replacement.
587 Its features include:
588
589 @enumerate
590 @item Single and multi line editing mode with the usual key bindings
591 @item History handling
592 @item Completion
593 @item Hints (suggestions at the right of the prompt as you type)
594 @item A subset of VT100 escapes, ANSI.SYS compatible
595 @end enumerate\n")
596 (license bsd-2))))
597
598 (define-public s-shell
599 (let ((commit "da2e5c20c0c5f477ec3426dc2584889a789b1659")
600 (revision "2"))
601 (package
602 (name "s-shell")
603 (version (git-version "0.0.0" revision commit))
604 (source
605 (origin
606 (method git-fetch)
607 (uri (git-reference
608 (url "https://github.com/rain-1/s")
609 (commit commit)))
610 (file-name (string-append name "-" version "-checkout"))
611 (sha256
612 (base32
613 "0qiny71ww5nhzy4mnc8652hn0mlxyb67h333gbdxp4j4qxsi13q4"))))
614 (build-system gnu-build-system)
615 (inputs
616 `(("linenoise" ,linenoise)))
617 (arguments
618 `(#:tests? #f
619 #:make-flags (list "CC=gcc"
620 (string-append "PREFIX="
621 (assoc-ref %outputs "out")))
622 #:phases
623 (modify-phases %standard-phases
624 (add-after 'unpack 'install-directory-fix
625 (lambda* (#:key outputs #:allow-other-keys)
626 (let* ((out (assoc-ref outputs "out"))
627 (bin (string-append out "/bin")))
628 (substitute* "Makefile"
629 (("out") bin))
630 #t)))
631 (add-after 'install 'manpage
632 (lambda* (#:key outputs #:allow-other-keys)
633 (install-file "s.1" (string-append (assoc-ref outputs "out")
634 "/share/man/man1"))))
635 (replace 'configure
636 (lambda* (#:key inputs outputs #:allow-other-keys)
637 ;; At this point linenoise is meant to be included,
638 ;; so we have to really copy it into the working directory
639 ;; of s.
640 (let* ((linenoise (assoc-ref inputs "linenoise"))
641 (noisepath (string-append linenoise "/include/linenoise"))
642 (out (assoc-ref outputs "out")))
643 (copy-recursively noisepath "linenoise")
644 (substitute* "s.c"
645 (("/bin/s") (string-append out "/bin/s")))
646 #t))))))
647 (home-page "https://github.com/rain-1/s")
648 (synopsis "Extremely minimal shell with the simplest syntax possible")
649 (description
650 "S is a new shell that aims to be extremely simple.
651 S does not implemnt the POSIX shell standard.
652 There are no globs or \"splatting\" where a variable $FOO turns into multiple
653 command line arguments. One token stays one token forever.
654 This is a \"no surprises\" straightforward approach.
655
656 There are no redirection operators > in the shell language, they are added as
657 extra programs. > is just another unix command, < is essentially cat(1).
658 A @code{andglob} program is also provided along with s.")
659 (license bsd-3))))
660
661 (define-public oksh
662 (package
663 (name "oksh")
664 (version "0.5.9")
665 (source
666 (origin
667 (method url-fetch)
668 (uri (string-append "https://connochaetos.org/oksh/oksh-"
669 version ".tar.gz"))
670 (sha256
671 (base32
672 "0ln9yf6pxngsviqszv8klnnvn8vcpplvj1njdn8xr2y8frkbw8r3"))))
673 (build-system gnu-build-system)
674 (arguments
675 `(; The test files are not part of the distributed tarball.
676 #:tests? #f))
677 (home-page "https://connochaetos.org/oksh")
678 (synopsis "Port of OpenBSD Korn Shell")
679 (description
680 "Oksh is a port of the OpenBSD Korn Shell.
681 The OpenBSD Korn Shell is a cleaned up and enhanced ksh.")
682 (license gpl3+)))
683
684 (define-public loksh
685 (package
686 (name "loksh")
687 (version "6.6")
688 (source
689 (origin
690 (method git-fetch)
691 (uri (git-reference
692 (url "https://github.com/dimkr/loksh.git")
693 (commit version)))
694 (file-name (git-file-name name version))
695 (sha256
696 (base32 "1a8s64n97ikvvi7ckirxnnjvcmhr3dd4rnqm2ivapyzb0wp42jk7"))))
697 (build-system gnu-build-system)
698 (inputs
699 `(("libbsd" ,libbsd)
700 ("ncurses" ,ncurses)))
701 (native-inputs
702 `(("pkg-config" ,pkg-config)))
703 (arguments
704 `(#:tests? #f ; no tests included
705 #:make-flags (list "CC=gcc" "HAVE_LIBBSD=1"
706 (string-append "PREFIX="
707 (assoc-ref %outputs "out")))
708 #:phases
709 (modify-phases %standard-phases
710 (delete 'configure)))) ; no configure script
711 (home-page "https://github.com/dimkr/loksh")
712 (synopsis "Korn Shell from OpenBSD")
713 (description
714 "loksh is a Linux port of OpenBSD's @command{ksh}. It is a small,
715 interactive POSIX shell targeted at resource-constrained systems.")
716 ;; The file 'LEGAL' says it is the public domain, and the 2
717 ;; exceptions which are listed are not included in this port.
718 (license public-domain)))
719
720 (define-public mksh
721 (package
722 (name "mksh")
723 (version "57")
724 (source
725 (origin
726 (method url-fetch)
727 (uri (string-append "https://www.mirbsd.org/MirOS/dist/mir/mksh/mksh-R"
728 version ".tgz"))
729 (sha256
730 (base32 "0xdykm1z710wriwd6nc8s8lwk2dwjl63dq96xxaawlid31a1241x"))))
731 (build-system gnu-build-system)
732 (arguments
733 `(#:tests? #f ; tests require access to /dev/tty
734 #:phases
735 (modify-phases %standard-phases
736 (delete 'configure)
737 (replace 'build
738 (lambda _
739 (setenv "CC" "gcc")
740 (invoke (which "sh") "Build.sh")))
741 (replace 'install
742 (lambda* (#:key outputs #:allow-other-keys)
743 (let* ((out (assoc-ref outputs "out"))
744 (bin (string-append out "/bin"))
745 (man (string-append out "/share/man/man1")))
746 (install-file "mksh" bin)
747 (with-directory-excursion bin
748 (symlink "mksh" "ksh"))
749 (install-file "mksh.1" man)
750 #t))))))
751 (home-page "https://www.mirbsd.org/mksh.htm")
752 (synopsis "Korn Shell from MirBSD")
753 (description "mksh is an actively developed free implementation of the
754 Korn Shell programming language and a successor to the Public Domain Korn
755 Shell (pdksh).")
756 (license (list miros
757 isc)))) ; strlcpy.c
758
759 (define-public oil-shell
760 (package
761 (name "oil-shell")
762 (version "0.7.0")
763 (source (origin
764 (method url-fetch)
765 (uri (string-append "https://www.oilshell.org/download/oil-"
766 version ".tar.xz"))
767 (sha256
768 (base32
769 "12c9s462879adb6mwd3fqafk0dnqsm16s18rhym6cmzfzy8v8zm3"))))
770 (build-system gnu-build-system)
771 (arguments
772 '(#:tests? #f ; the tests are not distributed in the tarballs
773 #:strip-binaries? #f ; the binaries cannot be stripped
774 #:phases
775 (modify-phases %standard-phases
776 (add-after 'unpack 'patch-compiler-invocation
777 (lambda _
778 (substitute* "configure"
779 ((" cc ") " gcc "))
780 #t))
781 (replace 'configure
782 (lambda* (#:key outputs #:allow-other-keys)
783 (let ((out (assoc-ref outputs "out")))
784 (setenv "CC" "gcc")
785 ;; The configure script doesn't recognize CONFIG_SHELL.
786 (setenv "CONFIG_SHELL" (which "sh"))
787 (invoke "./configure" (string-append "--prefix=" out)
788 "--with-readline"))))
789 (add-before 'install 'make-destination
790 (lambda _
791 ;; The build scripts don't create the destination directory.
792 (mkdir-p (string-append (assoc-ref %outputs "out") "/bin")))))))
793 (inputs
794 `(("readline" ,readline)))
795 (synopsis "Bash-compatible Unix shell")
796 (description "Oil is a Unix / POSIX shell, compatible with Bash. It
797 implements the Oil language, which is a new shell language to which Bash can be
798 automatically translated. The Oil language is a superset of Bash. It also
799 implements the OSH language, a statically-parseable language based on Bash as it
800 is commonly written.")
801 (home-page "https://www.oilshell.org/")
802 (license (list psfl ; The Oil sources include a patched Python 2 source tree
803 asl2.0))))
804
805 (define-public gash
806 (package
807 (name "gash")
808 (version "0.2.0")
809 (source
810 (origin (method url-fetch)
811 (uri (string-append "mirror://savannah/gash/gash-"
812 version ".tar.gz"))
813 (sha256
814 (base32
815 "13m0yz5h9nj3x40mr6wr5xcpq1lscndfwcicw3skrz801025hhgf"))
816 (modules '((guix build utils)))))
817 (build-system gnu-build-system)
818 (native-inputs
819 `(("pkg-config" ,pkg-config)))
820 (inputs
821 `(("guile" ,guile-2.2)))
822 (arguments
823 '(#:make-flags '("XFAIL_TESTS=tests/redirects.org")))
824 (home-page "https://savannah.nongnu.org/projects/gash/")
825 (synopsis "POSIX-compatible shell written in Guile Scheme")
826 (description "Gash is a POSIX-compatible shell written in Guile
827 Scheme. It provides both the shell interface, as well as a Guile
828 library for parsing shell scripts. Gash is designed to bootstrap Bash
829 as part of the Guix bootstrap process.")
830 (license gpl3+)))
831
832 (define-public gash-utils
833 (package
834 (name "gash-utils")
835 (version "0.1.0")
836 (source (origin
837 (method url-fetch)
838 (uri (string-append "mirror://savannah/gash/gash-utils-"
839 version ".tar.gz"))
840 (sha256
841 (base32
842 "0ib2p52qmbac5n0s5bys4fiwim461ps546976l1n7pwbs0avh7fk"))))
843 (build-system gnu-build-system)
844 (native-inputs
845 `(("pkg-config" ,pkg-config)))
846 (inputs
847 `(("guile" ,guile-2.2)
848 ("gash" ,gash)))
849 (home-page "https://savannah.nongnu.org/projects/gash/")
850 (synopsis "Core POSIX utilities written in Guile Scheme")
851 (description "Gash-Utils provides Scheme implementations of many
852 common POSIX utilities (there are about 40 of them, ranging in
853 complexity from @command{false} to @command{awk}). The utilities are
854 designed to be capable of bootstrapping their standard GNU counterparts.
855 Underpinning these utilities are many Scheme interfaces for manipulating
856 files and text.")
857 (license gpl3+)))
858