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>
12 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
68 (define (asdf-substitutions lisp)
69 ;; Prepend XDG_DATA_DIRS/LISP-bundle-systems to ASDF's
70 ;; 'default-system-source-registry'.
71 `((("\\(,dir \"systems/\"\\)\\)")
73 "(,dir \"~a-bundle-systems\")))
75 ,@(loop :for dir :in (xdg-data-dirs \"common-lisp/\")
76 :collect `(:directory (,dir \"systems\"))"
80 (let ((commit "5956140b1083e2302a59d7ce2054b0b7c2cbb417")
81 (revision "1")) ;Guix package revision
84 (version (string-append "2.6.12-" revision "."
85 (string-take commit 7)))
90 (url "https://git.savannah.gnu.org/r/gcl.git")
92 (file-name (string-append "gcl-" version "-checkout"))
94 (base32 "0mwclf2879mh3d9xqkqhghf58lwy7srsnsq9x0f1cc6j302sy4hb"))))
95 (build-system gnu-build-system)
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
101 (string-append "GCL_CC=" (assoc-ref %build-inputs "gcc")
103 (string-append "CC=" (assoc-ref %build-inputs "gcc")
106 (modify-phases %standard-phases
107 (add-before 'configure 'pre-conf
108 (lambda* (#:key inputs #:allow-other-keys)
112 '("pcl/impl/kcl/makefile.akcl"
114 "unixport/makefile.dos"
116 "gcl-tk/makefile.prev"
118 (find-files "h" "\\.defs"))
120 (string-append "SHELL=" (which "bash")))
122 (string-append "SHELL=" (which "sh"))))
123 (substitute* "h/linux.defs"
125 (("-fwritable-strings") "")
127 (substitute* "lsp/gcl_top.lsp"
129 (string-append "\"" (assoc-ref %build-inputs "gcc")
131 (("\\(or \\(get-path \\*cc\\*\\) \\*cc\\*\\)") "*cc*")
133 (string-append "\"" (assoc-ref %build-inputs "binutils")
135 (("\\(or \\(get-path \\*ld\\*\\) \\*ld\\*\\)") "*ld*")
136 (("\\(get-path \"objdump --source \"\\)")
137 (string-append "\"" (assoc-ref %build-inputs "binutils")
138 "/bin/objdump --source \"")))
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)
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"))
157 ;; drop strip phase to make maxima build, see
158 ;; https://www.ma.utexas.edu/pipermail/maxima/2008/009769.html
162 ("readline" ,readline)))
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+))))
185 "https://common-lisp.net/project/ecl/static/files/release/"
186 name "-" version ".tgz"))
188 (base32 "0m0j24w5d5a9dwwqyrg0d35c0nys16ijb4r0nyk87yp82v38b9bn"))
189 (modules '((guix build utils)))
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)
205 (modify-phases %standard-phases
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)
212 (assoc-ref inputs lib) path)))
213 (libraries '("gmp" "libatomic-ops" "libgc" "libffi" "libc"))
214 (binaries '("gcc" "ld-wrapper" "binutils"))
216 (map (lambda (lib) (input-path lib "/lib"))
219 (wrap-program (string-append ecl "/bin/ecl")
221 ,(map (lambda (binary)
222 (input-path binary "/bin"))
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
233 (substitute* "build/tests/Makefile"
234 (("\\$\\{exec_prefix\\}/") ""))
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+)))
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"))
264 (base32 "0qjv3z274rbdmb941hy03hl63f4z7bmci234f8dyz4skgfr82d3i"))
265 (patches (search-patches "clisp-remove-failing-test.patch"))))
266 (build-system gnu-build-system)
267 (inputs `(("libffcall" ,libffcall)
269 ("readline" ,readline)
270 ("libsigsegv" ,libsigsegv)))
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"
277 "--with-dynamic-modules"
278 "--with-module=bindings/glibc"
279 "--with-module=rawsock")
282 (modify-phases %standard-phases
283 (add-after 'unpack 'patch-sh-and-pwd
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")
292 (substitute* '("src/clisp-link.in")
293 (("/bin/pwd") "pwd"))
295 (add-after 'unpack 'remove-timestamps
297 (substitute* "src/constobj.d"
298 (("__DATE__ __TIME__") "\"1\""))
299 (substitute* "src/genclisph.d"
300 (("__DATE__") "\"1\"")
301 (("__TIME__") "\"1\""))
303 ;; Makefiles seem to have race conditions.
304 #:parallel-build? #f))
305 (home-page "http://www.clisp.org/")
306 (synopsis "A Common Lisp implementation")
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+)))
323 (uri (string-append "mirror://sourceforge/sbcl/sbcl/" version "/sbcl-"
324 version "-source.tar.bz2"))
326 (base32 "0fjdqnb2rsm2vi9794ywp27jr239ddvzc4xfr0dk49jd4v7p2kc5"))
327 (modules '((guix build utils)))
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.
338 ("inetutils" ,inetutils) ;for hostname(1)
341 ("texinfo" ,texinfo)))
343 '(#:modules ((guix build gnu-build-system)
347 (modify-phases %standard-phases
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.
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))))))
396 (lambda* (#:key outputs #:allow-other-keys)
398 (zero? (system* "sh" "make.sh" "clisp"
399 (string-append "--prefix="
400 (assoc-ref outputs "out"))))))
403 (zero? (system* "sh" "install.sh"))))
404 (add-after 'build 'build-doc
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")
419 (delete-file-recursively old-doc-dir)
421 ;; No 'check' target, though "make.sh" (build phase) runs tests.
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")))))
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.
454 "ftp://ftp.clozure.com/pub/release/" 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="
465 (match (%current-system)
466 ((or "i686-linux" "x86_64-linux")
467 "0w3dmj7q9kqyra3yrf1lxclnjz151yvf5s5q8ayllvmvqbl8bs08")
469 "1x487aaz2rqcb6k301sy2p39a1m4qdhg6z9p9fb76ssipqgr38b4")
473 ("subversion" ,subversion)))
475 `(#:tests? #f ;no 'check' target
476 #:modules ((srfi srfi-26)
478 (guix build gnu-build-system))
480 (modify-phases %standard-phases
482 (lambda* (#:key inputs #:allow-other-keys)
483 (and (zero? (system* "tar" "xzvf" (assoc-ref inputs "ccl")))
484 (begin (chdir "ccl") #t))))
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.
490 (chdir (string-append
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="
500 (substitute* '("Makefile")
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.
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.
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"))
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="
526 (heap (string-append kernel ".image")))
527 (install-file kernel libdir)
528 (install-file heap libdir)
530 (let ((dirs '("lib" "library" "examples" "contrib"
531 "tools" "objc-bridge")))
532 (for-each copy-recursively
534 (map (cut string-append libdir <>) dirs)))
537 (with-output-to-file wrapper
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))
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
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
559 (define-public femtolisp
560 (let ((commit "68c5b1225572ecf2c52baf62f928063e5a30511b")
564 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
568 (url "https://github.com/JeffBezanson/femtolisp.git")
570 (file-name (string-append name "-" version "-checkout"))
573 "04rnwllxnl86zw8c6pwxznn49bvkvh0f1lfliy085vjzvlq3rgja"))))
574 ;; See "utils.h" for supported systems. Upstream bug:
575 ;; https://github.com/JeffBezanson/femtolisp/issues/25
577 (fold delete %supported-systems
578 '("armhf-linux" "mips64el-linux" "aarch64-linux")))
579 (build-system gnu-build-system)
581 `(#:make-flags '("CC=gcc" "release")
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)
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")))
599 (zero? (system* "./bootstrap.sh"))
600 (install-file "flisp.boot" bin))))))))
601 (synopsis "Scheme-like lisp implementation")
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))))
616 (uri (string-append "mirror://sourceforge/lush/lush2/lush-"
618 (modules '((guix build utils)))
621 (substitute* "src/unix.c"
622 (("\\{ \"LUSH_DATE\", __DATE__ \\},") "")
623 (("\\{ \"LUSH_TIME\", __TIME__ \\},") ""))
624 (substitute* "src/main.c"
625 (("\" \\(built \" __DATE__ \"\\)\"") ""))))
628 "02pkfn3nqdkm9fm44911dbcz0v3r0l53vygj8xigl6id5g3iwi4k"))))
629 (build-system gnu-build-system)
631 `(;; We have to add these LIBS so that they are found.
632 #:configure-flags (list "LIBS=-lz"
633 "X_EXTRA_LIBS=-lfontconfig"
635 #:tests? #f)) ; No make check.
636 (native-inputs `(("intltool" ,intltool)))
638 `(("alsa-lib" ,alsa-lib)
640 ("sdl-image" ,sdl-image)
641 ("sdl-mixer" ,sdl-mixer)
646 ("fontconfig" ,fontconfig)
648 ("openblas" ,openblas)
651 ("mesa-utils" ,mesa-utils)
652 ("binutils" ,binutils)
653 ("libiberty" ,libiberty)
654 ("readline" ,readline)
656 ("gettext-minimal" ,gettext-minimal)))
657 (synopsis "Lisp Universal Shell")
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+)))
672 (define-public sbcl-alexandria
674 (commit "926a066611b7b11cb71e26c827a271e500888c30"))
676 (name "sbcl-alexandria")
677 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
682 (url "https://gitlab.common-lisp.net/alexandria/alexandria.git")
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")
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))))
697 (define-public cl-alexandria
698 (sbcl-package->cl-source-package sbcl-alexandria))
700 (define-public ecl-alexandria
701 (sbcl-package->ecl-package sbcl-alexandria))
703 (define-public sbcl-fiveam
711 "https://github.com/sionescu/fiveam/archive/v"
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)))
725 (define-public cl-fiveam
726 (sbcl-package->cl-source-package sbcl-fiveam))
728 (define-public ecl-fiveam
729 (sbcl-package->ecl-package sbcl-fiveam))
731 (define-public sbcl-bordeaux-threads
733 (name "sbcl-bordeaux-threads")
738 "https://github.com/sionescu/bordeaux-threads/archive/v"
741 (base32 "10ryrcx832fwqdawb6jmknymi7wpdzhi30qzx7cbrk0cpnka71w2"))
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
751 (home-page "https://common-lisp.net/project/bordeaux-threads/")
752 (license license:x11)))
754 (define-public cl-bordeaux-threads
755 (sbcl-package->cl-source-package sbcl-bordeaux-threads))
757 (define-public ecl-bordeaux-threads
758 (sbcl-package->ecl-package sbcl-bordeaux-threads))
760 (define-public sbcl-trivial-gray-streams
762 (commit "0483ade330508b4b2edeabdb47d16ec9437ee1cb"))
764 (name "sbcl-trivial-gray-streams")
765 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
771 (url "https://github.com/trivial-gray-streams/trivial-gray-streams.git")
774 (base32 "0m3rpf2x0zmdk3nf1qfa01j6a55vj7gkwhyw78qslcgbjlgh8p4d"))
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))))
786 (define-public cl-trivial-gray-streams
787 (sbcl-package->cl-source-package sbcl-trivial-gray-streams))
789 (define-public ecl-trivial-gray-streams
790 (sbcl-package->ecl-package sbcl-trivial-gray-streams))
792 (define-public sbcl-flexi-streams
794 (name "sbcl-flexi-streams")
800 "https://github.com/edicl/flexi-streams/archive/v"
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)))
816 (define-public cl-flexi-streams
817 (sbcl-package->cl-source-package sbcl-flexi-streams))
819 (define-public ecl-flexi-streams
820 (sbcl-package->ecl-package sbcl-flexi-streams))
822 (define-public sbcl-cl-ppcre
824 (name "sbcl-cl-ppcre")
830 "https://github.com/edicl/cl-ppcre/archive/v"
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)))
844 (define-public cl-ppcre
845 (sbcl-package->cl-source-package sbcl-cl-ppcre))
847 (define-public ecl-cl-ppcre
848 (sbcl-package->ecl-package sbcl-cl-ppcre))
850 (define sbcl-cl-unicode-base
852 (commit "9fcd06fba1ddc9e66aed2f2d6c32dc9b764f03ea"))
854 (name "sbcl-cl-unicode-base")
855 (version (string-append "0.1.5-" revision "." (string-take commit 7)))
859 (url "https://github.com/edicl/cl-unicode.git")
861 (file-name (string-append "cl-unicode-" version "-checkout"))
864 "1jicprb5b3bv57dy1kg03572gxkcaqdjhak00426s76g0plmx5ki"))))
865 (build-system asdf-build-system/sbcl)
867 '(#:asd-file "cl-unicode.asd"
868 #:asd-system-name "cl-unicode/base"))
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))))
878 (define-public sbcl-cl-unicode
880 (inherit sbcl-cl-unicode-base)
881 (name "sbcl-cl-unicode")
883 `(("cl-unicode/base" ,sbcl-cl-unicode-base)
884 ,@(package-inputs sbcl-cl-unicode-base)))
886 `(("flexi-streams" ,sbcl-flexi-streams)))
889 (define-public ecl-cl-unicode
890 (sbcl-package->ecl-package sbcl-cl-unicode))
892 (define-public cl-unicode
893 (sbcl-package->cl-source-package sbcl-cl-unicode))
895 (define-public sbcl-clx
897 (commit "1c62774b03c1cf3fe6e5cb532df8b14b44c96b95"))
900 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
906 (url "https://github.com/sharplispers/clx.git")
909 (base32 "0qffag03ns52kwq9xjns2qg1yr0bf3ba507iwq5cmx5xz0b0rmjm"))
910 (file-name (string-append "clx-" version "-checkout"))
913 (search-patch "clx-remove-demo.patch")))
914 (modules '((guix build utils)))
917 ;; These removed files cause the compiled system to crash when
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))))
932 (define-public cl-clx
933 (sbcl-package->cl-source-package sbcl-clx))
935 (define-public ecl-clx
936 (sbcl-package->ecl-package sbcl-clx))
938 (define-public sbcl-cl-ppcre-unicode
939 (package (inherit sbcl-cl-ppcre)
940 (name "sbcl-cl-ppcre-unicode")
942 `(#:tests? #f ; tests fail with "Component :CL-PPCRE-TEST not found"
943 #:asd-file "cl-ppcre-unicode.asd"))
945 `(("sbcl-cl-ppcre" ,sbcl-cl-ppcre)
946 ("sbcl-cl-unicode" ,sbcl-cl-unicode)))))
948 (define-public sbcl-stumpwm
950 (name "sbcl-stumpwm")
955 "https://github.com/stumpwm/stumpwm/archive/"
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)
963 (outputs '("out" "lib"))
966 (modify-phases %standard-phases
967 (add-after 'create-symlinks 'build-program
968 (lambda* (#:key outputs #:allow-other-keys)
970 (string-append (assoc-ref outputs "out") "/bin/stumpwm")
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")))
978 (call-with-output-file
979 (string-append xsessions "/stumpwm.desktop")
984 Comment=The Stump Window Manager~@
985 Exec=~a/bin/stumpwm~@
986 TryExec=~@*~a/bin/stumpwm~@
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))))))
1000 (define-public cl-stumpwm
1001 (sbcl-package->cl-source-package sbcl-stumpwm))
1003 (define-public ecl-stumpwm
1004 (let ((base (sbcl-package->ecl-package sbcl-stumpwm)))
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"))
1018 (name "sbcl-slynk-boot0")
1019 (version (string-append "1.0.0-beta-" revision "." (string-take commit 7)))
1025 (url "https://github.com/joaotavora/sly.git")
1028 (base32 "0h4gg3sndl2bf6jdnx9nrf14p9hhi43hagrl0f4v4l11hczl8w81"))
1029 (file-name (string-append "slynk-" version "-checkout"))
1030 (modules '((guix build utils)
1034 ;; Move the contribs into the main source directory for easier
1036 (substitute* "slynk/slynk.asd"
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
1044 (substitute* "contrib/slynk-profiler.lisp"
1046 "slynk-pprint-to-line"))
1047 (rename-file "contrib" "slynk/contrib")
1048 ;; Move slynk's contents into the base directory for easier
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)
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)))))))
1070 (define-public cl-slynk
1072 (inherit (sbcl-package->cl-source-package sbcl-slynk-boot0))
1075 (define ecl-slynk-boot0
1076 (sbcl-package->ecl-package sbcl-slynk-boot0))
1078 (define sbcl-slynk-arglists
1080 (inherit sbcl-slynk-boot0)
1081 (name "sbcl-slynk-arglists")
1082 (inputs `(("slynk" ,sbcl-slynk-boot0)))
1084 (substitute-keyword-arguments (package-arguments sbcl-slynk-boot0)
1085 ((#:asd-file _ "") "slynk.asd")
1086 ((#:asd-system-name _ #f) #f)))))
1088 (define ecl-slynk-arglists
1089 (sbcl-package->ecl-package sbcl-slynk-arglists))
1091 (define sbcl-slynk-util
1093 (inherit sbcl-slynk-arglists)
1094 (name "sbcl-slynk-util")))
1096 (define ecl-slynk-util
1097 (sbcl-package->ecl-package sbcl-slynk-util))
1099 (define sbcl-slynk-fancy-inspector
1101 (inherit sbcl-slynk-arglists)
1102 (name "sbcl-slynk-fancy-inspector")
1103 (inputs `(("slynk-util" ,sbcl-slynk-util)
1104 ,@(package-inputs sbcl-slynk-arglists)))))
1106 (define ecl-slynk-fancy-inspector
1107 (sbcl-package->ecl-package sbcl-slynk-fancy-inspector))
1109 (define sbcl-slynk-package-fu
1111 (inherit sbcl-slynk-arglists)
1112 (name "sbcl-slynk-package-fu")))
1114 (define ecl-slynk-package-fu
1115 (sbcl-package->ecl-package sbcl-slynk-package-fu))
1117 (define sbcl-slynk-mrepl
1119 (inherit sbcl-slynk-arglists)
1120 (name "sbcl-slynk-mrepl")))
1122 (define ecl-slynk-mrepl
1123 (sbcl-package->ecl-package sbcl-slynk-mrepl))
1125 (define sbcl-slynk-trace-dialog
1127 (inherit sbcl-slynk-arglists)
1128 (name "sbcl-slynk-trace-dialog")))
1130 (define ecl-slynk-trace-dialog
1131 (sbcl-package->ecl-package sbcl-slynk-trace-dialog))
1133 (define sbcl-slynk-profiler
1135 (inherit sbcl-slynk-arglists)
1136 (name "sbcl-slynk-profiler")))
1138 (define ecl-slynk-profiler
1139 (sbcl-package->ecl-package sbcl-slynk-profiler))
1141 (define sbcl-slynk-stickers
1143 (inherit sbcl-slynk-arglists)
1144 (name "sbcl-slynk-stickers")))
1146 (define ecl-slynk-stickers
1147 (sbcl-package->ecl-package sbcl-slynk-stickers))
1149 (define sbcl-slynk-indentation
1151 (inherit sbcl-slynk-arglists)
1152 (name "sbcl-slynk-indentation")))
1154 (define ecl-slynk-indentation
1155 (sbcl-package->ecl-package sbcl-slynk-indentation))
1157 (define sbcl-slynk-retro
1159 (inherit sbcl-slynk-arglists)
1160 (name "sbcl-slynk-retro")))
1162 (define ecl-slynk-retro
1163 (sbcl-package->ecl-package sbcl-slynk-retro))
1165 (define slynk-systems
1169 "slynk-fancy-inspector"
1173 "slynk-trace-dialog"
1178 (define-public sbcl-slynk
1180 (inherit sbcl-slynk-boot0)
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)
1197 (outputs '("out" "image"))
1199 `(#:modules ((guix build union)
1201 (guix build lisp-utils))
1204 (use-modules (ice-9 match)
1207 (guix build lisp-utils))
1210 (assoc-ref %outputs "out")
1214 (if (string-prefix? "slynk" name) path #f)))
1217 (prepend-to-source-registry
1218 (string-append (assoc-ref %outputs "out") "//"))
1220 (parameterize ((%lisp-type "sbcl")
1221 (%lisp (string-append (assoc-ref %build-inputs "sbcl")
1223 (build-image (string-append
1224 (assoc-ref %outputs "image")
1227 #:dependencies ',slynk-systems)))))))
1229 (define-public ecl-slynk
1231 (inherit sbcl-slynk)
1236 (list name (sbcl-package->ecl-package pkg))))
1237 (package-inputs sbcl-slynk)))
1241 '(#:modules ((guix build union))
1244 (use-modules (ice-9 match)
1246 (match %build-inputs
1247 (((names . paths) ...)
1248 (union-build (assoc-ref %outputs "out")
1251 (define-public sbcl-stumpwm+slynk
1253 (inherit sbcl-stumpwm)
1254 (name "sbcl-stumpwm-with-slynk")
1257 `(("stumpwm" ,sbcl-stumpwm "lib")
1258 ("slynk" ,sbcl-slynk)))
1260 (substitute-keyword-arguments (package-arguments sbcl-stumpwm)
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"
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"))
1277 (delete 'copy-source)
1280 (delete 'create-asd-file)
1282 (delete 'create-symlinks)))))))
1284 (define-public sbcl-parse-js
1285 (let ((commit "fbadc6029bec7039602abfc06c73bb52970998f6")
1288 (name "sbcl-parse-js")
1289 (version (string-append "0.0.0-" revision "." (string-take commit 9)))
1294 (url "http://marijn.haverbeke.nl/git/parse-js")
1296 (file-name (string-append name "-" commit "-checkout"))
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))))
1307 (define-public sbcl-parse-number
1309 (name "sbcl-parse-number")
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"))
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)))
1330 (define-public sbcl-iterate
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")
1339 (uri (string-append "http://beta.quicklisp.org/archive/iterate/"
1340 "2016-08-25/iterate-"
1341 version "-darcs.tgz"))
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:
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.
1357 (license license:expat)))
1359 (define-public sbcl-cl-uglify-js
1360 ;; There have been many bug fixes since the 2010 release.
1361 (let ((commit "429c5e1d844e2f96b44db8fccc92d6e8e28afdd5")
1364 (name "sbcl-cl-uglify-js")
1365 (version (string-append "0.1-" revision "." (string-take commit 9)))
1370 (url "https://github.com/mishoo/cl-uglify-js.git")
1374 "0k39y3c93jgxpr7gwz7w0d8yknn1fdnxrjhd03057lvk5w8js27a"))))
1375 (build-system asdf-build-system/sbcl)
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:
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
1397 (license license:zlib))))
1399 (define-public uglify-js
1401 (inherit sbcl-cl-uglify-js)
1403 (build-system trivial-build-system)
1405 `(#:modules ((guix build utils))
1407 (let* ((bin (string-append (assoc-ref %outputs "out") "/bin/"))
1408 (script (string-append bin "uglify-js")))
1409 (use-modules (guix build utils))
1411 (with-output-to-file script
1413 (format #t "#!~a/bin/sbcl --script
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.
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*)))
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))))
1436 (format *error-output*
1437 "Please provide a JavaScript file.~%")
1438 (sb-ext:exit :code 1))))))))
1439 (chmod script #o755)
1443 ("sbcl-cl-uglify-js" ,sbcl-cl-uglify-js)))
1444 (synopsis "JavaScript compressor")))