Commit | Line | Data |
---|---|---|
e117772d LC |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org> | |
3 | ;;; | |
4 | ;;; This file is part of GNU Guix. | |
5 | ;;; | |
6 | ;;; GNU 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 | ;;; GNU 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 GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
18 | ||
1ffa7090 | 19 | (define-module (gnu packages scheme) |
59a43334 | 20 | #:use-module (gnu packages) |
e117772d LC |
21 | #:use-module (guix licenses) |
22 | #:use-module (guix packages) | |
23 | #:use-module (guix download) | |
24 | #:use-module (guix build-system gnu) | |
1ffa7090 LC |
25 | #:use-module (gnu packages m4) |
26 | #:use-module (gnu packages multiprecision) | |
27 | #:use-module (gnu packages emacs) | |
28 | #:use-module (gnu packages texinfo) | |
d8707db0 | 29 | #:use-module (gnu packages patchelf) |
e6e82f62 | 30 | #:use-module (gnu packages which) |
cf53ecf5 LC |
31 | #:use-module (gnu packages pkg-config) |
32 | #:use-module (gnu packages avahi) | |
33 | #:use-module (gnu packages libphidget) | |
e117772d LC |
34 | #:use-module (ice-9 match)) |
35 | ||
36 | (define-public mit-scheme | |
37 | (package | |
38 | (name "mit-scheme") | |
39 | (version "9.1.1") | |
40 | (source #f) ; see below | |
41 | (build-system gnu-build-system) | |
42 | (arguments | |
43 | `(#:tests? #f ; no "check" target | |
44 | #:phases | |
45 | (alist-replace | |
46 | 'unpack | |
47 | (lambda* (#:key inputs #:allow-other-keys) | |
48 | (and (zero? (system* "tar" "xzvf" | |
49 | (assoc-ref inputs "source"))) | |
50 | (chdir ,(string-append name "-" version)) | |
51 | (begin | |
52 | ;; Delete these dangling symlinks since they break | |
53 | ;; `patch-shebangs'. | |
54 | (for-each delete-file | |
55 | (append (find-files "src/lib/lib" "\\.so$") | |
56 | (find-files "src/lib" "^ffi-test"))) | |
57 | (chdir "src") | |
58 | #t))) | |
59 | (alist-replace | |
60 | 'build | |
61 | (lambda* (#:key system outputs #:allow-other-keys) | |
62 | (let ((out (assoc-ref outputs "out"))) | |
63 | (if (or (string-prefix? "x86_64" system) | |
64 | (string-prefix? "i686" system)) | |
65 | (zero? (system* "make" "compile-microcode")) | |
66 | (zero? (system* "./etc/make-liarc.sh" | |
67 | (string-append "--prefix=" out)))))) | |
68 | %standard-phases)))) | |
69 | (inputs | |
70 | `(;; TODO: Build doc when TeX Live is available. | |
71 | ;; ("automake" ,automake) | |
72 | ;; ("texlive-core" ,texlive-core) | |
73 | ("texinfo" ,texinfo) | |
74 | ("m4" ,m4) | |
75 | ||
76 | ("source" | |
dd6b9a37 LC |
77 | |
78 | ;; MIT/GNU Scheme is not bootstrappable, so it's recommended to | |
79 | ;; compile from the architecture-specific tarballs, which contain | |
80 | ;; pre-built binaries. It leads to more efficient code than when | |
81 | ;; building the tarball that contains generated C code instead of | |
82 | ;; those binaries. | |
83 | ,(origin | |
84 | (method url-fetch) | |
85 | (uri (string-append "mirror://gnu/mit-scheme/stable.pkg/" | |
86 | version "/mit-scheme-" | |
87 | version "-" | |
88 | (match (%current-system) | |
89 | ("x86_64-linux" "x86-64") | |
90 | ("i686-linux" "i386") | |
91 | (_ "c")) | |
92 | ".tar.gz")) | |
93 | (sha256 | |
94 | (match (%current-system) | |
95 | ("x86_64-linux" | |
96 | (base32 | |
97 | "1wcxm9hyfc53myvlcn93fyqrnnn4scwkknl9hkbp1cphc6mp291x")) | |
98 | ("i686-linux" | |
99 | (base32 | |
100 | "0vi760fy550d9db538m0vzbq1mpdncvw9g8bk4lswk0kcdira55z")) | |
101 | (_ | |
102 | (base32 | |
103 | "0pclakzwxbqgy6wqwvs6ml62wgby8ba8xzmwzdwhx1v8wv05yw1j")))))))) | |
e117772d | 104 | (home-page "http://www.gnu.org/software/mit-scheme/") |
f50d2669 | 105 | (synopsis "Scheme implementation with integrated editor and debugger") |
e117772d LC |
106 | (description |
107 | "MIT/GNU Scheme is an implementation of the Scheme programming | |
108 | language, providing an interpreter, compiler, source-code debugger, | |
109 | integrated Emacs-like editor, and a large runtime library. MIT/GNU | |
110 | Scheme is best suited to programming large applications with a rapid | |
111 | development cycle.") | |
112 | (license gpl2+))) | |
113 | ||
114 | (define-public bigloo | |
115 | (package | |
116 | (name "bigloo") | |
66599195 | 117 | (version "4.0a") |
e117772d LC |
118 | (source (origin |
119 | (method url-fetch) | |
120 | (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Bigloo/bigloo" | |
121 | version ".tar.gz")) | |
122 | (sha256 | |
123 | (base32 | |
f992ead2 | 124 | "1771z43nmf9awjvlvrpjfhzcfxsbw2qipir8g9r47sygf2vn59yl")))) |
e117772d LC |
125 | (build-system gnu-build-system) |
126 | (arguments | |
127 | '(#:patches (list (assoc-ref %build-inputs "patch/shebangs")) | |
128 | #:test-target "test" | |
129 | #:phases (alist-replace | |
130 | 'configure | |
131 | (lambda* (#:key outputs #:allow-other-keys) | |
132 | ||
133 | (substitute* "configure" | |
134 | (("^shell=.*$") | |
135 | (string-append "shell=" (which "bash") "\n"))) | |
136 | ||
137 | ;; Those variables are used by libgc's `configure'. | |
138 | (setenv "SHELL" (which "bash")) | |
139 | (setenv "CONFIG_SHELL" (which "bash")) | |
140 | ||
141 | ;; The `configure' script doesn't understand options | |
142 | ;; of those of Autoconf. | |
143 | (let ((out (assoc-ref outputs "out"))) | |
144 | (zero? | |
145 | (system* "./configure" | |
146 | (string-append "--prefix=" out) | |
147 | (string-append"--mv=" (which "mv")) | |
148 | (string-append "--rm=" (which "rm")))))) | |
149 | (alist-cons-after | |
150 | 'patch 'patch-absolute-file-names | |
151 | (lambda _ | |
152 | (substitute* (cons "configure" | |
153 | (find-files "gc" "^install-gc")) | |
154 | (("/bin/rm") (which "rm")) | |
155 | (("/bin/mv") (which "mv")))) | |
0e7aac44 LC |
156 | (alist-cons-after |
157 | 'install 'install-emacs-modes | |
158 | (lambda* (#:key outputs #:allow-other-keys) | |
159 | (let* ((out (assoc-ref outputs "out")) | |
160 | (dir (string-append out "/share/emacs/site-lisp"))) | |
161 | (zero? (system* "make" "-C" "bmacs" "all" "install" | |
162 | (string-append "EMACSBRAND=emacs24") | |
163 | (string-append "EMACSDIR=" dir))))) | |
164 | %standard-phases))))) | |
e117772d | 165 | (inputs |
10879c4e | 166 | `(("emacs" ,emacs) |
cf53ecf5 LC |
167 | ("patch/shebangs" ,(search-patch "bigloo-gc-shebangs.patch")) |
168 | ||
169 | ;; Optional APIs for which Bigloo has bindings. | |
170 | ("avahi" ,avahi) | |
171 | ("libphidget" ,libphidget))) | |
172 | (native-inputs | |
173 | `(("pkg-config" ,pkg-config))) | |
10879c4e LC |
174 | (propagated-inputs |
175 | `(("gmp" ,gmp))) ; bigloo.h refers to gmp.h | |
e117772d LC |
176 | (home-page "http://www-sop.inria.fr/indes/fp/Bigloo/") |
177 | (synopsis "Bigloo, an efficient Scheme compiler") | |
178 | (description | |
179 | "Bigloo is a Scheme implementation devoted to one goal: enabling | |
180 | Scheme based programming style where C(++) is usually | |
181 | required. Bigloo attempts to make Scheme practical by offering | |
182 | features usually presented by traditional programming languages | |
183 | but not offered by Scheme and functional programming. Bigloo | |
184 | compiles Scheme modules. It delivers small and fast stand alone | |
185 | binary executables. Bigloo enables full connections between | |
186 | Scheme and C programs, between Scheme and Java programs, and | |
187 | between Scheme and C# programs.") | |
188 | (license gpl2+))) | |
e6e82f62 LC |
189 | |
190 | (define-public hop | |
191 | (package | |
192 | (name "hop") | |
193 | (version "2.4.0") | |
194 | (source (origin | |
195 | (method url-fetch) | |
196 | (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Hop/hop-" | |
197 | version ".tar.gz")) | |
198 | (sha256 | |
199 | (base32 | |
200 | "04fhy5jp9lq12fmdqfjzj1w32f7nxc80fagbj7pfci7xh86nm2c5")))) | |
201 | (build-system gnu-build-system) | |
202 | (arguments | |
d8707db0 LC |
203 | '(#:phases |
204 | (alist-replace | |
205 | 'configure | |
206 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
207 | (let ((out (assoc-ref outputs "out"))) | |
208 | (zero? | |
209 | (system* "./configure" | |
210 | (string-append"--prefix=" out))))) | |
211 | (alist-cons-after | |
212 | 'strip 'patch-rpath | |
213 | (lambda* (#:key outputs #:allow-other-keys) | |
214 | ;; Patch the RPATH of every installed library to point to $out/lib | |
215 | ;; instead of $TMPDIR. Note that "patchelf --set-rpath" produces | |
216 | ;; invalid binaries when used before stripping. | |
217 | (let ((out (assoc-ref outputs "out")) | |
218 | (tmpdir (getcwd))) | |
219 | (every (lambda (lib) | |
220 | (let* ((in (open-pipe* OPEN_READ "patchelf" | |
221 | "--print-rpath" lib)) | |
222 | (rpath (read-line in))) | |
223 | (and (zero? (close-pipe in)) | |
224 | (let ((rpath* (regexp-substitute/global | |
225 | #f (regexp-quote tmpdir) rpath | |
226 | 'pre out 'post))) | |
227 | (or (equal? rpath rpath*) | |
228 | (begin | |
229 | (format #t "~a: changing RPATH from `~a' to `~a'~%" | |
230 | lib rpath rpath*) | |
231 | (zero? | |
232 | (system* "patchelf" "--set-rpath" | |
233 | rpath* lib)))))))) | |
234 | (append (find-files (string-append out "/bin") | |
235 | ".*") | |
236 | (find-files (string-append out "/lib") | |
237 | "\\.so$"))))) | |
238 | %standard-phases)) | |
239 | #:tests? #f ; no test suite | |
240 | #:modules ((guix build gnu-build-system) | |
241 | (guix build utils) | |
242 | (ice-9 popen) | |
243 | (ice-9 regex) | |
244 | (ice-9 rdelim) | |
245 | (srfi srfi-1)))) | |
e6e82f62 | 246 | (inputs `(("bigloo" ,bigloo) |
d8707db0 LC |
247 | ("which" ,which) |
248 | ("patchelf" ,patchelf))) | |
e6e82f62 LC |
249 | (home-page "http://hop.inria.fr/") |
250 | (synopsis "A multi-tier programming language for the Web 2.0") | |
251 | (description | |
252 | "HOP is a multi-tier programming language for the Web 2.0 and the | |
253 | so-called diffuse Web. It is designed for programming interactive web | |
254 | applications in many fields such as multimedia (web galleries, music players, | |
255 | ...), ubiquitous and house automation (SmartPhones, personal appliance), | |
256 | mashups, office (web agendas, mail clients, ...), etc.") | |
257 | (license gpl2+))) |