gnu: unbound: Update to 1.10.1.
[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>
58155312 6;;; Copyright © 2016, 2017, 2018, 2019, 2020 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>
3c986a7d 9;;; Copyright © 2017, 2018 Nikita <nikita@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>
2b9ef6e5 14;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
ee8d86ff 15;;; Copyright © 2019, 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
718a6458 16;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
c356339d
TGR
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)
d754347c 34 #:use-module (gnu packages)
9a57d3e6 35 #:use-module (gnu packages autotools)
d754347c 36 #:use-module (gnu packages base)
1d962fc0 37 #:use-module (gnu packages bash)
e6880040 38 #:use-module (gnu packages bison)
618977ae 39 #:use-module (gnu packages documentation)
28a671ed 40 #:use-module (gnu packages groff)
2ccc9d69 41 #:use-module (gnu packages guile)
cc5a76a7 42 #:use-module (gnu packages libbsd)
c356339d 43 #:use-module (gnu packages libedit)
1d66e7ac 44 #:use-module (gnu packages linux)
618977ae 45 #:use-module (gnu packages ncurses)
7ccb874a 46 #:use-module (gnu packages pcre)
9a57d3e6
TGR
47 #:use-module (gnu packages perl)
48 #:use-module (gnu packages pkg-config)
618977ae 49 #:use-module (gnu packages python)
44d10b1f 50 #:use-module (gnu packages python-xyz)
9a57d3e6 51 #:use-module (gnu packages readline)
52ddeaa0 52 #:use-module (gnu packages scheme)
1d66e7ac 53 #:use-module (guix build-system cmake)
c356339d 54 #:use-module (guix build-system gnu)
1d515855 55 #:use-module (guix build-system python)
1d962fc0 56 #:use-module (guix build-system trivial)
c356339d 57 #:use-module (guix download)
9a57d3e6 58 #:use-module (guix git-download)
c356339d 59 #:use-module (guix licenses)
1d66e7ac
JS
60 #:use-module (guix packages)
61 #:use-module (guix utils))
c356339d
TGR
62
63(define-public dash
64 (package
65 (name "dash")
ade57b69 66 (version "0.5.10.2")
c356339d
TGR
67 (source
68 (origin
da20c38f
LF
69 (method url-fetch)
70 (uri (string-append "http://gondor.apana.org.au/~herbert/dash/files/"
71 "dash-" version ".tar.gz"))
c356339d
TGR
72 (sha256
73 (base32
ade57b69 74 "0wb0bwmqc661hylqcfdp7l7x12myw3vpqk513ncyqrjwvhckjriw"))
c356339d
TGR
75 (modules '((guix build utils)))
76 (snippet
77 '(begin
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"))
83 #t))))
84 (build-system gnu-build-system)
85 (inputs
86 `(("libedit" ,libedit)))
87 (arguments
da20c38f 88 '(#:configure-flags '("--with-libedit")))
c356339d
TGR
89 (home-page "http://gondor.apana.org.au/~herbert/dash")
90 (synopsis "POSIX-compliant shell optimised for size")
91 (description
92 "dash is a POSIX-compliant @command{/bin/sh} implementation that aims to be
93as small as possible, often without sacrificing speed. It is faster than the
94GNU Bourne-Again Shell (@command{bash}) at most scripted tasks. dash is a
95direct descendant of NetBSD's Almquist Shell (@command{ash}).")
96 (license (list bsd-3
97 gpl2+)))) ; mksignames.c
618977ae
TGR
98
99(define-public fish
100 (package
101 (name "fish")
1d66e7ac 102 (version "3.1.0")
e1dba5be
MP
103 (source
104 (origin
105 (method url-fetch)
106 (uri (string-append "https://github.com/fish-shell/fish-shell/"
107 "releases/download/" version "/"
46b39ce8 108 "fish-" version ".tar.gz"))
e1dba5be 109 (sha256
1d66e7ac
JS
110 (base32 "0s2356mlx7fp9kgqgw91lm5ds2i9iq9hq071fbqmcp3875l1xnz5"))))
111 (build-system cmake-build-system)
618977ae 112 (inputs
4bddd12a 113 `(("fish-foreign-env" ,fish-foreign-env)
a8d3bc47 114 ("ncurses" ,ncurses)
e1dba5be
MP
115 ("pcre2" ,pcre2) ; don't use the bundled PCRE2
116 ("python" ,python))) ; for fish_config and manpage completions
117 (native-inputs
1d66e7ac
JS
118 `(("doxygen" ,doxygen)
119 ; for 'fish --help'
120 ("groff" ,groff)))
618977ae 121 (arguments
1d66e7ac 122 '(#:phases
a8d3bc47 123 (modify-phases %standard-phases
1d66e7ac
JS
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))
141 (((string-append
142 "do_test\\(is_potential_path\\("
143 "L\"/usr\", wds, vars, PATH_REQUIRE_DIR\\)\\);"))
144 ""))
145 (substitute*
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")))
154 #t)))
e1dba5be 155 ;; Source /etc/fish/config.fish from $__fish_sysconf_dir/config.fish.
1d66e7ac 156 (add-after 'patch-tests 'patch-fish-config
e1dba5be
MP
157 (lambda _
158 (let ((port (open-file "etc/config.fish" "a")))
159 (display (string-append
160 "\n\n"
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"
165 "end\n")
166 port)
167 (close-port port))
168 #t))
1d66e7ac
JS
169 ;; Embed absolute paths.
170 (add-before 'install 'embed-absolute-paths
171 (lambda _
172 (substitute* "share/functions/__fish_print_help.fish"
173 (("nroff") (which "nroff")))
174 #t))
e1dba5be
MP
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
178 (lambda _
179 (let ((port (open-file "share/__fish_build_paths.fish" "a")))
180 (display
181 (string-append
182 "\n\n"
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_*"
186 " variables.\n"
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")
201 port)
202 (close-port port))
4bddd12a
MP
203 #t))
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")))
208 (display
209 (string-append
210 "\n\n"
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"
219 "end\n")
220 port)
221 (close-port port))
4f4bca0f 222 #t)))))
618977ae
TGR
223 (synopsis "The friendly interactive shell")
224 (description
225 "Fish (friendly interactive shell) is a shell focused on interactive use,
226discoverability, and friendliness. Fish has very user-friendly and powerful
227tab-completion, including descriptions of every completion, completion of
228strings with wildcards, and many completions for specific commands. It also
50786325
TGR
229has extensive and discoverable help. A special @command{help} command gives
230access to all the fish documentation in your web browser. Other features
231include smart terminal handling based on terminfo, an easy to search history,
232and syntax highlighting.")
618977ae
TGR
233 (home-page "https://fishshell.com/")
234 (license gpl2)))
9a57d3e6 235
1d962fc0
MP
236(define-public fish-foreign-env
237 (package
238 (name "fish-foreign-env")
239 (version "0.20190116")
240 (source
241 (origin
242 (method git-fetch)
243 (uri (git-reference
244 (url "https://github.com/oh-my-fish/plugin-foreign-env.git")
245 (commit "dddd9213272a0ab848d474d0cbde12ad034e65bc")))
246 (file-name (git-file-name name version))
247 (sha256
248 (base32 "00xqlyl3lffc5l0viin1nyp819wf81fncqyz87jx8ljjdhilmgbs"))))
249 (build-system trivial-build-system)
250 (arguments
251 '(#:modules ((guix build utils))
252 #:builder
253 (begin
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")))
258 (mkdir-p func-path)
259 (copy-recursively (string-append source "/functions")
260 func-path)
261
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"))
266 (("bash")
267 (string-append (assoc-ref %build-inputs "bash") "/bin/bash"))
268 (("sed")
269 (string-append (assoc-ref %build-inputs "sed") "/bin/sed"))
270 ((" tr ")
271 (string-append " " (assoc-ref %build-inputs "coreutils")
272 "/bin/tr ")))))))
273 (inputs
274 `(("bash" ,bash)
275 ("coreutils" ,coreutils)
276 ("sed" ,sed)))
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
280that environment variables that are exported or modified get imported back
281into fish.")
282 (license expat)))
283
9a57d3e6
TGR
284(define-public rc
285 (package
286 (name "rc")
287 (version "1.7.4")
288 (source (origin
289 (method git-fetch)
290 (uri (git-reference
5f13bf09 291 (url "https://github.com/rakitzis/rc.git")
487cf5aa 292 (commit (string-append "v" version))))
9a57d3e6
TGR
293 (sha256
294 (base32
487cf5aa
TGR
295 "0vj1h4pcg13vxsiydmmk87dr2sra9h4gwx0c4q6fjsiw4in78rrd"))
296 (file-name (git-file-name name version))))
9a57d3e6
TGR
297 (build-system gnu-build-system)
298 (arguments
299 `(#:configure-flags
300 '("--with-edit=gnu")
301 #:phases
302 (modify-phases %standard-phases
487cf5aa 303 (add-before 'bootstrap 'patch-trip.rc
9a57d3e6
TGR
304 (lambda _
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")) ")")))
310 #t)))))
311 (inputs `(("readline" ,readline)
312 ("perl" ,perl)))
313 (native-inputs `(("autoconf" ,autoconf)
314 ("automake" ,automake)
315 ("libtool" ,libtool)
316 ("pkg-config" ,pkg-config)))
317 (synopsis "Alternative implementation of the rc shell by Byron Rakitzis")
318 (description
319 "This is a reimplementation by Byron Rakitzis of the Plan 9 shell. It
320has a small feature set similar to a traditional Bourne shell.")
7bf837fd 321 (home-page "https://github.com/rakitzis/rc")
9a57d3e6 322 (license zlib)))
d754347c 323
e6880040 324(define-public es
325 (package
326 (name "es")
327 (version "0.9.1")
328 (source
329 (origin
330 (method url-fetch)
331 (uri (string-append "https://github.com/wryun/es-shell/releases/"
332 "download/v" version "/es-" version ".tar.gz"))
333 (sha256
334 (base32
335 "1fplzxc6lncz2lv2fyr2ig23rgg5j96rm2bbl1rs28mik771zd5h"))
336 (file-name (string-append name "-" version ".tar.gz"))))
337 (build-system gnu-build-system)
338 (arguments
339 `(#:test-target "test"
340 #:phases
341 (modify-phases %standard-phases
342 (add-before 'configure 're-enter-rootdir
343 ;; The tarball has no folder.
344 (lambda _
345 (chdir ".."))))))
346 (inputs
347 `(("readline" ,readline)))
348 (native-inputs
349 `(("bison" ,bison)))
350 (synopsis "Extensible shell with higher-order functions")
351 (description
352 "Es is an extensible shell. The language was derived from the Plan 9
353shell, rc, and was influenced by functional programming languages, such as
354Scheme, and the Tcl embeddable programming language. This implementation is
355derived from Byron Rakitzis's public domain implementation of rc, and was
356written by Paul Haahr and Byron Rakitzis.")
357 (home-page "https://wryun.github.io/es-shell/")
358 (license public-domain)))
359
d754347c
TGR
360(define-public tcsh
361 (package
362 (name "tcsh")
d098aa3e 363 (version "6.22.02")
d754347c
TGR
364 (source (origin
365 (method url-fetch)
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")))
371 (sha256
372 (base32
d098aa3e
MB
373 "0nw8prz1n0lmr82wnpyhrzmki630afn7p9cfgr3vl00vr9c72a7d"))
374 (patches (search-patches "tcsh-fix-autotest.patch"))
d754347c
TGR
375 (patch-flags '("-p0"))))
376 (build-system gnu-build-system)
816417f5 377 (native-inputs
d754347c 378 `(("autoconf" ,autoconf)
816417f5
LF
379 ("perl" ,perl)))
380 (inputs
381 `(("ncurses" ,ncurses)))
d754347c
TGR
382 (arguments
383 `(#:phases
c71011f8 384 (modify-phases %standard-phases
2b9ef6e5
MO
385 ,@(if (%current-target-system)
386 '((add-before 'configure 'set-cross-cc
387 (lambda _
388 (substitute* "configure"
389 (("CC_FOR_GETHOST=\"cc\"")
390 "CC_FOR_GETHOST=\"gcc\""))
391 #t)))
392 '())
c71011f8
LF
393 (add-before 'check 'patch-test-scripts
394 (lambda _
395 ;; Take care of pwd
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
c22f655f 404 (invoke "make" "tests/testsuite")
d754347c 405
c71011f8
LF
406 ;; This file is ISO-8859-1 encoded.
407 (with-fluids ((%default-port-encoding #f))
408 (substitute* "tests/testsuite"
409 (("/bin/sh") (which "sh"))))
410 #t))
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"))
417 #t))))))
cf566106 418 (home-page "https://www.tcsh.org/")
d754347c
TGR
419 (synopsis "Unix shell based on csh")
420 (description
421 "Tcsh is an enhanced, but completely compatible version of the Berkeley
422UNIX C shell (csh). It is a command language interpreter usable both as an
423interactive login shell and a shell script command processor. It includes a
424command-line editor, programmable word completion, spelling correction, a
425history mechanism, job control and a C-like syntax.")
426 (license bsd-4)))
7ccb874a
TGR
427
428(define-public zsh
429 (package
430 (name "zsh")
f37d089b 431 (version "5.8")
7ccb874a
TGR
432 (source (origin
433 (method url-fetch)
434 (uri (list (string-append
4dbef671 435 "https://www.zsh.org/pub/zsh-" version
379848ed 436 ".tar.xz")
7ccb874a 437 (string-append
4dbef671 438 "https://www.zsh.org/pub/old/zsh-" version
379848ed 439 ".tar.xz")))
7ccb874a
TGR
440 (sha256
441 (base32
f37d089b 442 "09yyaadq738zlrnlh1hd3ycj1mv3q5hh4xl1ank70mjnqm6bbi6w"))))
7ccb874a 443 (build-system gnu-build-system)
81bc9118
BW
444 (arguments `(#:configure-flags '("--with-tcsetpgrp" "--enable-pcre"
445 "--enable-maildir-support")
ddee9a6e
TGR
446 #:phases
447 (modify-phases %standard-phases
448 (add-before 'configure 'fix-sh
449 (lambda _
450 ;; Some of the files are ISO-8859-1 encoded.
451 (with-fluids ((%default-port-encoding #f))
452 (substitute*
453 '("configure"
454 "configure.ac"
455 "Src/exec.c"
456 "Src/mkmakemod.sh"
457 "Config/installfns.sh"
458 "Config/defs.mk.in"
459 "Test/E01options.ztst"
460 "Test/A05execution.ztst"
461 "Test/A01grammar.ztst"
462 "Test/A06assign.ztst"
463 "Test/B02typeset.ztst"
464 "Completion/Unix/Command/_init_d"
465 "Util/preconfig")
4440e40c
LF
466 (("/bin/sh") (which "sh"))))))
467 (add-before 'check 'patch-test
468 (lambda _
469 ;; In Zsh, `command -p` searches a predefined set of
470 ;; paths that don't exist in the build environment. See
471 ;; the assignment of 'path' in Src/init.c'
472 (substitute* "Test/A01grammar.ztst"
473 (("command -pv") "command -v")
474 (("command -p") "command ")
475 (("'command' -p") "'command' "))
476 #t)))))
7ccb874a
TGR
477 (native-inputs `(("autoconf" ,autoconf)))
478 (inputs `(("ncurses" ,ncurses)
479 ("pcre" ,pcre)
480 ("perl" ,perl)))
481 (synopsis "Powerful shell for interactive use and scripting")
482 (description "The Z shell (zsh) is a Unix shell that can be used
483as an interactive login shell and as a powerful command interpreter
484for shell scripting. Zsh can be thought of as an extended Bourne shell
485with a large number of improvements, including some features of bash,
486ksh, and tcsh.")
4dbef671 487 (home-page "https://www.zsh.org/")
7ccb874a
TGR
488
489 ;; The whole thing is under an MIT/X11-style license, but there's one
490 ;; command, 'Completion/Unix/Command/_darcs', which is under GPLv2+.
491 (license gpl2+)))
1d515855
SR
492
493(define-public xonsh
494 (package
495 (name "xonsh")
72faca2c 496 (version "0.9.18")
1d515855
SR
497 (source
498 (origin
499 (method url-fetch)
500 (uri (pypi-uri "xonsh" version))
501 (sha256
502 (base32
72faca2c 503 "1h4rrwzwiwkyi9p49sjn97rl39fqq2r23hchzsw0s3fcwa7m8fkj"))
cfb7e269
DM
504 (modules '((guix build utils)))
505 (snippet
506 `(begin
72faca2c 507 ;; Delete bundled PLY.
cfb7e269 508 (delete-file-recursively "xonsh/ply")
72faca2c
TGR
509 (substitute* "setup.py"
510 (("\"xonsh\\.ply\\.ply\",") ""))
511 ;; Use our properly packaged PLY instead.
512 (substitute* (list "setup.py"
513 "tests/test_lexer.py"
514 "xonsh/__amalgam__.py"
515 "xonsh/lexer.py"
516 "xonsh/parsers/base.py"
517 "xonsh/xonfig.py")
518 (("from xonsh\\.ply\\.(.*) import" _ module)
519 (format #f "from ~a import" module))
520 (("from xonsh\\.ply import") "import"))
cfb7e269 521 #t))))
1d515855 522 (build-system python-build-system)
792e6079
LF
523 (arguments
524 '(;; TODO Try running run the test suite.
525 ;; See 'requirements-tests.txt' in the source distribution for more
526 ;; information.
527 #:tests? #f))
cfb7e269
DM
528 (inputs
529 `(("python-ply" ,python-ply)))
9a50f47c 530 (home-page "https://xon.sh/")
1d515855
SR
531 (synopsis "Python-ish shell")
532 (description
533 "Xonsh is a Python-ish, BASHwards-looking shell language and command
e813f395
KK
534prompt. The language is a superset of Python 3.4+ with additional shell
535primitives that you are used to from Bash and IPython. It works on all major
536systems including Linux, Mac OSX, and Windows. Xonsh is meant for the daily
1d515855
SR
537use of experts and novices alike.")
538 (license bsd-2)))
52ddeaa0 539
540(define-public scsh
541 (let ((commit "114432435e4eadd54334df6b37fcae505079b49f")
542 (revision "1"))
543 (package
544 (name "scsh")
545 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
546 (source
547 (origin
548 (method git-fetch)
549 (uri (git-reference
550 (url "https://github.com/scheme/scsh")
551 (commit commit)))
552 (file-name (string-append name "-" version "-checkout"))
553 (sha256
554 (base32
555 "1ghk08akiz7hff1pndi8rmgamgcrn2mv9asbss9l79d3c2iaav3q"))))
556 (build-system gnu-build-system)
557 (arguments
558 `(#:test-target "test"
559 #:phases
560 (modify-phases %standard-phases
561 (add-before 'configure 'replace-rx
562 (lambda* (#:key inputs #:allow-other-keys)
563 (let* ((rx (assoc-ref inputs "scheme48-rx"))
564 (rxpath (string-append rx "/share/scheme48-"
565 ,(package-version scheme48)
566 "/rx")))
567 (delete-file-recursively "rx")
568 (symlink rxpath "rx"))
bc74e9e4 569 #t)))))
52ddeaa0 570 (inputs
571 `(("scheme48" ,scheme48)
572 ("scheme48-rx" ,scheme48-rx)))
573 (native-inputs
574 `(("autoconf" ,autoconf)
575 ("automake" ,automake)))
576 (home-page "https://github.com/scheme/scsh")
577 (synopsis "Unix shell embedded in Scheme")
578 (description
579 "Scsh is a Unix shell embedded in Scheme. Scsh has two main
580components: a process notation for running programs and setting up pipelines
581and redirections, and a complete syscall library for low-level access to the
582operating system.")
583 (license bsd-3))))
cc5a76a7 584
17cf788f 585(define-public linenoise
05af41a1 586 (let ((commit "2105ce445821381cf1bca87b6d386d4ea88ee20d")
587 (revision "1"))
588 (package
589 (name "linenoise")
590 (version (string-append "1.0-" revision "." (string-take commit 7)))
591 (source
592 (origin
593 (method git-fetch)
594 (uri (git-reference
595 (url "https://github.com/antirez/linenoise")
596 (commit commit)))
597 (file-name (string-append name "-" version "-checkout"))
598 (sha256
599 (base32
600 "1z16qwix8z6a40fskdgxsibkqgdrp4q6ncp4n6hnv4r9iihy2d8r"))))
601 (build-system gnu-build-system)
602 (arguments
603 `(#:tests? #f ;No tests are included
604 #:make-flags (list "CC=gcc")
605 #:phases
606 (modify-phases %standard-phases
607 (delete 'configure)
608 (replace 'install
609 (lambda* (#:key outputs #:allow-other-keys)
610 ;; At the moment there is no 'make install' in upstream.
611 (let* ((out (assoc-ref outputs "out")))
612 (install-file "linenoise.h"
613 (string-append out "/include/linenoise"))
614 (install-file "linenoise.c"
615 (string-append out "/include/linenoise"))
616 #t))))))
617 (home-page "https://github.com/antirez/linenoise")
618 (synopsis "Minimal zero-config readline replacement")
619 (description
620 "Linenoise is a minimal, zero-config, readline replacement.
17cf788f 621Its features include:
622
623@enumerate
624@item Single and multi line editing mode with the usual key bindings
625@item History handling
626@item Completion
627@item Hints (suggestions at the right of the prompt as you type)
628@item A subset of VT100 escapes, ANSI.SYS compatible
629@end enumerate\n")
05af41a1 630 (license bsd-2))))
17cf788f 631
9a68fb6c 632(define-public s-shell
e536b1d3 633 (let ((commit "da2e5c20c0c5f477ec3426dc2584889a789b1659")
634 (revision "2"))
0e4591bb 635 (package
9a68fb6c 636 (name "s-shell")
e536b1d3 637 (version (git-version "0.0.0" revision commit))
0e4591bb 638 (source
639 (origin
640 (method git-fetch)
641 (uri (git-reference
642 (url "https://github.com/rain-1/s")
643 (commit commit)))
644 (file-name (string-append name "-" version "-checkout"))
645 (sha256
646 (base32
e536b1d3 647 "0qiny71ww5nhzy4mnc8652hn0mlxyb67h333gbdxp4j4qxsi13q4"))))
0e4591bb 648 (build-system gnu-build-system)
649 (inputs
650 `(("linenoise" ,linenoise)))
651 (arguments
652 `(#:tests? #f
e536b1d3 653 #:make-flags (list "CC=gcc"
654 (string-append "PREFIX="
655 (assoc-ref %outputs "out")))
0e4591bb 656 #:phases
657 (modify-phases %standard-phases
658 (add-after 'unpack 'install-directory-fix
659 (lambda* (#:key outputs #:allow-other-keys)
660 (let* ((out (assoc-ref outputs "out"))
661 (bin (string-append out "/bin")))
662 (substitute* "Makefile"
663 (("out") bin))
664 #t)))
665 (add-after 'install 'manpage
666 (lambda* (#:key outputs #:allow-other-keys)
667 (install-file "s.1" (string-append (assoc-ref outputs "out")
668 "/share/man/man1"))))
669 (replace 'configure
670 (lambda* (#:key inputs outputs #:allow-other-keys)
671 ;; At this point linenoise is meant to be included,
672 ;; so we have to really copy it into the working directory
673 ;; of s.
674 (let* ((linenoise (assoc-ref inputs "linenoise"))
675 (noisepath (string-append linenoise "/include/linenoise"))
676 (out (assoc-ref outputs "out")))
677 (copy-recursively noisepath "linenoise")
678 (substitute* "s.c"
679 (("/bin/s") (string-append out "/bin/s")))
680 #t))))))
681 (home-page "https://github.com/rain-1/s")
682 (synopsis "Extremely minimal shell with the simplest syntax possible")
683 (description
684 "S is a new shell that aims to be extremely simple.
685S does not implemnt the POSIX shell standard.
686There are no globs or \"splatting\" where a variable $FOO turns into multiple
687command line arguments. One token stays one token forever.
688This is a \"no surprises\" straightforward approach.
689
690There are no redirection operators > in the shell language, they are added as
691extra programs. > is just another unix command, < is essentially cat(1).
692A @code{andglob} program is also provided along with s.")
693 (license bsd-3))))
694
7e3c977d 695(define-public oksh
696 (package
697 (name "oksh")
698 (version "0.5.9")
699 (source
700 (origin
701 (method url-fetch)
702 (uri (string-append "https://connochaetos.org/oksh/oksh-"
703 version ".tar.gz"))
704 (sha256
705 (base32
706 "0ln9yf6pxngsviqszv8klnnvn8vcpplvj1njdn8xr2y8frkbw8r3"))))
707 (build-system gnu-build-system)
708 (arguments
709 `(; The test files are not part of the distributed tarball.
710 #:tests? #f))
711 (home-page "https://connochaetos.org/oksh")
712 (synopsis "Port of OpenBSD Korn Shell")
713 (description
714 "Oksh is a port of the OpenBSD Korn Shell.
715The OpenBSD Korn Shell is a cleaned up and enhanced ksh.")
716 (license gpl3+)))
717
cc5a76a7 718(define-public loksh
719 (package
720 (name "loksh")
3ed134c4 721 (version "6.6")
cc5a76a7 722 (source
723 (origin
e5d75770
TGR
724 (method git-fetch)
725 (uri (git-reference
726 (url "https://github.com/dimkr/loksh.git")
727 (commit version)))
728 (file-name (git-file-name name version))
cc5a76a7 729 (sha256
3ed134c4 730 (base32 "1a8s64n97ikvvi7ckirxnnjvcmhr3dd4rnqm2ivapyzb0wp42jk7"))))
cc5a76a7 731 (build-system gnu-build-system)
732 (inputs
716cd19a
TGR
733 `(("libbsd" ,libbsd)
734 ("ncurses" ,ncurses)))
cc5a76a7 735 (native-inputs
736 `(("pkg-config" ,pkg-config)))
737 (arguments
f437e39a 738 `(#:tests? #f ; no tests included
cc5a76a7 739 #:make-flags (list "CC=gcc" "HAVE_LIBBSD=1"
f437e39a
TGR
740 (string-append "PREFIX="
741 (assoc-ref %outputs "out")))
cc5a76a7 742 #:phases
743 (modify-phases %standard-phases
f437e39a 744 (delete 'configure)))) ; no configure script
cc5a76a7 745 (home-page "https://github.com/dimkr/loksh")
746 (synopsis "Korn Shell from OpenBSD")
747 (description
748 "loksh is a Linux port of OpenBSD's @command{ksh}. It is a small,
749interactive POSIX shell targeted at resource-constrained systems.")
750 ;; The file 'LEGAL' says it is the public domain, and the 2
751 ;; exceptions which are listed are not included in this port.
752 (license public-domain)))
0daa1d64
AI
753
754(define-public mksh
755 (package
756 (name "mksh")
a4dd5955 757 (version "58")
0daa1d64
AI
758 (source
759 (origin
760 (method url-fetch)
761 (uri (string-append "https://www.mirbsd.org/MirOS/dist/mir/mksh/mksh-R"
762 version ".tgz"))
763 (sha256
a4dd5955 764 (base32 "1337zjvzh14yncg9igdry904a3ns52l8rnm1kcq262w7f5xyp2v0"))))
0daa1d64
AI
765 (build-system gnu-build-system)
766 (arguments
e7dfbae8 767 `(#:tests? #f ; tests require access to /dev/tty
0daa1d64
AI
768 #:phases
769 (modify-phases %standard-phases
770 (delete 'configure)
771 (replace 'build
772 (lambda _
773 (setenv "CC" "gcc")
2385ecb2 774 (invoke (which "sh") "Build.sh")))
0daa1d64
AI
775 (replace 'install
776 (lambda* (#:key outputs #:allow-other-keys)
777 (let* ((out (assoc-ref outputs "out"))
778 (bin (string-append out "/bin"))
779 (man (string-append out "/share/man/man1")))
780 (install-file "mksh" bin)
781 (with-directory-excursion bin
782 (symlink "mksh" "ksh"))
2385ecb2
TGR
783 (install-file "mksh.1" man)
784 #t))))))
0daa1d64
AI
785 (home-page "https://www.mirbsd.org/mksh.htm")
786 (synopsis "Korn Shell from MirBSD")
787 (description "mksh is an actively developed free implementation of the
788Korn Shell programming language and a successor to the Public Domain Korn
789Shell (pdksh).")
790 (license (list miros
e7dfbae8 791 isc)))) ; strlcpy.c
18d9d22a 792
5225626f 793(define-public oil
18d9d22a 794 (package
5225626f 795 (name "oil")
58155312 796 (version "0.7.0")
18d9d22a
LF
797 (source (origin
798 (method url-fetch)
799 (uri (string-append "https://www.oilshell.org/download/oil-"
800 version ".tar.xz"))
801 (sha256
802 (base32
58155312 803 "12c9s462879adb6mwd3fqafk0dnqsm16s18rhym6cmzfzy8v8zm3"))))
18d9d22a
LF
804 (build-system gnu-build-system)
805 (arguments
806 '(#:tests? #f ; the tests are not distributed in the tarballs
807 #:strip-binaries? #f ; the binaries cannot be stripped
808 #:phases
809 (modify-phases %standard-phases
810 (add-after 'unpack 'patch-compiler-invocation
811 (lambda _
812 (substitute* "configure"
813 ((" cc ") " gcc "))
814 #t))
815 (replace 'configure
816 (lambda* (#:key outputs #:allow-other-keys)
817 (let ((out (assoc-ref outputs "out")))
818 (setenv "CC" "gcc")
819 ;; The configure script doesn't recognize CONFIG_SHELL.
820 (setenv "CONFIG_SHELL" (which "sh"))
821 (invoke "./configure" (string-append "--prefix=" out)
822 "--with-readline"))))
823 (add-before 'install 'make-destination
824 (lambda _
825 ;; The build scripts don't create the destination directory.
826 (mkdir-p (string-append (assoc-ref %outputs "out") "/bin")))))))
827 (inputs
828 `(("readline" ,readline)))
829 (synopsis "Bash-compatible Unix shell")
830 (description "Oil is a Unix / POSIX shell, compatible with Bash. It
831implements the Oil language, which is a new shell language to which Bash can be
832automatically translated. The Oil language is a superset of Bash. It also
833implements the OSH language, a statically-parseable language based on Bash as it
834is commonly written.")
835 (home-page "https://www.oilshell.org/")
836 (license (list psfl ; The Oil sources include a patched Python 2 source tree
837 asl2.0))))
2ccc9d69 838
5225626f
RP
839(define-public oil-shell
840 (deprecated-package "oil-shell" oil))
841
2ccc9d69
TS
842(define-public gash
843 (package
844 (name "gash")
d0a26d0b 845 (version "0.2.0")
2ccc9d69
TS
846 (source
847 (origin (method url-fetch)
848 (uri (string-append "mirror://savannah/gash/gash-"
849 version ".tar.gz"))
850 (sha256
851 (base32
d0a26d0b
JN
852 "13m0yz5h9nj3x40mr6wr5xcpq1lscndfwcicw3skrz801025hhgf"))
853 (modules '((guix build utils)))))
2ccc9d69
TS
854 (build-system gnu-build-system)
855 (native-inputs
856 `(("pkg-config" ,pkg-config)))
857 (inputs
858 `(("guile" ,guile-2.2)))
d0a26d0b
JN
859 (arguments
860 '(#:make-flags '("XFAIL_TESTS=tests/redirects.org")))
2ccc9d69
TS
861 (home-page "https://savannah.nongnu.org/projects/gash/")
862 (synopsis "POSIX-compatible shell written in Guile Scheme")
863 (description "Gash is a POSIX-compatible shell written in Guile
864Scheme. It provides both the shell interface, as well as a Guile
865library for parsing shell scripts. Gash is designed to bootstrap Bash
866as part of the Guix bootstrap process.")
867 (license gpl3+)))
ee8d86ff
JN
868
869(define-public gash-utils
870 (package
871 (name "gash-utils")
872 (version "0.1.0")
873 (source (origin
874 (method url-fetch)
875 (uri (string-append "mirror://savannah/gash/gash-utils-"
876 version ".tar.gz"))
877 (sha256
878 (base32
879 "0ib2p52qmbac5n0s5bys4fiwim461ps546976l1n7pwbs0avh7fk"))))
880 (build-system gnu-build-system)
881 (native-inputs
882 `(("pkg-config" ,pkg-config)))
883 (inputs
884 `(("guile" ,guile-2.2)
885 ("gash" ,gash)))
886 (home-page "https://savannah.nongnu.org/projects/gash/")
887 (synopsis "Core POSIX utilities written in Guile Scheme")
888 (description "Gash-Utils provides Scheme implementations of many
889common POSIX utilities (there are about 40 of them, ranging in
890complexity from @command{false} to @command{awk}). The utilities are
891designed to be capable of bootstrapping their standard GNU counterparts.
892Underpinning these utilities are many Scheme interfaces for manipulating
893files and text.")
894 (license gpl3+)))
d98205b4 895