Commit | Line | Data |
---|---|---|
233e7676 | 1 | ;;; GNU Guix --- Functional package management for GNU |
ef02e1e9 | 2 | ;;; Copyright © 2012, 2013 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) |
59a43334 | 21 | #:use-module (gnu packages) |
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) | |
ef02e1e9 | 32 | #:use-module (gnu packages ncurses) |
1722d680 | 33 | #:use-module (guix packages) |
87f5d366 | 34 | #:use-module (guix download) |
1722d680 LC |
35 | #:use-module (guix build-system gnu)) |
36 | ||
37 | ;;; Commentary: | |
38 | ;;; | |
c44899a2 | 39 | ;;; GNU Guile, and modules and extensions. |
1722d680 LC |
40 | ;;; |
41 | ;;; Code: | |
42 | ||
c44899a2 LC |
43 | (define-public guile-1.8 |
44 | (package | |
45 | (name "guile") | |
46 | (version "1.8.8") | |
47 | (source (origin | |
87f5d366 | 48 | (method url-fetch) |
0db342a5 | 49 | (uri (string-append "mirror://gnu/guile/guile-" version |
c44899a2 LC |
50 | ".tar.gz")) |
51 | (sha256 | |
52 | (base32 | |
53 | "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3")))) | |
54 | (build-system gnu-build-system) | |
55 | (arguments '(#:configure-flags '("--disable-error-on-warning") | |
56 | #:patches (list (assoc-ref %build-inputs "patch/snarf")) | |
57 | ||
58 | ;; Insert a phase before `configure' to patch things up. | |
59 | #:phases (alist-cons-before | |
60 | 'configure | |
61 | 'patch-loader-search-path | |
62 | (lambda* (#:key outputs #:allow-other-keys) | |
63 | ;; Add a call to `lt_dladdsearchdir' so that | |
64 | ;; `libguile-readline.so' & co. are in the | |
65 | ;; loader's search path. | |
66 | (substitute* "libguile/dynl.c" | |
67 | (("lt_dlinit.*$" match) | |
68 | (format #f | |
69 | " ~a~% lt_dladdsearchdir(\"~a/lib\");~%" | |
70 | match | |
71 | (assoc-ref outputs "out"))))) | |
72 | %standard-phases))) | |
73 | (inputs `(("patch/snarf" ,(search-patch "guile-1.8-cpp-4.5.patch")) | |
74 | ("gawk" ,gawk) | |
75 | ("readline" ,readline))) | |
76 | ||
77 | ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be | |
78 | ;; propagated. | |
79 | (propagated-inputs `(("gmp" ,gmp) | |
80 | ("libtool" ,libtool))) | |
81 | ||
82 | ;; When cross-compiling, a native version of Guile itself is needed. | |
83 | (self-native-input? #t) | |
84 | ||
85 | (synopsis "GNU Guile 1.8, an embeddable Scheme interpreter") | |
86 | (description | |
87 | "GNU Guile 1.8 is an interpreter for the Scheme programming language, | |
88 | packaged as a library that can be embedded into programs to make them | |
89 | extensible. It supports many SRFIs.") | |
90 | (home-page "http://www.gnu.org/software/guile/") | |
4a44e743 | 91 | (license lgpl2.0+))) |
c44899a2 LC |
92 | |
93 | (define-public guile-2.0 | |
94 | (package | |
95 | (name "guile") | |
3af4e053 | 96 | (version "2.0.7") |
c44899a2 | 97 | (source (origin |
87f5d366 | 98 | (method url-fetch) |
0db342a5 | 99 | (uri (string-append "mirror://gnu/guile/guile-" version |
c44899a2 LC |
100 | ".tar.xz")) |
101 | (sha256 | |
102 | (base32 | |
3af4e053 | 103 | "0f53pxkia4v17n0avwqlcjpy0n89hkazm2xsa6p84lv8k6k8y9vg")))) |
c44899a2 LC |
104 | (build-system gnu-build-system) |
105 | (native-inputs `(("pkgconfig" ,pkg-config))) | |
106 | (inputs `(("libffi" ,libffi) | |
107 | ("readline" ,readline))) | |
108 | ||
109 | (propagated-inputs | |
110 | `( ;; These ones aren't normally needed here, but since `libguile-2.0.la' | |
111 | ;; reads `-lltdl -lunistring', adding them here will add the needed | |
112 | ;; `-L' flags. As for why the `.la' file lacks the `-L' flags, see | |
113 | ;; <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903>. | |
114 | ("libunistring" ,libunistring) | |
115 | ("libtool" ,libtool) | |
116 | ||
117 | ;; The headers and/or `guile-2.0.pc' refer to these packages, so they | |
118 | ;; must be propagated. | |
119 | ("bdw-gc" ,libgc) | |
120 | ("gmp" ,gmp))) | |
121 | ||
122 | (self-native-input? #t) | |
123 | ||
8ffaa93b LC |
124 | (arguments |
125 | '(#:phases (alist-cons-before | |
126 | 'configure 'pre-configure | |
127 | (lambda* (#:key inputs #:allow-other-keys) | |
128 | (let ((bash (assoc-ref inputs "bash"))) | |
129 | (substitute* "module/ice-9/popen.scm" | |
130 | (("/bin/sh") | |
131 | (string-append bash "/bin/bash"))))) | |
132 | %standard-phases))) | |
133 | ||
c44899a2 LC |
134 | (synopsis "GNU Guile 2.0, an embeddable Scheme implementation") |
135 | (description | |
136 | "GNU Guile is an implementation of the Scheme programming language, with | |
137 | support for many SRFIs, packaged for use in a wide variety of environments. | |
138 | In addition to implementing the R5RS Scheme standard and a large subset of | |
139 | R6RS, Guile includes a module system, full access to POSIX system calls, | |
140 | networking support, multiple threads, dynamic linking, a foreign function | |
141 | call interface, and powerful string processing.") | |
142 | (home-page "http://www.gnu.org/software/guile/") | |
4a44e743 | 143 | (license lgpl3+))) |
c44899a2 | 144 | |
fa29b199 LC |
145 | (define-public guile-2.0/fixed |
146 | ;; A package of Guile 2.0 that's rarely changed. It is the one used | |
147 | ;; in the `base' module, and thus changing it entails a full rebuild. | |
325285d5 | 148 | guile-2.0) |
fa29b199 | 149 | |
c44899a2 LC |
150 | \f |
151 | ;;; | |
152 | ;;; Extensions. | |
153 | ;;; | |
154 | ||
1722d680 LC |
155 | (define (guile-reader guile) |
156 | "Build Guile-Reader against GUILE, a package of some version of Guile 1.8 | |
157 | or 2.0." | |
158 | (package | |
159 | (name (string-append "guile-reader-for-guile-" (package-version guile))) | |
160 | (version "0.6") | |
161 | (source (origin | |
87f5d366 | 162 | (method url-fetch) |
1722d680 LC |
163 | (uri (string-append |
164 | "http://download-mirror.savannah.gnu.org/releases/guile-reader/guile-reader-" | |
165 | version ".tar.gz")) | |
166 | (sha256 | |
167 | (base32 | |
168 | "1svlyk5pm4fsdp2g7n6qffdl6fdggxnlicj0jn9s4lxd63gzxy1n")))) | |
169 | (build-system gnu-build-system) | |
cb0d69ed | 170 | (native-inputs `(("pkgconfig" ,pkg-config) |
1627f7f7 | 171 | ("gperf" ,gperf))) |
1722d680 | 172 | (inputs `(("guile" ,guile))) |
d45122f5 | 173 | (synopsis "Guile-Reader, a simple framework for building readers for |
1722d680 | 174 | GNU Guile") |
d45122f5 | 175 | (description |
1722d680 LC |
176 | "Guile-Reader is a simple framework for building readers for GNU Guile. |
177 | ||
178 | The idea is to make it easy to build procedures that extend Guile’s read | |
179 | procedure. Readers supporting various syntax variants can easily be written, | |
180 | possibly by re-using existing “token readers” of a standard Scheme | |
181 | readers. For example, it is used to implement Skribilo’s R5RS-derived | |
182 | document syntax. | |
183 | ||
184 | Guile-Reader’s approach is similar to Common Lisp’s “read table”, but | |
185 | hopefully more powerful and flexible (for instance, one may instantiate as | |
186 | many readers as needed).") | |
187 | (home-page "http://www.nongnu.org/guile-reader/") | |
4a44e743 | 188 | (license gpl3+))) |
1722d680 LC |
189 | |
190 | (define-public guile-reader/guile-1.8 | |
191 | ;; Guile-Reader built against Guile 1.8. | |
192 | (guile-reader guile-1.8)) | |
193 | ||
194 | (define-public guile-reader/guile-2.0 | |
195 | ;; Guile-Reader built against Guile 2.0. | |
196 | (guile-reader guile-2.0)) | |
197 | ||
ef02e1e9 LC |
198 | (define-public guile-ncurses |
199 | (package | |
200 | (name "guile-ncurses") | |
201 | (version "1.3") | |
202 | (source (origin | |
203 | (method url-fetch) | |
204 | (uri (string-append "mirror://gnu/guile-ncurses/guile-ncurses-" | |
205 | version ".tar.gz")) | |
206 | (sha256 | |
207 | (base32 | |
208 | "0chvfjrlmg99db98ra9vzwjmbypqx7d4ssm8q0kvzi0n0p9irszi")))) | |
209 | (build-system gnu-build-system) | |
210 | (inputs `(("ncurses" ,ncurses) | |
211 | ("guile" ,guile-2.0))) | |
212 | (arguments | |
213 | '(#:configure-flags (list (string-append "--with-guilesitedir=" | |
214 | (assoc-ref %outputs "out") | |
215 | "/share/guile/site")) | |
216 | #:phases (alist-cons-after | |
217 | 'install 'post-install | |
218 | (lambda* (#:key outputs #:allow-other-keys) | |
219 | (let* ((out (assoc-ref outputs "out")) | |
220 | (dir (string-append out "/share/guile/site/")) | |
221 | (files (find-files dir ".scm"))) | |
222 | (substitute* files | |
223 | (("\"libguile-ncurses\"") | |
224 | (format #f "\"~a/lib/libguile-ncurses\"" | |
225 | out))))) | |
226 | %standard-phases))) | |
227 | (home-page "http://www.gnu.org/software/guile-ncurses/") | |
228 | (synopsis | |
229 | "GNU Guile-Ncurses, Scheme interface to the NCurses libraries") | |
230 | (description | |
231 | "GNU Guile-Ncurses is a library for the Guile Scheme interpreter that | |
232 | provides functions for creating text user interfaces. The text user interface | |
233 | functionality is built on the ncurses libraries: curses, form, panel, and | |
234 | menu.") | |
235 | (license lgpl3+))) | |
236 | ||
1722d680 | 237 | ;;; guile.scm ends here |