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