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