1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
4 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
42 ;;; GNU Guile, and modules and extensions.
46 (define-public guile-1.8
52 (uri (string-append "mirror://gnu/guile/guile-" version
56 "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3"))
57 (patches (list (search-patch "guile-1.8-cpp-4.5.patch")))))
58 (build-system gnu-build-system)
59 (arguments '(#:configure-flags '("--disable-error-on-warning")
61 ;; Insert a phase before `configure' to patch things up.
62 #:phases (alist-cons-before
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)
72 " ~a~% lt_dladdsearchdir(\"~a/lib\");~%"
74 (assoc-ref outputs "out"))))
76 ;; The usual /bin/sh...
77 (substitute* "ice-9/popen.scm"
78 (("/bin/sh") (which "sh"))))
80 (inputs `(("gawk" ,gawk)
81 ("readline" ,readline)))
83 ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be
85 (propagated-inputs `(("gmp" ,gmp)
86 ("libtool" ,libtool)))
88 ;; When cross-compiling, a native version of Guile itself is needed.
89 (self-native-input? #t)
92 (list (search-path-specification
93 (variable "GUILE_LOAD_PATH")
94 (directories '("share/guile/site")))))
96 (synopsis "Scheme implementation intended especially for extensions")
98 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
99 official extension language of the GNU system. It is an implementation of
100 the Scheme language which can be easily embedded in other applications to
101 provide a convenient means of extending the functionality of the application
102 without requiring the source code to be rewritten.")
103 (home-page "http://www.gnu.org/software/guile/")
106 (define-public guile-2.0
112 (uri (string-append "mirror://gnu/guile/guile-" version
116 "0nw9y8vjyz4r61v06p9msks5lm58pd91irmzg4k487vmv743h2pp"))))
117 (build-system gnu-build-system)
118 (native-inputs `(("pkgconfig" ,pkg-config)))
119 (inputs `(("libffi" ,libffi)
120 ("readline" ,readline)
122 ;; TODO: On next core-updates, make Bash input unconditional.
123 ,@(if (%current-target-system)
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)
135 ;; The headers and/or `guile-2.0.pc' refer to these packages, so they
136 ;; must be propagated.
140 (self-native-input? #t)
142 (outputs '("out" "debug"))
145 `(#:phases (alist-cons-before
146 'configure 'pre-configure
147 (lambda* (#:key inputs #:allow-other-keys)
148 ;; Tell (ice-9 popen) the file name of Bash.
149 (let ((bash (assoc-ref inputs "bash")))
150 (substitute* "module/ice-9/popen.scm"
152 (string-append bash "/bin/bash")))))
155 ,@(if (%current-target-system)
156 '(#:configure-flags '("CC_FOR_BUILD=gcc"))
160 (list (search-path-specification
161 (variable "GUILE_LOAD_PATH")
162 (directories '("share/guile/site/2.0")))
163 (search-path-specification
164 (variable "GUILE_LOAD_COMPILED_PATH")
165 (directories '("share/guile/site/2.0")))))
167 (synopsis "Scheme implementation intended especially for extensions")
169 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
170 official extension language of the GNU system. It is an implementation of
171 the Scheme language which can be easily embedded in other applications to
172 provide a convenient means of extending the functionality of the application
173 without requiring the source code to be rewritten.")
174 (home-page "http://www.gnu.org/software/guile/")
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.
187 (define (guile-reader guile)
188 "Build Guile-Reader against GUILE, a package of some version of Guile 1.8
191 (name (string-append "guile-reader-for-guile_" (package-version guile)))
196 "http://download-mirror.savannah.gnu.org/releases/guile-reader/guile-reader-"
200 "1svlyk5pm4fsdp2g7n6qffdl6fdggxnlicj0jn9s4lxd63gzxy1n"))))
201 (build-system gnu-build-system)
202 (native-inputs `(("pkgconfig" ,pkg-config)
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")
214 "Guile-Reader is a simple framework for building readers for GNU Guile.
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
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/")
228 (define-public guile-reader/guile-1.8
229 ;; Guile-Reader built against Guile 1.8.
230 (guile-reader guile-1.8))
232 (define-public guile-reader/guile-2.0
233 ;; Guile-Reader built against Guile 2.0.
234 (guile-reader guile-2.0))
236 (define-public guile-ncurses
238 (name "guile-ncurses")
242 (uri (string-append "mirror://gnu/guile-ncurses/guile-ncurses-"
246 "070wl664lsm14hb6y9ch97x9q6cns4k6nxgdzbdzi5byixn74899"))))
247 (build-system gnu-build-system)
248 (inputs `(("ncurses" ,ncurses)
249 ("guile" ,guile-2.0)))
251 '(#:configure-flags (list (string-append "--with-guilesitedir="
252 (assoc-ref %outputs "out")
253 "/share/guile/site/2.0"))
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")))
261 (("\"libguile-ncurses\"")
262 (format #f "\"~a/lib/libguile-ncurses\""
265 (home-page "http://www.gnu.org/software/guile-ncurses/")
266 (synopsis "Guile bindings to ncurses")
268 "guile-ncurses provides guile bindings to the ncurses library.")
277 (uri (string-append "mirror://gnu/mcron/mcron-"
281 "0yvrfzzdy2m7fbqkr61fw01wd9r2jpnbyabxhcsfivgxywknl0fy"))
282 (patches (list (search-patch "mcron-install.patch")))))
283 (build-system gnu-build-system)
285 `(("ed" ,ed) ("which" ,which) ("guile" ,guile-1.8)))
286 (home-page "http://www.gnu.org/software/mcron/")
287 (synopsis "Run jobs at scheduled times")
289 "Mcron is a complete replacement for Vixie cron. It is used to run
290 tasks on a schedule, such as every hour or every Monday. Mcron is written in
291 Guile, so its configuration can be written in Scheme, however the original
292 cron format is also supported.")
295 (define-public guile-lib
301 (uri (string-append "mirror://savannah/guile-lib/guile-lib-"
305 "1f9n2b5b5r75lzjinyk6zp6g20g60msa0jpfrk5hhg4j8cy0ih4b"))))
306 (build-system gnu-build-system)
308 '(#:phases (alist-cons-before
309 'configure 'patch-module-dir
311 (substitute* "src/Makefile.in"
312 (("^moddir[[:blank:]]*=[[:blank:]]*([[:graph:]]+)" _ rhs)
313 (string-append "moddir = " rhs "/2.0\n"))))
315 (inputs `(("guile" ,guile-2.0)))
316 (home-page "http://www.nongnu.org/guile-lib/")
317 (synopsis "Collection of useful Guile Scheme modules")
319 "guile-lib is intended as an accumulation place for pure-scheme Guile
320 modules, allowing for people to cooperate integrating their generic Guile
321 modules into a coherent library. Think \"a down-scaled, limited-scope CPAN
324 ;; The whole is under GPLv3+, but some modules are under laxer
325 ;; distribution terms such as LGPL and public domain. See `COPYING' for
329 ;;; guile.scm ends here