build-system/gnu: Patch shebangs after `configure'.
[jackhill/guix/guix.git] / distro / packages / guile.scm
CommitLineData
1722d680
LC
1;;; Guix --- Nix package management from Guile. -*- coding: utf-8 -*-
2;;; Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
3;;;
4;;; This file is part of Guix.
5;;;
6;;; Guix is free software; you can redistribute it and/or modify it
7;;; under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 3 of the License, or (at
9;;; your option) any later version.
10;;;
11;;; Guix is distributed in the hope that it will be useful, but
12;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with Guix. If not, see <http://www.gnu.org/licenses/>.
18
19(define-module (distro packages guile)
4a44e743 20 #:use-module (guix licenses)
c44899a2
LC
21 #:use-module (distro)
22 #:use-module (distro packages bdw-gc)
23 #:use-module (distro packages gawk)
1627f7f7 24 #:use-module (distro packages gperf)
c44899a2 25 #:use-module (distro packages libffi)
36d4d49e 26 #:use-module (distro packages autotools)
c44899a2
LC
27 #:use-module (distro packages libunistring)
28 #:use-module (distro packages m4)
29 #:use-module (distro packages multiprecision)
30 #:use-module (distro packages pkg-config)
31 #:use-module (distro packages readline)
1722d680 32 #:use-module (guix packages)
87f5d366 33 #:use-module (guix download)
1722d680
LC
34 #:use-module (guix build-system gnu))
35
36;;; Commentary:
37;;;
c44899a2 38;;; GNU Guile, and modules and extensions.
1722d680
LC
39;;;
40;;; Code:
41
c44899a2
LC
42(define-public guile-1.8
43 (package
44 (name "guile")
45 (version "1.8.8")
46 (source (origin
87f5d366 47 (method url-fetch)
0db342a5 48 (uri (string-append "mirror://gnu/guile/guile-" version
c44899a2
LC
49 ".tar.gz"))
50 (sha256
51 (base32
52 "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3"))))
53 (build-system gnu-build-system)
54 (arguments '(#:configure-flags '("--disable-error-on-warning")
55 #:patches (list (assoc-ref %build-inputs "patch/snarf"))
56
57 ;; Insert a phase before `configure' to patch things up.
58 #:phases (alist-cons-before
59 'configure
60 'patch-loader-search-path
61 (lambda* (#:key outputs #:allow-other-keys)
62 ;; Add a call to `lt_dladdsearchdir' so that
63 ;; `libguile-readline.so' & co. are in the
64 ;; loader's search path.
65 (substitute* "libguile/dynl.c"
66 (("lt_dlinit.*$" match)
67 (format #f
68 " ~a~% lt_dladdsearchdir(\"~a/lib\");~%"
69 match
70 (assoc-ref outputs "out")))))
71 %standard-phases)))
72 (inputs `(("patch/snarf" ,(search-patch "guile-1.8-cpp-4.5.patch"))
73 ("gawk" ,gawk)
74 ("readline" ,readline)))
75
76 ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be
77 ;; propagated.
78 (propagated-inputs `(("gmp" ,gmp)
79 ("libtool" ,libtool)))
80
81 ;; When cross-compiling, a native version of Guile itself is needed.
82 (self-native-input? #t)
83
84 (synopsis "GNU Guile 1.8, an embeddable Scheme interpreter")
85 (description
86"GNU Guile 1.8 is an interpreter for the Scheme programming language,
87packaged as a library that can be embedded into programs to make them
88extensible. It supports many SRFIs.")
89 (home-page "http://www.gnu.org/software/guile/")
4a44e743 90 (license lgpl2.0+)))
c44899a2
LC
91
92(define-public guile-2.0
93 (package
94 (name "guile")
3af4e053 95 (version "2.0.7")
c44899a2 96 (source (origin
87f5d366 97 (method url-fetch)
0db342a5 98 (uri (string-append "mirror://gnu/guile/guile-" version
c44899a2
LC
99 ".tar.xz"))
100 (sha256
101 (base32
3af4e053 102 "0f53pxkia4v17n0avwqlcjpy0n89hkazm2xsa6p84lv8k6k8y9vg"))))
c44899a2
LC
103 (build-system gnu-build-system)
104 (native-inputs `(("pkgconfig" ,pkg-config)))
105 (inputs `(("libffi" ,libffi)
106 ("readline" ,readline)))
107
108 (propagated-inputs
109 `( ;; These ones aren't normally needed here, but since `libguile-2.0.la'
110 ;; reads `-lltdl -lunistring', adding them here will add the needed
111 ;; `-L' flags. As for why the `.la' file lacks the `-L' flags, see
112 ;; <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903>.
113 ("libunistring" ,libunistring)
114 ("libtool" ,libtool)
115
116 ;; The headers and/or `guile-2.0.pc' refer to these packages, so they
117 ;; must be propagated.
118 ("bdw-gc" ,libgc)
119 ("gmp" ,gmp)))
120
121 (self-native-input? #t)
122
123 (synopsis "GNU Guile 2.0, an embeddable Scheme implementation")
124 (description
125"GNU Guile is an implementation of the Scheme programming language, with
126support for many SRFIs, packaged for use in a wide variety of environments.
127In addition to implementing the R5RS Scheme standard and a large subset of
128R6RS, Guile includes a module system, full access to POSIX system calls,
129networking support, multiple threads, dynamic linking, a foreign function
130call interface, and powerful string processing.")
131 (home-page "http://www.gnu.org/software/guile/")
4a44e743 132 (license lgpl3+)))
c44899a2 133
fa29b199
LC
134(define-public guile-2.0/fixed
135 ;; A package of Guile 2.0 that's rarely changed. It is the one used
136 ;; in the `base' module, and thus changing it entails a full rebuild.
325285d5 137 guile-2.0)
fa29b199 138
c44899a2
LC
139\f
140;;;
141;;; Extensions.
142;;;
143
1722d680
LC
144(define (guile-reader guile)
145 "Build Guile-Reader against GUILE, a package of some version of Guile 1.8
146or 2.0."
147 (package
148 (name (string-append "guile-reader-for-guile-" (package-version guile)))
149 (version "0.6")
150 (source (origin
87f5d366 151 (method url-fetch)
1722d680
LC
152 (uri (string-append
153 "http://download-mirror.savannah.gnu.org/releases/guile-reader/guile-reader-"
154 version ".tar.gz"))
155 (sha256
156 (base32
157 "1svlyk5pm4fsdp2g7n6qffdl6fdggxnlicj0jn9s4lxd63gzxy1n"))))
158 (build-system gnu-build-system)
cb0d69ed 159 (native-inputs `(("pkgconfig" ,pkg-config)
1627f7f7 160 ("gperf" ,gperf)))
1722d680 161 (inputs `(("guile" ,guile)))
d45122f5 162 (synopsis "Guile-Reader, a simple framework for building readers for
1722d680 163GNU Guile")
d45122f5 164 (description
1722d680
LC
165"Guile-Reader is a simple framework for building readers for GNU Guile.
166
167The idea is to make it easy to build procedures that extend Guile’s read
168procedure. Readers supporting various syntax variants can easily be written,
169possibly by re-using existing “token readers” of a standard Scheme
170readers. For example, it is used to implement Skribilo’s R5RS-derived
171document syntax.
172
173Guile-Reader’s approach is similar to Common Lisp’s “read table”, but
174hopefully more powerful and flexible (for instance, one may instantiate as
175many readers as needed).")
176 (home-page "http://www.nongnu.org/guile-reader/")
4a44e743 177 (license gpl3+)))
1722d680
LC
178
179(define-public guile-reader/guile-1.8
180 ;; Guile-Reader built against Guile 1.8.
181 (guile-reader guile-1.8))
182
183(define-public guile-reader/guile-2.0
184 ;; Guile-Reader built against Guile 2.0.
185 (guile-reader guile-2.0))
186
187;;; guile.scm ends here