services: herd: Add missing newlines in error messages.
[jackhill/guix/guix.git] / gnu / packages / guile.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
d9f0788a 2;;; Copyright © 2012, 2013, 2014, 2015, 2016 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>
44a2bdf8 5;;; Copyright © 2016 Alex Sassmannshausen <alex@pompo.co>
1722d680 6;;;
233e7676 7;;; This file is part of GNU Guix.
1722d680 8;;;
233e7676 9;;; GNU Guix is free software; you can redistribute it and/or modify it
1722d680
LC
10;;; under the terms of the GNU General Public License as published by
11;;; the Free Software Foundation; either version 3 of the License, or (at
12;;; your option) any later version.
13;;;
233e7676 14;;; GNU Guix is distributed in the hope that it will be useful, but
1722d680
LC
15;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;;; GNU General Public License for more details.
18;;;
19;;; You should have received a copy of the GNU General Public License
233e7676 20;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
1722d680 21
1ffa7090 22(define-module (gnu packages guile)
4a44e743 23 #:use-module (guix licenses)
59a43334 24 #:use-module (gnu packages)
9c782445 25 #:use-module (gnu packages bash)
1ffa7090
LC
26 #:use-module (gnu packages bdw-gc)
27 #:use-module (gnu packages gawk)
28 #:use-module (gnu packages gperf)
29 #:use-module (gnu packages libffi)
30 #:use-module (gnu packages autotools)
f906d30c 31 #:use-module (gnu packages flex)
1ffa7090 32 #:use-module (gnu packages libunistring)
7119cca8 33 #:use-module (gnu packages linux)
1ffa7090
LC
34 #:use-module (gnu packages m4)
35 #:use-module (gnu packages multiprecision)
36 #:use-module (gnu packages pkg-config)
37 #:use-module (gnu packages readline)
ef02e1e9 38 #:use-module (gnu packages ncurses)
87d836b2 39 #:use-module (gnu packages ed)
ce0614dd 40 #:use-module (gnu packages base)
f906d30c
CAW
41 #:use-module (gnu packages texinfo)
42 #:use-module (gnu packages gettext)
b416aadf 43 #:use-module (gnu packages databases)
9d373377 44 #:use-module (gnu packages python)
5649c8cd
DT
45 #:use-module (gnu packages gl)
46 #:use-module (gnu packages sdl)
47 #:use-module (gnu packages maths)
48 #:use-module (gnu packages image)
1722d680 49 #:use-module (guix packages)
87f5d366 50 #:use-module (guix download)
6bc24063 51 #:use-module (guix git-download)
32795fcf 52 #:use-module (guix build-system gnu)
6bc24063 53 #:use-module (guix build-system trivial)
32795fcf
LC
54 #:use-module (guix utils)
55 #:use-module (ice-9 match))
1722d680
LC
56
57;;; Commentary:
58;;;
c44899a2 59;;; GNU Guile, and modules and extensions.
1722d680
LC
60;;;
61;;; Code:
62
c44899a2
LC
63(define-public guile-1.8
64 (package
65 (name "guile")
66 (version "1.8.8")
67 (source (origin
87f5d366 68 (method url-fetch)
0db342a5 69 (uri (string-append "mirror://gnu/guile/guile-" version
c44899a2
LC
70 ".tar.gz"))
71 (sha256
72 (base32
01eafd38
LC
73 "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3"))
74 (patches (list (search-patch "guile-1.8-cpp-4.5.patch")))))
c44899a2
LC
75 (build-system gnu-build-system)
76 (arguments '(#:configure-flags '("--disable-error-on-warning")
c44899a2
LC
77
78 ;; Insert a phase before `configure' to patch things up.
79 #:phases (alist-cons-before
80 'configure
2f4fbe1c 81 'patch-stuff
c44899a2
LC
82 (lambda* (#:key outputs #:allow-other-keys)
83 ;; Add a call to `lt_dladdsearchdir' so that
84 ;; `libguile-readline.so' & co. are in the
85 ;; loader's search path.
86 (substitute* "libguile/dynl.c"
2f4fbe1c
LC
87 (("lt_dlinit.*$" match)
88 (format #f
89 " ~a~% lt_dladdsearchdir(\"~a/lib\");~%"
90 match
91 (assoc-ref outputs "out"))))
92
93 ;; The usual /bin/sh...
94 (substitute* "ice-9/popen.scm"
95 (("/bin/sh") (which "sh"))))
c44899a2 96 %standard-phases)))
01eafd38 97 (inputs `(("gawk" ,gawk)
c44899a2
LC
98 ("readline" ,readline)))
99
100 ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be
101 ;; propagated.
102 (propagated-inputs `(("gmp" ,gmp)
be11b102 103 ("libltdl" ,libltdl)))
c44899a2
LC
104
105 ;; When cross-compiling, a native version of Guile itself is needed.
106 (self-native-input? #t)
107
9be8d7c8
LC
108 (native-search-paths
109 (list (search-path-specification
110 (variable "GUILE_LOAD_PATH")
af070955 111 (files '("share/guile/site")))))
9be8d7c8 112
f50d2669 113 (synopsis "Scheme implementation intended especially for extensions")
c44899a2 114 (description
a22dc0c4
LC
115 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
116official extension language of the GNU system. It is an implementation of
117the Scheme language which can be easily embedded in other applications to
118provide a convenient means of extending the functionality of the application
119without requiring the source code to be rewritten.")
c44899a2 120 (home-page "http://www.gnu.org/software/guile/")
4a44e743 121 (license lgpl2.0+)))
c44899a2
LC
122
123(define-public guile-2.0
124 (package
125 (name "guile")
b1a01474 126 (version "2.0.11")
c44899a2 127 (source (origin
87f5d366 128 (method url-fetch)
0db342a5 129 (uri (string-append "mirror://gnu/guile/guile-" version
c44899a2
LC
130 ".tar.xz"))
131 (sha256
132 (base32
b515822d
MW
133 "1qh3j7308qvsjgwf7h94yqgckpbgz2k3yqdkzsyhqcafvfka9l5f"))
134 (patches (list (search-patch "guile-arm-fixes.patch")))))
c44899a2
LC
135 (build-system gnu-build-system)
136 (native-inputs `(("pkgconfig" ,pkg-config)))
137 (inputs `(("libffi" ,libffi)
9c782445 138 ("readline" ,readline)
cba95006 139 ("bash" ,bash)))
c44899a2
LC
140
141 (propagated-inputs
142 `( ;; These ones aren't normally needed here, but since `libguile-2.0.la'
143 ;; reads `-lltdl -lunistring', adding them here will add the needed
144 ;; `-L' flags. As for why the `.la' file lacks the `-L' flags, see
145 ;; <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903>.
146 ("libunistring" ,libunistring)
be11b102
LC
147
148 ;; Depend on LIBLTDL, not LIBTOOL. That way, we avoid some the extra
149 ;; dependencies that LIBTOOL has, which is helpful during bootstrap.
150 ("libltdl" ,libltdl)
c44899a2
LC
151
152 ;; The headers and/or `guile-2.0.pc' refer to these packages, so they
153 ;; must be propagated.
bda1bc6c 154 ("bdw-gc" ,libgc)
c44899a2
LC
155 ("gmp" ,gmp)))
156
157 (self-native-input? #t)
158
9bf62d9b
LC
159 (outputs '("out" "debug"))
160
8ffaa93b 161 (arguments
9c782445 162 `(#:phases (alist-cons-before
8ffaa93b
LC
163 'configure 'pre-configure
164 (lambda* (#:key inputs #:allow-other-keys)
58b4e8e8 165 ;; Tell (ice-9 popen) the file name of Bash.
8ffaa93b
LC
166 (let ((bash (assoc-ref inputs "bash")))
167 (substitute* "module/ice-9/popen.scm"
168 (("/bin/sh")
169 (string-append bash "/bin/bash")))))
db619089 170 %standard-phases)))
8ffaa93b 171
9be8d7c8
LC
172 (native-search-paths
173 (list (search-path-specification
174 (variable "GUILE_LOAD_PATH")
af070955 175 (files '("share/guile/site/2.0")))
9be8d7c8
LC
176 (search-path-specification
177 (variable "GUILE_LOAD_COMPILED_PATH")
05f1e956
LC
178 (files '("lib/guile/2.0/ccache"
179 "share/guile/site/2.0")))))
9be8d7c8 180
f50d2669 181 (synopsis "Scheme implementation intended especially for extensions")
c44899a2 182 (description
a22dc0c4
LC
183 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
184official extension language of the GNU system. It is an implementation of
185the Scheme language which can be easily embedded in other applications to
186provide a convenient means of extending the functionality of the application
187without requiring the source code to be rewritten.")
c44899a2 188 (home-page "http://www.gnu.org/software/guile/")
4a44e743 189 (license lgpl3+)))
c44899a2 190
fa29b199
LC
191(define-public guile-2.0/fixed
192 ;; A package of Guile 2.0 that's rarely changed. It is the one used
193 ;; in the `base' module, and thus changing it entails a full rebuild.
bda1bc6c 194 guile-2.0)
fa29b199 195
be3feafe 196(define-public guile-next
f906d30c 197 (package (inherit guile-2.0)
be3feafe 198 (name "guile-next")
d9f0788a 199 (version "2.1.2")
4eae7980
LC
200 (source (origin
201 (method url-fetch)
202 (uri (string-append "ftp://alpha.gnu.org/gnu/guile/guile-"
203 version ".tar.xz"))
204 (sha256
205 (base32
d9f0788a
LC
206 "0p971k3v04jj5klnv145g4172cpcp90arf0wvxxj2aqkg16j9m9c"))
207 (modules '((guix build utils)))
208
209 ;; Remove the pre-built object files. Instead, build everything
210 ;; from source, at the expense of significantly longer build
211 ;; times (almost 3 hours on a 4-core Intel i5).
212 (snippet '(for-each delete-file
213 (find-files "prebuilt" "\\.go$")))))
4eae7980
LC
214 (synopsis "Snapshot of what will become version 2.2 of GNU Guile")))
215
216(define-public guile-for-guile-emacs
217 (package (inherit guile-next)
218 (name "guile-for-guile-emacs")
219 (version "20150510.d8d9a8d")
f906d30c
CAW
220 (source (origin
221 (method git-fetch)
222 (uri (git-reference
4eae7980
LC
223 (url "git://git.hcoop.net/git/bpt/guile.git")
224 (commit "d8d9a8da05ec876acba81a559798eb5eeceb5a17")))
f906d30c
CAW
225 (sha256
226 (base32
4eae7980 227 "00sprsshy16y8pxjy126hr2adqcvvzzz96hjyjwgg8swva1qh6b0"))))
f906d30c
CAW
228 (arguments
229 (substitute-keyword-arguments `(;; Tests aren't passing for now.
230 ;; Obviously we should re-enable this!
231 #:tests? #f
4eae7980 232 ,@(package-arguments guile-next))
f906d30c
CAW
233 ((#:phases phases)
234 `(modify-phases ,phases
235 (add-after 'unpack 'autogen
236 (lambda _
237 (zero? (system* "sh" "autogen.sh"))))
238 (add-before 'autogen 'patch-/bin/sh
239 (lambda _
240 (substitute* "build-aux/git-version-gen"
241 (("#!/bin/sh") (string-append "#!" (which "sh"))))
242 #t))))))
243 (native-inputs
244 `(("autoconf" ,autoconf)
245 ("automake" ,automake)
246 ("libtool" ,libtool)
247 ("flex" ,flex)
248 ("texinfo" ,texinfo)
249 ("gettext" ,gnu-gettext)
4eae7980 250 ,@(package-native-inputs guile-next)))))
be3feafe 251
c44899a2
LC
252\f
253;;;
254;;; Extensions.
255;;;
256
7119cca8
ML
257(define-public artanis
258 (package
259 (name "artanis")
260 (version "0.1.0")
261 (source (origin
262 (method url-fetch)
263 (uri (string-append "ftp://alpha.gnu.org/gnu/artanis/artanis-"
264 version ".tar.gz"))
265 (sha256
266 (base32
267 "1mc2zy6n9wnn4hzi3zp3jd6b5rlr0lv7fvh800xf4fyrxg0zia4g"))))
268 (build-system gnu-build-system)
269 ;; TODO: Add guile-dbi and guile-dbd optional dependencies.
270 (inputs `(("guile" ,guile-2.0)))
271 (native-inputs `(("bash" ,bash) ;for the `source' builtin
272 ("pkgconfig" ,pkg-config)
273 ("util-linux" ,util-linux))) ;for the `script' command
274 (arguments
275 '(#:make-flags
276 ;; TODO: The documentation must be built with the `docs' target.
277 (let* ((out (assoc-ref %outputs "out"))
278 (dir (string-append out "/share/guile/site/2.0")))
279 ;; Don't use (%site-dir) for site paths.
280 (list (string-append "MOD_PATH=" dir)
281 (string-append "MOD_COMPILED_PATH=" dir)))
282 #:test-target "test"
283 #:phases
284 (modify-phases %standard-phases
285 (add-before
286 'install 'substitute-root-dir
287 (lambda* (#:key outputs #:allow-other-keys)
288 (let ((out (assoc-ref outputs "out")))
289 (substitute* "Makefile" ;ignore the execution of bash.bashrc
290 ((" /etc/bash.bashrc") " /dev/null"))
291 (substitute* "Makefile" ;set the root of config files to OUT
292 ((" /etc") (string-append " " out "/etc")))
293 (mkdir-p (string-append out "/bin")) ;for the `art' executable
294 #t))))))
295 (synopsis "Web application framework written in Guile")
296 (description "GNU Artanis is a web application framework written in Guile
297Scheme. A web application framework (WAF) is a software framework that is
298designed to support the development of dynamic websites, web applications, web
299services and web resources. The framework aims to alleviate the overhead
300associated with common activities performed in web development. Artanis
301provides several tools for web development: database access, templating
302frameworks, session management, URL-remapping for RESTful, page caching, and
303more.")
304 (home-page "https://www.gnu.org/software/artanis/")
305 (license (list gpl3+ lgpl3+)))) ;dual license
306
d6d9f1f7 307(define-public guile-reader
1722d680 308 (package
d6d9f1f7 309 (name "guile-reader")
ad29c6f2 310 (version "0.6.1")
d6d9f1f7
LC
311 (source (origin
312 (method url-fetch)
313 (uri (string-append "mirror://savannah/guile-reader/guile-reader-"
314 version ".tar.gz"))
315 (sha256
316 (base32
ad29c6f2 317 "020wz5w8z6g79nbqifg2n496wxwkcjzh8xizpv6mz0hczpl155ma"))))
d6d9f1f7
LC
318 (build-system gnu-build-system)
319 (native-inputs `(("pkgconfig" ,pkg-config)
320 ("gperf" ,gperf)))
321 (inputs `(("guile" ,guile-2.0)))
ad29c6f2 322 (arguments `(#:configure-flags
d6d9f1f7
LC
323 (let ((out (assoc-ref %outputs "out")))
324 (list (string-append "--with-guilemoduledir="
325 out "/share/guile/site/2.0")))))
326 (synopsis "Framework for building readers for GNU Guile")
327 (description
328 "Guile-Reader is a simple framework for building readers for GNU Guile.
1722d680
LC
329
330The idea is to make it easy to build procedures that extend Guile’s read
35b9e423 331procedure. Readers supporting various syntax variants can easily be written,
1722d680 332possibly by re-using existing “token readers” of a standard Scheme
35b9e423 333readers. For example, it is used to implement Skribilo’s R5RS-derived
1722d680
LC
334document syntax.
335
336Guile-Reader’s approach is similar to Common Lisp’s “read table”, but
337hopefully more powerful and flexible (for instance, one may instantiate as
338many readers as needed).")
d6d9f1f7
LC
339 (home-page "http://www.nongnu.org/guile-reader/")
340 (license gpl3+)))
1722d680 341
ef02e1e9
LC
342(define-public guile-ncurses
343 (package
344 (name "guile-ncurses")
31a123fe 345 (version "1.6")
ef02e1e9
LC
346 (source (origin
347 (method url-fetch)
348 (uri (string-append "mirror://gnu/guile-ncurses/guile-ncurses-"
349 version ".tar.gz"))
350 (sha256
351 (base32
31a123fe 352 "0wmk681zzi1wxw543r2s2r84ndnzxp69kr7pc01aw4l55hg7jn73"))))
ef02e1e9
LC
353 (build-system gnu-build-system)
354 (inputs `(("ncurses" ,ncurses)
355 ("guile" ,guile-2.0)))
356 (arguments
2c6b7c7d
LC
357 '(#:configure-flags (list "--with-ncursesw" ; Unicode support
358 (string-append "--with-guilesitedir="
ef02e1e9 359 (assoc-ref %outputs "out")
3f69e393 360 "/share/guile/site/2.0"))
3931607e
LC
361
362 ;; Work around <http://bugs.gnu.org/21677>.
363 #:make-flags '("XFAIL_TESTS=curses_034_util.test")
364
afd3d931
LC
365 #:phases (alist-cons-after
366 'install 'post-install
367 (lambda* (#:key outputs #:allow-other-keys)
368 (let* ((out (assoc-ref outputs "out"))
369 (dir (string-append out "/share/guile/site/"))
370 (files (find-files dir ".scm")))
371 (substitute* files
372 (("\"libguile-ncurses\"")
373 (format #f "\"~a/lib/libguile-ncurses\""
374 out)))))
375 %standard-phases)))
ef02e1e9 376 (home-page "http://www.gnu.org/software/guile-ncurses/")
f50d2669 377 (synopsis "Guile bindings to ncurses")
ef02e1e9 378 (description
12bcf94a 379 "guile-ncurses provides Guile language bindings for the ncurses
79c311b8 380library.")
ef02e1e9
LC
381 (license lgpl3+)))
382
87d836b2
LC
383(define-public mcron
384 (package
385 (name "mcron")
d12c626c 386 (version "1.0.8")
87d836b2
LC
387 (source (origin
388 (method url-fetch)
389 (uri (string-append "mirror://gnu/mcron/mcron-"
390 version ".tar.gz"))
391 (sha256
392 (base32
d12c626c 393 "0zparwgf01jgl1x53ik71ghabldq6zz18ha4dscps1i0qrzgap1b"))
01eafd38 394 (patches (list (search-patch "mcron-install.patch")))))
87d836b2 395 (build-system gnu-build-system)
b6c18d6a
LC
396 (native-inputs `(("pkg-config" ,pkg-config)))
397 (inputs `(("ed" ,ed) ("which" ,which) ("guile" ,guile-2.0)))
87d836b2 398 (home-page "http://www.gnu.org/software/mcron/")
f50d2669 399 (synopsis "Run jobs at scheduled times")
87d836b2 400 (description
79c311b8 401 "GNU Mcron is a complete replacement for Vixie cron. It is used to run
a22dc0c4 402tasks on a schedule, such as every hour or every Monday. Mcron is written in
79c311b8
LC
403Guile, so its configuration can be written in Scheme; the original cron
404format is also supported.")
87d836b2
LC
405 (license gpl3+)))
406
3e9066fc
LC
407(define-public guile-lib
408 (package
409 (name "guile-lib")
410 (version "0.2.2")
411 (source (origin
412 (method url-fetch)
413 (uri (string-append "mirror://savannah/guile-lib/guile-lib-"
414 version ".tar.gz"))
415 (sha256
416 (base32
417 "1f9n2b5b5r75lzjinyk6zp6g20g60msa0jpfrk5hhg4j8cy0ih4b"))))
418 (build-system gnu-build-system)
419 (arguments
420 '(#:phases (alist-cons-before
421 'configure 'patch-module-dir
422 (lambda _
423 (substitute* "src/Makefile.in"
424 (("^moddir[[:blank:]]*=[[:blank:]]*([[:graph:]]+)" _ rhs)
425 (string-append "moddir = " rhs "/2.0\n"))))
426 %standard-phases)))
427 (inputs `(("guile" ,guile-2.0)))
428 (home-page "http://www.nongnu.org/guile-lib/")
429 (synopsis "Collection of useful Guile Scheme modules")
430 (description
35b9e423 431 "Guile-Lib is intended as an accumulation place for pure-scheme Guile
3e9066fc
LC
432modules, allowing for people to cooperate integrating their generic Guile
433modules into a coherent library. Think \"a down-scaled, limited-scope CPAN
434for Guile\".")
435
436 ;; The whole is under GPLv3+, but some modules are under laxer
437 ;; distribution terms such as LGPL and public domain. See `COPYING' for
438 ;; details.
439 (license gpl3+)))
440
6050a1fb
CR
441(define-public guile-json
442 (package
443 (name "guile-json")
cdf2b286 444 (version "0.4.0")
6050a1fb
CR
445 (source (origin
446 (method url-fetch)
447 (uri (string-append "mirror://savannah/guile-json/guile-json-"
448 version ".tar.gz"))
449 (sha256
450 (base32
cdf2b286 451 "0v06272rw4ycwzssjf3fzpk2vhpslvl55hz94q80vc6f74j0d5h6"))
bf6fcf54
LC
452 (modules '((guix build utils)))
453 (snippet
454 ;; Make sure everything goes under .../site/2.0, like Guile's
455 ;; search paths expects.
456 '(substitute* '("Makefile.in" "json/Makefile.in")
457 (("moddir =.*/share/guile/site" all)
458 (string-append all "/2.0"))))))
6050a1fb 459 (build-system gnu-build-system)
db5584dd 460 (native-inputs `(("guile" ,guile-2.0)))
6050a1fb
CR
461 (home-page "http://savannah.nongnu.org/projects/guile-json/")
462 (synopsis "JSON module for Guile")
463 (description
464 "Guile-json supports parsing and building JSON documents according to the
35b9e423 465http:://json.org specification. These are the main features:
6050a1fb
CR
466- Strictly complies to http://json.org specification.
467- Build JSON documents programmatically via macros.
468- Unicode support for strings.
469- Allows JSON pretty printing.")
470 (license lgpl3+)))
471
6bc24063
CAW
472(define-public guile-minikanren
473 (package
474 (name "guile-minikanren")
475 (version "20150424.e844d85")
476 (source (origin
477 (method git-fetch)
478 (uri (git-reference
479 (url "https://github.com/ijp/minikanren.git")
480 (commit "e844d85512f8c055d3f96143ee506007389a25e3")))
821f4dc2 481 (file-name (string-append name "-" version "-checkout"))
6bc24063
CAW
482 (sha256
483 (base32
484 "0r50jlpzi940jlmxyy3ddqqwmj5r12gb4bcv0ssini9v8km13xz6"))))
485 (build-system trivial-build-system)
486 (arguments
487 `(#:modules
488 ((guix build utils)
489 (ice-9 match))
490 #:builder
491 (begin
492 (use-modules (guix build utils)
493 (ice-9 match))
494 (let* ((out (assoc-ref %outputs "out"))
495 (module-dir (string-append out "/share/guile/site/2.0"))
496 (source (assoc-ref %build-inputs "source"))
f3d8cd79 497 (doc (string-append out "/share/doc/guile-minikanren"))
6bc24063
CAW
498 (scm-files '("minikanren.scm"
499 "minikanren/mkextraforms.scm"
500 "minikanren/mkprelude.scm"
501 "minikanren/mk.scm"))
502 (guild (string-append (assoc-ref %build-inputs "guile")
503 "/bin/guild")))
504 ;; Make installation directories.
505 (mkdir-p (string-append module-dir "/minikanren"))
506 (mkdir-p doc)
507
508 ;; Compile .scm files and install.
509 (chdir source)
510 (setenv "GUILE_AUTO_COMPILE" "0")
511 (for-each (lambda (file)
512 (let* ((dest-file (string-append module-dir "/"
513 file ".scm"))
514 (go-file (match (string-split file #\.)
515 ((base _)
516 (string-append module-dir "/"
517 base ".go")))))
518 ;; Install source module.
519 (copy-file file dest-file)
520 ;; Install compiled module.
521 (unless (zero? (system* guild "compile"
522 "-L" source
523 "-o" go-file
524 file))
525 (error (format #f "Failed to compile ~s to ~s!"
526 file go-file)))))
527 scm-files)
528
529 ;; Also copy over the README.
96c46210 530 (install-file "README.org" doc)
6bc24063
CAW
531 #t))))
532 (inputs
533 `(("guile" ,guile-2.0)))
534 (home-page "https://github.com/ijp/minikanren")
e881752c 535 (synopsis "MiniKanren declarative logic system, packaged for Guile")
6bc24063
CAW
536 (description
537 "MiniKanren is a relational programming extension to the Scheme
538programming Language, written as a smaller version of Kanren suitable for
539pedagogical purposes. It is featured in the book, The Reasoned Schemer,
540written by Dan Friedman, William Byrd, and Oleg Kiselyov.
541
e881752c 542This is Ian Price's r6rs packaged version of miniKanren, which deviates
6bc24063
CAW
543slightly from miniKanren mainline.
544
545See http://minikanren.org/ for more on miniKanren generally.")
546 (license expat)))
547
32e14fc1
CAW
548(define-public guile-irregex
549 (package
550 (name "guile-irregex")
551 (version "0.9.3")
552 (source (origin
553 (method url-fetch)
554 (uri (string-append
555 "http://synthcode.com/scheme/irregex/irregex-"
556 version
557 ".tar.gz"))
558 (sha256
559 (base32
560 "1b8jl7bycyl2ssp6sb1j24pp9hvqyxm85ki9bmwd50glyyjs5zay"))))
561 (build-system gnu-build-system)
562 (arguments
563 `(#:modules ((guix build utils)
564 (ice-9 match)
565 (guix build gnu-build-system))
566 #:phases
567 (modify-phases %standard-phases
32e14fc1
CAW
568 (delete 'configure)
569 (delete 'build)
570 (delete 'check)
571 (replace 'install
572 (lambda* (#:key inputs outputs #:allow-other-keys)
573 (begin
574 (use-modules (guix build utils)
575 (ice-9 match))
576 (let* ((out (assoc-ref outputs "out"))
577 (module-dir (string-append out "/share/guile/site/2.0"))
578 (source (assoc-ref inputs "source"))
579 (doc (string-append out "/share/doc/guile-irregex/"))
580 (guild (string-append (assoc-ref %build-inputs "guile")
581 "/bin/guild")))
582 ;; Make installation directories.
583 (mkdir-p (string-append module-dir "/rx/source"))
584 (mkdir-p doc)
585
586 ;; Compile .scm files and install.
587 (setenv "GUILE_AUTO_COMPILE" "0")
588
589 (for-each (lambda (copy-info)
590 (match copy-info
591 ((src-file dest-file-basis)
592 (let* ((dest-file (string-append
593 module-dir dest-file-basis
594 ".scm"))
595 (go-file (string-append
596 module-dir dest-file-basis
597 ".go")))
598 ;; Install source module.
599 (copy-file src-file
600 dest-file)
601 ;; Install compiled module.
602 (unless (zero? (system* guild "compile"
603 "-L" (getcwd)
604 "-o" go-file
605 src-file))
606 (error (format #f "Failed to compile ~s to ~s!"
607 src-file dest-file)))))))
608 '(("irregex-guile.scm" "/rx/irregex")
609 ("irregex.scm" "/rx/source/irregex")
610 ;; Not really reachable via guile's packaging system,
611 ;; but nice to have around
612 ("irregex-utils.scm" "/rx/source/irregex-utils")))
613
614 ;; Also copy over the README.
615 (install-file "irregex.html" doc)
616 #t)))))))
617 (inputs
618 `(("guile" ,guile-2.0)))
619 (home-page "http://synthcode.com/scheme/irregex")
620 (synopsis "S-expression based regular expressions")
621 (description
622 "Irregex is an s-expression based alternative to your classic
623string-based regular expressions. It implements SRFI 115 and is deeply
624inspired by the SCSH regular expression system.")
625 (license bsd-3)))
93e7199b
CAW
626
627;; There are two guile-gdbm packages, one using the FFI and one with
628;; direct C bindings, hence the verbose name.
629
630(define-public guile-gdbm-ffi
631 (package
632 (name "guile-gdbm-ffi")
633 (version "20120209.fa1d5b6")
634 (source (origin
635 (method git-fetch)
636 (uri (git-reference
637 (url "https://github.com/ijp/guile-gdbm.git")
638 (commit "fa1d5b6231d0e4d096687b378c025f2148c5f246")))
821f4dc2 639 (file-name (string-append name "-" version "-checkout"))
93e7199b
CAW
640 (sha256
641 (base32
642 "1j8wrsw7v9w6qkl47xz0rdikg50v16nn6kbs3lgzcymjzpa7babj"))))
643 (build-system trivial-build-system)
644 (arguments
645 `(#:modules
646 ((guix build utils))
647 #:builder
648 (begin
649 (use-modules (guix build utils)
650 (system base compile))
651
652 (let* ((out (assoc-ref %outputs "out"))
653 (module-dir (string-append out "/share/guile/site/2.0"))
654 (source (assoc-ref %build-inputs "source"))
655 (doc (string-append out "/share/doc"))
656 (guild (string-append (assoc-ref %build-inputs "guile")
657 "/bin/guild"))
658 (gdbm.scm-dest
659 (string-append module-dir "/gdbm.scm"))
660 (gdbm.go-dest
661 (string-append module-dir "/gdbm.go")))
662 ;; Make installation directories.
663 (mkdir-p module-dir)
664 (mkdir-p doc)
665
666 ;; Switch directory for compiling and installing
667 (chdir source)
668
669 ;; copy the source
670 (copy-file "gdbm.scm" gdbm.scm-dest)
671
672 ;; Patch the FFI
673 (substitute* gdbm.scm-dest
674 (("\\(dynamic-link \"libgdbm\"\\)")
675 (format #f "(dynamic-link \"~a/lib/libgdbm.so\")"
676 (assoc-ref %build-inputs "gdbm"))))
677
678 ;; compile to the destination
679 (compile-file gdbm.scm-dest
680 #:output-file gdbm.go-dest)))))
681 (inputs
682 `(("guile" ,guile-2.0)))
683 (propagated-inputs
684 `(("gdbm" ,gdbm)))
685 (home-page "https://github.com/ijp/guile-gdbm")
686 (synopsis "Guile bindings to the GDBM library via Guile's FFI")
687 (description
688 "Guile bindings to the GDBM key-value storage system, using
689Guile's foreign function interface.")
690 (license gpl3+)))
691
27f5e13e
DT
692(define-public haunt
693 (package
694 (name "haunt")
695 (version "0.1")
696 (source (origin
697 (method url-fetch)
698 (uri (string-append "http://files.dthompson.us/haunt/haunt-"
699 version ".tar.gz"))
700 (sha256
701 (base32
702 "15q1qwjnay7k90ppqrzqsmikvwyj61mjvf1zahyd9gm4vi2fgb3x"))))
703 (build-system gnu-build-system)
4ecbf6d2
LC
704 (arguments
705 `(#:modules ((ice-9 match) (ice-9 ftw)
706 ,@%gnu-build-system-modules)
707
708 #:phases (modify-phases %standard-phases
709 (add-after 'install 'wrap-haunt
710 (lambda* (#:key outputs #:allow-other-keys)
711 ;; Wrap the 'haunt' command to refer to the right
712 ;; modules.
713 (let* ((out (assoc-ref outputs "out"))
714 (bin (string-append out "/bin"))
715 (site (string-append
716 out "/share/guile/site")))
717 (match (scandir site)
718 (("." ".." version)
719 (let ((modules (string-append site "/" version)))
720 (wrap-program (string-append bin "/haunt")
721 `("GUILE_LOAD_PATH" ":" prefix
722 (,modules))
723 `("GUILE_LOAD_COMPILED_PATH" ":" prefix
724 (,modules)))
725 #t)))))))))
27f5e13e
DT
726 (inputs
727 `(("guile" ,guile-2.0)))
728 (synopsis "Functional static site generator")
729 (description "Haunt is a static site generator written in Guile
730Scheme. Haunt features a functional build system and an extensible
731interface for reading articles in any format.")
732 (home-page "http://haunt.dthompson.us")
733 (license gpl3+)))
734
44a2bdf8
AS
735(define-public guile-config
736 (package
737 (name "guile-config")
3c98acb7 738 (version "0.1.1")
44a2bdf8
AS
739 (source (origin
740 (method url-fetch)
741 (uri (string-append
742 "http://alex.pompo.co/software/" name "-" version
743 ".tar.gz"))
744 (sha256
745 (base32
3c98acb7 746 "1b719bn192f9wg24rr0zx8jpmygsvyhfi35iy778pb5p392snrn8"))))
44a2bdf8
AS
747 (build-system gnu-build-system)
748 (inputs
749 `(("guile" ,guile-2.0)))
750 (synopsis "Guile application configuration parsing library")
751 (description
752 "Guile Config is a library providing a declarative approach to
753application configuration specification. The library provides clean
754configuration declaration forms, and processors that take care of:
755configuration file creation; configuration file parsing; command-line
756parameter parsing using getopt-long; basic GNU command-line parameter
757generation (--help, --usage, --version); automatic output generation for the
758above command-line parameters.")
759 (home-page "https://github.com/a-sassmannshausen/guile-config")
760 (license agpl3+)))
761
36548111
DT
762(define-public guile-redis
763 (package
764 (name "guile-redis")
765 (version "0.1.0")
766 (source (origin
767 (method url-fetch)
768 (uri (string-append "mirror://savannah/guile-redis/guile-redis-"
769 version ".tar.gz"))
770 (sha256
771 (base32
772 "0vx6if6b4r3kwx64vzbs6vpc0cpcr85x11w9vkzq27gw8n7isv56"))
773 (modules '((guix build utils)))
774 (snippet
775 ;; Make sure everything goes under .../site/2.0, like Guile's
776 ;; search paths expects.
777 '(substitute* '("Makefile.in"
778 "redis/Makefile.in"
779 "redis/commands/Makefile.in")
780 (("moddir =.*/share/guile/site" all)
781 (string-append all "/2.0"))))))
782 (build-system gnu-build-system)
783 (native-inputs
784 `(("guile" ,guile-2.0)))
785 (home-page "http://savannah.nongnu.org/projects/guile-redis/")
786 (synopsis "Redis client library for Guile")
787 (description "Guile-redis provides a Scheme interface to the Redis
788key-value cache and store.")
789 (license lgpl3+)))
790
9d373377
CAW
791(define-public guile-wisp
792 (package
793 (name "guile-wisp")
794 (version "0.9.0")
795 (source (origin
796 (method url-fetch)
797 (uri (string-append "https://bitbucket.org/ArneBab/"
798 "wisp/downloads/wisp-"
799 version ".tar.gz"))
800 (sha256
801 (base32
802 "0y5fxacalkgbv9s71h58vdvm2h2ln3rk024dd0vszwcf953as5fq"))))
803 (build-system gnu-build-system)
804 (arguments
805 `(#:modules ((system base compile)
806 ,@%gnu-build-system-modules)
807 #:phases
808 (modify-phases %standard-phases
809 (add-before
810 'configure 'substitute-before-config
811
812 (lambda* (#:key inputs #:allow-other-keys)
813 (let ((bash (assoc-ref inputs "bash")))
814 ;; configure checks for guile-2.0, but ours is just named "guile" :)
815 (substitute* "configure"
816 (("guile-2.0") "guile"))
817 ;; Puts together some test files with /bin/bash hardcoded
818 (substitute* "Makefile.in"
819 (("/bin/bash")
820 (string-append bash "/bin/bash") ))
821 #t)))
822
823 ;; auto compilation breaks, but if we set HOME to /tmp,
824 ;; that works ok
825 (add-before
826 'check 'auto-compile-hacky-workaround
827 (lambda _
828 (setenv "HOME" "/tmp")
829 #t))
830 (replace
831 'install
832 (lambda* (#:key outputs inputs #:allow-other-keys)
833 (let* ((out (assoc-ref outputs "out"))
834 (module-dir (string-append out "/share/guile/site/2.0"))
835 (language-dir
836 (string-append module-dir "/language/wisp"))
837 (guild (string-append (assoc-ref inputs "guile")
838 "/bin/guild")))
839 ;; Make installation directories.
840 (mkdir-p module-dir)
841 (mkdir-p language-dir)
842
843 ;; copy the source
844 (copy-file "wisp-scheme.scm"
845 (string-append module-dir "/wisp-scheme.scm"))
846 (copy-file "language/wisp/spec.scm"
847 (string-append language-dir "/spec.scm"))
848
849 ;; compile to the destination
850 (compile-file "wisp-scheme.scm"
851 #:output-file (string-append
852 module-dir "/wisp-scheme.go"))
853 (compile-file "language/wisp/spec.scm"
854 #:output-file (string-append
855 language-dir "/spec.go"))
856 #t))))))
857 (home-page "http://draketo.de/english/wisp")
858 (inputs
859 `(("guile" ,guile-2.0)
860 ("python" ,python)))
a124bbd2
SB
861 (synopsis "Whitespace to lisp syntax for Guile")
862 (description "Wisp is a syntax for Guile which provides a Python-like
9d373377
CAW
863whitespace-significant language. It may be easier on the eyes for some
864users and in some situations.")
865 (license gpl3+)))
866
5649c8cd
DT
867(define-public guile-sly
868 (package
869 (name "guile-sly")
870 (version "0.1")
871 (source (origin
872 (method url-fetch)
8d5e7ad2 873 (uri (string-append "https://files.dthompson.us/sly/sly-"
5649c8cd
DT
874 version ".tar.gz"))
875 (sha256
876 (base32
877 "1svzlbz2vripmyq2kjh0rig16bsrnbkwbsm558pjln9l65mcl4qq"))))
878 (build-system gnu-build-system)
879 (arguments
880 '(#:configure-flags
881 (list (string-append "--with-libfreeimage-prefix="
882 (assoc-ref %build-inputs "freeimage"))
883 (string-append "--with-libgslcblas-prefix="
884 (assoc-ref %build-inputs "gsl")))))
885 (native-inputs
886 `(("pkg-config" ,pkg-config)))
887 (propagated-inputs
888 `(("guile" ,guile-2.0)
889 ("guile-sdl" ,guile-sdl)
890 ("guile-opengl" ,guile-opengl)))
891 (inputs
892 `(("gsl" ,gsl)
893 ("freeimage" ,freeimage)
894 ("mesa" ,mesa)))
895 (synopsis "2D/3D game engine for GNU Guile")
896 (description "Sly is a 2D/3D game engine written in Guile Scheme. Sly
897features a functional reactive programming interface and live coding
898capabilities.")
899 (home-page "http://dthompson.us/pages/software/sly.html")
900 (license gpl3+)))
901
dec1e2b3
AB
902(define-public g-wrap
903 (package
904 (name "g-wrap")
905 (version "1.9.15")
906 (source (origin
907 (method url-fetch)
908 (uri (string-append "mirror://savannah/g-wrap/g-wrap-"
909 version ".tar.gz"))
910 (sha256
911 (base32
912 "0ak0bha37dfpj9kmyw1r8fj8nva639aw5xr66wr5gd3l1rqf5xhg"))))
913 (build-system gnu-build-system)
914 (native-inputs
915 `(("pkg-config" ,pkg-config)))
916 (propagated-inputs
917 `(("guile" ,guile-2.0)
918 ("guile-lib" ,guile-lib)))
919 (inputs
920 `(("libffi" ,libffi)))
921 (synopsis "Generate C bindings for Guile")
922 (description "G-Wrap is a tool and Guile library for generating function
923wrappers for inter-language calls. It currently only supports generating Guile
924wrappers for C functions. Given a definition of the types and prototypes for
925a given C interface, G-Wrap will automatically generate the C code that
926provides access to that interface and its types from the Scheme level.")
927 (home-page "http://www.nongnu.org/g-wrap/index.html")
928 (license lgpl2.1+)))
929
1722d680 930;;; guile.scm ends here