Merge branch 'master' into core-updates
[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, 2020 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 ,@(if (hurd-system?)
184 '((add-after 'unpack 'disable-tests
185 (lambda _
186 ;; Hangs at: "Running 00-repl-server.test"
187 (rename-file "test-suite/tests/00-repl-server.test" "00-repl-server.test")
188 ;; Sometimes Hangs at: "Running 00-socket.test"
189 (rename-file "test-suite/tests/00-socket.test" "00-socket.test")
190 ;; FAIL: srfi-18.test: thread-sleep!: thread sleeps fractions of a second
191 (rename-file "test-suite/tests/srfi-18.test" "srfi-18.test")
192 ;; failed to remove 't-guild-compile-7215.go.tdL7yC
193 (substitute* "test-suite/standalone/Makefile.in"
194 (("test-guild-compile ") ""))
195 #t)))
196 '())
197 (add-before 'configure 'pre-configure
198 (lambda* (#:key inputs #:allow-other-keys)
199 ;; Tell (ice-9 popen) the file name of Bash.
200 (let ((bash (assoc-ref inputs "bash")))
201 (substitute* "module/ice-9/popen.scm"
202 ;; If bash is #f allow fallback for user to provide
203 ;; "bash" in PATH. This happens when cross-building to
204 ;; MinGW for which we do not have Bash yet.
205 (("/bin/sh")
206 ,@(if (target-mingw?)
207 '((if bash
208 (string-append bash "/bin/bash")
209 "bash"))
210 '((string-append bash "/bin/bash")))))
211 #t))))))
212
213 (native-search-paths
214 (list (search-path-specification
215 (variable "GUILE_LOAD_PATH")
216 (files '("share/guile/site/2.0")))
217 (search-path-specification
218 (variable "GUILE_LOAD_COMPILED_PATH")
219 (files '("lib/guile/2.0/site-ccache")))))
220
221 (synopsis "Scheme implementation intended especially for extensions")
222 (description
223 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
224 official extension language of the GNU system. It is an implementation of
225 the Scheme language which can be easily embedded in other applications to
226 provide a convenient means of extending the functionality of the application
227 without requiring the source code to be rewritten.")
228 (home-page "https://www.gnu.org/software/guile/")
229 (license license:lgpl3+)))
230
231 (define-public guile-2.2
232 (package (inherit guile-2.0)
233 (name "guile")
234 (version "2.2.7")
235 (source (origin
236 (method url-fetch)
237
238 ;; Note: we are limited to one of the compression formats
239 ;; supported by the bootstrap binaries, so no lzip here.
240 (uri (string-append "mirror://gnu/guile/guile-" version
241 ".tar.xz"))
242 (sha256
243 (base32
244 "013mydzhfswqci6xmyc1ajzd59pfbdak15i0b090nhr9bzm7dxyd"))
245 (modules '((guix build utils)))
246 (patches (search-patches
247 "guile-2.2-skip-oom-test.patch"))
248
249 ;; Remove the pre-built object files. Instead, build everything
250 ;; from source, at the expense of significantly longer build
251 ;; times (almost 3 hours on a 4-core Intel i5).
252 (snippet '(begin
253 (for-each delete-file
254 (find-files "prebuilt" "\\.go$"))
255 #t))))
256 (properties '((timeout . 72000) ;20 hours
257 (max-silent-time . 36000))) ;10 hours (needed on ARM
258 ; when heavily loaded)
259 (native-search-paths
260 (list (search-path-specification
261 (variable "GUILE_LOAD_PATH")
262 (files '("share/guile/site/2.2")))
263 (search-path-specification
264 (variable "GUILE_LOAD_COMPILED_PATH")
265 (files '("lib/guile/2.2/site-ccache")))))))
266
267 (define-deprecated guile-2.2/bug-fix guile-2.2)
268
269 (define-public guile-2.2.4
270 (package/inherit
271 guile-2.2
272 (version "2.2.4")
273 (source (origin
274 (inherit (package-source guile-2.2))
275 (uri (string-append "mirror://gnu/guile/guile-" version
276 ".tar.xz"))
277 (sha256
278 (base32
279 "07p3g0v2ba2vlfbfidqzlgbhnzdx46wh2rgc5gszq1mjyx5bks6r"))))))
280
281 (define-public guile-3.0
282 ;; This is the latest Guile stable version.
283 (package
284 (inherit guile-2.2)
285 (name "guile")
286 (version "3.0.2")
287 (source (origin
288 (inherit (package-source guile-2.2))
289 (uri (string-append "mirror://gnu/guile/guile-"
290 version ".tar.xz"))
291 (sha256
292 (base32
293 "12lziar4j27j9whqp2n18427q45y9ghq7gdd8lqhmj1k0lr7vi2k"))))
294 (arguments
295 ;; XXX: JIT-enabled Guile crashes in obscure ways on GNU/Hurd.
296 (if (hurd-target?)
297 (substitute-keyword-arguments (package-arguments guile-2.2)
298 ((#:configure-flags flags ''())
299 `(cons "--disable-jit" ,flags)))
300 (package-arguments guile-2.2)))
301 (native-search-paths
302 (list (search-path-specification
303 (variable "GUILE_LOAD_PATH")
304 (files '("share/guile/site/3.0")))
305 (search-path-specification
306 (variable "GUILE_LOAD_COMPILED_PATH")
307 (files '("lib/guile/3.0/site-ccache"
308 "share/guile/site/3.0")))))))
309
310 (define-public guile-next guile-3.0)
311
312 (define-public guile-3.0/libgc-7
313 ;; Using libgc-7 avoid crashes that can occur, particularly when loading
314 ;; data in to the Guix Data Service:
315 ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=40525
316 (hidden-package
317 (package
318 (inherit guile-3.0)
319 (propagated-inputs
320 `(("bdw-gc" ,libgc-7)
321 ,@(srfi-1:alist-delete "bdw-gc" (package-propagated-inputs guile-3.0)))))))
322
323 (define-public guile-3.0/fixed
324 ;; A package of Guile that's rarely changed. It is the one used in the
325 ;; `base' module, and thus changing it entails a full rebuild.
326 (package
327 (inherit guile-3.0)
328 (properties '((hidden? . #t) ;people should install 'guile-2.2'
329 (timeout . 72000) ;20 hours
330 (max-silent-time . 36000))))) ;10 hours (needed on ARM
331 ; when heavily loaded)
332
333 (define* (make-guile-readline guile #:optional (name "guile-readline"))
334 (package
335 (name name)
336 (version (package-version guile))
337 (source (package-source guile))
338 (build-system gnu-build-system)
339 (arguments
340 '(#:configure-flags '("--disable-silent-rules")
341 #:phases (modify-phases %standard-phases
342 (add-before 'build 'chdir
343 (lambda* (#:key outputs #:allow-other-keys)
344 (invoke "make" "-C" "libguile" "scmconfig.h")
345 (invoke "make" "-C" "lib")
346 (chdir "guile-readline")
347
348 (substitute* "Makefile"
349 (("../libguile/libguile-[[:graph:]]+\\.la")
350 ;; Remove dependency on libguile-X.Y.la.
351 "")
352 (("^READLINE_LIBS = (.*)$" _ libs)
353 ;; Link against the provided libguile.
354 (string-append "READLINE_LIBS = "
355 "-lguile-$(GUILE_EFFECTIVE_VERSION) "
356 libs "\n"))
357 (("\\$\\(top_builddir\\)/meta/build-env")
358 ;; Use the provided Guile, not the one from
359 ;; $(builddir).
360 "")
361
362 ;; Install modules to the 'site' directories.
363 (("^moddir = .*$")
364 "moddir = $(pkgdatadir)/site/$(GUILE_EFFECTIVE_VERSION)\n")
365 (("^ccachedir = .*$")
366 "ccachedir = $(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/site-ccache\n"))
367
368 ;; Load 'guile-readline.so' from the right place.
369 (substitute* "ice-9/readline.scm"
370 (("load-extension \"guile-readline\"")
371 (format #f "load-extension \
372 (string-append ~s \"/lib/guile/\" (effective-version) \"/extensions/guile-readline\")"
373 (assoc-ref outputs "out"))))
374 #t)))))
375 (home-page (package-home-page guile))
376 (native-inputs (package-native-inputs guile))
377 (inputs
378 `(,@(package-inputs guile) ;to placate 'configure'
379 ,@(package-propagated-inputs guile)
380 ("guile" ,guile)
381 ("readline" ,readline)))
382 (synopsis "Line editing support for GNU Guile")
383 (description
384 "This module provides line editing support via the Readline library for
385 GNU@tie{}Guile. Use the @code{(ice-9 readline)} module and call its
386 @code{activate-readline} procedure to enable it.")
387 (license license:gpl3+)))
388
389 (define-public guile-readline
390 (make-guile-readline guile-3.0))
391
392 (define-public guile2.2-readline
393 (make-guile-readline guile-2.2 "guile2.2-readline"))
394
395 (define (guile-variant-package-name prefix)
396 (lambda (name)
397 "Return NAME with PREFIX instead of \"guile-\", when applicable."
398 (if (string-prefix? "guile-" name)
399 (string-append prefix "-"
400 (string-drop name
401 (string-length "guile-")))
402 name)))
403
404 (define package-for-guile-2.0
405 ;; A procedure that rewrites the dependency tree of the given package to use
406 ;; GUILE-2.0 instead of GUILE-3.0.
407 (package-input-rewriting `((,guile-3.0 . ,guile-2.0))
408 (guile-variant-package-name "guile2.0")))
409
410 (define package-for-guile-2.2
411 (package-input-rewriting `((,guile-3.0 . ,guile-2.2))
412 (guile-variant-package-name "guile2.2")))
413
414 (define-syntax define-deprecated-guile3.0-package
415 (lambda (s)
416 "Define a deprecated package alias for \"guile3.0-something\"."
417 (syntax-case s ()
418 ((_ name)
419 (and (identifier? #'name)
420 (string-prefix? "guile3.0-" (symbol->string (syntax->datum
421 #'name))))
422 (let ((->guile (lambda (str)
423 (let ((base (string-drop str
424 (string-length "guile3.0-"))))
425 (string-append "guile-" base)))))
426 (with-syntax ((package-name (symbol->string (syntax->datum #'name)))
427 (package
428 (datum->syntax
429 #'name
430 (string->symbol
431 (->guile (symbol->string (syntax->datum #'name)))))))
432 #'(begin
433 (define-deprecated name package
434 (deprecated-package package-name package))
435 (export name))))))))
436
437 (define-deprecated-guile3.0-package guile3.0-readline)
438
439 (define-public guile-for-guile-emacs
440 (let ((commit "15ca78482ac0dd2e3eb36dcb31765d8652d7106d")
441 (revision "1"))
442 (package (inherit guile-2.2)
443 (name "guile-for-guile-emacs")
444 (version (git-version "2.1.2" revision commit))
445 (source (origin
446 (method git-fetch)
447 (uri (git-reference
448 (url "git://git.savannah.gnu.org/guile.git")
449 (commit commit)))
450 (file-name (git-file-name name version))
451 (sha256
452 (base32
453 "1l7ik4q4zk7vq4m3gnwizc0b64b1mdr31hxqlzxs94xaf2lvi7s2"))))
454 (arguments
455 (substitute-keyword-arguments (package-arguments guile-2.2)
456 ((#:phases phases '%standard-phases)
457 `(modify-phases ,phases
458 (replace 'bootstrap
459 (lambda _
460 ;; Disable broken tests.
461 ;; TODO: Fix them!
462 (substitute* "test-suite/tests/gc.test"
463 (("\\(pass-if \"after-gc-hook gets called\"" m)
464 (string-append "#;" m)))
465 (substitute* "test-suite/tests/version.test"
466 (("\\(pass-if \"version reporting works\"" m)
467 (string-append "#;" m)))
468 ;; Warning: Unwind-only `out-of-memory' exception; skipping pre-unwind handler.
469 ;; FAIL: test-out-of-memory
470 (substitute* "test-suite/standalone/Makefile.am"
471 (("(check_SCRIPTS|TESTS) \\+= test-out-of-memory") ""))
472
473 (patch-shebang "build-aux/git-version-gen")
474 (invoke "sh" "autogen.sh")
475 #t))))))
476 (native-inputs
477 `(("autoconf" ,autoconf)
478 ("automake" ,automake)
479 ("libtool" ,libtool)
480 ("flex" ,flex)
481 ("texinfo" ,texinfo)
482 ("gettext" ,gettext-minimal)
483 ,@(package-native-inputs guile-2.2))))))
484
485 \f
486 ;;;
487 ;;; Extensions.
488 ;;;
489
490 (define-public guile-json-1
491 (package
492 (name "guile-json")
493 (version "1.2.0")
494 (home-page "https://github.com/aconchillo/guile-json")
495 (source (origin
496 (method url-fetch)
497 (uri (string-append "mirror://savannah/guile-json/guile-json-"
498 version ".tar.gz"))
499 (sha256
500 (base32
501 "15gnb84d7hpazqhskkf3g9z4r6knw54wfj4ch5270kakz1lp70c9"))))
502 (build-system gnu-build-system)
503 (native-inputs `(("pkg-config" ,pkg-config)
504 ("guile" ,guile-2.2)))
505 (inputs `(("guile" ,guile-2.2)))
506 (synopsis "JSON module for Guile")
507 (description
508 "Guile-JSON supports parsing and building JSON documents according to the
509 specification. These are the main features:
510
511 @itemize
512 @item Strictly complies to @uref{http://json.org, specification}.
513 @item Build JSON documents programmatically via macros.
514 @item Unicode support for strings.
515 @item Allows JSON pretty printing.
516 @end itemize\n")
517
518 ;; Version 1.2.0 switched to GPLv3+ (from LGPLv3+).
519 (license license:gpl3+)))
520
521 ;; Deprecate the 'guile-json' alias to force the use 'guile-json-1' or
522 ;; 'guile-json-3'. In the future, we may reuse 'guile-json' as an alias for
523 ;; 'guile-json-3'.
524 (define-deprecated guile-json guile-json-1)
525 (export guile-json)
526
527 (define-public guile2.0-json
528 (package-for-guile-2.0 guile-json-1))
529
530 (define-public guile-json-3
531 ;; This version is incompatible with 1.x; see the 'NEWS' file.
532 (package
533 (inherit guile-json-1)
534 (name "guile-json")
535 (version "3.5.0")
536 (source (origin
537 (method url-fetch)
538 (uri (string-append "mirror://savannah/guile-json/guile-json-"
539 version ".tar.gz"))
540 (sha256
541 (base32
542 "0nj0684qgh6ppkbdyxqfyjwsv2qbyairxpi8fzrhsi3xnc7jn4im"))))
543 (native-inputs `(("pkg-config" ,pkg-config)
544 ("guile" ,guile-3.0)))
545 (inputs `(("guile" ,guile-3.0)))))
546
547 (define-public guile2.2-json
548 (package-for-guile-2.2 guile-json-3))
549
550 (define-public guile3.0-json
551 (deprecated-package "guile3.0-json" guile-json-3))
552
553 ;; There are two guile-gdbm packages, one using the FFI and one with
554 ;; direct C bindings, hence the verbose name.
555
556 (define-public guile-gdbm-ffi
557 (package
558 (name "guile-gdbm-ffi")
559 (version "20120209.fa1d5b6")
560 (source (origin
561 (method git-fetch)
562 (uri (git-reference
563 (url "https://github.com/ijp/guile-gdbm.git")
564 (commit "fa1d5b6231d0e4d096687b378c025f2148c5f246")))
565 (file-name (string-append name "-" version "-checkout"))
566 (patches (search-patches
567 "guile-gdbm-ffi-support-gdbm-1.14.patch"))
568 (sha256
569 (base32
570 "1j8wrsw7v9w6qkl47xz0rdikg50v16nn6kbs3lgzcymjzpa7babj"))))
571 (build-system guile-build-system)
572 (arguments
573 '(#:phases (modify-phases %standard-phases
574 (add-after 'unpack 'move-examples
575 (lambda* (#:key outputs #:allow-other-keys)
576 ;; Move examples where they belong.
577 (let* ((out (assoc-ref outputs "out"))
578 (doc (string-append out "/share/doc/"
579 (strip-store-file-name out)
580 "/examples")))
581 (copy-recursively "examples" doc)
582 (delete-file-recursively "examples")
583 #t)))
584 (add-after 'unpack 'set-libgdbm-file-name
585 (lambda* (#:key inputs #:allow-other-keys)
586 (substitute* "gdbm.scm"
587 (("\\(dynamic-link \"libgdbm\"\\)")
588 (format #f "(dynamic-link \"~a/lib/libgdbm.so\")"
589 (assoc-ref inputs "gdbm"))))
590 #t)))))
591 (native-inputs
592 `(("guile" ,guile-3.0)))
593 (inputs
594 `(("gdbm" ,gdbm)))
595 (home-page "https://github.com/ijp/guile-gdbm")
596 (synopsis "Guile bindings to the GDBM library via Guile's FFI")
597 (description
598 "Guile bindings to the GDBM key-value storage system, using
599 Guile's foreign function interface.")
600 (license license:gpl3+)))
601
602 (define-public guile2.0-gdbm-ffi
603 (package-for-guile-2.0 guile-gdbm-ffi))
604
605 (define-public guile2.2-gdbm-ffi
606 (package-for-guile-2.2 guile-gdbm-ffi))
607
608 (define-deprecated-guile3.0-package guile3.0-gdbm-ffi)
609
610 (define-public guile-sqlite3
611 (package
612 (name "guile-sqlite3")
613 (version "0.1.0")
614 (home-page "https://notabug.org/guile-sqlite3/guile-sqlite3.git")
615 (source (origin
616 (method git-fetch)
617 (uri (git-reference
618 (url home-page)
619 (commit (string-append "v" version))))
620 (sha256
621 (base32
622 "1nv8j7wk6b5n4p22szyi8lv8fs31rrzxhzz16gyj8r38c1fyp9qp"))
623 (file-name (string-append name "-" version "-checkout"))
624 (patches
625 (search-patches "guile-sqlite3-fix-cross-compilation.patch"))
626 (modules '((guix build utils)))
627 (snippet
628 '(begin
629 ;; Allow builds with Guile 3.0.
630 (substitute* "configure.ac"
631 (("^GUILE_PKG.*")
632 "GUILE_PKG([3.0 2.2 2.0])\n"))
633 #t))))
634 (build-system gnu-build-system)
635 (native-inputs
636 `(("autoconf" ,autoconf)
637 ("automake" ,automake)
638 ("guile" ,guile-3.0)
639 ("pkg-config" ,pkg-config)))
640 (inputs
641 `(("guile" ,guile-3.0)
642 ("sqlite" ,sqlite)))
643 (synopsis "Access SQLite databases from Guile")
644 (description
645 "This package provides Guile bindings to the SQLite database system.")
646 (license license:gpl3+)))
647
648 (define-public guile2.0-sqlite3
649 (package-for-guile-2.0 guile-sqlite3))
650
651 (define-public guile2.2-sqlite3
652 (package-for-guile-2.2 guile-sqlite3))
653
654 (define-deprecated-guile3.0-package guile3.0-sqlite3)
655
656 (define-public guile-bytestructures
657 (package
658 (name "guile-bytestructures")
659 (version "1.0.7")
660 (home-page "https://github.com/TaylanUB/scheme-bytestructures")
661 (source (origin
662 (method git-fetch)
663 (uri (git-reference
664 (url home-page)
665 (commit (string-append "v" version))))
666 (file-name (git-file-name name version))
667 (sha256
668 (base32
669 "0q0habjiy3h9cigb7q1br9kz6z212dn2ab31f6dgd3rrmsfn5rvb"))))
670 (build-system gnu-build-system)
671 (arguments
672 `(#:make-flags '("GUILE_AUTO_COMPILE=0") ;to prevent guild warnings
673
674 #:phases (modify-phases %standard-phases
675 (add-after 'install 'install-doc
676 (lambda* (#:key outputs #:allow-other-keys)
677 (let* ((out (assoc-ref outputs "out"))
678 (package ,(package-full-name this-package "-"))
679 (doc (string-append out "/share/doc/" package)))
680 (install-file "README.md" doc)
681 #t))))))
682 (native-inputs
683 `(("autoconf" ,autoconf)
684 ("automake" ,automake)
685 ("pkg-config" ,pkg-config)
686 ("guile" ,guile-3.0)))
687 (inputs
688 `(("guile" ,guile-3.0)))
689 (synopsis "Structured access to bytevector contents for Guile")
690 (description
691 "Guile bytestructures offers a system imitating the type system
692 of the C programming language, to be used on bytevectors. C's type
693 system works on raw memory, and Guile works on bytevectors which are
694 an abstraction over raw memory. It's also more powerful than the C
695 type system, elevating types to first-class status.")
696 (license license:gpl3+)
697 (properties '((upstream-name . "bytestructures")))))
698
699 (define-public guile2.0-bytestructures
700 (package-for-guile-2.0 guile-bytestructures))
701
702 (define-public guile2.2-bytestructures
703 (package-for-guile-2.2 guile-bytestructures))
704
705 (define-deprecated-guile3.0-package guile3.0-bytestructures)
706
707 (define-public guile-git
708 (package
709 (name "guile-git")
710 (version "0.3.0")
711 (home-page "https://gitlab.com/guile-git/guile-git.git")
712 (source (origin
713 (method url-fetch)
714 (uri (string-append "https://gitlab.com/guile-git/guile-git/uploads/"
715 "4c563d8e7e1ff84396abe8ca7011bcaf/guile-git-"
716 version ".tar.gz"))
717 (sha256
718 (base32
719 "0c5i3d16hp7gp9rd78vk9zc45js8bphf92m4lbb5gyi4l1yl7kkm"))))
720 (build-system gnu-build-system)
721 (native-inputs
722 `(("pkg-config" ,pkg-config)
723 ("guile" ,guile-3.0)
724 ("guile-bytestructures" ,guile-bytestructures)))
725 (inputs
726 `(("guile" ,guile-3.0)
727 ("libgit2" ,libgit2)))
728 (propagated-inputs
729 `(("guile-bytestructures" ,guile-bytestructures)))
730 (synopsis "Guile bindings for libgit2")
731 (description
732 "This package provides Guile bindings to libgit2, a library to
733 manipulate repositories of the Git version control system.")
734 (license license:gpl3+)))
735
736 (define-public guile2.2-git
737 (package-for-guile-2.2 guile-git))
738
739 (define-public guile2.0-git
740 (let ((base (package-for-guile-2.0 guile-git)))
741 (package
742 (inherit base)
743 ;; Libgit2's Guile test driver requires (ice-9 textual-ports), which is
744 ;; not in Guile 2.0. Thus, keep LIBGIT2 as-is here (i.e., built against
745 ;; Guile 2.2).
746 (inputs `(("libgit2" ,libgit2)
747 ,@(srfi-1:alist-delete "libgit2"
748 (package-inputs base)))))))
749
750 (define-deprecated-guile3.0-package guile3.0-git)
751
752 ;;; guile.scm ends here
753