Commit | Line | Data |
---|---|---|
233e7676 LC |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2012 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) |
c44899a2 | 21 | #:use-module (distro) |
1ffa7090 LC |
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) | |
1722d680 | 32 | #:use-module (guix packages) |
87f5d366 | 33 | #:use-module (guix download) |
1722d680 LC |
34 | #:use-module (guix build-system gnu)) |
35 | ||
36 | ;;; Commentary: | |
37 | ;;; | |
c44899a2 | 38 | ;;; GNU Guile, and modules and extensions. |
1722d680 LC |
39 | ;;; |
40 | ;;; Code: | |
41 | ||
c44899a2 LC |
42 | (define-public guile-1.8 |
43 | (package | |
44 | (name "guile") | |
45 | (version "1.8.8") | |
46 | (source (origin | |
87f5d366 | 47 | (method url-fetch) |
0db342a5 | 48 | (uri (string-append "mirror://gnu/guile/guile-" version |
c44899a2 LC |
49 | ".tar.gz")) |
50 | (sha256 | |
51 | (base32 | |
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")) | |
56 | ||
57 | ;; Insert a phase before `configure' to patch things up. | |
58 | #:phases (alist-cons-before | |
59 | 'configure | |
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) | |
67 | (format #f | |
68 | " ~a~% lt_dladdsearchdir(\"~a/lib\");~%" | |
69 | match | |
70 | (assoc-ref outputs "out"))))) | |
71 | %standard-phases))) | |
72 | (inputs `(("patch/snarf" ,(search-patch "guile-1.8-cpp-4.5.patch")) | |
73 | ("gawk" ,gawk) | |
74 | ("readline" ,readline))) | |
75 | ||
76 | ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be | |
77 | ;; propagated. | |
78 | (propagated-inputs `(("gmp" ,gmp) | |
79 | ("libtool" ,libtool))) | |
80 | ||
81 | ;; When cross-compiling, a native version of Guile itself is needed. | |
82 | (self-native-input? #t) | |
83 | ||
84 | (synopsis "GNU Guile 1.8, an embeddable Scheme interpreter") | |
85 | (description | |
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/") | |
4a44e743 | 90 | (license lgpl2.0+))) |
c44899a2 LC |
91 | |
92 | (define-public guile-2.0 | |
93 | (package | |
94 | (name "guile") | |
3af4e053 | 95 | (version "2.0.7") |
c44899a2 | 96 | (source (origin |
87f5d366 | 97 | (method url-fetch) |
0db342a5 | 98 | (uri (string-append "mirror://gnu/guile/guile-" version |
c44899a2 LC |
99 | ".tar.xz")) |
100 | (sha256 | |
101 | (base32 | |
3af4e053 | 102 | "0f53pxkia4v17n0avwqlcjpy0n89hkazm2xsa6p84lv8k6k8y9vg")))) |
c44899a2 LC |
103 | (build-system gnu-build-system) |
104 | (native-inputs `(("pkgconfig" ,pkg-config))) | |
105 | (inputs `(("libffi" ,libffi) | |
106 | ("readline" ,readline))) | |
107 | ||
108 | (propagated-inputs | |
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) | |
114 | ("libtool" ,libtool) | |
115 | ||
116 | ;; The headers and/or `guile-2.0.pc' refer to these packages, so they | |
117 | ;; must be propagated. | |
118 | ("bdw-gc" ,libgc) | |
119 | ("gmp" ,gmp))) | |
120 | ||
121 | (self-native-input? #t) | |
122 | ||
8ffaa93b LC |
123 | (arguments |
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" | |
129 | (("/bin/sh") | |
130 | (string-append bash "/bin/bash"))))) | |
131 | %standard-phases))) | |
132 | ||
c44899a2 LC |
133 | (synopsis "GNU Guile 2.0, an embeddable Scheme implementation") |
134 | (description | |
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/") | |
4a44e743 | 142 | (license lgpl3+))) |
c44899a2 | 143 | |
fa29b199 LC |
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. | |
325285d5 | 147 | guile-2.0) |
fa29b199 | 148 | |
c44899a2 LC |
149 | \f |
150 | ;;; | |
151 | ;;; Extensions. | |
152 | ;;; | |
153 | ||
1722d680 LC |
154 | (define (guile-reader guile) |
155 | "Build Guile-Reader against GUILE, a package of some version of Guile 1.8 | |
156 | or 2.0." | |
157 | (package | |
158 | (name (string-append "guile-reader-for-guile-" (package-version guile))) | |
159 | (version "0.6") | |
160 | (source (origin | |
87f5d366 | 161 | (method url-fetch) |
1722d680 LC |
162 | (uri (string-append |
163 | "http://download-mirror.savannah.gnu.org/releases/guile-reader/guile-reader-" | |
164 | version ".tar.gz")) | |
165 | (sha256 | |
166 | (base32 | |
167 | "1svlyk5pm4fsdp2g7n6qffdl6fdggxnlicj0jn9s4lxd63gzxy1n")))) | |
168 | (build-system gnu-build-system) | |
cb0d69ed | 169 | (native-inputs `(("pkgconfig" ,pkg-config) |
1627f7f7 | 170 | ("gperf" ,gperf))) |
1722d680 | 171 | (inputs `(("guile" ,guile))) |
d45122f5 | 172 | (synopsis "Guile-Reader, a simple framework for building readers for |
1722d680 | 173 | GNU Guile") |
d45122f5 | 174 | (description |
1722d680 LC |
175 | "Guile-Reader is a simple framework for building readers for GNU Guile. |
176 | ||
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 | |
181 | document syntax. | |
182 | ||
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/") | |
4a44e743 | 187 | (license gpl3+))) |
1722d680 LC |
188 | |
189 | (define-public guile-reader/guile-1.8 | |
190 | ;; Guile-Reader built against Guile 1.8. | |
191 | (guile-reader guile-1.8)) | |
192 | ||
193 | (define-public guile-reader/guile-2.0 | |
194 | ;; Guile-Reader built against Guile 2.0. | |
195 | (guile-reader guile-2.0)) | |
196 | ||
197 | ;;; guile.scm ends here |