gnu: python2-testpath: Remove package.
[jackhill/guix/guix.git] / gnu / packages / guile.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
973c6f18 2;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
0791437f
RW
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>
c5793e7e 6;;; Copyright © 2015, 2017 Christopher Allan Webber <cwebber@dustycloud.org>
c5793e7e 7;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
0791437f 8;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
a71d3358 9;;; Copyright © 2016, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
aaf1bdc3 10;;; Copyright © 2017 Andy Wingo <wingo@igalia.com>
0791437f 11;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
e53bf62e 12;;; Copyright © 2017, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
0791437f
RW
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>
c8e3651a 16;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org>
0791437f 17;;; Copyright © 2019 Taylan Kammer <taylan.kammer@gmail.com>
2bbbf673 18;;; Copyright © 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
1722d680 19;;;
233e7676 20;;; This file is part of GNU Guix.
1722d680 21;;;
233e7676 22;;; GNU Guix is free software; you can redistribute it and/or modify it
1722d680
LC
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;;;
233e7676 27;;; GNU Guix is distributed in the hope that it will be useful, but
1722d680
LC
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
233e7676 33;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
1722d680 34
1ffa7090 35(define-module (gnu packages guile)
71e0f217 36 #:use-module ((guix licenses) #:prefix license:)
59a43334 37 #:use-module (gnu packages)
146c6b62
RW
38 #:use-module (gnu packages autotools)
39 #:use-module (gnu packages base)
9c782445 40 #:use-module (gnu packages bash)
1ffa7090 41 #:use-module (gnu packages bdw-gc)
148585c2 42 #:use-module (gnu packages compression)
255d1bbe 43 #:use-module (gnu packages dbm)
146c6b62 44 #:use-module (gnu packages flex)
1ffa7090 45 #:use-module (gnu packages gawk)
146c6b62 46 #:use-module (gnu packages gettext)
973c6f18 47 #:use-module (gnu packages gperf)
ee8ee748 48 #:use-module (gnu packages hurd)
1ffa7090 49 #:use-module (gnu packages libffi)
1ffa7090 50 #:use-module (gnu packages libunistring)
7119cca8 51 #:use-module (gnu packages linux)
1ffa7090
LC
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)
cd0322a3 56 #:use-module (gnu packages sqlite)
f906d30c 57 #:use-module (gnu packages texinfo)
bd233722 58 #:use-module (gnu packages version-control)
1722d680 59 #:use-module (guix packages)
87f5d366 60 #:use-module (guix download)
6bc24063 61 #:use-module (guix git-download)
32795fcf 62 #:use-module (guix build-system gnu)
977d8666 63 #:use-module (guix build-system guile)
84af1e74 64 #:use-module (guix deprecation)
32795fcf 65 #:use-module (guix utils)
d4660a54
MC
66 #:use-module (ice-9 match)
67 #:use-module ((srfi srfi-1) #:prefix srfi-1:))
1722d680
LC
68
69;;; Commentary:
70;;;
c44899a2 71;;; GNU Guile, and modules and extensions.
1722d680
LC
72;;;
73;;; Code:
74
c44899a2
LC
75(define-public guile-1.8
76 (package
77 (name "guile")
78 (version "1.8.8")
79 (source (origin
87f5d366 80 (method url-fetch)
0db342a5 81 (uri (string-append "mirror://gnu/guile/guile-" version
c44899a2
LC
82 ".tar.gz"))
83 (sha256
84 (base32
01eafd38 85 "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3"))
fc1adab1 86 (patches (search-patches "guile-1.8-cpp-4.5.patch"))))
c44899a2
LC
87 (build-system gnu-build-system)
88 (arguments '(#:configure-flags '("--disable-error-on-warning")
c44899a2
LC
89
90 ;; Insert a phase before `configure' to patch things up.
dc1d3cde
KK
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"))))
2f4fbe1c 104
dc1d3cde
KK
105 ;; The usual /bin/sh...
106 (substitute* "ice-9/popen.scm"
107 (("/bin/sh") (which "sh")))
108 #t)))))
528ea990
LC
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
01eafd38 115 (inputs `(("gawk" ,gawk)
c44899a2
LC
116 ("readline" ,readline)))
117
118 ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be
119 ;; propagated.
120 (propagated-inputs `(("gmp" ,gmp)
be11b102 121 ("libltdl" ,libltdl)))
c44899a2 122
9be8d7c8
LC
123 (native-search-paths
124 (list (search-path-specification
125 (variable "GUILE_LOAD_PATH")
af070955 126 (files '("share/guile/site")))))
9be8d7c8 127
f50d2669 128 (synopsis "Scheme implementation intended especially for extensions")
c44899a2 129 (description
a22dc0c4
LC
130 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
131official extension language of the GNU system. It is an implementation of
132the Scheme language which can be easily embedded in other applications to
133provide a convenient means of extending the functionality of the application
134without requiring the source code to be rewritten.")
6fd52309 135 (home-page "https://www.gnu.org/software/guile/")
71e0f217 136 (license license:lgpl2.0+)))
c44899a2
LC
137
138(define-public guile-2.0
139 (package
140 (name "guile")
b5efd14a 141 (version "2.0.14")
c44899a2 142 (source (origin
87f5d366 143 (method url-fetch)
0db342a5 144 (uri (string-append "mirror://gnu/guile/guile-" version
c44899a2
LC
145 ".tar.xz"))
146 (sha256
147 (base32
b5efd14a 148 "10lxc6l5alf3lzbs3ihnbfy6dfcrsyf8667wa57f26vf4mk2ai78"))))
c44899a2 149 (build-system gnu-build-system)
528ea990
LC
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)))
c44899a2 156 (inputs `(("libffi" ,libffi)
88da729f 157 ,@(libiconv-if-needed)
baf549df
LC
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)))))
c44899a2
LC
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)
be11b102
LC
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)
c44899a2
LC
173
174 ;; The headers and/or `guile-2.0.pc' refer to these packages, so they
175 ;; must be propagated.
bda1bc6c 176 ("bdw-gc" ,libgc)
c44899a2
LC
177 ("gmp" ,gmp)))
178
9bf62d9b
LC
179 (outputs '("out" "debug"))
180
8ffaa93b 181 (arguments
20897536
TGR
182 `(#:configure-flags '("--disable-static") ; saves 3 MiB
183 #:phases
184 (modify-phases %standard-phases
ba2f61bb
JN
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 '())
20897536
TGR
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))))))
8ffaa93b 214
9be8d7c8
LC
215 (native-search-paths
216 (list (search-path-specification
217 (variable "GUILE_LOAD_PATH")
af070955 218 (files '("share/guile/site/2.0")))
9be8d7c8
LC
219 (search-path-specification
220 (variable "GUILE_LOAD_COMPILED_PATH")
b03f270e 221 (files '("lib/guile/2.0/site-ccache")))))
9be8d7c8 222
f50d2669 223 (synopsis "Scheme implementation intended especially for extensions")
c44899a2 224 (description
a22dc0c4
LC
225 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
226official extension language of the GNU system. It is an implementation of
227the Scheme language which can be easily embedded in other applications to
228provide a convenient means of extending the functionality of the application
229without requiring the source code to be rewritten.")
6fd52309 230 (home-page "https://www.gnu.org/software/guile/")
71e0f217 231 (license license:lgpl3+)))
c44899a2 232
f6396d86 233(define-public guile-2.2
f906d30c 234 (package (inherit guile-2.0)
f6396d86 235 (name "guile")
edc8fd2e 236 (version "2.2.7")
4eae7980
LC
237 (source (origin
238 (method url-fetch)
34d624ce
LC
239
240 ;; Note: we are limited to one of the compression formats
241 ;; supported by the bootstrap binaries, so no lzip here.
80a72572 242 (uri (string-append "mirror://gnu/guile/guile-" version
34d624ce 243 ".tar.xz"))
4eae7980
LC
244 (sha256
245 (base32
edc8fd2e 246 "013mydzhfswqci6xmyc1ajzd59pfbdak15i0b090nhr9bzm7dxyd"))
d9f0788a 247 (modules '((guix build utils)))
44f07d1d
CD
248 (patches (search-patches
249 "guile-2.2-skip-oom-test.patch"))
d9f0788a
LC
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).
6cbee49d
MW
254 (snippet '(begin
255 (for-each delete-file
256 (find-files "prebuilt" "\\.go$"))
257 #t))))
4fbd0f4f 258 (properties '((timeout . 72000) ;20 hours
16b0f205 259 (max-silent-time . 36000))) ;10 hours (needed on ARM
1577a658 260 ; when heavily loaded)
dd90ed89
DT
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")
1dcca83a 267 (files '("lib/guile/2.2/site-ccache")))))))
4eae7980 268
edc8fd2e 269(define-deprecated guile-2.2/bug-fix guile-2.2)
4bd6f1d1 270
8400d097 271(define-public guile-2.2.4
dbcf2b61
MB
272 (package
273 (inherit guile-2.2)
8400d097
LC
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"))))))
34d624ce 282
e7921d5e
LC
283(define-public guile-3.0
284 ;; This is the latest Guile stable version.
2d0e802f
DT
285 (package
286 (inherit guile-2.2)
b6bee63b 287 (name "guile")
7f1aa73b 288 (version "3.0.2")
2d0e802f
DT
289 (source (origin
290 (inherit (package-source guile-2.2))
1a30351b 291 (uri (string-append "mirror://gnu/guile/guile-"
2d0e802f
DT
292 version ".tar.xz"))
293 (sha256
294 (base32
7f1aa73b 295 "12lziar4j27j9whqp2n18427q45y9ghq7gdd8lqhmj1k0lr7vi2k"))))
916ec91f
LC
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)))
2d0e802f
DT
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"
e7921d5e
LC
310 "share/guile/site/3.0")))))))
311
9e91f862 312(define-public guile-3.0-latest
89ab6bfb 313 ;; TODO: Make this 'guile-3.0' on the next rebuild cycle.
47d48f0c
LC
314 (package
315 (inherit guile-3.0)
316 (version "3.0.7")
317 (source (origin
a9431d8e
LC
318 (inherit (package-source guile-3.0)) ;preserve snippet
319 (patches '())
47d48f0c
LC
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))))))
89ab6bfb 338
cef392f3
CB
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
9e91f862 345 (inherit guile-3.0-latest)
cef392f3
CB
346 (propagated-inputs
347 `(("bdw-gc" ,libgc-7)
348 ,@(srfi-1:alist-delete "bdw-gc" (package-propagated-inputs guile-3.0)))))))
349
b6bee63b
LC
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
973c6f18
LC
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)))
2bbbf673 374 (file-name (git-file-name name version))
973c6f18
LC
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
7c3b6b2e 399(define* (make-guile-readline guile #:optional (name "guile-readline"))
2ba2c98d 400 (package
7c3b6b2e 401 (name name)
2ba2c98d
LC
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
451GNU@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
142cd4dc 456 (make-guile-readline guile-3.0))
2ba2c98d 457
142cd4dc
MB
458(define-public guile2.2-readline
459 (make-guile-readline guile-2.2 "guile2.2-readline"))
7c3b6b2e 460
8f4acad7
LC
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)))
947a5d47 469
8f4acad7 470(define package-for-guile-2.0
10b507b2 471 ;; A procedure that rewrites the dependency tree of the given package to use
e8bc2a01
MB
472 ;; GUILE-2.0 instead of GUILE-3.0.
473 (package-input-rewriting `((,guile-3.0 . ,guile-2.0))
8819551c
LC
474 (guile-variant-package-name "guile2.0")
475 #:deep? #f))
947a5d47 476
b6bee63b
LC
477(define package-for-guile-2.2
478 (package-input-rewriting `((,guile-3.0 . ,guile-2.2))
8819551c
LC
479 (guile-variant-package-name "guile2.2")
480 #:deep? #f))
b6bee63b
LC
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
f69cf407
LC
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))))
b6bee63b
LC
508 #'(begin
509 (define-deprecated name package
510 (deprecated-package package-name package))
f69cf407 511 (export old-name))))))))
89a99d53 512
142cd4dc
MB
513(define-deprecated-guile3.0-package guile3.0-readline)
514
4eae7980 515(define-public guile-for-guile-emacs
a71d3358
RW
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))))))
be3feafe 560
c44899a2
LC
561\f
562;;;
563;;; Extensions.
564;;;
565
84af1e74 566(define-public guile-json-1
6050a1fb
CR
567 (package
568 (name "guile-json")
327ebd55 569 (version "1.3.2")
f52ef55e 570 (home-page "https://github.com/aconchillo/guile-json")
6050a1fb 571 (source (origin
ffc72ec6 572 (method url-fetch)
28123c01
LC
573 (uri (string-append "mirror://savannah/guile-json/guile-json-"
574 version ".tar.gz"))
ffc72ec6
LC
575 (sha256
576 (base32
327ebd55 577 "0m6yzb169r6iz56k3nkncjaiijwi4p0x9ijn1p5ax3s77jklxy9k"))))
6050a1fb 578 (build-system gnu-build-system)
327ebd55
EF
579 (arguments
580 `(#:make-flags '("GUILE_AUTO_COMPILE=0"))) ;to prevent guild warnings
6efccabe 581 (native-inputs `(("pkg-config" ,pkg-config)
f52ef55e
LC
582 ("guile" ,guile-2.2)))
583 (inputs `(("guile" ,guile-2.2)))
6050a1fb
CR
584 (synopsis "JSON module for Guile")
585 (description
0f31d4f0
LC
586 "Guile-JSON supports parsing and building JSON documents according to the
587specification. 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")
15214828
LC
595
596 ;; Version 1.2.0 switched to GPLv3+ (from LGPLv3+).
597 (license license:gpl3+)))
6050a1fb 598
84af1e74
LC
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'.
9b65dea8 602(define-deprecated guile-json guile-json-1)
7f81cce3 603(export guile-json)
584a3ca3 604
2252f087 605(define-public guile2.0-json
84af1e74 606 (package-for-guile-2.0 guile-json-1))
947a5d47 607
152d4076
LC
608(define-public guile-json-3
609 ;; This version is incompatible with 1.x; see the 'NEWS' file.
610 (package
84af1e74 611 (inherit guile-json-1)
152d4076 612 (name "guile-json")
5d9e2187 613 (version "3.5.0")
152d4076
LC
614 (source (origin
615 (method url-fetch)
28123c01
LC
616 (uri (string-append "mirror://savannah/guile-json/guile-json-"
617 version ".tar.gz"))
152d4076
LC
618 (sha256
619 (base32
5d9e2187
MB
620 "0nj0684qgh6ppkbdyxqfyjwsv2qbyairxpi8fzrhsi3xnc7jn4im"))))
621 (native-inputs `(("pkg-config" ,pkg-config)
b6bee63b 622 ("guile" ,guile-3.0)))
5d9e2187 623 (inputs `(("guile" ,guile-3.0)))))
b6bee63b 624
89a99d53 625(define-public guile3.0-json
b6bee63b 626 (deprecated-package "guile3.0-json" guile-json-3))
89a99d53 627
793a48ed
LC
628(define-public guile-json-4
629 (package
630 (inherit guile-json-3)
631 (name "guile-json")
fc5f9de5 632 (version "4.5.2")
793a48ed
LC
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
fc5f9de5 639 "0cqr0ljqmzlc2bwrapcsmcgxg147h66mcxf23824ri5i6vn4dc0s"))))))
793a48ed
LC
640
641(define-public guile2.2-json
642 (package-for-guile-2.2 guile-json-4))
643
93e7199b
CAW
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
b0e7b699 654 (url "https://github.com/ijp/guile-gdbm")
93e7199b 655 (commit "fa1d5b6231d0e4d096687b378c025f2148c5f246")))
821f4dc2 656 (file-name (string-append name "-" version "-checkout"))
977d8666
LC
657 (patches (search-patches
658 "guile-gdbm-ffi-support-gdbm-1.14.patch"))
93e7199b
CAW
659 (sha256
660 (base32
661 "1j8wrsw7v9w6qkl47xz0rdikg50v16nn6kbs3lgzcymjzpa7babj"))))
977d8666
LC
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
b6bee63b 683 `(("guile" ,guile-3.0)))
56f31a9f 684 (inputs
56f31a9f 685 `(("gdbm" ,gdbm)))
93e7199b
CAW
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
690Guile's foreign function interface.")
71e0f217 691 (license license:gpl3+)))
93e7199b 692
5bd3a841
LC
693(define-public guile2.0-gdbm-ffi
694 (package-for-guile-2.0 guile-gdbm-ffi))
695
b6bee63b
LC
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)
93e7199b 700
e8ac1f8f 701(define-public guile-sqlite3
319e26e4
LC
702 (package
703 (name "guile-sqlite3")
1eec6b0c 704 (version "0.1.2")
3527f600 705 (home-page "https://notabug.org/guile-sqlite3/guile-sqlite3.git")
319e26e4
LC
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
1eec6b0c 713 "1nryy9j3bk34i0alkmc9bmqsm0ayz92k1cdf752mvhyjjn8nr928"))
29e4d3ea 714 (file-name (string-append name "-" version "-checkout"))))
319e26e4
LC
715 (build-system gnu-build-system)
716 (native-inputs
717 `(("autoconf" ,autoconf)
718 ("automake" ,automake)
02ed227f 719 ("guile" ,guile-3.0)
319e26e4
LC
720 ("pkg-config" ,pkg-config)))
721 (inputs
b6bee63b 722 `(("guile" ,guile-3.0)
319e26e4
LC
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+)))
e8ac1f8f 728
c8e3651a
EB
729(define-public guile2.0-sqlite3
730 (package-for-guile-2.0 guile-sqlite3))
731
b6bee63b
LC
732(define-public guile2.2-sqlite3
733 (package-for-guile-2.2 guile-sqlite3))
734
735(define-deprecated-guile3.0-package guile3.0-sqlite3)
d15e4b1d 736
3b5783fc
AB
737(define-public guile-bytestructures
738 (package
739 (name "guile-bytestructures")
b1eb7448 740 (version "1.0.10")
16e42db0 741 (home-page "https://github.com/TaylanUB/scheme-bytestructures")
3b5783fc 742 (source (origin
16e42db0
MO
743 (method git-fetch)
744 (uri (git-reference
745 (url home-page)
0a1da465 746 (commit version)))
43476625 747 (file-name (git-file-name name version))
3b5783fc
AB
748 (sha256
749 (base32
b1eb7448 750 "14k50jln32kkxv41hvsdgjkkfj6xlv06vc1caz01qkgk1fzh72nk"))))
4f85f7f7 751 (build-system gnu-build-system)
9a78e181 752 (arguments
7ed9c312
LC
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))))))
726ecfeb 763 (native-inputs
16e42db0
MO
764 `(("autoconf" ,autoconf)
765 ("automake" ,automake)
b9a9c8ef 766 ("pkg-config" ,pkg-config)
b6bee63b 767 ("guile" ,guile-3.0)))
3b5783fc 768 (inputs
b6bee63b 769 `(("guile" ,guile-3.0)))
3b5783fc
AB
770 (synopsis "Structured access to bytevector contents for Guile")
771 (description
772 "Guile bytestructures offers a system imitating the type system
773of the C programming language, to be used on bytevectors. C's type
774system works on raw memory, and Guile works on bytevectors which are
775an abstraction over raw memory. It's also more powerful than the C
776type system, elevating types to first-class status.")
abba4073
LC
777 (license license:gpl3+)
778 (properties '((upstream-name . "bytestructures")))))
3b5783fc 779
726ecfeb
LC
780(define-public guile2.0-bytestructures
781 (package-for-guile-2.0 guile-bytestructures))
782
b6bee63b
LC
783(define-public guile2.2-bytestructures
784 (package-for-guile-2.2 guile-bytestructures))
785
786(define-deprecated-guile3.0-package guile3.0-bytestructures)
89a99d53 787
bd233722 788(define-public guile-git
e85035c9
LC
789 (package
790 (name "guile-git")
50d9bccb 791 (version "0.5.1")
e85035c9
LC
792 (home-page "https://gitlab.com/guile-git/guile-git.git")
793 (source (origin
7a6625e8
XC
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))
e85035c9
LC
799 (sha256
800 (base32
50d9bccb 801 "1x3wa6la4j1wcfxyhhjlmd7yp85wwpny0y6lrzpz803i9z5fwagc"))))
e85035c9 802 (build-system gnu-build-system)
3d867fea
EF
803 (arguments
804 `(#:make-flags '("GUILE_AUTO_COMPILE=0"))) ; to prevent guild warnings
e85035c9 805 (native-inputs
96a9675b 806 `(("pkg-config" ,pkg-config)
7a6625e8
XC
807 ("autoconf" ,autoconf)
808 ("automake" ,automake)
809 ("texinfo" ,texinfo)
b6bee63b 810 ("guile" ,guile-3.0)
96a9675b 811 ("guile-bytestructures" ,guile-bytestructures)))
e85035c9 812 (inputs
b6bee63b 813 `(("guile" ,guile-3.0)
e85035c9
LC
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
bd233722 820manipulate repositories of the Git version control system.")
e85035c9 821 (license license:gpl3+)))
c5793e7e 822
b6bee63b
LC
823(define-public guile2.2-git
824 (package-for-guile-2.2 guile-git))
01c11aeb 825
70bc6085 826(define-public guile2.0-git
2bd60ca1 827 (package-for-guile-2.0 guile-git))
70bc6085 828
b6bee63b
LC
829(define-deprecated-guile3.0-package guile3.0-git)
830
e5758aeb
MO
831(define-public guile-zlib
832 (package
833 (name "guile-zlib")
97b45977 834 (version "0.1.0")
44241391
MO
835 (source
836 (origin
4aa7dfe4
MO
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.
44241391
MO
840 (method url-fetch)
841 (uri
97b45977 842 (string-append "https://notabug.org/guile-zlib/guile-zlib/archive/v"
44241391 843 version ".tar.gz"))
b4d6e378 844 (file-name (string-append name "-" version ".tar.gz"))
44241391 845 (sha256
97b45977 846 ;; content hash: 1ip18nzwnczqyhn9cpzxkm9vzpi5fz5sy96cgjhmp7cwhnkmv6zv
44241391 847 (base32
97b45977 848 "1safz7rrbdf1d98x3lgx5v74kivpyf9n1v6pdyy22vd0f2sjdir5"))))
e5758aeb
MO
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)
65777dce
MO
856 ("pkg-config" ,pkg-config)
857 ,@(if (%current-target-system)
858 `(("guile" ,guile-3.0)) ;for 'guild compile' and 'guile-3.0.pc'
859 '())))
e5758aeb
MO
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
866data-compression library. The bindings are written in pure Scheme by using
867Guile's foreign function interface.")
868 (home-page "https://notabug.org/guile-zlib/guile-zlib")
869 (license license:gpl3+)))
a8307a17 870
2a9af225
LC
871(define-public guile2.2-zlib
872 (package-for-guile-2.2 guile-zlib))
873
e5758aeb
MO
874(define-public guile-lzlib
875 (package
876 (name "guile-lzlib")
af56f60e 877 (version "0.0.2")
69361e88
MO
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"))
90748666 884 (file-name (string-append name "-" version ".tar.gz"))
69361e88
MO
885 (sha256
886 (base32
af56f60e 887 "11sggvncyx08ssp1s5xii4d6nskh1qwqihnbpzzvkrs7sivxn8w6"))))
e5758aeb
MO
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)
0c50d723
MO
895 ("pkg-config" ,pkg-config)
896 ,@(if (%current-target-system)
897 `(("guile" ,guile-3.0)) ;for 'guild compile' and 'guile-3.0.pc'
898 '())))
e5758aeb
MO
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
905in-memory LZMA compression and decompression. The bindings are written in
906pure Scheme by using Guile's foreign function interface.")
907 (home-page "https://notabug.org/guile-lzlib/guile-lzlib")
908 (license license:gpl3+)))
909
2238bd8d
LC
910(define-public guile2.2-lzlib
911 (package-for-guile-2.2 guile-lzlib))
912
32568f5b
LC
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'')
938compression library.")
939 (license license:gpl3+)))
940
e5758aeb 941;;; guile.scm ends here