gnu: sqlite: Update to 3.19.0.
[jackhill/guix/guix.git] / gnu / packages / guile.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2015, 2017 Christopher Allan Webber <cwebber@dustycloud.org>
5 ;;; Copyright © 2016 Alex Sassmannshausen <alex@pompo.co>
6 ;;; Copyright © 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
7 ;;; Copyright © 2016 Erik Edrosa <erik.edrosa@gmail.com>
8 ;;; Copyright © 2016 Eraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2016 Alex Kost <alezost@gmail.com>
10 ;;; Copyright © 2016 Adonay "adfeno" Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> <adfeno@openmailbox.org>
11 ;;; Copyright © 2016 Amirouche <amirouche@hypermove.net>
12 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
13 ;;; Copyright © 2017 Andy Wingo <wingo@igalia.com>
14 ;;;
15 ;;; This file is part of GNU Guix.
16 ;;;
17 ;;; GNU Guix is free software; you can redistribute it and/or modify it
18 ;;; under the terms of the GNU General Public License as published by
19 ;;; the Free Software Foundation; either version 3 of the License, or (at
20 ;;; your option) any later version.
21 ;;;
22 ;;; GNU Guix is distributed in the hope that it will be useful, but
23 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
24 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 ;;; GNU General Public License for more details.
26 ;;;
27 ;;; You should have received a copy of the GNU General Public License
28 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
29
30 (define-module (gnu packages guile)
31 #:use-module ((guix licenses) #:prefix license:)
32 #:use-module (gnu packages)
33 #:use-module (gnu packages aspell)
34 #:use-module (gnu packages bash)
35 #:use-module (gnu packages bdw-gc)
36 #:use-module (gnu packages gawk)
37 #:use-module (gnu packages gperf)
38 #:use-module (gnu packages libffi)
39 #:use-module (gnu packages autotools)
40 #:use-module (gnu packages flex)
41 #:use-module (gnu packages libunistring)
42 #:use-module (gnu packages linux)
43 #:use-module (gnu packages m4)
44 #:use-module (gnu packages multiprecision)
45 #:use-module (gnu packages pkg-config)
46 #:use-module (gnu packages readline)
47 #:use-module (gnu packages ncurses)
48 #:use-module (gnu packages ed)
49 #:use-module (gnu packages base)
50 #:use-module (gnu packages texinfo)
51 #:use-module (gnu packages man)
52 #:use-module (gnu packages gettext)
53 #:use-module (gnu packages databases)
54 #:use-module (gnu packages python)
55 #:use-module (gnu packages gl)
56 #:use-module (gnu packages sdl)
57 #:use-module (gnu packages maths)
58 #:use-module (gnu packages image)
59 #:use-module (gnu packages version-control)
60 #:use-module (gnu packages xdisorg)
61 #:use-module (gnu packages xorg)
62 #:use-module (gnu packages zip)
63 #:use-module (guix packages)
64 #:use-module (guix download)
65 #:use-module (guix git-download)
66 #:use-module (guix build-system gnu)
67 #:use-module (guix build-system trivial)
68 #:use-module (guix utils)
69 #:use-module (ice-9 match))
70
71 ;;; Commentary:
72 ;;;
73 ;;; GNU Guile, and modules and extensions.
74 ;;;
75 ;;; Code:
76
77 (define-public guile-1.8
78 (package
79 (name "guile")
80 (version "1.8.8")
81 (source (origin
82 (method url-fetch)
83 (uri (string-append "mirror://gnu/guile/guile-" version
84 ".tar.gz"))
85 (sha256
86 (base32
87 "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3"))
88 (patches (search-patches "guile-1.8-cpp-4.5.patch"))))
89 (build-system gnu-build-system)
90 (arguments '(#:configure-flags '("--disable-error-on-warning")
91
92 ;; Insert a phase before `configure' to patch things up.
93 #:phases (alist-cons-before
94 'configure
95 'patch-stuff
96 (lambda* (#:key outputs #:allow-other-keys)
97 ;; Add a call to `lt_dladdsearchdir' so that
98 ;; `libguile-readline.so' & co. are in the
99 ;; loader's search path.
100 (substitute* "libguile/dynl.c"
101 (("lt_dlinit.*$" match)
102 (format #f
103 " ~a~% lt_dladdsearchdir(\"~a/lib\");~%"
104 match
105 (assoc-ref outputs "out"))))
106
107 ;; The usual /bin/sh...
108 (substitute* "ice-9/popen.scm"
109 (("/bin/sh") (which "sh"))))
110 %standard-phases)))
111 (inputs `(("gawk" ,gawk)
112 ("readline" ,readline)))
113
114 ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be
115 ;; propagated.
116 (propagated-inputs `(("gmp" ,gmp)
117 ("libltdl" ,libltdl)))
118
119 ;; When cross-compiling, a native version of Guile itself is needed.
120 (self-native-input? #t)
121
122 (native-search-paths
123 (list (search-path-specification
124 (variable "GUILE_LOAD_PATH")
125 (files '("share/guile/site")))))
126
127 (synopsis "Scheme implementation intended especially for extensions")
128 (description
129 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
130 official extension language of the GNU system. It is an implementation of
131 the Scheme language which can be easily embedded in other applications to
132 provide a convenient means of extending the functionality of the application
133 without requiring the source code to be rewritten.")
134 (home-page "https://www.gnu.org/software/guile/")
135 (license license:lgpl2.0+)))
136
137 (define-public guile-2.0
138 (package
139 (name "guile")
140 (version "2.0.14")
141 (source (origin
142 (method url-fetch)
143 (uri (string-append "mirror://gnu/guile/guile-" version
144 ".tar.xz"))
145 (sha256
146 (base32
147 "10lxc6l5alf3lzbs3ihnbfy6dfcrsyf8667wa57f26vf4mk2ai78"))))
148 (build-system gnu-build-system)
149 (native-inputs `(("pkgconfig" ,pkg-config)))
150 (inputs `(("libffi" ,libffi)
151 ("readline" ,readline)
152 ,@(libiconv-if-needed)
153 ,@(if (target-mingw?) '() `(("bash" ,bash)))))
154 (propagated-inputs
155 `( ;; These ones aren't normally needed here, but since `libguile-2.0.la'
156 ;; reads `-lltdl -lunistring', adding them here will add the needed
157 ;; `-L' flags. As for why the `.la' file lacks the `-L' flags, see
158 ;; <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903>.
159 ("libunistring" ,libunistring)
160
161 ;; Depend on LIBLTDL, not LIBTOOL. That way, we avoid some the extra
162 ;; dependencies that LIBTOOL has, which is helpful during bootstrap.
163 ("libltdl" ,libltdl)
164
165 ;; The headers and/or `guile-2.0.pc' refer to these packages, so they
166 ;; must be propagated.
167 ("bdw-gc" ,libgc)
168 ("gmp" ,gmp)))
169
170 (self-native-input? #t)
171
172 (outputs '("out" "debug"))
173
174 (arguments
175 `(#:configure-flags '("--disable-static") ;saves 3MiB
176 #:phases (alist-cons-before
177 'configure 'pre-configure
178 (lambda* (#:key inputs #:allow-other-keys)
179 ;; Tell (ice-9 popen) the file name of Bash.
180 (let ((bash (assoc-ref inputs "bash")))
181 (substitute* "module/ice-9/popen.scm"
182 ;; If bash is #f allow fallback for user to provide
183 ;; "bash" in PATH. This happens when cross-building to
184 ;; MinGW for which we do not have Bash yet.
185 (("/bin/sh")
186 ,@(if (target-mingw?)
187 '((if bash
188 (string-append bash "/bin/bash")
189 "bash"))
190 '((string-append bash "/bin/bash")))))))
191 %standard-phases)))
192
193 (native-search-paths
194 (list (search-path-specification
195 (variable "GUILE_LOAD_PATH")
196 (files '("share/guile/site/2.0")))
197 (search-path-specification
198 (variable "GUILE_LOAD_COMPILED_PATH")
199 (files '("lib/guile/2.0/site-ccache"
200 "share/guile/site/2.0")))))
201
202 (synopsis "Scheme implementation intended especially for extensions")
203 (description
204 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
205 official extension language of the GNU system. It is an implementation of
206 the Scheme language which can be easily embedded in other applications to
207 provide a convenient means of extending the functionality of the application
208 without requiring the source code to be rewritten.")
209 (home-page "https://www.gnu.org/software/guile/")
210 (license license:lgpl3+)))
211
212 (define-public guile-2.2
213 (package (inherit guile-2.0)
214 (name "guile")
215 (version "2.2.0")
216 (replacement #f)
217 (source (origin
218 (method url-fetch)
219
220 ;; Note: we are limited to one of the compression formats
221 ;; supported by the bootstrap binaries, so no lzip here.
222 (uri (string-append "mirror://gnu/guile/guile-" version
223 ".tar.xz"))
224 (sha256
225 (base32
226 "05dmvhd1y135x7w5qfw4my42cfp6l8bbhjfxvchcc1cbdvzri0f1"))
227 (modules '((guix build utils)))
228
229 ;; Remove the pre-built object files. Instead, build everything
230 ;; from source, at the expense of significantly longer build
231 ;; times (almost 3 hours on a 4-core Intel i5).
232 (snippet '(for-each delete-file
233 (find-files "prebuilt" "\\.go$")))))
234 (properties '((timeout . 72000) ;20 hours
235 (max-silent-time . 10800))) ;3 hours (needed on ARM)
236 (native-search-paths
237 (list (search-path-specification
238 (variable "GUILE_LOAD_PATH")
239 (files '("share/guile/site/2.2")))
240 (search-path-specification
241 (variable "GUILE_LOAD_COMPILED_PATH")
242 (files '("lib/guile/2.2/site-ccache"
243 "share/guile/site/2.2")))))))
244
245 (define-public guile-2.2/fixed
246 ;; A package of Guile 2.2 that's rarely changed. It is the one used
247 ;; in the `base' module, and thus changing it entails a full rebuild.
248 (package
249 (inherit guile-2.2)
250 (properties '((hidden? . #t))) ;people should install 'guile-2.2'
251 (replacement #f)))
252
253 (define-public guile-next
254 (deprecated-package "guile-next" guile-2.2))
255
256 (define (guile-variant-package-name prefix)
257 (lambda (name)
258 "Return NAME with PREFIX instead of \"guile-\", when applicable."
259 (if (string-prefix? "guile-" name)
260 (string-append prefix "-"
261 (string-drop name
262 (string-length "guile-")))
263 name)))
264
265 (define package-for-guile-2.2
266 ;; A procedure that rewrites the dependency tree of the given package to use
267 ;; GUILE-2.2 instead of GUILE-2.0.
268 (package-input-rewriting `((,guile-2.0 . ,guile-2.2))
269 (guile-variant-package-name "guile2.2")))
270
271 (define package-for-guile-2.0
272 ;; Likewise, but the other way around. :-)
273 (package-input-rewriting `((,guile-2.2 . ,guile-2.0))
274 (guile-variant-package-name "guile2.0")))
275
276 (define-public guile-for-guile-emacs
277 (package (inherit guile-2.2)
278 (name "guile-for-guile-emacs")
279 (version "20150510.d8d9a8d")
280 (source (origin
281 (method git-fetch)
282 (uri (git-reference
283 (url "git://git.hcoop.net/git/bpt/guile.git")
284 (commit "d8d9a8da05ec876acba81a559798eb5eeceb5a17")))
285 (sha256
286 (base32
287 "00sprsshy16y8pxjy126hr2adqcvvzzz96hjyjwgg8swva1qh6b0"))))
288 (arguments
289 (substitute-keyword-arguments `(;; Tests aren't passing for now.
290 ;; Obviously we should re-enable this!
291 #:tests? #f
292 ,@(package-arguments guile-2.2))
293 ((#:phases phases)
294 `(modify-phases ,phases
295 (add-after 'unpack 'autogen
296 (lambda _
297 (zero? (system* "sh" "autogen.sh"))))
298 (add-before 'autogen 'patch-/bin/sh
299 (lambda _
300 (substitute* "build-aux/git-version-gen"
301 (("#!/bin/sh") (string-append "#!" (which "sh"))))
302 #t))))))
303 (native-inputs
304 `(("autoconf" ,autoconf)
305 ("automake" ,automake)
306 ("libtool" ,libtool)
307 ("flex" ,flex)
308 ("texinfo" ,texinfo)
309 ("gettext" ,gettext-minimal)
310 ,@(package-native-inputs guile-2.2)))
311 ;; Same as in guile-2.0
312 (native-search-paths
313 (list (search-path-specification
314 (variable "GUILE_LOAD_PATH")
315 (files '("share/guile/site/2.0")))
316 (search-path-specification
317 (variable "GUILE_LOAD_COMPILED_PATH")
318 (files '("lib/guile/2.0/site-ccache"
319 "share/guile/site/2.0")))))))
320
321 ;; There has not been any release yet.
322 (define-public guildhall
323 (let ((commit "2fe2cc539f4b811bbcd69e58738db03eb5a2b778")
324 (revision "1"))
325 (package
326 (name "guildhall")
327 (version (string-append "0-" revision "." (string-take commit 9)))
328 (source (origin
329 (method git-fetch)
330 (uri (git-reference
331 (url "https://github.com/ijp/guildhall.git")
332 (commit commit)))
333 (file-name (string-append name "-" version "-checkout"))
334 (sha256
335 (base32
336 "115bym7bg66h3gs399yb2vkzc2ygriaqsn4zbrg8f054mgy8wzn1"))))
337 (build-system gnu-build-system)
338 (arguments
339 `(#:phases
340 (modify-phases %standard-phases
341 ;; Tests fail without this fix because they try to load the bash
342 ;; executable as a Scheme file. See bug report at
343 ;; https://github.com/ijp/guildhall/issues/22
344 (add-after 'unpack 'fix-bug-22
345 (lambda _
346 (substitute* "Makefile.am"
347 (("TESTS_ENVIRONMENT=.*")
348 "AM_TESTS_ENVIRONMENT=srcdir=$(abs_top_srcdir)/tests/
349 TEST_EXTENSIONS = .scm
350 SCM_LOG_COMPILER= $(top_builddir)/env $(GUILE)
351 AM_SCM_LOG_FLAGS = --no-auto-compile -s")
352 ;; FIXME: one of the database tests fails for unknown
353 ;; reasons. It does not fail when run outside of Guix.
354 (("tests/database.scm") ""))
355 #t))
356 (add-before 'configure 'autogen
357 (lambda _
358 (zero? (system* "sh" "autogen.sh")))))))
359 (inputs
360 `(("guile" ,guile-2.0)))
361 (native-inputs
362 `(("zip" ,zip) ; for tests
363 ("autoconf" ,autoconf)
364 ("automake" ,automake)
365 ("texinfo" ,texinfo)))
366 (synopsis "Package manager for Guile")
367 (description
368 "Guildhall is a package manager written for Guile Scheme. A guild is
369 an association of independent craftspeople. A guildhall is where they meet.
370 This Guildhall aims to make a virtual space for Guile wizards and journeyfolk
371 to share code.
372
373 On a practical level, Guildhall lets you share Scheme modules and programs
374 over the internet, and install code that has been shared by others. Guildhall
375 can handle dependencies, so when a program requires several libraries, and
376 each of those has further dependencies, all of the prerequisites for the
377 program can be installed in one go.")
378 (home-page "https://github.com/ijp/guildhall")
379 (license license:gpl3+))))
380
381 \f
382 ;;;
383 ;;; Extensions.
384 ;;;
385
386 (define-public artanis
387 (package
388 (name "artanis")
389 (version "0.1.2")
390 (source (origin
391 (method url-fetch)
392 (uri (string-append "ftp://alpha.gnu.org/gnu/artanis/artanis-"
393 version ".tar.gz"))
394 (sha256
395 (base32
396 "19m3ak12cqk8js9d2mdg11kh4fjsq8frfpd10qw75h0zpr5cywpp"))
397 (patches (search-patches "artanis-fix-Makefile.in.patch"))))
398 (build-system gnu-build-system)
399 ;; TODO: Add guile-dbi and guile-dbd optional dependencies.
400 (inputs `(("guile" ,guile-2.0)))
401 (native-inputs `(("bash" ,bash) ;for the `source' builtin
402 ("pkgconfig" ,pkg-config)
403 ("util-linux" ,util-linux))) ;for the `script' command
404 (arguments
405 '(#:make-flags
406 ;; TODO: The documentation must be built with the `docs' target.
407 (let* ((out (assoc-ref %outputs "out"))
408 (dir (string-append out "/share/guile/site/2.0")))
409 ;; Don't use (%site-dir) for site paths.
410 (list (string-append "MOD_PATH=" dir)
411 (string-append "MOD_COMPILED_PATH=" dir)))
412 #:test-target "test"
413 #:phases
414 (modify-phases %standard-phases
415 (add-before
416 'install 'substitute-root-dir
417 (lambda* (#:key outputs #:allow-other-keys)
418 (let ((out (assoc-ref outputs "out")))
419 (substitute* "Makefile" ;ignore the execution of bash.bashrc
420 ((" /etc/bash.bashrc") " /dev/null"))
421 (substitute* "Makefile" ;set the root of config files to OUT
422 ((" /etc") (string-append " " out "/etc")))
423 (mkdir-p (string-append out "/bin")) ;for the `art' executable
424 #t))))))
425 (synopsis "Web application framework written in Guile")
426 (description "GNU Artanis is a web application framework written in Guile
427 Scheme. A web application framework (WAF) is a software framework that is
428 designed to support the development of dynamic websites, web applications, web
429 services and web resources. The framework aims to alleviate the overhead
430 associated with common activities performed in web development. Artanis
431 provides several tools for web development: database access, templating
432 frameworks, session management, URL-remapping for RESTful, page caching, and
433 more.")
434 (home-page "https://www.gnu.org/software/artanis/")
435 (license (list license:gpl3+ license:lgpl3+)))) ;dual license
436
437 (define-public guile-reader
438 (package
439 (name "guile-reader")
440 (version "0.6.2")
441 (source (origin
442 (method url-fetch)
443 (uri (string-append "mirror://savannah/guile-reader/guile-reader-"
444 version ".tar.gz"))
445 (sha256
446 (base32
447 "0592s2s8ampqmqwilc4fvcild6rb9gy79di6vxv5kcdmv23abkgx"))))
448 (build-system gnu-build-system)
449 (native-inputs `(("pkgconfig" ,pkg-config)
450 ("gperf" ,gperf-3.0)))
451 (inputs `(("guile" ,guile-2.2)))
452 (synopsis "Framework for building readers for GNU Guile")
453 (description
454 "Guile-Reader is a simple framework for building readers for GNU Guile.
455
456 The idea is to make it easy to build procedures that extend Guile’s read
457 procedure. Readers supporting various syntax variants can easily be written,
458 possibly by re-using existing “token readers” of a standard Scheme
459 readers. For example, it is used to implement Skribilo’s R5RS-derived
460 document syntax.
461
462 Guile-Reader’s approach is similar to Common Lisp’s “read table”, but
463 hopefully more powerful and flexible (for instance, one may instantiate as
464 many readers as needed).")
465 (home-page "http://www.nongnu.org/guile-reader/")
466 (license license:gpl3+)))
467
468 (define-public guile2.0-reader
469 (package-for-guile-2.0 guile-reader))
470 (define-public guile2.2-reader
471 (deprecated-package "guile2.2-reader" guile-reader))
472
473 (define-public guile-ncurses
474 (package
475 (name "guile-ncurses")
476 (version "2.1")
477 (source (origin
478 (method url-fetch)
479 (uri (string-append "mirror://gnu/guile-ncurses/guile-ncurses-"
480 version ".tar.gz"))
481 (sha256
482 (base32
483 "1h7rnq4g7xlxxybcb3vjq6nscm9zhlmfaxb7258c8ax7him4azg6"))))
484 (build-system gnu-build-system)
485 (inputs `(("ncurses" ,ncurses)
486 ("guile" ,guile-2.0)))
487 (native-inputs `(("pkg-config" ,pkg-config)))
488 (arguments
489 '(#:configure-flags (list "--with-ncursesw" ; Unicode support
490 "--with-gnu-filesystem-hierarchy")
491 #:phases
492 (modify-phases %standard-phases
493 (add-before 'build 'fix-libguile-ncurses-file-name
494 (lambda* (#:key outputs #:allow-other-keys)
495 (and (zero? (system* "make" "install"
496 "-C" "src/ncurses"
497 "-j" (number->string
498 (parallel-job-count))))
499 (let* ((out (assoc-ref outputs "out"))
500 (dir "src/ncurses")
501 (files (find-files dir ".scm")))
502 (substitute* files
503 (("\"libguile-ncurses\"")
504 (format #f "\"~a/lib/guile/2.0/libguile-ncurses\""
505 out)))
506 #t)))))))
507 (home-page "https://www.gnu.org/software/guile-ncurses/")
508 (synopsis "Guile bindings to ncurses")
509 (description
510 "guile-ncurses provides Guile language bindings for the ncurses
511 library.")
512 (license license:lgpl3+)))
513
514 (define-public mcron
515 (package
516 (name "mcron")
517 (version "1.0.8")
518 (source (origin
519 (method url-fetch)
520 (uri (string-append "mirror://gnu/mcron/mcron-"
521 version ".tar.gz"))
522 (sha256
523 (base32
524 "0zparwgf01jgl1x53ik71ghabldq6zz18ha4dscps1i0qrzgap1b"))
525 (patches (search-patches "mcron-install.patch"))))
526 (build-system gnu-build-system)
527 (native-inputs `(("pkg-config" ,pkg-config)))
528 (inputs `(("ed" ,ed) ("which" ,which) ("guile" ,guile-2.0)))
529 (home-page "https://www.gnu.org/software/mcron/")
530 (synopsis "Run jobs at scheduled times")
531 (description
532 "GNU Mcron is a complete replacement for Vixie cron. It is used to run
533 tasks on a schedule, such as every hour or every Monday. Mcron is written in
534 Guile, so its configuration can be written in Scheme; the original cron
535 format is also supported.")
536 (license license:gpl3+)))
537
538 (define-public mcron2
539 ;; This is mthl's mcron development branch, not yet merged in mcron.
540 (let ((commit "31baff1a5187d8ddc89324cbe42dbeffc309c962"))
541 (package
542 (inherit mcron)
543 (name "mcron2")
544 (version (string-append (package-version mcron) "-0."
545 (string-take commit 7)))
546 (source (origin
547 (method git-fetch)
548 (uri (git-reference
549 (url "https://notabug.org/mthl/mcron/")
550 (commit commit)))
551 (sha256
552 (base32
553 "1h5wxy997hxi718hpx419c23q09939kbxrjbbq54lv0cgw1bb63z"))
554 (file-name (string-append name "-" version "-checkout"))))
555 (native-inputs
556 `(("autoconf" ,autoconf)
557 ("automake" ,automake)
558 ("pkg-config" ,pkg-config)
559 ("texinfo" ,texinfo)
560 ("help2man" ,help2man)))
561 (arguments
562 `(#:modules ((ice-9 match) (ice-9 ftw)
563 ,@%gnu-build-system-modules)
564
565 #:phases (modify-phases %standard-phases
566 (add-after 'unpack 'bootstrap
567 (lambda _
568 (zero? (system* "autoreconf" "-vfi"))))
569 (add-after 'install 'wrap-mcron
570 (lambda* (#:key outputs #:allow-other-keys)
571 ;; Wrap the 'mcron' command to refer to the right
572 ;; modules.
573 (let* ((out (assoc-ref outputs "out"))
574 (bin (string-append out "/bin"))
575 (site (string-append
576 out "/share/guile/site")))
577 (match (scandir site)
578 (("." ".." version)
579 (let ((modules (string-append site "/" version)))
580 (wrap-program (string-append bin "/mcron")
581 `("GUILE_LOAD_PATH" ":" prefix
582 (,modules))
583 `("GUILE_LOAD_COMPILED_PATH" ":" prefix
584 (,modules)))
585 #t))))))))))))
586
587 (define-public guile-ics
588 (package
589 (name "guile-ics")
590 (version "0.1.1")
591 (source (origin
592 (method git-fetch)
593 (uri (git-reference
594 (url "https://github.com/artyom-poptsov/guile-ics")
595 (commit "v0.1.1")))
596 (file-name (string-append name "-" version "-checkout"))
597 (sha256
598 (base32
599 "1pvg6j48inpbq47hq00yh5hhl2qd2srvrx5yjl7w7ky1jsjadp86"))))
600 (build-system gnu-build-system)
601 (arguments
602 '(#:phases (modify-phases %standard-phases
603 (add-before 'configure 'autoreconf
604 (lambda _
605 ;; Repository comes with a broken symlink
606 (delete-file "README")
607 (symlink "README.org" "README")
608 (zero? (system* "autoreconf" "-fi")))))))
609 (native-inputs
610 `(("autoconf" ,(autoconf-wrapper))
611 ("automake" ,automake)
612 ("texinfo" ,texinfo)
613 ;; Gettext brings 'AC_LIB_LINKFLAGS_FROM_LIBS'.
614 ("gettext" ,gettext-minimal)
615 ("pkg-config" ,pkg-config)))
616 (inputs `(("guile" ,guile-2.0) ("which" ,which)))
617 (propagated-inputs `(("guile-lib" ,guile-lib)))
618 (home-page "https://github.com/artyom-poptsov/guile-ics")
619 (synopsis "Guile parser library for the iCalendar format")
620 (description
621 "Guile-ICS is an iCalendar (RFC5545) format parser library written in
622 pure Scheme. The library can be used to read and write iCalendar data.
623
624 The library is shipped with documentation in Info format and usage examples.")
625 (license license:gpl3+)))
626
627 (define-public guile-lib
628 (package
629 (name "guile-lib")
630 (version "0.2.5")
631 (source (origin
632 (method url-fetch)
633 (uri (string-append "mirror://savannah/guile-lib/guile-lib-"
634 version ".tar.gz"))
635 (sha256
636 (base32
637 "1qbk485djgxqrbfjvk4b7w7y4x9xygf2qb8dqnl7885kajasx8qg"))))
638 (build-system gnu-build-system)
639 (arguments
640 '(#:make-flags
641 '("GUILE_AUTO_COMPILE=0") ;to prevent guild errors
642 #:phases
643 (modify-phases %standard-phases
644 (add-before 'configure 'patch-module-dir
645 (lambda _
646 (substitute* "src/Makefile.in"
647 (("^moddir = ([[:graph:]]+)")
648 "moddir = $(datadir)/guile/site/@GUILE_EFFECTIVE_VERSION@\n")
649 (("^godir = ([[:graph:]]+)")
650 "godir = \
651 $(libdir)/guile/@GUILE_EFFECTIVE_VERSION@/site-ccache\n"))
652 #t)))))
653 (native-inputs `(("pkg-config" ,pkg-config)))
654 (inputs `(("guile" ,guile-2.0)))
655 (home-page "http://www.nongnu.org/guile-lib/")
656 (synopsis "Collection of useful Guile Scheme modules")
657 (description
658 "Guile-Lib is intended as an accumulation place for pure-scheme Guile
659 modules, allowing for people to cooperate integrating their generic Guile
660 modules into a coherent library. Think \"a down-scaled, limited-scope CPAN
661 for Guile\".")
662
663 ;; The whole is under GPLv3+, but some modules are under laxer
664 ;; distribution terms such as LGPL and public domain. See `COPYING' for
665 ;; details.
666 (license license:gpl3+)))
667
668 (define-public guile2.2-lib
669 (package-for-guile-2.2 guile-lib))
670
671 (define-public guile-json
672 (package
673 (name "guile-json")
674 (version "0.6.0")
675 (source (origin
676 (method url-fetch)
677 (uri (string-append "mirror://savannah/guile-json/guile-json-"
678 version ".tar.gz"))
679 (sha256
680 (base32
681 "1qmjg7lbgciw95fkdzvlp9f68vv17kdjky42ywfzd4ffzwww0lgc"))
682 (modules '((guix build utils)))
683 (snippet
684 ;; Make sure everything goes under .../site/X.Y, like Guile's
685 ;; search paths expects.
686 '(begin
687 (substitute* "configure"
688 (("ac_subst_vars='")
689 "ac_subst_vars='GUILE_EFFECTIVE_VERSION\n"))
690 (substitute* '("Makefile.in" "json/Makefile.in")
691 (("moddir =.*/share/guile/site" all)
692 (string-append all "/@GUILE_EFFECTIVE_VERSION@")))))))
693 (build-system gnu-build-system)
694 (native-inputs `(("guile" ,guile-2.0)))
695 (home-page "http://savannah.nongnu.org/projects/guile-json/")
696 (synopsis "JSON module for Guile")
697 (description
698 "Guile-JSON supports parsing and building JSON documents according to the
699 specification. These are the main features:
700
701 @itemize
702 @item Strictly complies to @uref{http://json.org, specification}.
703 @item Build JSON documents programmatically via macros.
704 @item Unicode support for strings.
705 @item Allows JSON pretty printing.
706 @end itemize\n")
707 (license license:lgpl3+)))
708
709 (define-public guile2.2-json
710 (package-for-guile-2.2 guile-json))
711
712 (define-public guile-minikanren
713 (package
714 (name "guile-minikanren")
715 (version "20150424.e844d85")
716 (source (origin
717 (method git-fetch)
718 (uri (git-reference
719 (url "https://github.com/ijp/minikanren.git")
720 (commit "e844d85512f8c055d3f96143ee506007389a25e3")))
721 (file-name (string-append name "-" version "-checkout"))
722 (sha256
723 (base32
724 "0r50jlpzi940jlmxyy3ddqqwmj5r12gb4bcv0ssini9v8km13xz6"))))
725 (build-system trivial-build-system)
726 (arguments
727 `(#:modules ((guix build utils))
728 #:builder
729 (begin
730 (use-modules (guix build utils)
731 (ice-9 match)
732 (ice-9 popen)
733 (ice-9 rdelim))
734
735 (let* ((out (assoc-ref %outputs "out"))
736 (guile (assoc-ref %build-inputs "guile"))
737 (effective (read-line
738 (open-pipe* OPEN_READ
739 (string-append guile "/bin/guile")
740 "-c" "(display (effective-version))")))
741 (module-dir (string-append out "/share/guile/site/"
742 effective))
743 (source (assoc-ref %build-inputs "source"))
744 (doc (string-append out "/share/doc/guile-minikanren"))
745 (scm-files '("minikanren.scm"
746 "minikanren/mkextraforms.scm"
747 "minikanren/mkprelude.scm"
748 "minikanren/mk.scm"))
749 (guild (string-append (assoc-ref %build-inputs "guile")
750 "/bin/guild")))
751 ;; Make installation directories.
752 (mkdir-p (string-append module-dir "/minikanren"))
753 (mkdir-p doc)
754
755 ;; Compile .scm files and install.
756 (chdir source)
757 (setenv "GUILE_AUTO_COMPILE" "0")
758 (for-each (lambda (file)
759 (let* ((dest-file (string-append module-dir "/"
760 file))
761 (go-file (match (string-split file #\.)
762 ((base _)
763 (string-append module-dir "/"
764 base ".go")))))
765 ;; Install source module.
766 (copy-file file dest-file)
767 ;; Install compiled module.
768 (unless (zero? (system* guild "compile"
769 "-L" source
770 "-o" go-file
771 file))
772 (error (format #f "Failed to compile ~s to ~s!"
773 file go-file)))))
774 scm-files)
775
776 ;; Also copy over the README.
777 (install-file "README.org" doc)
778 #t))))
779 (inputs
780 `(("guile" ,guile-2.0)))
781 (home-page "https://github.com/ijp/minikanren")
782 (synopsis "MiniKanren declarative logic system, packaged for Guile")
783 (description
784 "MiniKanren is a relational programming extension to the Scheme
785 programming Language, written as a smaller version of Kanren suitable for
786 pedagogical purposes. It is featured in the book, The Reasoned Schemer,
787 written by Dan Friedman, William Byrd, and Oleg Kiselyov.
788
789 This is Ian Price's r6rs packaged version of miniKanren, which deviates
790 slightly from miniKanren mainline.
791
792 See http://minikanren.org/ for more on miniKanren generally.")
793 (license license:expat)))
794
795 (define-public guile2.2-minikanren
796 (package-for-guile-2.2 guile-minikanren))
797
798 (define-public guile-irregex
799 (package
800 (name "guile-irregex")
801 (version "0.9.6")
802 (source (origin
803 (method url-fetch)
804 (uri (string-append
805 "http://synthcode.com/scheme/irregex/irregex-"
806 version ".tar.gz"))
807 (sha256
808 (base32
809 "1ia3m7dp3lcxa048q0gqbiwwsyvn99baw6xkhb4bhhzn4k7bwyqq"))))
810 (build-system gnu-build-system)
811 (arguments
812 `(#:modules ((guix build utils)
813 (ice-9 match)
814 (ice-9 rdelim)
815 (ice-9 popen)
816 (guix build gnu-build-system))
817 #:phases
818 (modify-phases %standard-phases
819 (delete 'configure)
820 (delete 'build)
821 (delete 'check)
822 (replace 'install
823 (lambda* (#:key inputs outputs #:allow-other-keys)
824 (let* ((out (assoc-ref outputs "out"))
825 (effective (read-line
826 (open-pipe* OPEN_READ
827 "guile" "-c"
828 "(display (effective-version))")))
829 (module-dir (string-append out "/share/guile/site/"
830 effective))
831 (source (assoc-ref inputs "source"))
832 (doc (string-append out "/share/doc/guile-irregex/"))
833 (guild (string-append (assoc-ref %build-inputs "guile")
834 "/bin/guild")))
835 ;; Make installation directories.
836 (mkdir-p (string-append module-dir "/rx/source"))
837 (mkdir-p doc)
838
839 ;; Compile .scm files and install.
840 (setenv "GUILE_AUTO_COMPILE" "0")
841
842 (for-each (lambda (copy-info)
843 (match copy-info
844 ((src-file dest-file-basis)
845 (let* ((dest-file (string-append
846 module-dir dest-file-basis
847 ".scm"))
848 (go-file (string-append
849 module-dir dest-file-basis
850 ".go")))
851 ;; Install source module.
852 (copy-file src-file
853 dest-file)
854 ;; Install compiled module.
855 (unless (zero? (system* guild "compile"
856 "-L" (getcwd)
857 "-o" go-file
858 src-file))
859 (error (format #f "Failed to compile ~s to ~s!"
860 src-file dest-file)))))))
861 '(("irregex-guile.scm" "/rx/irregex")
862 ("irregex.scm" "/rx/source/irregex")
863 ;; Not really reachable via guile's packaging system,
864 ;; but nice to have around
865 ("irregex-utils.scm" "/rx/source/irregex-utils")))
866
867 ;; Also copy over the README.
868 (install-file "irregex.html" doc)
869 #t))))))
870 (inputs
871 `(("guile" ,guile-2.0)))
872 (home-page "http://synthcode.com/scheme/irregex")
873 (synopsis "S-expression based regular expressions")
874 (description
875 "Irregex is an s-expression based alternative to your classic
876 string-based regular expressions. It implements SRFI 115 and is deeply
877 inspired by the SCSH regular expression system.")
878 (license license:bsd-3)))
879
880 (define-public guile2.2-irregex
881 (package-for-guile-2.2 guile-irregex))
882
883 ;; There are two guile-gdbm packages, one using the FFI and one with
884 ;; direct C bindings, hence the verbose name.
885
886 (define-public guile-gdbm-ffi
887 (package
888 (name "guile-gdbm-ffi")
889 (version "20120209.fa1d5b6")
890 (source (origin
891 (method git-fetch)
892 (uri (git-reference
893 (url "https://github.com/ijp/guile-gdbm.git")
894 (commit "fa1d5b6231d0e4d096687b378c025f2148c5f246")))
895 (file-name (string-append name "-" version "-checkout"))
896 (sha256
897 (base32
898 "1j8wrsw7v9w6qkl47xz0rdikg50v16nn6kbs3lgzcymjzpa7babj"))))
899 (build-system trivial-build-system)
900 (arguments
901 `(#:modules
902 ((guix build utils))
903 #:builder
904 (begin
905 (use-modules (guix build utils)
906 (ice-9 rdelim)
907 (ice-9 popen))
908
909 ;; Avoid warnings we can safely ignore
910 (setenv "GUILE_AUTO_COMPILE" "0")
911
912 (let* ((out (assoc-ref %outputs "out"))
913 (effective-version
914 (read-line
915 (open-pipe* OPEN_READ
916 (string-append
917 (assoc-ref %build-inputs "guile")
918 "/bin/guile")
919 "-c" "(display (effective-version))")))
920 (module-dir (string-append out "/share/guile/site/"
921 effective-version))
922 (source (assoc-ref %build-inputs "source"))
923 (doc (string-append out "/share/doc"))
924 (guild (string-append (assoc-ref %build-inputs "guile")
925 "/bin/guild"))
926 (gdbm.scm-dest
927 (string-append module-dir "/gdbm.scm"))
928 (gdbm.go-dest
929 (string-append module-dir "/gdbm.go"))
930 (compile-file
931 (lambda (in-file out-file)
932 (system* guild "compile" "-o" out-file in-file))))
933 ;; Make installation directories.
934 (mkdir-p module-dir)
935 (mkdir-p doc)
936
937 ;; Switch directory for compiling and installing
938 (chdir source)
939
940 ;; copy the source
941 (copy-file "gdbm.scm" gdbm.scm-dest)
942
943 ;; Patch the FFI
944 (substitute* gdbm.scm-dest
945 (("\\(dynamic-link \"libgdbm\"\\)")
946 (format #f "(dynamic-link \"~a/lib/libgdbm.so\")"
947 (assoc-ref %build-inputs "gdbm"))))
948
949 ;; compile to the destination
950 (compile-file gdbm.scm-dest gdbm.go-dest)))))
951 (inputs
952 `(("guile" ,guile-2.0)))
953 (propagated-inputs
954 `(("gdbm" ,gdbm)))
955 (home-page "https://github.com/ijp/guile-gdbm")
956 (synopsis "Guile bindings to the GDBM library via Guile's FFI")
957 (description
958 "Guile bindings to the GDBM key-value storage system, using
959 Guile's foreign function interface.")
960 (license license:gpl3+)))
961
962 (define-public guile2.2-gdbm-ffi
963 (package-for-guile-2.2 guile-gdbm-ffi))
964
965 (define-public guile-sqlite3
966 (let ((commit "607721fe1174a299e45d457acacf94eefb964071"))
967 (package
968 (name "guile-sqlite3")
969 (version (string-append "0.0-0." (string-take commit 7)))
970
971 ;; XXX: This used to be available read-only at
972 ;; <https://www.gitorious.org/guile-sqlite3/guile-sqlite3.git/> but it
973 ;; eventually disappeared, so we have our own copy here.
974 (home-page "https://notabug.org/civodul/guile-sqlite3.git")
975 (source (origin
976 (method git-fetch)
977 (uri (git-reference
978 (url home-page)
979 (commit commit)))
980 (sha256
981 (base32
982 "09gaffhh5rawz5kdmqx2ahvj1ngvxddp469r18bmjz3sz8p0slj2"))
983 (file-name (string-append name "-" version "-checkout"))
984 (modules '((guix build utils)))
985 (snippet
986 ;; Upgrade 'Makefile.am' to the current way of doing things.
987 '(substitute* "Makefile.am"
988 (("TESTS_ENVIRONMENT")
989 "TEST_LOG_COMPILER")))))
990
991 (build-system gnu-build-system)
992 (native-inputs
993 `(("autoconf" ,autoconf)
994 ("automake" ,automake)
995 ("pkg-config" ,pkg-config)))
996 (inputs
997 `(("guile" ,guile-2.0)
998 ("sqlite" ,sqlite)))
999 (arguments
1000 '(#:phases (modify-phases %standard-phases
1001 (add-before 'configure 'autoreconf
1002 (lambda _
1003 (zero? (system* "autoreconf" "-vfi"))))
1004 (add-before 'build 'set-sqlite3-file-name
1005 (lambda* (#:key inputs #:allow-other-keys)
1006 (substitute* "sqlite3.scm"
1007 (("\"libsqlite3\"")
1008 (string-append "\"" (assoc-ref inputs "sqlite")
1009 "/lib/libsqlite3\"")))
1010 #t)))))
1011 (synopsis "Access SQLite databases from Guile")
1012 (description
1013 "This package provides Guile bindings to the SQLite database system.")
1014 (license license:gpl3+))))
1015
1016 (define-public haunt
1017 (package
1018 (name "haunt")
1019 (version "0.2.1")
1020 (source (origin
1021 (method url-fetch)
1022 (uri (string-append "https://files.dthompson.us/haunt/haunt-"
1023 version ".tar.gz"))
1024 (sha256
1025 (base32
1026 "1fpaf1vm6s7j13fs35barjh5yajcc2rc3pi8r7278wpgp4i2vs3w"))))
1027 (build-system gnu-build-system)
1028 (arguments
1029 `(#:modules ((ice-9 match) (ice-9 ftw)
1030 ,@%gnu-build-system-modules)
1031 #:tests? #f ; test suite is non-deterministic :(
1032 #:phases (modify-phases %standard-phases
1033 (add-after 'install 'wrap-haunt
1034 (lambda* (#:key outputs #:allow-other-keys)
1035 ;; Wrap the 'haunt' command to refer to the right
1036 ;; modules.
1037 (let* ((out (assoc-ref outputs "out"))
1038 (bin (string-append out "/bin"))
1039 (site (string-append
1040 out "/share/guile/site")))
1041 (match (scandir site)
1042 (("." ".." version)
1043 (let ((modules (string-append site "/" version)))
1044 (wrap-program (string-append bin "/haunt")
1045 `("GUILE_LOAD_PATH" ":" prefix
1046 (,modules))
1047 `("GUILE_LOAD_COMPILED_PATH" ":" prefix
1048 (,modules)))
1049 #t)))))))))
1050 (native-inputs
1051 `(("pkg-config" ,pkg-config)
1052 ("texinfo" ,texinfo)))
1053 (inputs
1054 `(("guile" ,guile-2.2)))
1055 (propagated-inputs
1056 `(("guile-reader" ,guile-reader)
1057 ("guile-commonmark" ,guile-commonmark)))
1058 (synopsis "Functional static site generator")
1059 (description "Haunt is a static site generator written in Guile
1060 Scheme. Haunt features a functional build system and an extensible
1061 interface for reading articles in any format.")
1062 (home-page "http://haunt.dthompson.us")
1063 (license license:gpl3+)))
1064
1065 (define-public guile2.0-haunt
1066 (package-for-guile-2.0
1067 (package (inherit haunt) (name "guile2.0-haunt"))))
1068 (define-public guile2.2-haunt
1069 (deprecated-package "guile2.2-haunt" haunt))
1070
1071 (define-public guile-config
1072 (package
1073 (name "guile-config")
1074 (version "0.1.1")
1075 (source (origin
1076 (method url-fetch)
1077 (uri (string-append
1078 "http://alex.pompo.co/software/" name "-" version
1079 ".tar.gz"))
1080 (sha256
1081 (base32
1082 "1b719bn192f9wg24rr0zx8jpmygsvyhfi35iy778pb5p392snrn8"))))
1083 (build-system gnu-build-system)
1084 (inputs
1085 `(("guile" ,guile-2.0)))
1086 (synopsis "Guile application configuration parsing library")
1087 (description
1088 "Guile Config is a library providing a declarative approach to
1089 application configuration specification. The library provides clean
1090 configuration declaration forms, and processors that take care of:
1091 configuration file creation; configuration file parsing; command-line
1092 parameter parsing using getopt-long; basic GNU command-line parameter
1093 generation (--help, --usage, --version); automatic output generation for the
1094 above command-line parameters.")
1095 (home-page "https://github.com/a-sassmannshausen/guile-config")
1096 (license license:agpl3+)))
1097
1098 (define-public guile-redis
1099 (package
1100 (name "guile-redis")
1101 (version "0.1.0")
1102 (source (origin
1103 (method url-fetch)
1104 (uri (string-append "mirror://savannah/guile-redis/guile-redis-"
1105 version ".tar.gz"))
1106 (sha256
1107 (base32
1108 "0vx6if6b4r3kwx64vzbs6vpc0cpcr85x11w9vkzq27gw8n7isv56"))
1109 (modules '((guix build utils)))
1110 (snippet
1111 ;; Make sure everything goes under .../site/X.Y, like Guile's
1112 ;; search paths expects.
1113 '(begin
1114 (substitute* "configure"
1115 (("ac_subst_vars='")
1116 "ac_subst_vars='GUILE_EFFECTIVE_VERSION\n"))
1117 (substitute* '("Makefile.in"
1118 "redis/Makefile.in"
1119 "redis/commands/Makefile.in")
1120 (("moddir =.*/share/guile/site" all)
1121 (string-append all "/@GUILE_EFFECTIVE_VERSION@")))))))
1122 (build-system gnu-build-system)
1123 (native-inputs
1124 `(("guile" ,guile-2.0)))
1125 (home-page "http://savannah.nongnu.org/projects/guile-redis/")
1126 (synopsis "Redis client library for Guile")
1127 (description "Guile-redis provides a Scheme interface to the Redis
1128 key-value cache and store.")
1129 (license license:lgpl3+)))
1130
1131 (define-public guile2.2-redis
1132 (package-for-guile-2.2 guile-redis))
1133
1134 (define-public guile-wisp
1135 (package
1136 (name "guile-wisp")
1137 (version "0.9.0")
1138 (source (origin
1139 (method url-fetch)
1140 (uri (string-append "https://bitbucket.org/ArneBab/"
1141 "wisp/downloads/wisp-"
1142 version ".tar.gz"))
1143 (sha256
1144 (base32
1145 "0y5fxacalkgbv9s71h58vdvm2h2ln3rk024dd0vszwcf953as5fq"))))
1146 (build-system gnu-build-system)
1147 (arguments
1148 `(#:modules ((system base compile)
1149 ,@%gnu-build-system-modules)
1150 #:phases
1151 (modify-phases %standard-phases
1152 (add-before
1153 'configure 'substitute-before-config
1154
1155 (lambda* (#:key inputs #:allow-other-keys)
1156 (let ((bash (assoc-ref inputs "bash")))
1157 ;; configure checks for guile-2.0, but ours is just named "guile" :)
1158 (substitute* "configure"
1159 (("guile-2.0") "guile"))
1160 ;; Puts together some test files with /bin/bash hardcoded
1161 (substitute* "Makefile.in"
1162 (("/bin/bash")
1163 (string-append bash "/bin/bash") ))
1164 #t)))
1165
1166 ;; auto compilation breaks, but if we set HOME to /tmp,
1167 ;; that works ok
1168 (add-before
1169 'check 'auto-compile-hacky-workaround
1170 (lambda _
1171 (setenv "HOME" "/tmp")
1172 #t))
1173 (replace
1174 'install
1175 (lambda* (#:key outputs inputs #:allow-other-keys)
1176 (let* ((out (assoc-ref outputs "out"))
1177 (module-dir (string-append out "/share/guile/site/2.0"))
1178 (language-dir
1179 (string-append module-dir "/language/wisp"))
1180 (guild (string-append (assoc-ref inputs "guile")
1181 "/bin/guild")))
1182 ;; Make installation directories.
1183 (mkdir-p module-dir)
1184 (mkdir-p language-dir)
1185
1186 ;; copy the source
1187 (copy-file "wisp-scheme.scm"
1188 (string-append module-dir "/wisp-scheme.scm"))
1189 (copy-file "language/wisp/spec.scm"
1190 (string-append language-dir "/spec.scm"))
1191
1192 ;; compile to the destination
1193 (compile-file "wisp-scheme.scm"
1194 #:output-file (string-append
1195 module-dir "/wisp-scheme.go"))
1196 (compile-file "language/wisp/spec.scm"
1197 #:output-file (string-append
1198 language-dir "/spec.go"))
1199 #t))))))
1200 (home-page "http://draketo.de/english/wisp")
1201 (inputs
1202 `(("guile" ,guile-2.0)
1203 ("python" ,python)))
1204 (synopsis "Whitespace to lisp syntax for Guile")
1205 (description "Wisp is a syntax for Guile which provides a Python-like
1206 whitespace-significant language. It may be easier on the eyes for some
1207 users and in some situations.")
1208 (license license:gpl3+)))
1209
1210 (define-public guile-sly
1211 (package
1212 (name "guile-sly")
1213 (version "0.1")
1214 (source (origin
1215 (method url-fetch)
1216 (uri (string-append "https://files.dthompson.us/sly/sly-"
1217 version ".tar.gz"))
1218 (sha256
1219 (base32
1220 "1svzlbz2vripmyq2kjh0rig16bsrnbkwbsm558pjln9l65mcl4qq"))))
1221 (build-system gnu-build-system)
1222 (arguments
1223 '(#:configure-flags
1224 (list (string-append "--with-libfreeimage-prefix="
1225 (assoc-ref %build-inputs "freeimage"))
1226 (string-append "--with-libgslcblas-prefix="
1227 (assoc-ref %build-inputs "gsl")))))
1228 (native-inputs
1229 `(("pkg-config" ,pkg-config)))
1230 (propagated-inputs
1231 `(("guile" ,guile-2.0)
1232 ("guile-sdl" ,guile-sdl)
1233 ("guile-opengl" ,guile-opengl)))
1234 (inputs
1235 `(("gsl" ,gsl)
1236 ("freeimage" ,freeimage)
1237 ("mesa" ,mesa)))
1238 (synopsis "2D/3D game engine for GNU Guile")
1239 (description "Sly is a 2D/3D game engine written in Guile Scheme. Sly
1240 features a functional reactive programming interface and live coding
1241 capabilities.")
1242 (home-page "http://dthompson.us/pages/software/sly.html")
1243 (license license:gpl3+)))
1244
1245 (define-public g-wrap
1246 (package
1247 (name "g-wrap")
1248 (version "1.9.15")
1249 (source (origin
1250 (method url-fetch)
1251 (uri (string-append "mirror://savannah/g-wrap/g-wrap-"
1252 version ".tar.gz"))
1253 (sha256
1254 (base32
1255 "0ak0bha37dfpj9kmyw1r8fj8nva639aw5xr66wr5gd3l1rqf5xhg"))))
1256 (build-system gnu-build-system)
1257 (native-inputs
1258 `(("pkg-config" ,pkg-config)))
1259 (propagated-inputs
1260 `(("guile" ,guile-2.0)
1261 ("guile-lib" ,guile-lib)))
1262 (inputs
1263 `(("libffi" ,libffi)))
1264 (arguments
1265 `(#:phases
1266 (modify-phases %standard-phases
1267 (add-before 'configure 'pre-configure
1268 (lambda* (#:key outputs #:allow-other-keys)
1269 (let ((out (assoc-ref outputs "out")))
1270 (substitute* (find-files "." "^Makefile.in$")
1271 (("guilemoduledir =.*guile/site" all)
1272 (string-append all "/2.0")))
1273 #t))))))
1274 (synopsis "Generate C bindings for Guile")
1275 (description "G-Wrap is a tool and Guile library for generating function
1276 wrappers for inter-language calls. It currently only supports generating Guile
1277 wrappers for C functions. Given a definition of the types and prototypes for
1278 a given C interface, G-Wrap will automatically generate the C code that
1279 provides access to that interface and its types from the Scheme level.")
1280 (home-page "http://www.nongnu.org/g-wrap/index.html")
1281 (license license:lgpl2.1+)))
1282
1283 (define-public guile-dbi
1284 (package
1285 (name "guile-dbi")
1286 (version "2.1.6")
1287 (source (origin
1288 (method url-fetch)
1289 (uri (string-append
1290 "http://download.gna.org/guile-dbi/guile-dbi-"
1291 version ".tar.gz"))
1292 (sha256
1293 (base32
1294 "116njrprhgrsv1qm904sp3b02rq01fx639r433d657gyhw3x159n"))))
1295 (build-system gnu-build-system)
1296 (arguments
1297 '(#:configure-flags
1298 (list (string-append
1299 "--with-guile-site-dir=" %output "/share/guile/site/2.0"))
1300 #:phases
1301 (modify-phases %standard-phases
1302 (add-after 'install 'patch-extension-path
1303 (lambda* (#:key outputs #:allow-other-keys)
1304 (let* ((out (assoc-ref outputs "out"))
1305 (dbi.scm (string-append
1306 out "/share/guile/site/2.0/dbi/dbi.scm"))
1307 (ext (string-append out "/lib/libguile-dbi")))
1308 (substitute* dbi.scm (("libguile-dbi") ext))
1309 #t))))))
1310 (propagated-inputs
1311 `(("guile" ,guile-2.0)))
1312 (synopsis "Guile database abstraction layer")
1313 (home-page "http://home.gna.org/guile-dbi/guile-dbi.html")
1314 (description
1315 "guile-dbi is a library for Guile that provides a convenient interface to
1316 SQL databases. Database programming with guile-dbi is generic in that the same
1317 programming interface is presented regardless of which database system is used.
1318 It currently supports MySQL, Postgres and SQLite3.")
1319 (license license:gpl2+)))
1320
1321 (define-public guile-dbd-sqlite3
1322 (package
1323 (name "guile-dbd-sqlite3")
1324 (version "2.1.6")
1325 (source (origin
1326 (method url-fetch)
1327 (uri (string-append
1328 "http://download.gna.org/guile-dbi/guile-dbd-sqlite3-"
1329 version ".tar.gz"))
1330 (sha256
1331 (base32
1332 "0rg71jchxd2y8x496s8zmfmikr5g8zxi8zv2ar3f7a23pph92iw2"))))
1333 (build-system gnu-build-system)
1334 (native-inputs
1335 `(("pkg-config" ,pkg-config)))
1336 (inputs
1337 `(("sqlite" ,sqlite)
1338 ("zlib" ,(@ (gnu packages compression) zlib))))
1339 (propagated-inputs
1340 `(("guile-dbi" ,guile-dbi)))
1341 (synopsis "Guile DBI driver for SQLite")
1342 (home-page "https://github.com/jkalbhenn/guile-dbd-sqlite3")
1343 (description
1344 "guile-dbi is a library for Guile that provides a convenient interface to
1345 SQL databases. This package implements the interface for SQLite.")
1346 (license license:gpl2+)))
1347
1348 (define-public guile-xosd
1349 (package
1350 (name "guile-xosd")
1351 (version "0.2.1")
1352 (source (origin
1353 (method url-fetch)
1354 (uri (string-append "https://github.com/alezost/" name
1355 "/releases/download/v" version
1356 "/" name "-" version ".tar.gz"))
1357 (sha256
1358 (base32
1359 "1ri5065c16kmgrf2pysn2ymxjqi5302lhpb07wkl1jr75ym8fn8p"))))
1360 (build-system gnu-build-system)
1361 (native-inputs
1362 `(("pkg-config" ,pkg-config)))
1363 (inputs
1364 `(("guile" ,guile-2.0)
1365 ("libx11" ,libx11)
1366 ("libxext" ,libxext)
1367 ("libxinerama" ,libxinerama)
1368 ("xosd" ,xosd)))
1369 (home-page "https://github.com/alezost/guile-xosd")
1370 (synopsis "XOSD bindings for Guile")
1371 (description
1372 "Guile-XOSD provides Guile bindings for @code{libxosd},
1373 @uref{http://sourceforge.net/projects/libxosd/, the X On Screen Display
1374 library}.")
1375 (license license:gpl3+)))
1376
1377 (define-public guile-daemon
1378 (package
1379 (name "guile-daemon")
1380 (version "0.1.1")
1381 (source (origin
1382 (method url-fetch)
1383 (uri (string-append "https://github.com/alezost/" name
1384 "/releases/download/v" version
1385 "/" name "-" version ".tar.gz"))
1386 (sha256
1387 (base32
1388 "0wsq9l6a4sijq4i1r3kcddfaznsak2jc5k59gzkhs5il5d2kn5yi"))))
1389 (build-system gnu-build-system)
1390 (native-inputs
1391 `(("pkg-config" ,pkg-config)))
1392 (inputs
1393 `(("guile" ,guile-2.0)))
1394 (home-page "https://github.com/alezost/guile-daemon")
1395 (synopsis "Evaluate code in a running Guile process")
1396 (description
1397 "Guile-Daemon is a small Guile program that loads your initial
1398 configuration file, and then reads and evaluates Guile expressions that
1399 you send to a FIFO file.")
1400 (license license:gpl3+)))
1401
1402 (define-public guile-commonmark
1403 (package
1404 (name "guile-commonmark")
1405 (version "0.1")
1406 (source (origin
1407 (method url-fetch)
1408 (uri (string-append "https://github.com/OrangeShark/" name
1409 "/releases/download/v" version
1410 "/" name "-" version ".tar.gz"))
1411 (sha256
1412 (base32
1413 "12cb5fqvvgc87f5xp0ih5az305wnjia89l5jba83d0r2p8bfy0b0"))
1414 (modules '((guix build utils)))
1415 (snippet
1416 ;; Use the real effective version of Guile in directory names
1417 ;; instead of a hard-coded "/2.0".
1418 '(begin
1419 (substitute* "configure"
1420 (("ac_subst_vars='")
1421 "ac_subst_vars='GUILE_EFFECTIVE_VERSION\n"))
1422 (substitute* "Makefile.in"
1423 (("/site/2.0")
1424 "/site/@GUILE_EFFECTIVE_VERSION@"))))))
1425 (build-system gnu-build-system)
1426 (inputs
1427 `(("guile" ,guile-2.2)))
1428 (synopsis "CommonMark parser for Guile")
1429 (description
1430 "guile-commonmark is a library for parsing CommonMark, a fully specified
1431 variant of Markdown. The library is written in Guile Scheme and is designed
1432 to transform a CommonMark document to SXML. guile-commonmark tries to closely
1433 follow the @uref{http://commonmark.org/, CommonMark spec}, the main difference
1434 is no support for parsing block and inline level HTML.")
1435 (home-page "https://github.com/OrangeShark/guile-commonmark")
1436 (license license:lgpl3+)))
1437
1438 (define-public guile2.0-commonmark
1439 (package-for-guile-2.0 guile-commonmark))
1440 (define-public guile2.2-commonmark
1441 (deprecated-package "guile2.2-commonmark" guile-commonmark))
1442
1443 (define-public guile-bytestructures
1444 (package
1445 (name "guile-bytestructures")
1446 (version "20160726.53127f6")
1447 (source (origin
1448 (method git-fetch)
1449 (uri (git-reference
1450 (url "https://github.com/TaylanUB/scheme-bytestructures")
1451 (commit "53127f608caf64b34fa41c389b2743b546fbe9da")))
1452 (file-name (string-append name "-" version "-checkout"))
1453 (sha256
1454 (base32
1455 "0l4nx1vp9fkrgrgwjiycj7nx6wfjfd39rqamv4pmq7issi8mrywq"))))
1456 (build-system trivial-build-system)
1457 (arguments
1458 `(#:modules ((guix build utils))
1459 #:builder
1460 (begin
1461 (use-modules (guix build utils)
1462 (ice-9 match)
1463 (ice-9 popen)
1464 (ice-9 rdelim))
1465 (let* ((out (assoc-ref %outputs "out"))
1466 (guile (assoc-ref %build-inputs "guile"))
1467 (effective (read-line
1468 (open-pipe* OPEN_READ
1469 (string-append guile "/bin/guile")
1470 "-c" "(display (effective-version))")))
1471 (module-dir (string-append out "/share/guile/site/"
1472 effective))
1473 (source (assoc-ref %build-inputs "source"))
1474 (doc (string-append out "/share/doc/scheme-bytestructures"))
1475 (scm-files (filter (lambda (path)
1476 (not (string-prefix? "bytestructures/r7" path)))
1477 (with-directory-excursion source
1478 (find-files "bytestructures" "\\.scm$"))))
1479 (guild (string-append (assoc-ref %build-inputs "guile")
1480 "/bin/guild")))
1481 ;; Make installation directories.
1482 (mkdir-p doc)
1483
1484 ;; Compile .scm files and install.
1485 (chdir source)
1486 (setenv "GUILE_AUTO_COMPILE" "0")
1487 (for-each (lambda (file)
1488 (let* ((dest-file (string-append module-dir "/"
1489 file))
1490 (go-file (string-append module-dir "/"
1491 (substring file 0
1492 (string-rindex file #\.))
1493 ".go")))
1494 ;; Install source module.
1495 (mkdir-p (dirname dest-file))
1496 (copy-file file dest-file)
1497
1498 ;; Install compiled module.
1499 (mkdir-p (dirname go-file))
1500 (unless (zero? (system* guild "compile"
1501 "-L" source
1502 "-o" go-file
1503 file))
1504 (error (format #f "Failed to compile ~s to ~s!"
1505 file go-file)))))
1506 scm-files)
1507
1508 ;; Also copy over the README.
1509 (install-file "README.md" doc)
1510 #t))))
1511 (inputs
1512 `(("guile" ,guile-2.2)))
1513 (home-page "https://github.com/TaylanUB/scheme-bytestructures")
1514 (synopsis "Structured access to bytevector contents for Guile")
1515 (description
1516 "Guile bytestructures offers a system imitating the type system
1517 of the C programming language, to be used on bytevectors. C's type
1518 system works on raw memory, and Guile works on bytevectors which are
1519 an abstraction over raw memory. It's also more powerful than the C
1520 type system, elevating types to first-class status.")
1521 (license license:gpl3+)))
1522
1523 (define-public guile-aspell
1524 (package
1525 (name "guile-aspell")
1526 (version "0.3")
1527 (source (origin
1528 (method url-fetch)
1529 (uri (string-append
1530 "http://lonelycactus.com/tarball/guile_aspell-"
1531 version ".tar.gz"))
1532 (sha256
1533 (base32
1534 "1wknn57x2qcsbn7zw6sbn1ma6fjsg8cvpnf78ak47s8jw6k6j75n"))))
1535 (build-system gnu-build-system)
1536 (arguments
1537 '(#:configure-flags (list (string-append "--with-guilesitedir="
1538 (assoc-ref %outputs "out")
1539 "/share/guile/site/2.0"))
1540 #:phases (modify-phases %standard-phases
1541 (add-before 'build 'set-libaspell-file-name
1542 (lambda* (#:key inputs #:allow-other-keys)
1543 (let ((aspell (assoc-ref inputs "aspell")))
1544 (substitute* "aspell/aspell.scm"
1545 (("\"libaspell\\.so\"")
1546 (string-append "\"" aspell
1547 "/lib/libaspell\"")))
1548 #t))))))
1549 (native-inputs `(("pkg-config" ,pkg-config)))
1550 (inputs `(("guile" ,guile-2.0)
1551 ("aspell" ,aspell)))
1552 (home-page "https://github.com/spk121/guile-aspell")
1553 (synopsis "Spell-checking from Guile")
1554 (description
1555 "guile-aspell is a Guile Scheme library for comparing a string against a
1556 dictionary and suggesting spelling corrections.")
1557 (license license:gpl3+)))
1558
1559 (define-public guile-bash
1560 ;; This project is currently retired. It was initially announced here:
1561 ;; <https://lists.gnu.org/archive/html/guile-user/2015-02/msg00003.html>.
1562 (let ((commit "1eabc563ca5692b3e08d84f1f0e6fd2283284469")
1563 (revision "0"))
1564 (package
1565 (name "guile-bash")
1566 (version (string-append "0.1.6-" revision "." (string-take commit 7)))
1567 (home-page
1568 "https://anonscm.debian.org/cgit/users/kaction-guest/retired/dev.guile-bash.git")
1569 (source (origin
1570 (method git-fetch)
1571 (uri (git-reference
1572 (commit commit)
1573 (url home-page)))
1574 (sha256
1575 (base32
1576 "097vny990wp2qpjij6a5a5gwc6fxzg5wk56inhy18iki5v6pif1p"))
1577 (file-name (string-append name "-" version "-checkout"))))
1578 (build-system gnu-build-system)
1579 (arguments
1580 '(#:phases (modify-phases %standard-phases
1581 (add-after 'unpack 'bootstrap
1582 (lambda _
1583 (zero? (system* "sh" "bootstrap")))))
1584
1585 #:configure-flags
1586 ;; Add -I to match 'bash.pc' of Bash 4.4.
1587 (list (string-append "CPPFLAGS=-I"
1588 (assoc-ref %build-inputs "bash:include")
1589 "/include/bash/include")
1590
1591 ;; The '.a' file is useless.
1592 "--disable-static"
1593
1594 ;; Install 'lib/bash' as Bash 4.4 expects.
1595 (string-append "--libdir=" (assoc-ref %outputs "out")
1596 "/lib/bash"))))
1597 (native-inputs `(("pkg-config" ,pkg-config)
1598 ("autoconf" ,(autoconf-wrapper))
1599 ("automake" ,automake)
1600 ("libtool" ,libtool)
1601 ;; Gettext brings 'AC_LIB_LINKFLAGS_FROM_LIBS'.
1602 ("gettext" ,gettext-minimal)))
1603 (inputs `(("guile" ,guile-2.0)
1604 ("bash:include" ,bash "include")))
1605 (synopsis "Extend Bash using Guile")
1606 (description
1607 "Guile-Bash provides a shared library and set of Guile modules,
1608 allowing you to extend Bash in Scheme. Scheme interfaces allow you to access
1609 the following aspects of Bash:
1610
1611 @itemize
1612 @item aliases;
1613 @item setting and getting Bash variables;
1614 @item creating dynamic variables;
1615 @item creating Bash functions with a Scheme implementation;
1616 @item reader macro for output capturing;
1617 @item reader macro for evaluating raw Bash commands.
1618 @end itemize
1619
1620 To enable it, run:
1621
1622 @example
1623 enable -f ~/.guix-profile/lib/bash/libguile-bash.so scm
1624 @end example
1625
1626 and then run @command{scm example.scm}.")
1627 (license license:gpl3+))))
1628
1629 (define-public guile-8sync
1630 (package
1631 (name "guile-8sync")
1632 (version "0.4.2")
1633 (source (origin
1634 (method url-fetch)
1635 (uri (string-append "mirror://gnu/8sync/8sync-" version
1636 ".tar.gz"))
1637 (sha256
1638 (base32
1639 "031wm13srak3wsnll7j2mbbi29g1pcm4swdb71ds9yn567pn20qw"))))
1640 (build-system gnu-build-system)
1641 (native-inputs `(("autoconf" ,autoconf)
1642 ("automake" ,automake)
1643 ("guile" ,guile-2.2)
1644 ("pkg-config" ,pkg-config)
1645 ("texinfo" ,texinfo)))
1646 (arguments
1647 `(#:phases (modify-phases %standard-phases
1648 (add-before 'configure 'setenv
1649 (lambda _
1650 ;; quiet warnings
1651 (setenv "GUILE_AUTO_COMPILE" "0")
1652 #t)))))
1653 (home-page "https://gnu.org/s/8sync/")
1654 (synopsis "Asynchronous actor model library for Guile")
1655 (description
1656 "GNU 8sync (pronounced \"eight-sync\") is an asynchronous programming
1657 library for GNU Guile based on the actor model.
1658
1659 Note that 8sync is only available for Guile 2.2.")
1660 (license license:lgpl3+)))
1661
1662 (define-public guile-fibers
1663 (package
1664 (name "guile-fibers")
1665 (version "1.0.0")
1666 (source (origin
1667 (method url-fetch)
1668 (uri (string-append "https://wingolog.org/pub/fibers/fibers-"
1669 version ".tar.gz"))
1670 (sha256
1671 (base32
1672 "0vjkg72ghgdgphzbjz9ig8al8271rq8974viknb2r1rg4lz92ld0"))))
1673 (build-system gnu-build-system)
1674 (native-inputs
1675 `(("texinfo" ,texinfo)
1676 ("pkg-config" ,pkg-config)))
1677 (inputs
1678 `(("guile" ,guile-2.2)))
1679 (synopsis "Lightweight concurrency facility for Guile")
1680 (description
1681 "Fibers is a Guile library that implements a a lightweight concurrency
1682 facility, inspired by systems like Concurrent ML, Go, and Erlang. A fiber is
1683 like a \"goroutine\" from the Go language: a lightweight thread-like
1684 abstraction. Systems built with Fibers can scale up to millions of concurrent
1685 fibers, tens of thousands of concurrent socket connections, and many parallel
1686 cores. The Fibers library also provides Concurrent ML-like channels for
1687 communication between fibers.
1688
1689 Note that Fibers makes use of some Guile 2.1/2.2-specific features and
1690 is not available for Guile 2.0.")
1691 (home-page "https://github.com/wingo/fibers")
1692 (license license:lgpl3+)))
1693
1694 (define-public guile-git
1695 (let ((revision "1")
1696 (commit "96dfb3bdba39a37cf6aefb18e335118a6115f963"))
1697 (package
1698 (name "guile-git")
1699 (version (string-append "0.0-" revision "." (string-take commit 7)))
1700 (home-page "https://gitlab.com/amirouche/guile-git")
1701 (source (origin
1702 (method git-fetch)
1703 (uri (git-reference (url home-page) (commit commit)))
1704 (sha256
1705 (base32
1706 "0v73251kmh1vs7gp3jh4pk4rikl4d8illwi0gnhwa55ij1mn9apl"))
1707 (file-name (git-file-name name version))))
1708 (build-system gnu-build-system)
1709 (arguments
1710 '(#:phases (modify-phases %standard-phases
1711 (add-after 'unpack 'bootstrap
1712 (lambda _
1713 ;; Install .go files to "site-ccache", not "ccache".
1714 (substitute* "Makefile.am"
1715 (("/ccache")
1716 "/site-ccache"))
1717
1718 (zero? (system* "autoreconf" "-vfi")))))))
1719 (native-inputs
1720 `(("autoconf" ,autoconf)
1721 ("automake" ,automake)
1722 ("pkg-config" ,pkg-config)))
1723 (inputs
1724 `(("guile" ,guile-2.2)
1725 ("libgit2" ,libgit2)))
1726 (propagated-inputs
1727 `(("guile-bytestructures" ,guile-bytestructures)))
1728 (synopsis "Guile bindings for libgit2")
1729 (description
1730 "This package provides Guile bindings to libgit2, a library to
1731 manipulate repositories of the Git version control system.")
1732 (license license:gpl3+))))
1733
1734 ;;; guile.scm ends here