1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012 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 bdw-gc)
23 #:use-module (gnu packages gawk)
24 #:use-module (gnu packages gperf)
25 #:use-module (gnu packages libffi)
26 #:use-module (gnu packages autotools)
27 #:use-module (gnu packages libunistring)
28 #:use-module (gnu packages m4)
29 #:use-module (gnu packages multiprecision)
30 #:use-module (gnu packages pkg-config)
31 #:use-module (gnu packages readline)
32 #:use-module (guix packages)
33 #:use-module (guix download)
34 #:use-module (guix build-system gnu))
38 ;;; GNU Guile, and modules and extensions.
42 (define-public guile-1.8
48 (uri (string-append "mirror://gnu/guile/guile-" version
52 "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3"))))
53 (build-system gnu-build-system)
54 (arguments '(#:configure-flags '("--disable-error-on-warning")
55 #:patches (list (assoc-ref %build-inputs "patch/snarf"))
57 ;; Insert a phase before `configure' to patch things up.
58 #:phases (alist-cons-before
60 'patch-loader-search-path
61 (lambda* (#:key outputs #:allow-other-keys)
62 ;; Add a call to `lt_dladdsearchdir' so that
63 ;; `libguile-readline.so' & co. are in the
64 ;; loader's search path.
65 (substitute* "libguile/dynl.c"
66 (("lt_dlinit.*$" match)
68 " ~a~% lt_dladdsearchdir(\"~a/lib\");~%"
70 (assoc-ref outputs "out")))))
72 (inputs `(("patch/snarf" ,(search-patch "guile-1.8-cpp-4.5.patch"))
74 ("readline" ,readline)))
76 ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be
78 (propagated-inputs `(("gmp" ,gmp)
79 ("libtool" ,libtool)))
81 ;; When cross-compiling, a native version of Guile itself is needed.
82 (self-native-input? #t)
84 (synopsis "GNU Guile 1.8, an embeddable Scheme interpreter")
86 "GNU Guile 1.8 is an interpreter for the Scheme programming language,
87 packaged as a library that can be embedded into programs to make them
88 extensible. It supports many SRFIs.")
89 (home-page "http://www.gnu.org/software/guile/")
92 (define-public guile-2.0
98 (uri (string-append "mirror://gnu/guile/guile-" version
102 "0f53pxkia4v17n0avwqlcjpy0n89hkazm2xsa6p84lv8k6k8y9vg"))))
103 (build-system gnu-build-system)
104 (native-inputs `(("pkgconfig" ,pkg-config)))
105 (inputs `(("libffi" ,libffi)
106 ("readline" ,readline)))
109 `( ;; These ones aren't normally needed here, but since `libguile-2.0.la'
110 ;; reads `-lltdl -lunistring', adding them here will add the needed
111 ;; `-L' flags. As for why the `.la' file lacks the `-L' flags, see
112 ;; <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903>.
113 ("libunistring" ,libunistring)
116 ;; The headers and/or `guile-2.0.pc' refer to these packages, so they
117 ;; must be propagated.
121 (self-native-input? #t)
124 '(#:phases (alist-cons-before
125 'configure 'pre-configure
126 (lambda* (#:key inputs #:allow-other-keys)
127 (let ((bash (assoc-ref inputs "bash")))
128 (substitute* "module/ice-9/popen.scm"
130 (string-append bash "/bin/bash")))))
133 (synopsis "GNU Guile 2.0, an embeddable Scheme implementation")
135 "GNU Guile is an implementation of the Scheme programming language, with
136 support for many SRFIs, packaged for use in a wide variety of environments.
137 In addition to implementing the R5RS Scheme standard and a large subset of
138 R6RS, Guile includes a module system, full access to POSIX system calls,
139 networking support, multiple threads, dynamic linking, a foreign function
140 call interface, and powerful string processing.")
141 (home-page "http://www.gnu.org/software/guile/")
144 (define-public guile-2.0/fixed
145 ;; A package of Guile 2.0 that's rarely changed. It is the one used
146 ;; in the `base' module, and thus changing it entails a full rebuild.
154 (define (guile-reader guile)
155 "Build Guile-Reader against GUILE, a package of some version of Guile 1.8
158 (name (string-append "guile-reader-for-guile-" (package-version guile)))
163 "http://download-mirror.savannah.gnu.org/releases/guile-reader/guile-reader-"
167 "1svlyk5pm4fsdp2g7n6qffdl6fdggxnlicj0jn9s4lxd63gzxy1n"))))
168 (build-system gnu-build-system)
169 (native-inputs `(("pkgconfig" ,pkg-config)
171 (inputs `(("guile" ,guile)))
172 (synopsis "Guile-Reader, a simple framework for building readers for
175 "Guile-Reader is a simple framework for building readers for GNU Guile.
177 The idea is to make it easy to build procedures that extend Guile’s read
178 procedure. Readers supporting various syntax variants can easily be written,
179 possibly by re-using existing “token readers” of a standard Scheme
180 readers. For example, it is used to implement Skribilo’s R5RS-derived
183 Guile-Reader’s approach is similar to Common Lisp’s “read table”, but
184 hopefully more powerful and flexible (for instance, one may instantiate as
185 many readers as needed).")
186 (home-page "http://www.nongnu.org/guile-reader/")
189 (define-public guile-reader/guile-1.8
190 ;; Guile-Reader built against Guile 1.8.
191 (guile-reader guile-1.8))
193 (define-public guile-reader/guile-2.0
194 ;; Guile-Reader built against Guile 2.0.
195 (guile-reader guile-2.0))
197 ;;; guile.scm ends here