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>
18 ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
20 ;;; This file is part of GNU Guix.
22 ;;; GNU Guix is free software; you can redistribute it and/or modify it
23 ;;; under the terms of the GNU General Public License as published by
24 ;;; the Free Software Foundation; either version 3 of the License, or (at
25 ;;; your option) any later version.
27 ;;; GNU Guix is distributed in the hope that it will be useful, but
28 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
29 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 ;;; GNU General Public License for more details.
32 ;;; You should have received a copy of the GNU General Public License
33 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
35 (define-module (gnu packages shells)
36 #:use-module (gnu packages)
37 #:use-module (gnu packages autotools)
38 #:use-module (gnu packages base)
39 #:use-module (gnu packages bash)
40 #:use-module (gnu packages bison)
41 #:use-module (gnu packages documentation)
42 #:use-module (gnu packages groff)
43 #:use-module (gnu packages guile)
44 #:use-module (gnu packages libbsd)
45 #:use-module (gnu packages libedit)
46 #:use-module (gnu packages linux)
47 #:use-module (gnu packages ncurses)
48 #:use-module (gnu packages pcre)
49 #:use-module (gnu packages perl)
50 #:use-module (gnu packages pkg-config)
51 #:use-module (gnu packages python)
52 #:use-module (gnu packages python-xyz)
53 #:use-module (gnu packages readline)
54 #:use-module (gnu packages scheme)
55 #:use-module (guix build-system cmake)
56 #:use-module (guix build-system gnu)
57 #:use-module (guix build-system python)
58 #:use-module (guix build-system trivial)
59 #:use-module (guix download)
60 #:use-module (guix git-download)
61 #:use-module (guix licenses)
62 #:use-module (guix packages)
63 #:use-module (guix utils))
72 (uri (string-append "http://gondor.apana.org.au/~herbert/dash/files/"
73 "dash-" version ".tar.gz"))
75 (base32 "048n1rbw3v1ffzsw5mkc6zzvvf1csq7pcri7jraaqag38vqq3j3k"))
76 (modules '((guix build utils)))
79 ;; The man page hails from BSD, where (d)ash is the default shell.
80 ;; This isn't the case on Guix or indeed most other GNU systems.
81 (substitute* "src/dash.1"
82 (("the standard command interpreter for the system")
83 "a command interpreter based on the original Bourne shell"))
85 (build-system gnu-build-system)
87 `(("libedit" ,libedit)))
89 '(#:configure-flags '("--with-libedit")))
90 (home-page "http://gondor.apana.org.au/~herbert/dash")
91 (synopsis "POSIX-compliant shell optimised for size")
93 "dash is a POSIX-compliant @command{/bin/sh} implementation that aims to be
94 as small as possible, often without sacrificing speed. It is faster than the
95 GNU Bourne-Again Shell (@command{bash}) at most scripted tasks. dash is a
96 direct descendant of NetBSD's Almquist Shell (@command{ash}).")
98 gpl2+)))) ; mksignames.c
107 (uri (string-append "https://github.com/fish-shell/fish-shell/"
108 "releases/download/" version "/"
109 "fish-" version ".tar.gz"))
111 (base32 "1vblmb3x2k2cb0db5jdyflppnlqsm7i6jjaidyhmvaaw7ch2gffm"))
112 (modules '((guix build utils)))
115 (delete-file-recursively "pcre2-10.32") #t))))
116 (build-system cmake-build-system)
118 `(("fish-foreign-env" ,fish-foreign-env)
120 ("pcre2" ,pcre2) ; don't use the bundled PCRE2
121 ("python" ,python))) ; for fish_config and manpage completions
123 `(("doxygen" ,doxygen)
128 (modify-phases %standard-phases
129 (add-after 'unpack 'set-env
131 ;; some tests write to $HOME
132 (setenv "HOME" (getcwd))
134 (add-after 'unpack 'patch-tests
135 (lambda* (#:key inputs #:allow-other-keys)
136 (let ((coreutils (assoc-ref inputs "coreutils"))
137 (bash (assoc-ref inputs "bash")))
139 (delete-file "tests/checks/pipeline-pgroup.fish")
140 ;; These try to open a terminal
141 (delete-file "tests/checks/interactive.fish")
142 (delete-file "tests/checks/login-interactive.fish")
143 ;; These contain absolute path references
144 (substitute* "src/fish_tests.cpp"
145 (("/bin/echo" echo) (string-append coreutils echo))
146 (("/bin/ca" ca) (string-append coreutils ca))
147 (("\"(/bin/c)\"" _ c) (string-append "\"" coreutils c "\""))
148 (("/bin/ls_not_a_path" ls-not-a-path)
149 (string-append coreutils ls-not-a-path))
150 (("/bin/ls" ls) (string-append coreutils ls))
151 (("(/bin/)\"" _ bin) (string-append coreutils bin "\""))
152 (("/bin -" bin) (string-append coreutils bin))
154 "do_test\\(is_potential_path\\("
155 "L\"/usr\", wds, vars, PATH_REQUIRE_DIR\\)\\);"))
158 (append (find-files "tests" ".*\\.(in|out|err)$")
159 (find-files "tests/checks" ".*\\.fish"))
160 (("/bin/pwd" pwd) (string-append coreutils pwd))
161 (("/bin/echo" echo) (string-append coreutils echo))
162 (("/bin/sh" sh) (string-append bash sh))
163 (("/bin/ls" ls) (string-append coreutils ls)))
164 (substitute* (find-files "tests" ".*\\.(in|out|err)$")
165 (("/usr/bin") (string-append coreutils "/bin")))
167 ;; Source /etc/fish/config.fish from $__fish_sysconf_dir/config.fish.
168 (add-after 'patch-tests 'patch-fish-config
170 (let ((port (open-file "etc/config.fish" "a")))
171 (display (string-append
173 "# Patched by Guix.\n"
174 "# Source /etc/fish/config.fish.\n"
175 "if test -f /etc/fish/config.fish\n"
176 " source /etc/fish/config.fish\n"
181 ;; Embed absolute paths.
182 (add-before 'install 'embed-absolute-paths
184 (substitute* "share/functions/__fish_print_help.fish"
185 (("nroff") (which "nroff")))
187 ;; Enable completions, functions and configurations in user's and
188 ;; system's guix profiles by adding them to __extra_* variables.
189 (add-before 'install 'patch-fish-extra-paths
191 (let ((port (open-file "share/__fish_build_paths.fish" "a")))
195 "# Patched by Guix.\n"
196 "# Enable completions, functions and configurations in user's"
197 " and system's guix profiles by adding them to __extra_*"
199 "set -l __guix_profile_paths ~/.guix-profile"
200 " /run/current-system/profile\n"
201 "set __extra_completionsdir"
202 " $__guix_profile_paths\"/etc/fish/completions\""
203 " $__guix_profile_paths\"/share/fish/vendor_completions.d\""
204 " $__extra_completionsdir\n"
205 "set __extra_functionsdir"
206 " $__guix_profile_paths\"/etc/fish/functions\""
207 " $__guix_profile_paths\"/share/fish/vendor_functions.d\""
208 " $__extra_functionsdir\n"
209 "set __extra_confdir"
210 " $__guix_profile_paths\"/etc/fish/conf.d\""
211 " $__guix_profile_paths\"/share/fish/vendor_conf.d\""
212 " $__extra_confdir\n")
216 ;; Use fish-foreign-env to source /etc/profile.
217 (add-before 'install 'source-etc-profile
218 (lambda* (#:key inputs #:allow-other-keys)
219 (let ((port (open-file "share/__fish_build_paths.fish" "a")))
223 "# Patched by Guix.\n"
224 "# Use fish-foreign-env to source /etc/profile.\n"
225 "if status is-login\n"
226 " set fish_function_path "
227 (assoc-ref inputs "fish-foreign-env") "/share/fish/functions"
228 " $__fish_datadir/functions\n"
229 " fenv source /etc/profile\n"
230 " set -e fish_function_path\n"
235 (synopsis "The friendly interactive shell")
237 "Fish (friendly interactive shell) is a shell focused on interactive use,
238 discoverability, and friendliness. Fish has very user-friendly and powerful
239 tab-completion, including descriptions of every completion, completion of
240 strings with wildcards, and many completions for specific commands. It also
241 has extensive and discoverable help. A special @command{help} command gives
242 access to all the fish documentation in your web browser. Other features
243 include smart terminal handling based on terminfo, an easy to search history,
244 and syntax highlighting.")
245 (home-page "https://fishshell.com/")
248 (define-public fish-foreign-env
250 (name "fish-foreign-env")
251 (version "0.20190116")
256 (url "https://github.com/oh-my-fish/plugin-foreign-env")
257 (commit "dddd9213272a0ab848d474d0cbde12ad034e65bc")))
258 (file-name (git-file-name name version))
260 (base32 "00xqlyl3lffc5l0viin1nyp819wf81fncqyz87jx8ljjdhilmgbs"))))
261 (build-system trivial-build-system)
263 '(#:modules ((guix build utils))
266 (use-modules (guix build utils))
267 (let* ((source (assoc-ref %build-inputs "source"))
268 (out (assoc-ref %outputs "out"))
269 (func-path (string-append out "/share/fish/functions")))
271 (copy-recursively (string-append source "/functions")
274 ;; Embed absolute paths.
275 (substitute* `(,(string-append func-path "/fenv.fish")
276 ,(string-append func-path "/fenv.apply.fish")
277 ,(string-append func-path "/fenv.main.fish"))
279 (string-append (assoc-ref %build-inputs "bash") "/bin/bash"))
281 (string-append (assoc-ref %build-inputs "sed") "/bin/sed"))
283 (string-append " " (assoc-ref %build-inputs "coreutils")
287 ("coreutils" ,coreutils)
289 (home-page "https://github.com/oh-my-fish/plugin-foreign-env")
290 (synopsis "Foreign environment interface for fish shell")
291 (description "@code{fish-foreign-env} wraps bash script execution in a way
292 that environment variables that are exported or modified get imported back
303 (url "https://github.com/rakitzis/rc")
304 (commit (string-append "v" version))))
307 "0vj1h4pcg13vxsiydmmk87dr2sra9h4gwx0c4q6fjsiw4in78rrd"))
308 (file-name (git-file-name name version))))
309 (build-system gnu-build-system)
314 (modify-phases %standard-phases
315 (add-before 'bootstrap 'patch-trip.rc
317 (substitute* "trip.rc"
318 (("/bin/pwd") (which "pwd"))
319 (("/bin/sh") (which "sh"))
320 (("/bin/rm") (which "rm"))
321 (("/bin\\)") (string-append (dirname (which "rm")) ")")))
323 (inputs `(("readline" ,readline)
325 (native-inputs `(("autoconf" ,autoconf)
326 ("automake" ,automake)
328 ("pkg-config" ,pkg-config)))
329 (synopsis "Alternative implementation of the rc shell by Byron Rakitzis")
331 "This is a reimplementation by Byron Rakitzis of the Plan 9 shell. It
332 has a small feature set similar to a traditional Bourne shell.")
333 (home-page "https://github.com/rakitzis/rc")
343 (uri (string-append "https://github.com/wryun/es-shell/releases/"
344 "download/v" version "/es-" version ".tar.gz"))
347 "1fplzxc6lncz2lv2fyr2ig23rgg5j96rm2bbl1rs28mik771zd5h"))
348 (file-name (string-append name "-" version ".tar.gz"))))
349 (build-system gnu-build-system)
351 `(#:test-target "test"
353 (modify-phases %standard-phases
354 (add-before 'configure 're-enter-rootdir
355 ;; The tarball has no folder.
359 `(("readline" ,readline)))
362 (synopsis "Extensible shell with higher-order functions")
364 "Es is an extensible shell. The language was derived from the Plan 9
365 shell, rc, and was influenced by functional programming languages, such as
366 Scheme, and the Tcl embeddable programming language. This implementation is
367 derived from Byron Rakitzis's public domain implementation of rc, and was
368 written by Paul Haahr and Byron Rakitzis.")
369 (home-page "https://wryun.github.io/es-shell/")
370 (license public-domain)))
378 ;; Old tarballs are moved to old/.
379 (uri (list (string-append "ftp://ftp.astron.com/pub/tcsh/"
380 "tcsh-" version ".tar.gz")
381 (string-append "ftp://ftp.astron.com/pub/tcsh/"
382 "old/tcsh-" version ".tar.gz")))
385 "0nw8prz1n0lmr82wnpyhrzmki630afn7p9cfgr3vl00vr9c72a7d"))
386 (patches (search-patches "tcsh-fix-autotest.patch"))
387 (patch-flags '("-p0"))))
388 (build-system gnu-build-system)
390 `(("autoconf" ,autoconf)
393 `(("ncurses" ,ncurses)))
396 (modify-phases %standard-phases
397 ,@(if (%current-target-system)
398 '((add-before 'configure 'set-cross-cc
400 (substitute* "configure"
401 (("CC_FOR_GETHOST=\"cc\"")
402 "CC_FOR_GETHOST=\"gcc\""))
405 (add-before 'check 'patch-test-scripts
408 (substitute* '("tests/commands.at" "tests/variables.at")
409 (("/bin/pwd") (which "pwd")))
410 ;; The .at files create shell scripts without shebangs. Erk.
411 (substitute* "tests/commands.at"
412 (("./output.sh") "/bin/sh output.sh"))
413 (substitute* "tests/syntax.at"
414 (("; other_script.csh") "; /bin/sh other_script.csh"))
415 ;; Now, let's generate the test suite and patch it
416 (invoke "make" "tests/testsuite")
418 ;; This file is ISO-8859-1 encoded.
419 (with-fluids ((%default-port-encoding #f))
420 (substitute* "tests/testsuite"
421 (("/bin/sh") (which "sh"))))
423 (add-after 'install 'post-install
424 (lambda* (#:key inputs outputs #:allow-other-keys)
425 (let* ((out (assoc-ref %outputs "out"))
426 (bin (string-append out "/bin")))
427 (with-directory-excursion bin
428 (symlink "tcsh" "csh"))
430 (home-page "https://www.tcsh.org/")
431 (synopsis "Unix shell based on csh")
433 "Tcsh is an enhanced, but completely compatible version of the Berkeley
434 UNIX C shell (csh). It is a command language interpreter usable both as an
435 interactive login shell and a shell script command processor. It includes a
436 command-line editor, programmable word completion, spelling correction, a
437 history mechanism, job control and a C-like syntax.")
446 (uri (list (string-append
447 "https://www.zsh.org/pub/zsh-" version
450 "https://www.zsh.org/pub/old/zsh-" version
454 "09yyaadq738zlrnlh1hd3ycj1mv3q5hh4xl1ank70mjnqm6bbi6w"))))
455 (build-system gnu-build-system)
456 (arguments `(#:configure-flags
459 "--enable-maildir-support"
460 ;; share/zsh/site-functions isn't populated
461 "--disable-site-fndir"
463 "--enable-additional-fpath="
464 "/usr/local/share/zsh/site-functions," ; for foreign OS
465 "/run/current-system/profile/share/zsh/site-functions"))
467 (modify-phases %standard-phases
468 (add-before 'configure 'fix-sh
470 ;; Some of the files are ISO-8859-1 encoded.
471 (with-fluids ((%default-port-encoding #f))
477 "Config/installfns.sh"
479 "Test/E01options.ztst"
480 "Test/A05execution.ztst"
481 "Test/A01grammar.ztst"
482 "Test/A06assign.ztst"
483 "Test/B02typeset.ztst"
484 "Completion/Unix/Command/_init_d"
486 (("/bin/sh") (which "sh"))))))
487 (add-before 'check 'patch-test
489 ;; In Zsh, `command -p` searches a predefined set of
490 ;; paths that don't exist in the build environment. See
491 ;; the assignment of 'path' in Src/init.c'
492 (substitute* "Test/A01grammar.ztst"
493 (("command -pv") "command -v")
494 (("command -p") "command ")
495 (("'command' -p") "'command' "))
497 (native-inputs `(("autoconf" ,autoconf)))
498 (inputs `(("ncurses" ,ncurses)
501 (synopsis "Powerful shell for interactive use and scripting")
502 (description "The Z shell (zsh) is a Unix shell that can be used
503 as an interactive login shell and as a powerful command interpreter
504 for shell scripting. Zsh can be thought of as an extended Bourne shell
505 with a large number of improvements, including some features of bash,
507 (home-page "https://www.zsh.org/")
509 ;; The whole thing is under an MIT/X11-style license, but there's one
510 ;; command, 'Completion/Unix/Command/_darcs', which is under GPLv2+.
520 (uri (pypi-uri "xonsh" version))
523 "1h4rrwzwiwkyi9p49sjn97rl39fqq2r23hchzsw0s3fcwa7m8fkj"))
524 (modules '((guix build utils)))
527 ;; Delete bundled PLY.
528 (delete-file-recursively "xonsh/ply")
529 (substitute* "setup.py"
530 (("\"xonsh\\.ply\\.ply\",") ""))
531 ;; Use our properly packaged PLY instead.
532 (substitute* (list "setup.py"
533 "tests/test_lexer.py"
534 "xonsh/__amalgam__.py"
536 "xonsh/parsers/base.py"
538 (("from xonsh\\.ply\\.(.*) import" _ module)
539 (format #f "from ~a import" module))
540 (("from xonsh\\.ply import") "import"))
542 (build-system python-build-system)
544 '(;; TODO Try running run the test suite.
545 ;; See 'requirements-tests.txt' in the source distribution for more
549 `(("python-ply" ,python-ply)))
550 (home-page "https://xon.sh/")
551 (synopsis "Python-ish shell")
553 "Xonsh is a Python-ish, BASHwards-looking shell language and command
554 prompt. The language is a superset of Python 3.4+ with additional shell
555 primitives that you are used to from Bash and IPython. It works on all major
556 systems including Linux, Mac OSX, and Windows. Xonsh is meant for the daily
557 use of experts and novices alike.")
561 (let ((commit "114432435e4eadd54334df6b37fcae505079b49f")
565 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
570 (url "https://github.com/scheme/scsh")
572 (file-name (string-append name "-" version "-checkout"))
575 "1ghk08akiz7hff1pndi8rmgamgcrn2mv9asbss9l79d3c2iaav3q"))))
576 (build-system gnu-build-system)
578 `(#:test-target "test"
580 (modify-phases %standard-phases
581 (add-before 'configure 'replace-rx
582 (lambda* (#:key inputs #:allow-other-keys)
583 (let* ((rx (assoc-ref inputs "scheme48-rx"))
584 (rxpath (string-append rx "/share/scheme48-"
585 ,(package-version scheme48)
587 (delete-file-recursively "rx")
588 (symlink rxpath "rx"))
591 `(("scheme48" ,scheme48)
592 ("scheme48-rx" ,scheme48-rx)))
594 `(("autoconf" ,autoconf)
595 ("automake" ,automake)))
596 (home-page "https://github.com/scheme/scsh")
597 (synopsis "Unix shell embedded in Scheme")
599 "Scsh is a Unix shell embedded in Scheme. Scsh has two main
600 components: a process notation for running programs and setting up pipelines
601 and redirections, and a complete syscall library for low-level access to the
605 (define-public linenoise
606 (let ((commit "2105ce445821381cf1bca87b6d386d4ea88ee20d")
610 (version (string-append "1.0-" revision "." (string-take commit 7)))
615 (url "https://github.com/antirez/linenoise")
617 (file-name (string-append name "-" version "-checkout"))
620 "1z16qwix8z6a40fskdgxsibkqgdrp4q6ncp4n6hnv4r9iihy2d8r"))))
621 (build-system gnu-build-system)
623 `(#:tests? #f ; no tests are included
625 (list ,(string-append "CC=" (cc-for-target)))
627 (modify-phases %standard-phases
630 (lambda* (#:key outputs #:allow-other-keys)
631 ;; At the moment there is no 'make install' in upstream.
632 (let* ((out (assoc-ref outputs "out")))
633 (install-file "linenoise.h"
634 (string-append out "/include/linenoise"))
635 (install-file "linenoise.c"
636 (string-append out "/include/linenoise"))
638 (home-page "https://github.com/antirez/linenoise")
639 (synopsis "Minimal zero-config readline replacement")
641 "Linenoise is a minimal, zero-config, readline replacement.
642 Its features include:
645 @item Single and multi line editing mode with the usual key bindings
646 @item History handling
648 @item Hints (suggestions at the right of the prompt as you type)
649 @item A subset of VT100 escapes, ANSI.SYS compatible
653 (define-public s-shell
654 (let ((commit "da2e5c20c0c5f477ec3426dc2584889a789b1659")
658 (version (git-version "0.0.0" revision commit))
663 (url "https://github.com/rain-1/s")
665 (file-name (string-append name "-" version "-checkout"))
668 "0qiny71ww5nhzy4mnc8652hn0mlxyb67h333gbdxp4j4qxsi13q4"))))
669 (build-system gnu-build-system)
671 `(("linenoise" ,linenoise)))
674 #:make-flags (list "CC=gcc"
675 (string-append "PREFIX="
676 (assoc-ref %outputs "out")))
678 (modify-phases %standard-phases
679 (add-after 'unpack 'install-directory-fix
680 (lambda* (#:key outputs #:allow-other-keys)
681 (let* ((out (assoc-ref outputs "out"))
682 (bin (string-append out "/bin")))
683 (substitute* "Makefile"
686 (add-after 'install 'manpage
687 (lambda* (#:key outputs #:allow-other-keys)
688 (install-file "s.1" (string-append (assoc-ref outputs "out")
689 "/share/man/man1"))))
691 (lambda* (#:key inputs outputs #:allow-other-keys)
692 ;; At this point linenoise is meant to be included,
693 ;; so we have to really copy it into the working directory
695 (let* ((linenoise (assoc-ref inputs "linenoise"))
696 (noisepath (string-append linenoise "/include/linenoise"))
697 (out (assoc-ref outputs "out")))
698 (copy-recursively noisepath "linenoise")
700 (("/bin/s") (string-append out "/bin/s")))
702 (home-page "https://github.com/rain-1/s")
703 (synopsis "Extremely minimal shell with the simplest syntax possible")
705 "S is a new shell that aims to be extremely simple.
706 S does not implemnt the POSIX shell standard.
707 There are no globs or \"splatting\" where a variable $FOO turns into multiple
708 command line arguments. One token stays one token forever.
709 This is a \"no surprises\" straightforward approach.
711 There are no redirection operators > in the shell language, they are added as
712 extra programs. > is just another unix command, < is essentially cat(1).
713 A @code{andglob} program is also provided along with s.")
723 (uri (string-append "https://connochaetos.org/oksh/oksh-"
727 "0ln9yf6pxngsviqszv8klnnvn8vcpplvj1njdn8xr2y8frkbw8r3"))))
728 (build-system gnu-build-system)
730 `(; The test files are not part of the distributed tarball.
732 (home-page "https://connochaetos.org/oksh")
733 (synopsis "Port of OpenBSD Korn Shell")
735 "Oksh is a port of the OpenBSD Korn Shell.
736 The OpenBSD Korn Shell is a cleaned up and enhanced ksh.")
747 (url "https://github.com/dimkr/loksh")
749 (file-name (git-file-name name version))
751 (base32 "1a8s64n97ikvvi7ckirxnnjvcmhr3dd4rnqm2ivapyzb0wp42jk7"))))
752 (build-system gnu-build-system)
755 ("ncurses" ,ncurses)))
757 `(("pkg-config" ,pkg-config)))
759 `(#:tests? #f ; no tests included
760 #:make-flags (list "CC=gcc" "HAVE_LIBBSD=1"
761 (string-append "PREFIX="
762 (assoc-ref %outputs "out")))
764 (modify-phases %standard-phases
765 (delete 'configure)))) ; no configure script
766 (home-page "https://github.com/dimkr/loksh")
767 (synopsis "Korn Shell from OpenBSD")
769 "loksh is a Linux port of OpenBSD's @command{ksh}. It is a small,
770 interactive POSIX shell targeted at resource-constrained systems.")
771 ;; The file 'LEGAL' says it is the public domain, and the 2
772 ;; exceptions which are listed are not included in this port.
773 (license public-domain)))
782 (uri (string-append "https://www.mirbsd.org/MirOS/dist/mir/mksh/mksh-R"
785 (base32 "1337zjvzh14yncg9igdry904a3ns52l8rnm1kcq262w7f5xyp2v0"))))
786 (build-system gnu-build-system)
788 `(#:tests? #f ; tests require access to /dev/tty
790 (modify-phases %standard-phases
795 (invoke (which "sh") "Build.sh")))
797 (lambda* (#:key outputs #:allow-other-keys)
798 (let* ((out (assoc-ref outputs "out"))
799 (bin (string-append out "/bin"))
800 (man (string-append out "/share/man/man1")))
801 (install-file "mksh" bin)
802 (with-directory-excursion bin
803 (symlink "mksh" "ksh"))
804 (install-file "mksh.1" man)
806 (home-page "https://www.mirbsd.org/mksh.htm")
807 (synopsis "Korn Shell from MirBSD")
808 (description "mksh is an actively developed free implementation of the
809 Korn Shell programming language and a successor to the Public Domain Korn
817 ;; https://www.oilshell.org/blog/2020/04/release-0.8.pre4.html#comment-on-version-numbering
822 (uri (string-append "https://www.oilshell.org/download/oil-"
825 (base32 "11nfwn5b1w74hv78065jg2zm45mqzi59381b0f649j7n3g7yp3iq"))))
826 (build-system gnu-build-system)
828 `(#:strip-binaries? #f ; strip breaks the binary
830 (modify-phases %standard-phases
832 (lambda* (#:key outputs #:allow-other-keys)
833 (let ((out (assoc-ref outputs "out")))
835 (substitute* "configure"
837 (invoke "./configure" (string-append "--prefix=" out)
838 "--with-readline"))))
840 ;; The tests are not distributed in the tarballs but upstream
841 ;; recommends running this smoke test.
842 ;; https://github.com/oilshell/oil/blob/release/0.8.pre6/INSTALL.txt#L38-L48
844 (let* ((oil "_bin/oil.ovm"))
845 (invoke/quiet oil "osh" "-c" "echo hi")
846 (invoke/quiet oil "osh" "-n" "configure")))))))
848 `(("readline" ,readline)))
849 (home-page "https://www.oilshell.org")
850 (synopsis "Programming language and Bash-compatible Unix shell")
851 (description "Oil is a programming language with automatic translation for
852 Bash. It includes osh, a Unix/POSIX shell that runs unmodified Bash
854 (license (list psfl ; tarball includes python2.7
857 (define-public oil-shell
858 (deprecated-package "oil-shell" oil))
865 (origin (method url-fetch)
866 (uri (string-append "mirror://savannah/gash/gash-"
870 "13m0yz5h9nj3x40mr6wr5xcpq1lscndfwcicw3skrz801025hhgf"))
871 (modules '((guix build utils)))
874 ;; Allow builds with Guile 3.0.
875 (substitute* "configure"
876 (("search=\"2\\.2 2\\.0\"")
877 "search=\"3.0 2.2 2.0\""))
879 (build-system gnu-build-system)
881 `(("pkg-config" ,pkg-config)))
883 `(("guile" ,guile-3.0)))
885 '(#:make-flags '("XFAIL_TESTS=tests/redirects.org")))
886 (home-page "https://savannah.nongnu.org/projects/gash/")
887 (synopsis "POSIX-compatible shell written in Guile Scheme")
888 (description "Gash is a POSIX-compatible shell written in Guile
889 Scheme. It provides both the shell interface, as well as a Guile
890 library for parsing shell scripts. Gash is designed to bootstrap Bash
891 as part of the Guix bootstrap process.")
894 (define-public gash-utils
900 (uri (string-append "mirror://savannah/gash/gash-utils-"
904 "0ib2p52qmbac5n0s5bys4fiwim461ps546976l1n7pwbs0avh7fk"))
905 (patches (search-patches "gash-utils-ls-test.patch"))
906 (modules '((guix build utils)))
909 ;; Allow builds with Guile 3.0.
910 (substitute* "configure"
911 (("search=\"2\\.2 2\\.0\"")
912 "search=\"3.0 2.2 2.0\""))
914 (build-system gnu-build-system)
916 `(("pkg-config" ,pkg-config)))
918 `(("guile" ,guile-3.0)
920 (home-page "https://savannah.nongnu.org/projects/gash/")
921 (synopsis "Core POSIX utilities written in Guile Scheme")
922 (description "Gash-Utils provides Scheme implementations of many
923 common POSIX utilities (there are about 40 of them, ranging in
924 complexity from @command{false} to @command{awk}). The utilities are
925 designed to be capable of bootstrapping their standard GNU counterparts.
926 Underpinning these utilities are many Scheme interfaces for manipulating