Commit | Line | Data |
---|---|---|
233e7676 | 1 | ;;; GNU Guix --- Functional package management for GNU |
00ebe474 | 2 | ;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> |
b515822d | 3 | ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org> |
6bc24063 | 4 | ;;; Copyright © 2015 Christopher Allan Webber <cwebber@dustycloud.org> |
1722d680 | 5 | ;;; |
233e7676 | 6 | ;;; This file is part of GNU Guix. |
1722d680 | 7 | ;;; |
233e7676 | 8 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
1722d680 LC |
9 | ;;; under the terms of the GNU General Public License as published by |
10 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
11 | ;;; your option) any later version. | |
12 | ;;; | |
233e7676 | 13 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
1722d680 LC |
14 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | ;;; GNU General Public License for more details. | |
17 | ;;; | |
18 | ;;; You should have received a copy of the GNU General Public License | |
233e7676 | 19 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
1722d680 | 20 | |
1ffa7090 | 21 | (define-module (gnu packages guile) |
4a44e743 | 22 | #:use-module (guix licenses) |
59a43334 | 23 | #:use-module (gnu packages) |
9c782445 | 24 | #:use-module (gnu packages bash) |
1ffa7090 LC |
25 | #:use-module (gnu packages bdw-gc) |
26 | #:use-module (gnu packages gawk) | |
27 | #:use-module (gnu packages gperf) | |
28 | #:use-module (gnu packages libffi) | |
29 | #:use-module (gnu packages autotools) | |
30 | #:use-module (gnu packages libunistring) | |
31 | #:use-module (gnu packages m4) | |
32 | #:use-module (gnu packages multiprecision) | |
33 | #:use-module (gnu packages pkg-config) | |
34 | #:use-module (gnu packages readline) | |
ef02e1e9 | 35 | #:use-module (gnu packages ncurses) |
87d836b2 | 36 | #:use-module (gnu packages ed) |
ce0614dd | 37 | #:use-module (gnu packages base) |
1722d680 | 38 | #:use-module (guix packages) |
87f5d366 | 39 | #:use-module (guix download) |
6bc24063 | 40 | #:use-module (guix git-download) |
32795fcf | 41 | #:use-module (guix build-system gnu) |
6bc24063 | 42 | #:use-module (guix build-system trivial) |
32795fcf LC |
43 | #:use-module (guix utils) |
44 | #:use-module (ice-9 match)) | |
1722d680 LC |
45 | |
46 | ;;; Commentary: | |
47 | ;;; | |
c44899a2 | 48 | ;;; GNU Guile, and modules and extensions. |
1722d680 LC |
49 | ;;; |
50 | ;;; Code: | |
51 | ||
c44899a2 LC |
52 | (define-public guile-1.8 |
53 | (package | |
54 | (name "guile") | |
55 | (version "1.8.8") | |
56 | (source (origin | |
87f5d366 | 57 | (method url-fetch) |
0db342a5 | 58 | (uri (string-append "mirror://gnu/guile/guile-" version |
c44899a2 LC |
59 | ".tar.gz")) |
60 | (sha256 | |
61 | (base32 | |
01eafd38 LC |
62 | "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3")) |
63 | (patches (list (search-patch "guile-1.8-cpp-4.5.patch"))))) | |
c44899a2 LC |
64 | (build-system gnu-build-system) |
65 | (arguments '(#:configure-flags '("--disable-error-on-warning") | |
c44899a2 LC |
66 | |
67 | ;; Insert a phase before `configure' to patch things up. | |
68 | #:phases (alist-cons-before | |
69 | 'configure | |
2f4fbe1c | 70 | 'patch-stuff |
c44899a2 LC |
71 | (lambda* (#:key outputs #:allow-other-keys) |
72 | ;; Add a call to `lt_dladdsearchdir' so that | |
73 | ;; `libguile-readline.so' & co. are in the | |
74 | ;; loader's search path. | |
75 | (substitute* "libguile/dynl.c" | |
2f4fbe1c LC |
76 | (("lt_dlinit.*$" match) |
77 | (format #f | |
78 | " ~a~% lt_dladdsearchdir(\"~a/lib\");~%" | |
79 | match | |
80 | (assoc-ref outputs "out")))) | |
81 | ||
82 | ;; The usual /bin/sh... | |
83 | (substitute* "ice-9/popen.scm" | |
84 | (("/bin/sh") (which "sh")))) | |
c44899a2 | 85 | %standard-phases))) |
01eafd38 | 86 | (inputs `(("gawk" ,gawk) |
c44899a2 LC |
87 | ("readline" ,readline))) |
88 | ||
89 | ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be | |
90 | ;; propagated. | |
91 | (propagated-inputs `(("gmp" ,gmp) | |
be11b102 | 92 | ("libltdl" ,libltdl))) |
c44899a2 LC |
93 | |
94 | ;; When cross-compiling, a native version of Guile itself is needed. | |
95 | (self-native-input? #t) | |
96 | ||
9be8d7c8 LC |
97 | (native-search-paths |
98 | (list (search-path-specification | |
99 | (variable "GUILE_LOAD_PATH") | |
af070955 | 100 | (files '("share/guile/site"))))) |
9be8d7c8 | 101 | |
f50d2669 | 102 | (synopsis "Scheme implementation intended especially for extensions") |
c44899a2 | 103 | (description |
a22dc0c4 LC |
104 | "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the |
105 | official extension language of the GNU system. It is an implementation of | |
106 | the Scheme language which can be easily embedded in other applications to | |
107 | provide a convenient means of extending the functionality of the application | |
108 | without requiring the source code to be rewritten.") | |
c44899a2 | 109 | (home-page "http://www.gnu.org/software/guile/") |
4a44e743 | 110 | (license lgpl2.0+))) |
c44899a2 LC |
111 | |
112 | (define-public guile-2.0 | |
113 | (package | |
114 | (name "guile") | |
b1a01474 | 115 | (version "2.0.11") |
c44899a2 | 116 | (source (origin |
87f5d366 | 117 | (method url-fetch) |
0db342a5 | 118 | (uri (string-append "mirror://gnu/guile/guile-" version |
c44899a2 LC |
119 | ".tar.xz")) |
120 | (sha256 | |
121 | (base32 | |
b515822d MW |
122 | "1qh3j7308qvsjgwf7h94yqgckpbgz2k3yqdkzsyhqcafvfka9l5f")) |
123 | (patches (list (search-patch "guile-arm-fixes.patch"))))) | |
c44899a2 LC |
124 | (build-system gnu-build-system) |
125 | (native-inputs `(("pkgconfig" ,pkg-config))) | |
126 | (inputs `(("libffi" ,libffi) | |
9c782445 | 127 | ("readline" ,readline) |
cba95006 | 128 | ("bash" ,bash))) |
c44899a2 LC |
129 | |
130 | (propagated-inputs | |
131 | `( ;; These ones aren't normally needed here, but since `libguile-2.0.la' | |
132 | ;; reads `-lltdl -lunistring', adding them here will add the needed | |
133 | ;; `-L' flags. As for why the `.la' file lacks the `-L' flags, see | |
134 | ;; <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903>. | |
135 | ("libunistring" ,libunistring) | |
be11b102 LC |
136 | |
137 | ;; Depend on LIBLTDL, not LIBTOOL. That way, we avoid some the extra | |
138 | ;; dependencies that LIBTOOL has, which is helpful during bootstrap. | |
139 | ("libltdl" ,libltdl) | |
c44899a2 LC |
140 | |
141 | ;; The headers and/or `guile-2.0.pc' refer to these packages, so they | |
142 | ;; must be propagated. | |
bda1bc6c | 143 | ("bdw-gc" ,libgc) |
c44899a2 LC |
144 | ("gmp" ,gmp))) |
145 | ||
146 | (self-native-input? #t) | |
147 | ||
9bf62d9b LC |
148 | (outputs '("out" "debug")) |
149 | ||
8ffaa93b | 150 | (arguments |
9c782445 | 151 | `(#:phases (alist-cons-before |
8ffaa93b LC |
152 | 'configure 'pre-configure |
153 | (lambda* (#:key inputs #:allow-other-keys) | |
58b4e8e8 | 154 | ;; Tell (ice-9 popen) the file name of Bash. |
8ffaa93b LC |
155 | (let ((bash (assoc-ref inputs "bash"))) |
156 | (substitute* "module/ice-9/popen.scm" | |
157 | (("/bin/sh") | |
158 | (string-append bash "/bin/bash"))))) | |
db619089 | 159 | %standard-phases))) |
8ffaa93b | 160 | |
9be8d7c8 LC |
161 | (native-search-paths |
162 | (list (search-path-specification | |
163 | (variable "GUILE_LOAD_PATH") | |
af070955 | 164 | (files '("share/guile/site/2.0"))) |
9be8d7c8 LC |
165 | (search-path-specification |
166 | (variable "GUILE_LOAD_COMPILED_PATH") | |
af070955 | 167 | (files '("share/guile/site/2.0"))))) |
9be8d7c8 | 168 | |
f50d2669 | 169 | (synopsis "Scheme implementation intended especially for extensions") |
c44899a2 | 170 | (description |
a22dc0c4 LC |
171 | "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the |
172 | official extension language of the GNU system. It is an implementation of | |
173 | the Scheme language which can be easily embedded in other applications to | |
174 | provide a convenient means of extending the functionality of the application | |
175 | without requiring the source code to be rewritten.") | |
c44899a2 | 176 | (home-page "http://www.gnu.org/software/guile/") |
4a44e743 | 177 | (license lgpl3+))) |
c44899a2 | 178 | |
fa29b199 LC |
179 | (define-public guile-2.0/fixed |
180 | ;; A package of Guile 2.0 that's rarely changed. It is the one used | |
181 | ;; in the `base' module, and thus changing it entails a full rebuild. | |
bda1bc6c | 182 | guile-2.0) |
fa29b199 | 183 | |
c44899a2 LC |
184 | \f |
185 | ;;; | |
186 | ;;; Extensions. | |
187 | ;;; | |
188 | ||
d6d9f1f7 | 189 | (define-public guile-reader |
1722d680 | 190 | (package |
d6d9f1f7 LC |
191 | (name "guile-reader") |
192 | (version "0.6") | |
193 | (source (origin | |
194 | (method url-fetch) | |
195 | (uri (string-append "mirror://savannah/guile-reader/guile-reader-" | |
196 | version ".tar.gz")) | |
197 | (sha256 | |
198 | (base32 | |
199 | "1svlyk5pm4fsdp2g7n6qffdl6fdggxnlicj0jn9s4lxd63gzxy1n")))) | |
200 | (build-system gnu-build-system) | |
201 | (native-inputs `(("pkgconfig" ,pkg-config) | |
202 | ("gperf" ,gperf))) | |
203 | (inputs `(("guile" ,guile-2.0))) | |
7d9e8c08 LC |
204 | (arguments `(;; The extract-*.sh scripts really expect to run in the C |
205 | ;; locale. Failing to do that, we end up with a build | |
206 | ;; failure while extracting doc. (Fixed in Guile-Reader's | |
207 | ;; repo.) | |
208 | #:locale "C" | |
209 | ||
210 | #:configure-flags | |
d6d9f1f7 LC |
211 | (let ((out (assoc-ref %outputs "out"))) |
212 | (list (string-append "--with-guilemoduledir=" | |
213 | out "/share/guile/site/2.0"))))) | |
214 | (synopsis "Framework for building readers for GNU Guile") | |
215 | (description | |
216 | "Guile-Reader is a simple framework for building readers for GNU Guile. | |
1722d680 LC |
217 | |
218 | The idea is to make it easy to build procedures that extend Guile’s read | |
35b9e423 | 219 | procedure. Readers supporting various syntax variants can easily be written, |
1722d680 | 220 | possibly by re-using existing “token readers” of a standard Scheme |
35b9e423 | 221 | readers. For example, it is used to implement Skribilo’s R5RS-derived |
1722d680 LC |
222 | document syntax. |
223 | ||
224 | Guile-Reader’s approach is similar to Common Lisp’s “read table”, but | |
225 | hopefully more powerful and flexible (for instance, one may instantiate as | |
226 | many readers as needed).") | |
d6d9f1f7 LC |
227 | (home-page "http://www.nongnu.org/guile-reader/") |
228 | (license gpl3+))) | |
1722d680 | 229 | |
ef02e1e9 LC |
230 | (define-public guile-ncurses |
231 | (package | |
232 | (name "guile-ncurses") | |
31a123fe | 233 | (version "1.6") |
ef02e1e9 LC |
234 | (source (origin |
235 | (method url-fetch) | |
236 | (uri (string-append "mirror://gnu/guile-ncurses/guile-ncurses-" | |
237 | version ".tar.gz")) | |
238 | (sha256 | |
239 | (base32 | |
31a123fe | 240 | "0wmk681zzi1wxw543r2s2r84ndnzxp69kr7pc01aw4l55hg7jn73")))) |
ef02e1e9 LC |
241 | (build-system gnu-build-system) |
242 | (inputs `(("ncurses" ,ncurses) | |
243 | ("guile" ,guile-2.0))) | |
244 | (arguments | |
2c6b7c7d LC |
245 | '(#:configure-flags (list "--with-ncursesw" ; Unicode support |
246 | (string-append "--with-guilesitedir=" | |
ef02e1e9 | 247 | (assoc-ref %outputs "out") |
3f69e393 | 248 | "/share/guile/site/2.0")) |
b0b72780 LC |
249 | #:phases (alist-cons-before |
250 | 'check 'change-locale | |
251 | (lambda _ | |
252 | ;; Use the locale that's actually available in the build | |
253 | ;; environment. | |
254 | (substitute* "test/f009_form_wide.test" | |
255 | (("en_US\\.utf8") | |
256 | "en_US.UTF-8"))) | |
257 | (alist-cons-after | |
258 | 'install 'post-install | |
259 | (lambda* (#:key outputs #:allow-other-keys) | |
260 | (let* ((out (assoc-ref outputs "out")) | |
261 | (dir (string-append out "/share/guile/site/")) | |
262 | (files (find-files dir ".scm"))) | |
263 | (substitute* files | |
264 | (("\"libguile-ncurses\"") | |
265 | (format #f "\"~a/lib/libguile-ncurses\"" | |
266 | out))))) | |
267 | %standard-phases)))) | |
ef02e1e9 | 268 | (home-page "http://www.gnu.org/software/guile-ncurses/") |
f50d2669 | 269 | (synopsis "Guile bindings to ncurses") |
ef02e1e9 | 270 | (description |
12bcf94a | 271 | "guile-ncurses provides Guile language bindings for the ncurses |
79c311b8 | 272 | library.") |
ef02e1e9 LC |
273 | (license lgpl3+))) |
274 | ||
87d836b2 LC |
275 | (define-public mcron |
276 | (package | |
277 | (name "mcron") | |
d12c626c | 278 | (version "1.0.8") |
87d836b2 LC |
279 | (source (origin |
280 | (method url-fetch) | |
281 | (uri (string-append "mirror://gnu/mcron/mcron-" | |
282 | version ".tar.gz")) | |
283 | (sha256 | |
284 | (base32 | |
d12c626c | 285 | "0zparwgf01jgl1x53ik71ghabldq6zz18ha4dscps1i0qrzgap1b")) |
01eafd38 | 286 | (patches (list (search-patch "mcron-install.patch"))))) |
87d836b2 | 287 | (build-system gnu-build-system) |
b6c18d6a LC |
288 | (native-inputs `(("pkg-config" ,pkg-config))) |
289 | (inputs `(("ed" ,ed) ("which" ,which) ("guile" ,guile-2.0))) | |
87d836b2 | 290 | (home-page "http://www.gnu.org/software/mcron/") |
f50d2669 | 291 | (synopsis "Run jobs at scheduled times") |
87d836b2 | 292 | (description |
79c311b8 | 293 | "GNU Mcron is a complete replacement for Vixie cron. It is used to run |
a22dc0c4 | 294 | tasks on a schedule, such as every hour or every Monday. Mcron is written in |
79c311b8 LC |
295 | Guile, so its configuration can be written in Scheme; the original cron |
296 | format is also supported.") | |
87d836b2 LC |
297 | (license gpl3+))) |
298 | ||
3e9066fc LC |
299 | (define-public guile-lib |
300 | (package | |
301 | (name "guile-lib") | |
302 | (version "0.2.2") | |
303 | (source (origin | |
304 | (method url-fetch) | |
305 | (uri (string-append "mirror://savannah/guile-lib/guile-lib-" | |
306 | version ".tar.gz")) | |
307 | (sha256 | |
308 | (base32 | |
309 | "1f9n2b5b5r75lzjinyk6zp6g20g60msa0jpfrk5hhg4j8cy0ih4b")))) | |
310 | (build-system gnu-build-system) | |
311 | (arguments | |
312 | '(#:phases (alist-cons-before | |
313 | 'configure 'patch-module-dir | |
314 | (lambda _ | |
315 | (substitute* "src/Makefile.in" | |
316 | (("^moddir[[:blank:]]*=[[:blank:]]*([[:graph:]]+)" _ rhs) | |
317 | (string-append "moddir = " rhs "/2.0\n")))) | |
318 | %standard-phases))) | |
319 | (inputs `(("guile" ,guile-2.0))) | |
320 | (home-page "http://www.nongnu.org/guile-lib/") | |
321 | (synopsis "Collection of useful Guile Scheme modules") | |
322 | (description | |
35b9e423 | 323 | "Guile-Lib is intended as an accumulation place for pure-scheme Guile |
3e9066fc LC |
324 | modules, allowing for people to cooperate integrating their generic Guile |
325 | modules into a coherent library. Think \"a down-scaled, limited-scope CPAN | |
326 | for Guile\".") | |
327 | ||
328 | ;; The whole is under GPLv3+, but some modules are under laxer | |
329 | ;; distribution terms such as LGPL and public domain. See `COPYING' for | |
330 | ;; details. | |
331 | (license gpl3+))) | |
332 | ||
6050a1fb CR |
333 | (define-public guile-json |
334 | (package | |
335 | (name "guile-json") | |
cdf2b286 | 336 | (version "0.4.0") |
6050a1fb CR |
337 | (source (origin |
338 | (method url-fetch) | |
339 | (uri (string-append "mirror://savannah/guile-json/guile-json-" | |
340 | version ".tar.gz")) | |
341 | (sha256 | |
342 | (base32 | |
cdf2b286 | 343 | "0v06272rw4ycwzssjf3fzpk2vhpslvl55hz94q80vc6f74j0d5h6")) |
bf6fcf54 LC |
344 | (modules '((guix build utils))) |
345 | (snippet | |
346 | ;; Make sure everything goes under .../site/2.0, like Guile's | |
347 | ;; search paths expects. | |
348 | '(substitute* '("Makefile.in" "json/Makefile.in") | |
349 | (("moddir =.*/share/guile/site" all) | |
350 | (string-append all "/2.0")))))) | |
6050a1fb | 351 | (build-system gnu-build-system) |
db5584dd | 352 | (native-inputs `(("guile" ,guile-2.0))) |
6050a1fb CR |
353 | (home-page "http://savannah.nongnu.org/projects/guile-json/") |
354 | (synopsis "JSON module for Guile") | |
355 | (description | |
356 | "Guile-json supports parsing and building JSON documents according to the | |
35b9e423 | 357 | http:://json.org specification. These are the main features: |
6050a1fb CR |
358 | - Strictly complies to http://json.org specification. |
359 | - Build JSON documents programmatically via macros. | |
360 | - Unicode support for strings. | |
361 | - Allows JSON pretty printing.") | |
362 | (license lgpl3+))) | |
363 | ||
6bc24063 CAW |
364 | (define-public guile-minikanren |
365 | (package | |
366 | (name "guile-minikanren") | |
367 | (version "20150424.e844d85") | |
368 | (source (origin | |
369 | (method git-fetch) | |
370 | (uri (git-reference | |
371 | (url "https://github.com/ijp/minikanren.git") | |
372 | (commit "e844d85512f8c055d3f96143ee506007389a25e3"))) | |
373 | (sha256 | |
374 | (base32 | |
375 | "0r50jlpzi940jlmxyy3ddqqwmj5r12gb4bcv0ssini9v8km13xz6")))) | |
376 | (build-system trivial-build-system) | |
377 | (arguments | |
378 | `(#:modules | |
379 | ((guix build utils) | |
380 | (ice-9 match)) | |
381 | #:builder | |
382 | (begin | |
383 | (use-modules (guix build utils) | |
384 | (ice-9 match)) | |
385 | (let* ((out (assoc-ref %outputs "out")) | |
386 | (module-dir (string-append out "/share/guile/site/2.0")) | |
387 | (source (assoc-ref %build-inputs "source")) | |
388 | (doc (string-append out "/share/doc")) | |
389 | (scm-files '("minikanren.scm" | |
390 | "minikanren/mkextraforms.scm" | |
391 | "minikanren/mkprelude.scm" | |
392 | "minikanren/mk.scm")) | |
393 | (guild (string-append (assoc-ref %build-inputs "guile") | |
394 | "/bin/guild"))) | |
395 | ;; Make installation directories. | |
396 | (mkdir-p (string-append module-dir "/minikanren")) | |
397 | (mkdir-p doc) | |
398 | ||
399 | ;; Compile .scm files and install. | |
400 | (chdir source) | |
401 | (setenv "GUILE_AUTO_COMPILE" "0") | |
402 | (for-each (lambda (file) | |
403 | (let* ((dest-file (string-append module-dir "/" | |
404 | file ".scm")) | |
405 | (go-file (match (string-split file #\.) | |
406 | ((base _) | |
407 | (string-append module-dir "/" | |
408 | base ".go"))))) | |
409 | ;; Install source module. | |
410 | (copy-file file dest-file) | |
411 | ;; Install compiled module. | |
412 | (unless (zero? (system* guild "compile" | |
413 | "-L" source | |
414 | "-o" go-file | |
415 | file)) | |
416 | (error (format #f "Failed to compile ~s to ~s!" | |
417 | file go-file))))) | |
418 | scm-files) | |
419 | ||
420 | ;; Also copy over the README. | |
421 | (copy-file "README.org" (string-append doc "/README.org")) | |
422 | #t)))) | |
423 | (inputs | |
424 | `(("guile" ,guile-2.0))) | |
425 | (home-page "https://github.com/ijp/minikanren") | |
426 | (synopsis "miniKanren declarative logic system, packaged for Guile") | |
427 | (description | |
428 | "MiniKanren is a relational programming extension to the Scheme | |
429 | programming Language, written as a smaller version of Kanren suitable for | |
430 | pedagogical purposes. It is featured in the book, The Reasoned Schemer, | |
431 | written by Dan Friedman, William Byrd, and Oleg Kiselyov. | |
432 | ||
433 | This is Ian Price's r6rs packaged version of miniKranen, which deviates | |
434 | slightly from miniKanren mainline. | |
435 | ||
436 | See http://minikanren.org/ for more on miniKanren generally.") | |
437 | (license expat))) | |
438 | ||
1722d680 | 439 | ;;; guile.scm ends here |