Commit | Line | Data |
---|---|---|
1722d680 LC |
1 | ;;; Guix --- Nix package management from Guile. -*- coding: utf-8 -*- |
2 | ;;; Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org> | |
3 | ;;; | |
4 | ;;; This file is part of Guix. | |
5 | ;;; | |
6 | ;;; 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. | |
10 | ;;; | |
11 | ;;; 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. | |
15 | ;;; | |
16 | ;;; You should have received a copy of the GNU General Public License | |
17 | ;;; along with Guix. If not, see <http://www.gnu.org/licenses/>. | |
18 | ||
19 | (define-module (distro packages guile) | |
4a44e743 | 20 | #:use-module (guix licenses) |
c44899a2 LC |
21 | #:use-module (distro) |
22 | #:use-module (distro packages bdw-gc) | |
23 | #:use-module (distro packages gawk) | |
1627f7f7 | 24 | #:use-module (distro packages gperf) |
c44899a2 | 25 | #:use-module (distro packages libffi) |
36d4d49e | 26 | #:use-module (distro packages autotools) |
c44899a2 LC |
27 | #:use-module (distro packages libunistring) |
28 | #:use-module (distro packages m4) | |
29 | #:use-module (distro packages multiprecision) | |
30 | #:use-module (distro packages pkg-config) | |
31 | #:use-module (distro 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 | ||
123 | (synopsis "GNU Guile 2.0, an embeddable Scheme implementation") | |
124 | (description | |
125 | "GNU Guile is an implementation of the Scheme programming language, with | |
126 | support for many SRFIs, packaged for use in a wide variety of environments. | |
127 | In addition to implementing the R5RS Scheme standard and a large subset of | |
128 | R6RS, Guile includes a module system, full access to POSIX system calls, | |
129 | networking support, multiple threads, dynamic linking, a foreign function | |
130 | call interface, and powerful string processing.") | |
131 | (home-page "http://www.gnu.org/software/guile/") | |
4a44e743 | 132 | (license lgpl3+))) |
c44899a2 | 133 | |
fa29b199 LC |
134 | (define-public guile-2.0/fixed |
135 | ;; A package of Guile 2.0 that's rarely changed. It is the one used | |
136 | ;; in the `base' module, and thus changing it entails a full rebuild. | |
3af4e053 LC |
137 | (package (inherit guile-2.0) |
138 | (version "2.0.6") | |
139 | (source (origin | |
140 | (method url-fetch) | |
141 | (uri (string-append "mirror://gnu/guile/guile-" version | |
142 | ".tar.xz")) | |
143 | (sha256 | |
144 | (base32 | |
145 | "000ng5qsq3cl1k35jvzvhwxj92wx4q87745n2fppkd4irh58vv5l")))))) | |
fa29b199 | 146 | |
c44899a2 LC |
147 | \f |
148 | ;;; | |
149 | ;;; Extensions. | |
150 | ;;; | |
151 | ||
1722d680 LC |
152 | (define (guile-reader guile) |
153 | "Build Guile-Reader against GUILE, a package of some version of Guile 1.8 | |
154 | or 2.0." | |
155 | (package | |
156 | (name (string-append "guile-reader-for-guile-" (package-version guile))) | |
157 | (version "0.6") | |
158 | (source (origin | |
87f5d366 | 159 | (method url-fetch) |
1722d680 LC |
160 | (uri (string-append |
161 | "http://download-mirror.savannah.gnu.org/releases/guile-reader/guile-reader-" | |
162 | version ".tar.gz")) | |
163 | (sha256 | |
164 | (base32 | |
165 | "1svlyk5pm4fsdp2g7n6qffdl6fdggxnlicj0jn9s4lxd63gzxy1n")))) | |
166 | (build-system gnu-build-system) | |
cb0d69ed | 167 | (native-inputs `(("pkgconfig" ,pkg-config) |
1627f7f7 | 168 | ("gperf" ,gperf))) |
1722d680 | 169 | (inputs `(("guile" ,guile))) |
d45122f5 | 170 | (synopsis "Guile-Reader, a simple framework for building readers for |
1722d680 | 171 | GNU Guile") |
d45122f5 | 172 | (description |
1722d680 LC |
173 | "Guile-Reader is a simple framework for building readers for GNU Guile. |
174 | ||
175 | The idea is to make it easy to build procedures that extend Guile’s read | |
176 | procedure. Readers supporting various syntax variants can easily be written, | |
177 | possibly by re-using existing “token readers” of a standard Scheme | |
178 | readers. For example, it is used to implement Skribilo’s R5RS-derived | |
179 | document syntax. | |
180 | ||
181 | Guile-Reader’s approach is similar to Common Lisp’s “read table”, but | |
182 | hopefully more powerful and flexible (for instance, one may instantiate as | |
183 | many readers as needed).") | |
184 | (home-page "http://www.nongnu.org/guile-reader/") | |
4a44e743 | 185 | (license gpl3+))) |
1722d680 LC |
186 | |
187 | (define-public guile-reader/guile-1.8 | |
188 | ;; Guile-Reader built against Guile 1.8. | |
189 | (guile-reader guile-1.8)) | |
190 | ||
191 | (define-public guile-reader/guile-2.0 | |
192 | ;; Guile-Reader built against Guile 2.0. | |
193 | (guile-reader guile-2.0)) | |
194 | ||
195 | ;;; guile.scm ends here |