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