maint: Switch to Guile-JSON 3.x.
[jackhill/guix/guix.git] / gnu / packages / guile.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
152d4076 2;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
0791437f
RW
3;;; Copyright © 2014 Cyril Roelandt <tipecaml@gmail.com>
4;;; Copyright © 2014, 2016, 2018 David Thompson <davet@gnu.org>
5;;; Copyright © 2014, 2017, 2018 Mark H Weaver <mhw@netris.org>
c5793e7e 6;;; Copyright © 2015, 2017 Christopher Allan Webber <cwebber@dustycloud.org>
c5793e7e 7;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
0791437f
RW
8;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
9;;; Copyright © 2016, 2019 Ricardo Wurmus <rekado@elephly.net>
aaf1bdc3 10;;; Copyright © 2017 Andy Wingo <wingo@igalia.com>
0791437f
RW
11;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
12;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
13;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
14;;; Copyright © 2017, 2018 Amirouche <amirouche@hypermove.net>
15;;; Copyright © 2018 Danny Milosavljevic <dannym@scratchpost.org>
c8e3651a 16;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org>
0791437f 17;;; Copyright © 2019 Taylan Kammer <taylan.kammer@gmail.com>
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)
146c6b62
RW
37 #:use-module (gnu packages autotools)
38 #:use-module (gnu packages base)
9c782445 39 #:use-module (gnu packages bash)
1ffa7090 40 #:use-module (gnu packages bdw-gc)
148585c2 41 #:use-module (gnu packages compression)
255d1bbe 42 #:use-module (gnu packages dbm)
146c6b62 43 #:use-module (gnu packages flex)
1ffa7090 44 #:use-module (gnu packages gawk)
146c6b62 45 #:use-module (gnu packages gettext)
ee8ee748 46 #:use-module (gnu packages hurd)
1ffa7090 47 #:use-module (gnu packages libffi)
1ffa7090 48 #:use-module (gnu packages libunistring)
7119cca8 49 #:use-module (gnu packages linux)
1ffa7090
LC
50 #:use-module (gnu packages m4)
51 #:use-module (gnu packages multiprecision)
52 #:use-module (gnu packages pkg-config)
53 #:use-module (gnu packages readline)
cd0322a3 54 #:use-module (gnu packages sqlite)
f906d30c 55 #:use-module (gnu packages texinfo)
bd233722 56 #:use-module (gnu packages version-control)
1722d680 57 #:use-module (guix packages)
87f5d366 58 #:use-module (guix download)
6bc24063 59 #:use-module (guix git-download)
32795fcf 60 #:use-module (guix build-system gnu)
977d8666 61 #:use-module (guix build-system guile)
32795fcf 62 #:use-module (guix utils)
d4660a54
MC
63 #:use-module (ice-9 match)
64 #:use-module ((srfi srfi-1) #:prefix srfi-1:))
1722d680
LC
65
66;;; Commentary:
67;;;
c44899a2 68;;; GNU Guile, and modules and extensions.
1722d680
LC
69;;;
70;;; Code:
71
c44899a2
LC
72(define-public guile-1.8
73 (package
74 (name "guile")
75 (version "1.8.8")
76 (source (origin
87f5d366 77 (method url-fetch)
0db342a5 78 (uri (string-append "mirror://gnu/guile/guile-" version
c44899a2
LC
79 ".tar.gz"))
80 (sha256
81 (base32
01eafd38 82 "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3"))
fc1adab1 83 (patches (search-patches "guile-1.8-cpp-4.5.patch"))))
c44899a2
LC
84 (build-system gnu-build-system)
85 (arguments '(#:configure-flags '("--disable-error-on-warning")
c44899a2
LC
86
87 ;; Insert a phase before `configure' to patch things up.
dc1d3cde
KK
88 #:phases
89 (modify-phases %standard-phases
90 (add-before 'configure 'patch-stuff
91 (lambda* (#:key outputs #:allow-other-keys)
92 ;; Add a call to `lt_dladdsearchdir' so that
93 ;; `libguile-readline.so' & co. are in the
94 ;; loader's search path.
95 (substitute* "libguile/dynl.c"
96 (("lt_dlinit.*$" match)
97 (format #f
98 " ~a~% lt_dladdsearchdir(\"~a/lib\");~%"
99 match
100 (assoc-ref outputs "out"))))
2f4fbe1c 101
dc1d3cde
KK
102 ;; The usual /bin/sh...
103 (substitute* "ice-9/popen.scm"
104 (("/bin/sh") (which "sh")))
105 #t)))))
528ea990
LC
106
107 ;; When cross-compiling, a native version of Guile itself is needed.
108 (native-inputs (if (%current-target-system)
109 `(("self" ,this-package))
110 '()))
111
01eafd38 112 (inputs `(("gawk" ,gawk)
c44899a2
LC
113 ("readline" ,readline)))
114
115 ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be
116 ;; propagated.
117 (propagated-inputs `(("gmp" ,gmp)
be11b102 118 ("libltdl" ,libltdl)))
c44899a2 119
9be8d7c8
LC
120 (native-search-paths
121 (list (search-path-specification
122 (variable "GUILE_LOAD_PATH")
af070955 123 (files '("share/guile/site")))))
9be8d7c8 124
f50d2669 125 (synopsis "Scheme implementation intended especially for extensions")
c44899a2 126 (description
a22dc0c4
LC
127 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
128official extension language of the GNU system. It is an implementation of
129the Scheme language which can be easily embedded in other applications to
130provide a convenient means of extending the functionality of the application
131without requiring the source code to be rewritten.")
6fd52309 132 (home-page "https://www.gnu.org/software/guile/")
71e0f217 133 (license license:lgpl2.0+)))
c44899a2
LC
134
135(define-public guile-2.0
136 (package
137 (name "guile")
b5efd14a 138 (version "2.0.14")
c44899a2 139 (source (origin
87f5d366 140 (method url-fetch)
0db342a5 141 (uri (string-append "mirror://gnu/guile/guile-" version
c44899a2
LC
142 ".tar.xz"))
143 (sha256
144 (base32
b5efd14a 145 "10lxc6l5alf3lzbs3ihnbfy6dfcrsyf8667wa57f26vf4mk2ai78"))))
c44899a2 146 (build-system gnu-build-system)
528ea990
LC
147
148 ;; When cross-compiling, a native version of Guile itself is needed.
149 (native-inputs `(,@(if (%current-target-system)
150 `(("self" ,this-package))
151 '())
152 ("pkgconfig" ,pkg-config)))
c44899a2 153 (inputs `(("libffi" ,libffi)
88da729f 154 ,@(libiconv-if-needed)
baf549df
LC
155
156 ;; We need Bash when cross-compiling because some of the scripts
157 ;; in bin/ refer to it. Use 'bash-minimal' because we don't need
158 ;; an interactive Bash with Readline and all.
159 ,@(if (target-mingw?) '() `(("bash" ,bash-minimal)))))
c44899a2
LC
160 (propagated-inputs
161 `( ;; These ones aren't normally needed here, but since `libguile-2.0.la'
162 ;; reads `-lltdl -lunistring', adding them here will add the needed
163 ;; `-L' flags. As for why the `.la' file lacks the `-L' flags, see
164 ;; <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903>.
165 ("libunistring" ,libunistring)
be11b102
LC
166
167 ;; Depend on LIBLTDL, not LIBTOOL. That way, we avoid some the extra
168 ;; dependencies that LIBTOOL has, which is helpful during bootstrap.
169 ("libltdl" ,libltdl)
c44899a2
LC
170
171 ;; The headers and/or `guile-2.0.pc' refer to these packages, so they
172 ;; must be propagated.
bda1bc6c 173 ("bdw-gc" ,libgc)
c44899a2
LC
174 ("gmp" ,gmp)))
175
9bf62d9b
LC
176 (outputs '("out" "debug"))
177
8ffaa93b 178 (arguments
20897536
TGR
179 `(#:configure-flags '("--disable-static") ; saves 3 MiB
180 #:phases
181 (modify-phases %standard-phases
182 (add-before 'configure 'pre-configure
183 (lambda* (#:key inputs #:allow-other-keys)
184 ;; Tell (ice-9 popen) the file name of Bash.
185 (let ((bash (assoc-ref inputs "bash")))
186 (substitute* "module/ice-9/popen.scm"
187 ;; If bash is #f allow fallback for user to provide
188 ;; "bash" in PATH. This happens when cross-building to
189 ;; MinGW for which we do not have Bash yet.
190 (("/bin/sh")
191 ,@(if (target-mingw?)
192 '((if bash
193 (string-append bash "/bin/bash")
194 "bash"))
195 '((string-append bash "/bin/bash")))))
196 #t))))))
8ffaa93b 197
9be8d7c8
LC
198 (native-search-paths
199 (list (search-path-specification
200 (variable "GUILE_LOAD_PATH")
af070955 201 (files '("share/guile/site/2.0")))
9be8d7c8
LC
202 (search-path-specification
203 (variable "GUILE_LOAD_COMPILED_PATH")
b03f270e 204 (files '("lib/guile/2.0/site-ccache")))))
9be8d7c8 205
f50d2669 206 (synopsis "Scheme implementation intended especially for extensions")
c44899a2 207 (description
a22dc0c4
LC
208 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
209official extension language of the GNU system. It is an implementation of
210the Scheme language which can be easily embedded in other applications to
211provide a convenient means of extending the functionality of the application
212without requiring the source code to be rewritten.")
6fd52309 213 (home-page "https://www.gnu.org/software/guile/")
71e0f217 214 (license license:lgpl3+)))
c44899a2 215
f6396d86 216(define-public guile-2.2
f906d30c 217 (package (inherit guile-2.0)
f6396d86 218 (name "guile")
2abd76e8 219 (version "2.2.4")
4eae7980
LC
220 (source (origin
221 (method url-fetch)
34d624ce
LC
222
223 ;; Note: we are limited to one of the compression formats
224 ;; supported by the bootstrap binaries, so no lzip here.
80a72572 225 (uri (string-append "mirror://gnu/guile/guile-" version
34d624ce 226 ".tar.xz"))
4eae7980
LC
227 (sha256
228 (base32
2abd76e8 229 "07p3g0v2ba2vlfbfidqzlgbhnzdx46wh2rgc5gszq1mjyx5bks6r"))
d9f0788a
LC
230 (modules '((guix build utils)))
231
232 ;; Remove the pre-built object files. Instead, build everything
233 ;; from source, at the expense of significantly longer build
234 ;; times (almost 3 hours on a 4-core Intel i5).
6cbee49d
MW
235 (snippet '(begin
236 (for-each delete-file
237 (find-files "prebuilt" "\\.go$"))
238 #t))))
4fbd0f4f 239 (properties '((timeout . 72000) ;20 hours
16b0f205 240 (max-silent-time . 36000))) ;10 hours (needed on ARM
1577a658 241 ; when heavily loaded)
dd90ed89
DT
242 (native-search-paths
243 (list (search-path-specification
244 (variable "GUILE_LOAD_PATH")
245 (files '("share/guile/site/2.2")))
246 (search-path-specification
247 (variable "GUILE_LOAD_COMPILED_PATH")
b03f270e 248 (files '("lib/guile/2.2/site-ccache")))))
33c3a214
LC
249
250 (arguments
251 (if (%current-target-system)
252 (substitute-keyword-arguments (package-arguments guile-2.0)
253 ((#:phases phases '%standard-phases)
254 `(modify-phases ,phases
255 (add-after 'unpack 'sacrifice-elisp-support
256 (lambda _
257 ;; Cross-compiling language/elisp/boot.el fails, so
258 ;; sacrifice it. See
259 ;; <https://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.2&id=988aa29238fca862c7e2cb55f15762a69b4c16ce>
260 ;; for the upstream fix.
261 (substitute* "module/Makefile.in"
262 (("language/elisp/boot\\.el")
263 "\n"))
ee8ee748
LC
264 #t))
265 ,@(if (hurd-target?)
266 `((add-after 'unpack 'allow-madvise-ENOSYS
267 (lambda _
268 ;; Do not warn about ENOSYS on 'madvise'. This is
269 ;; what Guile commit
270 ;; 45e4ace6603e00b297e6542362273041aebe7305 does.
271 ;; TODO: Remove for Guile >= 2.2.5.
272 (substitute* "libguile/vm.c"
273 (("perror \\(\"madvise failed\"\\)")
274 "if (errno != ENOSYS) perror (\"madvised failed\");"))
275 #t)))
276 '()))))
33c3a214 277 (package-arguments guile-2.0)))))
4eae7980 278
34d624ce
LC
279(define-public guile-2.2/fixed
280 ;; A package of Guile 2.2 that's rarely changed. It is the one used
281 ;; in the `base' module, and thus changing it entails a full rebuild.
282 (package
283 (inherit guile-2.2)
a9308efe 284 (properties '((hidden? . #t) ;people should install 'guile-2.2'
5a5b3632
MW
285 (timeout . 72000) ;20 hours
286 (max-silent-time . 36000))))) ;10 hours (needed on ARM
287 ; when heavily loaded)
34d624ce 288
78c88baa 289(define-public guile-2.2.6
c050f187
LC
290 (package
291 (inherit guile-2.2)
78c88baa 292 (version "2.2.6")
c050f187
LC
293 (source (origin
294 (inherit (package-source guile-2.2))
295 (uri (string-append "mirror://gnu/guile/guile-" version
296 ".tar.xz"))
297 (sha256
298 (base32
78c88baa 299 "1269ymxm56j1z1lvq1y42rm961f2n7rinm3k6l00p9k52hrpcddk"))))))
c050f187 300
5cd074ea 301(define-public guile-next
35f90377 302 ;; This is the upcoming Guile 3.0, with JIT support.
55b616fd
DT
303 (let ((commit "6f3357b0df64c4be17e72079864c09a542f1c779")
304 (revision "1"))
35f90377
LC
305 (package
306 (inherit guile-2.2)
307 (name "guile-next")
fc289fb2 308 (version "2.9.2")
35f90377 309 (source (origin
121f32a1 310 (inherit (package-source guile-2.2))
fc289fb2 311 (uri (string-append "ftp://alpha.gnu.org/gnu/guile/guile-"
121f32a1 312 version ".tar.xz"))
35f90377
LC
313 (sha256
314 (base32
fc289fb2 315 "1w358df2wmcyzk2ziqrj2zhwqisaqraqfa3008ay23nf1a7bw0z4"))))
e14b3067
DT
316 (native-search-paths
317 (list (search-path-specification
318 (variable "GUILE_LOAD_PATH")
319 (files '("share/guile/site/3.0")))
320 (search-path-specification
321 (variable "GUILE_LOAD_COMPILED_PATH")
322 (files '("lib/guile/3.0/site-ccache"
121f32a1
LC
323 "share/guile/site/3.0")))))
324 (properties '((ftp-server . "alpha.gnu.org")
325 (upstream-name . "guile"))))))
5cd074ea 326
2ba2c98d
LC
327(define (make-guile-readline guile)
328 (package
329 (name "guile-readline")
330 (version (package-version guile))
331 (source (package-source guile))
332 (build-system gnu-build-system)
333 (arguments
334 '(#:configure-flags '("--disable-silent-rules")
335 #:phases (modify-phases %standard-phases
336 (add-before 'build 'chdir
337 (lambda* (#:key outputs #:allow-other-keys)
338 (invoke "make" "-C" "libguile" "scmconfig.h")
339 (invoke "make" "-C" "lib")
340 (chdir "guile-readline")
341
342 (substitute* "Makefile"
343 (("../libguile/libguile-[[:graph:]]+\\.la")
344 ;; Remove dependency on libguile-X.Y.la.
345 "")
346 (("^READLINE_LIBS = (.*)$" _ libs)
347 ;; Link against the provided libguile.
348 (string-append "READLINE_LIBS = "
349 "-lguile-$(GUILE_EFFECTIVE_VERSION) "
350 libs "\n"))
351 (("\\$\\(top_builddir\\)/meta/build-env")
352 ;; Use the provided Guile, not the one from
353 ;; $(builddir).
354 "")
355
356 ;; Install modules to the 'site' directories.
357 (("^moddir = .*$")
358 "moddir = $(pkgdatadir)/site/$(GUILE_EFFECTIVE_VERSION)\n")
359 (("^ccachedir = .*$")
360 "ccachedir = $(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/site-ccache\n"))
361
362 ;; Load 'guile-readline.so' from the right place.
363 (substitute* "ice-9/readline.scm"
364 (("load-extension \"guile-readline\"")
365 (format #f "load-extension \
366 (string-append ~s \"/lib/guile/\" (effective-version) \"/extensions/guile-readline\")"
367 (assoc-ref outputs "out"))))
368 #t)))))
369 (home-page (package-home-page guile))
370 (native-inputs (package-native-inputs guile))
371 (inputs
372 `(,@(package-inputs guile) ;to placate 'configure'
373 ,@(package-propagated-inputs guile)
374 ("guile" ,guile)
375 ("readline" ,readline)))
376 (synopsis "Line editing support for GNU Guile")
377 (description
378 "This module provides line editing support via the Readline library for
379GNU@tie{}Guile. Use the @code{(ice-9 readline)} module and call its
380@code{activate-readline} procedure to enable it.")
381 (license license:gpl3+)))
382
383(define-public guile-readline
384 (make-guile-readline guile-2.2))
385
8f4acad7
LC
386(define (guile-variant-package-name prefix)
387 (lambda (name)
388 "Return NAME with PREFIX instead of \"guile-\", when applicable."
389 (if (string-prefix? "guile-" name)
390 (string-append prefix "-"
391 (string-drop name
392 (string-length "guile-")))
393 name)))
947a5d47 394
8f4acad7 395(define package-for-guile-2.0
10b507b2
LC
396 ;; A procedure that rewrites the dependency tree of the given package to use
397 ;; GUILE-2.0 instead of GUILE-2.2.
c9c51ac3 398 (package-input-rewriting `((,guile-2.2 . ,guile-2.0))
8f4acad7 399 (guile-variant-package-name "guile2.0")))
947a5d47 400
4eae7980 401(define-public guile-for-guile-emacs
f6396d86 402 (package (inherit guile-2.2)
4eae7980
LC
403 (name "guile-for-guile-emacs")
404 (version "20150510.d8d9a8d")
f906d30c
CAW
405 (source (origin
406 (method git-fetch)
407 (uri (git-reference
4eae7980
LC
408 (url "git://git.hcoop.net/git/bpt/guile.git")
409 (commit "d8d9a8da05ec876acba81a559798eb5eeceb5a17")))
51988e3a 410 (file-name (string-append name "-" version "-checkout"))
f906d30c
CAW
411 (sha256
412 (base32
4eae7980 413 "00sprsshy16y8pxjy126hr2adqcvvzzz96hjyjwgg8swva1qh6b0"))))
f906d30c 414 (arguments
8924e3fd
RW
415 `(;; Tests aren't passing for now.
416 ;; Obviously we should re-enable this!
417 #:tests? #f
418 ,@(package-arguments guile-2.2)))
f906d30c
CAW
419 (native-inputs
420 `(("autoconf" ,autoconf)
421 ("automake" ,automake)
422 ("libtool" ,libtool)
423 ("flex" ,flex)
424 ("texinfo" ,texinfo)
b94a6ca0 425 ("gettext" ,gettext-minimal)
f6396d86 426 ,@(package-native-inputs guile-2.2)))
daeb61f7
RW
427 ;; Same as in guile-2.0
428 (native-search-paths
429 (list (search-path-specification
430 (variable "GUILE_LOAD_PATH")
431 (files '("share/guile/site/2.0")))
432 (search-path-specification
433 (variable "GUILE_LOAD_COMPILED_PATH")
31769b9f 434 (files '("lib/guile/2.0/site-ccache"
daeb61f7 435 "share/guile/site/2.0")))))))
be3feafe 436
c44899a2
LC
437\f
438;;;
439;;; Extensions.
440;;;
441
6050a1fb
CR
442(define-public guile-json
443 (package
444 (name "guile-json")
15214828 445 (version "1.2.0")
f52ef55e 446 (home-page "https://github.com/aconchillo/guile-json")
6050a1fb 447 (source (origin
ffc72ec6 448 (method url-fetch)
6efccabe
EB
449 (uri (string-append "https://download.savannah.nongnu.org/releases/"
450 name "/" name "-" version ".tar.gz"))
ffc72ec6
LC
451 (sha256
452 (base32
6efccabe 453 "15gnb84d7hpazqhskkf3g9z4r6knw54wfj4ch5270kakz1lp70c9"))))
6050a1fb 454 (build-system gnu-build-system)
6efccabe 455 (native-inputs `(("pkg-config" ,pkg-config)
f52ef55e
LC
456 ("guile" ,guile-2.2)))
457 (inputs `(("guile" ,guile-2.2)))
6050a1fb
CR
458 (synopsis "JSON module for Guile")
459 (description
0f31d4f0
LC
460 "Guile-JSON supports parsing and building JSON documents according to the
461specification. These are the main features:
462
463@itemize
464@item Strictly complies to @uref{http://json.org, specification}.
465@item Build JSON documents programmatically via macros.
466@item Unicode support for strings.
467@item Allows JSON pretty printing.
468@end itemize\n")
15214828
LC
469
470 ;; Version 1.2.0 switched to GPLv3+ (from LGPLv3+).
471 (license license:gpl3+)))
6050a1fb 472
947a5d47 473(define-public guile2.2-json
2252f087
LC
474 (deprecated-package "guile2.2-json" guile-json))
475
476(define-public guile2.0-json
477 (package-for-guile-2.0 guile-json))
947a5d47 478
152d4076
LC
479(define-public guile-json-3
480 ;; This version is incompatible with 1.x; see the 'NEWS' file.
481 (package
482 (inherit guile-json)
483 (name "guile-json")
484 (version "3.1.0")
485 (source (origin
486 (method url-fetch)
487 (uri (string-append "https://download.savannah.nongnu.org/releases/"
488 name "/" name "-" version ".tar.gz"))
489 (sha256
490 (base32
491 "1yfqscz74i4vxylabd3s9l0wbdp8bg9qxnv1ixdm3b1l7zdx00z3"))))))
492
93e7199b
CAW
493;; There are two guile-gdbm packages, one using the FFI and one with
494;; direct C bindings, hence the verbose name.
495
496(define-public guile-gdbm-ffi
497 (package
498 (name "guile-gdbm-ffi")
499 (version "20120209.fa1d5b6")
500 (source (origin
501 (method git-fetch)
502 (uri (git-reference
503 (url "https://github.com/ijp/guile-gdbm.git")
504 (commit "fa1d5b6231d0e4d096687b378c025f2148c5f246")))
821f4dc2 505 (file-name (string-append name "-" version "-checkout"))
977d8666
LC
506 (patches (search-patches
507 "guile-gdbm-ffi-support-gdbm-1.14.patch"))
93e7199b
CAW
508 (sha256
509 (base32
510 "1j8wrsw7v9w6qkl47xz0rdikg50v16nn6kbs3lgzcymjzpa7babj"))))
977d8666
LC
511 (build-system guile-build-system)
512 (arguments
513 '(#:phases (modify-phases %standard-phases
514 (add-after 'unpack 'move-examples
515 (lambda* (#:key outputs #:allow-other-keys)
516 ;; Move examples where they belong.
517 (let* ((out (assoc-ref outputs "out"))
518 (doc (string-append out "/share/doc/"
519 (strip-store-file-name out)
520 "/examples")))
521 (copy-recursively "examples" doc)
522 (delete-file-recursively "examples")
523 #t)))
524 (add-after 'unpack 'set-libgdbm-file-name
525 (lambda* (#:key inputs #:allow-other-keys)
526 (substitute* "gdbm.scm"
527 (("\\(dynamic-link \"libgdbm\"\\)")
528 (format #f "(dynamic-link \"~a/lib/libgdbm.so\")"
529 (assoc-ref inputs "gdbm"))))
530 #t)))))
531 (native-inputs
532 `(("guile" ,guile-2.2)))
56f31a9f 533 (inputs
56f31a9f 534 `(("gdbm" ,gdbm)))
93e7199b
CAW
535 (home-page "https://github.com/ijp/guile-gdbm")
536 (synopsis "Guile bindings to the GDBM library via Guile's FFI")
537 (description
538 "Guile bindings to the GDBM key-value storage system, using
539Guile's foreign function interface.")
71e0f217 540 (license license:gpl3+)))
93e7199b 541
5bd3a841
LC
542(define-public guile2.0-gdbm-ffi
543 (package-for-guile-2.0 guile-gdbm-ffi))
544
2737bcff 545(define-public guile2.2-gdbm-ffi
5bd3a841 546 (deprecated-package "guile2.2-gdbm-ffi" guile-gdbm-ffi))
93e7199b 547
e8ac1f8f 548(define-public guile-sqlite3
319e26e4
LC
549 (package
550 (name "guile-sqlite3")
551 (version "0.1.0")
3527f600 552 (home-page "https://notabug.org/guile-sqlite3/guile-sqlite3.git")
319e26e4
LC
553 (source (origin
554 (method git-fetch)
555 (uri (git-reference
556 (url home-page)
557 (commit (string-append "v" version))))
558 (sha256
559 (base32
560 "1nv8j7wk6b5n4p22szyi8lv8fs31rrzxhzz16gyj8r38c1fyp9qp"))
561 (file-name (string-append name "-" version "-checkout"))))
562 (build-system gnu-build-system)
563 (native-inputs
564 `(("autoconf" ,autoconf)
565 ("automake" ,automake)
566 ("pkg-config" ,pkg-config)))
567 (inputs
568 `(("guile" ,guile-2.2)
569 ("sqlite" ,sqlite)))
570 (synopsis "Access SQLite databases from Guile")
571 (description
572 "This package provides Guile bindings to the SQLite database system.")
573 (license license:gpl3+)))
e8ac1f8f 574
c8e3651a
EB
575(define-public guile2.0-sqlite3
576 (package-for-guile-2.0 guile-sqlite3))
577
3b5783fc
AB
578(define-public guile-bytestructures
579 (package
580 (name "guile-bytestructures")
db58e326 581 (version "1.0.5")
3b5783fc 582 (source (origin
4f85f7f7 583 (method url-fetch)
584 (uri (string-append "https://github.com/TaylanUB/scheme-bytestructures"
585 "/releases/download/v" version
586 "/bytestructures-" version ".tar.gz"))
3b5783fc
AB
587 (sha256
588 (base32
db58e326 589 "0ibk7fjwpb450lnrva4bx45sgln3pbyb645az4ansvh1spgani43"))))
4f85f7f7 590 (build-system gnu-build-system)
726ecfeb 591 (native-inputs
4f85f7f7 592 `(("pkg-config" ,pkg-config)))
3b5783fc 593 (inputs
aabece2e 594 `(("guile" ,guile-2.2)))
3b5783fc
AB
595 (home-page "https://github.com/TaylanUB/scheme-bytestructures")
596 (synopsis "Structured access to bytevector contents for Guile")
597 (description
598 "Guile bytestructures offers a system imitating the type system
599of the C programming language, to be used on bytevectors. C's type
600system works on raw memory, and Guile works on bytevectors which are
601an abstraction over raw memory. It's also more powerful than the C
602type system, elevating types to first-class status.")
71e0f217 603 (license license:gpl3+)))
3b5783fc 604
726ecfeb
LC
605(define-public guile2.0-bytestructures
606 (package-for-guile-2.0 guile-bytestructures))
607
bd233722 608(define-public guile-git
e85035c9
LC
609 (package
610 (name "guile-git")
db9771a9 611 (version "0.2.0")
e85035c9
LC
612 (home-page "https://gitlab.com/guile-git/guile-git.git")
613 (source (origin
614 (method git-fetch)
615 (uri (git-reference (url home-page)
616 (commit (string-append "v" version))))
617 (sha256
618 (base32
db9771a9 619 "018hmfsh0rjwfvr4h7y10jc6k8a2k9xsirngghy3pjasin4nd2yz"))
e85035c9
LC
620 (file-name (git-file-name name version))))
621 (build-system gnu-build-system)
622 (native-inputs
623 `(("autoconf" ,autoconf)
624 ("automake" ,automake)
625 ("texinfo" ,texinfo)
626 ("pkg-config" ,pkg-config)))
627 (inputs
628 `(("guile" ,guile-2.2)
629 ("libgit2" ,libgit2)))
630 (propagated-inputs
631 `(("guile-bytestructures" ,guile-bytestructures)))
632 (synopsis "Guile bindings for libgit2")
633 (description
634 "This package provides Guile bindings to libgit2, a library to
bd233722 635manipulate repositories of the Git version control system.")
e85035c9 636 (license license:gpl3+)))
c5793e7e 637
70bc6085
LC
638(define-public guile2.0-git
639 (package-for-guile-2.0 guile-git))
640
1722d680 641;;; guile.scm ends here
a8307a17 642