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 Nikita <nikita@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 ;;; Copyright © 2020 Ryan Prior <rprior@protonmail.com>
19 ;;; This file is part of GNU Guix.
21 ;;; GNU Guix is free software; you can redistribute it and/or modify it
22 ;;; under the terms of the GNU General Public License as published by
23 ;;; the Free Software Foundation; either version 3 of the License, or (at
24 ;;; your option) any later version.
26 ;;; GNU Guix is distributed in the hope that it will be useful, but
27 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 ;;; GNU General Public License for more details.
31 ;;; You should have received a copy of the GNU General Public License
32 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
34 (define-module (gnu packages shells)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages autotools)
37 #:use-module (gnu packages base)
38 #:use-module (gnu packages bash)
39 #:use-module (gnu packages bison)
40 #:use-module (gnu packages documentation)
41 #:use-module (gnu packages groff)
42 #:use-module (gnu packages guile)
43 #:use-module (gnu packages libbsd)
44 #:use-module (gnu packages libedit)
45 #:use-module (gnu packages linux)
46 #:use-module (gnu packages ncurses)
47 #:use-module (gnu packages pcre)
48 #:use-module (gnu packages perl)
49 #:use-module (gnu packages pkg-config)
50 #:use-module (gnu packages python)
51 #:use-module (gnu packages python-xyz)
52 #:use-module (gnu packages readline)
53 #:use-module (gnu packages scheme)
54 #:use-module (guix build-system cmake)
55 #:use-module (guix build-system gnu)
56 #:use-module (guix build-system python)
57 #:use-module (guix build-system trivial)
58 #:use-module (guix download)
59 #:use-module (guix git-download)
60 #:use-module (guix licenses)
61 #:use-module (guix packages)
62 #:use-module (guix utils))
71 (uri (string-append "http://gondor.apana.org.au/~herbert/dash/files/"
72 "dash-" version ".tar.gz"))
74 (base32 "1jwilfsy249d3q7fagg1ga4bgc2bg1fzw63r2nan0m77bznsdnad"))
75 (modules '((guix build utils)))
78 ;; The man page hails from BSD, where (d)ash is the default shell.
79 ;; This isn't the case on Guix or indeed most other GNU systems.
80 (substitute* "src/dash.1"
81 (("the standard command interpreter for the system")
82 "a command interpreter based on the original Bourne shell"))
84 (build-system gnu-build-system)
86 `(("libedit" ,libedit)))
88 '(#:configure-flags '("--with-libedit")))
89 (home-page "http://gondor.apana.org.au/~herbert/dash")
90 (synopsis "POSIX-compliant shell optimised for size")
92 "dash is a POSIX-compliant @command{/bin/sh} implementation that aims to be
93 as small as possible, often without sacrificing speed. It is faster than the
94 GNU Bourne-Again Shell (@command{bash}) at most scripted tasks. dash is a
95 direct descendant of NetBSD's Almquist Shell (@command{ash}).")
97 gpl2+)))) ; mksignames.c
106 (uri (string-append "https://github.com/fish-shell/fish-shell/"
107 "releases/download/" version "/"
108 "fish-" version ".tar.gz"))
110 (base32 "0s2356mlx7fp9kgqgw91lm5ds2i9iq9hq071fbqmcp3875l1xnz5"))))
111 (build-system cmake-build-system)
113 `(("fish-foreign-env" ,fish-foreign-env)
115 ("pcre2" ,pcre2) ; don't use the bundled PCRE2
116 ("python" ,python))) ; for fish_config and manpage completions
118 `(("doxygen" ,doxygen)
123 (modify-phases %standard-phases
124 (add-after 'unpack 'patch-tests
125 (lambda* (#:key inputs #:allow-other-keys)
126 (let ((coreutils (assoc-ref inputs "coreutils"))
127 (bash (assoc-ref inputs "bash")))
128 ;; These try to open a terminal
129 (delete-file "tests/checks/interactive.fish")
130 (delete-file "tests/checks/login-interactive.fish")
131 ;; These contain absolute path references
132 (substitute* "src/fish_tests.cpp"
133 (("/bin/echo" echo) (string-append coreutils echo))
134 (("/bin/ca" ca) (string-append coreutils ca))
135 (("\"(/bin/c)\"" _ c) (string-append "\"" coreutils c "\""))
136 (("/bin/ls_not_a_path" ls-not-a-path)
137 (string-append coreutils ls-not-a-path))
138 (("/bin/ls" ls) (string-append coreutils ls))
139 (("(/bin/)\"" _ bin) (string-append coreutils bin "\""))
140 (("/bin -" bin) (string-append coreutils bin))
142 "do_test\\(is_potential_path\\("
143 "L\"/usr\", wds, vars, PATH_REQUIRE_DIR\\)\\);"))
146 (append (find-files "tests" ".*\\.(in|out|err)$")
147 (find-files "tests/checks" ".*\\.fish"))
148 (("/bin/pwd" pwd) (string-append coreutils pwd))
149 (("/bin/echo" echo) (string-append coreutils echo))
150 (("/bin/sh" sh) (string-append bash sh))
151 (("/bin/ls" ls) (string-append coreutils ls)))
152 (substitute* (find-files "tests" ".*\\.(in|out|err)$")
153 (("/usr/bin") (string-append coreutils "/bin")))
155 ;; Source /etc/fish/config.fish from $__fish_sysconf_dir/config.fish.
156 (add-after 'patch-tests 'patch-fish-config
158 (let ((port (open-file "etc/config.fish" "a")))
159 (display (string-append
161 "# Patched by Guix.\n"
162 "# Source /etc/fish/config.fish.\n"
163 "if test -f /etc/fish/config.fish\n"
164 " source /etc/fish/config.fish\n"
169 ;; Embed absolute paths.
170 (add-before 'install 'embed-absolute-paths
172 (substitute* "share/functions/__fish_print_help.fish"
173 (("nroff") (which "nroff")))
175 ;; Enable completions, functions and configurations in user's and
176 ;; system's guix profiles by adding them to __extra_* variables.
177 (add-before 'install 'patch-fish-extra-paths
179 (let ((port (open-file "share/__fish_build_paths.fish" "a")))
183 "# Patched by Guix.\n"
184 "# Enable completions, functions and configurations in user's"
185 " and system's guix profiles by adding them to __extra_*"
187 "set -l __guix_profile_paths ~/.guix-profile"
188 " /run/current-system/profile\n"
189 "set __extra_completionsdir"
190 " $__guix_profile_paths\"/etc/fish/completions\""
191 " $__guix_profile_paths\"/share/fish/vendor_completions.d\""
192 " $__extra_completionsdir\n"
193 "set __extra_functionsdir"
194 " $__guix_profile_paths\"/etc/fish/functions\""
195 " $__guix_profile_paths\"/share/fish/vendor_functions.d\""
196 " $__extra_functionsdir\n"
197 "set __extra_confdir"
198 " $__guix_profile_paths\"/etc/fish/conf.d\""
199 " $__guix_profile_paths\"/share/fish/vendor_conf.d\""
200 " $__extra_confdir\n")
204 ;; Use fish-foreign-env to source /etc/profile.
205 (add-before 'install 'source-etc-profile
206 (lambda* (#:key inputs #:allow-other-keys)
207 (let ((port (open-file "share/__fish_build_paths.fish" "a")))
211 "# Patched by Guix.\n"
212 "# Use fish-foreign-env to source /etc/profile.\n"
213 "if status is-login\n"
214 " set fish_function_path "
215 (assoc-ref inputs "fish-foreign-env") "/share/fish/functions"
216 " $__fish_datadir/functions\n"
217 " fenv source /etc/profile\n"
218 " set -e fish_function_path\n"
223 (synopsis "The friendly interactive shell")
225 "Fish (friendly interactive shell) is a shell focused on interactive use,
226 discoverability, and friendliness. Fish has very user-friendly and powerful
227 tab-completion, including descriptions of every completion, completion of
228 strings with wildcards, and many completions for specific commands. It also
229 has extensive and discoverable help. A special @command{help} command gives
230 access to all the fish documentation in your web browser. Other features
231 include smart terminal handling based on terminfo, an easy to search history,
232 and syntax highlighting.")
233 (home-page "https://fishshell.com/")
236 (define-public fish-foreign-env
238 (name "fish-foreign-env")
239 (version "0.20190116")
244 (url "https://github.com/oh-my-fish/plugin-foreign-env.git")
245 (commit "dddd9213272a0ab848d474d0cbde12ad034e65bc")))
246 (file-name (git-file-name name version))
248 (base32 "00xqlyl3lffc5l0viin1nyp819wf81fncqyz87jx8ljjdhilmgbs"))))
249 (build-system trivial-build-system)
251 '(#:modules ((guix build utils))
254 (use-modules (guix build utils))
255 (let* ((source (assoc-ref %build-inputs "source"))
256 (out (assoc-ref %outputs "out"))
257 (func-path (string-append out "/share/fish/functions")))
259 (copy-recursively (string-append source "/functions")
262 ;; Embed absolute paths.
263 (substitute* `(,(string-append func-path "/fenv.fish")
264 ,(string-append func-path "/fenv.apply.fish")
265 ,(string-append func-path "/fenv.main.fish"))
267 (string-append (assoc-ref %build-inputs "bash") "/bin/bash"))
269 (string-append (assoc-ref %build-inputs "sed") "/bin/sed"))
271 (string-append " " (assoc-ref %build-inputs "coreutils")
275 ("coreutils" ,coreutils)
277 (home-page "https://github.com/oh-my-fish/plugin-foreign-env")
278 (synopsis "Foreign environment interface for fish shell")
279 (description "@code{fish-foreign-env} wraps bash script execution in a way
280 that environment variables that are exported or modified get imported back
291 (url "https://github.com/rakitzis/rc.git")
292 (commit (string-append "v" version))))
295 "0vj1h4pcg13vxsiydmmk87dr2sra9h4gwx0c4q6fjsiw4in78rrd"))
296 (file-name (git-file-name name version))))
297 (build-system gnu-build-system)
302 (modify-phases %standard-phases
303 (add-before 'bootstrap 'patch-trip.rc
305 (substitute* "trip.rc"
306 (("/bin/pwd") (which "pwd"))
307 (("/bin/sh") (which "sh"))
308 (("/bin/rm") (which "rm"))
309 (("/bin\\)") (string-append (dirname (which "rm")) ")")))
311 (inputs `(("readline" ,readline)
313 (native-inputs `(("autoconf" ,autoconf)
314 ("automake" ,automake)
316 ("pkg-config" ,pkg-config)))
317 (synopsis "Alternative implementation of the rc shell by Byron Rakitzis")
319 "This is a reimplementation by Byron Rakitzis of the Plan 9 shell. It
320 has a small feature set similar to a traditional Bourne shell.")
321 (home-page "https://github.com/rakitzis/rc")
331 (uri (string-append "https://github.com/wryun/es-shell/releases/"
332 "download/v" version "/es-" version ".tar.gz"))
335 "1fplzxc6lncz2lv2fyr2ig23rgg5j96rm2bbl1rs28mik771zd5h"))
336 (file-name (string-append name "-" version ".tar.gz"))))
337 (build-system gnu-build-system)
339 `(#:test-target "test"
341 (modify-phases %standard-phases
342 (add-before 'configure 're-enter-rootdir
343 ;; The tarball has no folder.
347 `(("readline" ,readline)))
350 (synopsis "Extensible shell with higher-order functions")
352 "Es is an extensible shell. The language was derived from the Plan 9
353 shell, rc, and was influenced by functional programming languages, such as
354 Scheme, and the Tcl embeddable programming language. This implementation is
355 derived from Byron Rakitzis's public domain implementation of rc, and was
356 written by Paul Haahr and Byron Rakitzis.")
357 (home-page "https://wryun.github.io/es-shell/")
358 (license public-domain)))
366 ;; Old tarballs are moved to old/.
367 (uri (list (string-append "ftp://ftp.astron.com/pub/tcsh/"
368 "tcsh-" version ".tar.gz")
369 (string-append "ftp://ftp.astron.com/pub/tcsh/"
370 "old/tcsh-" version ".tar.gz")))
373 "0nw8prz1n0lmr82wnpyhrzmki630afn7p9cfgr3vl00vr9c72a7d"))
374 (patches (search-patches "tcsh-fix-autotest.patch"))
375 (patch-flags '("-p0"))))
376 (build-system gnu-build-system)
378 `(("autoconf" ,autoconf)
381 `(("ncurses" ,ncurses)))
384 (modify-phases %standard-phases
385 ,@(if (%current-target-system)
386 '((add-before 'configure 'set-cross-cc
388 (substitute* "configure"
389 (("CC_FOR_GETHOST=\"cc\"")
390 "CC_FOR_GETHOST=\"gcc\""))
393 (add-before 'check 'patch-test-scripts
396 (substitute* '("tests/commands.at" "tests/variables.at")
397 (("/bin/pwd") (which "pwd")))
398 ;; The .at files create shell scripts without shebangs. Erk.
399 (substitute* "tests/commands.at"
400 (("./output.sh") "/bin/sh output.sh"))
401 (substitute* "tests/syntax.at"
402 (("; other_script.csh") "; /bin/sh other_script.csh"))
403 ;; Now, let's generate the test suite and patch it
404 (invoke "make" "tests/testsuite")
406 ;; This file is ISO-8859-1 encoded.
407 (with-fluids ((%default-port-encoding #f))
408 (substitute* "tests/testsuite"
409 (("/bin/sh") (which "sh"))))
411 (add-after 'install 'post-install
412 (lambda* (#:key inputs outputs #:allow-other-keys)
413 (let* ((out (assoc-ref %outputs "out"))
414 (bin (string-append out "/bin")))
415 (with-directory-excursion bin
416 (symlink "tcsh" "csh"))
418 (home-page "https://www.tcsh.org/")
419 (synopsis "Unix shell based on csh")
421 "Tcsh is an enhanced, but completely compatible version of the Berkeley
422 UNIX C shell (csh). It is a command language interpreter usable both as an
423 interactive login shell and a shell script command processor. It includes a
424 command-line editor, programmable word completion, spelling correction, a
425 history mechanism, job control and a C-like syntax.")
434 (uri (list (string-append
435 "https://www.zsh.org/pub/zsh-" version
438 "https://www.zsh.org/pub/old/zsh-" version
442 "09yyaadq738zlrnlh1hd3ycj1mv3q5hh4xl1ank70mjnqm6bbi6w"))))
443 (build-system gnu-build-system)
444 (arguments `(#:configure-flags
447 "--enable-maildir-support"
448 ;; share/zsh/site-functions isn't populated
449 "--disable-site-fndir"
451 "--enable-additional-fpath="
452 "/usr/local/share/zsh/site-functions," ; for foreign OS
453 "/run/current-system/profile/share/zsh/site-functions"))
455 (modify-phases %standard-phases
456 (add-before 'configure 'fix-sh
458 ;; Some of the files are ISO-8859-1 encoded.
459 (with-fluids ((%default-port-encoding #f))
465 "Config/installfns.sh"
467 "Test/E01options.ztst"
468 "Test/A05execution.ztst"
469 "Test/A01grammar.ztst"
470 "Test/A06assign.ztst"
471 "Test/B02typeset.ztst"
472 "Completion/Unix/Command/_init_d"
474 (("/bin/sh") (which "sh"))))))
475 (add-before 'check 'patch-test
477 ;; In Zsh, `command -p` searches a predefined set of
478 ;; paths that don't exist in the build environment. See
479 ;; the assignment of 'path' in Src/init.c'
480 (substitute* "Test/A01grammar.ztst"
481 (("command -pv") "command -v")
482 (("command -p") "command ")
483 (("'command' -p") "'command' "))
485 (native-inputs `(("autoconf" ,autoconf)))
486 (inputs `(("ncurses" ,ncurses)
489 (synopsis "Powerful shell for interactive use and scripting")
490 (description "The Z shell (zsh) is a Unix shell that can be used
491 as an interactive login shell and as a powerful command interpreter
492 for shell scripting. Zsh can be thought of as an extended Bourne shell
493 with a large number of improvements, including some features of bash,
495 (home-page "https://www.zsh.org/")
497 ;; The whole thing is under an MIT/X11-style license, but there's one
498 ;; command, 'Completion/Unix/Command/_darcs', which is under GPLv2+.
508 (uri (pypi-uri "xonsh" version))
511 "1h4rrwzwiwkyi9p49sjn97rl39fqq2r23hchzsw0s3fcwa7m8fkj"))
512 (modules '((guix build utils)))
515 ;; Delete bundled PLY.
516 (delete-file-recursively "xonsh/ply")
517 (substitute* "setup.py"
518 (("\"xonsh\\.ply\\.ply\",") ""))
519 ;; Use our properly packaged PLY instead.
520 (substitute* (list "setup.py"
521 "tests/test_lexer.py"
522 "xonsh/__amalgam__.py"
524 "xonsh/parsers/base.py"
526 (("from xonsh\\.ply\\.(.*) import" _ module)
527 (format #f "from ~a import" module))
528 (("from xonsh\\.ply import") "import"))
530 (build-system python-build-system)
532 '(;; TODO Try running run the test suite.
533 ;; See 'requirements-tests.txt' in the source distribution for more
537 `(("python-ply" ,python-ply)))
538 (home-page "https://xon.sh/")
539 (synopsis "Python-ish shell")
541 "Xonsh is a Python-ish, BASHwards-looking shell language and command
542 prompt. The language is a superset of Python 3.4+ with additional shell
543 primitives that you are used to from Bash and IPython. It works on all major
544 systems including Linux, Mac OSX, and Windows. Xonsh is meant for the daily
545 use of experts and novices alike.")
549 (let ((commit "114432435e4eadd54334df6b37fcae505079b49f")
553 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
558 (url "https://github.com/scheme/scsh")
560 (file-name (string-append name "-" version "-checkout"))
563 "1ghk08akiz7hff1pndi8rmgamgcrn2mv9asbss9l79d3c2iaav3q"))))
564 (build-system gnu-build-system)
566 `(#:test-target "test"
568 (modify-phases %standard-phases
569 (add-before 'configure 'replace-rx
570 (lambda* (#:key inputs #:allow-other-keys)
571 (let* ((rx (assoc-ref inputs "scheme48-rx"))
572 (rxpath (string-append rx "/share/scheme48-"
573 ,(package-version scheme48)
575 (delete-file-recursively "rx")
576 (symlink rxpath "rx"))
579 `(("scheme48" ,scheme48)
580 ("scheme48-rx" ,scheme48-rx)))
582 `(("autoconf" ,autoconf)
583 ("automake" ,automake)))
584 (home-page "https://github.com/scheme/scsh")
585 (synopsis "Unix shell embedded in Scheme")
587 "Scsh is a Unix shell embedded in Scheme. Scsh has two main
588 components: a process notation for running programs and setting up pipelines
589 and redirections, and a complete syscall library for low-level access to the
593 (define-public linenoise
594 (let ((commit "2105ce445821381cf1bca87b6d386d4ea88ee20d")
598 (version (string-append "1.0-" revision "." (string-take commit 7)))
603 (url "https://github.com/antirez/linenoise")
605 (file-name (string-append name "-" version "-checkout"))
608 "1z16qwix8z6a40fskdgxsibkqgdrp4q6ncp4n6hnv4r9iihy2d8r"))))
609 (build-system gnu-build-system)
611 `(#:tests? #f ; no tests are included
613 (list ,(string-append "CC=" (cc-for-target)))
615 (modify-phases %standard-phases
618 (lambda* (#:key outputs #:allow-other-keys)
619 ;; At the moment there is no 'make install' in upstream.
620 (let* ((out (assoc-ref outputs "out")))
621 (install-file "linenoise.h"
622 (string-append out "/include/linenoise"))
623 (install-file "linenoise.c"
624 (string-append out "/include/linenoise"))
626 (home-page "https://github.com/antirez/linenoise")
627 (synopsis "Minimal zero-config readline replacement")
629 "Linenoise is a minimal, zero-config, readline replacement.
630 Its features include:
633 @item Single and multi line editing mode with the usual key bindings
634 @item History handling
636 @item Hints (suggestions at the right of the prompt as you type)
637 @item A subset of VT100 escapes, ANSI.SYS compatible
641 (define-public s-shell
642 (let ((commit "da2e5c20c0c5f477ec3426dc2584889a789b1659")
646 (version (git-version "0.0.0" revision commit))
651 (url "https://github.com/rain-1/s")
653 (file-name (string-append name "-" version "-checkout"))
656 "0qiny71ww5nhzy4mnc8652hn0mlxyb67h333gbdxp4j4qxsi13q4"))))
657 (build-system gnu-build-system)
659 `(("linenoise" ,linenoise)))
662 #:make-flags (list "CC=gcc"
663 (string-append "PREFIX="
664 (assoc-ref %outputs "out")))
666 (modify-phases %standard-phases
667 (add-after 'unpack 'install-directory-fix
668 (lambda* (#:key outputs #:allow-other-keys)
669 (let* ((out (assoc-ref outputs "out"))
670 (bin (string-append out "/bin")))
671 (substitute* "Makefile"
674 (add-after 'install 'manpage
675 (lambda* (#:key outputs #:allow-other-keys)
676 (install-file "s.1" (string-append (assoc-ref outputs "out")
677 "/share/man/man1"))))
679 (lambda* (#:key inputs outputs #:allow-other-keys)
680 ;; At this point linenoise is meant to be included,
681 ;; so we have to really copy it into the working directory
683 (let* ((linenoise (assoc-ref inputs "linenoise"))
684 (noisepath (string-append linenoise "/include/linenoise"))
685 (out (assoc-ref outputs "out")))
686 (copy-recursively noisepath "linenoise")
688 (("/bin/s") (string-append out "/bin/s")))
690 (home-page "https://github.com/rain-1/s")
691 (synopsis "Extremely minimal shell with the simplest syntax possible")
693 "S is a new shell that aims to be extremely simple.
694 S does not implemnt the POSIX shell standard.
695 There are no globs or \"splatting\" where a variable $FOO turns into multiple
696 command line arguments. One token stays one token forever.
697 This is a \"no surprises\" straightforward approach.
699 There are no redirection operators > in the shell language, they are added as
700 extra programs. > is just another unix command, < is essentially cat(1).
701 A @code{andglob} program is also provided along with s.")
711 (uri (string-append "https://connochaetos.org/oksh/oksh-"
715 "0ln9yf6pxngsviqszv8klnnvn8vcpplvj1njdn8xr2y8frkbw8r3"))))
716 (build-system gnu-build-system)
718 `(; The test files are not part of the distributed tarball.
720 (home-page "https://connochaetos.org/oksh")
721 (synopsis "Port of OpenBSD Korn Shell")
723 "Oksh is a port of the OpenBSD Korn Shell.
724 The OpenBSD Korn Shell is a cleaned up and enhanced ksh.")
735 (url "https://github.com/dimkr/loksh.git")
737 (file-name (git-file-name name version))
739 (base32 "1a8s64n97ikvvi7ckirxnnjvcmhr3dd4rnqm2ivapyzb0wp42jk7"))))
740 (build-system gnu-build-system)
743 ("ncurses" ,ncurses)))
745 `(("pkg-config" ,pkg-config)))
747 `(#:tests? #f ; no tests included
748 #:make-flags (list "CC=gcc" "HAVE_LIBBSD=1"
749 (string-append "PREFIX="
750 (assoc-ref %outputs "out")))
752 (modify-phases %standard-phases
753 (delete 'configure)))) ; no configure script
754 (home-page "https://github.com/dimkr/loksh")
755 (synopsis "Korn Shell from OpenBSD")
757 "loksh is a Linux port of OpenBSD's @command{ksh}. It is a small,
758 interactive POSIX shell targeted at resource-constrained systems.")
759 ;; The file 'LEGAL' says it is the public domain, and the 2
760 ;; exceptions which are listed are not included in this port.
761 (license public-domain)))
770 (uri (string-append "https://www.mirbsd.org/MirOS/dist/mir/mksh/mksh-R"
773 (base32 "1337zjvzh14yncg9igdry904a3ns52l8rnm1kcq262w7f5xyp2v0"))))
774 (build-system gnu-build-system)
776 `(#:tests? #f ; tests require access to /dev/tty
778 (modify-phases %standard-phases
783 (invoke (which "sh") "Build.sh")))
785 (lambda* (#:key outputs #:allow-other-keys)
786 (let* ((out (assoc-ref outputs "out"))
787 (bin (string-append out "/bin"))
788 (man (string-append out "/share/man/man1")))
789 (install-file "mksh" bin)
790 (with-directory-excursion bin
791 (symlink "mksh" "ksh"))
792 (install-file "mksh.1" man)
794 (home-page "https://www.mirbsd.org/mksh.htm")
795 (synopsis "Korn Shell from MirBSD")
796 (description "mksh is an actively developed free implementation of the
797 Korn Shell programming language and a successor to the Public Domain Korn
805 ;; https://www.oilshell.org/blog/2020/04/release-0.8.pre4.html#comment-on-version-numbering
810 (uri (string-append "https://www.oilshell.org/download/oil-"
813 (base32 "11nfwn5b1w74hv78065jg2zm45mqzi59381b0f649j7n3g7yp3iq"))))
814 (build-system gnu-build-system)
816 `(#:strip-binaries? #f ; strip breaks the binary
818 (modify-phases %standard-phases
820 (lambda* (#:key outputs #:allow-other-keys)
821 (let ((out (assoc-ref outputs "out")))
823 (substitute* "configure"
825 (invoke "./configure" (string-append "--prefix=" out)
826 "--with-readline"))))
828 ;; The tests are not distributed in the tarballs but upstream
829 ;; recommends running this smoke test.
830 ;; https://github.com/oilshell/oil/blob/release/0.8.pre6/INSTALL.txt#L38-L48
832 (let* ((oil "_bin/oil.ovm"))
833 (invoke/quiet oil "osh" "-c" "echo hi")
834 (invoke/quiet oil "osh" "-n" "configure")))))))
836 `(("readline" ,readline)))
837 (home-page "https://www.oilshell.org")
838 (synopsis "Programming language and Bash-compatible Unix shell")
839 (description "Oil is a programming language with automatic translation for
840 Bash. It includes osh, a Unix/POSIX shell that runs unmodified Bash
842 (license (list psfl ; tarball includes python2.7
845 (define-public oil-shell
846 (deprecated-package "oil-shell" oil))
853 (origin (method url-fetch)
854 (uri (string-append "mirror://savannah/gash/gash-"
858 "13m0yz5h9nj3x40mr6wr5xcpq1lscndfwcicw3skrz801025hhgf"))
859 (modules '((guix build utils)))))
860 (build-system gnu-build-system)
862 `(("pkg-config" ,pkg-config)))
864 `(("guile" ,guile-2.2)))
866 '(#:make-flags '("XFAIL_TESTS=tests/redirects.org")))
867 (home-page "https://savannah.nongnu.org/projects/gash/")
868 (synopsis "POSIX-compatible shell written in Guile Scheme")
869 (description "Gash is a POSIX-compatible shell written in Guile
870 Scheme. It provides both the shell interface, as well as a Guile
871 library for parsing shell scripts. Gash is designed to bootstrap Bash
872 as part of the Guix bootstrap process.")
875 (define-public gash-utils
881 (uri (string-append "mirror://savannah/gash/gash-utils-"
885 "0ib2p52qmbac5n0s5bys4fiwim461ps546976l1n7pwbs0avh7fk"))))
886 (build-system gnu-build-system)
888 `(("pkg-config" ,pkg-config)))
890 `(("guile" ,guile-2.2)
892 (home-page "https://savannah.nongnu.org/projects/gash/")
893 (synopsis "Core POSIX utilities written in Guile Scheme")
894 (description "Gash-Utils provides Scheme implementations of many
895 common POSIX utilities (there are about 40 of them, ranging in
896 complexity from @command{false} to @command{awk}). The utilities are
897 designed to be capable of bootstrapping their standard GNU counterparts.
898 Underpinning these utilities are many Scheme interfaces for manipulating