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