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