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