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