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