gnu: Add python-pyshp.
[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, 2021 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
273 (inherit 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
315 (inherit guile-3.0)
316 (version "3.0.7")
317 (source (origin
318 (inherit (package-source guile-3.0)) ;preserve snippet
319 (patches '())
320 (uri (string-append "mirror://gnu/guile/guile-"
321 version ".tar.xz"))
322 (sha256
323 (base32
324 "1dwiwsrpm4f96alfnz6wibq378242z4f16vsxgy1n9r00v3qczgm"))))
325
326 ;; Build with the bundled mini-GMP to avoid interference with GnuTLS' own
327 ;; use of GMP via Nettle: <https://issues.guix.gnu.org/46330>. Use
328 ;; LIBGC/DISABLE-MUNMAP to work around <https://bugs.gnu.org/40525>.
329 ;; Remove libltdl, which is no longer used.
330 (propagated-inputs
331 `(("bdw-gc" ,libgc/disable-munmap)
332 ,@(srfi-1:fold srfi-1:alist-delete (package-propagated-inputs guile-3.0)
333 '("gmp" "libltdl" "bdw-gc"))))
334 (arguments
335 (substitute-keyword-arguments (package-arguments guile-3.0)
336 ((#:configure-flags flags ''())
337 `(cons "--enable-mini-gmp" ,flags))))))
338
339 (define-public guile-3.0/libgc-7
340 ;; Using libgc-7 avoid crashes that can occur, particularly when loading
341 ;; data in to the Guix Data Service:
342 ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=40525
343 (hidden-package
344 (package
345 (inherit guile-3.0-latest)
346 (propagated-inputs
347 `(("bdw-gc" ,libgc-7)
348 ,@(srfi-1:alist-delete "bdw-gc" (package-propagated-inputs guile-3.0)))))))
349
350 (define-public guile-3.0/fixed
351 ;; A package of Guile that's rarely changed. It is the one used in the
352 ;; `base' module, and thus changing it entails a full rebuild.
353 (package
354 (inherit guile-3.0)
355 (properties '((hidden? . #t) ;people should install 'guile-2.2'
356 (timeout . 72000) ;20 hours
357 (max-silent-time . 36000))))) ;10 hours (needed on ARM
358 ; when heavily loaded)
359
360 (define-public guile-next
361 (let ((version "3.0.5")
362 (revision "0")
363 (commit "91547abf54d5e0795afda2781259ab8923eb527b"))
364 (package
365 (inherit guile-3.0)
366 (name "guile-next")
367 (version (git-version version revision commit))
368 (source (origin
369 ;; The main goal here is to allow for '--with-branch'.
370 (method git-fetch)
371 (uri (git-reference
372 (url "https://git.savannah.gnu.org/git/guile.git")
373 (commit commit)))
374 (file-name (git-file-name name version))
375 (sha256
376 (base32
377 "09i1c77h2shygylfk0av31jsc1my6zjl230b2cx6vyl58q8c0cqy"))))
378 (arguments
379 (substitute-keyword-arguments (package-arguments guile-3.0)
380 ((#:phases phases '%standard-phases)
381 `(modify-phases ,phases
382 (add-before 'check 'skip-failing-tests
383 (lambda _
384 (substitute* "test-suite/standalone/test-out-of-memory"
385 (("!#") "!#\n\n(exit 77)\n"))
386 (delete-file "test-suite/tests/version.test")
387 #t))))))
388 (native-inputs
389 `(("autoconf" ,autoconf)
390 ("automake" ,automake)
391 ("libtool" ,libtool)
392 ("flex" ,flex)
393 ("gettext" ,gnu-gettext)
394 ("texinfo" ,texinfo)
395 ("gperf" ,gperf)
396 ,@(package-native-inputs guile-3.0)))
397 (synopsis "Development version of GNU Guile"))))
398
399 (define* (make-guile-readline guile #:optional (name "guile-readline"))
400 (package
401 (name name)
402 (version (package-version guile))
403 (source (package-source guile))
404 (build-system gnu-build-system)
405 (arguments
406 '(#:configure-flags '("--disable-silent-rules")
407 #:phases (modify-phases %standard-phases
408 (add-before 'build 'chdir
409 (lambda* (#:key outputs #:allow-other-keys)
410 (invoke "make" "-C" "libguile" "scmconfig.h")
411 (invoke "make" "-C" "lib")
412 (chdir "guile-readline")
413
414 (substitute* "Makefile"
415 (("../libguile/libguile-[[:graph:]]+\\.la")
416 ;; Remove dependency on libguile-X.Y.la.
417 "")
418 (("^READLINE_LIBS = (.*)$" _ libs)
419 ;; Link against the provided libguile.
420 (string-append "READLINE_LIBS = "
421 "-lguile-$(GUILE_EFFECTIVE_VERSION) "
422 libs "\n"))
423 (("\\$\\(top_builddir\\)/meta/build-env")
424 ;; Use the provided Guile, not the one from
425 ;; $(builddir).
426 "")
427
428 ;; Install modules to the 'site' directories.
429 (("^moddir = .*$")
430 "moddir = $(pkgdatadir)/site/$(GUILE_EFFECTIVE_VERSION)\n")
431 (("^ccachedir = .*$")
432 "ccachedir = $(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/site-ccache\n"))
433
434 ;; Load 'guile-readline.so' from the right place.
435 (substitute* "ice-9/readline.scm"
436 (("load-extension \"guile-readline\"")
437 (format #f "load-extension \
438 (string-append ~s \"/lib/guile/\" (effective-version) \"/extensions/guile-readline\")"
439 (assoc-ref outputs "out"))))
440 #t)))))
441 (home-page (package-home-page guile))
442 (native-inputs (package-native-inputs guile))
443 (inputs
444 `(,@(package-inputs guile) ;to placate 'configure'
445 ,@(package-propagated-inputs guile)
446 ("guile" ,guile)
447 ("readline" ,readline)))
448 (synopsis "Line editing support for GNU Guile")
449 (description
450 "This module provides line editing support via the Readline library for
451 GNU@tie{}Guile. Use the @code{(ice-9 readline)} module and call its
452 @code{activate-readline} procedure to enable it.")
453 (license license:gpl3+)))
454
455 (define-public guile-readline
456 (make-guile-readline guile-3.0))
457
458 (define-public guile2.2-readline
459 (make-guile-readline guile-2.2 "guile2.2-readline"))
460
461 (define (guile-variant-package-name prefix)
462 (lambda (name)
463 "Return NAME with PREFIX instead of \"guile-\", when applicable."
464 (if (string-prefix? "guile-" name)
465 (string-append prefix "-"
466 (string-drop name
467 (string-length "guile-")))
468 name)))
469
470 (define package-for-guile-2.0
471 ;; A procedure that rewrites the dependency tree of the given package to use
472 ;; GUILE-2.0 instead of GUILE-3.0.
473 (package-input-rewriting `((,guile-3.0 . ,guile-2.0))
474 (guile-variant-package-name "guile2.0")
475 #:deep? #f))
476
477 (define package-for-guile-2.2
478 (package-input-rewriting `((,guile-3.0 . ,guile-2.2))
479 (guile-variant-package-name "guile2.2")
480 #:deep? #f))
481
482 (define-syntax define-deprecated-guile3.0-package
483 (lambda (s)
484 "Define a deprecated package alias for \"guile3.0-something\"."
485 (syntax-case s ()
486 ((_ name)
487 (and (identifier? #'name)
488 (string-prefix? "guile3.0-" (symbol->string (syntax->datum
489 #'name))))
490 (let ((->guile (lambda (str)
491 (let ((base (string-drop str
492 (string-length "guile3.0-"))))
493 (string-append "guile-" base)))))
494 (with-syntax ((package-name (symbol->string (syntax->datum #'name)))
495 (package
496 (datum->syntax
497 #'name
498 (string->symbol
499 (->guile (symbol->string (syntax->datum
500 #'name))))))
501 (old-name
502 ;; XXX: This is the name generated by
503 ;; 'define-deprecated'.
504 (datum->syntax
505 #'name
506 (symbol-append '% (syntax->datum #'name)
507 '/deprecated))))
508 #'(begin
509 (define-deprecated name package
510 (deprecated-package package-name package))
511 (export old-name))))))))
512
513 (define-deprecated-guile3.0-package guile3.0-readline)
514
515 (define-public guile-for-guile-emacs
516 (let ((commit "15ca78482ac0dd2e3eb36dcb31765d8652d7106d")
517 (revision "1"))
518 (package (inherit guile-2.2)
519 (name "guile-for-guile-emacs")
520 (version (git-version "2.1.2" revision commit))
521 (source (origin
522 (method git-fetch)
523 (uri (git-reference
524 (url "git://git.savannah.gnu.org/guile.git")
525 (commit commit)))
526 (file-name (git-file-name name version))
527 (sha256
528 (base32
529 "1l7ik4q4zk7vq4m3gnwizc0b64b1mdr31hxqlzxs94xaf2lvi7s2"))))
530 (arguments
531 (substitute-keyword-arguments (package-arguments guile-2.2)
532 ((#:phases phases '%standard-phases)
533 `(modify-phases ,phases
534 (replace 'bootstrap
535 (lambda _
536 ;; Disable broken tests.
537 ;; TODO: Fix them!
538 (substitute* "test-suite/tests/gc.test"
539 (("\\(pass-if \"after-gc-hook gets called\"" m)
540 (string-append "#;" m)))
541 (substitute* "test-suite/tests/version.test"
542 (("\\(pass-if \"version reporting works\"" m)
543 (string-append "#;" m)))
544 ;; Warning: Unwind-only `out-of-memory' exception; skipping pre-unwind handler.
545 ;; FAIL: test-out-of-memory
546 (substitute* "test-suite/standalone/Makefile.am"
547 (("(check_SCRIPTS|TESTS) \\+= test-out-of-memory") ""))
548
549 (patch-shebang "build-aux/git-version-gen")
550 (invoke "sh" "autogen.sh")
551 #t))))))
552 (native-inputs
553 `(("autoconf" ,autoconf)
554 ("automake" ,automake)
555 ("libtool" ,libtool)
556 ("flex" ,flex)
557 ("texinfo" ,texinfo)
558 ("gettext" ,gettext-minimal)
559 ,@(package-native-inputs guile-2.2))))))
560
561 \f
562 ;;;
563 ;;; Extensions.
564 ;;;
565
566 (define-public guile-json-1
567 (package
568 (name "guile-json")
569 (version "1.3.2")
570 (home-page "https://github.com/aconchillo/guile-json")
571 (source (origin
572 (method url-fetch)
573 (uri (string-append "mirror://savannah/guile-json/guile-json-"
574 version ".tar.gz"))
575 (sha256
576 (base32
577 "0m6yzb169r6iz56k3nkncjaiijwi4p0x9ijn1p5ax3s77jklxy9k"))))
578 (build-system gnu-build-system)
579 (arguments
580 `(#:make-flags '("GUILE_AUTO_COMPILE=0"))) ;to prevent guild warnings
581 (native-inputs `(("pkg-config" ,pkg-config)
582 ("guile" ,guile-2.2)))
583 (inputs `(("guile" ,guile-2.2)))
584 (synopsis "JSON module for Guile")
585 (description
586 "Guile-JSON supports parsing and building JSON documents according to the
587 specification. These are the main features:
588
589 @itemize
590 @item Strictly complies to @uref{http://json.org, specification}.
591 @item Build JSON documents programmatically via macros.
592 @item Unicode support for strings.
593 @item Allows JSON pretty printing.
594 @end itemize\n")
595
596 ;; Version 1.2.0 switched to GPLv3+ (from LGPLv3+).
597 (license license:gpl3+)))
598
599 ;; Deprecate the 'guile-json' alias to force the use 'guile-json-1' or
600 ;; 'guile-json-3'. In the future, we may reuse 'guile-json' as an alias for
601 ;; 'guile-json-3'.
602 (define-deprecated guile-json guile-json-1)
603 (export guile-json)
604
605 (define-public guile2.0-json
606 (package-for-guile-2.0 guile-json-1))
607
608 (define-public guile-json-3
609 ;; This version is incompatible with 1.x; see the 'NEWS' file.
610 (package
611 (inherit guile-json-1)
612 (name "guile-json")
613 (version "3.5.0")
614 (source (origin
615 (method url-fetch)
616 (uri (string-append "mirror://savannah/guile-json/guile-json-"
617 version ".tar.gz"))
618 (sha256
619 (base32
620 "0nj0684qgh6ppkbdyxqfyjwsv2qbyairxpi8fzrhsi3xnc7jn4im"))))
621 (native-inputs `(("pkg-config" ,pkg-config)
622 ("guile" ,guile-3.0)))
623 (inputs `(("guile" ,guile-3.0)))))
624
625 (define-public guile3.0-json
626 (deprecated-package "guile3.0-json" guile-json-3))
627
628 (define-public guile-json-4
629 (package
630 (inherit guile-json-3)
631 (name "guile-json")
632 (version "4.5.2")
633 (source (origin
634 (method url-fetch)
635 (uri (string-append "mirror://savannah/guile-json/guile-json-"
636 version ".tar.gz"))
637 (sha256
638 (base32
639 "0cqr0ljqmzlc2bwrapcsmcgxg147h66mcxf23824ri5i6vn4dc0s"))))))
640
641 (define-public guile2.2-json
642 (package-for-guile-2.2 guile-json-4))
643
644 ;; There are two guile-gdbm packages, one using the FFI and one with
645 ;; direct C bindings, hence the verbose name.
646
647 (define-public guile-gdbm-ffi
648 (package
649 (name "guile-gdbm-ffi")
650 (version "20120209.fa1d5b6")
651 (source (origin
652 (method git-fetch)
653 (uri (git-reference
654 (url "https://github.com/ijp/guile-gdbm")
655 (commit "fa1d5b6231d0e4d096687b378c025f2148c5f246")))
656 (file-name (string-append name "-" version "-checkout"))
657 (patches (search-patches
658 "guile-gdbm-ffi-support-gdbm-1.14.patch"))
659 (sha256
660 (base32
661 "1j8wrsw7v9w6qkl47xz0rdikg50v16nn6kbs3lgzcymjzpa7babj"))))
662 (build-system guile-build-system)
663 (arguments
664 '(#:phases (modify-phases %standard-phases
665 (add-after 'unpack 'move-examples
666 (lambda* (#:key outputs #:allow-other-keys)
667 ;; Move examples where they belong.
668 (let* ((out (assoc-ref outputs "out"))
669 (doc (string-append out "/share/doc/"
670 (strip-store-file-name out)
671 "/examples")))
672 (copy-recursively "examples" doc)
673 (delete-file-recursively "examples")
674 #t)))
675 (add-after 'unpack 'set-libgdbm-file-name
676 (lambda* (#:key inputs #:allow-other-keys)
677 (substitute* "gdbm.scm"
678 (("\\(dynamic-link \"libgdbm\"\\)")
679 (format #f "(dynamic-link \"~a/lib/libgdbm.so\")"
680 (assoc-ref inputs "gdbm"))))
681 #t)))))
682 (native-inputs
683 `(("guile" ,guile-3.0)))
684 (inputs
685 `(("gdbm" ,gdbm)))
686 (home-page "https://github.com/ijp/guile-gdbm")
687 (synopsis "Guile bindings to the GDBM library via Guile's FFI")
688 (description
689 "Guile bindings to the GDBM key-value storage system, using
690 Guile's foreign function interface.")
691 (license license:gpl3+)))
692
693 (define-public guile2.0-gdbm-ffi
694 (package-for-guile-2.0 guile-gdbm-ffi))
695
696 (define-public guile2.2-gdbm-ffi
697 (package-for-guile-2.2 guile-gdbm-ffi))
698
699 (define-deprecated-guile3.0-package guile3.0-gdbm-ffi)
700
701 (define-public guile-sqlite3
702 (package
703 (name "guile-sqlite3")
704 (version "0.1.2")
705 (home-page "https://notabug.org/guile-sqlite3/guile-sqlite3.git")
706 (source (origin
707 (method git-fetch)
708 (uri (git-reference
709 (url home-page)
710 (commit (string-append "v" version))))
711 (sha256
712 (base32
713 "1nryy9j3bk34i0alkmc9bmqsm0ayz92k1cdf752mvhyjjn8nr928"))
714 (file-name (string-append name "-" version "-checkout"))))
715 (build-system gnu-build-system)
716 (native-inputs
717 `(("autoconf" ,autoconf)
718 ("automake" ,automake)
719 ("guile" ,guile-3.0)
720 ("pkg-config" ,pkg-config)))
721 (inputs
722 `(("guile" ,guile-3.0)
723 ("sqlite" ,sqlite)))
724 (synopsis "Access SQLite databases from Guile")
725 (description
726 "This package provides Guile bindings to the SQLite database system.")
727 (license license:gpl3+)))
728
729 (define-public guile2.0-sqlite3
730 (package-for-guile-2.0 guile-sqlite3))
731
732 (define-public guile2.2-sqlite3
733 (package-for-guile-2.2 guile-sqlite3))
734
735 (define-deprecated-guile3.0-package guile3.0-sqlite3)
736
737 (define-public guile-bytestructures
738 (package
739 (name "guile-bytestructures")
740 (version "1.0.10")
741 (home-page "https://github.com/TaylanUB/scheme-bytestructures")
742 (source (origin
743 (method git-fetch)
744 (uri (git-reference
745 (url home-page)
746 (commit version)))
747 (file-name (git-file-name name version))
748 (sha256
749 (base32
750 "14k50jln32kkxv41hvsdgjkkfj6xlv06vc1caz01qkgk1fzh72nk"))))
751 (build-system gnu-build-system)
752 (arguments
753 `(#:make-flags '("GUILE_AUTO_COMPILE=0") ;to prevent guild warnings
754
755 #:phases (modify-phases %standard-phases
756 (add-after 'install 'install-doc
757 (lambda* (#:key outputs #:allow-other-keys)
758 (let* ((out (assoc-ref outputs "out"))
759 (package ,(package-full-name this-package "-"))
760 (doc (string-append out "/share/doc/" package)))
761 (install-file "README.md" doc)
762 #t))))))
763 (native-inputs
764 `(("autoconf" ,autoconf)
765 ("automake" ,automake)
766 ("pkg-config" ,pkg-config)
767 ("guile" ,guile-3.0)))
768 (inputs
769 `(("guile" ,guile-3.0)))
770 (synopsis "Structured access to bytevector contents for Guile")
771 (description
772 "Guile bytestructures offers a system imitating the type system
773 of the C programming language, to be used on bytevectors. C's type
774 system works on raw memory, and Guile works on bytevectors which are
775 an abstraction over raw memory. It's also more powerful than the C
776 type system, elevating types to first-class status.")
777 (license license:gpl3+)
778 (properties '((upstream-name . "bytestructures")))))
779
780 (define-public guile2.0-bytestructures
781 (package-for-guile-2.0 guile-bytestructures))
782
783 (define-public guile2.2-bytestructures
784 (package-for-guile-2.2 guile-bytestructures))
785
786 (define-deprecated-guile3.0-package guile3.0-bytestructures)
787
788 (define-public guile-git
789 (package
790 (name "guile-git")
791 (version "0.5.1")
792 (home-page "https://gitlab.com/guile-git/guile-git.git")
793 (source (origin
794 (method git-fetch)
795 (uri (git-reference
796 (url home-page)
797 (commit (string-append "v" version))))
798 (file-name (git-file-name name version))
799 (sha256
800 (base32
801 "1x3wa6la4j1wcfxyhhjlmd7yp85wwpny0y6lrzpz803i9z5fwagc"))))
802 (build-system gnu-build-system)
803 (arguments
804 `(#:make-flags '("GUILE_AUTO_COMPILE=0"))) ; to prevent guild warnings
805 (native-inputs
806 `(("pkg-config" ,pkg-config)
807 ("autoconf" ,autoconf)
808 ("automake" ,automake)
809 ("texinfo" ,texinfo)
810 ("guile" ,guile-3.0)
811 ("guile-bytestructures" ,guile-bytestructures)))
812 (inputs
813 `(("guile" ,guile-3.0)
814 ("libgit2" ,libgit2)))
815 (propagated-inputs
816 `(("guile-bytestructures" ,guile-bytestructures)))
817 (synopsis "Guile bindings for libgit2")
818 (description
819 "This package provides Guile bindings to libgit2, a library to
820 manipulate repositories of the Git version control system.")
821 (license license:gpl3+)))
822
823 (define-public guile2.2-git
824 (package-for-guile-2.2 guile-git))
825
826 (define-public guile2.0-git
827 (package-for-guile-2.0 guile-git))
828
829 (define-deprecated-guile3.0-package guile3.0-git)
830
831 (define-public guile-zlib
832 (package
833 (name "guile-zlib")
834 (version "0.1.0")
835 (source
836 (origin
837 ;; XXX: Do not use "git-fetch" method here that would create and
838 ;; endless inclusion loop, because this package is used as an extension
839 ;; in the same method.
840 (method url-fetch)
841 (uri
842 (string-append "https://notabug.org/guile-zlib/guile-zlib/archive/v"
843 version ".tar.gz"))
844 (file-name (string-append name "-" version ".tar.gz"))
845 (sha256
846 ;; content hash: 1ip18nzwnczqyhn9cpzxkm9vzpi5fz5sy96cgjhmp7cwhnkmv6zv
847 (base32
848 "1safz7rrbdf1d98x3lgx5v74kivpyf9n1v6pdyy22vd0f2sjdir5"))))
849 (build-system gnu-build-system)
850 (arguments
851 '(#:make-flags
852 '("GUILE_AUTO_COMPILE=0"))) ;to prevent guild warnings
853 (native-inputs
854 `(("autoconf" ,autoconf)
855 ("automake" ,automake)
856 ("pkg-config" ,pkg-config)
857 ,@(if (%current-target-system)
858 `(("guile" ,guile-3.0)) ;for 'guild compile' and 'guile-3.0.pc'
859 '())))
860 (inputs
861 `(("guile" ,guile-3.0)
862 ("zlib" ,zlib)))
863 (synopsis "Guile bindings to zlib")
864 (description
865 "This package provides Guile bindings for zlib, a lossless
866 data-compression library. The bindings are written in pure Scheme by using
867 Guile's foreign function interface.")
868 (home-page "https://notabug.org/guile-zlib/guile-zlib")
869 (license license:gpl3+)))
870
871 (define-public guile2.2-zlib
872 (package-for-guile-2.2 guile-zlib))
873
874 (define-public guile-lzlib
875 (package
876 (name "guile-lzlib")
877 (version "0.0.2")
878 (source
879 (origin
880 (method url-fetch)
881 (uri
882 (string-append "https://notabug.org/guile-lzlib/guile-lzlib/archive/"
883 version ".tar.gz"))
884 (file-name (string-append name "-" version ".tar.gz"))
885 (sha256
886 (base32
887 "11sggvncyx08ssp1s5xii4d6nskh1qwqihnbpzzvkrs7sivxn8w6"))))
888 (build-system gnu-build-system)
889 (arguments
890 '(#:make-flags
891 '("GUILE_AUTO_COMPILE=0"))) ;to prevent guild warnings
892 (native-inputs
893 `(("autoconf" ,autoconf)
894 ("automake" ,automake)
895 ("pkg-config" ,pkg-config)
896 ,@(if (%current-target-system)
897 `(("guile" ,guile-3.0)) ;for 'guild compile' and 'guile-3.0.pc'
898 '())))
899 (inputs
900 `(("guile" ,guile-3.0)
901 ("lzlib" ,lzlib)))
902 (synopsis "Guile bindings to lzlib")
903 (description
904 "This package provides Guile bindings for lzlib, a C library for
905 in-memory LZMA compression and decompression. The bindings are written in
906 pure Scheme by using Guile's foreign function interface.")
907 (home-page "https://notabug.org/guile-lzlib/guile-lzlib")
908 (license license:gpl3+)))
909
910 (define-public guile2.2-lzlib
911 (package-for-guile-2.2 guile-lzlib))
912
913 (define-public guile-zstd
914 (package
915 (name "guile-zstd")
916 (version "0.1.1")
917 (home-page "https://notabug.org/guile-zstd/guile-zstd")
918 (source (origin
919 (method git-fetch)
920 (uri (git-reference (url home-page)
921 (commit (string-append "v" version))))
922 (file-name (git-file-name name version))
923 (sha256
924 (base32
925 "1c8l7829b5yx8wdc0mrhzjfwb6h9hb7cd8dfxcr71a7vlsi86310"))))
926 (build-system gnu-build-system)
927 (native-inputs
928 `(("autoconf" ,autoconf)
929 ("automake" ,automake)
930 ("pkg-config" ,pkg-config)
931 ("guile" ,guile-3.0)))
932 (inputs
933 `(("zstd" ,zstd "lib")
934 ("guile" ,guile-3.0)))
935 (synopsis "GNU Guile bindings to the zstd compression library")
936 (description
937 "This package provides a GNU Guile interface to the zstd (``zstandard'')
938 compression library.")
939 (license license:gpl3+)))
940
941 ;;; guile.scm ends here