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