Commit | Line | Data |
---|---|---|
233e7676 | 1 | ;;; GNU Guix --- Functional package management for GNU |
9b65dea8 | 2 | ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 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> |
3d867fea | 18 | ;;; Copyright © 2020 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) |
ee8ee748 | 47 | #:use-module (gnu packages hurd) |
1ffa7090 | 48 | #:use-module (gnu packages libffi) |
1ffa7090 | 49 | #:use-module (gnu packages libunistring) |
7119cca8 | 50 | #:use-module (gnu packages linux) |
1ffa7090 LC |
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) | |
cd0322a3 | 55 | #:use-module (gnu packages sqlite) |
f906d30c | 56 | #:use-module (gnu packages texinfo) |
bd233722 | 57 | #:use-module (gnu packages version-control) |
1722d680 | 58 | #:use-module (guix packages) |
87f5d366 | 59 | #:use-module (guix download) |
6bc24063 | 60 | #:use-module (guix git-download) |
32795fcf | 61 | #:use-module (guix build-system gnu) |
977d8666 | 62 | #:use-module (guix build-system guile) |
84af1e74 | 63 | #:use-module (guix deprecation) |
32795fcf | 64 | #:use-module (guix utils) |
d4660a54 MC |
65 | #:use-module (ice-9 match) |
66 | #:use-module ((srfi srfi-1) #:prefix srfi-1:)) | |
1722d680 LC |
67 | |
68 | ;;; Commentary: | |
69 | ;;; | |
c44899a2 | 70 | ;;; GNU Guile, and modules and extensions. |
1722d680 LC |
71 | ;;; |
72 | ;;; Code: | |
73 | ||
c44899a2 LC |
74 | (define-public guile-1.8 |
75 | (package | |
76 | (name "guile") | |
77 | (version "1.8.8") | |
78 | (source (origin | |
87f5d366 | 79 | (method url-fetch) |
0db342a5 | 80 | (uri (string-append "mirror://gnu/guile/guile-" version |
c44899a2 LC |
81 | ".tar.gz")) |
82 | (sha256 | |
83 | (base32 | |
01eafd38 | 84 | "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3")) |
fc1adab1 | 85 | (patches (search-patches "guile-1.8-cpp-4.5.patch")))) |
c44899a2 LC |
86 | (build-system gnu-build-system) |
87 | (arguments '(#:configure-flags '("--disable-error-on-warning") | |
c44899a2 LC |
88 | |
89 | ;; Insert a phase before `configure' to patch things up. | |
dc1d3cde KK |
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")))) | |
2f4fbe1c | 103 | |
dc1d3cde KK |
104 | ;; The usual /bin/sh... |
105 | (substitute* "ice-9/popen.scm" | |
106 | (("/bin/sh") (which "sh"))) | |
107 | #t))))) | |
528ea990 LC |
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 | ||
01eafd38 | 114 | (inputs `(("gawk" ,gawk) |
c44899a2 LC |
115 | ("readline" ,readline))) |
116 | ||
117 | ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be | |
118 | ;; propagated. | |
119 | (propagated-inputs `(("gmp" ,gmp) | |
be11b102 | 120 | ("libltdl" ,libltdl))) |
c44899a2 | 121 | |
9be8d7c8 LC |
122 | (native-search-paths |
123 | (list (search-path-specification | |
124 | (variable "GUILE_LOAD_PATH") | |
af070955 | 125 | (files '("share/guile/site"))))) |
9be8d7c8 | 126 | |
f50d2669 | 127 | (synopsis "Scheme implementation intended especially for extensions") |
c44899a2 | 128 | (description |
a22dc0c4 LC |
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.") | |
6fd52309 | 134 | (home-page "https://www.gnu.org/software/guile/") |
71e0f217 | 135 | (license license:lgpl2.0+))) |
c44899a2 LC |
136 | |
137 | (define-public guile-2.0 | |
138 | (package | |
139 | (name "guile") | |
b5efd14a | 140 | (version "2.0.14") |
c44899a2 | 141 | (source (origin |
87f5d366 | 142 | (method url-fetch) |
0db342a5 | 143 | (uri (string-append "mirror://gnu/guile/guile-" version |
c44899a2 LC |
144 | ".tar.xz")) |
145 | (sha256 | |
146 | (base32 | |
b5efd14a | 147 | "10lxc6l5alf3lzbs3ihnbfy6dfcrsyf8667wa57f26vf4mk2ai78")))) |
c44899a2 | 148 | (build-system gnu-build-system) |
528ea990 LC |
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))) | |
c44899a2 | 155 | (inputs `(("libffi" ,libffi) |
88da729f | 156 | ,@(libiconv-if-needed) |
baf549df LC |
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))))) | |
c44899a2 LC |
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) | |
be11b102 LC |
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) | |
c44899a2 LC |
172 | |
173 | ;; The headers and/or `guile-2.0.pc' refer to these packages, so they | |
174 | ;; must be propagated. | |
bda1bc6c | 175 | ("bdw-gc" ,libgc) |
c44899a2 LC |
176 | ("gmp" ,gmp))) |
177 | ||
9bf62d9b LC |
178 | (outputs '("out" "debug")) |
179 | ||
8ffaa93b | 180 | (arguments |
20897536 TGR |
181 | `(#:configure-flags '("--disable-static") ; saves 3 MiB |
182 | #:phases | |
183 | (modify-phases %standard-phases | |
ba2f61bb JN |
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 | '()) | |
20897536 TGR |
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)))))) | |
8ffaa93b | 213 | |
9be8d7c8 LC |
214 | (native-search-paths |
215 | (list (search-path-specification | |
216 | (variable "GUILE_LOAD_PATH") | |
af070955 | 217 | (files '("share/guile/site/2.0"))) |
9be8d7c8 LC |
218 | (search-path-specification |
219 | (variable "GUILE_LOAD_COMPILED_PATH") | |
b03f270e | 220 | (files '("lib/guile/2.0/site-ccache"))))) |
9be8d7c8 | 221 | |
f50d2669 | 222 | (synopsis "Scheme implementation intended especially for extensions") |
c44899a2 | 223 | (description |
a22dc0c4 LC |
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.") | |
6fd52309 | 229 | (home-page "https://www.gnu.org/software/guile/") |
71e0f217 | 230 | (license license:lgpl3+))) |
c44899a2 | 231 | |
f6396d86 | 232 | (define-public guile-2.2 |
f906d30c | 233 | (package (inherit guile-2.0) |
f6396d86 | 234 | (name "guile") |
edc8fd2e | 235 | (version "2.2.7") |
4eae7980 LC |
236 | (source (origin |
237 | (method url-fetch) | |
34d624ce LC |
238 | |
239 | ;; Note: we are limited to one of the compression formats | |
240 | ;; supported by the bootstrap binaries, so no lzip here. | |
80a72572 | 241 | (uri (string-append "mirror://gnu/guile/guile-" version |
34d624ce | 242 | ".tar.xz")) |
4eae7980 LC |
243 | (sha256 |
244 | (base32 | |
edc8fd2e | 245 | "013mydzhfswqci6xmyc1ajzd59pfbdak15i0b090nhr9bzm7dxyd")) |
d9f0788a | 246 | (modules '((guix build utils))) |
44f07d1d CD |
247 | (patches (search-patches |
248 | "guile-2.2-skip-oom-test.patch")) | |
d9f0788a LC |
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). | |
6cbee49d MW |
253 | (snippet '(begin |
254 | (for-each delete-file | |
255 | (find-files "prebuilt" "\\.go$")) | |
256 | #t)))) | |
4fbd0f4f | 257 | (properties '((timeout . 72000) ;20 hours |
16b0f205 | 258 | (max-silent-time . 36000))) ;10 hours (needed on ARM |
1577a658 | 259 | ; when heavily loaded) |
dd90ed89 DT |
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") | |
1dcca83a | 266 | (files '("lib/guile/2.2/site-ccache"))))))) |
4eae7980 | 267 | |
edc8fd2e | 268 | (define-deprecated guile-2.2/bug-fix guile-2.2) |
4bd6f1d1 | 269 | |
8400d097 LC |
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")))))) | |
34d624ce | 281 | |
e7921d5e LC |
282 | (define-public guile-3.0 |
283 | ;; This is the latest Guile stable version. | |
2d0e802f DT |
284 | (package |
285 | (inherit guile-2.2) | |
b6bee63b | 286 | (name "guile") |
7f1aa73b | 287 | (version "3.0.2") |
2d0e802f DT |
288 | (source (origin |
289 | (inherit (package-source guile-2.2)) | |
1a30351b | 290 | (uri (string-append "mirror://gnu/guile/guile-" |
2d0e802f DT |
291 | version ".tar.xz")) |
292 | (sha256 | |
293 | (base32 | |
7f1aa73b | 294 | "12lziar4j27j9whqp2n18427q45y9ghq7gdd8lqhmj1k0lr7vi2k")))) |
916ec91f LC |
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))) | |
2d0e802f DT |
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" | |
e7921d5e LC |
309 | "share/guile/site/3.0"))))))) |
310 | ||
0e8b0517 LC |
311 | (define-public guile-next |
312 | (deprecated-package "guile-next" guile-3.0)) | |
5cd074ea | 313 | |
cef392f3 CB |
314 | (define-public guile-3.0/libgc-7 |
315 | ;; Using libgc-7 avoid crashes that can occur, particularly when loading | |
316 | ;; data in to the Guix Data Service: | |
317 | ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=40525 | |
318 | (hidden-package | |
319 | (package | |
320 | (inherit guile-3.0) | |
321 | (propagated-inputs | |
322 | `(("bdw-gc" ,libgc-7) | |
323 | ,@(srfi-1:alist-delete "bdw-gc" (package-propagated-inputs guile-3.0))))))) | |
324 | ||
b6bee63b LC |
325 | (define-public guile-3.0/fixed |
326 | ;; A package of Guile that's rarely changed. It is the one used in the | |
327 | ;; `base' module, and thus changing it entails a full rebuild. | |
328 | (package | |
329 | (inherit guile-3.0) | |
330 | (properties '((hidden? . #t) ;people should install 'guile-2.2' | |
331 | (timeout . 72000) ;20 hours | |
332 | (max-silent-time . 36000))))) ;10 hours (needed on ARM | |
333 | ; when heavily loaded) | |
334 | ||
7c3b6b2e | 335 | (define* (make-guile-readline guile #:optional (name "guile-readline")) |
2ba2c98d | 336 | (package |
7c3b6b2e | 337 | (name name) |
2ba2c98d LC |
338 | (version (package-version guile)) |
339 | (source (package-source guile)) | |
340 | (build-system gnu-build-system) | |
341 | (arguments | |
342 | '(#:configure-flags '("--disable-silent-rules") | |
343 | #:phases (modify-phases %standard-phases | |
344 | (add-before 'build 'chdir | |
345 | (lambda* (#:key outputs #:allow-other-keys) | |
346 | (invoke "make" "-C" "libguile" "scmconfig.h") | |
347 | (invoke "make" "-C" "lib") | |
348 | (chdir "guile-readline") | |
349 | ||
350 | (substitute* "Makefile" | |
351 | (("../libguile/libguile-[[:graph:]]+\\.la") | |
352 | ;; Remove dependency on libguile-X.Y.la. | |
353 | "") | |
354 | (("^READLINE_LIBS = (.*)$" _ libs) | |
355 | ;; Link against the provided libguile. | |
356 | (string-append "READLINE_LIBS = " | |
357 | "-lguile-$(GUILE_EFFECTIVE_VERSION) " | |
358 | libs "\n")) | |
359 | (("\\$\\(top_builddir\\)/meta/build-env") | |
360 | ;; Use the provided Guile, not the one from | |
361 | ;; $(builddir). | |
362 | "") | |
363 | ||
364 | ;; Install modules to the 'site' directories. | |
365 | (("^moddir = .*$") | |
366 | "moddir = $(pkgdatadir)/site/$(GUILE_EFFECTIVE_VERSION)\n") | |
367 | (("^ccachedir = .*$") | |
368 | "ccachedir = $(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/site-ccache\n")) | |
369 | ||
370 | ;; Load 'guile-readline.so' from the right place. | |
371 | (substitute* "ice-9/readline.scm" | |
372 | (("load-extension \"guile-readline\"") | |
373 | (format #f "load-extension \ | |
374 | (string-append ~s \"/lib/guile/\" (effective-version) \"/extensions/guile-readline\")" | |
375 | (assoc-ref outputs "out")))) | |
376 | #t))))) | |
377 | (home-page (package-home-page guile)) | |
378 | (native-inputs (package-native-inputs guile)) | |
379 | (inputs | |
380 | `(,@(package-inputs guile) ;to placate 'configure' | |
381 | ,@(package-propagated-inputs guile) | |
382 | ("guile" ,guile) | |
383 | ("readline" ,readline))) | |
384 | (synopsis "Line editing support for GNU Guile") | |
385 | (description | |
386 | "This module provides line editing support via the Readline library for | |
387 | GNU@tie{}Guile. Use the @code{(ice-9 readline)} module and call its | |
388 | @code{activate-readline} procedure to enable it.") | |
389 | (license license:gpl3+))) | |
390 | ||
391 | (define-public guile-readline | |
142cd4dc | 392 | (make-guile-readline guile-3.0)) |
2ba2c98d | 393 | |
142cd4dc MB |
394 | (define-public guile2.2-readline |
395 | (make-guile-readline guile-2.2 "guile2.2-readline")) | |
7c3b6b2e | 396 | |
8f4acad7 LC |
397 | (define (guile-variant-package-name prefix) |
398 | (lambda (name) | |
399 | "Return NAME with PREFIX instead of \"guile-\", when applicable." | |
400 | (if (string-prefix? "guile-" name) | |
401 | (string-append prefix "-" | |
402 | (string-drop name | |
403 | (string-length "guile-"))) | |
404 | name))) | |
947a5d47 | 405 | |
8f4acad7 | 406 | (define package-for-guile-2.0 |
10b507b2 | 407 | ;; A procedure that rewrites the dependency tree of the given package to use |
e8bc2a01 MB |
408 | ;; GUILE-2.0 instead of GUILE-3.0. |
409 | (package-input-rewriting `((,guile-3.0 . ,guile-2.0)) | |
8f4acad7 | 410 | (guile-variant-package-name "guile2.0"))) |
947a5d47 | 411 | |
b6bee63b LC |
412 | (define package-for-guile-2.2 |
413 | (package-input-rewriting `((,guile-3.0 . ,guile-2.2)) | |
414 | (guile-variant-package-name "guile2.2"))) | |
415 | ||
416 | (define-syntax define-deprecated-guile3.0-package | |
417 | (lambda (s) | |
418 | "Define a deprecated package alias for \"guile3.0-something\"." | |
419 | (syntax-case s () | |
420 | ((_ name) | |
421 | (and (identifier? #'name) | |
422 | (string-prefix? "guile3.0-" (symbol->string (syntax->datum | |
423 | #'name)))) | |
424 | (let ((->guile (lambda (str) | |
425 | (let ((base (string-drop str | |
426 | (string-length "guile3.0-")))) | |
427 | (string-append "guile-" base))))) | |
428 | (with-syntax ((package-name (symbol->string (syntax->datum #'name))) | |
429 | (package | |
430 | (datum->syntax | |
431 | #'name | |
432 | (string->symbol | |
f69cf407 LC |
433 | (->guile (symbol->string (syntax->datum |
434 | #'name)))))) | |
435 | (old-name | |
436 | ;; XXX: This is the name generated by | |
437 | ;; 'define-deprecated'. | |
438 | (datum->syntax | |
439 | #'name | |
440 | (symbol-append '% (syntax->datum #'name) | |
441 | '/deprecated)))) | |
b6bee63b LC |
442 | #'(begin |
443 | (define-deprecated name package | |
444 | (deprecated-package package-name package)) | |
f69cf407 | 445 | (export old-name)))))))) |
89a99d53 | 446 | |
142cd4dc MB |
447 | (define-deprecated-guile3.0-package guile3.0-readline) |
448 | ||
4eae7980 | 449 | (define-public guile-for-guile-emacs |
a71d3358 RW |
450 | (let ((commit "15ca78482ac0dd2e3eb36dcb31765d8652d7106d") |
451 | (revision "1")) | |
452 | (package (inherit guile-2.2) | |
453 | (name "guile-for-guile-emacs") | |
454 | (version (git-version "2.1.2" revision commit)) | |
455 | (source (origin | |
456 | (method git-fetch) | |
457 | (uri (git-reference | |
458 | (url "git://git.savannah.gnu.org/guile.git") | |
459 | (commit commit))) | |
460 | (file-name (git-file-name name version)) | |
461 | (sha256 | |
462 | (base32 | |
463 | "1l7ik4q4zk7vq4m3gnwizc0b64b1mdr31hxqlzxs94xaf2lvi7s2")))) | |
464 | (arguments | |
465 | (substitute-keyword-arguments (package-arguments guile-2.2) | |
466 | ((#:phases phases '%standard-phases) | |
467 | `(modify-phases ,phases | |
468 | (replace 'bootstrap | |
469 | (lambda _ | |
470 | ;; Disable broken tests. | |
471 | ;; TODO: Fix them! | |
472 | (substitute* "test-suite/tests/gc.test" | |
473 | (("\\(pass-if \"after-gc-hook gets called\"" m) | |
474 | (string-append "#;" m))) | |
475 | (substitute* "test-suite/tests/version.test" | |
476 | (("\\(pass-if \"version reporting works\"" m) | |
477 | (string-append "#;" m))) | |
478 | ;; Warning: Unwind-only `out-of-memory' exception; skipping pre-unwind handler. | |
479 | ;; FAIL: test-out-of-memory | |
480 | (substitute* "test-suite/standalone/Makefile.am" | |
481 | (("(check_SCRIPTS|TESTS) \\+= test-out-of-memory") "")) | |
482 | ||
483 | (patch-shebang "build-aux/git-version-gen") | |
484 | (invoke "sh" "autogen.sh") | |
485 | #t)))))) | |
486 | (native-inputs | |
487 | `(("autoconf" ,autoconf) | |
488 | ("automake" ,automake) | |
489 | ("libtool" ,libtool) | |
490 | ("flex" ,flex) | |
491 | ("texinfo" ,texinfo) | |
492 | ("gettext" ,gettext-minimal) | |
493 | ,@(package-native-inputs guile-2.2)))))) | |
be3feafe | 494 | |
c44899a2 LC |
495 | \f |
496 | ;;; | |
497 | ;;; Extensions. | |
498 | ;;; | |
499 | ||
84af1e74 | 500 | (define-public guile-json-1 |
6050a1fb CR |
501 | (package |
502 | (name "guile-json") | |
15214828 | 503 | (version "1.2.0") |
f52ef55e | 504 | (home-page "https://github.com/aconchillo/guile-json") |
6050a1fb | 505 | (source (origin |
ffc72ec6 | 506 | (method url-fetch) |
28123c01 LC |
507 | (uri (string-append "mirror://savannah/guile-json/guile-json-" |
508 | version ".tar.gz")) | |
ffc72ec6 LC |
509 | (sha256 |
510 | (base32 | |
6efccabe | 511 | "15gnb84d7hpazqhskkf3g9z4r6knw54wfj4ch5270kakz1lp70c9")))) |
6050a1fb | 512 | (build-system gnu-build-system) |
6efccabe | 513 | (native-inputs `(("pkg-config" ,pkg-config) |
f52ef55e LC |
514 | ("guile" ,guile-2.2))) |
515 | (inputs `(("guile" ,guile-2.2))) | |
6050a1fb CR |
516 | (synopsis "JSON module for Guile") |
517 | (description | |
0f31d4f0 LC |
518 | "Guile-JSON supports parsing and building JSON documents according to the |
519 | specification. These are the main features: | |
520 | ||
521 | @itemize | |
522 | @item Strictly complies to @uref{http://json.org, specification}. | |
523 | @item Build JSON documents programmatically via macros. | |
524 | @item Unicode support for strings. | |
525 | @item Allows JSON pretty printing. | |
526 | @end itemize\n") | |
15214828 LC |
527 | |
528 | ;; Version 1.2.0 switched to GPLv3+ (from LGPLv3+). | |
529 | (license license:gpl3+))) | |
6050a1fb | 530 | |
84af1e74 LC |
531 | ;; Deprecate the 'guile-json' alias to force the use 'guile-json-1' or |
532 | ;; 'guile-json-3'. In the future, we may reuse 'guile-json' as an alias for | |
533 | ;; 'guile-json-3'. | |
9b65dea8 | 534 | (define-deprecated guile-json guile-json-1) |
7f81cce3 | 535 | (export guile-json) |
584a3ca3 | 536 | |
2252f087 | 537 | (define-public guile2.0-json |
84af1e74 | 538 | (package-for-guile-2.0 guile-json-1)) |
947a5d47 | 539 | |
152d4076 LC |
540 | (define-public guile-json-3 |
541 | ;; This version is incompatible with 1.x; see the 'NEWS' file. | |
542 | (package | |
84af1e74 | 543 | (inherit guile-json-1) |
152d4076 | 544 | (name "guile-json") |
5d9e2187 | 545 | (version "3.5.0") |
152d4076 LC |
546 | (source (origin |
547 | (method url-fetch) | |
28123c01 LC |
548 | (uri (string-append "mirror://savannah/guile-json/guile-json-" |
549 | version ".tar.gz")) | |
152d4076 LC |
550 | (sha256 |
551 | (base32 | |
5d9e2187 MB |
552 | "0nj0684qgh6ppkbdyxqfyjwsv2qbyairxpi8fzrhsi3xnc7jn4im")))) |
553 | (native-inputs `(("pkg-config" ,pkg-config) | |
b6bee63b | 554 | ("guile" ,guile-3.0))) |
5d9e2187 | 555 | (inputs `(("guile" ,guile-3.0))))) |
b6bee63b LC |
556 | |
557 | (define-public guile2.2-json | |
558 | (package-for-guile-2.2 guile-json-3)) | |
152d4076 | 559 | |
89a99d53 | 560 | (define-public guile3.0-json |
b6bee63b | 561 | (deprecated-package "guile3.0-json" guile-json-3)) |
89a99d53 | 562 | |
93e7199b CAW |
563 | ;; There are two guile-gdbm packages, one using the FFI and one with |
564 | ;; direct C bindings, hence the verbose name. | |
565 | ||
566 | (define-public guile-gdbm-ffi | |
567 | (package | |
568 | (name "guile-gdbm-ffi") | |
569 | (version "20120209.fa1d5b6") | |
570 | (source (origin | |
571 | (method git-fetch) | |
572 | (uri (git-reference | |
573 | (url "https://github.com/ijp/guile-gdbm.git") | |
574 | (commit "fa1d5b6231d0e4d096687b378c025f2148c5f246"))) | |
821f4dc2 | 575 | (file-name (string-append name "-" version "-checkout")) |
977d8666 LC |
576 | (patches (search-patches |
577 | "guile-gdbm-ffi-support-gdbm-1.14.patch")) | |
93e7199b CAW |
578 | (sha256 |
579 | (base32 | |
580 | "1j8wrsw7v9w6qkl47xz0rdikg50v16nn6kbs3lgzcymjzpa7babj")))) | |
977d8666 LC |
581 | (build-system guile-build-system) |
582 | (arguments | |
583 | '(#:phases (modify-phases %standard-phases | |
584 | (add-after 'unpack 'move-examples | |
585 | (lambda* (#:key outputs #:allow-other-keys) | |
586 | ;; Move examples where they belong. | |
587 | (let* ((out (assoc-ref outputs "out")) | |
588 | (doc (string-append out "/share/doc/" | |
589 | (strip-store-file-name out) | |
590 | "/examples"))) | |
591 | (copy-recursively "examples" doc) | |
592 | (delete-file-recursively "examples") | |
593 | #t))) | |
594 | (add-after 'unpack 'set-libgdbm-file-name | |
595 | (lambda* (#:key inputs #:allow-other-keys) | |
596 | (substitute* "gdbm.scm" | |
597 | (("\\(dynamic-link \"libgdbm\"\\)") | |
598 | (format #f "(dynamic-link \"~a/lib/libgdbm.so\")" | |
599 | (assoc-ref inputs "gdbm")))) | |
600 | #t))))) | |
601 | (native-inputs | |
b6bee63b | 602 | `(("guile" ,guile-3.0))) |
56f31a9f | 603 | (inputs |
56f31a9f | 604 | `(("gdbm" ,gdbm))) |
93e7199b CAW |
605 | (home-page "https://github.com/ijp/guile-gdbm") |
606 | (synopsis "Guile bindings to the GDBM library via Guile's FFI") | |
607 | (description | |
608 | "Guile bindings to the GDBM key-value storage system, using | |
609 | Guile's foreign function interface.") | |
71e0f217 | 610 | (license license:gpl3+))) |
93e7199b | 611 | |
5bd3a841 LC |
612 | (define-public guile2.0-gdbm-ffi |
613 | (package-for-guile-2.0 guile-gdbm-ffi)) | |
614 | ||
b6bee63b LC |
615 | (define-public guile2.2-gdbm-ffi |
616 | (package-for-guile-2.2 guile-gdbm-ffi)) | |
617 | ||
618 | (define-deprecated-guile3.0-package guile3.0-gdbm-ffi) | |
93e7199b | 619 | |
e8ac1f8f | 620 | (define-public guile-sqlite3 |
319e26e4 LC |
621 | (package |
622 | (name "guile-sqlite3") | |
623 | (version "0.1.0") | |
3527f600 | 624 | (home-page "https://notabug.org/guile-sqlite3/guile-sqlite3.git") |
319e26e4 LC |
625 | (source (origin |
626 | (method git-fetch) | |
627 | (uri (git-reference | |
628 | (url home-page) | |
629 | (commit (string-append "v" version)))) | |
630 | (sha256 | |
631 | (base32 | |
632 | "1nv8j7wk6b5n4p22szyi8lv8fs31rrzxhzz16gyj8r38c1fyp9qp")) | |
e53bf62e MO |
633 | (file-name (string-append name "-" version "-checkout")) |
634 | (patches | |
9d5aa009 | 635 | (search-patches "guile-sqlite3-fix-cross-compilation.patch")) |
d15e4b1d LC |
636 | (modules '((guix build utils))) |
637 | (snippet | |
638 | '(begin | |
639 | ;; Allow builds with Guile 3.0. | |
640 | (substitute* "configure.ac" | |
641 | (("^GUILE_PKG.*") | |
642 | "GUILE_PKG([3.0 2.2 2.0])\n")) | |
643 | #t)))) | |
319e26e4 LC |
644 | (build-system gnu-build-system) |
645 | (native-inputs | |
646 | `(("autoconf" ,autoconf) | |
647 | ("automake" ,automake) | |
02ed227f | 648 | ("guile" ,guile-3.0) |
319e26e4 LC |
649 | ("pkg-config" ,pkg-config))) |
650 | (inputs | |
b6bee63b | 651 | `(("guile" ,guile-3.0) |
319e26e4 LC |
652 | ("sqlite" ,sqlite))) |
653 | (synopsis "Access SQLite databases from Guile") | |
654 | (description | |
655 | "This package provides Guile bindings to the SQLite database system.") | |
656 | (license license:gpl3+))) | |
e8ac1f8f | 657 | |
c8e3651a EB |
658 | (define-public guile2.0-sqlite3 |
659 | (package-for-guile-2.0 guile-sqlite3)) | |
660 | ||
b6bee63b LC |
661 | (define-public guile2.2-sqlite3 |
662 | (package-for-guile-2.2 guile-sqlite3)) | |
663 | ||
664 | (define-deprecated-guile3.0-package guile3.0-sqlite3) | |
d15e4b1d | 665 | |
3b5783fc AB |
666 | (define-public guile-bytestructures |
667 | (package | |
668 | (name "guile-bytestructures") | |
247a47bc | 669 | (version "1.0.7") |
16e42db0 | 670 | (home-page "https://github.com/TaylanUB/scheme-bytestructures") |
3b5783fc | 671 | (source (origin |
16e42db0 MO |
672 | (method git-fetch) |
673 | (uri (git-reference | |
674 | (url home-page) | |
675 | (commit (string-append "v" version)))) | |
43476625 | 676 | (file-name (git-file-name name version)) |
3b5783fc AB |
677 | (sha256 |
678 | (base32 | |
247a47bc | 679 | "0q0habjiy3h9cigb7q1br9kz6z212dn2ab31f6dgd3rrmsfn5rvb")))) |
4f85f7f7 | 680 | (build-system gnu-build-system) |
9a78e181 | 681 | (arguments |
7ed9c312 LC |
682 | `(#:make-flags '("GUILE_AUTO_COMPILE=0") ;to prevent guild warnings |
683 | ||
684 | #:phases (modify-phases %standard-phases | |
685 | (add-after 'install 'install-doc | |
686 | (lambda* (#:key outputs #:allow-other-keys) | |
687 | (let* ((out (assoc-ref outputs "out")) | |
688 | (package ,(package-full-name this-package "-")) | |
689 | (doc (string-append out "/share/doc/" package))) | |
690 | (install-file "README.md" doc) | |
691 | #t)))))) | |
726ecfeb | 692 | (native-inputs |
16e42db0 MO |
693 | `(("autoconf" ,autoconf) |
694 | ("automake" ,automake) | |
b9a9c8ef | 695 | ("pkg-config" ,pkg-config) |
b6bee63b | 696 | ("guile" ,guile-3.0))) |
3b5783fc | 697 | (inputs |
b6bee63b | 698 | `(("guile" ,guile-3.0))) |
3b5783fc AB |
699 | (synopsis "Structured access to bytevector contents for Guile") |
700 | (description | |
701 | "Guile bytestructures offers a system imitating the type system | |
702 | of the C programming language, to be used on bytevectors. C's type | |
703 | system works on raw memory, and Guile works on bytevectors which are | |
704 | an abstraction over raw memory. It's also more powerful than the C | |
705 | type system, elevating types to first-class status.") | |
abba4073 LC |
706 | (license license:gpl3+) |
707 | (properties '((upstream-name . "bytestructures"))))) | |
3b5783fc | 708 | |
726ecfeb LC |
709 | (define-public guile2.0-bytestructures |
710 | (package-for-guile-2.0 guile-bytestructures)) | |
711 | ||
b6bee63b LC |
712 | (define-public guile2.2-bytestructures |
713 | (package-for-guile-2.2 guile-bytestructures)) | |
714 | ||
715 | (define-deprecated-guile3.0-package guile3.0-bytestructures) | |
89a99d53 | 716 | |
bd233722 | 717 | (define-public guile-git |
e85035c9 LC |
718 | (package |
719 | (name "guile-git") | |
25623647 | 720 | (version "0.3.0") |
e85035c9 LC |
721 | (home-page "https://gitlab.com/guile-git/guile-git.git") |
722 | (source (origin | |
25623647 MB |
723 | (method url-fetch) |
724 | (uri (string-append "https://gitlab.com/guile-git/guile-git/uploads/" | |
725 | "4c563d8e7e1ff84396abe8ca7011bcaf/guile-git-" | |
726 | version ".tar.gz")) | |
e85035c9 LC |
727 | (sha256 |
728 | (base32 | |
25623647 | 729 | "0c5i3d16hp7gp9rd78vk9zc45js8bphf92m4lbb5gyi4l1yl7kkm")))) |
e85035c9 | 730 | (build-system gnu-build-system) |
3d867fea EF |
731 | (arguments |
732 | `(#:make-flags '("GUILE_AUTO_COMPILE=0"))) ; to prevent guild warnings | |
e85035c9 | 733 | (native-inputs |
96a9675b | 734 | `(("pkg-config" ,pkg-config) |
b6bee63b | 735 | ("guile" ,guile-3.0) |
96a9675b | 736 | ("guile-bytestructures" ,guile-bytestructures))) |
e85035c9 | 737 | (inputs |
b6bee63b | 738 | `(("guile" ,guile-3.0) |
e85035c9 LC |
739 | ("libgit2" ,libgit2))) |
740 | (propagated-inputs | |
741 | `(("guile-bytestructures" ,guile-bytestructures))) | |
742 | (synopsis "Guile bindings for libgit2") | |
743 | (description | |
744 | "This package provides Guile bindings to libgit2, a library to | |
bd233722 | 745 | manipulate repositories of the Git version control system.") |
e85035c9 | 746 | (license license:gpl3+))) |
c5793e7e | 747 | |
b6bee63b LC |
748 | (define-public guile2.2-git |
749 | (package-for-guile-2.2 guile-git)) | |
01c11aeb | 750 | |
70bc6085 | 751 | (define-public guile2.0-git |
60353203 LC |
752 | (let ((base (package-for-guile-2.0 guile-git))) |
753 | (package | |
754 | (inherit base) | |
755 | ;; Libgit2's Guile test driver requires (ice-9 textual-ports), which is | |
756 | ;; not in Guile 2.0. Thus, keep LIBGIT2 as-is here (i.e., built against | |
757 | ;; Guile 2.2). | |
758 | (inputs `(("libgit2" ,libgit2) | |
759 | ,@(srfi-1:alist-delete "libgit2" | |
760 | (package-inputs base))))))) | |
70bc6085 | 761 | |
b6bee63b LC |
762 | (define-deprecated-guile3.0-package guile3.0-git) |
763 | ||
1722d680 | 764 | ;;; guile.scm ends here |
a8307a17 | 765 |