Commit | Line | Data |
---|---|---|
f842bbed JD |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2014 John Darrington <jmd@gnu.org> | |
00ab9458 | 3 | ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com> |
e396976b | 4 | ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> |
05f5ce0c | 5 | ;;; Copyright © 2016 Federico Beffa <beffa@fbengineering.ch> |
4a78fd46 | 6 | ;;; Copyright © 2016, 2017 Nils Gillmann <ng0@n0.is> |
14afc7b8 | 7 | ;;; Copyright © 2016, 2017 Andy Patterson <ajpatter@uwaterloo.ca> |
636c77d0 | 8 | ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net> |
f3cd6633 | 9 | ;;; Copyright © 2017, 2018 Efraim Flashner <efraim@flashner.co.il> |
5dff0752 | 10 | ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr> |
56c240ba | 11 | ;;; Copyright © 2018 Benjamin Slade <slade@jnanam.net> |
f842bbed JD |
12 | ;;; |
13 | ;;; This file is part of GNU Guix. | |
14 | ;;; | |
15 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
16 | ;;; under the terms of the GNU General Public License as published by | |
17 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
18 | ;;; your option) any later version. | |
19 | ;;; | |
20 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
21 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
22 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
23 | ;;; GNU General Public License for more details. | |
24 | ;;; | |
25 | ;;; You should have received a copy of the GNU General Public License | |
26 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
27 | ||
28 | (define-module (gnu packages lisp) | |
29 | #:use-module (gnu packages) | |
b5b73a82 | 30 | #:use-module ((guix licenses) #:prefix license:) |
f842bbed JD |
31 | #:use-module (guix packages) |
32 | #:use-module (gnu packages readline) | |
33 | #:use-module (gnu packages texinfo) | |
8f9ac901 | 34 | #:use-module (gnu packages tex) |
f842bbed JD |
35 | #:use-module (gnu packages m4) |
36 | #:use-module (guix download) | |
423eef36 | 37 | #:use-module (guix git-download) |
f473b8f1 | 38 | #:use-module (guix hg-download) |
f842bbed | 39 | #:use-module (guix utils) |
00ab9458 | 40 | #:use-module (guix build-system gnu) |
a72debb7 | 41 | #:use-module (guix build-system asdf) |
e3e171ee | 42 | #:use-module (guix build-system trivial) |
ce0614dd | 43 | #:use-module (gnu packages base) |
05c63898 | 44 | #:use-module (gnu packages compression) |
45 | #:use-module (gnu packages fontutils) | |
46 | #:use-module (gnu packages maths) | |
00ab9458 | 47 | #:use-module (gnu packages multiprecision) |
f473b8f1 | 48 | #:use-module (gnu packages ncurses) |
00ab9458 | 49 | #:use-module (gnu packages bdw-gc) |
560f51d0 TUBK |
50 | #:use-module (gnu packages libffi) |
51 | #:use-module (gnu packages libffcall) | |
52 | #:use-module (gnu packages readline) | |
05c63898 | 53 | #:use-module (gnu packages sdl) |
b702b52d | 54 | #:use-module (gnu packages libsigsegv) |
05c63898 | 55 | #:use-module (gnu packages linux) |
b702b52d | 56 | #:use-module (gnu packages admin) |
531a9aac | 57 | #:use-module (gnu packages ed) |
05c63898 | 58 | #:use-module (gnu packages gl) |
59 | #:use-module (gnu packages gcc) | |
60 | #:use-module (gnu packages glib) | |
61 | #:use-module (gnu packages gettext) | |
531a9aac | 62 | #:use-module (gnu packages m4) |
05c63898 | 63 | #:use-module (gnu packages pkg-config) |
531a9aac | 64 | #:use-module (gnu packages version-control) |
05c63898 | 65 | #:use-module (gnu packages xorg) |
56c240ba | 66 | #:use-module (gnu packages perl) |
419fb3f1 | 67 | #:use-module (ice-9 match) |
68 | #:use-module (srfi srfi-1)) | |
f842bbed | 69 | |
8d0489ae AP |
70 | (define (asdf-substitutions lisp) |
71 | ;; Prepend XDG_DATA_DIRS/LISP-bundle-systems to ASDF's | |
72 | ;; 'default-system-source-registry'. | |
73 | `((("\\(,dir \"systems/\"\\)\\)") | |
74 | (format #f | |
75 | "(,dir \"~a-bundle-systems\"))) | |
76 | ||
77 | ,@(loop :for dir :in (xdg-data-dirs \"common-lisp/\") | |
78 | :collect `(:directory (,dir \"systems\"))" | |
79 | ,lisp)))) | |
80 | ||
f842bbed | 81 | (define-public gcl |
dd0134fc KK |
82 | (let ((commit "5956140b1083e2302a59d7ce2054b0b7c2cbb417") |
83 | (revision "1")) ;Guix package revision | |
84 | (package | |
85 | (name "gcl") | |
86 | (version (string-append "2.6.12-" revision "." | |
87 | (string-take commit 7))) | |
88 | (source | |
89 | (origin | |
90 | (method git-fetch) | |
91 | (uri (git-reference | |
92 | (url "https://git.savannah.gnu.org/r/gcl.git") | |
93 | (commit commit))) | |
94 | (file-name (string-append "gcl-" version "-checkout")) | |
95 | (sha256 | |
96 | (base32 "0mwclf2879mh3d9xqkqhghf58lwy7srsnsq9x0f1cc6j302sy4hb")))) | |
97 | (build-system gnu-build-system) | |
98 | (arguments | |
99 | `(#:parallel-build? #f ; The build system seems not to be thread safe. | |
100 | #:tests? #f ; There does not seem to be make check or anything similar. | |
101 | #:configure-flags '("--enable-ansi") ; required for use by the maxima package | |
102 | #:make-flags (list | |
103 | (string-append "GCL_CC=" (assoc-ref %build-inputs "gcc") | |
104 | "/bin/gcc") | |
105 | (string-append "CC=" (assoc-ref %build-inputs "gcc") | |
106 | "/bin/gcc")) | |
107 | #:phases | |
108 | (modify-phases %standard-phases | |
109 | (add-before 'configure 'pre-conf | |
110 | (lambda* (#:key inputs #:allow-other-keys) | |
111 | (chdir "gcl") | |
112 | (substitute* | |
113 | (append | |
114 | '("pcl/impl/kcl/makefile.akcl" | |
115 | "add-defs" | |
116 | "unixport/makefile.dos" | |
117 | "add-defs.bat" | |
118 | "gcl-tk/makefile.prev" | |
119 | "add-defs1") | |
120 | (find-files "h" "\\.defs")) | |
121 | (("SHELL=/bin/bash") | |
122 | (string-append "SHELL=" (which "bash"))) | |
123 | (("SHELL=/bin/sh") | |
124 | (string-append "SHELL=" (which "sh")))) | |
125 | (substitute* "h/linux.defs" | |
126 | (("#CC") "CC") | |
127 | (("-fwritable-strings") "") | |
128 | (("-Werror") "")) | |
129 | (substitute* "lsp/gcl_top.lsp" | |
130 | (("\"cc\"") | |
131 | (string-append "\"" (assoc-ref %build-inputs "gcc") | |
132 | "/bin/gcc\"")) | |
133 | (("\\(or \\(get-path \\*cc\\*\\) \\*cc\\*\\)") "*cc*") | |
134 | (("\"ld\"") | |
135 | (string-append "\"" (assoc-ref %build-inputs "binutils") | |
136 | "/bin/ld\"")) | |
137 | (("\\(or \\(get-path \\*ld\\*\\) \\*ld\\*\\)") "*ld*") | |
138 | (("\\(get-path \"objdump --source \"\\)") | |
139 | (string-append "\"" (assoc-ref %build-inputs "binutils") | |
140 | "/bin/objdump --source \""))) | |
141 | #t)) | |
142 | (add-after 'install 'wrap | |
143 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
144 | (let* ((gcl (assoc-ref outputs "out")) | |
145 | (input-path (lambda (lib path) | |
146 | (string-append | |
147 | (assoc-ref inputs lib) path))) | |
148 | (binaries '("binutils"))) | |
149 | ;; GCC and the GNU binutils are necessary for GCL to be | |
150 | ;; able to compile Lisp functions and programs (this is | |
151 | ;; a standard feature in Common Lisp). While the | |
152 | ;; the location of GCC is specified in the make-flags, | |
153 | ;; the GNU binutils must be available in GCL's $PATH. | |
154 | (wrap-program (string-append gcl "/bin/gcl") | |
155 | `("PATH" prefix ,(map (lambda (binary) | |
156 | (input-path binary "/bin")) | |
157 | binaries)))) | |
158 | #t)) | |
159 | ;; drop strip phase to make maxima build, see | |
160 | ;; https://www.ma.utexas.edu/pipermail/maxima/2008/009769.html | |
161 | (delete 'strip)))) | |
162 | (inputs | |
163 | `(("gmp" ,gmp) | |
164 | ("readline" ,readline))) | |
165 | (native-inputs | |
166 | `(("gcc" ,gcc-4.9) | |
167 | ("m4" ,m4) | |
168 | ("texinfo" ,texinfo) | |
169 | ("texlive" ,texlive))) | |
170 | (home-page "https://www.gnu.org/software/gcl/") | |
171 | (synopsis "A Common Lisp implementation") | |
172 | (description "GCL is an implementation of the Common Lisp language. It | |
f842bbed JD |
173 | features the ability to compile to native object code and to load native |
174 | object code modules directly into its lisp core. It also features a | |
175 | stratified garbage collection strategy, a source-level debugger and a built-in | |
176 | interface to the Tk widget system.") | |
dd0134fc | 177 | (license license:lgpl2.0+)))) |
f842bbed | 178 | |
00ab9458 TUBK |
179 | (define-public ecl |
180 | (package | |
181 | (name "ecl") | |
108f69c4 | 182 | (version "16.1.3") |
00ab9458 TUBK |
183 | (source |
184 | (origin | |
185 | (method url-fetch) | |
e0524511 AP |
186 | (uri (string-append |
187 | "https://common-lisp.net/project/ecl/static/files/release/" | |
188 | name "-" version ".tgz")) | |
00ab9458 | 189 | (sha256 |
108f69c4 | 190 | (base32 "0m0j24w5d5a9dwwqyrg0d35c0nys16ijb4r0nyk87yp82v38b9bn")) |
fb7dc6d6 AP |
191 | (modules '((guix build utils))) |
192 | (snippet | |
193 | ;; Add ecl-bundle-systems to 'default-system-source-registry'. | |
6cbee49d MW |
194 | `(begin |
195 | (substitute* "contrib/asdf/asdf.lisp" | |
196 | ,@(asdf-substitutions name)) | |
197 | #t)))) | |
00ab9458 | 198 | (build-system gnu-build-system) |
cb03a9b6 | 199 | ;; src/configure uses 'which' to confirm the existence of 'gzip'. |
00ab9458 TUBK |
200 | (native-inputs `(("which" ,which))) |
201 | (inputs `(("gmp" ,gmp) | |
202 | ("libatomic-ops" ,libatomic-ops) | |
203 | ("libgc" ,libgc) | |
204 | ("libffi" ,libffi))) | |
205 | (arguments | |
60474cd1 | 206 | '(#:tests? #t |
60474cd1 AP |
207 | #:parallel-tests? #f |
208 | #:phases | |
209 | (modify-phases %standard-phases | |
210 | (delete 'check) | |
54a43ff4 AP |
211 | (add-after 'install 'wrap |
212 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
213 | (let* ((ecl (assoc-ref outputs "out")) | |
214 | (input-path (lambda (lib path) | |
215 | (string-append | |
216 | (assoc-ref inputs lib) path))) | |
217 | (libraries '("gmp" "libatomic-ops" "libgc" "libffi" "libc")) | |
218 | (binaries '("gcc" "ld-wrapper" "binutils")) | |
219 | (library-directories | |
220 | (map (lambda (lib) (input-path lib "/lib")) | |
221 | libraries))) | |
222 | ||
223 | (wrap-program (string-append ecl "/bin/ecl") | |
224 | `("PATH" prefix | |
225 | ,(map (lambda (binary) | |
226 | (input-path binary "/bin")) | |
227 | binaries)) | |
228 | `("CPATH" suffix | |
229 | ,(map (lambda (lib) | |
230 | (input-path lib "/include")) | |
932b2ea2 | 231 | `("kernel-headers" ,@libraries))) |
54a43ff4 AP |
232 | `("LIBRARY_PATH" suffix ,library-directories) |
233 | `("LD_LIBRARY_PATH" suffix ,library-directories))))) | |
108f69c4 AP |
234 | (add-after 'wrap 'check (assoc-ref %standard-phases 'check)) |
235 | (add-before 'check 'fix-path-to-ecl | |
236 | (lambda _ | |
237 | (substitute* "build/tests/Makefile" | |
238 | (("\\$\\{exec_prefix\\}/") "")) | |
239 | #t))))) | |
fb7dc6d6 AP |
240 | (native-search-paths |
241 | (list (search-path-specification | |
242 | (variable "XDG_DATA_DIRS") | |
243 | (files '("share"))))) | |
00ab9458 TUBK |
244 | (home-page "http://ecls.sourceforge.net/") |
245 | (synopsis "Embeddable Common Lisp") | |
246 | (description "ECL is an implementation of the Common Lisp language as | |
247 | defined by the ANSI X3J13 specification. Its most relevant features are: a | |
248 | bytecode compiler and interpreter, being able to compile Common Lisp with any | |
249 | C/C++ compiler, being able to build standalone executables and libraries, and | |
250 | supporting ASDF, Sockets, Gray streams, MOP, and other useful components.") | |
251 | ;; Note that the file "Copyright" points to some files and directories | |
252 | ;; which aren't under the lgpl2.0+ and instead contain many different, | |
253 | ;; non-copyleft licenses. | |
254 | (license license:lgpl2.0+))) | |
560f51d0 TUBK |
255 | |
256 | (define-public clisp | |
257 | (package | |
258 | (name "clisp") | |
f473b8f1 | 259 | (version "2.49-60") |
560f51d0 TUBK |
260 | (source |
261 | (origin | |
f473b8f1 EF |
262 | (method hg-fetch) |
263 | (uri (hg-reference | |
264 | (url "http://hg.code.sf.net/p/clisp/clisp") | |
265 | (changeset "clisp_2_49_60-2017-06-25"))) | |
266 | (file-name (string-append name "-" version "-checkout")) | |
560f51d0 | 267 | (sha256 |
f473b8f1 | 268 | (base32 "0qjv3z274rbdmb941hy03hl63f4z7bmci234f8dyz4skgfr82d3i")) |
75033216 KK |
269 | (patches (search-patches "clisp-glibc-2.26.patch" |
270 | "clisp-remove-failing-test.patch")))) | |
560f51d0 TUBK |
271 | (build-system gnu-build-system) |
272 | (inputs `(("libffcall" ,libffcall) | |
f473b8f1 EF |
273 | ("ncurses" ,ncurses) |
274 | ("readline" ,readline) | |
560f51d0 TUBK |
275 | ("libsigsegv" ,libsigsegv))) |
276 | (arguments | |
f3cd6633 | 277 | '(#:configure-flags '("--enable-portability" |
f473b8f1 EF |
278 | "--with-dynamic-ffi" |
279 | "--with-dynamic-modules" | |
f473b8f1 | 280 | "--with-module=rawsock") |
f90ef3c3 MW |
281 | #:build #f |
282 | #:phases | |
636c77d0 RW |
283 | (modify-phases %standard-phases |
284 | (add-after 'unpack 'patch-sh-and-pwd | |
285 | (lambda _ | |
286 | ;; The package is very messy with its references to "/bin/sh" and | |
287 | ;; some other absolute paths to traditional tools. These appear in | |
288 | ;; many places where our automatic patching misses them. Therefore | |
289 | ;; we do the following, in this early (post-unpack) phase, to solve | |
290 | ;; the problem from its root. | |
291 | (substitute* (find-files "." "configure|Makefile") | |
292 | (("/bin/sh") "sh")) | |
293 | (substitute* '("src/clisp-link.in") | |
294 | (("/bin/pwd") "pwd")) | |
636c77d0 | 295 | #t))) |
560f51d0 TUBK |
296 | ;; Makefiles seem to have race conditions. |
297 | #:parallel-build? #f)) | |
298 | (home-page "http://www.clisp.org/") | |
4cc78cb3 LC |
299 | (synopsis "A Common Lisp implementation") |
300 | (description | |
301 | "GNU CLISP is an implementation of ANSI Common Lisp. Common Lisp is a | |
302 | high-level, object-oriented functional programming language. CLISP includes | |
303 | an interpreter, a compiler, a debugger, and much more.") | |
4bd2e2a5 | 304 | (license license:gpl2+))) |
b702b52d TUBK |
305 | |
306 | (define-public sbcl | |
307 | (package | |
308 | (name "sbcl") | |
3a52bb71 | 309 | (version "1.4.4") |
b702b52d TUBK |
310 | (source |
311 | (origin | |
312 | (method url-fetch) | |
313 | (uri (string-append "mirror://sourceforge/sbcl/sbcl/" version "/sbcl-" | |
314 | version "-source.tar.bz2")) | |
315 | (sha256 | |
3a52bb71 | 316 | (base32 "1k6v5b8qv7vyxvh8asx6phf2hbapx5pp5p5j47hgnq123fwnh4fa")) |
8d0489ae AP |
317 | (modules '((guix build utils))) |
318 | (snippet | |
319 | ;; Add sbcl-bundle-systems to 'default-system-source-registry'. | |
6cbee49d MW |
320 | `(begin |
321 | (substitute* "contrib/asdf/asdf.lisp" | |
322 | ,@(asdf-substitutions name)) | |
323 | #t)))) | |
b702b52d | 324 | (build-system gnu-build-system) |
05f5ce0c | 325 | (outputs '("out" "doc")) |
b702b52d TUBK |
326 | ;; Bootstrap with CLISP. |
327 | (native-inputs | |
328 | `(("clisp" ,clisp) | |
329 | ("which" ,which) | |
330 | ("inetutils" ,inetutils) ;for hostname(1) | |
05f5ce0c FB |
331 | ("ed" ,ed) |
332 | ("texlive" ,texlive) | |
333 | ("texinfo" ,texinfo))) | |
b702b52d | 334 | (arguments |
f0b7dc7e ST |
335 | '(#:modules ((guix build gnu-build-system) |
336 | (guix build utils) | |
337 | (srfi srfi-1)) | |
338 | #:phases | |
1ee131df FB |
339 | (modify-phases %standard-phases |
340 | (delete 'configure) | |
341 | (add-before 'build 'patch-unix-tool-paths | |
342 | (lambda* (#:key outputs inputs #:allow-other-keys) | |
343 | (let ((out (assoc-ref outputs "out")) | |
344 | (bash (assoc-ref inputs "bash")) | |
345 | (coreutils (assoc-ref inputs "coreutils")) | |
346 | (ed (assoc-ref inputs "ed"))) | |
347 | (define (quoted-path input path) | |
348 | (string-append "\"" input path "\"")) | |
349 | ;; Patch absolute paths in string literals. Note that this | |
350 | ;; occurs in some .sh files too (which contain Lisp code). Use | |
351 | ;; ISO-8859-1 because some of the files are ISO-8859-1 encoded. | |
352 | (with-fluids ((%default-port-encoding #f)) | |
1925a879 AP |
353 | ;; The removed file is utf-16-be encoded, which gives substitute* |
354 | ;; trouble. It does not contain references to the listed programs. | |
355 | (substitute* (delete | |
356 | "./tests/data/compile-file-pos-utf16be.lisp" | |
357 | (find-files "." "\\.(lisp|sh)$")) | |
1ee131df FB |
358 | (("\"/bin/sh\"") (quoted-path bash "/bin/sh")) |
359 | (("\"/usr/bin/env\"") (quoted-path coreutils "/usr/bin/env")) | |
360 | (("\"/bin/cat\"") (quoted-path coreutils "/bin/cat")) | |
361 | (("\"/bin/ed\"") (quoted-path ed "/bin/ed")) | |
362 | (("\"/bin/echo\"") (quoted-path coreutils "/bin/echo")) | |
363 | (("\"/bin/uname\"") (quoted-path coreutils "/bin/uname")))) | |
364 | ;; This one script has a non-string occurrence of /bin/sh. | |
365 | (substitute* '("tests/foreign.test.sh") | |
366 | ;; Leave whitespace so we don't match the shebang. | |
367 | ((" /bin/sh ") " sh ")) | |
368 | ;; This file contains a module that can create executable files | |
369 | ;; which depend on the presence of SBCL. It generates shell | |
370 | ;; scripts doing "exec sbcl ..." to achieve this. We patch both | |
371 | ;; the shebang and the reference to "sbcl", tying the generated | |
372 | ;; executables to the exact SBCL package that generated them. | |
373 | (substitute* '("contrib/sb-executable/sb-executable.lisp") | |
374 | (("/bin/sh") (string-append bash "/bin/sh")) | |
375 | (("exec sbcl") (string-append "exec " out "/bin/sbcl"))) | |
376 | ;; Disable some tests that fail in our build environment. | |
377 | (substitute* '("contrib/sb-bsd-sockets/tests.lisp") | |
378 | ;; This requires /etc/protocols. | |
379 | (("\\(deftest get-protocol-by-name/error" all) | |
380 | (string-append "#+nil ;disabled by Guix\n" all))) | |
381 | (substitute* '("contrib/sb-posix/posix-tests.lisp") | |
382 | ;; These assume some users/groups which we don't have. | |
383 | (("\\(deftest pwent\\.[12]" all) | |
384 | (string-append "#+nil ;disabled by Guix\n" all)) | |
385 | (("\\(deftest grent\\.[12]" all) | |
386 | (string-append "#+nil ;disabled by Guix\n" all)))))) | |
387 | (replace 'build | |
388 | (lambda* (#:key outputs #:allow-other-keys) | |
389 | (setenv "CC" "gcc") | |
390 | (zero? (system* "sh" "make.sh" "clisp" | |
391 | (string-append "--prefix=" | |
392 | (assoc-ref outputs "out")))))) | |
393 | (replace 'install | |
b702b52d | 394 | (lambda _ |
05f5ce0c FB |
395 | (zero? (system* "sh" "install.sh")))) |
396 | (add-after 'build 'build-doc | |
397 | (lambda _ | |
398 | (with-directory-excursion "doc/manual" | |
399 | (and (zero? (system* "make" "info")) | |
400 | (zero? (system* "make" "dist")))))) | |
401 | (add-after 'install 'install-doc | |
402 | (lambda* (#:key outputs #:allow-other-keys) | |
403 | (let* ((out (assoc-ref outputs "out")) | |
404 | (doc (assoc-ref outputs "doc")) | |
405 | (old-doc-dir (string-append out "/share/doc")) | |
406 | (new-doc/sbcl-dir (string-append doc "/share/doc/sbcl"))) | |
407 | (rmdir (string-append old-doc-dir "/sbcl/html")) | |
408 | (mkdir-p new-doc/sbcl-dir) | |
409 | (copy-recursively (string-append old-doc-dir "/sbcl") | |
410 | new-doc/sbcl-dir) | |
411 | (delete-file-recursively old-doc-dir) | |
412 | #t)))) | |
1ee131df FB |
413 | ;; No 'check' target, though "make.sh" (build phase) runs tests. |
414 | #:tests? #f)) | |
8d0489ae AP |
415 | (native-search-paths |
416 | (list (search-path-specification | |
417 | (variable "XDG_DATA_DIRS") | |
418 | (files '("share"))))) | |
b702b52d TUBK |
419 | (home-page "http://www.sbcl.org/") |
420 | (synopsis "Common Lisp implementation") | |
421 | (description "Steel Bank Common Lisp (SBCL) is a high performance Common | |
422 | Lisp compiler. In addition to the compiler and runtime system for ANSI Common | |
423 | Lisp, it provides an interactive environment including a debugger, a | |
424 | statistical profiler, a code coverage tool, and many other extensions.") | |
425 | ;; Public domain in jurisdictions that allow it, bsd-2 otherwise. MIT | |
426 | ;; loop macro has its own license. See COPYING file for further notes. | |
427 | (license (list license:public-domain license:bsd-2 | |
428 | (license:x11-style "file://src/code/loop.lisp"))))) | |
531a9aac TUBK |
429 | |
430 | (define-public ccl | |
431 | (package | |
432 | (name "ccl") | |
04ab38b7 | 433 | (version "1.11.5") |
531a9aac TUBK |
434 | (source #f) |
435 | (build-system gnu-build-system) | |
436 | ;; CCL consists of a "lisp kernel" and "heap image", both of which are | |
437 | ;; shipped in precompiled form in source tarballs. The former is a C | |
438 | ;; program which we can rebuild from scratch, but the latter cannot be | |
439 | ;; generated without an already working copy of CCL, and is platform | |
440 | ;; dependent, so we need to fetch the correct tarball for the platform. | |
441 | (inputs | |
442 | `(("ccl" | |
443 | ,(origin | |
444 | (method url-fetch) | |
445 | (uri (string-append | |
04ab38b7 | 446 | "https://github.com/Clozure/ccl/releases/download/v" version |
3701f014 | 447 | "/ccl-" version "-" |
531a9aac TUBK |
448 | (match (%current-system) |
449 | ((or "i686-linux" "x86_64-linux") "linuxx86") | |
42f11801 MW |
450 | ("armhf-linux" "linuxarm") |
451 | ;; Prevent errors when querying this package on unsupported | |
452 | ;; platforms, e.g. when running "guix package --search=" | |
453 | (_ "UNSUPPORTED")) | |
531a9aac TUBK |
454 | ".tar.gz")) |
455 | (sha256 | |
456 | (base32 | |
457 | (match (%current-system) | |
458 | ((or "i686-linux" "x86_64-linux") | |
04ab38b7 | 459 | "0hs1f3z7crgzvinpj990kv9gvbsipxvcvwbmk54n51nasvc5025q") |
42f11801 | 460 | ("armhf-linux" |
04ab38b7 | 461 | "0p0l1dzsygb6i1xxgbipjpxkn46xhq3jm41a34ga1qqp4x8lkr62") |
42f11801 | 462 | (_ "")))))))) |
531a9aac TUBK |
463 | (native-inputs |
464 | `(("m4" ,m4) | |
465 | ("subversion" ,subversion))) | |
466 | (arguments | |
467 | `(#:tests? #f ;no 'check' target | |
fc7d5a34 AP |
468 | #:modules ((srfi srfi-26) |
469 | (guix build utils) | |
470 | (guix build gnu-build-system)) | |
531a9aac | 471 | #:phases |
dc1d3cde KK |
472 | (modify-phases %standard-phases |
473 | (replace 'unpack | |
474 | (lambda* (#:key inputs #:allow-other-keys) | |
475 | (and (zero? (system* "tar" "xzvf" (assoc-ref inputs "ccl"))) | |
476 | (begin (chdir "ccl") #t)))) | |
477 | (delete 'configure) | |
478 | (add-before 'build 'pre-build | |
479 | ;; Enter the source directory for the current platform's lisp | |
480 | ;; kernel, and run 'make clean' to remove the precompiled one. | |
481 | (lambda _ | |
bcc65510 EF |
482 | (substitute* "lisp-kernel/m4macros.m4" |
483 | (("/bin/pwd") (which "pwd"))) | |
dc1d3cde KK |
484 | (chdir (string-append |
485 | "lisp-kernel/" | |
486 | ,(match (or (%current-target-system) (%current-system)) | |
487 | ("i686-linux" "linuxx8632") | |
488 | ("x86_64-linux" "linuxx8664") | |
489 | ("armhf-linux" "linuxarm") | |
490 | ;; Prevent errors when querying this package | |
491 | ;; on unsupported platforms, e.g. when running | |
492 | ;; "guix package --search=" | |
493 | (_ "UNSUPPORTED")))) | |
494 | (substitute* '("Makefile") | |
495 | (("/bin/rm") "rm")) | |
496 | (setenv "CC" "gcc") | |
497 | (zero? (system* "make" "clean")))) | |
498 | ;; XXX Do we need to recompile the heap image as well for Guix? | |
499 | ;; For now just use the one we already got in the tarball. | |
500 | (replace 'install | |
531a9aac TUBK |
501 | (lambda* (#:key outputs inputs #:allow-other-keys) |
502 | ;; The lisp kernel built by running 'make' in lisp-kernel/$system | |
503 | ;; is put back into the original directory, so go back. The heap | |
504 | ;; image is there as well. | |
505 | (chdir "../..") | |
506 | (let* ((out (assoc-ref outputs "out")) | |
507 | (libdir (string-append out "/lib/")) | |
508 | (bindir (string-append out "/bin/")) | |
509 | (wrapper (string-append bindir "ccl")) | |
510 | (bash (assoc-ref inputs "bash")) | |
511 | (kernel | |
512 | ,(match (or (%current-target-system) (%current-system)) | |
76eb7266 | 513 | ("i686-linux" "lx86cl") |
531a9aac | 514 | ("x86_64-linux" "lx86cl64") |
76eb7266 MW |
515 | ("armhf-linux" "armcl") |
516 | ;; Prevent errors when querying this package | |
517 | ;; on unsupported platforms, e.g. when running | |
518 | ;; "guix package --search=" | |
519 | (_ "UNSUPPORTED"))) | |
531a9aac | 520 | (heap (string-append kernel ".image"))) |
fc7d5a34 AP |
521 | (install-file kernel libdir) |
522 | (install-file heap libdir) | |
523 | ||
524 | (let ((dirs '("lib" "library" "examples" "contrib" | |
525 | "tools" "objc-bridge"))) | |
526 | (for-each copy-recursively | |
527 | dirs | |
528 | (map (cut string-append libdir <>) dirs))) | |
529 | ||
531a9aac | 530 | (mkdir-p bindir) |
531a9aac TUBK |
531 | (with-output-to-file wrapper |
532 | (lambda () | |
533 | (display | |
534 | (string-append | |
535 | "#!" bash "/bin/sh\n" | |
58b24078 | 536 | "CCL_DEFAULT_DIRECTORY=" libdir "\n" |
531a9aac TUBK |
537 | "export CCL_DEFAULT_DIRECTORY\n" |
538 | "exec " libdir kernel "\n")))) | |
dc1d3cde KK |
539 | (chmod wrapper #o755)) |
540 | #t))))) | |
531a9aac TUBK |
541 | (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux")) |
542 | (home-page "http://ccl.clozure.com/") | |
543 | (synopsis "Common Lisp implementation") | |
544 | (description "Clozure CL (often called CCL for short) is a Common Lisp | |
545 | implementation featuring fast compilation speed, native threads, a precise, | |
546 | generational, compacting garbage collector, and a convenient foreign-function | |
547 | interface.") | |
548 | ;; See file doc/LICENSE for clarifications it makes regarding how the LGPL | |
549 | ;; applies to Lisp code according to them. | |
550 | (license (list license:lgpl2.1 | |
551 | license:clarified-artistic)))) ;TRIVIAL-LDAP package | |
423eef36 | 552 | |
995e5092 | 553 | (define-public femtolisp |
554 | (let ((commit "68c5b1225572ecf2c52baf62f928063e5a30511b") | |
555 | (revision "1")) | |
556 | (package | |
557 | (name "femtolisp") | |
558 | (version (string-append "0.0.0-" revision "." (string-take commit 7))) | |
559 | (source (origin | |
560 | (method git-fetch) | |
561 | (uri (git-reference | |
562 | (url "https://github.com/JeffBezanson/femtolisp.git") | |
563 | (commit commit))) | |
564 | (file-name (string-append name "-" version "-checkout")) | |
565 | (sha256 | |
566 | (base32 | |
567 | "04rnwllxnl86zw8c6pwxznn49bvkvh0f1lfliy085vjzvlq3rgja")))) | |
419fb3f1 | 568 | ;; See "utils.h" for supported systems. Upstream bug: |
569 | ;; https://github.com/JeffBezanson/femtolisp/issues/25 | |
570 | (supported-systems | |
571 | (fold delete %supported-systems | |
dc00f635 | 572 | '("armhf-linux" "mips64el-linux" "aarch64-linux"))) |
995e5092 | 573 | (build-system gnu-build-system) |
574 | (arguments | |
f7fe5f7a | 575 | `(#:make-flags '("CC=gcc" "release") |
576 | #:test-target "test" | |
995e5092 | 577 | #:phases |
578 | (modify-phases %standard-phases | |
579 | (delete 'configure) ; No configure script | |
995e5092 | 580 | (replace 'install ; Makefile has no 'install phase |
581 | (lambda* (#:key outputs #:allow-other-keys) | |
582 | (let* ((out (assoc-ref outputs "out")) | |
583 | (bin (string-append out "/bin"))) | |
584 | (install-file "flisp" bin) | |
585 | #t))) | |
586 | ;; The flisp binary is now available, run bootstrap to | |
587 | ;; generate flisp.boot and afterwards runs make test. | |
588 | (add-after 'install 'bootstrap-gen-and-test | |
589 | (lambda* (#:key outputs #:allow-other-keys) | |
590 | (let* ((out (assoc-ref outputs "out")) | |
591 | (bin (string-append out "/bin"))) | |
592 | (and | |
593 | (zero? (system* "./bootstrap.sh")) | |
594 | (install-file "flisp.boot" bin)))))))) | |
595 | (synopsis "Scheme-like lisp implementation") | |
596 | (description | |
597 | "@code{femtolisp} is a scheme-like lisp implementation with a | |
598 | simple, elegant Scheme dialect. It is a lisp-1 with lexical scope. | |
599 | The core is 12 builtin special forms and 33 builtin functions.") | |
600 | (home-page "https://github.com/JeffBezanson/femtolisp") | |
601 | (license license:bsd-3)))) | |
a72debb7 | 602 | |
05c63898 | 603 | (define-public lush2 |
604 | (package | |
605 | (name "lush2") | |
606 | (version "2.0.1") | |
607 | (source | |
608 | (origin | |
609 | (method url-fetch) | |
610 | (uri (string-append "mirror://sourceforge/lush/lush2/lush-" | |
611 | version ".tar.gz")) | |
612 | (modules '((guix build utils))) | |
613 | (snippet | |
614 | '(begin | |
615 | (substitute* "src/unix.c" | |
6cbee49d MW |
616 | (("\\{ \"LUSH_DATE\", __DATE__ \\},") "") |
617 | (("\\{ \"LUSH_TIME\", __TIME__ \\},") "")) | |
618 | (substitute* "src/main.c" | |
619 | (("\" \\(built \" __DATE__ \"\\)\"") "")) | |
620 | #t)) | |
05c63898 | 621 | (sha256 |
622 | (base32 | |
623 | "02pkfn3nqdkm9fm44911dbcz0v3r0l53vygj8xigl6id5g3iwi4k")))) | |
624 | (build-system gnu-build-system) | |
625 | (arguments | |
626 | `(;; We have to add these LIBS so that they are found. | |
627 | #:configure-flags (list "LIBS=-lz" | |
628 | "X_EXTRA_LIBS=-lfontconfig" | |
629 | "--with-x") | |
630 | #:tests? #f)) ; No make check. | |
631 | (native-inputs `(("intltool" ,intltool))) | |
632 | (inputs | |
633 | `(("alsa-lib" ,alsa-lib) | |
634 | ("sdl" ,sdl) | |
635 | ("sdl-image" ,sdl-image) | |
636 | ("sdl-mixer" ,sdl-mixer) | |
637 | ("sdl-net" ,sdl-net) | |
638 | ("sdl-ttf" ,sdl-ttf) | |
639 | ("lapack" ,lapack) | |
640 | ("libxft" ,libxft) | |
641 | ("fontconfig" ,fontconfig) | |
642 | ("gsl" ,gsl) | |
643 | ("openblas" ,openblas) | |
644 | ("glu" ,glu) | |
645 | ("mesa" ,mesa) | |
646 | ("mesa-utils" ,mesa-utils) | |
647 | ("binutils" ,binutils) | |
648 | ("libiberty" ,libiberty) | |
649 | ("readline" ,readline) | |
650 | ("zlib" ,zlib) | |
651 | ("gettext-minimal" ,gettext-minimal))) | |
652 | (synopsis "Lisp Universal Shell") | |
653 | (description | |
654 | "Lush is an object-oriented Lisp interpreter/compiler with features | |
655 | designed to please people who want to prototype large numerical | |
656 | applications. Lush includes an extensive library of | |
657 | vector/matrix/tensor manipulation, numerous numerical libraries | |
658 | (including GSL, LAPACK, and BLAS), a set of graphic functions, a | |
659 | simple GUI toolkit, and interfaces to various graphic and multimedia | |
660 | libraries such as OpenGL, SDL, Video4Linux, and ALSA (video/audio | |
661 | grabbing), and others. Lush is an ideal frontend script language for | |
662 | programming projects written in C or other languages. Lush also has | |
663 | libraries for Machine Learning, Neural Nets and statistical estimation.") | |
664 | (home-page "http://lush.sourceforge.net/") | |
665 | (license license:lgpl2.1+))) | |
666 | ||
a72debb7 AP |
667 | (define-public sbcl-alexandria |
668 | (let ((revision "1") | |
669 | (commit "926a066611b7b11cb71e26c827a271e500888c30")) | |
670 | (package | |
671 | (name "sbcl-alexandria") | |
672 | (version (string-append "0.0.0-" revision "." (string-take commit 7))) | |
673 | (source | |
674 | (origin | |
675 | (method git-fetch) | |
676 | (uri (git-reference | |
677 | (url "https://gitlab.common-lisp.net/alexandria/alexandria.git") | |
678 | (commit commit))) | |
679 | (sha256 | |
680 | (base32 | |
681 | "18yncicdkh294j05rhgm23gzi36y9qy6vrfba8vg69jrxjp1hx8l")) | |
682 | (file-name (string-append "alexandria-" version "-checkout")))) | |
683 | (build-system asdf-build-system/sbcl) | |
684 | (synopsis "Collection of portable utilities for Common Lisp") | |
685 | (description | |
686 | "Alexandria is a collection of portable utilities. It does not contain | |
687 | conceptual extensions to Common Lisp. It is conservative in scope, and | |
688 | portable between implementations.") | |
689 | (home-page "https://common-lisp.net/project/alexandria/") | |
690 | (license license:public-domain)))) | |
691 | ||
692 | (define-public cl-alexandria | |
693 | (sbcl-package->cl-source-package sbcl-alexandria)) | |
694 | ||
695 | (define-public ecl-alexandria | |
696 | (sbcl-package->ecl-package sbcl-alexandria)) | |
86022c92 AP |
697 | |
698 | (define-public sbcl-fiveam | |
699 | (package | |
700 | (name "sbcl-fiveam") | |
701 | (version "1.2") | |
702 | (source | |
703 | (origin | |
704 | (method url-fetch) | |
705 | (uri (string-append | |
706 | "https://github.com/sionescu/fiveam/archive/v" | |
707 | version ".tar.gz")) | |
708 | (sha256 | |
709 | (base32 "0f48pcbhqs3wwwzjl5nk57d4hcbib4l9xblxc66b8c2fhvhmhxnv")) | |
710 | (file-name (string-append "fiveam-" version ".tar.gz")))) | |
0e1371be | 711 | (inputs `(("alexandria" ,sbcl-alexandria))) |
86022c92 AP |
712 | (build-system asdf-build-system/sbcl) |
713 | (synopsis "Common Lisp testing framework") | |
714 | (description "FiveAM is a simple (as far as writing and running tests | |
715 | goes) regression testing framework. It has been designed with Common Lisp's | |
716 | interactive development model in mind.") | |
717 | (home-page "https://common-lisp.net/project/fiveam/") | |
718 | (license license:bsd-3))) | |
719 | ||
720 | (define-public cl-fiveam | |
721 | (sbcl-package->cl-source-package sbcl-fiveam)) | |
722 | ||
723 | (define-public ecl-fiveam | |
724 | (sbcl-package->ecl-package sbcl-fiveam)) | |
8662809d AP |
725 | |
726 | (define-public sbcl-bordeaux-threads | |
543cf6fd AP |
727 | (let ((commit "354abb0ae9f1d9324001e1a8abab3128d7420e0e") |
728 | (revision "1")) | |
729 | (package | |
730 | (name "sbcl-bordeaux-threads") | |
731 | (version (git-version "0.8.5" revision commit)) | |
732 | (source (origin | |
733 | (method git-fetch) | |
734 | (uri (git-reference | |
735 | (url "https://github.com/sionescu/bordeaux-threads.git") | |
736 | (commit commit))) | |
737 | (sha256 | |
738 | (base32 "1hcfp21l6av1xj6z7r77sp6h4mwf9vvx4s745803sysq2qy2mwnq")) | |
739 | (file-name | |
740 | (git-file-name "bordeaux-threads" version)))) | |
741 | (inputs `(("alexandria" ,sbcl-alexandria))) | |
742 | (native-inputs `(("fiveam" ,sbcl-fiveam))) | |
743 | (build-system asdf-build-system/sbcl) | |
744 | (synopsis "Portable shared-state concurrency library for Common Lisp") | |
745 | (description "BORDEAUX-THREADS is a proposed standard for a minimal | |
8662809d AP |
746 | MP/Threading interface. It is similar to the CLIM-SYS threading and lock |
747 | support.") | |
543cf6fd AP |
748 | (home-page "https://common-lisp.net/project/bordeaux-threads/") |
749 | (license license:x11)))) | |
8662809d AP |
750 | |
751 | (define-public cl-bordeaux-threads | |
752 | (sbcl-package->cl-source-package sbcl-bordeaux-threads)) | |
753 | ||
754 | (define-public ecl-bordeaux-threads | |
755 | (sbcl-package->ecl-package sbcl-bordeaux-threads)) | |
059cab30 AP |
756 | |
757 | (define-public sbcl-trivial-gray-streams | |
758 | (let ((revision "1") | |
759 | (commit "0483ade330508b4b2edeabdb47d16ec9437ee1cb")) | |
760 | (package | |
761 | (name "sbcl-trivial-gray-streams") | |
762 | (version (string-append "0.0.0-" revision "." (string-take commit 7))) | |
763 | (source | |
764 | (origin | |
765 | (method git-fetch) | |
766 | (uri | |
767 | (git-reference | |
768 | (url "https://github.com/trivial-gray-streams/trivial-gray-streams.git") | |
769 | (commit commit))) | |
770 | (sha256 | |
771 | (base32 "0m3rpf2x0zmdk3nf1qfa01j6a55vj7gkwhyw78qslcgbjlgh8p4d")) | |
772 | (file-name | |
773 | (string-append "trivial-gray-streams-" version "-checkout")))) | |
774 | (build-system asdf-build-system/sbcl) | |
775 | (synopsis "Compatibility layer for Gray streams implementations") | |
776 | (description "Gray streams is an interface proposed for inclusion with | |
777 | ANSI CL by David N. Gray. The proposal did not make it into ANSI CL, but most | |
778 | popular CL implementations implement it. This package provides an extremely | |
779 | thin compatibility layer for gray streams.") | |
780 | (home-page "http://www.cliki.net/trivial-gray-streams") | |
781 | (license license:x11)))) | |
782 | ||
783 | (define-public cl-trivial-gray-streams | |
784 | (sbcl-package->cl-source-package sbcl-trivial-gray-streams)) | |
785 | ||
786 | (define-public ecl-trivial-gray-streams | |
787 | (sbcl-package->ecl-package sbcl-trivial-gray-streams)) | |
3c55c780 AP |
788 | |
789 | (define-public sbcl-flexi-streams | |
790 | (package | |
791 | (name "sbcl-flexi-streams") | |
5dff0752 | 792 | (version "1.0.16") |
3c55c780 AP |
793 | (source |
794 | (origin | |
795 | (method url-fetch) | |
796 | (uri (string-append | |
797 | "https://github.com/edicl/flexi-streams/archive/v" | |
798 | version ".tar.gz")) | |
799 | (sha256 | |
5dff0752 | 800 | (base32 "1fb0jrwxr5c3i2lhy7kn30m1n0vggfzwjm1dacx6y5wf9wfsbamw")) |
3c55c780 AP |
801 | (file-name (string-append "flexi-streams-" version ".tar.gz")))) |
802 | (build-system asdf-build-system/sbcl) | |
0e1371be | 803 | (inputs `(("trivial-gray-streams" ,sbcl-trivial-gray-streams))) |
3c55c780 AP |
804 | (synopsis "Implementation of virtual bivalent streams for Common Lisp") |
805 | (description "Flexi-streams is an implementation of \"virtual\" bivalent | |
806 | streams that can be layered atop real binary or bivalent streams and that can | |
807 | be used to read and write character data in various single- or multi-octet | |
808 | encodings which can be changed on the fly. It also supplies in-memory binary | |
809 | streams which are similar to string streams.") | |
810 | (home-page "http://weitz.de/flexi-streams/") | |
811 | (license license:bsd-3))) | |
812 | ||
813 | (define-public cl-flexi-streams | |
814 | (sbcl-package->cl-source-package sbcl-flexi-streams)) | |
815 | ||
816 | (define-public ecl-flexi-streams | |
817 | (sbcl-package->ecl-package sbcl-flexi-streams)) | |
5aa608a7 AP |
818 | |
819 | (define-public sbcl-cl-ppcre | |
820 | (package | |
821 | (name "sbcl-cl-ppcre") | |
822 | (version "2.0.11") | |
823 | (source | |
824 | (origin | |
825 | (method url-fetch) | |
826 | (uri (string-append | |
827 | "https://github.com/edicl/cl-ppcre/archive/v" | |
828 | version ".tar.gz")) | |
829 | (sha256 | |
830 | (base32 "1i7daxf0wnydb0pgwiym7qh2wy70n14lxd6dyv28sy0naa8p31gd")) | |
831 | (file-name (string-append "cl-ppcre-" version ".tar.gz")))) | |
832 | (build-system asdf-build-system/sbcl) | |
0e1371be | 833 | (native-inputs `(("flexi-streams" ,sbcl-flexi-streams))) |
5aa608a7 AP |
834 | (synopsis "Portable regular expression library for Common Lisp") |
835 | (description "CL-PPCRE is a portable regular expression library for Common | |
836 | Lisp, which is compatible with perl. It is pretty fast, thread-safe, and | |
837 | compatible with ANSI-compliant Common Lisp implementations.") | |
838 | (home-page "http://weitz.de/cl-ppcre/") | |
839 | (license license:bsd-2))) | |
840 | ||
841 | (define-public cl-ppcre | |
842 | (sbcl-package->cl-source-package sbcl-cl-ppcre)) | |
843 | ||
844 | (define-public ecl-cl-ppcre | |
845 | (sbcl-package->ecl-package sbcl-cl-ppcre)) | |
4b51b21c | 846 | |
ac259253 RW |
847 | (define sbcl-cl-unicode-base |
848 | (let ((revision "1") | |
849 | (commit "9fcd06fba1ddc9e66aed2f2d6c32dc9b764f03ea")) | |
850 | (package | |
851 | (name "sbcl-cl-unicode-base") | |
852 | (version (string-append "0.1.5-" revision "." (string-take commit 7))) | |
853 | (source (origin | |
854 | (method git-fetch) | |
855 | (uri (git-reference | |
856 | (url "https://github.com/edicl/cl-unicode.git") | |
857 | (commit commit))) | |
858 | (file-name (string-append "cl-unicode-" version "-checkout")) | |
859 | (sha256 | |
860 | (base32 | |
861 | "1jicprb5b3bv57dy1kg03572gxkcaqdjhak00426s76g0plmx5ki")))) | |
862 | (build-system asdf-build-system/sbcl) | |
863 | (arguments | |
864 | '(#:asd-file "cl-unicode.asd" | |
865 | #:asd-system-name "cl-unicode/base")) | |
866 | (inputs | |
867 | `(("cl-ppcre" ,sbcl-cl-ppcre))) | |
868 | (home-page "http://weitz.de/cl-unicode/") | |
869 | (synopsis "Portable Unicode library for Common Lisp") | |
870 | (description "CL-UNICODE is a portable Unicode library Common Lisp, which | |
871 | is compatible with perl. It is pretty fast, thread-safe, and compatible with | |
872 | ANSI-compliant Common Lisp implementations.") | |
873 | (license license:bsd-2)))) | |
874 | ||
875 | (define-public sbcl-cl-unicode | |
876 | (package | |
877 | (inherit sbcl-cl-unicode-base) | |
878 | (name "sbcl-cl-unicode") | |
879 | (inputs | |
880 | `(("cl-unicode/base" ,sbcl-cl-unicode-base) | |
881 | ,@(package-inputs sbcl-cl-unicode-base))) | |
882 | (native-inputs | |
883 | `(("flexi-streams" ,sbcl-flexi-streams))) | |
884 | (arguments '()))) | |
885 | ||
886 | (define-public ecl-cl-unicode | |
887 | (sbcl-package->ecl-package sbcl-cl-unicode)) | |
888 | ||
889 | (define-public cl-unicode | |
890 | (sbcl-package->cl-source-package sbcl-cl-unicode)) | |
891 | ||
4b51b21c AP |
892 | (define-public sbcl-clx |
893 | (let ((revision "1") | |
894 | (commit "1c62774b03c1cf3fe6e5cb532df8b14b44c96b95")) | |
895 | (package | |
896 | (name "sbcl-clx") | |
897 | (version (string-append "0.0.0-" revision "." (string-take commit 7))) | |
898 | (source | |
899 | (origin | |
900 | (method git-fetch) | |
901 | (uri | |
902 | (git-reference | |
903 | (url "https://github.com/sharplispers/clx.git") | |
904 | (commit commit))) | |
905 | (sha256 | |
906 | (base32 "0qffag03ns52kwq9xjns2qg1yr0bf3ba507iwq5cmx5xz0b0rmjm")) | |
907 | (file-name (string-append "clx-" version "-checkout")) | |
908 | (patches | |
909 | (list | |
910 | (search-patch "clx-remove-demo.patch"))) | |
911 | (modules '((guix build utils))) | |
912 | (snippet | |
913 | '(begin | |
914 | ;; These removed files cause the compiled system to crash when | |
915 | ;; loading. | |
916 | (delete-file-recursively "demo") | |
917 | (delete-file "test/trapezoid.lisp") | |
918 | (substitute* "clx.asd" | |
6cbee49d MW |
919 | (("\\(:file \"trapezoid\"\\)") "")) |
920 | #t)))) | |
4b51b21c | 921 | (build-system asdf-build-system/sbcl) |
4b51b21c AP |
922 | (home-page "http://www.cliki.net/portable-clx") |
923 | (synopsis "X11 client library for Common Lisp") | |
924 | (description "CLX is an X11 client library for Common Lisp. The code was | |
925 | originally taken from a CMUCL distribution, was modified somewhat in order to | |
926 | make it compile and run under SBCL, then a selection of patches were added | |
927 | from other CLXes around the net.") | |
928 | (license license:x11)))) | |
929 | ||
930 | (define-public cl-clx | |
931 | (sbcl-package->cl-source-package sbcl-clx)) | |
932 | ||
933 | (define-public ecl-clx | |
934 | (sbcl-package->ecl-package sbcl-clx)) | |
d075960f | 935 | |
b693aa6e RW |
936 | (define-public sbcl-cl-ppcre-unicode |
937 | (package (inherit sbcl-cl-ppcre) | |
938 | (name "sbcl-cl-ppcre-unicode") | |
939 | (arguments | |
940 | `(#:tests? #f ; tests fail with "Component :CL-PPCRE-TEST not found" | |
941 | #:asd-file "cl-ppcre-unicode.asd")) | |
942 | (inputs | |
943 | `(("sbcl-cl-ppcre" ,sbcl-cl-ppcre) | |
944 | ("sbcl-cl-unicode" ,sbcl-cl-unicode))))) | |
945 | ||
d075960f AP |
946 | (define-public sbcl-stumpwm |
947 | (package | |
948 | (name "sbcl-stumpwm") | |
abf818bc | 949 | (version "18.05") |
d075960f AP |
950 | (source (origin |
951 | (method url-fetch) | |
952 | (uri (string-append | |
953 | "https://github.com/stumpwm/stumpwm/archive/" | |
954 | version ".tar.gz")) | |
955 | (sha256 | |
abf818bc | 956 | (base32 "1n2gaab3lwgf5r1hmwdcw13dkv9xdd7drn2shx28kfxvhdc9kbb9")) |
d075960f AP |
957 | (file-name (string-append "stumpwm-" version ".tar.gz")))) |
958 | (build-system asdf-build-system/sbcl) | |
0e1371be | 959 | (inputs `(("cl-ppcre" ,sbcl-cl-ppcre) |
abf818bc OP |
960 | ("clx" ,sbcl-clx) |
961 | ("alexandria" ,sbcl-alexandria))) | |
290bf612 | 962 | (outputs '("out" "lib")) |
d075960f | 963 | (arguments |
35189728 | 964 | '(#:phases |
d075960f AP |
965 | (modify-phases %standard-phases |
966 | (add-after 'create-symlinks 'build-program | |
b4c9f0c5 | 967 | (lambda* (#:key outputs #:allow-other-keys) |
d075960f | 968 | (build-program |
290bf612 | 969 | (string-append (assoc-ref outputs "out") "/bin/stumpwm") |
4209c31b | 970 | outputs |
d075960f AP |
971 | #:entry-program '((stumpwm:stumpwm) 0)))) |
972 | (add-after 'build-program 'create-desktop-file | |
290bf612 AP |
973 | (lambda* (#:key outputs #:allow-other-keys) |
974 | (let* ((out (assoc-ref outputs "out")) | |
975 | (xsessions (string-append out "/share/xsessions"))) | |
976 | (mkdir-p xsessions) | |
977 | (call-with-output-file | |
978 | (string-append xsessions "/stumpwm.desktop") | |
979 | (lambda (file) | |
980 | (format file | |
d075960f AP |
981 | "[Desktop Entry]~@ |
982 | Name=stumpwm~@ | |
983 | Comment=The Stump Window Manager~@ | |
984 | Exec=~a/bin/stumpwm~@ | |
985 | TryExec=~@*~a/bin/stumpwm~@ | |
986 | Icon=~@ | |
987 | Type=Application~%" | |
290bf612 | 988 | out))) |
d075960f AP |
989 | #t)))))) |
990 | (synopsis "Window manager written in Common Lisp") | |
991 | (description "Stumpwm is a window manager written entirely in Common Lisp. | |
992 | It attempts to be highly customizable while relying entirely on the keyboard | |
993 | for input. These design decisions reflect the growing popularity of | |
994 | productive, customizable lisp based systems.") | |
7bf837fd | 995 | (home-page "https://github.com/stumpwm/stumpwm") |
d075960f AP |
996 | (license license:gpl2+) |
997 | (properties `((ecl-variant . ,(delay ecl-stumpwm)))))) | |
998 | ||
999 | (define-public cl-stumpwm | |
1000 | (sbcl-package->cl-source-package sbcl-stumpwm)) | |
1001 | ||
1002 | (define-public ecl-stumpwm | |
1003 | (let ((base (sbcl-package->ecl-package sbcl-stumpwm))) | |
1004 | (package | |
1005 | (inherit base) | |
1006 | (outputs '("out")) | |
1007 | (arguments '())))) | |
e3e171ee | 1008 | |
75e8b3af AP |
1009 | ;; The slynk that users expect to install includes all of slynk's contrib |
1010 | ;; modules. Therefore, we build the base module and all contribs first; then | |
1011 | ;; we expose the union of these as `sbcl-slynk'. The following variable | |
1012 | ;; describes the base module. | |
e3e171ee | 1013 | (define sbcl-slynk-boot0 |
1d98b44e AP |
1014 | (let ((revision "2") |
1015 | (commit "cbf84c36c4eca8b032e3fd16177a7bc02df3ec4c")) | |
e3e171ee | 1016 | (package |
f56da605 | 1017 | (name "sbcl-slynk-boot0") |
e3e171ee AP |
1018 | (version (string-append "1.0.0-beta-" revision "." (string-take commit 7))) |
1019 | (source | |
1020 | (origin | |
1021 | (method git-fetch) | |
1022 | (uri | |
1023 | (git-reference | |
1024 | (url "https://github.com/joaotavora/sly.git") | |
1025 | (commit commit))) | |
1026 | (sha256 | |
1d98b44e | 1027 | (base32 "13dyhsravn591p7g6is01mp2ynzjnnj7pwgi57r6xqmd4611y9vh")) |
e3e171ee AP |
1028 | (file-name (string-append "slynk-" version "-checkout")) |
1029 | (modules '((guix build utils) | |
1030 | (ice-9 ftw))) | |
1031 | (snippet | |
1032 | '(begin | |
1033 | ;; Move the contribs into the main source directory for easier | |
1034 | ;; access | |
1035 | (substitute* "slynk/slynk.asd" | |
1036 | (("\\.\\./contrib") | |
1037 | "contrib") | |
1d98b44e AP |
1038 | (("\\(defsystem :slynk/util") |
1039 | "(defsystem :slynk/util :depends-on (:slynk)") | |
1040 | ((":depends-on \\(:slynk :slynk/util\\)") | |
1041 | ":depends-on (:slynk :slynk-util)")) | |
e3e171ee AP |
1042 | (substitute* "contrib/slynk-trace-dialog.lisp" |
1043 | (("\\(slynk::reset-inspector\\)") ; Causes problems on load | |
1044 | "nil")) | |
1045 | (substitute* "contrib/slynk-profiler.lisp" | |
1046 | (("slynk:to-line") | |
1047 | "slynk-pprint-to-line")) | |
1d98b44e AP |
1048 | (substitute* "contrib/slynk-fancy-inspector.lisp" |
1049 | (("slynk/util") "slynk-util") | |
1050 | ((":compile-toplevel :load-toplevel") "")) | |
e3e171ee AP |
1051 | (rename-file "contrib" "slynk/contrib") |
1052 | ;; Move slynk's contents into the base directory for easier | |
1053 | ;; access | |
6cbee49d MW |
1054 | (for-each (lambda (file) |
1055 | (unless (string-prefix? "." file) | |
1056 | (rename-file (string-append "slynk/" file) | |
1057 | (string-append "./" (basename file))))) | |
1058 | (scandir "slynk")) | |
1059 | #t)))) | |
e3e171ee AP |
1060 | (build-system asdf-build-system/sbcl) |
1061 | (arguments | |
f56da605 AP |
1062 | `(#:tests? #f ; No test suite |
1063 | #:asd-system-name "slynk")) | |
e3e171ee | 1064 | (synopsis "Common Lisp IDE for Emacs") |
14afc7b8 AP |
1065 | (description "SLY is a fork of SLIME, an IDE backend for Common Lisp. |
1066 | It also features a completely redesigned REPL based on Emacs's own | |
1067 | full-featured comint.el, live code annotations, and a consistent interactive | |
1068 | button interface. Everything can be copied to the REPL. One can create | |
1069 | multiple inspectors with independent history.") | |
e3e171ee AP |
1070 | (home-page "https://github.com/joaotavora/sly") |
1071 | (license license:public-domain) | |
1072 | (properties `((cl-source-variant . ,(delay cl-slynk))))))) | |
1073 | ||
1074 | (define-public cl-slynk | |
f56da605 AP |
1075 | (package |
1076 | (inherit (sbcl-package->cl-source-package sbcl-slynk-boot0)) | |
1077 | (name "cl-slynk"))) | |
e3e171ee AP |
1078 | |
1079 | (define ecl-slynk-boot0 | |
1080 | (sbcl-package->ecl-package sbcl-slynk-boot0)) | |
1081 | ||
1082 | (define sbcl-slynk-arglists | |
1083 | (package | |
1084 | (inherit sbcl-slynk-boot0) | |
1085 | (name "sbcl-slynk-arglists") | |
0e1371be | 1086 | (inputs `(("slynk" ,sbcl-slynk-boot0))) |
e3e171ee | 1087 | (arguments |
f56da605 AP |
1088 | (substitute-keyword-arguments (package-arguments sbcl-slynk-boot0) |
1089 | ((#:asd-file _ "") "slynk.asd") | |
1d98b44e | 1090 | ((#:asd-system-name _ #f) "slynk/arglists"))))) |
e3e171ee AP |
1091 | |
1092 | (define ecl-slynk-arglists | |
1093 | (sbcl-package->ecl-package sbcl-slynk-arglists)) | |
1094 | ||
1095 | (define sbcl-slynk-util | |
1096 | (package | |
1d98b44e AP |
1097 | (inherit sbcl-slynk-boot0) |
1098 | (name "sbcl-slynk-util") | |
1099 | (inputs `(("slynk" ,sbcl-slynk-boot0))) | |
1100 | (arguments | |
1101 | (substitute-keyword-arguments (package-arguments sbcl-slynk-boot0) | |
1102 | ((#:asd-file _ "") "slynk.asd") | |
1103 | ((#:asd-system-name _ #f) "slynk/util"))))) | |
e3e171ee AP |
1104 | |
1105 | (define ecl-slynk-util | |
1106 | (sbcl-package->ecl-package sbcl-slynk-util)) | |
1107 | ||
1108 | (define sbcl-slynk-fancy-inspector | |
1109 | (package | |
1110 | (inherit sbcl-slynk-arglists) | |
1111 | (name "sbcl-slynk-fancy-inspector") | |
0e1371be | 1112 | (inputs `(("slynk-util" ,sbcl-slynk-util) |
1d98b44e AP |
1113 | ,@(package-inputs sbcl-slynk-arglists))) |
1114 | (arguments | |
1115 | (substitute-keyword-arguments (package-arguments sbcl-slynk-arglists) | |
1116 | ((#:asd-system-name _ #f) "slynk/fancy-inspector"))))) | |
e3e171ee AP |
1117 | |
1118 | (define ecl-slynk-fancy-inspector | |
1119 | (sbcl-package->ecl-package sbcl-slynk-fancy-inspector)) | |
1120 | ||
1121 | (define sbcl-slynk-package-fu | |
1122 | (package | |
1123 | (inherit sbcl-slynk-arglists) | |
1d98b44e AP |
1124 | (name "sbcl-slynk-package-fu") |
1125 | (arguments | |
1126 | (substitute-keyword-arguments (package-arguments sbcl-slynk-arglists) | |
1127 | ((#:asd-system-name _ #f) "slynk/package-fu"))))) | |
e3e171ee AP |
1128 | |
1129 | (define ecl-slynk-package-fu | |
1130 | (sbcl-package->ecl-package sbcl-slynk-package-fu)) | |
1131 | ||
1132 | (define sbcl-slynk-mrepl | |
1133 | (package | |
1d98b44e AP |
1134 | (inherit sbcl-slynk-fancy-inspector) |
1135 | (name "sbcl-slynk-mrepl") | |
1136 | (arguments | |
1137 | (substitute-keyword-arguments (package-arguments sbcl-slynk-arglists) | |
1138 | ((#:asd-system-name _ #f) "slynk/mrepl"))))) | |
e3e171ee AP |
1139 | |
1140 | (define ecl-slynk-mrepl | |
1141 | (sbcl-package->ecl-package sbcl-slynk-mrepl)) | |
1142 | ||
1143 | (define sbcl-slynk-trace-dialog | |
1144 | (package | |
1145 | (inherit sbcl-slynk-arglists) | |
1d98b44e AP |
1146 | (name "sbcl-slynk-trace-dialog") |
1147 | (arguments | |
1148 | (substitute-keyword-arguments (package-arguments sbcl-slynk-arglists) | |
1149 | ((#:asd-system-name _ #f) "slynk/trace-dialog"))))) | |
e3e171ee AP |
1150 | |
1151 | (define ecl-slynk-trace-dialog | |
1152 | (sbcl-package->ecl-package sbcl-slynk-trace-dialog)) | |
1153 | ||
1154 | (define sbcl-slynk-profiler | |
1155 | (package | |
1156 | (inherit sbcl-slynk-arglists) | |
1d98b44e AP |
1157 | (name "sbcl-slynk-profiler") |
1158 | (arguments | |
1159 | (substitute-keyword-arguments (package-arguments sbcl-slynk-arglists) | |
1160 | ((#:asd-system-name _ #f) "slynk/profiler"))))) | |
e3e171ee AP |
1161 | |
1162 | (define ecl-slynk-profiler | |
1163 | (sbcl-package->ecl-package sbcl-slynk-profiler)) | |
1164 | ||
1165 | (define sbcl-slynk-stickers | |
1166 | (package | |
1167 | (inherit sbcl-slynk-arglists) | |
1d98b44e AP |
1168 | (name "sbcl-slynk-stickers") |
1169 | (arguments | |
1170 | (substitute-keyword-arguments (package-arguments sbcl-slynk-arglists) | |
1171 | ((#:asd-system-name _ #f) "slynk/stickers"))))) | |
e3e171ee AP |
1172 | |
1173 | (define ecl-slynk-stickers | |
1174 | (sbcl-package->ecl-package sbcl-slynk-stickers)) | |
1175 | ||
1176 | (define sbcl-slynk-indentation | |
1177 | (package | |
1178 | (inherit sbcl-slynk-arglists) | |
1d98b44e AP |
1179 | (name "sbcl-slynk-indentation") |
1180 | (arguments | |
1181 | (substitute-keyword-arguments (package-arguments sbcl-slynk-arglists) | |
1182 | ((#:asd-system-name _ #f) "slynk/indentation"))))) | |
e3e171ee AP |
1183 | |
1184 | (define ecl-slynk-indentation | |
1185 | (sbcl-package->ecl-package sbcl-slynk-indentation)) | |
1186 | ||
1187 | (define sbcl-slynk-retro | |
1188 | (package | |
1189 | (inherit sbcl-slynk-arglists) | |
1d98b44e AP |
1190 | (name "sbcl-slynk-retro") |
1191 | (arguments | |
1192 | (substitute-keyword-arguments (package-arguments sbcl-slynk-arglists) | |
1193 | ((#:asd-system-name _ #f) "slynk/retro"))))) | |
e3e171ee AP |
1194 | |
1195 | (define ecl-slynk-retro | |
1196 | (sbcl-package->ecl-package sbcl-slynk-retro)) | |
1197 | ||
1198 | (define slynk-systems | |
1199 | '("slynk" | |
1200 | "slynk-util" | |
1201 | "slynk-arglists" | |
1202 | "slynk-fancy-inspector" | |
1203 | "slynk-package-fu" | |
1204 | "slynk-mrepl" | |
1205 | "slynk-profiler" | |
1206 | "slynk-trace-dialog" | |
1207 | "slynk-stickers" | |
1208 | "slynk-indentation" | |
1209 | "slynk-retro")) | |
1210 | ||
1211 | (define-public sbcl-slynk | |
1212 | (package | |
1213 | (inherit sbcl-slynk-boot0) | |
f56da605 | 1214 | (name "sbcl-slynk") |
e3e171ee AP |
1215 | (inputs |
1216 | `(("slynk" ,sbcl-slynk-boot0) | |
1217 | ("slynk-util" ,sbcl-slynk-util) | |
1218 | ("slynk-arglists" ,sbcl-slynk-arglists) | |
1219 | ("slynk-fancy-inspector" ,sbcl-slynk-fancy-inspector) | |
1220 | ("slynk-package-fu" ,sbcl-slynk-package-fu) | |
1221 | ("slynk-mrepl" ,sbcl-slynk-mrepl) | |
1222 | ("slynk-profiler" ,sbcl-slynk-profiler) | |
1223 | ("slynk-trace-dialog" ,sbcl-slynk-trace-dialog) | |
1224 | ("slynk-stickers" ,sbcl-slynk-stickers) | |
1225 | ("slynk-indentation" ,sbcl-slynk-indentation) | |
1226 | ("slynk-retro" ,sbcl-slynk-retro))) | |
1227 | (native-inputs `(("sbcl" ,sbcl))) | |
1228 | (build-system trivial-build-system) | |
1229 | (source #f) | |
1230 | (outputs '("out" "image")) | |
1231 | (arguments | |
1232 | `(#:modules ((guix build union) | |
1233 | (guix build utils) | |
1234 | (guix build lisp-utils)) | |
1235 | #:builder | |
1236 | (begin | |
1237 | (use-modules (ice-9 match) | |
1238 | (srfi srfi-1) | |
1239 | (guix build union) | |
1240 | (guix build lisp-utils)) | |
1241 | ||
1242 | (union-build | |
1243 | (assoc-ref %outputs "out") | |
1244 | (filter-map | |
1245 | (match-lambda | |
1246 | ((name . path) | |
1247 | (if (string-prefix? "slynk" name) path #f))) | |
1248 | %build-inputs)) | |
1249 | ||
1250 | (prepend-to-source-registry | |
1251 | (string-append (assoc-ref %outputs "out") "//")) | |
b4c9f0c5 AP |
1252 | |
1253 | (parameterize ((%lisp-type "sbcl") | |
1254 | (%lisp (string-append (assoc-ref %build-inputs "sbcl") | |
1255 | "/bin/sbcl"))) | |
1256 | (build-image (string-append | |
1257 | (assoc-ref %outputs "image") | |
1258 | "/bin/slynk") | |
4209c31b | 1259 | %outputs |
e3cfef22 MW |
1260 | #:dependencies ',slynk-systems)) |
1261 | #t))))) | |
e3e171ee AP |
1262 | |
1263 | (define-public ecl-slynk | |
1264 | (package | |
1265 | (inherit sbcl-slynk) | |
1266 | (name "ecl-slynk") | |
1267 | (inputs | |
1268 | (map (match-lambda | |
1269 | ((name pkg . _) | |
1270 | (list name (sbcl-package->ecl-package pkg)))) | |
1271 | (package-inputs sbcl-slynk))) | |
1272 | (native-inputs '()) | |
1273 | (outputs '("out")) | |
1274 | (arguments | |
1275 | '(#:modules ((guix build union)) | |
1276 | #:builder | |
1277 | (begin | |
1278 | (use-modules (ice-9 match) | |
1279 | (guix build union)) | |
1280 | (match %build-inputs | |
1281 | (((names . paths) ...) | |
1282 | (union-build (assoc-ref %outputs "out") | |
e3cfef22 MW |
1283 | paths) |
1284 | #t))))))) | |
96784438 AP |
1285 | |
1286 | (define-public sbcl-stumpwm+slynk | |
1287 | (package | |
1288 | (inherit sbcl-stumpwm) | |
1289 | (name "sbcl-stumpwm-with-slynk") | |
1290 | (outputs '("out")) | |
4209c31b | 1291 | (inputs |
290bf612 | 1292 | `(("stumpwm" ,sbcl-stumpwm "lib") |
96784438 AP |
1293 | ("slynk" ,sbcl-slynk))) |
1294 | (arguments | |
1295 | (substitute-keyword-arguments (package-arguments sbcl-stumpwm) | |
1296 | ((#:phases phases) | |
1297 | `(modify-phases ,phases | |
1298 | (replace 'build-program | |
4209c31b | 1299 | (lambda* (#:key inputs outputs #:allow-other-keys) |
96784438 AP |
1300 | (let* ((out (assoc-ref outputs "out")) |
1301 | (program (string-append out "/bin/stumpwm"))) | |
4209c31b | 1302 | (build-program program outputs |
96784438 AP |
1303 | #:entry-program '((stumpwm:stumpwm) 0) |
1304 | #:dependencies '("stumpwm" | |
4209c31b AP |
1305 | ,@slynk-systems) |
1306 | #:dependency-prefixes | |
1307 | (map (lambda (input) (assoc-ref inputs input)) | |
1308 | '("stumpwm" "slynk"))) | |
96784438 AP |
1309 | ;; Remove unneeded file. |
1310 | (delete-file (string-append out "/bin/stumpwm-exec.fasl")) | |
1311 | #t))) | |
1312 | (delete 'copy-source) | |
1313 | (delete 'build) | |
1314 | (delete 'check) | |
290bf612 | 1315 | (delete 'create-asd-file) |
96784438 AP |
1316 | (delete 'cleanup) |
1317 | (delete 'create-symlinks))))))) | |
d00c96d7 RW |
1318 | |
1319 | (define-public sbcl-parse-js | |
1320 | (let ((commit "fbadc6029bec7039602abfc06c73bb52970998f6") | |
1321 | (revision "1")) | |
1322 | (package | |
1323 | (name "sbcl-parse-js") | |
1324 | (version (string-append "0.0.0-" revision "." (string-take commit 9))) | |
1325 | (source | |
1326 | (origin | |
1327 | (method git-fetch) | |
1328 | (uri (git-reference | |
1329 | (url "http://marijn.haverbeke.nl/git/parse-js") | |
1330 | (commit commit))) | |
1331 | (file-name (string-append name "-" commit "-checkout")) | |
1332 | (sha256 | |
1333 | (base32 | |
1334 | "1wddrnr5kiya5s3gp4cdq6crbfy9fqcz7fr44p81502sj3bvdv39")))) | |
1335 | (build-system asdf-build-system/sbcl) | |
1336 | (home-page "http://marijnhaverbeke.nl/parse-js/") | |
1337 | (synopsis "Parse JavaScript") | |
1338 | (description "Parse-js is a Common Lisp package for parsing | |
1339 | JavaScript (ECMAScript 3). It has basic support for ECMAScript 5.") | |
1340 | (license license:zlib)))) | |
d0eec99a RW |
1341 | |
1342 | (define-public sbcl-parse-number | |
1343 | (package | |
1344 | (name "sbcl-parse-number") | |
1345 | (version "1.5") | |
1346 | (source | |
1347 | (origin | |
1348 | (method url-fetch) | |
1349 | (uri (string-append "https://github.com/sharplispers/parse-number/" | |
1350 | "archive/v" version ".tar.gz")) | |
1351 | (file-name (string-append name "-" version ".tar.gz")) | |
1352 | (sha256 | |
1353 | (base32 | |
1354 | "1k6s4v65ksc1j5i0dprvzfvj213v6nah7i0rgd0726ngfjisj9ir")))) | |
1355 | (build-system asdf-build-system/sbcl) | |
1356 | (home-page "http://www.cliki.net/PARSE-NUMBER") | |
1357 | (synopsis "Parse numbers") | |
1358 | (description "@code{parse-number} is a library of functions for parsing | |
1359 | strings into one of the standard Common Lisp number types without using the | |
1360 | reader. @code{parse-number} accepts an arbitrary string and attempts to parse | |
1361 | the string into one of the standard Common Lisp number types, if possible, or | |
1362 | else @code{parse-number} signals an error of type @code{invalid-number}.") | |
1363 | (license license:bsd-3))) | |
1364 | ||
476b583f RW |
1365 | (define-public sbcl-iterate |
1366 | (package | |
1367 | (name "sbcl-iterate") | |
1368 | ;; The latest official release (1.4.3) fails to build so we have to take | |
1369 | ;; the current darcs tarball from quicklisp. | |
1370 | (version "20160825") | |
1371 | (source | |
1372 | (origin | |
1373 | (method url-fetch) | |
1374 | (uri (string-append "http://beta.quicklisp.org/archive/iterate/" | |
1375 | "2016-08-25/iterate-" | |
1376 | version "-darcs.tgz")) | |
1377 | (sha256 | |
1378 | (base32 | |
1379 | "0kvz16gnxnkdz0fy1x8y5yr28nfm7i2qpvix7mgwccdpjmsb4pgm")))) | |
1380 | (build-system asdf-build-system/sbcl) | |
1381 | (home-page "https://common-lisp.net/project/iterate/") | |
1382 | (synopsis "Iteration construct for Common Lisp") | |
1383 | (description "@code{iterate} is an iteration construct for Common Lisp. | |
1384 | It is similar to the @code{CL:LOOP} macro, with these distinguishing marks: | |
1385 | ||
1386 | @itemize | |
1387 | @item it is extensible, | |
1388 | @item it helps editors like Emacs indent iterate forms by having a more | |
1389 | lisp-like syntax, and | |
1390 | @item it isn't part of the ANSI standard for Common Lisp. | |
1391 | @end itemize\n") | |
1392 | (license license:expat))) | |
52650a4d RW |
1393 | |
1394 | (define-public sbcl-cl-uglify-js | |
1395 | ;; There have been many bug fixes since the 2010 release. | |
1396 | (let ((commit "429c5e1d844e2f96b44db8fccc92d6e8e28afdd5") | |
1397 | (revision "1")) | |
1398 | (package | |
1399 | (name "sbcl-cl-uglify-js") | |
1400 | (version (string-append "0.1-" revision "." (string-take commit 9))) | |
1401 | (source | |
1402 | (origin | |
1403 | (method git-fetch) | |
1404 | (uri (git-reference | |
1405 | (url "https://github.com/mishoo/cl-uglify-js.git") | |
1406 | (commit commit))) | |
03e8182b | 1407 | (file-name (git-file-name name version)) |
52650a4d RW |
1408 | (sha256 |
1409 | (base32 | |
1410 | "0k39y3c93jgxpr7gwz7w0d8yknn1fdnxrjhd03057lvk5w8js27a")))) | |
1411 | (build-system asdf-build-system/sbcl) | |
1412 | (inputs | |
1413 | `(("sbcl-parse-js" ,sbcl-parse-js) | |
1414 | ("sbcl-cl-ppcre" ,sbcl-cl-ppcre) | |
1415 | ("sbcl-cl-ppcre-unicode" ,sbcl-cl-ppcre-unicode) | |
1416 | ("sbcl-parse-number" ,sbcl-parse-number) | |
1417 | ("sbcl-iterate" ,sbcl-iterate))) | |
1418 | (home-page "https://github.com/mishoo/cl-uglify-js") | |
1419 | (synopsis "JavaScript compressor library for Common Lisp") | |
1420 | (description "This is a Common Lisp version of UglifyJS, a JavaScript | |
1421 | compressor. It works on data produced by @code{parse-js} to generate a | |
1422 | @dfn{minified} version of the code. Currently it can: | |
1423 | ||
1424 | @itemize | |
1425 | @item reduce variable names (usually to single letters) | |
1426 | @item join consecutive @code{var} statements | |
1427 | @item resolve simple binary expressions | |
1428 | @item group most consecutive statements using the ``sequence'' operator (comma) | |
1429 | @item remove unnecessary blocks | |
1430 | @item convert @code{IF} expressions in various ways that result in smaller code | |
1431 | @item remove some unreachable code | |
1432 | @end itemize\n") | |
1433 | (license license:zlib)))) | |
dd35abfe RW |
1434 | |
1435 | (define-public uglify-js | |
1436 | (package | |
1437 | (inherit sbcl-cl-uglify-js) | |
1438 | (name "uglify-js") | |
1439 | (build-system trivial-build-system) | |
1440 | (arguments | |
1441 | `(#:modules ((guix build utils)) | |
1442 | #:builder | |
1443 | (let* ((bin (string-append (assoc-ref %outputs "out") "/bin/")) | |
1444 | (script (string-append bin "uglify-js"))) | |
1445 | (use-modules (guix build utils)) | |
1446 | (mkdir-p bin) | |
1447 | (with-output-to-file script | |
1448 | (lambda _ | |
1449 | (format #t "#!~a/bin/sbcl --script | |
1450 | (require :asdf) | |
1451 | (push (truename \"~a/lib/sbcl\") asdf:*central-registry*)" | |
1452 | (assoc-ref %build-inputs "sbcl") | |
1453 | (assoc-ref %build-inputs "sbcl-cl-uglify-js")) | |
1454 | ;; FIXME: cannot use progn here because otherwise it fails to | |
1455 | ;; find cl-uglify-js. | |
1456 | (for-each | |
1457 | write | |
1458 | '(;; Quiet, please! | |
1459 | (let ((*standard-output* (make-broadcast-stream)) | |
1460 | (*error-output* (make-broadcast-stream))) | |
1461 | (asdf:load-system :cl-uglify-js)) | |
1462 | (let ((file (cadr *posix-argv*))) | |
1463 | (if file | |
1464 | (format t "~a" | |
1465 | (cl-uglify-js:ast-gen-code | |
1466 | (cl-uglify-js:ast-mangle | |
1467 | (cl-uglify-js:ast-squeeze | |
1468 | (with-open-file (in file) | |
1469 | (parse-js:parse-js in)))) | |
1470 | :beautify nil)) | |
1471 | (progn | |
1472 | (format *error-output* | |
1473 | "Please provide a JavaScript file.~%") | |
1474 | (sb-ext:exit :code 1)))))))) | |
1475 | (chmod script #o755) | |
1476 | #t))) | |
1477 | (inputs | |
1478 | `(("sbcl" ,sbcl) | |
1479 | ("sbcl-cl-uglify-js" ,sbcl-cl-uglify-js))) | |
1480 | (synopsis "JavaScript compressor"))) | |
56c240ba LC |
1481 | |
1482 | (define-public confusion-mdl | |
1483 | (let* ((commit "12a055581fc262225272df43287dae48281900f5")) | |
1484 | (package | |
1485 | (name "confusion-mdl") | |
1486 | (version "0.2") | |
1487 | (source (origin | |
1488 | (method git-fetch) | |
1489 | (uri (git-reference | |
1490 | (url (string-append "https://gitlab.com/emacsomancer/" name)) | |
1491 | (commit commit))) | |
1492 | (sha256 | |
1493 | (base32 | |
1494 | "1zi8kflzvwqg97ha1sa5xjisbjs5z1mvbpa772vfxiv5ksnpxp0d")) | |
1495 | (file-name (git-file-name name version)))) | |
1496 | (build-system gnu-build-system) | |
1497 | (arguments | |
1498 | `(#:tests? #f ; there are no tests | |
1499 | #:phases | |
1500 | (modify-phases %standard-phases | |
1501 | (delete 'configure) | |
1502 | (replace 'build | |
1503 | (lambda* (#:key (make-flags '()) #:allow-other-keys) | |
1504 | (apply invoke "make" "CC=gcc" make-flags))) | |
1505 | (replace 'install | |
1506 | (lambda* (#:key outputs #:allow-other-keys) | |
1507 | (let* ((out (assoc-ref outputs "out")) | |
1508 | (bin (string-append out "/bin"))) | |
1509 | (install-file "mdli" bin) | |
1510 | #t)))))) | |
1511 | (native-inputs | |
1512 | `(("perl" ,perl))) | |
1513 | (inputs | |
1514 | `(("libgc" ,libgc))) | |
1515 | (synopsis "Interpreter for the MIT Design Language (MDL)") | |
1516 | (description "MDL (the MIT Design Language) is a descendant of Lisp. It | |
1517 | was originally developed in 1971 on the PDP-10 computer under the Incompatible | |
1518 | Timesharing System (ITS) to provide high level language support for the | |
1519 | Dynamic Modeling Group at MIT's Project MAC. Infocom built the original | |
1520 | PDP-10 Zork in MDL and their later ZIL (Zork Implementation Language) was | |
1521 | based on a subset of MDL. Confusion is a MDL interpreter that works just well | |
1522 | enough to play the original mainframe Zork all the way through.") | |
1523 | (home-page "http://www.russotto.net/git/mrussotto/confusion/src/master/src/README") | |
1524 | (license license:gpl3+)))) |