gnu: evas-generic-loaders: Update to 1.13.2.
[jackhill/guix/guix.git] / gnu / packages / guile.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
00ebe474 2;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
b515822d 3;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
1722d680 4;;;
233e7676 5;;; This file is part of GNU Guix.
1722d680 6;;;
233e7676 7;;; GNU Guix is free software; you can redistribute it and/or modify it
1722d680
LC
8;;; under the terms of the GNU General Public License as published by
9;;; the Free Software Foundation; either version 3 of the License, or (at
10;;; your option) any later version.
11;;;
233e7676 12;;; GNU Guix is distributed in the hope that it will be useful, but
1722d680
LC
13;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;;; GNU General Public License for more details.
16;;;
17;;; You should have received a copy of the GNU General Public License
233e7676 18;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
1722d680 19
1ffa7090 20(define-module (gnu packages guile)
4a44e743 21 #:use-module (guix licenses)
59a43334 22 #:use-module (gnu packages)
9c782445 23 #:use-module (gnu packages bash)
1ffa7090
LC
24 #:use-module (gnu packages bdw-gc)
25 #:use-module (gnu packages gawk)
26 #:use-module (gnu packages gperf)
27 #:use-module (gnu packages libffi)
28 #:use-module (gnu packages autotools)
29 #:use-module (gnu packages libunistring)
30 #:use-module (gnu packages m4)
31 #:use-module (gnu packages multiprecision)
32 #:use-module (gnu packages pkg-config)
33 #:use-module (gnu packages readline)
ef02e1e9 34 #:use-module (gnu packages ncurses)
87d836b2 35 #:use-module (gnu packages ed)
ce0614dd 36 #:use-module (gnu packages base)
1722d680 37 #:use-module (guix packages)
87f5d366 38 #:use-module (guix download)
32795fcf
LC
39 #:use-module (guix build-system gnu)
40 #:use-module (guix utils)
41 #:use-module (ice-9 match))
1722d680
LC
42
43;;; Commentary:
44;;;
c44899a2 45;;; GNU Guile, and modules and extensions.
1722d680
LC
46;;;
47;;; Code:
48
c44899a2
LC
49(define-public guile-1.8
50 (package
51 (name "guile")
52 (version "1.8.8")
53 (source (origin
87f5d366 54 (method url-fetch)
0db342a5 55 (uri (string-append "mirror://gnu/guile/guile-" version
c44899a2
LC
56 ".tar.gz"))
57 (sha256
58 (base32
01eafd38
LC
59 "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3"))
60 (patches (list (search-patch "guile-1.8-cpp-4.5.patch")))))
c44899a2
LC
61 (build-system gnu-build-system)
62 (arguments '(#:configure-flags '("--disable-error-on-warning")
c44899a2
LC
63
64 ;; Insert a phase before `configure' to patch things up.
65 #:phases (alist-cons-before
66 'configure
2f4fbe1c 67 'patch-stuff
c44899a2
LC
68 (lambda* (#:key outputs #:allow-other-keys)
69 ;; Add a call to `lt_dladdsearchdir' so that
70 ;; `libguile-readline.so' & co. are in the
71 ;; loader's search path.
72 (substitute* "libguile/dynl.c"
2f4fbe1c
LC
73 (("lt_dlinit.*$" match)
74 (format #f
75 " ~a~% lt_dladdsearchdir(\"~a/lib\");~%"
76 match
77 (assoc-ref outputs "out"))))
78
79 ;; The usual /bin/sh...
80 (substitute* "ice-9/popen.scm"
81 (("/bin/sh") (which "sh"))))
c44899a2 82 %standard-phases)))
01eafd38 83 (inputs `(("gawk" ,gawk)
c44899a2
LC
84 ("readline" ,readline)))
85
86 ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be
87 ;; propagated.
88 (propagated-inputs `(("gmp" ,gmp)
be11b102 89 ("libltdl" ,libltdl)))
c44899a2
LC
90
91 ;; When cross-compiling, a native version of Guile itself is needed.
92 (self-native-input? #t)
93
9be8d7c8
LC
94 (native-search-paths
95 (list (search-path-specification
96 (variable "GUILE_LOAD_PATH")
af070955 97 (files '("share/guile/site")))))
9be8d7c8 98
f50d2669 99 (synopsis "Scheme implementation intended especially for extensions")
c44899a2 100 (description
a22dc0c4
LC
101 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
102official extension language of the GNU system. It is an implementation of
103the Scheme language which can be easily embedded in other applications to
104provide a convenient means of extending the functionality of the application
105without requiring the source code to be rewritten.")
c44899a2 106 (home-page "http://www.gnu.org/software/guile/")
4a44e743 107 (license lgpl2.0+)))
c44899a2
LC
108
109(define-public guile-2.0
110 (package
111 (name "guile")
b1a01474 112 (version "2.0.11")
c44899a2 113 (source (origin
87f5d366 114 (method url-fetch)
0db342a5 115 (uri (string-append "mirror://gnu/guile/guile-" version
c44899a2
LC
116 ".tar.xz"))
117 (sha256
118 (base32
b515822d
MW
119 "1qh3j7308qvsjgwf7h94yqgckpbgz2k3yqdkzsyhqcafvfka9l5f"))
120 (patches (list (search-patch "guile-arm-fixes.patch")))))
c44899a2
LC
121 (build-system gnu-build-system)
122 (native-inputs `(("pkgconfig" ,pkg-config)))
123 (inputs `(("libffi" ,libffi)
9c782445 124 ("readline" ,readline)
cba95006 125 ("bash" ,bash)))
c44899a2
LC
126
127 (propagated-inputs
128 `( ;; These ones aren't normally needed here, but since `libguile-2.0.la'
129 ;; reads `-lltdl -lunistring', adding them here will add the needed
130 ;; `-L' flags. As for why the `.la' file lacks the `-L' flags, see
131 ;; <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903>.
132 ("libunistring" ,libunistring)
be11b102
LC
133
134 ;; Depend on LIBLTDL, not LIBTOOL. That way, we avoid some the extra
135 ;; dependencies that LIBTOOL has, which is helpful during bootstrap.
136 ("libltdl" ,libltdl)
c44899a2
LC
137
138 ;; The headers and/or `guile-2.0.pc' refer to these packages, so they
139 ;; must be propagated.
bda1bc6c 140 ("bdw-gc" ,libgc)
c44899a2
LC
141 ("gmp" ,gmp)))
142
143 (self-native-input? #t)
144
9bf62d9b
LC
145 (outputs '("out" "debug"))
146
8ffaa93b 147 (arguments
9c782445 148 `(#:phases (alist-cons-before
8ffaa93b
LC
149 'configure 'pre-configure
150 (lambda* (#:key inputs #:allow-other-keys)
58b4e8e8 151 ;; Tell (ice-9 popen) the file name of Bash.
8ffaa93b
LC
152 (let ((bash (assoc-ref inputs "bash")))
153 (substitute* "module/ice-9/popen.scm"
154 (("/bin/sh")
155 (string-append bash "/bin/bash")))))
db619089 156 %standard-phases)))
8ffaa93b 157
9be8d7c8
LC
158 (native-search-paths
159 (list (search-path-specification
160 (variable "GUILE_LOAD_PATH")
af070955 161 (files '("share/guile/site/2.0")))
9be8d7c8
LC
162 (search-path-specification
163 (variable "GUILE_LOAD_COMPILED_PATH")
af070955 164 (files '("share/guile/site/2.0")))))
9be8d7c8 165
f50d2669 166 (synopsis "Scheme implementation intended especially for extensions")
c44899a2 167 (description
a22dc0c4
LC
168 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
169official extension language of the GNU system. It is an implementation of
170the Scheme language which can be easily embedded in other applications to
171provide a convenient means of extending the functionality of the application
172without requiring the source code to be rewritten.")
c44899a2 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.
bda1bc6c 179 guile-2.0)
fa29b199 180
c44899a2
LC
181\f
182;;;
183;;; Extensions.
184;;;
185
d6d9f1f7 186(define-public guile-reader
1722d680 187 (package
d6d9f1f7
LC
188 (name "guile-reader")
189 (version "0.6")
190 (source (origin
191 (method url-fetch)
192 (uri (string-append "mirror://savannah/guile-reader/guile-reader-"
193 version ".tar.gz"))
194 (sha256
195 (base32
196 "1svlyk5pm4fsdp2g7n6qffdl6fdggxnlicj0jn9s4lxd63gzxy1n"))))
197 (build-system gnu-build-system)
198 (native-inputs `(("pkgconfig" ,pkg-config)
199 ("gperf" ,gperf)))
200 (inputs `(("guile" ,guile-2.0)))
7d9e8c08
LC
201 (arguments `(;; The extract-*.sh scripts really expect to run in the C
202 ;; locale. Failing to do that, we end up with a build
203 ;; failure while extracting doc. (Fixed in Guile-Reader's
204 ;; repo.)
205 #:locale "C"
206
207 #:configure-flags
d6d9f1f7
LC
208 (let ((out (assoc-ref %outputs "out")))
209 (list (string-append "--with-guilemoduledir="
210 out "/share/guile/site/2.0")))))
211 (synopsis "Framework for building readers for GNU Guile")
212 (description
213 "Guile-Reader is a simple framework for building readers for GNU Guile.
1722d680
LC
214
215The idea is to make it easy to build procedures that extend Guile’s read
35b9e423 216procedure. Readers supporting various syntax variants can easily be written,
1722d680 217possibly by re-using existing “token readers” of a standard Scheme
35b9e423 218readers. For example, it is used to implement Skribilo’s R5RS-derived
1722d680
LC
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).")
d6d9f1f7
LC
224 (home-page "http://www.nongnu.org/guile-reader/")
225 (license gpl3+)))
1722d680 226
ef02e1e9
LC
227(define-public guile-ncurses
228 (package
229 (name "guile-ncurses")
31a123fe 230 (version "1.6")
ef02e1e9
LC
231 (source (origin
232 (method url-fetch)
233 (uri (string-append "mirror://gnu/guile-ncurses/guile-ncurses-"
234 version ".tar.gz"))
235 (sha256
236 (base32
31a123fe 237 "0wmk681zzi1wxw543r2s2r84ndnzxp69kr7pc01aw4l55hg7jn73"))))
ef02e1e9
LC
238 (build-system gnu-build-system)
239 (inputs `(("ncurses" ,ncurses)
240 ("guile" ,guile-2.0)))
241 (arguments
2c6b7c7d
LC
242 '(#:configure-flags (list "--with-ncursesw" ; Unicode support
243 (string-append "--with-guilesitedir="
ef02e1e9 244 (assoc-ref %outputs "out")
3f69e393 245 "/share/guile/site/2.0"))
b0b72780
LC
246 #:phases (alist-cons-before
247 'check 'change-locale
248 (lambda _
249 ;; Use the locale that's actually available in the build
250 ;; environment.
251 (substitute* "test/f009_form_wide.test"
252 (("en_US\\.utf8")
253 "en_US.UTF-8")))
254 (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))))
ef02e1e9 265 (home-page "http://www.gnu.org/software/guile-ncurses/")
f50d2669 266 (synopsis "Guile bindings to ncurses")
ef02e1e9 267 (description
12bcf94a 268 "guile-ncurses provides Guile language bindings for the ncurses
79c311b8 269library.")
ef02e1e9
LC
270 (license lgpl3+)))
271
87d836b2
LC
272(define-public mcron
273 (package
274 (name "mcron")
d12c626c 275 (version "1.0.8")
87d836b2
LC
276 (source (origin
277 (method url-fetch)
278 (uri (string-append "mirror://gnu/mcron/mcron-"
279 version ".tar.gz"))
280 (sha256
281 (base32
d12c626c 282 "0zparwgf01jgl1x53ik71ghabldq6zz18ha4dscps1i0qrzgap1b"))
01eafd38 283 (patches (list (search-patch "mcron-install.patch")))))
87d836b2 284 (build-system gnu-build-system)
b6c18d6a
LC
285 (native-inputs `(("pkg-config" ,pkg-config)))
286 (inputs `(("ed" ,ed) ("which" ,which) ("guile" ,guile-2.0)))
87d836b2 287 (home-page "http://www.gnu.org/software/mcron/")
f50d2669 288 (synopsis "Run jobs at scheduled times")
87d836b2 289 (description
79c311b8 290 "GNU Mcron is a complete replacement for Vixie cron. It is used to run
a22dc0c4 291tasks on a schedule, such as every hour or every Monday. Mcron is written in
79c311b8
LC
292Guile, so its configuration can be written in Scheme; the original cron
293format is also supported.")
87d836b2
LC
294 (license gpl3+)))
295
3e9066fc
LC
296(define-public guile-lib
297 (package
298 (name "guile-lib")
299 (version "0.2.2")
300 (source (origin
301 (method url-fetch)
302 (uri (string-append "mirror://savannah/guile-lib/guile-lib-"
303 version ".tar.gz"))
304 (sha256
305 (base32
306 "1f9n2b5b5r75lzjinyk6zp6g20g60msa0jpfrk5hhg4j8cy0ih4b"))))
307 (build-system gnu-build-system)
308 (arguments
309 '(#:phases (alist-cons-before
310 'configure 'patch-module-dir
311 (lambda _
312 (substitute* "src/Makefile.in"
313 (("^moddir[[:blank:]]*=[[:blank:]]*([[:graph:]]+)" _ rhs)
314 (string-append "moddir = " rhs "/2.0\n"))))
315 %standard-phases)))
316 (inputs `(("guile" ,guile-2.0)))
317 (home-page "http://www.nongnu.org/guile-lib/")
318 (synopsis "Collection of useful Guile Scheme modules")
319 (description
35b9e423 320 "Guile-Lib is intended as an accumulation place for pure-scheme Guile
3e9066fc
LC
321modules, allowing for people to cooperate integrating their generic Guile
322modules into a coherent library. Think \"a down-scaled, limited-scope CPAN
323for Guile\".")
324
325 ;; The whole is under GPLv3+, but some modules are under laxer
326 ;; distribution terms such as LGPL and public domain. See `COPYING' for
327 ;; details.
328 (license gpl3+)))
329
6050a1fb
CR
330(define-public guile-json
331 (package
332 (name "guile-json")
cdf2b286 333 (version "0.4.0")
6050a1fb
CR
334 (source (origin
335 (method url-fetch)
336 (uri (string-append "mirror://savannah/guile-json/guile-json-"
337 version ".tar.gz"))
338 (sha256
339 (base32
cdf2b286 340 "0v06272rw4ycwzssjf3fzpk2vhpslvl55hz94q80vc6f74j0d5h6"))
bf6fcf54
LC
341 (modules '((guix build utils)))
342 (snippet
343 ;; Make sure everything goes under .../site/2.0, like Guile's
344 ;; search paths expects.
345 '(substitute* '("Makefile.in" "json/Makefile.in")
346 (("moddir =.*/share/guile/site" all)
347 (string-append all "/2.0"))))))
6050a1fb 348 (build-system gnu-build-system)
db5584dd 349 (native-inputs `(("guile" ,guile-2.0)))
6050a1fb
CR
350 (home-page "http://savannah.nongnu.org/projects/guile-json/")
351 (synopsis "JSON module for Guile")
352 (description
353 "Guile-json supports parsing and building JSON documents according to the
35b9e423 354http:://json.org specification. These are the main features:
6050a1fb
CR
355- Strictly complies to http://json.org specification.
356- Build JSON documents programmatically via macros.
357- Unicode support for strings.
358- Allows JSON pretty printing.")
359 (license lgpl3+)))
360
1722d680 361;;; guile.scm ends here