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