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