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