Add (guix download) and (guix build download).
[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)
c44899a2
LC
20 #:use-module (distro)
21 #:use-module (distro packages bdw-gc)
22 #:use-module (distro packages gawk)
1627f7f7 23 #:use-module (distro packages gperf)
c44899a2
LC
24 #:use-module (distro packages libffi)
25 #:use-module (distro packages libtool)
26 #:use-module (distro packages libunistring)
27 #:use-module (distro packages m4)
28 #:use-module (distro packages multiprecision)
29 #:use-module (distro packages pkg-config)
30 #:use-module (distro packages readline)
1722d680
LC
31 #:use-module (guix packages)
32 #:use-module (guix http)
1722d680
LC
33 #:use-module (guix build-system gnu))
34
35;;; Commentary:
36;;;
c44899a2 37;;; GNU Guile, and modules and extensions.
1722d680
LC
38;;;
39;;; Code:
40
c44899a2
LC
41(define-public guile-1.8
42 (package
43 (name "guile")
44 (version "1.8.8")
45 (source (origin
46 (method http-fetch)
47 (uri (string-append "http://ftp.gnu.org/gnu/guile/guile-" version
48 ".tar.gz"))
49 (sha256
50 (base32
51 "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3"))))
52 (build-system gnu-build-system)
53 (arguments '(#:configure-flags '("--disable-error-on-warning")
54 #:patches (list (assoc-ref %build-inputs "patch/snarf"))
55
56 ;; Insert a phase before `configure' to patch things up.
57 #:phases (alist-cons-before
58 'configure
59 'patch-loader-search-path
60 (lambda* (#:key outputs #:allow-other-keys)
61 ;; Add a call to `lt_dladdsearchdir' so that
62 ;; `libguile-readline.so' & co. are in the
63 ;; loader's search path.
64 (substitute* "libguile/dynl.c"
65 (("lt_dlinit.*$" match)
66 (format #f
67 " ~a~% lt_dladdsearchdir(\"~a/lib\");~%"
68 match
69 (assoc-ref outputs "out")))))
70 %standard-phases)))
71 (inputs `(("patch/snarf" ,(search-patch "guile-1.8-cpp-4.5.patch"))
72 ("gawk" ,gawk)
73 ("readline" ,readline)))
74
75 ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be
76 ;; propagated.
77 (propagated-inputs `(("gmp" ,gmp)
78 ("libtool" ,libtool)))
79
80 ;; When cross-compiling, a native version of Guile itself is needed.
81 (self-native-input? #t)
82
83 (synopsis "GNU Guile 1.8, an embeddable Scheme interpreter")
84 (description
85"GNU Guile 1.8 is an interpreter for the Scheme programming language,
86packaged as a library that can be embedded into programs to make them
87extensible. It supports many SRFIs.")
88 (home-page "http://www.gnu.org/software/guile/")
89 (license "LGPLv2+")))
90
91(define-public guile-2.0
92 (package
93 (name "guile")
94 (version "2.0.6")
95 (source (origin
96 (method http-fetch)
97 (uri (string-append "http://ftp.gnu.org/gnu/guile/guile-" version
98 ".tar.xz"))
99 (sha256
100 (base32
101 "000ng5qsq3cl1k35jvzvhwxj92wx4q87745n2fppkd4irh58vv5l"))))
102 (build-system gnu-build-system)
103 (native-inputs `(("pkgconfig" ,pkg-config)))
104 (inputs `(("libffi" ,libffi)
105 ("readline" ,readline)))
106
107 (propagated-inputs
108 `( ;; These ones aren't normally needed here, but since `libguile-2.0.la'
109 ;; reads `-lltdl -lunistring', adding them here will add the needed
110 ;; `-L' flags. As for why the `.la' file lacks the `-L' flags, see
111 ;; <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903>.
112 ("libunistring" ,libunistring)
113 ("libtool" ,libtool)
114
115 ;; The headers and/or `guile-2.0.pc' refer to these packages, so they
116 ;; must be propagated.
117 ("bdw-gc" ,libgc)
118 ("gmp" ,gmp)))
119
120 (self-native-input? #t)
121
122 (synopsis "GNU Guile 2.0, an embeddable Scheme implementation")
123 (description
124"GNU Guile is an implementation of the Scheme programming language, with
125support for many SRFIs, packaged for use in a wide variety of environments.
126In addition to implementing the R5RS Scheme standard and a large subset of
127R6RS, Guile includes a module system, full access to POSIX system calls,
128networking support, multiple threads, dynamic linking, a foreign function
129call interface, and powerful string processing.")
130 (home-page "http://www.gnu.org/software/guile/")
131 (license "LGPLv3+")))
132
133\f
134;;;
135;;; Extensions.
136;;;
137
1722d680
LC
138(define (guile-reader guile)
139 "Build Guile-Reader against GUILE, a package of some version of Guile 1.8
140or 2.0."
141 (package
142 (name (string-append "guile-reader-for-guile-" (package-version guile)))
143 (version "0.6")
144 (source (origin
145 (method http-fetch)
146 (uri (string-append
147 "http://download-mirror.savannah.gnu.org/releases/guile-reader/guile-reader-"
148 version ".tar.gz"))
149 (sha256
150 (base32
151 "1svlyk5pm4fsdp2g7n6qffdl6fdggxnlicj0jn9s4lxd63gzxy1n"))))
152 (build-system gnu-build-system)
cb0d69ed 153 (native-inputs `(("pkgconfig" ,pkg-config)
1627f7f7 154 ("gperf" ,gperf)))
1722d680 155 (inputs `(("guile" ,guile)))
d45122f5 156 (synopsis "Guile-Reader, a simple framework for building readers for
1722d680 157GNU Guile")
d45122f5 158 (description
1722d680
LC
159"Guile-Reader is a simple framework for building readers for GNU Guile.
160
161The idea is to make it easy to build procedures that extend Guile’s read
162procedure. Readers supporting various syntax variants can easily be written,
163possibly by re-using existing “token readers” of a standard Scheme
164readers. For example, it is used to implement Skribilo’s R5RS-derived
165document syntax.
166
167Guile-Reader’s approach is similar to Common Lisp’s “read table”, but
168hopefully more powerful and flexible (for instance, one may instantiate as
169many readers as needed).")
170 (home-page "http://www.nongnu.org/guile-reader/")
171 (license "GPLv3+")))
172
173(define-public guile-reader/guile-1.8
174 ;; Guile-Reader built against Guile 1.8.
175 (guile-reader guile-1.8))
176
177(define-public guile-reader/guile-2.0
178 ;; Guile-Reader built against Guile 2.0.
179 (guile-reader guile-2.0))
180
181;;; guile.scm ends here