Merge branch 'master' into staging
[jackhill/guix/guix.git] / gnu / packages / guile.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
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>
6 ;;; Copyright © 2015, 2017 Christopher Allan Webber <cwebber@dustycloud.org>
7 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
8 ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
9 ;;; Copyright © 2016, 2019 Ricardo Wurmus <rekado@elephly.net>
10 ;;; Copyright © 2017 Andy Wingo <wingo@igalia.com>
11 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
12 ;;; Copyright © 2017, 2019 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>
16 ;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org>
17 ;;; Copyright © 2019 Taylan Kammer <taylan.kammer@gmail.com>
18 ;;;
19 ;;; This file is part of GNU Guix.
20 ;;;
21 ;;; GNU Guix is free software; you can redistribute it and/or modify it
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 ;;;
26 ;;; GNU Guix is distributed in the hope that it will be useful, but
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
32 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33
34 (define-module (gnu packages guile)
35 #:use-module ((guix licenses) #:prefix license:)
36 #:use-module (gnu packages)
37 #:use-module (gnu packages autotools)
38 #:use-module (gnu packages base)
39 #:use-module (gnu packages bash)
40 #:use-module (gnu packages bdw-gc)
41 #:use-module (gnu packages compression)
42 #:use-module (gnu packages dbm)
43 #:use-module (gnu packages flex)
44 #:use-module (gnu packages gawk)
45 #:use-module (gnu packages gettext)
46 #:use-module (gnu packages hurd)
47 #:use-module (gnu packages libffi)
48 #:use-module (gnu packages libunistring)
49 #:use-module (gnu packages linux)
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)
54 #:use-module (gnu packages sqlite)
55 #:use-module (gnu packages texinfo)
56 #:use-module (gnu packages version-control)
57 #:use-module (guix packages)
58 #:use-module (guix download)
59 #:use-module (guix git-download)
60 #:use-module (guix build-system gnu)
61 #:use-module (guix build-system guile)
62 #:use-module (guix deprecation)
63 #:use-module (guix utils)
64 #:use-module (ice-9 match)
65 #:use-module ((srfi srfi-1) #:prefix srfi-1:))
66
67 ;;; Commentary:
68 ;;;
69 ;;; GNU Guile, and modules and extensions.
70 ;;;
71 ;;; Code:
72
73 (define-public guile-1.8
74 (package
75 (name "guile")
76 (version "1.8.8")
77 (source (origin
78 (method url-fetch)
79 (uri (string-append "mirror://gnu/guile/guile-" version
80 ".tar.gz"))
81 (sha256
82 (base32
83 "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3"))
84 (patches (search-patches "guile-1.8-cpp-4.5.patch"))))
85 (build-system gnu-build-system)
86 (arguments '(#:configure-flags '("--disable-error-on-warning")
87
88 ;; Insert a phase before `configure' to patch things up.
89 #:phases
90 (modify-phases %standard-phases
91 (add-before 'configure 'patch-stuff
92 (lambda* (#:key outputs #:allow-other-keys)
93 ;; Add a call to `lt_dladdsearchdir' so that
94 ;; `libguile-readline.so' & co. are in the
95 ;; loader's search path.
96 (substitute* "libguile/dynl.c"
97 (("lt_dlinit.*$" match)
98 (format #f
99 " ~a~% lt_dladdsearchdir(\"~a/lib\");~%"
100 match
101 (assoc-ref outputs "out"))))
102
103 ;; The usual /bin/sh...
104 (substitute* "ice-9/popen.scm"
105 (("/bin/sh") (which "sh")))
106 #t)))))
107
108 ;; When cross-compiling, a native version of Guile itself is needed.
109 (native-inputs (if (%current-target-system)
110 `(("self" ,this-package))
111 '()))
112
113 (inputs `(("gawk" ,gawk)
114 ("readline" ,readline)))
115
116 ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be
117 ;; propagated.
118 (propagated-inputs `(("gmp" ,gmp)
119 ("libltdl" ,libltdl)))
120
121 (native-search-paths
122 (list (search-path-specification
123 (variable "GUILE_LOAD_PATH")
124 (files '("share/guile/site")))))
125
126 (synopsis "Scheme implementation intended especially for extensions")
127 (description
128 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
129 official extension language of the GNU system. It is an implementation of
130 the Scheme language which can be easily embedded in other applications to
131 provide a convenient means of extending the functionality of the application
132 without requiring the source code to be rewritten.")
133 (home-page "https://www.gnu.org/software/guile/")
134 (license license:lgpl2.0+)))
135
136 (define-public guile-2.0
137 (package
138 (name "guile")
139 (version "2.0.14")
140 (source (origin
141 (method url-fetch)
142 (uri (string-append "mirror://gnu/guile/guile-" version
143 ".tar.xz"))
144 (sha256
145 (base32
146 "10lxc6l5alf3lzbs3ihnbfy6dfcrsyf8667wa57f26vf4mk2ai78"))))
147 (build-system gnu-build-system)
148
149 ;; When cross-compiling, a native version of Guile itself is needed.
150 (native-inputs `(,@(if (%current-target-system)
151 `(("self" ,this-package))
152 '())
153 ("pkgconfig" ,pkg-config)))
154 (inputs `(("libffi" ,libffi)
155 ,@(libiconv-if-needed)
156
157 ;; We need Bash when cross-compiling because some of the scripts
158 ;; in bin/ refer to it. Use 'bash-minimal' because we don't need
159 ;; an interactive Bash with Readline and all.
160 ,@(if (target-mingw?) '() `(("bash" ,bash-minimal)))))
161 (propagated-inputs
162 `( ;; These ones aren't normally needed here, but since `libguile-2.0.la'
163 ;; reads `-lltdl -lunistring', adding them here will add the needed
164 ;; `-L' flags. As for why the `.la' file lacks the `-L' flags, see
165 ;; <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903>.
166 ("libunistring" ,libunistring)
167
168 ;; Depend on LIBLTDL, not LIBTOOL. That way, we avoid some the extra
169 ;; dependencies that LIBTOOL has, which is helpful during bootstrap.
170 ("libltdl" ,libltdl)
171
172 ;; The headers and/or `guile-2.0.pc' refer to these packages, so they
173 ;; must be propagated.
174 ("bdw-gc" ,libgc)
175 ("gmp" ,gmp)))
176
177 (outputs '("out" "debug"))
178
179 (arguments
180 `(#:configure-flags '("--disable-static") ; saves 3 MiB
181 #:phases
182 (modify-phases %standard-phases
183 (add-before 'configure 'pre-configure
184 (lambda* (#:key inputs #:allow-other-keys)
185 ;; Tell (ice-9 popen) the file name of Bash.
186 (let ((bash (assoc-ref inputs "bash")))
187 (substitute* "module/ice-9/popen.scm"
188 ;; If bash is #f allow fallback for user to provide
189 ;; "bash" in PATH. This happens when cross-building to
190 ;; MinGW for which we do not have Bash yet.
191 (("/bin/sh")
192 ,@(if (target-mingw?)
193 '((if bash
194 (string-append bash "/bin/bash")
195 "bash"))
196 '((string-append bash "/bin/bash")))))
197 #t))))))
198
199 (native-search-paths
200 (list (search-path-specification
201 (variable "GUILE_LOAD_PATH")
202 (files '("share/guile/site/2.0")))
203 (search-path-specification
204 (variable "GUILE_LOAD_COMPILED_PATH")
205 (files '("lib/guile/2.0/site-ccache")))))
206
207 (synopsis "Scheme implementation intended especially for extensions")
208 (description
209 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
210 official extension language of the GNU system. It is an implementation of
211 the Scheme language which can be easily embedded in other applications to
212 provide a convenient means of extending the functionality of the application
213 without requiring the source code to be rewritten.")
214 (home-page "https://www.gnu.org/software/guile/")
215 (license license:lgpl3+)))
216
217 (define-public guile-2.2
218 (package (inherit guile-2.0)
219 (name "guile")
220 (version "2.2.6")
221 (source (origin
222 (method url-fetch)
223
224 ;; Note: we are limited to one of the compression formats
225 ;; supported by the bootstrap binaries, so no lzip here.
226 (uri (string-append "mirror://gnu/guile/guile-" version
227 ".tar.xz"))
228 (sha256
229 (base32
230 "1269ymxm56j1z1lvq1y42rm961f2n7rinm3k6l00p9k52hrpcddk"))
231 (modules '((guix build utils)))
232 (patches (search-patches
233 "guile-2.2-skip-oom-test.patch"))
234
235 ;; Remove the pre-built object files. Instead, build everything
236 ;; from source, at the expense of significantly longer build
237 ;; times (almost 3 hours on a 4-core Intel i5).
238 (snippet '(begin
239 (for-each delete-file
240 (find-files "prebuilt" "\\.go$"))
241 #t))))
242 (properties '((timeout . 72000) ;20 hours
243 (max-silent-time . 36000))) ;10 hours (needed on ARM
244 ; when heavily loaded)
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")
251 (files '("lib/guile/2.2/site-ccache")))))))
252
253 (define-public guile-2.2.7
254 ;; This version contains a bug fix for a relatively rare crash that could
255 ;; affect shepherd as PID 1: <https://bugs.gnu.org/37757>.
256 (package
257 (inherit guile-2.2)
258 (version "2.2.7")
259 (source (origin
260 (inherit (package-source guile-2.2))
261 (uri (string-append "mirror://gnu/guile/guile-" version
262 ".tar.xz"))
263 (sha256
264 (base32
265 "013mydzhfswqci6xmyc1ajzd59pfbdak15i0b090nhr9bzm7dxyd"))))))
266
267 (define-deprecated guile-2.2/bug-fix guile-2.2.7)
268
269 (define-public guile-2.2/fixed
270 ;; A package of Guile 2.2 that's rarely changed. It is the one used
271 ;; in the `base' module, and thus changing it entails a full rebuild.
272 (package
273 (inherit guile-2.2)
274 (properties '((hidden? . #t) ;people should install 'guile-2.2'
275 (timeout . 72000) ;20 hours
276 (max-silent-time . 36000))))) ;10 hours (needed on ARM
277 ; when heavily loaded)
278 (define-public guile-2.2.4
279 (package/inherit
280 guile-2.2
281 (version "2.2.4")
282 (source (origin
283 (inherit (package-source guile-2.2))
284 (uri (string-append "mirror://gnu/guile/guile-" version
285 ".tar.xz"))
286 (sha256
287 (base32
288 "07p3g0v2ba2vlfbfidqzlgbhnzdx46wh2rgc5gszq1mjyx5bks6r"))))))
289
290 (define-public guile-3.0
291 ;; This is the latest Guile stable version.
292 (package
293 (inherit guile-2.2)
294 (name "guile-next") ;to be renamed to "guile"
295 (version "3.0.1")
296 (source (origin
297 (inherit (package-source guile-2.2))
298 (uri (string-append "mirror://gnu/guile/guile-"
299 version ".tar.xz"))
300 (sha256
301 (base32
302 "1jakps3127h8g69ixgb4zwc8v2g29dmwql1vi3pwg30kzp8fm5nn"))
303 (patches
304 (append (search-patches "guile-3.0-crash.patch")
305 (origin-patches (package-source guile-2.2))))))
306
307 (arguments
308 (substitute-keyword-arguments (package-arguments guile-2.2)
309 ;; XXX: On ARMv7, work around <https://bugs.gnu.org/39208> by disabling
310 ;; JIT.
311 ((#:configure-flags flags '())
312 (if (target-arm32?)
313 `(cons "--disable-jit" ,flags)
314 flags))))
315 (native-search-paths
316 (list (search-path-specification
317 (variable "GUILE_LOAD_PATH")
318 (files '("share/guile/site/3.0")))
319 (search-path-specification
320 (variable "GUILE_LOAD_COMPILED_PATH")
321 (files '("lib/guile/3.0/site-ccache"
322 "share/guile/site/3.0")))))))
323
324 (define-public guile-next guile-3.0)
325
326 (define* (make-guile-readline guile #:optional (name "guile-readline"))
327 (package
328 (name name)
329 (version (package-version guile))
330 (source (package-source guile))
331 (build-system gnu-build-system)
332 (arguments
333 '(#:configure-flags '("--disable-silent-rules")
334 #:phases (modify-phases %standard-phases
335 (add-before 'build 'chdir
336 (lambda* (#:key outputs #:allow-other-keys)
337 (invoke "make" "-C" "libguile" "scmconfig.h")
338 (invoke "make" "-C" "lib")
339 (chdir "guile-readline")
340
341 (substitute* "Makefile"
342 (("../libguile/libguile-[[:graph:]]+\\.la")
343 ;; Remove dependency on libguile-X.Y.la.
344 "")
345 (("^READLINE_LIBS = (.*)$" _ libs)
346 ;; Link against the provided libguile.
347 (string-append "READLINE_LIBS = "
348 "-lguile-$(GUILE_EFFECTIVE_VERSION) "
349 libs "\n"))
350 (("\\$\\(top_builddir\\)/meta/build-env")
351 ;; Use the provided Guile, not the one from
352 ;; $(builddir).
353 "")
354
355 ;; Install modules to the 'site' directories.
356 (("^moddir = .*$")
357 "moddir = $(pkgdatadir)/site/$(GUILE_EFFECTIVE_VERSION)\n")
358 (("^ccachedir = .*$")
359 "ccachedir = $(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/site-ccache\n"))
360
361 ;; Load 'guile-readline.so' from the right place.
362 (substitute* "ice-9/readline.scm"
363 (("load-extension \"guile-readline\"")
364 (format #f "load-extension \
365 (string-append ~s \"/lib/guile/\" (effective-version) \"/extensions/guile-readline\")"
366 (assoc-ref outputs "out"))))
367 #t)))))
368 (home-page (package-home-page guile))
369 (native-inputs (package-native-inputs guile))
370 (inputs
371 `(,@(package-inputs guile) ;to placate 'configure'
372 ,@(package-propagated-inputs guile)
373 ("guile" ,guile)
374 ("readline" ,readline)))
375 (synopsis "Line editing support for GNU Guile")
376 (description
377 "This module provides line editing support via the Readline library for
378 GNU@tie{}Guile. Use the @code{(ice-9 readline)} module and call its
379 @code{activate-readline} procedure to enable it.")
380 (license license:gpl3+)))
381
382 (define-public guile-readline
383 (make-guile-readline guile-2.2))
384
385 (define-public guile3.0-readline
386 (make-guile-readline guile-next "guile3.0-readline"))
387
388 (define (guile-variant-package-name prefix)
389 (lambda (name)
390 "Return NAME with PREFIX instead of \"guile-\", when applicable."
391 (if (string-prefix? "guile-" name)
392 (string-append prefix "-"
393 (string-drop name
394 (string-length "guile-")))
395 name)))
396
397 (define package-for-guile-2.0
398 ;; A procedure that rewrites the dependency tree of the given package to use
399 ;; GUILE-2.0 instead of GUILE-2.2.
400 (package-input-rewriting `((,guile-2.2 . ,guile-2.0))
401 (guile-variant-package-name "guile2.0")))
402
403 (define package-for-guile-3.0
404 (package-input-rewriting `((,guile-2.2 . ,guile-next))
405 (guile-variant-package-name "guile3.0")))
406
407 (define-public guile-for-guile-emacs
408 (package (inherit guile-2.2)
409 (name "guile-for-guile-emacs")
410 (version "20150510.d8d9a8d")
411 (source (origin
412 (method git-fetch)
413 (uri (git-reference
414 (url "git://git.hcoop.net/git/bpt/guile.git")
415 (commit "d8d9a8da05ec876acba81a559798eb5eeceb5a17")))
416 (file-name (string-append name "-" version "-checkout"))
417 (sha256
418 (base32
419 "00sprsshy16y8pxjy126hr2adqcvvzzz96hjyjwgg8swva1qh6b0"))))
420 (arguments
421 `(;; Tests aren't passing for now.
422 ;; Obviously we should re-enable this!
423 #:tests? #f
424 ,@(package-arguments guile-2.2)))
425 (native-inputs
426 `(("autoconf" ,autoconf)
427 ("automake" ,automake)
428 ("libtool" ,libtool)
429 ("flex" ,flex)
430 ("texinfo" ,texinfo)
431 ("gettext" ,gettext-minimal)
432 ,@(package-native-inputs guile-2.2)))
433 ;; Same as in guile-2.0
434 (native-search-paths
435 (list (search-path-specification
436 (variable "GUILE_LOAD_PATH")
437 (files '("share/guile/site/2.0")))
438 (search-path-specification
439 (variable "GUILE_LOAD_COMPILED_PATH")
440 (files '("lib/guile/2.0/site-ccache"
441 "share/guile/site/2.0")))))))
442
443 \f
444 ;;;
445 ;;; Extensions.
446 ;;;
447
448 (define-public guile-json-1
449 (package
450 (name "guile-json")
451 (version "1.2.0")
452 (home-page "https://github.com/aconchillo/guile-json")
453 (source (origin
454 (method url-fetch)
455 (uri (string-append "mirror://savannah/guile-json/guile-json-"
456 version ".tar.gz"))
457 (sha256
458 (base32
459 "15gnb84d7hpazqhskkf3g9z4r6knw54wfj4ch5270kakz1lp70c9"))))
460 (build-system gnu-build-system)
461 (native-inputs `(("pkg-config" ,pkg-config)
462 ("guile" ,guile-2.2)))
463 (inputs `(("guile" ,guile-2.2)))
464 (synopsis "JSON module for Guile")
465 (description
466 "Guile-JSON supports parsing and building JSON documents according to the
467 specification. These are the main features:
468
469 @itemize
470 @item Strictly complies to @uref{http://json.org, specification}.
471 @item Build JSON documents programmatically via macros.
472 @item Unicode support for strings.
473 @item Allows JSON pretty printing.
474 @end itemize\n")
475
476 ;; Version 1.2.0 switched to GPLv3+ (from LGPLv3+).
477 (license license:gpl3+)))
478
479 ;; Deprecate the 'guile-json' alias to force the use 'guile-json-1' or
480 ;; 'guile-json-3'. In the future, we may reuse 'guile-json' as an alias for
481 ;; 'guile-json-3'.
482 (define-deprecated guile-json guile-json-1)
483 (export guile-json)
484
485 (define-public guile2.0-json
486 (package-for-guile-2.0 guile-json-1))
487
488 (define-public guile-json-3
489 ;; This version is incompatible with 1.x; see the 'NEWS' file.
490 (package
491 (inherit guile-json-1)
492 (name "guile-json")
493 (version "3.2.0")
494 (source (origin
495 (method url-fetch)
496 (uri (string-append "mirror://savannah/guile-json/guile-json-"
497 version ".tar.gz"))
498 (sha256
499 (base32
500 "14m6b6g2maw0mkvfm4x63rqb54vgbpn1gcqs715ijw4bikfzlqfz"))))))
501
502 (define-public guile3.0-json
503 (package-for-guile-3.0 guile-json-3))
504
505 ;; There are two guile-gdbm packages, one using the FFI and one with
506 ;; direct C bindings, hence the verbose name.
507
508 (define-public guile-gdbm-ffi
509 (package
510 (name "guile-gdbm-ffi")
511 (version "20120209.fa1d5b6")
512 (source (origin
513 (method git-fetch)
514 (uri (git-reference
515 (url "https://github.com/ijp/guile-gdbm.git")
516 (commit "fa1d5b6231d0e4d096687b378c025f2148c5f246")))
517 (file-name (string-append name "-" version "-checkout"))
518 (patches (search-patches
519 "guile-gdbm-ffi-support-gdbm-1.14.patch"))
520 (sha256
521 (base32
522 "1j8wrsw7v9w6qkl47xz0rdikg50v16nn6kbs3lgzcymjzpa7babj"))))
523 (build-system guile-build-system)
524 (arguments
525 '(#:phases (modify-phases %standard-phases
526 (add-after 'unpack 'move-examples
527 (lambda* (#:key outputs #:allow-other-keys)
528 ;; Move examples where they belong.
529 (let* ((out (assoc-ref outputs "out"))
530 (doc (string-append out "/share/doc/"
531 (strip-store-file-name out)
532 "/examples")))
533 (copy-recursively "examples" doc)
534 (delete-file-recursively "examples")
535 #t)))
536 (add-after 'unpack 'set-libgdbm-file-name
537 (lambda* (#:key inputs #:allow-other-keys)
538 (substitute* "gdbm.scm"
539 (("\\(dynamic-link \"libgdbm\"\\)")
540 (format #f "(dynamic-link \"~a/lib/libgdbm.so\")"
541 (assoc-ref inputs "gdbm"))))
542 #t)))))
543 (native-inputs
544 `(("guile" ,guile-2.2)))
545 (inputs
546 `(("gdbm" ,gdbm)))
547 (home-page "https://github.com/ijp/guile-gdbm")
548 (synopsis "Guile bindings to the GDBM library via Guile's FFI")
549 (description
550 "Guile bindings to the GDBM key-value storage system, using
551 Guile's foreign function interface.")
552 (license license:gpl3+)))
553
554 (define-public guile2.0-gdbm-ffi
555 (package-for-guile-2.0 guile-gdbm-ffi))
556
557 (define-public guile3.0-gdbm-ffi
558 (package-for-guile-3.0 guile-gdbm-ffi))
559
560 (define-public guile-sqlite3
561 (package
562 (name "guile-sqlite3")
563 (version "0.1.0")
564 (home-page "https://notabug.org/guile-sqlite3/guile-sqlite3.git")
565 (source (origin
566 (method git-fetch)
567 (uri (git-reference
568 (url home-page)
569 (commit (string-append "v" version))))
570 (sha256
571 (base32
572 "1nv8j7wk6b5n4p22szyi8lv8fs31rrzxhzz16gyj8r38c1fyp9qp"))
573 (file-name (string-append name "-" version "-checkout"))
574 (modules '((guix build utils)))
575 (snippet
576 '(begin
577 ;; Allow builds with Guile 3.0.
578 (substitute* "configure.ac"
579 (("^GUILE_PKG.*")
580 "GUILE_PKG([3.0 2.2 2.0])\n"))
581 #t))))
582 (build-system gnu-build-system)
583 (native-inputs
584 `(("autoconf" ,autoconf)
585 ("automake" ,automake)
586 ("pkg-config" ,pkg-config)))
587 (inputs
588 `(("guile" ,guile-2.2)
589 ("sqlite" ,sqlite)))
590 (synopsis "Access SQLite databases from Guile")
591 (description
592 "This package provides Guile bindings to the SQLite database system.")
593 (license license:gpl3+)))
594
595 (define-public guile2.0-sqlite3
596 (package-for-guile-2.0 guile-sqlite3))
597
598 (define-public guile3.0-sqlite3
599 (package-for-guile-3.0 guile-sqlite3))
600
601 (define-public guile-bytestructures
602 (package
603 (name "guile-bytestructures")
604 (version "1.0.7")
605 (home-page "https://github.com/TaylanUB/scheme-bytestructures")
606 (source (origin
607 (method git-fetch)
608 (uri (git-reference
609 (url home-page)
610 (commit (string-append "v" version))))
611 (file-name (git-file-name name version))
612 (sha256
613 (base32
614 "0q0habjiy3h9cigb7q1br9kz6z212dn2ab31f6dgd3rrmsfn5rvb"))))
615 (build-system gnu-build-system)
616 (arguments
617 `(#:make-flags '("GUILE_AUTO_COMPILE=0") ;to prevent guild warnings
618
619 #:phases (modify-phases %standard-phases
620 (add-after 'install 'install-doc
621 (lambda* (#:key outputs #:allow-other-keys)
622 (let* ((out (assoc-ref outputs "out"))
623 (package ,(package-full-name this-package "-"))
624 (doc (string-append out "/share/doc/" package)))
625 (install-file "README.md" doc)
626 #t))))))
627 (native-inputs
628 `(("autoconf" ,autoconf)
629 ("automake" ,automake)
630 ("pkg-config" ,pkg-config)
631 ("guile" ,guile-2.2)))
632 (inputs
633 `(("guile" ,guile-2.2)))
634 (synopsis "Structured access to bytevector contents for Guile")
635 (description
636 "Guile bytestructures offers a system imitating the type system
637 of the C programming language, to be used on bytevectors. C's type
638 system works on raw memory, and Guile works on bytevectors which are
639 an abstraction over raw memory. It's also more powerful than the C
640 type system, elevating types to first-class status.")
641 (license license:gpl3+)
642 (properties '((upstream-name . "bytestructures")))))
643
644 (define-public guile2.0-bytestructures
645 (package-for-guile-2.0 guile-bytestructures))
646
647 (define-public guile3.0-bytestructures
648 (package-for-guile-3.0 guile-bytestructures))
649
650 (define-public guile-git
651 (package
652 (name "guile-git")
653 (version "0.3.0")
654 (home-page "https://gitlab.com/guile-git/guile-git.git")
655 (source (origin
656 (method url-fetch)
657 (uri (string-append "https://gitlab.com/guile-git/guile-git/uploads/"
658 "4c563d8e7e1ff84396abe8ca7011bcaf/guile-git-"
659 version ".tar.gz"))
660 (sha256
661 (base32
662 "0c5i3d16hp7gp9rd78vk9zc45js8bphf92m4lbb5gyi4l1yl7kkm"))))
663 (build-system gnu-build-system)
664 (native-inputs
665 `(("pkg-config" ,pkg-config)
666 ("guile" ,guile-2.2)
667 ("guile-bytestructures" ,guile-bytestructures)))
668 (inputs
669 `(("guile" ,guile-2.2)
670 ("libgit2" ,libgit2)))
671 (propagated-inputs
672 `(("guile-bytestructures" ,guile-bytestructures)))
673 (synopsis "Guile bindings for libgit2")
674 (description
675 "This package provides Guile bindings to libgit2, a library to
676 manipulate repositories of the Git version control system.")
677 (license license:gpl3+)))
678
679 (define-public guile3.0-git
680 (package-for-guile-3.0 guile-git))
681
682 (define-public guile2.0-git
683 (let ((base (package-for-guile-2.0 guile-git)))
684 (package
685 (inherit base)
686 ;; Libgit2's Guile test driver requires (ice-9 textual-ports), which is
687 ;; not in Guile 2.0. Thus, keep LIBGIT2 as-is here (i.e., built against
688 ;; Guile 2.2).
689 (inputs `(("libgit2" ,libgit2)
690 ,@(srfi-1:alist-delete "libgit2"
691 (package-inputs base)))))))
692
693 ;;; guile.scm ends here
694