gnu: bash: Fix cross-compilation.
[jackhill/guix/guix.git] / gnu / packages / guile.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
ef02e1e9 2;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
1722d680 3;;;
233e7676 4;;; This file is part of GNU Guix.
1722d680 5;;;
233e7676 6;;; GNU Guix is free software; you can redistribute it and/or modify it
1722d680
LC
7;;; under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 3 of the License, or (at
9;;; your option) any later version.
10;;;
233e7676 11;;; GNU Guix is distributed in the hope that it will be useful, but
1722d680
LC
12;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
233e7676 17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
1722d680 18
1ffa7090 19(define-module (gnu packages guile)
4a44e743 20 #:use-module (guix licenses)
59a43334 21 #:use-module (gnu packages)
1ffa7090
LC
22 #:use-module (gnu packages bdw-gc)
23 #:use-module (gnu packages gawk)
24 #:use-module (gnu packages gperf)
25 #:use-module (gnu packages libffi)
26 #:use-module (gnu packages autotools)
27 #:use-module (gnu packages libunistring)
28 #:use-module (gnu packages m4)
29 #:use-module (gnu packages multiprecision)
30 #:use-module (gnu packages pkg-config)
31 #:use-module (gnu packages readline)
ef02e1e9 32 #:use-module (gnu packages ncurses)
87d836b2
LC
33 #:use-module (gnu packages ed)
34 #:use-module (gnu packages which)
1722d680 35 #:use-module (guix packages)
87f5d366 36 #:use-module (guix download)
1722d680
LC
37 #:use-module (guix build-system gnu))
38
39;;; Commentary:
40;;;
c44899a2 41;;; GNU Guile, and modules and extensions.
1722d680
LC
42;;;
43;;; Code:
44
c44899a2
LC
45(define-public guile-1.8
46 (package
47 (name "guile")
48 (version "1.8.8")
49 (source (origin
87f5d366 50 (method url-fetch)
0db342a5 51 (uri (string-append "mirror://gnu/guile/guile-" version
c44899a2
LC
52 ".tar.gz"))
53 (sha256
54 (base32
55 "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3"))))
56 (build-system gnu-build-system)
57 (arguments '(#:configure-flags '("--disable-error-on-warning")
58 #:patches (list (assoc-ref %build-inputs "patch/snarf"))
59
60 ;; Insert a phase before `configure' to patch things up.
61 #:phases (alist-cons-before
62 'configure
2f4fbe1c 63 'patch-stuff
c44899a2
LC
64 (lambda* (#:key outputs #:allow-other-keys)
65 ;; Add a call to `lt_dladdsearchdir' so that
66 ;; `libguile-readline.so' & co. are in the
67 ;; loader's search path.
68 (substitute* "libguile/dynl.c"
2f4fbe1c
LC
69 (("lt_dlinit.*$" match)
70 (format #f
71 " ~a~% lt_dladdsearchdir(\"~a/lib\");~%"
72 match
73 (assoc-ref outputs "out"))))
74
75 ;; The usual /bin/sh...
76 (substitute* "ice-9/popen.scm"
77 (("/bin/sh") (which "sh"))))
c44899a2
LC
78 %standard-phases)))
79 (inputs `(("patch/snarf" ,(search-patch "guile-1.8-cpp-4.5.patch"))
80 ("gawk" ,gawk)
81 ("readline" ,readline)))
82
83 ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be
84 ;; propagated.
85 (propagated-inputs `(("gmp" ,gmp)
86 ("libtool" ,libtool)))
87
88 ;; When cross-compiling, a native version of Guile itself is needed.
89 (self-native-input? #t)
90
9be8d7c8
LC
91 (native-search-paths
92 (list (search-path-specification
93 (variable "GUILE_LOAD_PATH")
94 (directories '("share/guile/site")))))
95
f50d2669 96 (synopsis "Scheme implementation intended especially for extensions")
c44899a2
LC
97 (description
98"GNU Guile 1.8 is an interpreter for the Scheme programming language,
99packaged as a library that can be embedded into programs to make them
100extensible. It supports many SRFIs.")
101 (home-page "http://www.gnu.org/software/guile/")
4a44e743 102 (license lgpl2.0+)))
c44899a2
LC
103
104(define-public guile-2.0
105 (package
106 (name "guile")
fcdf58c4 107 (version "2.0.9")
c44899a2 108 (source (origin
87f5d366 109 (method url-fetch)
0db342a5 110 (uri (string-append "mirror://gnu/guile/guile-" version
c44899a2
LC
111 ".tar.xz"))
112 (sha256
113 (base32
fcdf58c4 114 "0nw9y8vjyz4r61v06p9msks5lm58pd91irmzg4k487vmv743h2pp"))))
c44899a2
LC
115 (build-system gnu-build-system)
116 (native-inputs `(("pkgconfig" ,pkg-config)))
117 (inputs `(("libffi" ,libffi)
118 ("readline" ,readline)))
119
120 (propagated-inputs
121 `( ;; These ones aren't normally needed here, but since `libguile-2.0.la'
122 ;; reads `-lltdl -lunistring', adding them here will add the needed
123 ;; `-L' flags. As for why the `.la' file lacks the `-L' flags, see
124 ;; <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903>.
125 ("libunistring" ,libunistring)
126 ("libtool" ,libtool)
127
128 ;; The headers and/or `guile-2.0.pc' refer to these packages, so they
129 ;; must be propagated.
130 ("bdw-gc" ,libgc)
131 ("gmp" ,gmp)))
132
133 (self-native-input? #t)
134
8ffaa93b
LC
135 (arguments
136 '(#:phases (alist-cons-before
137 'configure 'pre-configure
138 (lambda* (#:key inputs #:allow-other-keys)
139 (let ((bash (assoc-ref inputs "bash")))
140 (substitute* "module/ice-9/popen.scm"
141 (("/bin/sh")
142 (string-append bash "/bin/bash")))))
143 %standard-phases)))
144
9be8d7c8
LC
145 (native-search-paths
146 (list (search-path-specification
147 (variable "GUILE_LOAD_PATH")
148 (directories '("share/guile/site/2.0")))
149 (search-path-specification
150 (variable "GUILE_LOAD_COMPILED_PATH")
151 (directories '("share/guile/site/2.0")))))
152
f50d2669 153 (synopsis "Scheme implementation intended especially for extensions")
c44899a2
LC
154 (description
155"GNU Guile is an implementation of the Scheme programming language, with
156support for many SRFIs, packaged for use in a wide variety of environments.
157In addition to implementing the R5RS Scheme standard and a large subset of
158R6RS, Guile includes a module system, full access to POSIX system calls,
159networking support, multiple threads, dynamic linking, a foreign function
160call interface, and powerful string processing.")
161 (home-page "http://www.gnu.org/software/guile/")
4a44e743 162 (license lgpl3+)))
c44899a2 163
fa29b199
LC
164(define-public guile-2.0/fixed
165 ;; A package of Guile 2.0 that's rarely changed. It is the one used
166 ;; in the `base' module, and thus changing it entails a full rebuild.
6aded2dd 167 guile-2.0)
fa29b199 168
c44899a2
LC
169\f
170;;;
171;;; Extensions.
172;;;
173
1722d680
LC
174(define (guile-reader guile)
175 "Build Guile-Reader against GUILE, a package of some version of Guile 1.8
176or 2.0."
177 (package
ba4bcae0 178 (name (string-append "guile-reader-for-guile_" (package-version guile)))
1722d680
LC
179 (version "0.6")
180 (source (origin
87f5d366 181 (method url-fetch)
1722d680
LC
182 (uri (string-append
183 "http://download-mirror.savannah.gnu.org/releases/guile-reader/guile-reader-"
184 version ".tar.gz"))
185 (sha256
186 (base32
187 "1svlyk5pm4fsdp2g7n6qffdl6fdggxnlicj0jn9s4lxd63gzxy1n"))))
188 (build-system gnu-build-system)
cb0d69ed 189 (native-inputs `(("pkgconfig" ,pkg-config)
1627f7f7 190 ("gperf" ,gperf)))
1722d680 191 (inputs `(("guile" ,guile)))
46614bba
LC
192 (arguments `(#:configure-flags
193 (let ((out (assoc-ref %outputs "out")))
194 ,(if (string-prefix? "2." (package-version guile))
195 '(list (string-append "--with-guilemoduledir="
196 out "/share/guile/site/2.0"))
197 '(list (string-append "--with-guilemoduledir="
198 out "/share/guile/site"))))))
199 (synopsis "Framework for building readers for GNU Guile")
d45122f5 200 (description
1722d680
LC
201"Guile-Reader is a simple framework for building readers for GNU Guile.
202
203The idea is to make it easy to build procedures that extend Guile’s read
204procedure. Readers supporting various syntax variants can easily be written,
205possibly by re-using existing “token readers” of a standard Scheme
206readers. For example, it is used to implement Skribilo’s R5RS-derived
207document syntax.
208
209Guile-Reader’s approach is similar to Common Lisp’s “read table”, but
210hopefully more powerful and flexible (for instance, one may instantiate as
211many readers as needed).")
212 (home-page "http://www.nongnu.org/guile-reader/")
4a44e743 213 (license gpl3+)))
1722d680
LC
214
215(define-public guile-reader/guile-1.8
216 ;; Guile-Reader built against Guile 1.8.
217 (guile-reader guile-1.8))
218
219(define-public guile-reader/guile-2.0
220 ;; Guile-Reader built against Guile 2.0.
221 (guile-reader guile-2.0))
222
ef02e1e9
LC
223(define-public guile-ncurses
224 (package
225 (name "guile-ncurses")
1d3991dc 226 (version "1.4")
ef02e1e9
LC
227 (source (origin
228 (method url-fetch)
229 (uri (string-append "mirror://gnu/guile-ncurses/guile-ncurses-"
230 version ".tar.gz"))
231 (sha256
232 (base32
1d3991dc 233 "070wl664lsm14hb6y9ch97x9q6cns4k6nxgdzbdzi5byixn74899"))))
ef02e1e9
LC
234 (build-system gnu-build-system)
235 (inputs `(("ncurses" ,ncurses)
236 ("guile" ,guile-2.0)))
237 (arguments
238 '(#:configure-flags (list (string-append "--with-guilesitedir="
239 (assoc-ref %outputs "out")
240 "/share/guile/site"))
241 #:phases (alist-cons-after
242 'install 'post-install
243 (lambda* (#:key outputs #:allow-other-keys)
244 (let* ((out (assoc-ref outputs "out"))
245 (dir (string-append out "/share/guile/site/"))
246 (files (find-files dir ".scm")))
247 (substitute* files
248 (("\"libguile-ncurses\"")
249 (format #f "\"~a/lib/libguile-ncurses\""
250 out)))))
251 %standard-phases)))
252 (home-page "http://www.gnu.org/software/guile-ncurses/")
f50d2669 253 (synopsis "Guile bindings to ncurses")
ef02e1e9
LC
254 (description
255 "GNU Guile-Ncurses is a library for the Guile Scheme interpreter that
256provides functions for creating text user interfaces. The text user interface
257functionality is built on the ncurses libraries: curses, form, panel, and
258menu.")
259 (license lgpl3+)))
260
87d836b2
LC
261(define-public mcron
262 (package
263 (name "mcron")
264 (version "1.0.6")
265 (source (origin
266 (method url-fetch)
267 (uri (string-append "mirror://gnu/mcron/mcron-"
268 version ".tar.gz"))
269 (sha256
270 (base32
271 "0yvrfzzdy2m7fbqkr61fw01wd9r2jpnbyabxhcsfivgxywknl0fy"))))
272 (build-system gnu-build-system)
273 (arguments
274 '(#:patches (list (assoc-ref %build-inputs "patch/install"))))
275 (inputs
276 `(("ed" ,ed) ("which" ,which) ("guile" ,guile-1.8)
277 ("patch/install" ,(search-patch "mcron-install.patch"))))
278 (home-page "http://www.gnu.org/software/mcron/")
f50d2669 279 (synopsis "Run jobs at scheduled times")
87d836b2
LC
280 (description
281 "The GNU package mcron (Mellor's cron) is a 100% compatible replacement
282for Vixie cron. It is written in pure Guile, and allows configuration files
283to be written in scheme (as well as Vixie's original format) for infinite
284flexibility in specifying when jobs should be run. Mcron was written by Dale
285Mellor.")
286 (license gpl3+)))
287
1722d680 288;;; guile.scm ends here