gnu: python-pandas: Fix build on 32-bit.
[jackhill/guix/guix.git] / gnu / packages / shells.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
3 ;;; Copyright © 2014, 2015 David Thompson <davet@gnu.org>
4 ;;; Copyright © 2014 Kevin Lemonnier <lemonnierk@ulrar.net>
5 ;;; Copyright © 2015 Jeff Mickey <j@codemac.net>
6 ;;; Copyright © 2016 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2016 Stefan Reichör <stefan@xsteve.at>
8 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
9 ;;; Copyright © 2017 ng0 <contact.ng0@cryptolab.net>
10 ;;;
11 ;;; This file is part of GNU Guix.
12 ;;;
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
17 ;;;
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
22 ;;;
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25
26 (define-module (gnu packages shells)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages algebra)
29 #:use-module (gnu packages autotools)
30 #:use-module (gnu packages base)
31 #:use-module (gnu packages bison)
32 #:use-module (gnu packages documentation)
33 #:use-module (gnu packages libedit)
34 #:use-module (gnu packages ncurses)
35 #:use-module (gnu packages pcre)
36 #:use-module (gnu packages perl)
37 #:use-module (gnu packages pkg-config)
38 #:use-module (gnu packages python)
39 #:use-module (gnu packages readline)
40 #:use-module (gnu packages scheme)
41 #:use-module (guix build-system gnu)
42 #:use-module (guix build-system python)
43 #:use-module (guix download)
44 #:use-module (guix git-download)
45 #:use-module (guix licenses)
46 #:use-module (guix packages))
47
48 (define-public dash
49 (package
50 (name "dash")
51 (version "0.5.9")
52 (source
53 (origin
54 (method url-fetch)
55 (uri (string-append "http://gondor.apana.org.au/~herbert/dash/files/"
56 name "-" version ".tar.gz"))
57 (sha256
58 (base32
59 "17328wd9n5krr5wd37smrk0y7fdf8aa3hmhm02br5mqpq0a3nycj"))
60 (modules '((guix build utils)))
61 (snippet
62 '(begin
63 ;; The man page hails from BSD, where (d)ash is the default shell.
64 ;; This isn't the case on Guix or indeed most other GNU systems.
65 (substitute* "src/dash.1"
66 (("the standard command interpreter for the system")
67 "a command interpreter based on the original Bourne shell"))
68 #t))))
69 (build-system gnu-build-system)
70 (inputs
71 `(("libedit" ,libedit)))
72 (arguments
73 `(#:configure-flags '("--with-libedit")))
74 (home-page "http://gondor.apana.org.au/~herbert/dash")
75 (synopsis "POSIX-compliant shell optimised for size")
76 (description
77 "dash is a POSIX-compliant @command{/bin/sh} implementation that aims to be
78 as small as possible, often without sacrificing speed. It is faster than the
79 GNU Bourne-Again Shell (@command{bash}) at most scripted tasks. dash is a
80 direct descendant of NetBSD's Almquist Shell (@command{ash}).")
81 (license (list bsd-3
82 gpl2+)))) ; mksignames.c
83
84 (define-public fish
85 (package
86 (name "fish")
87 (version "2.5.0")
88 (source (origin
89 (method url-fetch)
90 (uri (string-append "https://fishshell.com/files/"
91 version "/fish-" version ".tar.gz"))
92 (sha256
93 (base32
94 "19djav128nkhjxgfhwhc32i5y9d9c3karbh5yg67kqrdranyvh7q"))
95 (modules '((guix build utils)))
96 ;; Don't try to install /etc/fish/config.fish.
97 (snippet
98 '(substitute* "Makefile.in"
99 ((".*INSTALL.*sysconfdir.*fish.*") "")))))
100 (build-system gnu-build-system)
101 (native-inputs
102 `(("doxygen" ,doxygen)))
103 (inputs
104 `(("bc" ,bc)
105 ("ncurses" ,ncurses)
106 ("pcre2" ,pcre2) ;don't use the bundled PCRE2
107 ("python" ,python-wrapper))) ;for fish_config and manpage completions
108 (arguments
109 '(#:tests? #f ; no check target
110 #:configure-flags '("--sysconfdir=/etc")
111 #:phases
112 (modify-phases %standard-phases
113 ;; Embed absolute paths to store items.
114 (add-after 'unpack 'embed-store-paths
115 (lambda* (#:key inputs outputs #:allow-other-keys)
116 (substitute* '("share/functions/math.fish"
117 "share/functions/seq.fish")
118 (("\\| bc")
119 (string-append "| " (assoc-ref %build-inputs "bc")
120 "/bin/bc")))
121 (substitute* "share/functions/fish_update_completions.fish"
122 (("python") (which "python")))
123 #t)))))
124 (synopsis "The friendly interactive shell")
125 (description
126 "Fish (friendly interactive shell) is a shell focused on interactive use,
127 discoverability, and friendliness. Fish has very user-friendly and powerful
128 tab-completion, including descriptions of every completion, completion of
129 strings with wildcards, and many completions for specific commands. It also
130 has extensive and discoverable help. A special help command gives access to
131 all the fish documentation in your web browser. Other features include smart
132 terminal handling based on terminfo, an easy to search history, and syntax
133 highlighting.")
134 (home-page "https://fishshell.com/")
135 (license gpl2)))
136
137 (define-public rc
138 (package
139 (name "rc")
140 (version "1.7.4")
141 (source (origin
142 (method git-fetch)
143 (uri (git-reference
144 (url "git://github.com/rakitzis/rc.git")
145 ;; commit name 'release: rc-1.7.4'
146 (commit "c884da53a7c885d46ace2b92de78946855b18e92")))
147 (sha256
148 (base32
149 "00mgzvrrh9w96xa85g4gjbsvq02f08k4jwjcdnxq7kyh5xgiw95l"))
150 (file-name (string-append name "-" version "-checkout"))))
151 (build-system gnu-build-system)
152 (arguments
153 `(#:configure-flags
154 '("--with-edit=gnu")
155 #:phases
156 (modify-phases %standard-phases
157 (add-after
158 'unpack 'autoreconf
159 (lambda _ (zero? (system* "autoreconf" "-vfi"))))
160 (add-before
161 'autoreconf 'patch-trip.rc
162 (lambda _
163 (substitute* "trip.rc"
164 (("/bin/pwd") (which "pwd"))
165 (("/bin/sh") (which "sh"))
166 (("/bin/rm") (which "rm"))
167 (("/bin\\)") (string-append (dirname (which "rm")) ")")))
168 #t)))))
169 (inputs `(("readline" ,readline)
170 ("perl" ,perl)))
171 (native-inputs `(("autoconf" ,autoconf)
172 ("automake" ,automake)
173 ("libtool" ,libtool)
174 ("pkg-config" ,pkg-config)))
175 (synopsis "Alternative implementation of the rc shell by Byron Rakitzis")
176 (description
177 "This is a reimplementation by Byron Rakitzis of the Plan 9 shell. It
178 has a small feature set similar to a traditional Bourne shell.")
179 (home-page "http://github.com/rakitzis/rc")
180 (license zlib)))
181
182 (define-public es
183 (package
184 (name "es")
185 (version "0.9.1")
186 (source
187 (origin
188 (method url-fetch)
189 (uri (string-append "https://github.com/wryun/es-shell/releases/"
190 "download/v" version "/es-" version ".tar.gz"))
191 (sha256
192 (base32
193 "1fplzxc6lncz2lv2fyr2ig23rgg5j96rm2bbl1rs28mik771zd5h"))
194 (file-name (string-append name "-" version ".tar.gz"))))
195 (build-system gnu-build-system)
196 (arguments
197 `(#:test-target "test"
198 #:phases
199 (modify-phases %standard-phases
200 (add-before 'configure 're-enter-rootdir
201 ;; The tarball has no folder.
202 (lambda _
203 (chdir ".."))))))
204 (inputs
205 `(("readline" ,readline)))
206 (native-inputs
207 `(("bison" ,bison)))
208 (synopsis "Extensible shell with higher-order functions")
209 (description
210 "Es is an extensible shell. The language was derived from the Plan 9
211 shell, rc, and was influenced by functional programming languages, such as
212 Scheme, and the Tcl embeddable programming language. This implementation is
213 derived from Byron Rakitzis's public domain implementation of rc, and was
214 written by Paul Haahr and Byron Rakitzis.")
215 (home-page "https://wryun.github.io/es-shell/")
216 (license public-domain)))
217
218 (define-public tcsh
219 (package
220 (name "tcsh")
221 (replacement tcsh/fixed)
222 (version "6.18.01")
223 (source (origin
224 (method url-fetch)
225 ;; Old tarballs are moved to old/.
226 (uri (list (string-append "ftp://ftp.astron.com/pub/tcsh/"
227 "tcsh-" version ".tar.gz")
228 (string-append "ftp://ftp.astron.com/pub/tcsh/"
229 "old/tcsh-" version ".tar.gz")))
230 (sha256
231 (base32
232 "1a4z9kwgx1iqqzvv64si34m60gj34p7lp6rrcrb59s7ka5wa476q"))
233 (patches (search-patches "tcsh-fix-autotest.patch"
234 "tcsh-do-not-define-BSDWAIT.patch"))
235 (patch-flags '("-p0"))))
236 (build-system gnu-build-system)
237 (inputs
238 `(("autoconf" ,autoconf)
239 ("coreutils" ,coreutils)
240 ("ncurses" ,ncurses)))
241 (arguments
242 `(#:phases
243 (alist-cons-before
244 'check 'patch-test-scripts
245 (lambda _
246 ;; Take care of pwd
247 (substitute* '("tests/commands.at" "tests/variables.at")
248 (("/bin/pwd") (which "pwd")))
249 ;; The .at files create shell scripts without shebangs. Erk.
250 (substitute* "tests/commands.at"
251 (("./output.sh") "/bin/sh output.sh"))
252 (substitute* "tests/syntax.at"
253 (("; other_script.csh") "; /bin/sh other_script.csh"))
254 ;; Now, let's generate the test suite and patch it
255 (system* "make" "tests/testsuite")
256
257 ;; This file is ISO-8859-1 encoded.
258 (with-fluids ((%default-port-encoding #f))
259 (substitute* "tests/testsuite"
260 (("/bin/sh") (which "sh")))))
261 (alist-cons-after
262 'install 'post-install
263 (lambda* (#:key inputs outputs #:allow-other-keys)
264 (let* ((out (assoc-ref %outputs "out"))
265 (bin (string-append out "/bin")))
266 (with-directory-excursion bin
267 (symlink "tcsh" "csh"))))
268 %standard-phases))))
269 (home-page "http://www.tcsh.org/")
270 (synopsis "Unix shell based on csh")
271 (description
272 "Tcsh is an enhanced, but completely compatible version of the Berkeley
273 UNIX C shell (csh). It is a command language interpreter usable both as an
274 interactive login shell and a shell script command processor. It includes a
275 command-line editor, programmable word completion, spelling correction, a
276 history mechanism, job control and a C-like syntax.")
277 (license bsd-4)))
278
279 (define tcsh/fixed
280 (package
281 (inherit tcsh)
282 (name "tcsh")
283 (source (origin
284 (inherit (package-source tcsh))
285 (patches (cons (search-patch "tcsh-fix-out-of-bounds-read.patch")
286 (origin-patches (package-source tcsh))))))))
287
288 (define-public zsh
289 (package
290 (name "zsh")
291 (version "5.2")
292 (source (origin
293 (method url-fetch)
294 (uri (list (string-append
295 "http://www.zsh.org/pub/zsh-" version
296 ".tar.gz")
297 (string-append
298 "http://www.zsh.org/pub/old/zsh-" version
299 ".tar.gz")))
300 (sha256
301 (base32
302 "0dsr450v8nydvpk8ry276fvbznlrjgddgp7zvhcw4cv69i9lr4ps"))))
303 (build-system gnu-build-system)
304 (arguments `(#:configure-flags '("--with-tcsetpgrp" "--enable-pcre")
305 #:phases
306 (modify-phases %standard-phases
307 (add-before 'configure 'fix-sh
308 (lambda _
309 ;; Some of the files are ISO-8859-1 encoded.
310 (with-fluids ((%default-port-encoding #f))
311 (substitute*
312 '("configure"
313 "configure.ac"
314 "Src/exec.c"
315 "Src/mkmakemod.sh"
316 "Config/installfns.sh"
317 "Config/defs.mk.in"
318 "Test/E01options.ztst"
319 "Test/A05execution.ztst"
320 "Test/A01grammar.ztst"
321 "Test/A06assign.ztst"
322 "Test/B02typeset.ztst"
323 "Completion/Unix/Command/_init_d"
324 "Util/preconfig")
325 (("/bin/sh") (which "sh")))))))))
326 (native-inputs `(("autoconf" ,autoconf)))
327 (inputs `(("ncurses" ,ncurses)
328 ("pcre" ,pcre)
329 ("perl" ,perl)))
330 (synopsis "Powerful shell for interactive use and scripting")
331 (description "The Z shell (zsh) is a Unix shell that can be used
332 as an interactive login shell and as a powerful command interpreter
333 for shell scripting. Zsh can be thought of as an extended Bourne shell
334 with a large number of improvements, including some features of bash,
335 ksh, and tcsh.")
336 (home-page "http://www.zsh.org/")
337
338 ;; The whole thing is under an MIT/X11-style license, but there's one
339 ;; command, 'Completion/Unix/Command/_darcs', which is under GPLv2+.
340 (license gpl2+)))
341
342 (define-public xonsh
343 (package
344 (name "xonsh")
345 (version "0.5.5")
346 (source
347 (origin
348 (method url-fetch)
349 (uri (pypi-uri "xonsh" version))
350 (sha256
351 (base32
352 "1wa5g1gxk4aw8jazp3fqmr7mlkdmnva83x28i9xd3s99lv0qb3dd"))
353 (modules '((guix build utils)))
354 (snippet
355 `(begin
356 ;; Delete bundled ply.
357 (delete-file-recursively "xonsh/ply")
358 (substitute* '("setup.py")
359 (("'xonsh\\.ply\\.ply',") ""))
360 #t))))
361 (build-system python-build-system)
362 (arguments
363 '(;; TODO Try running run the test suite.
364 ;; See 'requirements-tests.txt' in the source distribution for more
365 ;; information.
366 #:tests? #f))
367 (inputs
368 `(("python-ply" ,python-ply)))
369 (home-page "http://xon.sh/")
370 (synopsis "Python-ish shell")
371 (description
372 "Xonsh is a Python-ish, BASHwards-looking shell language and command
373 prompt. The language is a superset of Python 3.4+ with additional shell
374 primitives that you are used to from Bash and IPython. It works on all major
375 systems including Linux, Mac OSX, and Windows. Xonsh is meant for the daily
376 use of experts and novices alike.")
377 (license bsd-2)))
378
379 (define-public scsh
380 (let ((commit "114432435e4eadd54334df6b37fcae505079b49f")
381 (revision "1"))
382 (package
383 (name "scsh")
384 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
385 (source
386 (origin
387 (method git-fetch)
388 (uri (git-reference
389 (url "https://github.com/scheme/scsh")
390 (commit commit)))
391 (file-name (string-append name "-" version "-checkout"))
392 (sha256
393 (base32
394 "1ghk08akiz7hff1pndi8rmgamgcrn2mv9asbss9l79d3c2iaav3q"))))
395 (build-system gnu-build-system)
396 (arguments
397 `(#:test-target "test"
398 #:phases
399 (modify-phases %standard-phases
400 (add-before 'configure 'replace-rx
401 (lambda* (#:key inputs #:allow-other-keys)
402 (let* ((rx (assoc-ref inputs "scheme48-rx"))
403 (rxpath (string-append rx "/share/scheme48-"
404 ,(package-version scheme48)
405 "/rx")))
406 (delete-file-recursively "rx")
407 (symlink rxpath "rx"))
408 #t))
409 (add-before 'configure 'autoreconf
410 (lambda _
411 (zero? (system* "autoreconf")))))))
412 (inputs
413 `(("scheme48" ,scheme48)
414 ("scheme48-rx" ,scheme48-rx)))
415 (native-inputs
416 `(("autoconf" ,autoconf)
417 ("automake" ,automake)))
418 (home-page "https://github.com/scheme/scsh")
419 (synopsis "Unix shell embedded in Scheme")
420 (description
421 "Scsh is a Unix shell embedded in Scheme. Scsh has two main
422 components: a process notation for running programs and setting up pipelines
423 and redirections, and a complete syscall library for low-level access to the
424 operating system.")
425 (license bsd-3))))