gnu: guile-git: Update to 0.5.1.
[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, 2021 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 ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
19 ;;;
20 ;;; This file is part of GNU Guix.
21 ;;;
22 ;;; GNU Guix is free software; you can redistribute it and/or modify it
23 ;;; under the terms of the GNU General Public License as published by
24 ;;; the Free Software Foundation; either version 3 of the License, or (at
25 ;;; your option) any later version.
26 ;;;
27 ;;; GNU Guix is distributed in the hope that it will be useful, but
28 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
29 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 ;;; GNU General Public License for more details.
31 ;;;
32 ;;; You should have received a copy of the GNU General Public License
33 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
34
35 (define-module (gnu packages guile)
36 #:use-module ((guix licenses) #:prefix license:)
37 #:use-module (gnu packages)
38 #:use-module (gnu packages autotools)
39 #:use-module (gnu packages base)
40 #:use-module (gnu packages bash)
41 #:use-module (gnu packages bdw-gc)
42 #:use-module (gnu packages compression)
43 #:use-module (gnu packages dbm)
44 #:use-module (gnu packages flex)
45 #:use-module (gnu packages gawk)
46 #:use-module (gnu packages gettext)
47 #:use-module (gnu packages gperf)
48 #:use-module (gnu packages hurd)
49 #:use-module (gnu packages libffi)
50 #:use-module (gnu packages libunistring)
51 #:use-module (gnu packages linux)
52 #:use-module (gnu packages m4)
53 #:use-module (gnu packages multiprecision)
54 #:use-module (gnu packages pkg-config)
55 #:use-module (gnu packages readline)
56 #:use-module (gnu packages sqlite)
57 #:use-module (gnu packages texinfo)
58 #:use-module (gnu packages version-control)
59 #:use-module (guix packages)
60 #:use-module (guix download)
61 #:use-module (guix git-download)
62 #:use-module (guix build-system gnu)
63 #:use-module (guix build-system guile)
64 #:use-module (guix deprecation)
65 #:use-module (guix utils)
66 #:use-module (ice-9 match)
67 #:use-module ((srfi srfi-1) #:prefix srfi-1:))
68
69 ;;; Commentary:
70 ;;;
71 ;;; GNU Guile, and modules and extensions.
72 ;;;
73 ;;; Code:
74
75 (define-public guile-1.8
76 (package
77 (name "guile")
78 (version "1.8.8")
79 (source (origin
80 (method url-fetch)
81 (uri (string-append "mirror://gnu/guile/guile-" version
82 ".tar.gz"))
83 (sha256
84 (base32
85 "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3"))
86 (patches (search-patches "guile-1.8-cpp-4.5.patch"))))
87 (build-system gnu-build-system)
88 (arguments '(#:configure-flags '("--disable-error-on-warning")
89
90 ;; Insert a phase before `configure' to patch things up.
91 #:phases
92 (modify-phases %standard-phases
93 (add-before 'configure 'patch-stuff
94 (lambda* (#:key outputs #:allow-other-keys)
95 ;; Add a call to `lt_dladdsearchdir' so that
96 ;; `libguile-readline.so' & co. are in the
97 ;; loader's search path.
98 (substitute* "libguile/dynl.c"
99 (("lt_dlinit.*$" match)
100 (format #f
101 " ~a~% lt_dladdsearchdir(\"~a/lib\");~%"
102 match
103 (assoc-ref outputs "out"))))
104
105 ;; The usual /bin/sh...
106 (substitute* "ice-9/popen.scm"
107 (("/bin/sh") (which "sh")))
108 #t)))))
109
110 ;; When cross-compiling, a native version of Guile itself is needed.
111 (native-inputs (if (%current-target-system)
112 `(("self" ,this-package))
113 '()))
114
115 (inputs `(("gawk" ,gawk)
116 ("readline" ,readline)))
117
118 ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be
119 ;; propagated.
120 (propagated-inputs `(("gmp" ,gmp)
121 ("libltdl" ,libltdl)))
122
123 (native-search-paths
124 (list (search-path-specification
125 (variable "GUILE_LOAD_PATH")
126 (files '("share/guile/site")))))
127
128 (synopsis "Scheme implementation intended especially for extensions")
129 (description
130 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
131 official extension language of the GNU system. It is an implementation of
132 the Scheme language which can be easily embedded in other applications to
133 provide a convenient means of extending the functionality of the application
134 without requiring the source code to be rewritten.")
135 (home-page "https://www.gnu.org/software/guile/")
136 (license license:lgpl2.0+)))
137
138 (define-public guile-2.0
139 (package
140 (name "guile")
141 (version "2.0.14")
142 (source (origin
143 (method url-fetch)
144 (uri (string-append "mirror://gnu/guile/guile-" version
145 ".tar.xz"))
146 (sha256
147 (base32
148 "10lxc6l5alf3lzbs3ihnbfy6dfcrsyf8667wa57f26vf4mk2ai78"))))
149 (build-system gnu-build-system)
150
151 ;; When cross-compiling, a native version of Guile itself is needed.
152 (native-inputs `(,@(if (%current-target-system)
153 `(("self" ,this-package))
154 '())
155 ("pkgconfig" ,pkg-config)))
156 (inputs `(("libffi" ,libffi)
157 ,@(libiconv-if-needed)
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)))))
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)
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)
173
174 ;; The headers and/or `guile-2.0.pc' refer to these packages, so they
175 ;; must be propagated.
176 ("bdw-gc" ,libgc)
177 ("gmp" ,gmp)))
178
179 (outputs '("out" "debug"))
180
181 (arguments
182 `(#:configure-flags '("--disable-static") ; saves 3 MiB
183 #:phases
184 (modify-phases %standard-phases
185 ,@(if (hurd-system?)
186 '((add-after 'unpack 'disable-tests
187 (lambda _
188 ;; Hangs at: "Running 00-repl-server.test"
189 (rename-file "test-suite/tests/00-repl-server.test" "00-repl-server.test")
190 ;; Sometimes Hangs at: "Running 00-socket.test"
191 (rename-file "test-suite/tests/00-socket.test" "00-socket.test")
192 ;; FAIL: srfi-18.test: thread-sleep!: thread sleeps fractions of a second
193 (rename-file "test-suite/tests/srfi-18.test" "srfi-18.test")
194 ;; failed to remove 't-guild-compile-7215.go.tdL7yC
195 (substitute* "test-suite/standalone/Makefile.in"
196 (("test-guild-compile ") ""))
197 #t)))
198 '())
199 (add-before 'configure 'pre-configure
200 (lambda* (#:key inputs #:allow-other-keys)
201 ;; Tell (ice-9 popen) the file name of Bash.
202 (let ((bash (assoc-ref inputs "bash")))
203 (substitute* "module/ice-9/popen.scm"
204 ;; If bash is #f allow fallback for user to provide
205 ;; "bash" in PATH. This happens when cross-building to
206 ;; MinGW for which we do not have Bash yet.
207 (("/bin/sh")
208 ,@(if (target-mingw?)
209 '((if bash
210 (string-append bash "/bin/bash")
211 "bash"))
212 '((string-append bash "/bin/bash")))))
213 #t))))))
214
215 (native-search-paths
216 (list (search-path-specification
217 (variable "GUILE_LOAD_PATH")
218 (files '("share/guile/site/2.0")))
219 (search-path-specification
220 (variable "GUILE_LOAD_COMPILED_PATH")
221 (files '("lib/guile/2.0/site-ccache")))))
222
223 (synopsis "Scheme implementation intended especially for extensions")
224 (description
225 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
226 official extension language of the GNU system. It is an implementation of
227 the Scheme language which can be easily embedded in other applications to
228 provide a convenient means of extending the functionality of the application
229 without requiring the source code to be rewritten.")
230 (home-page "https://www.gnu.org/software/guile/")
231 (license license:lgpl3+)))
232
233 (define-public guile-2.2
234 (package (inherit guile-2.0)
235 (name "guile")
236 (version "2.2.7")
237 (source (origin
238 (method url-fetch)
239
240 ;; Note: we are limited to one of the compression formats
241 ;; supported by the bootstrap binaries, so no lzip here.
242 (uri (string-append "mirror://gnu/guile/guile-" version
243 ".tar.xz"))
244 (sha256
245 (base32
246 "013mydzhfswqci6xmyc1ajzd59pfbdak15i0b090nhr9bzm7dxyd"))
247 (modules '((guix build utils)))
248 (patches (search-patches
249 "guile-2.2-skip-oom-test.patch"))
250
251 ;; Remove the pre-built object files. Instead, build everything
252 ;; from source, at the expense of significantly longer build
253 ;; times (almost 3 hours on a 4-core Intel i5).
254 (snippet '(begin
255 (for-each delete-file
256 (find-files "prebuilt" "\\.go$"))
257 #t))))
258 (properties '((timeout . 72000) ;20 hours
259 (max-silent-time . 36000))) ;10 hours (needed on ARM
260 ; when heavily loaded)
261 (native-search-paths
262 (list (search-path-specification
263 (variable "GUILE_LOAD_PATH")
264 (files '("share/guile/site/2.2")))
265 (search-path-specification
266 (variable "GUILE_LOAD_COMPILED_PATH")
267 (files '("lib/guile/2.2/site-ccache")))))))
268
269 (define-deprecated guile-2.2/bug-fix guile-2.2)
270
271 (define-public guile-2.2.4
272 (package/inherit
273 guile-2.2
274 (version "2.2.4")
275 (source (origin
276 (inherit (package-source guile-2.2))
277 (uri (string-append "mirror://gnu/guile/guile-" version
278 ".tar.xz"))
279 (sha256
280 (base32
281 "07p3g0v2ba2vlfbfidqzlgbhnzdx46wh2rgc5gszq1mjyx5bks6r"))))))
282
283 (define-public guile-3.0
284 ;; This is the latest Guile stable version.
285 (package
286 (inherit guile-2.2)
287 (name "guile")
288 (version "3.0.2")
289 (source (origin
290 (inherit (package-source guile-2.2))
291 (uri (string-append "mirror://gnu/guile/guile-"
292 version ".tar.xz"))
293 (sha256
294 (base32
295 "12lziar4j27j9whqp2n18427q45y9ghq7gdd8lqhmj1k0lr7vi2k"))))
296 (arguments
297 ;; XXX: JIT-enabled Guile crashes in obscure ways on GNU/Hurd.
298 (if (hurd-target?)
299 (substitute-keyword-arguments (package-arguments guile-2.2)
300 ((#:configure-flags flags ''())
301 `(cons "--disable-jit" ,flags)))
302 (package-arguments guile-2.2)))
303 (native-search-paths
304 (list (search-path-specification
305 (variable "GUILE_LOAD_PATH")
306 (files '("share/guile/site/3.0")))
307 (search-path-specification
308 (variable "GUILE_LOAD_COMPILED_PATH")
309 (files '("lib/guile/3.0/site-ccache"
310 "share/guile/site/3.0")))))))
311
312 (define-public guile-3.0-latest
313 ;; TODO: Make this 'guile-3.0' on the next rebuild cycle.
314 (package-with-extra-patches
315 (package
316 (inherit guile-3.0)
317 (version "3.0.5")
318 (source (origin
319 (inherit (package-source guile-3.0))
320 (uri (string-append "mirror://gnu/guile/guile-"
321 version ".tar.xz"))
322 (sha256
323 (base32
324 "1wah6fq1h8vmbpdadjych1mq8hyqkd7p015cbxm14ri37l1gnxid")))))
325 ;; Remove on the next rebuild cycle.
326 (search-patches "guile-2.2-skip-so-test.patch")))
327
328 (define-public guile-3.0/libgc-7
329 ;; Using libgc-7 avoid crashes that can occur, particularly when loading
330 ;; data in to the Guix Data Service:
331 ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=40525
332 (hidden-package
333 (package
334 (inherit guile-3.0-latest)
335 (propagated-inputs
336 `(("bdw-gc" ,libgc-7)
337 ,@(srfi-1:alist-delete "bdw-gc" (package-propagated-inputs guile-3.0)))))))
338
339 (define-public guile-3.0/fixed
340 ;; A package of Guile that's rarely changed. It is the one used in the
341 ;; `base' module, and thus changing it entails a full rebuild.
342 (package
343 (inherit guile-3.0)
344 (properties '((hidden? . #t) ;people should install 'guile-2.2'
345 (timeout . 72000) ;20 hours
346 (max-silent-time . 36000))))) ;10 hours (needed on ARM
347 ; when heavily loaded)
348
349 (define-public guile-next
350 (let ((version "3.0.5")
351 (revision "0")
352 (commit "91547abf54d5e0795afda2781259ab8923eb527b"))
353 (package
354 (inherit guile-3.0)
355 (name "guile-next")
356 (version (git-version version revision commit))
357 (source (origin
358 ;; The main goal here is to allow for '--with-branch'.
359 (method git-fetch)
360 (uri (git-reference
361 (url "https://git.savannah.gnu.org/git/guile.git")
362 (commit commit)))
363 (sha256
364 (base32
365 "09i1c77h2shygylfk0av31jsc1my6zjl230b2cx6vyl58q8c0cqy"))))
366 (arguments
367 (substitute-keyword-arguments (package-arguments guile-3.0)
368 ((#:phases phases '%standard-phases)
369 `(modify-phases ,phases
370 (add-before 'check 'skip-failing-tests
371 (lambda _
372 (substitute* "test-suite/standalone/test-out-of-memory"
373 (("!#") "!#\n\n(exit 77)\n"))
374 (delete-file "test-suite/tests/version.test")
375 #t))))))
376 (native-inputs
377 `(("autoconf" ,autoconf)
378 ("automake" ,automake)
379 ("libtool" ,libtool)
380 ("flex" ,flex)
381 ("gettext" ,gnu-gettext)
382 ("texinfo" ,texinfo)
383 ("gperf" ,gperf)
384 ,@(package-native-inputs guile-3.0)))
385 (synopsis "Development version of GNU Guile"))))
386
387 (define* (make-guile-readline guile #:optional (name "guile-readline"))
388 (package
389 (name name)
390 (version (package-version guile))
391 (source (package-source guile))
392 (build-system gnu-build-system)
393 (arguments
394 '(#:configure-flags '("--disable-silent-rules")
395 #:phases (modify-phases %standard-phases
396 (add-before 'build 'chdir
397 (lambda* (#:key outputs #:allow-other-keys)
398 (invoke "make" "-C" "libguile" "scmconfig.h")
399 (invoke "make" "-C" "lib")
400 (chdir "guile-readline")
401
402 (substitute* "Makefile"
403 (("../libguile/libguile-[[:graph:]]+\\.la")
404 ;; Remove dependency on libguile-X.Y.la.
405 "")
406 (("^READLINE_LIBS = (.*)$" _ libs)
407 ;; Link against the provided libguile.
408 (string-append "READLINE_LIBS = "
409 "-lguile-$(GUILE_EFFECTIVE_VERSION) "
410 libs "\n"))
411 (("\\$\\(top_builddir\\)/meta/build-env")
412 ;; Use the provided Guile, not the one from
413 ;; $(builddir).
414 "")
415
416 ;; Install modules to the 'site' directories.
417 (("^moddir = .*$")
418 "moddir = $(pkgdatadir)/site/$(GUILE_EFFECTIVE_VERSION)\n")
419 (("^ccachedir = .*$")
420 "ccachedir = $(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/site-ccache\n"))
421
422 ;; Load 'guile-readline.so' from the right place.
423 (substitute* "ice-9/readline.scm"
424 (("load-extension \"guile-readline\"")
425 (format #f "load-extension \
426 (string-append ~s \"/lib/guile/\" (effective-version) \"/extensions/guile-readline\")"
427 (assoc-ref outputs "out"))))
428 #t)))))
429 (home-page (package-home-page guile))
430 (native-inputs (package-native-inputs guile))
431 (inputs
432 `(,@(package-inputs guile) ;to placate 'configure'
433 ,@(package-propagated-inputs guile)
434 ("guile" ,guile)
435 ("readline" ,readline)))
436 (synopsis "Line editing support for GNU Guile")
437 (description
438 "This module provides line editing support via the Readline library for
439 GNU@tie{}Guile. Use the @code{(ice-9 readline)} module and call its
440 @code{activate-readline} procedure to enable it.")
441 (license license:gpl3+)))
442
443 (define-public guile-readline
444 (make-guile-readline guile-3.0))
445
446 (define-public guile2.2-readline
447 (make-guile-readline guile-2.2 "guile2.2-readline"))
448
449 (define (guile-variant-package-name prefix)
450 (lambda (name)
451 "Return NAME with PREFIX instead of \"guile-\", when applicable."
452 (if (string-prefix? "guile-" name)
453 (string-append prefix "-"
454 (string-drop name
455 (string-length "guile-")))
456 name)))
457
458 (define package-for-guile-2.0
459 ;; A procedure that rewrites the dependency tree of the given package to use
460 ;; GUILE-2.0 instead of GUILE-3.0.
461 (package-input-rewriting `((,guile-3.0 . ,guile-2.0))
462 (guile-variant-package-name "guile2.0")
463 #:deep? #f))
464
465 (define package-for-guile-2.2
466 (package-input-rewriting `((,guile-3.0 . ,guile-2.2))
467 (guile-variant-package-name "guile2.2")
468 #:deep? #f))
469
470 (define-syntax define-deprecated-guile3.0-package
471 (lambda (s)
472 "Define a deprecated package alias for \"guile3.0-something\"."
473 (syntax-case s ()
474 ((_ name)
475 (and (identifier? #'name)
476 (string-prefix? "guile3.0-" (symbol->string (syntax->datum
477 #'name))))
478 (let ((->guile (lambda (str)
479 (let ((base (string-drop str
480 (string-length "guile3.0-"))))
481 (string-append "guile-" base)))))
482 (with-syntax ((package-name (symbol->string (syntax->datum #'name)))
483 (package
484 (datum->syntax
485 #'name
486 (string->symbol
487 (->guile (symbol->string (syntax->datum
488 #'name))))))
489 (old-name
490 ;; XXX: This is the name generated by
491 ;; 'define-deprecated'.
492 (datum->syntax
493 #'name
494 (symbol-append '% (syntax->datum #'name)
495 '/deprecated))))
496 #'(begin
497 (define-deprecated name package
498 (deprecated-package package-name package))
499 (export old-name))))))))
500
501 (define-deprecated-guile3.0-package guile3.0-readline)
502
503 (define-public guile-for-guile-emacs
504 (let ((commit "15ca78482ac0dd2e3eb36dcb31765d8652d7106d")
505 (revision "1"))
506 (package (inherit guile-2.2)
507 (name "guile-for-guile-emacs")
508 (version (git-version "2.1.2" revision commit))
509 (source (origin
510 (method git-fetch)
511 (uri (git-reference
512 (url "git://git.savannah.gnu.org/guile.git")
513 (commit commit)))
514 (file-name (git-file-name name version))
515 (sha256
516 (base32
517 "1l7ik4q4zk7vq4m3gnwizc0b64b1mdr31hxqlzxs94xaf2lvi7s2"))))
518 (arguments
519 (substitute-keyword-arguments (package-arguments guile-2.2)
520 ((#:phases phases '%standard-phases)
521 `(modify-phases ,phases
522 (replace 'bootstrap
523 (lambda _
524 ;; Disable broken tests.
525 ;; TODO: Fix them!
526 (substitute* "test-suite/tests/gc.test"
527 (("\\(pass-if \"after-gc-hook gets called\"" m)
528 (string-append "#;" m)))
529 (substitute* "test-suite/tests/version.test"
530 (("\\(pass-if \"version reporting works\"" m)
531 (string-append "#;" m)))
532 ;; Warning: Unwind-only `out-of-memory' exception; skipping pre-unwind handler.
533 ;; FAIL: test-out-of-memory
534 (substitute* "test-suite/standalone/Makefile.am"
535 (("(check_SCRIPTS|TESTS) \\+= test-out-of-memory") ""))
536
537 (patch-shebang "build-aux/git-version-gen")
538 (invoke "sh" "autogen.sh")
539 #t))))))
540 (native-inputs
541 `(("autoconf" ,autoconf)
542 ("automake" ,automake)
543 ("libtool" ,libtool)
544 ("flex" ,flex)
545 ("texinfo" ,texinfo)
546 ("gettext" ,gettext-minimal)
547 ,@(package-native-inputs guile-2.2))))))
548
549 \f
550 ;;;
551 ;;; Extensions.
552 ;;;
553
554 (define-public guile-json-1
555 (package
556 (name "guile-json")
557 (version "1.3.2")
558 (home-page "https://github.com/aconchillo/guile-json")
559 (source (origin
560 (method url-fetch)
561 (uri (string-append "mirror://savannah/guile-json/guile-json-"
562 version ".tar.gz"))
563 (sha256
564 (base32
565 "0m6yzb169r6iz56k3nkncjaiijwi4p0x9ijn1p5ax3s77jklxy9k"))))
566 (build-system gnu-build-system)
567 (arguments
568 `(#:make-flags '("GUILE_AUTO_COMPILE=0"))) ;to prevent guild warnings
569 (native-inputs `(("pkg-config" ,pkg-config)
570 ("guile" ,guile-2.2)))
571 (inputs `(("guile" ,guile-2.2)))
572 (synopsis "JSON module for Guile")
573 (description
574 "Guile-JSON supports parsing and building JSON documents according to the
575 specification. These are the main features:
576
577 @itemize
578 @item Strictly complies to @uref{http://json.org, specification}.
579 @item Build JSON documents programmatically via macros.
580 @item Unicode support for strings.
581 @item Allows JSON pretty printing.
582 @end itemize\n")
583
584 ;; Version 1.2.0 switched to GPLv3+ (from LGPLv3+).
585 (license license:gpl3+)))
586
587 ;; Deprecate the 'guile-json' alias to force the use 'guile-json-1' or
588 ;; 'guile-json-3'. In the future, we may reuse 'guile-json' as an alias for
589 ;; 'guile-json-3'.
590 (define-deprecated guile-json guile-json-1)
591 (export guile-json)
592
593 (define-public guile2.0-json
594 (package-for-guile-2.0 guile-json-1))
595
596 (define-public guile-json-3
597 ;; This version is incompatible with 1.x; see the 'NEWS' file.
598 (package
599 (inherit guile-json-1)
600 (name "guile-json")
601 (version "3.5.0")
602 (source (origin
603 (method url-fetch)
604 (uri (string-append "mirror://savannah/guile-json/guile-json-"
605 version ".tar.gz"))
606 (sha256
607 (base32
608 "0nj0684qgh6ppkbdyxqfyjwsv2qbyairxpi8fzrhsi3xnc7jn4im"))))
609 (native-inputs `(("pkg-config" ,pkg-config)
610 ("guile" ,guile-3.0)))
611 (inputs `(("guile" ,guile-3.0)))))
612
613 (define-public guile3.0-json
614 (deprecated-package "guile3.0-json" guile-json-3))
615
616 (define-public guile-json-4
617 (package
618 (inherit guile-json-3)
619 (name "guile-json")
620 (version "4.5.2")
621 (source (origin
622 (method url-fetch)
623 (uri (string-append "mirror://savannah/guile-json/guile-json-"
624 version ".tar.gz"))
625 (sha256
626 (base32
627 "0cqr0ljqmzlc2bwrapcsmcgxg147h66mcxf23824ri5i6vn4dc0s"))))))
628
629 (define-public guile2.2-json
630 (package-for-guile-2.2 guile-json-4))
631
632 ;; There are two guile-gdbm packages, one using the FFI and one with
633 ;; direct C bindings, hence the verbose name.
634
635 (define-public guile-gdbm-ffi
636 (package
637 (name "guile-gdbm-ffi")
638 (version "20120209.fa1d5b6")
639 (source (origin
640 (method git-fetch)
641 (uri (git-reference
642 (url "https://github.com/ijp/guile-gdbm")
643 (commit "fa1d5b6231d0e4d096687b378c025f2148c5f246")))
644 (file-name (string-append name "-" version "-checkout"))
645 (patches (search-patches
646 "guile-gdbm-ffi-support-gdbm-1.14.patch"))
647 (sha256
648 (base32
649 "1j8wrsw7v9w6qkl47xz0rdikg50v16nn6kbs3lgzcymjzpa7babj"))))
650 (build-system guile-build-system)
651 (arguments
652 '(#:phases (modify-phases %standard-phases
653 (add-after 'unpack 'move-examples
654 (lambda* (#:key outputs #:allow-other-keys)
655 ;; Move examples where they belong.
656 (let* ((out (assoc-ref outputs "out"))
657 (doc (string-append out "/share/doc/"
658 (strip-store-file-name out)
659 "/examples")))
660 (copy-recursively "examples" doc)
661 (delete-file-recursively "examples")
662 #t)))
663 (add-after 'unpack 'set-libgdbm-file-name
664 (lambda* (#:key inputs #:allow-other-keys)
665 (substitute* "gdbm.scm"
666 (("\\(dynamic-link \"libgdbm\"\\)")
667 (format #f "(dynamic-link \"~a/lib/libgdbm.so\")"
668 (assoc-ref inputs "gdbm"))))
669 #t)))))
670 (native-inputs
671 `(("guile" ,guile-3.0)))
672 (inputs
673 `(("gdbm" ,gdbm)))
674 (home-page "https://github.com/ijp/guile-gdbm")
675 (synopsis "Guile bindings to the GDBM library via Guile's FFI")
676 (description
677 "Guile bindings to the GDBM key-value storage system, using
678 Guile's foreign function interface.")
679 (license license:gpl3+)))
680
681 (define-public guile2.0-gdbm-ffi
682 (package-for-guile-2.0 guile-gdbm-ffi))
683
684 (define-public guile2.2-gdbm-ffi
685 (package-for-guile-2.2 guile-gdbm-ffi))
686
687 (define-deprecated-guile3.0-package guile3.0-gdbm-ffi)
688
689 (define-public guile-sqlite3
690 (package
691 (name "guile-sqlite3")
692 (version "0.1.2")
693 (home-page "https://notabug.org/guile-sqlite3/guile-sqlite3.git")
694 (source (origin
695 (method git-fetch)
696 (uri (git-reference
697 (url home-page)
698 (commit (string-append "v" version))))
699 (sha256
700 (base32
701 "1nryy9j3bk34i0alkmc9bmqsm0ayz92k1cdf752mvhyjjn8nr928"))
702 (file-name (string-append name "-" version "-checkout"))))
703 (build-system gnu-build-system)
704 (native-inputs
705 `(("autoconf" ,autoconf)
706 ("automake" ,automake)
707 ("guile" ,guile-3.0)
708 ("pkg-config" ,pkg-config)))
709 (inputs
710 `(("guile" ,guile-3.0)
711 ("sqlite" ,sqlite)))
712 (synopsis "Access SQLite databases from Guile")
713 (description
714 "This package provides Guile bindings to the SQLite database system.")
715 (license license:gpl3+)))
716
717 (define-public guile2.0-sqlite3
718 (package-for-guile-2.0 guile-sqlite3))
719
720 (define-public guile2.2-sqlite3
721 (package-for-guile-2.2 guile-sqlite3))
722
723 (define-deprecated-guile3.0-package guile3.0-sqlite3)
724
725 (define-public guile-bytestructures
726 (package
727 (name "guile-bytestructures")
728 (version "1.0.10")
729 (home-page "https://github.com/TaylanUB/scheme-bytestructures")
730 (source (origin
731 (method git-fetch)
732 (uri (git-reference
733 (url home-page)
734 (commit version)))
735 (file-name (git-file-name name version))
736 (sha256
737 (base32
738 "14k50jln32kkxv41hvsdgjkkfj6xlv06vc1caz01qkgk1fzh72nk"))))
739 (build-system gnu-build-system)
740 (arguments
741 `(#:make-flags '("GUILE_AUTO_COMPILE=0") ;to prevent guild warnings
742
743 #:phases (modify-phases %standard-phases
744 (add-after 'install 'install-doc
745 (lambda* (#:key outputs #:allow-other-keys)
746 (let* ((out (assoc-ref outputs "out"))
747 (package ,(package-full-name this-package "-"))
748 (doc (string-append out "/share/doc/" package)))
749 (install-file "README.md" doc)
750 #t))))))
751 (native-inputs
752 `(("autoconf" ,autoconf)
753 ("automake" ,automake)
754 ("pkg-config" ,pkg-config)
755 ("guile" ,guile-3.0)))
756 (inputs
757 `(("guile" ,guile-3.0)))
758 (synopsis "Structured access to bytevector contents for Guile")
759 (description
760 "Guile bytestructures offers a system imitating the type system
761 of the C programming language, to be used on bytevectors. C's type
762 system works on raw memory, and Guile works on bytevectors which are
763 an abstraction over raw memory. It's also more powerful than the C
764 type system, elevating types to first-class status.")
765 (license license:gpl3+)
766 (properties '((upstream-name . "bytestructures")))))
767
768 (define-public guile2.0-bytestructures
769 (package-for-guile-2.0 guile-bytestructures))
770
771 (define-public guile2.2-bytestructures
772 (package-for-guile-2.2 guile-bytestructures))
773
774 (define-deprecated-guile3.0-package guile3.0-bytestructures)
775
776 (define-public guile-git
777 (package
778 (name "guile-git")
779 (version "0.5.1")
780 (home-page "https://gitlab.com/guile-git/guile-git.git")
781 (source (origin
782 (method git-fetch)
783 (uri (git-reference
784 (url home-page)
785 (commit (string-append "v" version))))
786 (file-name (git-file-name name version))
787 (sha256
788 (base32
789 "1x3wa6la4j1wcfxyhhjlmd7yp85wwpny0y6lrzpz803i9z5fwagc"))))
790 (build-system gnu-build-system)
791 (arguments
792 `(#:make-flags '("GUILE_AUTO_COMPILE=0"))) ; to prevent guild warnings
793 (native-inputs
794 `(("pkg-config" ,pkg-config)
795 ("autoconf" ,autoconf)
796 ("automake" ,automake)
797 ("texinfo" ,texinfo)
798 ("guile" ,guile-3.0)
799 ("guile-bytestructures" ,guile-bytestructures)))
800 (inputs
801 `(("guile" ,guile-3.0)
802 ("libgit2" ,libgit2)))
803 (propagated-inputs
804 `(("guile-bytestructures" ,guile-bytestructures)))
805 (synopsis "Guile bindings for libgit2")
806 (description
807 "This package provides Guile bindings to libgit2, a library to
808 manipulate repositories of the Git version control system.")
809 (license license:gpl3+)))
810
811 (define-public guile2.2-git
812 (package-for-guile-2.2 guile-git))
813
814 (define-public guile2.0-git
815 (package-for-guile-2.0 guile-git))
816
817 (define-deprecated-guile3.0-package guile3.0-git)
818
819 (define-public guile-zlib
820 (package
821 (name "guile-zlib")
822 (version "0.1.0")
823 (source
824 (origin
825 ;; XXX: Do not use "git-fetch" method here that would create and
826 ;; endless inclusion loop, because this package is used as an extension
827 ;; in the same method.
828 (method url-fetch)
829 (uri
830 (string-append "https://notabug.org/guile-zlib/guile-zlib/archive/v"
831 version ".tar.gz"))
832 (file-name (string-append name "-" version ".tar.gz"))
833 (sha256
834 ;; content hash: 1ip18nzwnczqyhn9cpzxkm9vzpi5fz5sy96cgjhmp7cwhnkmv6zv
835 (base32
836 "1safz7rrbdf1d98x3lgx5v74kivpyf9n1v6pdyy22vd0f2sjdir5"))))
837 (build-system gnu-build-system)
838 (arguments
839 '(#:make-flags
840 '("GUILE_AUTO_COMPILE=0"))) ;to prevent guild warnings
841 (native-inputs
842 `(("autoconf" ,autoconf)
843 ("automake" ,automake)
844 ("pkg-config" ,pkg-config)
845 ,@(if (%current-target-system)
846 `(("guile" ,guile-3.0)) ;for 'guild compile' and 'guile-3.0.pc'
847 '())))
848 (inputs
849 `(("guile" ,guile-3.0)
850 ("zlib" ,zlib)))
851 (synopsis "Guile bindings to zlib")
852 (description
853 "This package provides Guile bindings for zlib, a lossless
854 data-compression library. The bindings are written in pure Scheme by using
855 Guile's foreign function interface.")
856 (home-page "https://notabug.org/guile-zlib/guile-zlib")
857 (license license:gpl3+)))
858
859 (define-public guile-lzlib
860 (package
861 (name "guile-lzlib")
862 (version "0.0.2")
863 (source
864 (origin
865 (method url-fetch)
866 (uri
867 (string-append "https://notabug.org/guile-lzlib/guile-lzlib/archive/"
868 version ".tar.gz"))
869 (file-name (string-append name "-" version ".tar.gz"))
870 (sha256
871 (base32
872 "11sggvncyx08ssp1s5xii4d6nskh1qwqihnbpzzvkrs7sivxn8w6"))))
873 (build-system gnu-build-system)
874 (arguments
875 '(#:make-flags
876 '("GUILE_AUTO_COMPILE=0"))) ;to prevent guild warnings
877 (native-inputs
878 `(("autoconf" ,autoconf)
879 ("automake" ,automake)
880 ("pkg-config" ,pkg-config)
881 ,@(if (%current-target-system)
882 `(("guile" ,guile-3.0)) ;for 'guild compile' and 'guile-3.0.pc'
883 '())))
884 (inputs
885 `(("guile" ,guile-3.0)
886 ("lzlib" ,lzlib)))
887 (synopsis "Guile bindings to lzlib")
888 (description
889 "This package provides Guile bindings for lzlib, a C library for
890 in-memory LZMA compression and decompression. The bindings are written in
891 pure Scheme by using Guile's foreign function interface.")
892 (home-page "https://notabug.org/guile-lzlib/guile-lzlib")
893 (license license:gpl3+)))
894
895 (define-public guile-zstd
896 (package
897 (name "guile-zstd")
898 (version "0.1.1")
899 (home-page "https://notabug.org/guile-zstd/guile-zstd")
900 (source (origin
901 (method git-fetch)
902 (uri (git-reference (url home-page)
903 (commit (string-append "v" version))))
904 (file-name (git-file-name name version))
905 (sha256
906 (base32
907 "1c8l7829b5yx8wdc0mrhzjfwb6h9hb7cd8dfxcr71a7vlsi86310"))))
908 (build-system gnu-build-system)
909 (native-inputs
910 `(("autoconf" ,autoconf)
911 ("automake" ,automake)
912 ("pkg-config" ,pkg-config)
913 ("guile" ,guile-3.0)))
914 (inputs
915 `(("zstd" ,zstd "lib")
916 ("guile" ,guile-3.0)))
917 (synopsis "GNU Guile bindings to the zstd compression library")
918 (description
919 "This package provides a GNU Guile interface to the zstd (``zstandard'')
920 compression library.")
921 (license license:gpl3+)))
922
923 ;;; guile.scm ends here