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) | |
dd6b9a37 | 25 | #:use-module ((guix utils) #:select (%current-system)) |
1ffa7090 LC |
26 | #:use-module (gnu packages m4) |
27 | #:use-module (gnu packages multiprecision) | |
28 | #:use-module (gnu packages emacs) | |
29 | #:use-module (gnu packages texinfo) | |
e117772d LC |
30 | #:use-module (ice-9 match)) |
31 | ||
32 | (define-public mit-scheme | |
33 | (package | |
34 | (name "mit-scheme") | |
35 | (version "9.1.1") | |
36 | (source #f) ; see below | |
37 | (build-system gnu-build-system) | |
38 | (arguments | |
39 | `(#:tests? #f ; no "check" target | |
40 | #:phases | |
41 | (alist-replace | |
42 | 'unpack | |
43 | (lambda* (#:key inputs #:allow-other-keys) | |
44 | (and (zero? (system* "tar" "xzvf" | |
45 | (assoc-ref inputs "source"))) | |
46 | (chdir ,(string-append name "-" version)) | |
47 | (begin | |
48 | ;; Delete these dangling symlinks since they break | |
49 | ;; `patch-shebangs'. | |
50 | (for-each delete-file | |
51 | (append (find-files "src/lib/lib" "\\.so$") | |
52 | (find-files "src/lib" "^ffi-test"))) | |
53 | (chdir "src") | |
54 | #t))) | |
55 | (alist-replace | |
56 | 'build | |
57 | (lambda* (#:key system outputs #:allow-other-keys) | |
58 | (let ((out (assoc-ref outputs "out"))) | |
59 | (if (or (string-prefix? "x86_64" system) | |
60 | (string-prefix? "i686" system)) | |
61 | (zero? (system* "make" "compile-microcode")) | |
62 | (zero? (system* "./etc/make-liarc.sh" | |
63 | (string-append "--prefix=" out)))))) | |
64 | %standard-phases)))) | |
65 | (inputs | |
66 | `(;; TODO: Build doc when TeX Live is available. | |
67 | ;; ("automake" ,automake) | |
68 | ;; ("texlive-core" ,texlive-core) | |
69 | ("texinfo" ,texinfo) | |
70 | ("m4" ,m4) | |
71 | ||
72 | ("source" | |
dd6b9a37 LC |
73 | |
74 | ;; MIT/GNU Scheme is not bootstrappable, so it's recommended to | |
75 | ;; compile from the architecture-specific tarballs, which contain | |
76 | ;; pre-built binaries. It leads to more efficient code than when | |
77 | ;; building the tarball that contains generated C code instead of | |
78 | ;; those binaries. | |
79 | ,(origin | |
80 | (method url-fetch) | |
81 | (uri (string-append "mirror://gnu/mit-scheme/stable.pkg/" | |
82 | version "/mit-scheme-" | |
83 | version "-" | |
84 | (match (%current-system) | |
85 | ("x86_64-linux" "x86-64") | |
86 | ("i686-linux" "i386") | |
87 | (_ "c")) | |
88 | ".tar.gz")) | |
89 | (sha256 | |
90 | (match (%current-system) | |
91 | ("x86_64-linux" | |
92 | (base32 | |
93 | "1wcxm9hyfc53myvlcn93fyqrnnn4scwkknl9hkbp1cphc6mp291x")) | |
94 | ("i686-linux" | |
95 | (base32 | |
96 | "0vi760fy550d9db538m0vzbq1mpdncvw9g8bk4lswk0kcdira55z")) | |
97 | (_ | |
98 | (base32 | |
99 | "0pclakzwxbqgy6wqwvs6ml62wgby8ba8xzmwzdwhx1v8wv05yw1j")))))))) | |
e117772d LC |
100 | (home-page "http://www.gnu.org/software/mit-scheme/") |
101 | (synopsis "MIT/GNU Scheme, a native code Scheme compiler") | |
102 | (description | |
103 | "MIT/GNU Scheme is an implementation of the Scheme programming | |
104 | language, providing an interpreter, compiler, source-code debugger, | |
105 | integrated Emacs-like editor, and a large runtime library. MIT/GNU | |
106 | Scheme is best suited to programming large applications with a rapid | |
107 | development cycle.") | |
108 | (license gpl2+))) | |
109 | ||
110 | (define-public bigloo | |
111 | (package | |
112 | (name "bigloo") | |
66599195 | 113 | (version "4.0a") |
e117772d LC |
114 | (source (origin |
115 | (method url-fetch) | |
116 | (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Bigloo/bigloo" | |
117 | version ".tar.gz")) | |
118 | (sha256 | |
119 | (base32 | |
f992ead2 | 120 | "1771z43nmf9awjvlvrpjfhzcfxsbw2qipir8g9r47sygf2vn59yl")))) |
e117772d LC |
121 | (build-system gnu-build-system) |
122 | (arguments | |
123 | '(#:patches (list (assoc-ref %build-inputs "patch/shebangs")) | |
124 | #:test-target "test" | |
125 | #:phases (alist-replace | |
126 | 'configure | |
127 | (lambda* (#:key outputs #:allow-other-keys) | |
128 | ||
129 | (substitute* "configure" | |
130 | (("^shell=.*$") | |
131 | (string-append "shell=" (which "bash") "\n"))) | |
132 | ||
133 | ;; Those variables are used by libgc's `configure'. | |
134 | (setenv "SHELL" (which "bash")) | |
135 | (setenv "CONFIG_SHELL" (which "bash")) | |
136 | ||
137 | ;; The `configure' script doesn't understand options | |
138 | ;; of those of Autoconf. | |
139 | (let ((out (assoc-ref outputs "out"))) | |
140 | (zero? | |
141 | (system* "./configure" | |
142 | (string-append "--prefix=" out) | |
143 | (string-append"--mv=" (which "mv")) | |
144 | (string-append "--rm=" (which "rm")))))) | |
145 | (alist-cons-after | |
146 | 'patch 'patch-absolute-file-names | |
147 | (lambda _ | |
148 | (substitute* (cons "configure" | |
149 | (find-files "gc" "^install-gc")) | |
150 | (("/bin/rm") (which "rm")) | |
151 | (("/bin/mv") (which "mv")))) | |
152 | %standard-phases)))) | |
153 | (inputs | |
154 | `(("gmp" ,gmp) | |
155 | ("emacs" ,emacs) | |
156 | ("patch/shebangs" ,(search-patch "bigloo-gc-shebangs.patch")))) | |
157 | (home-page "http://www-sop.inria.fr/indes/fp/Bigloo/") | |
158 | (synopsis "Bigloo, an efficient Scheme compiler") | |
159 | (description | |
160 | "Bigloo is a Scheme implementation devoted to one goal: enabling | |
161 | Scheme based programming style where C(++) is usually | |
162 | required. Bigloo attempts to make Scheme practical by offering | |
163 | features usually presented by traditional programming languages | |
164 | but not offered by Scheme and functional programming. Bigloo | |
165 | compiles Scheme modules. It delivers small and fast stand alone | |
166 | binary executables. Bigloo enables full connections between | |
167 | Scheme and C programs, between Scheme and Java programs, and | |
168 | between Scheme and C# programs.") | |
169 | (license gpl2+))) |