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>
11 ;;; This file is part of GNU Guix.
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26 (define-module (gnu packages lisp)
27 #:use-module (gnu packages)
28 #:use-module ((guix licenses) #:prefix license:)
29 #:use-module (guix packages)
30 #:use-module (gnu packages readline)
31 #:use-module (gnu packages texinfo)
32 #:use-module (gnu packages tex)
33 #:use-module (gnu packages m4)
34 #:use-module (guix download)
35 #:use-module (guix git-download)
36 #:use-module (guix hg-download)
37 #:use-module (guix utils)
38 #:use-module (guix build-system gnu)
39 #:use-module (guix build-system asdf)
40 #:use-module (guix build-system trivial)
41 #:use-module (gnu packages base)
42 #:use-module (gnu packages compression)
43 #:use-module (gnu packages fontutils)
44 #:use-module (gnu packages maths)
45 #:use-module (gnu packages multiprecision)
46 #:use-module (gnu packages ncurses)
47 #:use-module (gnu packages bdw-gc)
48 #:use-module (gnu packages libffi)
49 #:use-module (gnu packages libffcall)
50 #:use-module (gnu packages readline)
51 #:use-module (gnu packages sdl)
52 #:use-module (gnu packages libsigsegv)
53 #:use-module (gnu packages linux)
54 #:use-module (gnu packages admin)
55 #:use-module (gnu packages ed)
56 #:use-module (gnu packages gl)
57 #:use-module (gnu packages gcc)
58 #:use-module (gnu packages glib)
59 #:use-module (gnu packages gettext)
60 #:use-module (gnu packages m4)
61 #:use-module (gnu packages pkg-config)
62 #:use-module (gnu packages version-control)
63 #:use-module (gnu packages xorg)
64 #:use-module (ice-9 match)
65 #:use-module (srfi srfi-1))
67 (define (asdf-substitutions lisp)
68 ;; Prepend XDG_DATA_DIRS/LISP-bundle-systems to ASDF's
69 ;; 'default-system-source-registry'.
70 `((("\\(,dir \"systems/\"\\)\\)")
72 "(,dir \"~a-bundle-systems\")))
74 ,@(loop :for dir :in (xdg-data-dirs \"common-lisp/\")
75 :collect `(:directory (,dir \"systems\"))"
85 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
87 (base32 "1s4hs2qbjqmn9h88l4xvsifq5c3dlc5s74lyb61rdi5grhdlkf4f"))))
88 (build-system gnu-build-system)
90 `(#:parallel-build? #f ; The build system seems not to be thread safe.
91 #:tests? #f ; There does not seem to be make check or anything similar.
92 #:configure-flags '("--enable-ansi") ; required for use by the maxima package
94 "CFLAGS=-fgnu89-inline" ; removes inline function warnings
95 (string-append "GCC=" (assoc-ref %build-inputs "gcc")
97 #:phases (modify-phases %standard-phases
98 (add-before 'configure 'pre-conf
102 '("pcl/impl/kcl/makefile.akcl"
104 "unixport/makefile.dos"
106 "gcl-tk/makefile.prev"
108 (find-files "h" "\\.defs"))
110 (string-append "SHELL=" (which "bash")))
112 (string-append "SHELL=" (which "sh"))))
113 (substitute* "h/linux.defs"
115 (("-fwritable-strings") "")
118 (add-after 'install 'wrap
119 (lambda* (#:key inputs outputs #:allow-other-keys)
120 (let* ((gcl (assoc-ref outputs "out"))
121 (input-path (lambda (lib path)
123 (assoc-ref inputs lib) path)))
124 (binaries '("binutils")))
125 ;; GCC and the GNU binutils are necessary for GCL to be
126 ;; able to compile Lisp functions and programs (this is
127 ;; a standard feature in Common Lisp). While the
128 ;; the location of GCC is specified in the make-flags,
129 ;; the GNU binutils must be available in GCL's $PATH.
130 (wrap-program (string-append gcl "/bin/gcl")
131 `("PATH" prefix ,(map (lambda (binary)
132 (input-path binary "/bin"))
135 ;; drop strip phase to make maxima build, see
136 ;; https://www.ma.utexas.edu/pipermail/maxima/2008/009769.html
140 ("readline" ,readline)))
145 ("texlive" ,texlive)))
146 (home-page "https://www.gnu.org/software/gcl/")
147 (synopsis "A Common Lisp implementation")
148 (description "GCL is an implementation of the Common Lisp language. It
149 features the ability to compile to native object code and to load native
150 object code modules directly into its lisp core. It also features a
151 stratified garbage collection strategy, a source-level debugger and a built-in
152 interface to the Tk widget system.")
153 (license license:lgpl2.0+)))
163 "https://common-lisp.net/project/ecl/static/files/release/"
164 name "-" version ".tgz"))
166 (base32 "0m0j24w5d5a9dwwqyrg0d35c0nys16ijb4r0nyk87yp82v38b9bn"))
167 (modules '((guix build utils)))
169 ;; Add ecl-bundle-systems to 'default-system-source-registry'.
170 `(substitute* "contrib/asdf/asdf.lisp"
171 ,@(asdf-substitutions name)))))
172 (build-system gnu-build-system)
173 ;; src/configure uses 'which' to confirm the existence of 'gzip'.
174 (native-inputs `(("which" ,which)))
175 (inputs `(("gmp" ,gmp)
176 ("libatomic-ops" ,libatomic-ops)
183 (modify-phases %standard-phases
185 (add-after 'install 'wrap
186 (lambda* (#:key inputs outputs #:allow-other-keys)
187 (let* ((ecl (assoc-ref outputs "out"))
188 (input-path (lambda (lib path)
190 (assoc-ref inputs lib) path)))
191 (libraries '("gmp" "libatomic-ops" "libgc" "libffi" "libc"))
192 (binaries '("gcc" "ld-wrapper" "binutils"))
194 (map (lambda (lib) (input-path lib "/lib"))
197 (wrap-program (string-append ecl "/bin/ecl")
199 ,(map (lambda (binary)
200 (input-path binary "/bin"))
204 (input-path lib "/include"))
205 `("kernel-headers" ,@libraries)))
206 `("LIBRARY_PATH" suffix ,library-directories)
207 `("LD_LIBRARY_PATH" suffix ,library-directories)))))
208 (add-after 'wrap 'check (assoc-ref %standard-phases 'check))
209 (add-before 'check 'fix-path-to-ecl
211 (substitute* "build/tests/Makefile"
212 (("\\$\\{exec_prefix\\}/") ""))
215 (list (search-path-specification
216 (variable "XDG_DATA_DIRS")
217 (files '("share")))))
218 (home-page "http://ecls.sourceforge.net/")
219 (synopsis "Embeddable Common Lisp")
220 (description "ECL is an implementation of the Common Lisp language as
221 defined by the ANSI X3J13 specification. Its most relevant features are: a
222 bytecode compiler and interpreter, being able to compile Common Lisp with any
223 C/C++ compiler, being able to build standalone executables and libraries, and
224 supporting ASDF, Sockets, Gray streams, MOP, and other useful components.")
225 ;; Note that the file "Copyright" points to some files and directories
226 ;; which aren't under the lgpl2.0+ and instead contain many different,
227 ;; non-copyleft licenses.
228 (license license:lgpl2.0+)))
238 (url "http://hg.code.sf.net/p/clisp/clisp")
239 (changeset "clisp_2_49_60-2017-06-25")))
240 (file-name (string-append name "-" version "-checkout"))
242 (base32 "0qjv3z274rbdmb941hy03hl63f4z7bmci234f8dyz4skgfr82d3i"))
243 (patches (search-patches "clisp-remove-failing-test.patch"))))
244 (build-system gnu-build-system)
245 (inputs `(("libffcall" ,libffcall)
247 ("readline" ,readline)
248 ("libsigsegv" ,libsigsegv)))
250 '(;; XXX The custom configure script does not cope well when passed
251 ;; --build=<triplet>.
252 #:configure-flags '("CFLAGS=-falign-functions=4"
253 "--enable-portability"
255 "--with-dynamic-modules"
256 "--with-module=bindings/glibc"
257 "--with-module=rawsock")
260 (modify-phases %standard-phases
261 (add-after 'unpack 'patch-sh-and-pwd
263 ;; The package is very messy with its references to "/bin/sh" and
264 ;; some other absolute paths to traditional tools. These appear in
265 ;; many places where our automatic patching misses them. Therefore
266 ;; we do the following, in this early (post-unpack) phase, to solve
267 ;; the problem from its root.
268 (substitute* (find-files "." "configure|Makefile")
270 (substitute* '("src/clisp-link.in")
271 (("/bin/pwd") "pwd"))
273 (add-after 'unpack 'remove-timestamps
275 (substitute* "src/constobj.d"
276 (("__DATE__ __TIME__") "\"1\""))
277 (substitute* "src/genclisph.d"
278 (("__DATE__") "\"1\"")
279 (("__TIME__") "\"1\""))
281 ;; Makefiles seem to have race conditions.
282 #:parallel-build? #f))
283 (home-page "http://www.clisp.org/")
284 (synopsis "A Common Lisp implementation")
286 "GNU CLISP is an implementation of ANSI Common Lisp. Common Lisp is a
287 high-level, object-oriented functional programming language. CLISP includes
288 an interpreter, a compiler, a debugger, and much more.")
289 ;; Website says gpl2+, COPYRIGHT file says gpl2; actual source files have
290 ;; a lot of gpl3+. (Also some parts are under non-copyleft licenses, such
291 ;; as CLX by Texas Instruments.) In that case gpl3+ wins out.
292 (license license:gpl3+)))
301 (uri (string-append "mirror://sourceforge/sbcl/sbcl/" version "/sbcl-"
302 version "-source.tar.bz2"))
304 (base32 "0fjdqnb2rsm2vi9794ywp27jr239ddvzc4xfr0dk49jd4v7p2kc5"))
305 (modules '((guix build utils)))
307 ;; Add sbcl-bundle-systems to 'default-system-source-registry'.
308 `(substitute* "contrib/asdf/asdf.lisp"
309 ,@(asdf-substitutions name)))))
310 (build-system gnu-build-system)
311 (outputs '("out" "doc"))
312 ;; Bootstrap with CLISP.
316 ("inetutils" ,inetutils) ;for hostname(1)
319 ("texinfo" ,texinfo)))
321 '(#:modules ((guix build gnu-build-system)
325 (modify-phases %standard-phases
327 (add-before 'build 'patch-unix-tool-paths
328 (lambda* (#:key outputs inputs #:allow-other-keys)
329 (let ((out (assoc-ref outputs "out"))
330 (bash (assoc-ref inputs "bash"))
331 (coreutils (assoc-ref inputs "coreutils"))
332 (ed (assoc-ref inputs "ed")))
333 (define (quoted-path input path)
334 (string-append "\"" input path "\""))
335 ;; Patch absolute paths in string literals. Note that this
336 ;; occurs in some .sh files too (which contain Lisp code). Use
337 ;; ISO-8859-1 because some of the files are ISO-8859-1 encoded.
338 (with-fluids ((%default-port-encoding #f))
339 ;; The removed file is utf-16-be encoded, which gives substitute*
340 ;; trouble. It does not contain references to the listed programs.
342 "./tests/data/compile-file-pos-utf16be.lisp"
343 (find-files "." "\\.(lisp|sh)$"))
344 (("\"/bin/sh\"") (quoted-path bash "/bin/sh"))
345 (("\"/usr/bin/env\"") (quoted-path coreutils "/usr/bin/env"))
346 (("\"/bin/cat\"") (quoted-path coreutils "/bin/cat"))
347 (("\"/bin/ed\"") (quoted-path ed "/bin/ed"))
348 (("\"/bin/echo\"") (quoted-path coreutils "/bin/echo"))
349 (("\"/bin/uname\"") (quoted-path coreutils "/bin/uname"))))
350 ;; This one script has a non-string occurrence of /bin/sh.
351 (substitute* '("tests/foreign.test.sh")
352 ;; Leave whitespace so we don't match the shebang.
353 ((" /bin/sh ") " sh "))
354 ;; This file contains a module that can create executable files
355 ;; which depend on the presence of SBCL. It generates shell
356 ;; scripts doing "exec sbcl ..." to achieve this. We patch both
357 ;; the shebang and the reference to "sbcl", tying the generated
358 ;; executables to the exact SBCL package that generated them.
359 (substitute* '("contrib/sb-executable/sb-executable.lisp")
360 (("/bin/sh") (string-append bash "/bin/sh"))
361 (("exec sbcl") (string-append "exec " out "/bin/sbcl")))
362 ;; Disable some tests that fail in our build environment.
363 (substitute* '("contrib/sb-bsd-sockets/tests.lisp")
364 ;; This requires /etc/protocols.
365 (("\\(deftest get-protocol-by-name/error" all)
366 (string-append "#+nil ;disabled by Guix\n" all)))
367 (substitute* '("contrib/sb-posix/posix-tests.lisp")
368 ;; These assume some users/groups which we don't have.
369 (("\\(deftest pwent\\.[12]" all)
370 (string-append "#+nil ;disabled by Guix\n" all))
371 (("\\(deftest grent\\.[12]" all)
372 (string-append "#+nil ;disabled by Guix\n" all))))))
374 (lambda* (#:key outputs #:allow-other-keys)
376 (zero? (system* "sh" "make.sh" "clisp"
377 (string-append "--prefix="
378 (assoc-ref outputs "out"))))))
381 (zero? (system* "sh" "install.sh"))))
382 (add-after 'build 'build-doc
384 (with-directory-excursion "doc/manual"
385 (and (zero? (system* "make" "info"))
386 (zero? (system* "make" "dist"))))))
387 (add-after 'install 'install-doc
388 (lambda* (#:key outputs #:allow-other-keys)
389 (let* ((out (assoc-ref outputs "out"))
390 (doc (assoc-ref outputs "doc"))
391 (old-doc-dir (string-append out "/share/doc"))
392 (new-doc/sbcl-dir (string-append doc "/share/doc/sbcl")))
393 (rmdir (string-append old-doc-dir "/sbcl/html"))
394 (mkdir-p new-doc/sbcl-dir)
395 (copy-recursively (string-append old-doc-dir "/sbcl")
397 (delete-file-recursively old-doc-dir)
399 ;; No 'check' target, though "make.sh" (build phase) runs tests.
402 (list (search-path-specification
403 (variable "XDG_DATA_DIRS")
404 (files '("share")))))
405 (home-page "http://www.sbcl.org/")
406 (synopsis "Common Lisp implementation")
407 (description "Steel Bank Common Lisp (SBCL) is a high performance Common
408 Lisp compiler. In addition to the compiler and runtime system for ANSI Common
409 Lisp, it provides an interactive environment including a debugger, a
410 statistical profiler, a code coverage tool, and many other extensions.")
411 ;; Public domain in jurisdictions that allow it, bsd-2 otherwise. MIT
412 ;; loop macro has its own license. See COPYING file for further notes.
413 (license (list license:public-domain license:bsd-2
414 (license:x11-style "file://src/code/loop.lisp")))))
421 (build-system gnu-build-system)
422 ;; CCL consists of a "lisp kernel" and "heap image", both of which are
423 ;; shipped in precompiled form in source tarballs. The former is a C
424 ;; program which we can rebuild from scratch, but the latter cannot be
425 ;; generated without an already working copy of CCL, and is platform
426 ;; dependent, so we need to fetch the correct tarball for the platform.
432 "ftp://ftp.clozure.com/pub/release/" version
434 (match (%current-system)
435 ((or "i686-linux" "x86_64-linux") "linuxx86")
436 ("armhf-linux" "linuxarm")
437 ;; Prevent errors when querying this package on unsupported
438 ;; platforms, e.g. when running "guix package --search="
443 (match (%current-system)
444 ((or "i686-linux" "x86_64-linux")
445 "0w3dmj7q9kqyra3yrf1lxclnjz151yvf5s5q8ayllvmvqbl8bs08")
447 "1x487aaz2rqcb6k301sy2p39a1m4qdhg6z9p9fb76ssipqgr38b4")
451 ("subversion" ,subversion)))
453 `(#:tests? #f ;no 'check' target
454 #:modules ((srfi srfi-26)
456 (guix build gnu-build-system))
460 (lambda* (#:key inputs #:allow-other-keys)
461 (and (zero? (system* "tar" "xzvf" (assoc-ref inputs "ccl")))
462 (begin (chdir "ccl") #t)))
467 ;; Enter the source directory for the current platform's lisp
468 ;; kernel, and run 'make clean' to remove the precompiled one.
470 (chdir (string-append
472 ,(match (or (%current-target-system) (%current-system))
473 ("i686-linux" "linuxx8632")
474 ("x86_64-linux" "linuxx8664")
475 ("armhf-linux" "linuxarm")
476 ;; Prevent errors when querying this package
477 ;; on unsupported platforms, e.g. when running
478 ;; "guix package --search="
480 (substitute* '("Makefile")
483 (zero? (system* "make" "clean")))
484 ;; XXX Do we need to recompile the heap image as well for Guix?
485 ;; For now just use the one we already got in the tarball.
488 (lambda* (#:key outputs inputs #:allow-other-keys)
489 ;; The lisp kernel built by running 'make' in lisp-kernel/$system
490 ;; is put back into the original directory, so go back. The heap
491 ;; image is there as well.
493 (let* ((out (assoc-ref outputs "out"))
494 (libdir (string-append out "/lib/"))
495 (bindir (string-append out "/bin/"))
496 (wrapper (string-append bindir "ccl"))
497 (bash (assoc-ref inputs "bash"))
499 ,(match (or (%current-target-system) (%current-system))
500 ("i686-linux" "lx86cl")
501 ("x86_64-linux" "lx86cl64")
502 ("armhf-linux" "armcl")
503 ;; Prevent errors when querying this package
504 ;; on unsupported platforms, e.g. when running
505 ;; "guix package --search="
507 (heap (string-append kernel ".image")))
508 (install-file kernel libdir)
509 (install-file heap libdir)
511 (let ((dirs '("lib" "library" "examples" "contrib"
512 "tools" "objc-bridge")))
513 (for-each copy-recursively
515 (map (cut string-append libdir <>) dirs)))
518 (with-output-to-file wrapper
522 "#!" bash "/bin/sh\n"
523 "CCL_DEFAULT_DIRECTORY=" libdir "\n"
524 "export CCL_DEFAULT_DIRECTORY\n"
525 "exec " libdir kernel "\n"))))
526 (chmod wrapper #o755)))
527 %standard-phases))))))
528 (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))
529 (home-page "http://ccl.clozure.com/")
530 (synopsis "Common Lisp implementation")
531 (description "Clozure CL (often called CCL for short) is a Common Lisp
532 implementation featuring fast compilation speed, native threads, a precise,
533 generational, compacting garbage collector, and a convenient foreign-function
535 ;; See file doc/LICENSE for clarifications it makes regarding how the LGPL
536 ;; applies to Lisp code according to them.
537 (license (list license:lgpl2.1
538 license:clarified-artistic)))) ;TRIVIAL-LDAP package
540 (define-public femtolisp
541 (let ((commit "68c5b1225572ecf2c52baf62f928063e5a30511b")
545 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
549 (url "https://github.com/JeffBezanson/femtolisp.git")
551 (file-name (string-append name "-" version "-checkout"))
554 "04rnwllxnl86zw8c6pwxznn49bvkvh0f1lfliy085vjzvlq3rgja"))))
555 ;; See "utils.h" for supported systems. Upstream bug:
556 ;; https://github.com/JeffBezanson/femtolisp/issues/25
558 (fold delete %supported-systems
559 '("armhf-linux" "mips64el-linux" "aarch64-linux")))
560 (build-system gnu-build-system)
562 `(#:make-flags '("CC=gcc" "release")
565 (modify-phases %standard-phases
566 (delete 'configure) ; No configure script
567 (replace 'install ; Makefile has no 'install phase
568 (lambda* (#:key outputs #:allow-other-keys)
569 (let* ((out (assoc-ref outputs "out"))
570 (bin (string-append out "/bin")))
571 (install-file "flisp" bin)
573 ;; The flisp binary is now available, run bootstrap to
574 ;; generate flisp.boot and afterwards runs make test.
575 (add-after 'install 'bootstrap-gen-and-test
576 (lambda* (#:key outputs #:allow-other-keys)
577 (let* ((out (assoc-ref outputs "out"))
578 (bin (string-append out "/bin")))
580 (zero? (system* "./bootstrap.sh"))
581 (install-file "flisp.boot" bin))))))))
582 (synopsis "Scheme-like lisp implementation")
584 "@code{femtolisp} is a scheme-like lisp implementation with a
585 simple, elegant Scheme dialect. It is a lisp-1 with lexical scope.
586 The core is 12 builtin special forms and 33 builtin functions.")
587 (home-page "https://github.com/JeffBezanson/femtolisp")
588 (license license:bsd-3))))
597 (uri (string-append "mirror://sourceforge/lush/lush2/lush-"
599 (modules '((guix build utils)))
602 (substitute* "src/unix.c"
603 (("\\{ \"LUSH_DATE\", __DATE__ \\},") "")
604 (("\\{ \"LUSH_TIME\", __TIME__ \\},") ""))
605 (substitute* "src/main.c"
606 (("\" \\(built \" __DATE__ \"\\)\"") ""))))
609 "02pkfn3nqdkm9fm44911dbcz0v3r0l53vygj8xigl6id5g3iwi4k"))))
610 (build-system gnu-build-system)
612 `(;; We have to add these LIBS so that they are found.
613 #:configure-flags (list "LIBS=-lz"
614 "X_EXTRA_LIBS=-lfontconfig"
616 #:tests? #f)) ; No make check.
617 (native-inputs `(("intltool" ,intltool)))
619 `(("alsa-lib" ,alsa-lib)
621 ("sdl-image" ,sdl-image)
622 ("sdl-mixer" ,sdl-mixer)
627 ("fontconfig" ,fontconfig)
629 ("openblas" ,openblas)
632 ("mesa-utils" ,mesa-utils)
633 ("binutils" ,binutils)
634 ("libiberty" ,libiberty)
635 ("readline" ,readline)
637 ("gettext-minimal" ,gettext-minimal)))
638 (synopsis "Lisp Universal Shell")
640 "Lush is an object-oriented Lisp interpreter/compiler with features
641 designed to please people who want to prototype large numerical
642 applications. Lush includes an extensive library of
643 vector/matrix/tensor manipulation, numerous numerical libraries
644 (including GSL, LAPACK, and BLAS), a set of graphic functions, a
645 simple GUI toolkit, and interfaces to various graphic and multimedia
646 libraries such as OpenGL, SDL, Video4Linux, and ALSA (video/audio
647 grabbing), and others. Lush is an ideal frontend script language for
648 programming projects written in C or other languages. Lush also has
649 libraries for Machine Learning, Neural Nets and statistical estimation.")
650 (home-page "http://lush.sourceforge.net/")
651 (license license:lgpl2.1+)))
653 (define-public sbcl-alexandria
655 (commit "926a066611b7b11cb71e26c827a271e500888c30"))
657 (name "sbcl-alexandria")
658 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
663 (url "https://gitlab.common-lisp.net/alexandria/alexandria.git")
667 "18yncicdkh294j05rhgm23gzi36y9qy6vrfba8vg69jrxjp1hx8l"))
668 (file-name (string-append "alexandria-" version "-checkout"))))
669 (build-system asdf-build-system/sbcl)
670 (synopsis "Collection of portable utilities for Common Lisp")
672 "Alexandria is a collection of portable utilities. It does not contain
673 conceptual extensions to Common Lisp. It is conservative in scope, and
674 portable between implementations.")
675 (home-page "https://common-lisp.net/project/alexandria/")
676 (license license:public-domain))))
678 (define-public cl-alexandria
679 (sbcl-package->cl-source-package sbcl-alexandria))
681 (define-public ecl-alexandria
682 (sbcl-package->ecl-package sbcl-alexandria))
684 (define-public sbcl-fiveam
692 "https://github.com/sionescu/fiveam/archive/v"
695 (base32 "0f48pcbhqs3wwwzjl5nk57d4hcbib4l9xblxc66b8c2fhvhmhxnv"))
696 (file-name (string-append "fiveam-" version ".tar.gz"))))
697 (inputs `(("alexandria" ,sbcl-alexandria)))
698 (build-system asdf-build-system/sbcl)
699 (synopsis "Common Lisp testing framework")
700 (description "FiveAM is a simple (as far as writing and running tests
701 goes) regression testing framework. It has been designed with Common Lisp's
702 interactive development model in mind.")
703 (home-page "https://common-lisp.net/project/fiveam/")
704 (license license:bsd-3)))
706 (define-public cl-fiveam
707 (sbcl-package->cl-source-package sbcl-fiveam))
709 (define-public ecl-fiveam
710 (sbcl-package->ecl-package sbcl-fiveam))
712 (define-public sbcl-bordeaux-threads
714 (name "sbcl-bordeaux-threads")
719 "https://github.com/sionescu/bordeaux-threads/archive/v"
722 (base32 "10ryrcx832fwqdawb6jmknymi7wpdzhi30qzx7cbrk0cpnka71w2"))
724 (string-append "bordeaux-threads-" version ".tar.gz"))))
725 (inputs `(("alexandria" ,sbcl-alexandria)))
726 (native-inputs `(("fiveam" ,sbcl-fiveam)))
727 (build-system asdf-build-system/sbcl)
728 (synopsis "Portable shared-state concurrency library for Common Lisp")
729 (description "BORDEAUX-THREADS is a proposed standard for a minimal
730 MP/Threading interface. It is similar to the CLIM-SYS threading and lock
732 (home-page "https://common-lisp.net/project/bordeaux-threads/")
733 (license license:x11)))
735 (define-public cl-bordeaux-threads
736 (sbcl-package->cl-source-package sbcl-bordeaux-threads))
738 (define-public ecl-bordeaux-threads
739 (sbcl-package->ecl-package sbcl-bordeaux-threads))
741 (define-public sbcl-trivial-gray-streams
743 (commit "0483ade330508b4b2edeabdb47d16ec9437ee1cb"))
745 (name "sbcl-trivial-gray-streams")
746 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
752 (url "https://github.com/trivial-gray-streams/trivial-gray-streams.git")
755 (base32 "0m3rpf2x0zmdk3nf1qfa01j6a55vj7gkwhyw78qslcgbjlgh8p4d"))
757 (string-append "trivial-gray-streams-" version "-checkout"))))
758 (build-system asdf-build-system/sbcl)
759 (synopsis "Compatibility layer for Gray streams implementations")
760 (description "Gray streams is an interface proposed for inclusion with
761 ANSI CL by David N. Gray. The proposal did not make it into ANSI CL, but most
762 popular CL implementations implement it. This package provides an extremely
763 thin compatibility layer for gray streams.")
764 (home-page "http://www.cliki.net/trivial-gray-streams")
765 (license license:x11))))
767 (define-public cl-trivial-gray-streams
768 (sbcl-package->cl-source-package sbcl-trivial-gray-streams))
770 (define-public ecl-trivial-gray-streams
771 (sbcl-package->ecl-package sbcl-trivial-gray-streams))
773 (define-public sbcl-flexi-streams
775 (name "sbcl-flexi-streams")
781 "https://github.com/edicl/flexi-streams/archive/v"
784 (base32 "16grnxvs7vqm5s6myf8a5s7vwblzq1kgwj8i7ahz8vwvihm9gzfi"))
785 (file-name (string-append "flexi-streams-" version ".tar.gz"))))
786 (build-system asdf-build-system/sbcl)
787 (inputs `(("trivial-gray-streams" ,sbcl-trivial-gray-streams)))
788 (synopsis "Implementation of virtual bivalent streams for Common Lisp")
789 (description "Flexi-streams is an implementation of \"virtual\" bivalent
790 streams that can be layered atop real binary or bivalent streams and that can
791 be used to read and write character data in various single- or multi-octet
792 encodings which can be changed on the fly. It also supplies in-memory binary
793 streams which are similar to string streams.")
794 (home-page "http://weitz.de/flexi-streams/")
795 (license license:bsd-3)))
797 (define-public cl-flexi-streams
798 (sbcl-package->cl-source-package sbcl-flexi-streams))
800 (define-public ecl-flexi-streams
801 (sbcl-package->ecl-package sbcl-flexi-streams))
803 (define-public sbcl-cl-ppcre
805 (name "sbcl-cl-ppcre")
811 "https://github.com/edicl/cl-ppcre/archive/v"
814 (base32 "1i7daxf0wnydb0pgwiym7qh2wy70n14lxd6dyv28sy0naa8p31gd"))
815 (file-name (string-append "cl-ppcre-" version ".tar.gz"))))
816 (build-system asdf-build-system/sbcl)
817 (native-inputs `(("flexi-streams" ,sbcl-flexi-streams)))
818 (synopsis "Portable regular expression library for Common Lisp")
819 (description "CL-PPCRE is a portable regular expression library for Common
820 Lisp, which is compatible with perl. It is pretty fast, thread-safe, and
821 compatible with ANSI-compliant Common Lisp implementations.")
822 (home-page "http://weitz.de/cl-ppcre/")
823 (license license:bsd-2)))
825 (define-public cl-ppcre
826 (sbcl-package->cl-source-package sbcl-cl-ppcre))
828 (define-public ecl-cl-ppcre
829 (sbcl-package->ecl-package sbcl-cl-ppcre))
831 (define sbcl-cl-unicode-base
833 (commit "9fcd06fba1ddc9e66aed2f2d6c32dc9b764f03ea"))
835 (name "sbcl-cl-unicode-base")
836 (version (string-append "0.1.5-" revision "." (string-take commit 7)))
840 (url "https://github.com/edicl/cl-unicode.git")
842 (file-name (string-append "cl-unicode-" version "-checkout"))
845 "1jicprb5b3bv57dy1kg03572gxkcaqdjhak00426s76g0plmx5ki"))))
846 (build-system asdf-build-system/sbcl)
848 '(#:asd-file "cl-unicode.asd"
849 #:asd-system-name "cl-unicode/base"))
851 `(("cl-ppcre" ,sbcl-cl-ppcre)))
852 (home-page "http://weitz.de/cl-unicode/")
853 (synopsis "Portable Unicode library for Common Lisp")
854 (description "CL-UNICODE is a portable Unicode library Common Lisp, which
855 is compatible with perl. It is pretty fast, thread-safe, and compatible with
856 ANSI-compliant Common Lisp implementations.")
857 (license license:bsd-2))))
859 (define-public sbcl-cl-unicode
861 (inherit sbcl-cl-unicode-base)
862 (name "sbcl-cl-unicode")
864 `(("cl-unicode/base" ,sbcl-cl-unicode-base)
865 ,@(package-inputs sbcl-cl-unicode-base)))
867 `(("flexi-streams" ,sbcl-flexi-streams)))
870 (define-public ecl-cl-unicode
871 (sbcl-package->ecl-package sbcl-cl-unicode))
873 (define-public cl-unicode
874 (sbcl-package->cl-source-package sbcl-cl-unicode))
876 (define-public sbcl-clx
878 (commit "1c62774b03c1cf3fe6e5cb532df8b14b44c96b95"))
881 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
887 (url "https://github.com/sharplispers/clx.git")
890 (base32 "0qffag03ns52kwq9xjns2qg1yr0bf3ba507iwq5cmx5xz0b0rmjm"))
891 (file-name (string-append "clx-" version "-checkout"))
894 (search-patch "clx-remove-demo.patch")))
895 (modules '((guix build utils)))
898 ;; These removed files cause the compiled system to crash when
900 (delete-file-recursively "demo")
901 (delete-file "test/trapezoid.lisp")
902 (substitute* "clx.asd"
903 (("\\(:file \"trapezoid\"\\)") ""))))))
904 (build-system asdf-build-system/sbcl)
905 (home-page "http://www.cliki.net/portable-clx")
906 (synopsis "X11 client library for Common Lisp")
907 (description "CLX is an X11 client library for Common Lisp. The code was
908 originally taken from a CMUCL distribution, was modified somewhat in order to
909 make it compile and run under SBCL, then a selection of patches were added
910 from other CLXes around the net.")
911 (license license:x11))))
913 (define-public cl-clx
914 (sbcl-package->cl-source-package sbcl-clx))
916 (define-public ecl-clx
917 (sbcl-package->ecl-package sbcl-clx))
919 (define-public sbcl-cl-ppcre-unicode
920 (package (inherit sbcl-cl-ppcre)
921 (name "sbcl-cl-ppcre-unicode")
923 `(#:tests? #f ; tests fail with "Component :CL-PPCRE-TEST not found"
924 #:asd-file "cl-ppcre-unicode.asd"))
926 `(("sbcl-cl-ppcre" ,sbcl-cl-ppcre)
927 ("sbcl-cl-unicode" ,sbcl-cl-unicode)))))
929 (define-public sbcl-stumpwm
931 (name "sbcl-stumpwm")
936 "https://github.com/stumpwm/stumpwm/archive/"
939 (base32 "1maxp98gh64az3d9vz9br6zdd6rc9fmj2imvax4by85g6kxvdz1i"))
940 (file-name (string-append "stumpwm-" version ".tar.gz"))))
941 (build-system asdf-build-system/sbcl)
942 (inputs `(("cl-ppcre" ,sbcl-cl-ppcre)
944 (outputs '("out" "lib"))
947 (modify-phases %standard-phases
948 (add-after 'create-symlinks 'build-program
949 (lambda* (#:key outputs #:allow-other-keys)
951 (string-append (assoc-ref outputs "out") "/bin/stumpwm")
953 #:entry-program '((stumpwm:stumpwm) 0))))
954 (add-after 'build-program 'create-desktop-file
955 (lambda* (#:key outputs #:allow-other-keys)
956 (let* ((out (assoc-ref outputs "out"))
957 (xsessions (string-append out "/share/xsessions")))
959 (call-with-output-file
960 (string-append xsessions "/stumpwm.desktop")
965 Comment=The Stump Window Manager~@
966 Exec=~a/bin/stumpwm~@
967 TryExec=~@*~a/bin/stumpwm~@
972 (synopsis "Window manager written in Common Lisp")
973 (description "Stumpwm is a window manager written entirely in Common Lisp.
974 It attempts to be highly customizable while relying entirely on the keyboard
975 for input. These design decisions reflect the growing popularity of
976 productive, customizable lisp based systems.")
977 (home-page "https://github.com/stumpwm/stumpwm")
978 (license license:gpl2+)
979 (properties `((ecl-variant . ,(delay ecl-stumpwm))))))
981 (define-public cl-stumpwm
982 (sbcl-package->cl-source-package sbcl-stumpwm))
984 (define-public ecl-stumpwm
985 (let ((base (sbcl-package->ecl-package sbcl-stumpwm)))
991 ;; The slynk that users expect to install includes all of slynk's contrib
992 ;; modules. Therefore, we build the base module and all contribs first; then
993 ;; we expose the union of these as `sbcl-slynk'. The following variable
994 ;; describes the base module.
995 (define sbcl-slynk-boot0
997 (commit "5706cd45d484a4f25795abe8e643509d31968aa2"))
999 (name "sbcl-slynk-boot0")
1000 (version (string-append "1.0.0-beta-" revision "." (string-take commit 7)))
1006 (url "https://github.com/joaotavora/sly.git")
1009 (base32 "0h4gg3sndl2bf6jdnx9nrf14p9hhi43hagrl0f4v4l11hczl8w81"))
1010 (file-name (string-append "slynk-" version "-checkout"))
1011 (modules '((guix build utils)
1015 ;; Move the contribs into the main source directory for easier
1017 (substitute* "slynk/slynk.asd"
1020 (("\\(defsystem :slynk-util")
1021 "(defsystem :slynk-util :depends-on (:slynk)"))
1022 (substitute* "contrib/slynk-trace-dialog.lisp"
1023 (("\\(slynk::reset-inspector\\)") ; Causes problems on load
1025 (substitute* "contrib/slynk-profiler.lisp"
1027 "slynk-pprint-to-line"))
1028 (rename-file "contrib" "slynk/contrib")
1029 ;; Move slynk's contents into the base directory for easier
1033 (unless (string-prefix? "." file)
1034 (rename-file (string-append "slynk/" file)
1035 (string-append "./" (basename file)))))
1036 (scandir "slynk"))))))
1037 (build-system asdf-build-system/sbcl)
1039 `(#:tests? #f ; No test suite
1040 #:asd-system-name "slynk"))
1041 (synopsis "Common Lisp IDE for Emacs")
1042 (description "SLY is a fork of SLIME, an IDE backend for Common Lisp.
1043 It also features a completely redesigned REPL based on Emacs's own
1044 full-featured comint.el, live code annotations, and a consistent interactive
1045 button interface. Everything can be copied to the REPL. One can create
1046 multiple inspectors with independent history.")
1047 (home-page "https://github.com/joaotavora/sly")
1048 (license license:public-domain)
1049 (properties `((cl-source-variant . ,(delay cl-slynk)))))))
1051 (define-public cl-slynk
1053 (inherit (sbcl-package->cl-source-package sbcl-slynk-boot0))
1056 (define ecl-slynk-boot0
1057 (sbcl-package->ecl-package sbcl-slynk-boot0))
1059 (define sbcl-slynk-arglists
1061 (inherit sbcl-slynk-boot0)
1062 (name "sbcl-slynk-arglists")
1063 (inputs `(("slynk" ,sbcl-slynk-boot0)))
1065 (substitute-keyword-arguments (package-arguments sbcl-slynk-boot0)
1066 ((#:asd-file _ "") "slynk.asd")
1067 ((#:asd-system-name _ #f) #f)))))
1069 (define ecl-slynk-arglists
1070 (sbcl-package->ecl-package sbcl-slynk-arglists))
1072 (define sbcl-slynk-util
1074 (inherit sbcl-slynk-arglists)
1075 (name "sbcl-slynk-util")))
1077 (define ecl-slynk-util
1078 (sbcl-package->ecl-package sbcl-slynk-util))
1080 (define sbcl-slynk-fancy-inspector
1082 (inherit sbcl-slynk-arglists)
1083 (name "sbcl-slynk-fancy-inspector")
1084 (inputs `(("slynk-util" ,sbcl-slynk-util)
1085 ,@(package-inputs sbcl-slynk-arglists)))))
1087 (define ecl-slynk-fancy-inspector
1088 (sbcl-package->ecl-package sbcl-slynk-fancy-inspector))
1090 (define sbcl-slynk-package-fu
1092 (inherit sbcl-slynk-arglists)
1093 (name "sbcl-slynk-package-fu")))
1095 (define ecl-slynk-package-fu
1096 (sbcl-package->ecl-package sbcl-slynk-package-fu))
1098 (define sbcl-slynk-mrepl
1100 (inherit sbcl-slynk-arglists)
1101 (name "sbcl-slynk-mrepl")))
1103 (define ecl-slynk-mrepl
1104 (sbcl-package->ecl-package sbcl-slynk-mrepl))
1106 (define sbcl-slynk-trace-dialog
1108 (inherit sbcl-slynk-arglists)
1109 (name "sbcl-slynk-trace-dialog")))
1111 (define ecl-slynk-trace-dialog
1112 (sbcl-package->ecl-package sbcl-slynk-trace-dialog))
1114 (define sbcl-slynk-profiler
1116 (inherit sbcl-slynk-arglists)
1117 (name "sbcl-slynk-profiler")))
1119 (define ecl-slynk-profiler
1120 (sbcl-package->ecl-package sbcl-slynk-profiler))
1122 (define sbcl-slynk-stickers
1124 (inherit sbcl-slynk-arglists)
1125 (name "sbcl-slynk-stickers")))
1127 (define ecl-slynk-stickers
1128 (sbcl-package->ecl-package sbcl-slynk-stickers))
1130 (define sbcl-slynk-indentation
1132 (inherit sbcl-slynk-arglists)
1133 (name "sbcl-slynk-indentation")))
1135 (define ecl-slynk-indentation
1136 (sbcl-package->ecl-package sbcl-slynk-indentation))
1138 (define sbcl-slynk-retro
1140 (inherit sbcl-slynk-arglists)
1141 (name "sbcl-slynk-retro")))
1143 (define ecl-slynk-retro
1144 (sbcl-package->ecl-package sbcl-slynk-retro))
1146 (define slynk-systems
1150 "slynk-fancy-inspector"
1154 "slynk-trace-dialog"
1159 (define-public sbcl-slynk
1161 (inherit sbcl-slynk-boot0)
1164 `(("slynk" ,sbcl-slynk-boot0)
1165 ("slynk-util" ,sbcl-slynk-util)
1166 ("slynk-arglists" ,sbcl-slynk-arglists)
1167 ("slynk-fancy-inspector" ,sbcl-slynk-fancy-inspector)
1168 ("slynk-package-fu" ,sbcl-slynk-package-fu)
1169 ("slynk-mrepl" ,sbcl-slynk-mrepl)
1170 ("slynk-profiler" ,sbcl-slynk-profiler)
1171 ("slynk-trace-dialog" ,sbcl-slynk-trace-dialog)
1172 ("slynk-stickers" ,sbcl-slynk-stickers)
1173 ("slynk-indentation" ,sbcl-slynk-indentation)
1174 ("slynk-retro" ,sbcl-slynk-retro)))
1175 (native-inputs `(("sbcl" ,sbcl)))
1176 (build-system trivial-build-system)
1178 (outputs '("out" "image"))
1180 `(#:modules ((guix build union)
1182 (guix build lisp-utils))
1185 (use-modules (ice-9 match)
1188 (guix build lisp-utils))
1191 (assoc-ref %outputs "out")
1195 (if (string-prefix? "slynk" name) path #f)))
1198 (prepend-to-source-registry
1199 (string-append (assoc-ref %outputs "out") "//"))
1201 (parameterize ((%lisp-type "sbcl")
1202 (%lisp (string-append (assoc-ref %build-inputs "sbcl")
1204 (build-image (string-append
1205 (assoc-ref %outputs "image")
1208 #:dependencies ',slynk-systems)))))))
1210 (define-public ecl-slynk
1212 (inherit sbcl-slynk)
1217 (list name (sbcl-package->ecl-package pkg))))
1218 (package-inputs sbcl-slynk)))
1222 '(#:modules ((guix build union))
1225 (use-modules (ice-9 match)
1227 (match %build-inputs
1228 (((names . paths) ...)
1229 (union-build (assoc-ref %outputs "out")
1232 (define-public sbcl-stumpwm+slynk
1234 (inherit sbcl-stumpwm)
1235 (name "sbcl-stumpwm-with-slynk")
1238 `(("stumpwm" ,sbcl-stumpwm "lib")
1239 ("slynk" ,sbcl-slynk)))
1241 (substitute-keyword-arguments (package-arguments sbcl-stumpwm)
1243 `(modify-phases ,phases
1244 (replace 'build-program
1245 (lambda* (#:key inputs outputs #:allow-other-keys)
1246 (let* ((out (assoc-ref outputs "out"))
1247 (program (string-append out "/bin/stumpwm")))
1248 (build-program program outputs
1249 #:entry-program '((stumpwm:stumpwm) 0)
1250 #:dependencies '("stumpwm"
1252 #:dependency-prefixes
1253 (map (lambda (input) (assoc-ref inputs input))
1254 '("stumpwm" "slynk")))
1255 ;; Remove unneeded file.
1256 (delete-file (string-append out "/bin/stumpwm-exec.fasl"))
1258 (delete 'copy-source)
1261 (delete 'create-asd-file)
1263 (delete 'create-symlinks)))))))
1265 (define-public sbcl-parse-js
1266 (let ((commit "fbadc6029bec7039602abfc06c73bb52970998f6")
1269 (name "sbcl-parse-js")
1270 (version (string-append "0.0.0-" revision "." (string-take commit 9)))
1275 (url "http://marijn.haverbeke.nl/git/parse-js")
1277 (file-name (string-append name "-" commit "-checkout"))
1280 "1wddrnr5kiya5s3gp4cdq6crbfy9fqcz7fr44p81502sj3bvdv39"))))
1281 (build-system asdf-build-system/sbcl)
1282 (home-page "http://marijnhaverbeke.nl/parse-js/")
1283 (synopsis "Parse JavaScript")
1284 (description "Parse-js is a Common Lisp package for parsing
1285 JavaScript (ECMAScript 3). It has basic support for ECMAScript 5.")
1286 (license license:zlib))))
1288 (define-public sbcl-parse-number
1290 (name "sbcl-parse-number")
1295 (uri (string-append "https://github.com/sharplispers/parse-number/"
1296 "archive/v" version ".tar.gz"))
1297 (file-name (string-append name "-" version ".tar.gz"))
1300 "1k6s4v65ksc1j5i0dprvzfvj213v6nah7i0rgd0726ngfjisj9ir"))))
1301 (build-system asdf-build-system/sbcl)
1302 (home-page "http://www.cliki.net/PARSE-NUMBER")
1303 (synopsis "Parse numbers")
1304 (description "@code{parse-number} is a library of functions for parsing
1305 strings into one of the standard Common Lisp number types without using the
1306 reader. @code{parse-number} accepts an arbitrary string and attempts to parse
1307 the string into one of the standard Common Lisp number types, if possible, or
1308 else @code{parse-number} signals an error of type @code{invalid-number}.")
1309 (license license:bsd-3)))
1311 (define-public sbcl-iterate
1313 (name "sbcl-iterate")
1314 ;; The latest official release (1.4.3) fails to build so we have to take
1315 ;; the current darcs tarball from quicklisp.
1316 (version "20160825")
1320 (uri (string-append "http://beta.quicklisp.org/archive/iterate/"
1321 "2016-08-25/iterate-"
1322 version "-darcs.tgz"))
1325 "0kvz16gnxnkdz0fy1x8y5yr28nfm7i2qpvix7mgwccdpjmsb4pgm"))))
1326 (build-system asdf-build-system/sbcl)
1327 (home-page "https://common-lisp.net/project/iterate/")
1328 (synopsis "Iteration construct for Common Lisp")
1329 (description "@code{iterate} is an iteration construct for Common Lisp.
1330 It is similar to the @code{CL:LOOP} macro, with these distinguishing marks:
1333 @item it is extensible,
1334 @item it helps editors like Emacs indent iterate forms by having a more
1335 lisp-like syntax, and
1336 @item it isn't part of the ANSI standard for Common Lisp.
1338 (license license:expat)))
1340 (define-public sbcl-cl-uglify-js
1341 ;; There have been many bug fixes since the 2010 release.
1342 (let ((commit "429c5e1d844e2f96b44db8fccc92d6e8e28afdd5")
1345 (name "sbcl-cl-uglify-js")
1346 (version (string-append "0.1-" revision "." (string-take commit 9)))
1351 (url "https://github.com/mishoo/cl-uglify-js.git")
1355 "0k39y3c93jgxpr7gwz7w0d8yknn1fdnxrjhd03057lvk5w8js27a"))))
1356 (build-system asdf-build-system/sbcl)
1358 `(("sbcl-parse-js" ,sbcl-parse-js)
1359 ("sbcl-cl-ppcre" ,sbcl-cl-ppcre)
1360 ("sbcl-cl-ppcre-unicode" ,sbcl-cl-ppcre-unicode)
1361 ("sbcl-parse-number" ,sbcl-parse-number)
1362 ("sbcl-iterate" ,sbcl-iterate)))
1363 (home-page "https://github.com/mishoo/cl-uglify-js")
1364 (synopsis "JavaScript compressor library for Common Lisp")
1365 (description "This is a Common Lisp version of UglifyJS, a JavaScript
1366 compressor. It works on data produced by @code{parse-js} to generate a
1367 @dfn{minified} version of the code. Currently it can:
1370 @item reduce variable names (usually to single letters)
1371 @item join consecutive @code{var} statements
1372 @item resolve simple binary expressions
1373 @item group most consecutive statements using the ``sequence'' operator (comma)
1374 @item remove unnecessary blocks
1375 @item convert @code{IF} expressions in various ways that result in smaller code
1376 @item remove some unreachable code
1378 (license license:zlib))))
1380 (define-public uglify-js
1382 (inherit sbcl-cl-uglify-js)
1384 (build-system trivial-build-system)
1386 `(#:modules ((guix build utils))
1388 (let* ((bin (string-append (assoc-ref %outputs "out") "/bin/"))
1389 (script (string-append bin "uglify-js")))
1390 (use-modules (guix build utils))
1392 (with-output-to-file script
1394 (format #t "#!~a/bin/sbcl --script
1396 (push (truename \"~a/lib/sbcl\") asdf:*central-registry*)"
1397 (assoc-ref %build-inputs "sbcl")
1398 (assoc-ref %build-inputs "sbcl-cl-uglify-js"))
1399 ;; FIXME: cannot use progn here because otherwise it fails to
1400 ;; find cl-uglify-js.
1404 (let ((*standard-output* (make-broadcast-stream))
1405 (*error-output* (make-broadcast-stream)))
1406 (asdf:load-system :cl-uglify-js))
1407 (let ((file (cadr *posix-argv*)))
1410 (cl-uglify-js:ast-gen-code
1411 (cl-uglify-js:ast-mangle
1412 (cl-uglify-js:ast-squeeze
1413 (with-open-file (in file)
1414 (parse-js:parse-js in))))
1417 (format *error-output*
1418 "Please provide a JavaScript file.~%")
1419 (sb-ext:exit :code 1))))))))
1420 (chmod script #o755)
1424 ("sbcl-cl-uglify-js" ,sbcl-cl-uglify-js)))
1425 (synopsis "JavaScript compressor")))