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 Nils Gillmann <ng0@n0.is>
7 ;;; Copyright © 2016, 2017 Andy Patterson <ajpatter@uwaterloo.ca>
8 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
9 ;;; Copyright © 2017, 2018 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-glibc-2.26.patch"
266 "clisp-remove-failing-test.patch"))))
267 (build-system gnu-build-system)
268 (inputs `(("libffcall" ,libffcall)
270 ("readline" ,readline)
271 ("libsigsegv" ,libsigsegv)))
273 '(#:configure-flags '("--enable-portability"
275 "--with-dynamic-modules"
276 "--with-module=rawsock")
279 (modify-phases %standard-phases
280 (add-after 'unpack 'patch-sh-and-pwd
282 ;; The package is very messy with its references to "/bin/sh" and
283 ;; some other absolute paths to traditional tools. These appear in
284 ;; many places where our automatic patching misses them. Therefore
285 ;; we do the following, in this early (post-unpack) phase, to solve
286 ;; the problem from its root.
287 (substitute* (find-files "." "configure|Makefile")
289 (substitute* '("src/clisp-link.in")
290 (("/bin/pwd") "pwd"))
292 ;; Makefiles seem to have race conditions.
293 #:parallel-build? #f))
294 (home-page "http://www.clisp.org/")
295 (synopsis "A Common Lisp implementation")
297 "GNU CLISP is an implementation of ANSI Common Lisp. Common Lisp is a
298 high-level, object-oriented functional programming language. CLISP includes
299 an interpreter, a compiler, a debugger, and much more.")
300 (license license:gpl2+)))
309 (uri (string-append "mirror://sourceforge/sbcl/sbcl/" version "/sbcl-"
310 version "-source.tar.bz2"))
312 (base32 "1k6v5b8qv7vyxvh8asx6phf2hbapx5pp5p5j47hgnq123fwnh4fa"))
313 (modules '((guix build utils)))
315 ;; Add sbcl-bundle-systems to 'default-system-source-registry'.
316 `(substitute* "contrib/asdf/asdf.lisp"
317 ,@(asdf-substitutions name)))))
318 (build-system gnu-build-system)
319 (outputs '("out" "doc"))
320 ;; Bootstrap with CLISP.
324 ("inetutils" ,inetutils) ;for hostname(1)
327 ("texinfo" ,texinfo)))
329 '(#:modules ((guix build gnu-build-system)
333 (modify-phases %standard-phases
335 (add-before 'build 'patch-unix-tool-paths
336 (lambda* (#:key outputs inputs #:allow-other-keys)
337 (let ((out (assoc-ref outputs "out"))
338 (bash (assoc-ref inputs "bash"))
339 (coreutils (assoc-ref inputs "coreutils"))
340 (ed (assoc-ref inputs "ed")))
341 (define (quoted-path input path)
342 (string-append "\"" input path "\""))
343 ;; Patch absolute paths in string literals. Note that this
344 ;; occurs in some .sh files too (which contain Lisp code). Use
345 ;; ISO-8859-1 because some of the files are ISO-8859-1 encoded.
346 (with-fluids ((%default-port-encoding #f))
347 ;; The removed file is utf-16-be encoded, which gives substitute*
348 ;; trouble. It does not contain references to the listed programs.
350 "./tests/data/compile-file-pos-utf16be.lisp"
351 (find-files "." "\\.(lisp|sh)$"))
352 (("\"/bin/sh\"") (quoted-path bash "/bin/sh"))
353 (("\"/usr/bin/env\"") (quoted-path coreutils "/usr/bin/env"))
354 (("\"/bin/cat\"") (quoted-path coreutils "/bin/cat"))
355 (("\"/bin/ed\"") (quoted-path ed "/bin/ed"))
356 (("\"/bin/echo\"") (quoted-path coreutils "/bin/echo"))
357 (("\"/bin/uname\"") (quoted-path coreutils "/bin/uname"))))
358 ;; This one script has a non-string occurrence of /bin/sh.
359 (substitute* '("tests/foreign.test.sh")
360 ;; Leave whitespace so we don't match the shebang.
361 ((" /bin/sh ") " sh "))
362 ;; This file contains a module that can create executable files
363 ;; which depend on the presence of SBCL. It generates shell
364 ;; scripts doing "exec sbcl ..." to achieve this. We patch both
365 ;; the shebang and the reference to "sbcl", tying the generated
366 ;; executables to the exact SBCL package that generated them.
367 (substitute* '("contrib/sb-executable/sb-executable.lisp")
368 (("/bin/sh") (string-append bash "/bin/sh"))
369 (("exec sbcl") (string-append "exec " out "/bin/sbcl")))
370 ;; Disable some tests that fail in our build environment.
371 (substitute* '("contrib/sb-bsd-sockets/tests.lisp")
372 ;; This requires /etc/protocols.
373 (("\\(deftest get-protocol-by-name/error" all)
374 (string-append "#+nil ;disabled by Guix\n" all)))
375 (substitute* '("contrib/sb-posix/posix-tests.lisp")
376 ;; These assume some users/groups which we don't have.
377 (("\\(deftest pwent\\.[12]" all)
378 (string-append "#+nil ;disabled by Guix\n" all))
379 (("\\(deftest grent\\.[12]" all)
380 (string-append "#+nil ;disabled by Guix\n" all))))))
382 (lambda* (#:key outputs #:allow-other-keys)
384 (zero? (system* "sh" "make.sh" "clisp"
385 (string-append "--prefix="
386 (assoc-ref outputs "out"))))))
389 (zero? (system* "sh" "install.sh"))))
390 (add-after 'build 'build-doc
392 (with-directory-excursion "doc/manual"
393 (and (zero? (system* "make" "info"))
394 (zero? (system* "make" "dist"))))))
395 (add-after 'install 'install-doc
396 (lambda* (#:key outputs #:allow-other-keys)
397 (let* ((out (assoc-ref outputs "out"))
398 (doc (assoc-ref outputs "doc"))
399 (old-doc-dir (string-append out "/share/doc"))
400 (new-doc/sbcl-dir (string-append doc "/share/doc/sbcl")))
401 (rmdir (string-append old-doc-dir "/sbcl/html"))
402 (mkdir-p new-doc/sbcl-dir)
403 (copy-recursively (string-append old-doc-dir "/sbcl")
405 (delete-file-recursively old-doc-dir)
407 ;; No 'check' target, though "make.sh" (build phase) runs tests.
410 (list (search-path-specification
411 (variable "XDG_DATA_DIRS")
412 (files '("share")))))
413 (home-page "http://www.sbcl.org/")
414 (synopsis "Common Lisp implementation")
415 (description "Steel Bank Common Lisp (SBCL) is a high performance Common
416 Lisp compiler. In addition to the compiler and runtime system for ANSI Common
417 Lisp, it provides an interactive environment including a debugger, a
418 statistical profiler, a code coverage tool, and many other extensions.")
419 ;; Public domain in jurisdictions that allow it, bsd-2 otherwise. MIT
420 ;; loop macro has its own license. See COPYING file for further notes.
421 (license (list license:public-domain license:bsd-2
422 (license:x11-style "file://src/code/loop.lisp")))))
429 (build-system gnu-build-system)
430 ;; CCL consists of a "lisp kernel" and "heap image", both of which are
431 ;; shipped in precompiled form in source tarballs. The former is a C
432 ;; program which we can rebuild from scratch, but the latter cannot be
433 ;; generated without an already working copy of CCL, and is platform
434 ;; dependent, so we need to fetch the correct tarball for the platform.
440 "https://github.com/Clozure/ccl/releases/download/v" version
442 (match (%current-system)
443 ((or "i686-linux" "x86_64-linux") "linuxx86")
444 ("armhf-linux" "linuxarm")
445 ;; Prevent errors when querying this package on unsupported
446 ;; platforms, e.g. when running "guix package --search="
451 (match (%current-system)
452 ((or "i686-linux" "x86_64-linux")
453 "0hs1f3z7crgzvinpj990kv9gvbsipxvcvwbmk54n51nasvc5025q")
455 "0p0l1dzsygb6i1xxgbipjpxkn46xhq3jm41a34ga1qqp4x8lkr62")
459 ("subversion" ,subversion)))
461 `(#:tests? #f ;no 'check' target
462 #:modules ((srfi srfi-26)
464 (guix build gnu-build-system))
466 (modify-phases %standard-phases
468 (lambda* (#:key inputs #:allow-other-keys)
469 (and (zero? (system* "tar" "xzvf" (assoc-ref inputs "ccl")))
470 (begin (chdir "ccl") #t))))
472 (add-before 'build 'pre-build
473 ;; Enter the source directory for the current platform's lisp
474 ;; kernel, and run 'make clean' to remove the precompiled one.
476 (substitute* "lisp-kernel/m4macros.m4"
477 (("/bin/pwd") (which "pwd")))
478 (chdir (string-append
480 ,(match (or (%current-target-system) (%current-system))
481 ("i686-linux" "linuxx8632")
482 ("x86_64-linux" "linuxx8664")
483 ("armhf-linux" "linuxarm")
484 ;; Prevent errors when querying this package
485 ;; on unsupported platforms, e.g. when running
486 ;; "guix package --search="
488 (substitute* '("Makefile")
491 (zero? (system* "make" "clean"))))
492 ;; XXX Do we need to recompile the heap image as well for Guix?
493 ;; For now just use the one we already got in the tarball.
495 (lambda* (#:key outputs inputs #:allow-other-keys)
496 ;; The lisp kernel built by running 'make' in lisp-kernel/$system
497 ;; is put back into the original directory, so go back. The heap
498 ;; image is there as well.
500 (let* ((out (assoc-ref outputs "out"))
501 (libdir (string-append out "/lib/"))
502 (bindir (string-append out "/bin/"))
503 (wrapper (string-append bindir "ccl"))
504 (bash (assoc-ref inputs "bash"))
506 ,(match (or (%current-target-system) (%current-system))
507 ("i686-linux" "lx86cl")
508 ("x86_64-linux" "lx86cl64")
509 ("armhf-linux" "armcl")
510 ;; Prevent errors when querying this package
511 ;; on unsupported platforms, e.g. when running
512 ;; "guix package --search="
514 (heap (string-append kernel ".image")))
515 (install-file kernel libdir)
516 (install-file heap libdir)
518 (let ((dirs '("lib" "library" "examples" "contrib"
519 "tools" "objc-bridge")))
520 (for-each copy-recursively
522 (map (cut string-append libdir <>) dirs)))
525 (with-output-to-file wrapper
529 "#!" bash "/bin/sh\n"
530 "CCL_DEFAULT_DIRECTORY=" libdir "\n"
531 "export CCL_DEFAULT_DIRECTORY\n"
532 "exec " libdir kernel "\n"))))
533 (chmod wrapper #o755))
535 (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))
536 (home-page "http://ccl.clozure.com/")
537 (synopsis "Common Lisp implementation")
538 (description "Clozure CL (often called CCL for short) is a Common Lisp
539 implementation featuring fast compilation speed, native threads, a precise,
540 generational, compacting garbage collector, and a convenient foreign-function
542 ;; See file doc/LICENSE for clarifications it makes regarding how the LGPL
543 ;; applies to Lisp code according to them.
544 (license (list license:lgpl2.1
545 license:clarified-artistic)))) ;TRIVIAL-LDAP package
547 (define-public femtolisp
548 (let ((commit "68c5b1225572ecf2c52baf62f928063e5a30511b")
552 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
556 (url "https://github.com/JeffBezanson/femtolisp.git")
558 (file-name (string-append name "-" version "-checkout"))
561 "04rnwllxnl86zw8c6pwxznn49bvkvh0f1lfliy085vjzvlq3rgja"))))
562 ;; See "utils.h" for supported systems. Upstream bug:
563 ;; https://github.com/JeffBezanson/femtolisp/issues/25
565 (fold delete %supported-systems
566 '("armhf-linux" "mips64el-linux" "aarch64-linux")))
567 (build-system gnu-build-system)
569 `(#:make-flags '("CC=gcc" "release")
572 (modify-phases %standard-phases
573 (delete 'configure) ; No configure script
574 (replace 'install ; Makefile has no 'install phase
575 (lambda* (#:key outputs #:allow-other-keys)
576 (let* ((out (assoc-ref outputs "out"))
577 (bin (string-append out "/bin")))
578 (install-file "flisp" bin)
580 ;; The flisp binary is now available, run bootstrap to
581 ;; generate flisp.boot and afterwards runs make test.
582 (add-after 'install 'bootstrap-gen-and-test
583 (lambda* (#:key outputs #:allow-other-keys)
584 (let* ((out (assoc-ref outputs "out"))
585 (bin (string-append out "/bin")))
587 (zero? (system* "./bootstrap.sh"))
588 (install-file "flisp.boot" bin))))))))
589 (synopsis "Scheme-like lisp implementation")
591 "@code{femtolisp} is a scheme-like lisp implementation with a
592 simple, elegant Scheme dialect. It is a lisp-1 with lexical scope.
593 The core is 12 builtin special forms and 33 builtin functions.")
594 (home-page "https://github.com/JeffBezanson/femtolisp")
595 (license license:bsd-3))))
604 (uri (string-append "mirror://sourceforge/lush/lush2/lush-"
606 (modules '((guix build utils)))
609 (substitute* "src/unix.c"
610 (("\\{ \"LUSH_DATE\", __DATE__ \\},") "")
611 (("\\{ \"LUSH_TIME\", __TIME__ \\},") ""))
612 (substitute* "src/main.c"
613 (("\" \\(built \" __DATE__ \"\\)\"") ""))))
616 "02pkfn3nqdkm9fm44911dbcz0v3r0l53vygj8xigl6id5g3iwi4k"))))
617 (build-system gnu-build-system)
619 `(;; We have to add these LIBS so that they are found.
620 #:configure-flags (list "LIBS=-lz"
621 "X_EXTRA_LIBS=-lfontconfig"
623 #:tests? #f)) ; No make check.
624 (native-inputs `(("intltool" ,intltool)))
626 `(("alsa-lib" ,alsa-lib)
628 ("sdl-image" ,sdl-image)
629 ("sdl-mixer" ,sdl-mixer)
634 ("fontconfig" ,fontconfig)
636 ("openblas" ,openblas)
639 ("mesa-utils" ,mesa-utils)
640 ("binutils" ,binutils)
641 ("libiberty" ,libiberty)
642 ("readline" ,readline)
644 ("gettext-minimal" ,gettext-minimal)))
645 (synopsis "Lisp Universal Shell")
647 "Lush is an object-oriented Lisp interpreter/compiler with features
648 designed to please people who want to prototype large numerical
649 applications. Lush includes an extensive library of
650 vector/matrix/tensor manipulation, numerous numerical libraries
651 (including GSL, LAPACK, and BLAS), a set of graphic functions, a
652 simple GUI toolkit, and interfaces to various graphic and multimedia
653 libraries such as OpenGL, SDL, Video4Linux, and ALSA (video/audio
654 grabbing), and others. Lush is an ideal frontend script language for
655 programming projects written in C or other languages. Lush also has
656 libraries for Machine Learning, Neural Nets and statistical estimation.")
657 (home-page "http://lush.sourceforge.net/")
658 (license license:lgpl2.1+)))
660 (define-public sbcl-alexandria
662 (commit "926a066611b7b11cb71e26c827a271e500888c30"))
664 (name "sbcl-alexandria")
665 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
670 (url "https://gitlab.common-lisp.net/alexandria/alexandria.git")
674 "18yncicdkh294j05rhgm23gzi36y9qy6vrfba8vg69jrxjp1hx8l"))
675 (file-name (string-append "alexandria-" version "-checkout"))))
676 (build-system asdf-build-system/sbcl)
677 (synopsis "Collection of portable utilities for Common Lisp")
679 "Alexandria is a collection of portable utilities. It does not contain
680 conceptual extensions to Common Lisp. It is conservative in scope, and
681 portable between implementations.")
682 (home-page "https://common-lisp.net/project/alexandria/")
683 (license license:public-domain))))
685 (define-public cl-alexandria
686 (sbcl-package->cl-source-package sbcl-alexandria))
688 (define-public ecl-alexandria
689 (sbcl-package->ecl-package sbcl-alexandria))
691 (define-public sbcl-fiveam
699 "https://github.com/sionescu/fiveam/archive/v"
702 (base32 "0f48pcbhqs3wwwzjl5nk57d4hcbib4l9xblxc66b8c2fhvhmhxnv"))
703 (file-name (string-append "fiveam-" version ".tar.gz"))))
704 (inputs `(("alexandria" ,sbcl-alexandria)))
705 (build-system asdf-build-system/sbcl)
706 (synopsis "Common Lisp testing framework")
707 (description "FiveAM is a simple (as far as writing and running tests
708 goes) regression testing framework. It has been designed with Common Lisp's
709 interactive development model in mind.")
710 (home-page "https://common-lisp.net/project/fiveam/")
711 (license license:bsd-3)))
713 (define-public cl-fiveam
714 (sbcl-package->cl-source-package sbcl-fiveam))
716 (define-public ecl-fiveam
717 (sbcl-package->ecl-package sbcl-fiveam))
719 (define-public sbcl-bordeaux-threads
720 (let ((commit "354abb0ae9f1d9324001e1a8abab3128d7420e0e")
723 (name "sbcl-bordeaux-threads")
724 (version (git-version "0.8.5" revision commit))
728 (url "https://github.com/sionescu/bordeaux-threads.git")
731 (base32 "1hcfp21l6av1xj6z7r77sp6h4mwf9vvx4s745803sysq2qy2mwnq"))
733 (git-file-name "bordeaux-threads" version))))
734 (inputs `(("alexandria" ,sbcl-alexandria)))
735 (native-inputs `(("fiveam" ,sbcl-fiveam)))
736 (build-system asdf-build-system/sbcl)
737 (synopsis "Portable shared-state concurrency library for Common Lisp")
738 (description "BORDEAUX-THREADS is a proposed standard for a minimal
739 MP/Threading interface. It is similar to the CLIM-SYS threading and lock
741 (home-page "https://common-lisp.net/project/bordeaux-threads/")
742 (license license:x11))))
744 (define-public cl-bordeaux-threads
745 (sbcl-package->cl-source-package sbcl-bordeaux-threads))
747 (define-public ecl-bordeaux-threads
748 (sbcl-package->ecl-package sbcl-bordeaux-threads))
750 (define-public sbcl-trivial-gray-streams
752 (commit "0483ade330508b4b2edeabdb47d16ec9437ee1cb"))
754 (name "sbcl-trivial-gray-streams")
755 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
761 (url "https://github.com/trivial-gray-streams/trivial-gray-streams.git")
764 (base32 "0m3rpf2x0zmdk3nf1qfa01j6a55vj7gkwhyw78qslcgbjlgh8p4d"))
766 (string-append "trivial-gray-streams-" version "-checkout"))))
767 (build-system asdf-build-system/sbcl)
768 (synopsis "Compatibility layer for Gray streams implementations")
769 (description "Gray streams is an interface proposed for inclusion with
770 ANSI CL by David N. Gray. The proposal did not make it into ANSI CL, but most
771 popular CL implementations implement it. This package provides an extremely
772 thin compatibility layer for gray streams.")
773 (home-page "http://www.cliki.net/trivial-gray-streams")
774 (license license:x11))))
776 (define-public cl-trivial-gray-streams
777 (sbcl-package->cl-source-package sbcl-trivial-gray-streams))
779 (define-public ecl-trivial-gray-streams
780 (sbcl-package->ecl-package sbcl-trivial-gray-streams))
782 (define-public sbcl-flexi-streams
784 (name "sbcl-flexi-streams")
790 "https://github.com/edicl/flexi-streams/archive/v"
793 (base32 "1fb0jrwxr5c3i2lhy7kn30m1n0vggfzwjm1dacx6y5wf9wfsbamw"))
794 (file-name (string-append "flexi-streams-" version ".tar.gz"))))
795 (build-system asdf-build-system/sbcl)
796 (inputs `(("trivial-gray-streams" ,sbcl-trivial-gray-streams)))
797 (synopsis "Implementation of virtual bivalent streams for Common Lisp")
798 (description "Flexi-streams is an implementation of \"virtual\" bivalent
799 streams that can be layered atop real binary or bivalent streams and that can
800 be used to read and write character data in various single- or multi-octet
801 encodings which can be changed on the fly. It also supplies in-memory binary
802 streams which are similar to string streams.")
803 (home-page "http://weitz.de/flexi-streams/")
804 (license license:bsd-3)))
806 (define-public cl-flexi-streams
807 (sbcl-package->cl-source-package sbcl-flexi-streams))
809 (define-public ecl-flexi-streams
810 (sbcl-package->ecl-package sbcl-flexi-streams))
812 (define-public sbcl-cl-ppcre
814 (name "sbcl-cl-ppcre")
820 "https://github.com/edicl/cl-ppcre/archive/v"
823 (base32 "1i7daxf0wnydb0pgwiym7qh2wy70n14lxd6dyv28sy0naa8p31gd"))
824 (file-name (string-append "cl-ppcre-" version ".tar.gz"))))
825 (build-system asdf-build-system/sbcl)
826 (native-inputs `(("flexi-streams" ,sbcl-flexi-streams)))
827 (synopsis "Portable regular expression library for Common Lisp")
828 (description "CL-PPCRE is a portable regular expression library for Common
829 Lisp, which is compatible with perl. It is pretty fast, thread-safe, and
830 compatible with ANSI-compliant Common Lisp implementations.")
831 (home-page "http://weitz.de/cl-ppcre/")
832 (license license:bsd-2)))
834 (define-public cl-ppcre
835 (sbcl-package->cl-source-package sbcl-cl-ppcre))
837 (define-public ecl-cl-ppcre
838 (sbcl-package->ecl-package sbcl-cl-ppcre))
840 (define sbcl-cl-unicode-base
842 (commit "9fcd06fba1ddc9e66aed2f2d6c32dc9b764f03ea"))
844 (name "sbcl-cl-unicode-base")
845 (version (string-append "0.1.5-" revision "." (string-take commit 7)))
849 (url "https://github.com/edicl/cl-unicode.git")
851 (file-name (string-append "cl-unicode-" version "-checkout"))
854 "1jicprb5b3bv57dy1kg03572gxkcaqdjhak00426s76g0plmx5ki"))))
855 (build-system asdf-build-system/sbcl)
857 '(#:asd-file "cl-unicode.asd"
858 #:asd-system-name "cl-unicode/base"))
860 `(("cl-ppcre" ,sbcl-cl-ppcre)))
861 (home-page "http://weitz.de/cl-unicode/")
862 (synopsis "Portable Unicode library for Common Lisp")
863 (description "CL-UNICODE is a portable Unicode library Common Lisp, which
864 is compatible with perl. It is pretty fast, thread-safe, and compatible with
865 ANSI-compliant Common Lisp implementations.")
866 (license license:bsd-2))))
868 (define-public sbcl-cl-unicode
870 (inherit sbcl-cl-unicode-base)
871 (name "sbcl-cl-unicode")
873 `(("cl-unicode/base" ,sbcl-cl-unicode-base)
874 ,@(package-inputs sbcl-cl-unicode-base)))
876 `(("flexi-streams" ,sbcl-flexi-streams)))
879 (define-public ecl-cl-unicode
880 (sbcl-package->ecl-package sbcl-cl-unicode))
882 (define-public cl-unicode
883 (sbcl-package->cl-source-package sbcl-cl-unicode))
885 (define-public sbcl-clx
887 (commit "1c62774b03c1cf3fe6e5cb532df8b14b44c96b95"))
890 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
896 (url "https://github.com/sharplispers/clx.git")
899 (base32 "0qffag03ns52kwq9xjns2qg1yr0bf3ba507iwq5cmx5xz0b0rmjm"))
900 (file-name (string-append "clx-" version "-checkout"))
903 (search-patch "clx-remove-demo.patch")))
904 (modules '((guix build utils)))
907 ;; These removed files cause the compiled system to crash when
909 (delete-file-recursively "demo")
910 (delete-file "test/trapezoid.lisp")
911 (substitute* "clx.asd"
912 (("\\(:file \"trapezoid\"\\)") ""))))))
913 (build-system asdf-build-system/sbcl)
914 (home-page "http://www.cliki.net/portable-clx")
915 (synopsis "X11 client library for Common Lisp")
916 (description "CLX is an X11 client library for Common Lisp. The code was
917 originally taken from a CMUCL distribution, was modified somewhat in order to
918 make it compile and run under SBCL, then a selection of patches were added
919 from other CLXes around the net.")
920 (license license:x11))))
922 (define-public cl-clx
923 (sbcl-package->cl-source-package sbcl-clx))
925 (define-public ecl-clx
926 (sbcl-package->ecl-package sbcl-clx))
928 (define-public sbcl-cl-ppcre-unicode
929 (package (inherit sbcl-cl-ppcre)
930 (name "sbcl-cl-ppcre-unicode")
932 `(#:tests? #f ; tests fail with "Component :CL-PPCRE-TEST not found"
933 #:asd-file "cl-ppcre-unicode.asd"))
935 `(("sbcl-cl-ppcre" ,sbcl-cl-ppcre)
936 ("sbcl-cl-unicode" ,sbcl-cl-unicode)))))
938 (define-public sbcl-stumpwm
940 (name "sbcl-stumpwm")
945 "https://github.com/stumpwm/stumpwm/archive/"
948 (base32 "1maxp98gh64az3d9vz9br6zdd6rc9fmj2imvax4by85g6kxvdz1i"))
949 (file-name (string-append "stumpwm-" version ".tar.gz"))))
950 (build-system asdf-build-system/sbcl)
951 (inputs `(("cl-ppcre" ,sbcl-cl-ppcre)
953 (outputs '("out" "lib"))
956 (modify-phases %standard-phases
957 (add-after 'create-symlinks 'build-program
958 (lambda* (#:key outputs #:allow-other-keys)
960 (string-append (assoc-ref outputs "out") "/bin/stumpwm")
962 #:entry-program '((stumpwm:stumpwm) 0))))
963 (add-after 'build-program 'create-desktop-file
964 (lambda* (#:key outputs #:allow-other-keys)
965 (let* ((out (assoc-ref outputs "out"))
966 (xsessions (string-append out "/share/xsessions")))
968 (call-with-output-file
969 (string-append xsessions "/stumpwm.desktop")
974 Comment=The Stump Window Manager~@
975 Exec=~a/bin/stumpwm~@
976 TryExec=~@*~a/bin/stumpwm~@
981 (synopsis "Window manager written in Common Lisp")
982 (description "Stumpwm is a window manager written entirely in Common Lisp.
983 It attempts to be highly customizable while relying entirely on the keyboard
984 for input. These design decisions reflect the growing popularity of
985 productive, customizable lisp based systems.")
986 (home-page "https://github.com/stumpwm/stumpwm")
987 (license license:gpl2+)
988 (properties `((ecl-variant . ,(delay ecl-stumpwm))))))
990 (define-public cl-stumpwm
991 (sbcl-package->cl-source-package sbcl-stumpwm))
993 (define-public ecl-stumpwm
994 (let ((base (sbcl-package->ecl-package sbcl-stumpwm)))
1000 ;; The slynk that users expect to install includes all of slynk's contrib
1001 ;; modules. Therefore, we build the base module and all contribs first; then
1002 ;; we expose the union of these as `sbcl-slynk'. The following variable
1003 ;; describes the base module.
1004 (define sbcl-slynk-boot0
1005 (let ((revision "1")
1006 (commit "5706cd45d484a4f25795abe8e643509d31968aa2"))
1008 (name "sbcl-slynk-boot0")
1009 (version (string-append "1.0.0-beta-" revision "." (string-take commit 7)))
1015 (url "https://github.com/joaotavora/sly.git")
1018 (base32 "0h4gg3sndl2bf6jdnx9nrf14p9hhi43hagrl0f4v4l11hczl8w81"))
1019 (file-name (string-append "slynk-" version "-checkout"))
1020 (modules '((guix build utils)
1024 ;; Move the contribs into the main source directory for easier
1026 (substitute* "slynk/slynk.asd"
1029 (("\\(defsystem :slynk-util")
1030 "(defsystem :slynk-util :depends-on (:slynk)"))
1031 (substitute* "contrib/slynk-trace-dialog.lisp"
1032 (("\\(slynk::reset-inspector\\)") ; Causes problems on load
1034 (substitute* "contrib/slynk-profiler.lisp"
1036 "slynk-pprint-to-line"))
1037 (rename-file "contrib" "slynk/contrib")
1038 ;; Move slynk's contents into the base directory for easier
1042 (unless (string-prefix? "." file)
1043 (rename-file (string-append "slynk/" file)
1044 (string-append "./" (basename file)))))
1045 (scandir "slynk"))))))
1046 (build-system asdf-build-system/sbcl)
1048 `(#:tests? #f ; No test suite
1049 #:asd-system-name "slynk"))
1050 (synopsis "Common Lisp IDE for Emacs")
1051 (description "SLY is a fork of SLIME, an IDE backend for Common Lisp.
1052 It also features a completely redesigned REPL based on Emacs's own
1053 full-featured comint.el, live code annotations, and a consistent interactive
1054 button interface. Everything can be copied to the REPL. One can create
1055 multiple inspectors with independent history.")
1056 (home-page "https://github.com/joaotavora/sly")
1057 (license license:public-domain)
1058 (properties `((cl-source-variant . ,(delay cl-slynk)))))))
1060 (define-public cl-slynk
1062 (inherit (sbcl-package->cl-source-package sbcl-slynk-boot0))
1065 (define ecl-slynk-boot0
1066 (sbcl-package->ecl-package sbcl-slynk-boot0))
1068 (define sbcl-slynk-arglists
1070 (inherit sbcl-slynk-boot0)
1071 (name "sbcl-slynk-arglists")
1072 (inputs `(("slynk" ,sbcl-slynk-boot0)))
1074 (substitute-keyword-arguments (package-arguments sbcl-slynk-boot0)
1075 ((#:asd-file _ "") "slynk.asd")
1076 ((#:asd-system-name _ #f) #f)))))
1078 (define ecl-slynk-arglists
1079 (sbcl-package->ecl-package sbcl-slynk-arglists))
1081 (define sbcl-slynk-util
1083 (inherit sbcl-slynk-arglists)
1084 (name "sbcl-slynk-util")))
1086 (define ecl-slynk-util
1087 (sbcl-package->ecl-package sbcl-slynk-util))
1089 (define sbcl-slynk-fancy-inspector
1091 (inherit sbcl-slynk-arglists)
1092 (name "sbcl-slynk-fancy-inspector")
1093 (inputs `(("slynk-util" ,sbcl-slynk-util)
1094 ,@(package-inputs sbcl-slynk-arglists)))))
1096 (define ecl-slynk-fancy-inspector
1097 (sbcl-package->ecl-package sbcl-slynk-fancy-inspector))
1099 (define sbcl-slynk-package-fu
1101 (inherit sbcl-slynk-arglists)
1102 (name "sbcl-slynk-package-fu")))
1104 (define ecl-slynk-package-fu
1105 (sbcl-package->ecl-package sbcl-slynk-package-fu))
1107 (define sbcl-slynk-mrepl
1109 (inherit sbcl-slynk-arglists)
1110 (name "sbcl-slynk-mrepl")))
1112 (define ecl-slynk-mrepl
1113 (sbcl-package->ecl-package sbcl-slynk-mrepl))
1115 (define sbcl-slynk-trace-dialog
1117 (inherit sbcl-slynk-arglists)
1118 (name "sbcl-slynk-trace-dialog")))
1120 (define ecl-slynk-trace-dialog
1121 (sbcl-package->ecl-package sbcl-slynk-trace-dialog))
1123 (define sbcl-slynk-profiler
1125 (inherit sbcl-slynk-arglists)
1126 (name "sbcl-slynk-profiler")))
1128 (define ecl-slynk-profiler
1129 (sbcl-package->ecl-package sbcl-slynk-profiler))
1131 (define sbcl-slynk-stickers
1133 (inherit sbcl-slynk-arglists)
1134 (name "sbcl-slynk-stickers")))
1136 (define ecl-slynk-stickers
1137 (sbcl-package->ecl-package sbcl-slynk-stickers))
1139 (define sbcl-slynk-indentation
1141 (inherit sbcl-slynk-arglists)
1142 (name "sbcl-slynk-indentation")))
1144 (define ecl-slynk-indentation
1145 (sbcl-package->ecl-package sbcl-slynk-indentation))
1147 (define sbcl-slynk-retro
1149 (inherit sbcl-slynk-arglists)
1150 (name "sbcl-slynk-retro")))
1152 (define ecl-slynk-retro
1153 (sbcl-package->ecl-package sbcl-slynk-retro))
1155 (define slynk-systems
1159 "slynk-fancy-inspector"
1163 "slynk-trace-dialog"
1168 (define-public sbcl-slynk
1170 (inherit sbcl-slynk-boot0)
1173 `(("slynk" ,sbcl-slynk-boot0)
1174 ("slynk-util" ,sbcl-slynk-util)
1175 ("slynk-arglists" ,sbcl-slynk-arglists)
1176 ("slynk-fancy-inspector" ,sbcl-slynk-fancy-inspector)
1177 ("slynk-package-fu" ,sbcl-slynk-package-fu)
1178 ("slynk-mrepl" ,sbcl-slynk-mrepl)
1179 ("slynk-profiler" ,sbcl-slynk-profiler)
1180 ("slynk-trace-dialog" ,sbcl-slynk-trace-dialog)
1181 ("slynk-stickers" ,sbcl-slynk-stickers)
1182 ("slynk-indentation" ,sbcl-slynk-indentation)
1183 ("slynk-retro" ,sbcl-slynk-retro)))
1184 (native-inputs `(("sbcl" ,sbcl)))
1185 (build-system trivial-build-system)
1187 (outputs '("out" "image"))
1189 `(#:modules ((guix build union)
1191 (guix build lisp-utils))
1194 (use-modules (ice-9 match)
1197 (guix build lisp-utils))
1200 (assoc-ref %outputs "out")
1204 (if (string-prefix? "slynk" name) path #f)))
1207 (prepend-to-source-registry
1208 (string-append (assoc-ref %outputs "out") "//"))
1210 (parameterize ((%lisp-type "sbcl")
1211 (%lisp (string-append (assoc-ref %build-inputs "sbcl")
1213 (build-image (string-append
1214 (assoc-ref %outputs "image")
1217 #:dependencies ',slynk-systems)))))))
1219 (define-public ecl-slynk
1221 (inherit sbcl-slynk)
1226 (list name (sbcl-package->ecl-package pkg))))
1227 (package-inputs sbcl-slynk)))
1231 '(#:modules ((guix build union))
1234 (use-modules (ice-9 match)
1236 (match %build-inputs
1237 (((names . paths) ...)
1238 (union-build (assoc-ref %outputs "out")
1241 (define-public sbcl-stumpwm+slynk
1243 (inherit sbcl-stumpwm)
1244 (name "sbcl-stumpwm-with-slynk")
1247 `(("stumpwm" ,sbcl-stumpwm "lib")
1248 ("slynk" ,sbcl-slynk)))
1250 (substitute-keyword-arguments (package-arguments sbcl-stumpwm)
1252 `(modify-phases ,phases
1253 (replace 'build-program
1254 (lambda* (#:key inputs outputs #:allow-other-keys)
1255 (let* ((out (assoc-ref outputs "out"))
1256 (program (string-append out "/bin/stumpwm")))
1257 (build-program program outputs
1258 #:entry-program '((stumpwm:stumpwm) 0)
1259 #:dependencies '("stumpwm"
1261 #:dependency-prefixes
1262 (map (lambda (input) (assoc-ref inputs input))
1263 '("stumpwm" "slynk")))
1264 ;; Remove unneeded file.
1265 (delete-file (string-append out "/bin/stumpwm-exec.fasl"))
1267 (delete 'copy-source)
1270 (delete 'create-asd-file)
1272 (delete 'create-symlinks)))))))
1274 (define-public sbcl-parse-js
1275 (let ((commit "fbadc6029bec7039602abfc06c73bb52970998f6")
1278 (name "sbcl-parse-js")
1279 (version (string-append "0.0.0-" revision "." (string-take commit 9)))
1284 (url "http://marijn.haverbeke.nl/git/parse-js")
1286 (file-name (string-append name "-" commit "-checkout"))
1289 "1wddrnr5kiya5s3gp4cdq6crbfy9fqcz7fr44p81502sj3bvdv39"))))
1290 (build-system asdf-build-system/sbcl)
1291 (home-page "http://marijnhaverbeke.nl/parse-js/")
1292 (synopsis "Parse JavaScript")
1293 (description "Parse-js is a Common Lisp package for parsing
1294 JavaScript (ECMAScript 3). It has basic support for ECMAScript 5.")
1295 (license license:zlib))))
1297 (define-public sbcl-parse-number
1299 (name "sbcl-parse-number")
1304 (uri (string-append "https://github.com/sharplispers/parse-number/"
1305 "archive/v" version ".tar.gz"))
1306 (file-name (string-append name "-" version ".tar.gz"))
1309 "1k6s4v65ksc1j5i0dprvzfvj213v6nah7i0rgd0726ngfjisj9ir"))))
1310 (build-system asdf-build-system/sbcl)
1311 (home-page "http://www.cliki.net/PARSE-NUMBER")
1312 (synopsis "Parse numbers")
1313 (description "@code{parse-number} is a library of functions for parsing
1314 strings into one of the standard Common Lisp number types without using the
1315 reader. @code{parse-number} accepts an arbitrary string and attempts to parse
1316 the string into one of the standard Common Lisp number types, if possible, or
1317 else @code{parse-number} signals an error of type @code{invalid-number}.")
1318 (license license:bsd-3)))
1320 (define-public sbcl-iterate
1322 (name "sbcl-iterate")
1323 ;; The latest official release (1.4.3) fails to build so we have to take
1324 ;; the current darcs tarball from quicklisp.
1325 (version "20160825")
1329 (uri (string-append "http://beta.quicklisp.org/archive/iterate/"
1330 "2016-08-25/iterate-"
1331 version "-darcs.tgz"))
1334 "0kvz16gnxnkdz0fy1x8y5yr28nfm7i2qpvix7mgwccdpjmsb4pgm"))))
1335 (build-system asdf-build-system/sbcl)
1336 (home-page "https://common-lisp.net/project/iterate/")
1337 (synopsis "Iteration construct for Common Lisp")
1338 (description "@code{iterate} is an iteration construct for Common Lisp.
1339 It is similar to the @code{CL:LOOP} macro, with these distinguishing marks:
1342 @item it is extensible,
1343 @item it helps editors like Emacs indent iterate forms by having a more
1344 lisp-like syntax, and
1345 @item it isn't part of the ANSI standard for Common Lisp.
1347 (license license:expat)))
1349 (define-public sbcl-cl-uglify-js
1350 ;; There have been many bug fixes since the 2010 release.
1351 (let ((commit "429c5e1d844e2f96b44db8fccc92d6e8e28afdd5")
1354 (name "sbcl-cl-uglify-js")
1355 (version (string-append "0.1-" revision "." (string-take commit 9)))
1360 (url "https://github.com/mishoo/cl-uglify-js.git")
1362 (file-name (git-file-name name version))
1365 "0k39y3c93jgxpr7gwz7w0d8yknn1fdnxrjhd03057lvk5w8js27a"))))
1366 (build-system asdf-build-system/sbcl)
1368 `(("sbcl-parse-js" ,sbcl-parse-js)
1369 ("sbcl-cl-ppcre" ,sbcl-cl-ppcre)
1370 ("sbcl-cl-ppcre-unicode" ,sbcl-cl-ppcre-unicode)
1371 ("sbcl-parse-number" ,sbcl-parse-number)
1372 ("sbcl-iterate" ,sbcl-iterate)))
1373 (home-page "https://github.com/mishoo/cl-uglify-js")
1374 (synopsis "JavaScript compressor library for Common Lisp")
1375 (description "This is a Common Lisp version of UglifyJS, a JavaScript
1376 compressor. It works on data produced by @code{parse-js} to generate a
1377 @dfn{minified} version of the code. Currently it can:
1380 @item reduce variable names (usually to single letters)
1381 @item join consecutive @code{var} statements
1382 @item resolve simple binary expressions
1383 @item group most consecutive statements using the ``sequence'' operator (comma)
1384 @item remove unnecessary blocks
1385 @item convert @code{IF} expressions in various ways that result in smaller code
1386 @item remove some unreachable code
1388 (license license:zlib))))
1390 (define-public uglify-js
1392 (inherit sbcl-cl-uglify-js)
1394 (build-system trivial-build-system)
1396 `(#:modules ((guix build utils))
1398 (let* ((bin (string-append (assoc-ref %outputs "out") "/bin/"))
1399 (script (string-append bin "uglify-js")))
1400 (use-modules (guix build utils))
1402 (with-output-to-file script
1404 (format #t "#!~a/bin/sbcl --script
1406 (push (truename \"~a/lib/sbcl\") asdf:*central-registry*)"
1407 (assoc-ref %build-inputs "sbcl")
1408 (assoc-ref %build-inputs "sbcl-cl-uglify-js"))
1409 ;; FIXME: cannot use progn here because otherwise it fails to
1410 ;; find cl-uglify-js.
1414 (let ((*standard-output* (make-broadcast-stream))
1415 (*error-output* (make-broadcast-stream)))
1416 (asdf:load-system :cl-uglify-js))
1417 (let ((file (cadr *posix-argv*)))
1420 (cl-uglify-js:ast-gen-code
1421 (cl-uglify-js:ast-mangle
1422 (cl-uglify-js:ast-squeeze
1423 (with-open-file (in file)
1424 (parse-js:parse-js in))))
1427 (format *error-output*
1428 "Please provide a JavaScript file.~%")
1429 (sb-ext:exit :code 1))))))))
1430 (chmod script #o755)
1434 ("sbcl-cl-uglify-js" ,sbcl-cl-uglify-js)))
1435 (synopsis "JavaScript compressor")))