build: 'sync-descriptions' now compares GNU package descriptions.
[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)
9c782445 22 #:use-module (gnu packages bash)
1ffa7090
LC
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)
ef02e1e9 33 #:use-module (gnu packages ncurses)
87d836b2
LC
34 #:use-module (gnu packages ed)
35 #:use-module (gnu packages which)
1722d680 36 #:use-module (guix packages)
87f5d366 37 #:use-module (guix download)
1722d680
LC
38 #:use-module (guix build-system gnu))
39
40;;; Commentary:
41;;;
c44899a2 42;;; GNU Guile, and modules and extensions.
1722d680
LC
43;;;
44;;; Code:
45
c44899a2
LC
46(define-public guile-1.8
47 (package
48 (name "guile")
49 (version "1.8.8")
50 (source (origin
87f5d366 51 (method url-fetch)
0db342a5 52 (uri (string-append "mirror://gnu/guile/guile-" version
c44899a2
LC
53 ".tar.gz"))
54 (sha256
55 (base32
01eafd38
LC
56 "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3"))
57 (patches (list (search-patch "guile-1.8-cpp-4.5.patch")))))
c44899a2
LC
58 (build-system gnu-build-system)
59 (arguments '(#:configure-flags '("--disable-error-on-warning")
c44899a2
LC
60
61 ;; Insert a phase before `configure' to patch things up.
62 #:phases (alist-cons-before
63 'configure
2f4fbe1c 64 'patch-stuff
c44899a2
LC
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"
2f4fbe1c
LC
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"))))
c44899a2 79 %standard-phases)))
01eafd38 80 (inputs `(("gawk" ,gawk)
c44899a2
LC
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)
9c782445
LC
118 ("readline" ,readline)
119
120 ;; TODO: On next core-updates, make Bash input unconditional.
121 ,@(if (%current-target-system)
122 `(("bash" ,bash))
123 '())))
c44899a2
LC
124
125 (propagated-inputs
126 `( ;; These ones aren't normally needed here, but since `libguile-2.0.la'
127 ;; reads `-lltdl -lunistring', adding them here will add the needed
128 ;; `-L' flags. As for why the `.la' file lacks the `-L' flags, see
129 ;; <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903>.
130 ("libunistring" ,libunistring)
131 ("libtool" ,libtool)
132
133 ;; The headers and/or `guile-2.0.pc' refer to these packages, so they
134 ;; must be propagated.
135 ("bdw-gc" ,libgc)
136 ("gmp" ,gmp)))
137
138 (self-native-input? #t)
139
9bf62d9b
LC
140 (outputs '("out" "debug"))
141
8ffaa93b 142 (arguments
9c782445 143 `(#:phases (alist-cons-before
8ffaa93b
LC
144 'configure 'pre-configure
145 (lambda* (#:key inputs #:allow-other-keys)
58b4e8e8 146 ;; Tell (ice-9 popen) the file name of Bash.
8ffaa93b
LC
147 (let ((bash (assoc-ref inputs "bash")))
148 (substitute* "module/ice-9/popen.scm"
149 (("/bin/sh")
150 (string-append bash "/bin/bash")))))
56c092ce 151 %standard-phases)
58b4e8e8
LC
152
153 ,@(if (%current-target-system)
154 '(#:configure-flags '("CC_FOR_BUILD=gcc"))
155 '())))
8ffaa93b 156
9be8d7c8
LC
157 (native-search-paths
158 (list (search-path-specification
159 (variable "GUILE_LOAD_PATH")
160 (directories '("share/guile/site/2.0")))
161 (search-path-specification
162 (variable "GUILE_LOAD_COMPILED_PATH")
163 (directories '("share/guile/site/2.0")))))
164
f50d2669 165 (synopsis "Scheme implementation intended especially for extensions")
c44899a2
LC
166 (description
167"GNU Guile is an implementation of the Scheme programming language, with
168support for many SRFIs, packaged for use in a wide variety of environments.
169In addition to implementing the R5RS Scheme standard and a large subset of
170R6RS, Guile includes a module system, full access to POSIX system calls,
171networking support, multiple threads, dynamic linking, a foreign function
172call interface, and powerful string processing.")
173 (home-page "http://www.gnu.org/software/guile/")
4a44e743 174 (license lgpl3+)))
c44899a2 175
fa29b199
LC
176(define-public guile-2.0/fixed
177 ;; A package of Guile 2.0 that's rarely changed. It is the one used
178 ;; in the `base' module, and thus changing it entails a full rebuild.
6aded2dd 179 guile-2.0)
fa29b199 180
c44899a2
LC
181\f
182;;;
183;;; Extensions.
184;;;
185
1722d680
LC
186(define (guile-reader guile)
187 "Build Guile-Reader against GUILE, a package of some version of Guile 1.8
188or 2.0."
189 (package
ba4bcae0 190 (name (string-append "guile-reader-for-guile_" (package-version guile)))
1722d680
LC
191 (version "0.6")
192 (source (origin
87f5d366 193 (method url-fetch)
1722d680
LC
194 (uri (string-append
195 "http://download-mirror.savannah.gnu.org/releases/guile-reader/guile-reader-"
196 version ".tar.gz"))
197 (sha256
198 (base32
199 "1svlyk5pm4fsdp2g7n6qffdl6fdggxnlicj0jn9s4lxd63gzxy1n"))))
200 (build-system gnu-build-system)
cb0d69ed 201 (native-inputs `(("pkgconfig" ,pkg-config)
1627f7f7 202 ("gperf" ,gperf)))
1722d680 203 (inputs `(("guile" ,guile)))
46614bba
LC
204 (arguments `(#:configure-flags
205 (let ((out (assoc-ref %outputs "out")))
206 ,(if (string-prefix? "2." (package-version guile))
207 '(list (string-append "--with-guilemoduledir="
208 out "/share/guile/site/2.0"))
209 '(list (string-append "--with-guilemoduledir="
210 out "/share/guile/site"))))))
211 (synopsis "Framework for building readers for GNU Guile")
d45122f5 212 (description
1722d680
LC
213"Guile-Reader is a simple framework for building readers for GNU Guile.
214
215The idea is to make it easy to build procedures that extend Guile’s read
216procedure. Readers supporting various syntax variants can easily be written,
217possibly by re-using existing “token readers” of a standard Scheme
218readers. For example, it is used to implement Skribilo’s R5RS-derived
219document syntax.
220
221Guile-Reader’s approach is similar to Common Lisp’s “read table”, but
222hopefully more powerful and flexible (for instance, one may instantiate as
223many readers as needed).")
224 (home-page "http://www.nongnu.org/guile-reader/")
4a44e743 225 (license gpl3+)))
1722d680
LC
226
227(define-public guile-reader/guile-1.8
228 ;; Guile-Reader built against Guile 1.8.
229 (guile-reader guile-1.8))
230
231(define-public guile-reader/guile-2.0
232 ;; Guile-Reader built against Guile 2.0.
233 (guile-reader guile-2.0))
234
ef02e1e9
LC
235(define-public guile-ncurses
236 (package
237 (name "guile-ncurses")
1d3991dc 238 (version "1.4")
ef02e1e9
LC
239 (source (origin
240 (method url-fetch)
241 (uri (string-append "mirror://gnu/guile-ncurses/guile-ncurses-"
242 version ".tar.gz"))
243 (sha256
244 (base32
1d3991dc 245 "070wl664lsm14hb6y9ch97x9q6cns4k6nxgdzbdzi5byixn74899"))))
ef02e1e9
LC
246 (build-system gnu-build-system)
247 (inputs `(("ncurses" ,ncurses)
248 ("guile" ,guile-2.0)))
249 (arguments
250 '(#:configure-flags (list (string-append "--with-guilesitedir="
251 (assoc-ref %outputs "out")
3f69e393 252 "/share/guile/site/2.0"))
ef02e1e9
LC
253 #:phases (alist-cons-after
254 'install 'post-install
255 (lambda* (#:key outputs #:allow-other-keys)
256 (let* ((out (assoc-ref outputs "out"))
257 (dir (string-append out "/share/guile/site/"))
258 (files (find-files dir ".scm")))
259 (substitute* files
260 (("\"libguile-ncurses\"")
261 (format #f "\"~a/lib/libguile-ncurses\""
262 out)))))
263 %standard-phases)))
264 (home-page "http://www.gnu.org/software/guile-ncurses/")
f50d2669 265 (synopsis "Guile bindings to ncurses")
ef02e1e9
LC
266 (description
267 "GNU Guile-Ncurses is a library for the Guile Scheme interpreter that
268provides functions for creating text user interfaces. The text user interface
269functionality is built on the ncurses libraries: curses, form, panel, and
270menu.")
271 (license lgpl3+)))
272
87d836b2
LC
273(define-public mcron
274 (package
275 (name "mcron")
276 (version "1.0.6")
277 (source (origin
278 (method url-fetch)
279 (uri (string-append "mirror://gnu/mcron/mcron-"
280 version ".tar.gz"))
281 (sha256
282 (base32
01eafd38
LC
283 "0yvrfzzdy2m7fbqkr61fw01wd9r2jpnbyabxhcsfivgxywknl0fy"))
284 (patches (list (search-patch "mcron-install.patch")))))
87d836b2 285 (build-system gnu-build-system)
87d836b2 286 (inputs
01eafd38 287 `(("ed" ,ed) ("which" ,which) ("guile" ,guile-1.8)))
87d836b2 288 (home-page "http://www.gnu.org/software/mcron/")
f50d2669 289 (synopsis "Run jobs at scheduled times")
87d836b2
LC
290 (description
291 "The GNU package mcron (Mellor's cron) is a 100% compatible replacement
292for Vixie cron. It is written in pure Guile, and allows configuration files
293to be written in scheme (as well as Vixie's original format) for infinite
294flexibility in specifying when jobs should be run. Mcron was written by Dale
295Mellor.")
296 (license gpl3+)))
297
3e9066fc
LC
298(define-public guile-lib
299 (package
300 (name "guile-lib")
301 (version "0.2.2")
302 (source (origin
303 (method url-fetch)
304 (uri (string-append "mirror://savannah/guile-lib/guile-lib-"
305 version ".tar.gz"))
306 (sha256
307 (base32
308 "1f9n2b5b5r75lzjinyk6zp6g20g60msa0jpfrk5hhg4j8cy0ih4b"))))
309 (build-system gnu-build-system)
310 (arguments
311 '(#:phases (alist-cons-before
312 'configure 'patch-module-dir
313 (lambda _
314 (substitute* "src/Makefile.in"
315 (("^moddir[[:blank:]]*=[[:blank:]]*([[:graph:]]+)" _ rhs)
316 (string-append "moddir = " rhs "/2.0\n"))))
317 %standard-phases)))
318 (inputs `(("guile" ,guile-2.0)))
319 (home-page "http://www.nongnu.org/guile-lib/")
320 (synopsis "Collection of useful Guile Scheme modules")
321 (description
322 "guile-lib is intended as an accumulation place for pure-scheme Guile
323modules, allowing for people to cooperate integrating their generic Guile
324modules into a coherent library. Think \"a down-scaled, limited-scope CPAN
325for Guile\".")
326
327 ;; The whole is under GPLv3+, but some modules are under laxer
328 ;; distribution terms such as LGPL and public domain. See `COPYING' for
329 ;; details.
330 (license gpl3+)))
331
1722d680 332;;; guile.scm ends here