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