1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
5 ;;; This file is part of GNU Guix.
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
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.
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
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.
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20 (define-module (gnu packages guile)
21 #:use-module (guix licenses)
22 #:use-module (gnu packages)
23 #:use-module (gnu packages bash)
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)
34 #:use-module (gnu packages ncurses)
35 #:use-module (gnu packages ed)
36 #:use-module (gnu packages base)
37 #:use-module (guix packages)
38 #:use-module (guix download)
39 #:use-module (guix build-system gnu)
40 #:use-module (guix utils)
41 #:use-module (ice-9 match))
45 ;;; GNU Guile, and modules and extensions.
49 (define-public guile-1.8
55 (uri (string-append "mirror://gnu/guile/guile-" version
59 "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3"))
60 (patches (list (search-patch "guile-1.8-cpp-4.5.patch")))))
61 (build-system gnu-build-system)
62 (arguments '(#:configure-flags '("--disable-error-on-warning")
64 ;; Insert a phase before `configure' to patch things up.
65 #:phases (alist-cons-before
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"
73 (("lt_dlinit.*$" match)
75 " ~a~% lt_dladdsearchdir(\"~a/lib\");~%"
77 (assoc-ref outputs "out"))))
79 ;; The usual /bin/sh...
80 (substitute* "ice-9/popen.scm"
81 (("/bin/sh") (which "sh"))))
83 (inputs `(("gawk" ,gawk)
84 ("readline" ,readline)))
86 ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be
88 (propagated-inputs `(("gmp" ,gmp)
89 ("libltdl" ,libltdl)))
91 ;; When cross-compiling, a native version of Guile itself is needed.
92 (self-native-input? #t)
95 (list (search-path-specification
96 (variable "GUILE_LOAD_PATH")
97 (files '("share/guile/site")))))
99 (synopsis "Scheme implementation intended especially for extensions")
101 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
102 official extension language of the GNU system. It is an implementation of
103 the Scheme language which can be easily embedded in other applications to
104 provide a convenient means of extending the functionality of the application
105 without requiring the source code to be rewritten.")
106 (home-page "http://www.gnu.org/software/guile/")
109 (define-public guile-2.0
115 (uri (string-append "mirror://gnu/guile/guile-" version
119 "1qh3j7308qvsjgwf7h94yqgckpbgz2k3yqdkzsyhqcafvfka9l5f"))
120 (patches (list (search-patch "guile-arm-fixes.patch")))))
121 (build-system gnu-build-system)
122 (native-inputs `(("pkgconfig" ,pkg-config)))
123 (inputs `(("libffi" ,libffi)
124 ("readline" ,readline)
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)
134 ;; Depend on LIBLTDL, not LIBTOOL. That way, we avoid some the extra
135 ;; dependencies that LIBTOOL has, which is helpful during bootstrap.
138 ;; The headers and/or `guile-2.0.pc' refer to these packages, so they
139 ;; must be propagated.
143 (self-native-input? #t)
145 (outputs '("out" "debug"))
148 `(#:phases (alist-cons-before
149 'configure 'pre-configure
150 (lambda* (#:key inputs #:allow-other-keys)
151 ;; Tell (ice-9 popen) the file name of Bash.
152 (let ((bash (assoc-ref inputs "bash")))
153 (substitute* "module/ice-9/popen.scm"
155 (string-append bash "/bin/bash")))))
159 (list (search-path-specification
160 (variable "GUILE_LOAD_PATH")
161 (files '("share/guile/site/2.0")))
162 (search-path-specification
163 (variable "GUILE_LOAD_COMPILED_PATH")
164 (files '("share/guile/site/2.0")))))
166 (synopsis "Scheme implementation intended especially for extensions")
168 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
169 official extension language of the GNU system. It is an implementation of
170 the Scheme language which can be easily embedded in other applications to
171 provide a convenient means of extending the functionality of the application
172 without requiring the source code to be rewritten.")
173 (home-page "http://www.gnu.org/software/guile/")
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.
186 (define-public guile-reader
188 (name "guile-reader")
192 (uri (string-append "mirror://savannah/guile-reader/guile-reader-"
196 "1svlyk5pm4fsdp2g7n6qffdl6fdggxnlicj0jn9s4lxd63gzxy1n"))))
197 (build-system gnu-build-system)
198 (native-inputs `(("pkgconfig" ,pkg-config)
200 (inputs `(("guile" ,guile-2.0)))
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
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")
213 "Guile-Reader is a simple framework for building readers for GNU Guile.
215 The idea is to make it easy to build procedures that extend Guile’s read
216 procedure. Readers supporting various syntax variants can easily be written,
217 possibly by re-using existing “token readers” of a standard Scheme
218 readers. For example, it is used to implement Skribilo’s R5RS-derived
221 Guile-Reader’s approach is similar to Common Lisp’s “read table”, but
222 hopefully more powerful and flexible (for instance, one may instantiate as
223 many readers as needed).")
224 (home-page "http://www.nongnu.org/guile-reader/")
227 (define-public guile-ncurses
229 (name "guile-ncurses")
233 (uri (string-append "mirror://gnu/guile-ncurses/guile-ncurses-"
237 "0wmk681zzi1wxw543r2s2r84ndnzxp69kr7pc01aw4l55hg7jn73"))))
238 (build-system gnu-build-system)
239 (inputs `(("ncurses" ,ncurses)
240 ("guile" ,guile-2.0)))
242 '(#:configure-flags (list "--with-ncursesw" ; Unicode support
243 (string-append "--with-guilesitedir="
244 (assoc-ref %outputs "out")
245 "/share/guile/site/2.0"))
246 #:phases (alist-cons-before
247 'check 'change-locale
249 ;; Use the locale that's actually available in the build
251 (substitute* "test/f009_form_wide.test"
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 language bindings for the ncurses
278 (uri (string-append "mirror://gnu/mcron/mcron-"
282 "0zparwgf01jgl1x53ik71ghabldq6zz18ha4dscps1i0qrzgap1b"))
283 (patches (list (search-patch "mcron-install.patch")))))
284 (build-system gnu-build-system)
285 (native-inputs `(("pkg-config" ,pkg-config)))
286 (inputs `(("ed" ,ed) ("which" ,which) ("guile" ,guile-2.0)))
287 (home-page "http://www.gnu.org/software/mcron/")
288 (synopsis "Run jobs at scheduled times")
290 "GNU Mcron is a complete replacement for Vixie cron. It is used to run
291 tasks on a schedule, such as every hour or every Monday. Mcron is written in
292 Guile, so its configuration can be written in Scheme; the original cron
293 format is also supported.")
296 (define-public guile-lib
302 (uri (string-append "mirror://savannah/guile-lib/guile-lib-"
306 "1f9n2b5b5r75lzjinyk6zp6g20g60msa0jpfrk5hhg4j8cy0ih4b"))))
307 (build-system gnu-build-system)
309 '(#:phases (alist-cons-before
310 'configure 'patch-module-dir
312 (substitute* "src/Makefile.in"
313 (("^moddir[[:blank:]]*=[[:blank:]]*([[:graph:]]+)" _ rhs)
314 (string-append "moddir = " rhs "/2.0\n"))))
316 (inputs `(("guile" ,guile-2.0)))
317 (home-page "http://www.nongnu.org/guile-lib/")
318 (synopsis "Collection of useful Guile Scheme modules")
320 "Guile-Lib is intended as an accumulation place for pure-scheme Guile
321 modules, allowing for people to cooperate integrating their generic Guile
322 modules into a coherent library. Think \"a down-scaled, limited-scope CPAN
325 ;; The whole is under GPLv3+, but some modules are under laxer
326 ;; distribution terms such as LGPL and public domain. See `COPYING' for
330 (define-public guile-json
336 (uri (string-append "mirror://savannah/guile-json/guile-json-"
340 "0v06272rw4ycwzssjf3fzpk2vhpslvl55hz94q80vc6f74j0d5h6"))
341 (modules '((guix build utils)))
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"))))))
348 (build-system gnu-build-system)
349 (native-inputs `(("guile" ,guile-2.0)))
350 (home-page "http://savannah.nongnu.org/projects/guile-json/")
351 (synopsis "JSON module for Guile")
353 "Guile-json supports parsing and building JSON documents according to the
354 http:://json.org specification. These are the main features:
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.")
361 ;;; guile.scm ends here