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