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))
458 (modify-phases %standard-phases
460 (lambda* (#:key inputs #:allow-other-keys)
461 (and (zero? (system* "tar" "xzvf" (assoc-ref inputs "ccl")))
462 (begin (chdir "ccl") #t))))
464 (add-before 'build 'pre-build
465 ;; Enter the source directory for the current platform's lisp
466 ;; kernel, and run 'make clean' to remove the precompiled one.
468 (chdir (string-append
470 ,(match (or (%current-target-system) (%current-system))
471 ("i686-linux" "linuxx8632")
472 ("x86_64-linux" "linuxx8664")
473 ("armhf-linux" "linuxarm")
474 ;; Prevent errors when querying this package
475 ;; on unsupported platforms, e.g. when running
476 ;; "guix package --search="
478 (substitute* '("Makefile")
481 (zero? (system* "make" "clean"))))
482 ;; XXX Do we need to recompile the heap image as well for Guix?
483 ;; For now just use the one we already got in the tarball.
485 (lambda* (#:key outputs inputs #:allow-other-keys)
486 ;; The lisp kernel built by running 'make' in lisp-kernel/$system
487 ;; is put back into the original directory, so go back. The heap
488 ;; image is there as well.
490 (let* ((out (assoc-ref outputs "out"))
491 (libdir (string-append out "/lib/"))
492 (bindir (string-append out "/bin/"))
493 (wrapper (string-append bindir "ccl"))
494 (bash (assoc-ref inputs "bash"))
496 ,(match (or (%current-target-system) (%current-system))
497 ("i686-linux" "lx86cl")
498 ("x86_64-linux" "lx86cl64")
499 ("armhf-linux" "armcl")
500 ;; Prevent errors when querying this package
501 ;; on unsupported platforms, e.g. when running
502 ;; "guix package --search="
504 (heap (string-append kernel ".image")))
505 (install-file kernel libdir)
506 (install-file heap libdir)
508 (let ((dirs '("lib" "library" "examples" "contrib"
509 "tools" "objc-bridge")))
510 (for-each copy-recursively
512 (map (cut string-append libdir <>) dirs)))
515 (with-output-to-file wrapper
519 "#!" bash "/bin/sh\n"
520 "CCL_DEFAULT_DIRECTORY=" libdir "\n"
521 "export CCL_DEFAULT_DIRECTORY\n"
522 "exec " libdir kernel "\n"))))
523 (chmod wrapper #o755))
525 (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))
526 (home-page "http://ccl.clozure.com/")
527 (synopsis "Common Lisp implementation")
528 (description "Clozure CL (often called CCL for short) is a Common Lisp
529 implementation featuring fast compilation speed, native threads, a precise,
530 generational, compacting garbage collector, and a convenient foreign-function
532 ;; See file doc/LICENSE for clarifications it makes regarding how the LGPL
533 ;; applies to Lisp code according to them.
534 (license (list license:lgpl2.1
535 license:clarified-artistic)))) ;TRIVIAL-LDAP package
537 (define-public femtolisp
538 (let ((commit "68c5b1225572ecf2c52baf62f928063e5a30511b")
542 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
546 (url "https://github.com/JeffBezanson/femtolisp.git")
548 (file-name (string-append name "-" version "-checkout"))
551 "04rnwllxnl86zw8c6pwxznn49bvkvh0f1lfliy085vjzvlq3rgja"))))
552 ;; See "utils.h" for supported systems. Upstream bug:
553 ;; https://github.com/JeffBezanson/femtolisp/issues/25
555 (fold delete %supported-systems
556 '("armhf-linux" "mips64el-linux" "aarch64-linux")))
557 (build-system gnu-build-system)
559 `(#:make-flags '("CC=gcc" "release")
562 (modify-phases %standard-phases
563 (delete 'configure) ; No configure script
564 (replace 'install ; Makefile has no 'install phase
565 (lambda* (#:key outputs #:allow-other-keys)
566 (let* ((out (assoc-ref outputs "out"))
567 (bin (string-append out "/bin")))
568 (install-file "flisp" bin)
570 ;; The flisp binary is now available, run bootstrap to
571 ;; generate flisp.boot and afterwards runs make test.
572 (add-after 'install 'bootstrap-gen-and-test
573 (lambda* (#:key outputs #:allow-other-keys)
574 (let* ((out (assoc-ref outputs "out"))
575 (bin (string-append out "/bin")))
577 (zero? (system* "./bootstrap.sh"))
578 (install-file "flisp.boot" bin))))))))
579 (synopsis "Scheme-like lisp implementation")
581 "@code{femtolisp} is a scheme-like lisp implementation with a
582 simple, elegant Scheme dialect. It is a lisp-1 with lexical scope.
583 The core is 12 builtin special forms and 33 builtin functions.")
584 (home-page "https://github.com/JeffBezanson/femtolisp")
585 (license license:bsd-3))))
594 (uri (string-append "mirror://sourceforge/lush/lush2/lush-"
596 (modules '((guix build utils)))
599 (substitute* "src/unix.c"
600 (("\\{ \"LUSH_DATE\", __DATE__ \\},") "")
601 (("\\{ \"LUSH_TIME\", __TIME__ \\},") ""))
602 (substitute* "src/main.c"
603 (("\" \\(built \" __DATE__ \"\\)\"") ""))))
606 "02pkfn3nqdkm9fm44911dbcz0v3r0l53vygj8xigl6id5g3iwi4k"))))
607 (build-system gnu-build-system)
609 `(;; We have to add these LIBS so that they are found.
610 #:configure-flags (list "LIBS=-lz"
611 "X_EXTRA_LIBS=-lfontconfig"
613 #:tests? #f)) ; No make check.
614 (native-inputs `(("intltool" ,intltool)))
616 `(("alsa-lib" ,alsa-lib)
618 ("sdl-image" ,sdl-image)
619 ("sdl-mixer" ,sdl-mixer)
624 ("fontconfig" ,fontconfig)
626 ("openblas" ,openblas)
629 ("mesa-utils" ,mesa-utils)
630 ("binutils" ,binutils)
631 ("libiberty" ,libiberty)
632 ("readline" ,readline)
634 ("gettext-minimal" ,gettext-minimal)))
635 (synopsis "Lisp Universal Shell")
637 "Lush is an object-oriented Lisp interpreter/compiler with features
638 designed to please people who want to prototype large numerical
639 applications. Lush includes an extensive library of
640 vector/matrix/tensor manipulation, numerous numerical libraries
641 (including GSL, LAPACK, and BLAS), a set of graphic functions, a
642 simple GUI toolkit, and interfaces to various graphic and multimedia
643 libraries such as OpenGL, SDL, Video4Linux, and ALSA (video/audio
644 grabbing), and others. Lush is an ideal frontend script language for
645 programming projects written in C or other languages. Lush also has
646 libraries for Machine Learning, Neural Nets and statistical estimation.")
647 (home-page "http://lush.sourceforge.net/")
648 (license license:lgpl2.1+)))
650 (define-public sbcl-alexandria
652 (commit "926a066611b7b11cb71e26c827a271e500888c30"))
654 (name "sbcl-alexandria")
655 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
660 (url "https://gitlab.common-lisp.net/alexandria/alexandria.git")
664 "18yncicdkh294j05rhgm23gzi36y9qy6vrfba8vg69jrxjp1hx8l"))
665 (file-name (string-append "alexandria-" version "-checkout"))))
666 (build-system asdf-build-system/sbcl)
667 (synopsis "Collection of portable utilities for Common Lisp")
669 "Alexandria is a collection of portable utilities. It does not contain
670 conceptual extensions to Common Lisp. It is conservative in scope, and
671 portable between implementations.")
672 (home-page "https://common-lisp.net/project/alexandria/")
673 (license license:public-domain))))
675 (define-public cl-alexandria
676 (sbcl-package->cl-source-package sbcl-alexandria))
678 (define-public ecl-alexandria
679 (sbcl-package->ecl-package sbcl-alexandria))
681 (define-public sbcl-fiveam
689 "https://github.com/sionescu/fiveam/archive/v"
692 (base32 "0f48pcbhqs3wwwzjl5nk57d4hcbib4l9xblxc66b8c2fhvhmhxnv"))
693 (file-name (string-append "fiveam-" version ".tar.gz"))))
694 (inputs `(("alexandria" ,sbcl-alexandria)))
695 (build-system asdf-build-system/sbcl)
696 (synopsis "Common Lisp testing framework")
697 (description "FiveAM is a simple (as far as writing and running tests
698 goes) regression testing framework. It has been designed with Common Lisp's
699 interactive development model in mind.")
700 (home-page "https://common-lisp.net/project/fiveam/")
701 (license license:bsd-3)))
703 (define-public cl-fiveam
704 (sbcl-package->cl-source-package sbcl-fiveam))
706 (define-public ecl-fiveam
707 (sbcl-package->ecl-package sbcl-fiveam))
709 (define-public sbcl-bordeaux-threads
711 (name "sbcl-bordeaux-threads")
716 "https://github.com/sionescu/bordeaux-threads/archive/v"
719 (base32 "10ryrcx832fwqdawb6jmknymi7wpdzhi30qzx7cbrk0cpnka71w2"))
721 (string-append "bordeaux-threads-" version ".tar.gz"))))
722 (inputs `(("alexandria" ,sbcl-alexandria)))
723 (native-inputs `(("fiveam" ,sbcl-fiveam)))
724 (build-system asdf-build-system/sbcl)
725 (synopsis "Portable shared-state concurrency library for Common Lisp")
726 (description "BORDEAUX-THREADS is a proposed standard for a minimal
727 MP/Threading interface. It is similar to the CLIM-SYS threading and lock
729 (home-page "https://common-lisp.net/project/bordeaux-threads/")
730 (license license:x11)))
732 (define-public cl-bordeaux-threads
733 (sbcl-package->cl-source-package sbcl-bordeaux-threads))
735 (define-public ecl-bordeaux-threads
736 (sbcl-package->ecl-package sbcl-bordeaux-threads))
738 (define-public sbcl-trivial-gray-streams
740 (commit "0483ade330508b4b2edeabdb47d16ec9437ee1cb"))
742 (name "sbcl-trivial-gray-streams")
743 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
749 (url "https://github.com/trivial-gray-streams/trivial-gray-streams.git")
752 (base32 "0m3rpf2x0zmdk3nf1qfa01j6a55vj7gkwhyw78qslcgbjlgh8p4d"))
754 (string-append "trivial-gray-streams-" version "-checkout"))))
755 (build-system asdf-build-system/sbcl)
756 (synopsis "Compatibility layer for Gray streams implementations")
757 (description "Gray streams is an interface proposed for inclusion with
758 ANSI CL by David N. Gray. The proposal did not make it into ANSI CL, but most
759 popular CL implementations implement it. This package provides an extremely
760 thin compatibility layer for gray streams.")
761 (home-page "http://www.cliki.net/trivial-gray-streams")
762 (license license:x11))))
764 (define-public cl-trivial-gray-streams
765 (sbcl-package->cl-source-package sbcl-trivial-gray-streams))
767 (define-public ecl-trivial-gray-streams
768 (sbcl-package->ecl-package sbcl-trivial-gray-streams))
770 (define-public sbcl-flexi-streams
772 (name "sbcl-flexi-streams")
778 "https://github.com/edicl/flexi-streams/archive/v"
781 (base32 "16grnxvs7vqm5s6myf8a5s7vwblzq1kgwj8i7ahz8vwvihm9gzfi"))
782 (file-name (string-append "flexi-streams-" version ".tar.gz"))))
783 (build-system asdf-build-system/sbcl)
784 (inputs `(("trivial-gray-streams" ,sbcl-trivial-gray-streams)))
785 (synopsis "Implementation of virtual bivalent streams for Common Lisp")
786 (description "Flexi-streams is an implementation of \"virtual\" bivalent
787 streams that can be layered atop real binary or bivalent streams and that can
788 be used to read and write character data in various single- or multi-octet
789 encodings which can be changed on the fly. It also supplies in-memory binary
790 streams which are similar to string streams.")
791 (home-page "http://weitz.de/flexi-streams/")
792 (license license:bsd-3)))
794 (define-public cl-flexi-streams
795 (sbcl-package->cl-source-package sbcl-flexi-streams))
797 (define-public ecl-flexi-streams
798 (sbcl-package->ecl-package sbcl-flexi-streams))
800 (define-public sbcl-cl-ppcre
802 (name "sbcl-cl-ppcre")
808 "https://github.com/edicl/cl-ppcre/archive/v"
811 (base32 "1i7daxf0wnydb0pgwiym7qh2wy70n14lxd6dyv28sy0naa8p31gd"))
812 (file-name (string-append "cl-ppcre-" version ".tar.gz"))))
813 (build-system asdf-build-system/sbcl)
814 (native-inputs `(("flexi-streams" ,sbcl-flexi-streams)))
815 (synopsis "Portable regular expression library for Common Lisp")
816 (description "CL-PPCRE is a portable regular expression library for Common
817 Lisp, which is compatible with perl. It is pretty fast, thread-safe, and
818 compatible with ANSI-compliant Common Lisp implementations.")
819 (home-page "http://weitz.de/cl-ppcre/")
820 (license license:bsd-2)))
822 (define-public cl-ppcre
823 (sbcl-package->cl-source-package sbcl-cl-ppcre))
825 (define-public ecl-cl-ppcre
826 (sbcl-package->ecl-package sbcl-cl-ppcre))
828 (define sbcl-cl-unicode-base
830 (commit "9fcd06fba1ddc9e66aed2f2d6c32dc9b764f03ea"))
832 (name "sbcl-cl-unicode-base")
833 (version (string-append "0.1.5-" revision "." (string-take commit 7)))
837 (url "https://github.com/edicl/cl-unicode.git")
839 (file-name (string-append "cl-unicode-" version "-checkout"))
842 "1jicprb5b3bv57dy1kg03572gxkcaqdjhak00426s76g0plmx5ki"))))
843 (build-system asdf-build-system/sbcl)
845 '(#:asd-file "cl-unicode.asd"
846 #:asd-system-name "cl-unicode/base"))
848 `(("cl-ppcre" ,sbcl-cl-ppcre)))
849 (home-page "http://weitz.de/cl-unicode/")
850 (synopsis "Portable Unicode library for Common Lisp")
851 (description "CL-UNICODE is a portable Unicode library Common Lisp, which
852 is compatible with perl. It is pretty fast, thread-safe, and compatible with
853 ANSI-compliant Common Lisp implementations.")
854 (license license:bsd-2))))
856 (define-public sbcl-cl-unicode
858 (inherit sbcl-cl-unicode-base)
859 (name "sbcl-cl-unicode")
861 `(("cl-unicode/base" ,sbcl-cl-unicode-base)
862 ,@(package-inputs sbcl-cl-unicode-base)))
864 `(("flexi-streams" ,sbcl-flexi-streams)))
867 (define-public ecl-cl-unicode
868 (sbcl-package->ecl-package sbcl-cl-unicode))
870 (define-public cl-unicode
871 (sbcl-package->cl-source-package sbcl-cl-unicode))
873 (define-public sbcl-clx
875 (commit "1c62774b03c1cf3fe6e5cb532df8b14b44c96b95"))
878 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
884 (url "https://github.com/sharplispers/clx.git")
887 (base32 "0qffag03ns52kwq9xjns2qg1yr0bf3ba507iwq5cmx5xz0b0rmjm"))
888 (file-name (string-append "clx-" version "-checkout"))
891 (search-patch "clx-remove-demo.patch")))
892 (modules '((guix build utils)))
895 ;; These removed files cause the compiled system to crash when
897 (delete-file-recursively "demo")
898 (delete-file "test/trapezoid.lisp")
899 (substitute* "clx.asd"
900 (("\\(:file \"trapezoid\"\\)") ""))))))
901 (build-system asdf-build-system/sbcl)
902 (home-page "http://www.cliki.net/portable-clx")
903 (synopsis "X11 client library for Common Lisp")
904 (description "CLX is an X11 client library for Common Lisp. The code was
905 originally taken from a CMUCL distribution, was modified somewhat in order to
906 make it compile and run under SBCL, then a selection of patches were added
907 from other CLXes around the net.")
908 (license license:x11))))
910 (define-public cl-clx
911 (sbcl-package->cl-source-package sbcl-clx))
913 (define-public ecl-clx
914 (sbcl-package->ecl-package sbcl-clx))
916 (define-public sbcl-cl-ppcre-unicode
917 (package (inherit sbcl-cl-ppcre)
918 (name "sbcl-cl-ppcre-unicode")
920 `(#:tests? #f ; tests fail with "Component :CL-PPCRE-TEST not found"
921 #:asd-file "cl-ppcre-unicode.asd"))
923 `(("sbcl-cl-ppcre" ,sbcl-cl-ppcre)
924 ("sbcl-cl-unicode" ,sbcl-cl-unicode)))))
926 (define-public sbcl-stumpwm
928 (name "sbcl-stumpwm")
933 "https://github.com/stumpwm/stumpwm/archive/"
936 (base32 "1maxp98gh64az3d9vz9br6zdd6rc9fmj2imvax4by85g6kxvdz1i"))
937 (file-name (string-append "stumpwm-" version ".tar.gz"))))
938 (build-system asdf-build-system/sbcl)
939 (inputs `(("cl-ppcre" ,sbcl-cl-ppcre)
941 (outputs '("out" "lib"))
944 (modify-phases %standard-phases
945 (add-after 'create-symlinks 'build-program
946 (lambda* (#:key outputs #:allow-other-keys)
948 (string-append (assoc-ref outputs "out") "/bin/stumpwm")
950 #:entry-program '((stumpwm:stumpwm) 0))))
951 (add-after 'build-program 'create-desktop-file
952 (lambda* (#:key outputs #:allow-other-keys)
953 (let* ((out (assoc-ref outputs "out"))
954 (xsessions (string-append out "/share/xsessions")))
956 (call-with-output-file
957 (string-append xsessions "/stumpwm.desktop")
962 Comment=The Stump Window Manager~@
963 Exec=~a/bin/stumpwm~@
964 TryExec=~@*~a/bin/stumpwm~@
969 (synopsis "Window manager written in Common Lisp")
970 (description "Stumpwm is a window manager written entirely in Common Lisp.
971 It attempts to be highly customizable while relying entirely on the keyboard
972 for input. These design decisions reflect the growing popularity of
973 productive, customizable lisp based systems.")
974 (home-page "https://github.com/stumpwm/stumpwm")
975 (license license:gpl2+)
976 (properties `((ecl-variant . ,(delay ecl-stumpwm))))))
978 (define-public cl-stumpwm
979 (sbcl-package->cl-source-package sbcl-stumpwm))
981 (define-public ecl-stumpwm
982 (let ((base (sbcl-package->ecl-package sbcl-stumpwm)))
988 ;; The slynk that users expect to install includes all of slynk's contrib
989 ;; modules. Therefore, we build the base module and all contribs first; then
990 ;; we expose the union of these as `sbcl-slynk'. The following variable
991 ;; describes the base module.
992 (define sbcl-slynk-boot0
994 (commit "5706cd45d484a4f25795abe8e643509d31968aa2"))
996 (name "sbcl-slynk-boot0")
997 (version (string-append "1.0.0-beta-" revision "." (string-take commit 7)))
1003 (url "https://github.com/joaotavora/sly.git")
1006 (base32 "0h4gg3sndl2bf6jdnx9nrf14p9hhi43hagrl0f4v4l11hczl8w81"))
1007 (file-name (string-append "slynk-" version "-checkout"))
1008 (modules '((guix build utils)
1012 ;; Move the contribs into the main source directory for easier
1014 (substitute* "slynk/slynk.asd"
1017 (("\\(defsystem :slynk-util")
1018 "(defsystem :slynk-util :depends-on (:slynk)"))
1019 (substitute* "contrib/slynk-trace-dialog.lisp"
1020 (("\\(slynk::reset-inspector\\)") ; Causes problems on load
1022 (substitute* "contrib/slynk-profiler.lisp"
1024 "slynk-pprint-to-line"))
1025 (rename-file "contrib" "slynk/contrib")
1026 ;; Move slynk's contents into the base directory for easier
1030 (unless (string-prefix? "." file)
1031 (rename-file (string-append "slynk/" file)
1032 (string-append "./" (basename file)))))
1033 (scandir "slynk"))))))
1034 (build-system asdf-build-system/sbcl)
1036 `(#:tests? #f ; No test suite
1037 #:asd-system-name "slynk"))
1038 (synopsis "Common Lisp IDE for Emacs")
1039 (description "SLY is a fork of SLIME, an IDE backend for Common Lisp.
1040 It also features a completely redesigned REPL based on Emacs's own
1041 full-featured comint.el, live code annotations, and a consistent interactive
1042 button interface. Everything can be copied to the REPL. One can create
1043 multiple inspectors with independent history.")
1044 (home-page "https://github.com/joaotavora/sly")
1045 (license license:public-domain)
1046 (properties `((cl-source-variant . ,(delay cl-slynk)))))))
1048 (define-public cl-slynk
1050 (inherit (sbcl-package->cl-source-package sbcl-slynk-boot0))
1053 (define ecl-slynk-boot0
1054 (sbcl-package->ecl-package sbcl-slynk-boot0))
1056 (define sbcl-slynk-arglists
1058 (inherit sbcl-slynk-boot0)
1059 (name "sbcl-slynk-arglists")
1060 (inputs `(("slynk" ,sbcl-slynk-boot0)))
1062 (substitute-keyword-arguments (package-arguments sbcl-slynk-boot0)
1063 ((#:asd-file _ "") "slynk.asd")
1064 ((#:asd-system-name _ #f) #f)))))
1066 (define ecl-slynk-arglists
1067 (sbcl-package->ecl-package sbcl-slynk-arglists))
1069 (define sbcl-slynk-util
1071 (inherit sbcl-slynk-arglists)
1072 (name "sbcl-slynk-util")))
1074 (define ecl-slynk-util
1075 (sbcl-package->ecl-package sbcl-slynk-util))
1077 (define sbcl-slynk-fancy-inspector
1079 (inherit sbcl-slynk-arglists)
1080 (name "sbcl-slynk-fancy-inspector")
1081 (inputs `(("slynk-util" ,sbcl-slynk-util)
1082 ,@(package-inputs sbcl-slynk-arglists)))))
1084 (define ecl-slynk-fancy-inspector
1085 (sbcl-package->ecl-package sbcl-slynk-fancy-inspector))
1087 (define sbcl-slynk-package-fu
1089 (inherit sbcl-slynk-arglists)
1090 (name "sbcl-slynk-package-fu")))
1092 (define ecl-slynk-package-fu
1093 (sbcl-package->ecl-package sbcl-slynk-package-fu))
1095 (define sbcl-slynk-mrepl
1097 (inherit sbcl-slynk-arglists)
1098 (name "sbcl-slynk-mrepl")))
1100 (define ecl-slynk-mrepl
1101 (sbcl-package->ecl-package sbcl-slynk-mrepl))
1103 (define sbcl-slynk-trace-dialog
1105 (inherit sbcl-slynk-arglists)
1106 (name "sbcl-slynk-trace-dialog")))
1108 (define ecl-slynk-trace-dialog
1109 (sbcl-package->ecl-package sbcl-slynk-trace-dialog))
1111 (define sbcl-slynk-profiler
1113 (inherit sbcl-slynk-arglists)
1114 (name "sbcl-slynk-profiler")))
1116 (define ecl-slynk-profiler
1117 (sbcl-package->ecl-package sbcl-slynk-profiler))
1119 (define sbcl-slynk-stickers
1121 (inherit sbcl-slynk-arglists)
1122 (name "sbcl-slynk-stickers")))
1124 (define ecl-slynk-stickers
1125 (sbcl-package->ecl-package sbcl-slynk-stickers))
1127 (define sbcl-slynk-indentation
1129 (inherit sbcl-slynk-arglists)
1130 (name "sbcl-slynk-indentation")))
1132 (define ecl-slynk-indentation
1133 (sbcl-package->ecl-package sbcl-slynk-indentation))
1135 (define sbcl-slynk-retro
1137 (inherit sbcl-slynk-arglists)
1138 (name "sbcl-slynk-retro")))
1140 (define ecl-slynk-retro
1141 (sbcl-package->ecl-package sbcl-slynk-retro))
1143 (define slynk-systems
1147 "slynk-fancy-inspector"
1151 "slynk-trace-dialog"
1156 (define-public sbcl-slynk
1158 (inherit sbcl-slynk-boot0)
1161 `(("slynk" ,sbcl-slynk-boot0)
1162 ("slynk-util" ,sbcl-slynk-util)
1163 ("slynk-arglists" ,sbcl-slynk-arglists)
1164 ("slynk-fancy-inspector" ,sbcl-slynk-fancy-inspector)
1165 ("slynk-package-fu" ,sbcl-slynk-package-fu)
1166 ("slynk-mrepl" ,sbcl-slynk-mrepl)
1167 ("slynk-profiler" ,sbcl-slynk-profiler)
1168 ("slynk-trace-dialog" ,sbcl-slynk-trace-dialog)
1169 ("slynk-stickers" ,sbcl-slynk-stickers)
1170 ("slynk-indentation" ,sbcl-slynk-indentation)
1171 ("slynk-retro" ,sbcl-slynk-retro)))
1172 (native-inputs `(("sbcl" ,sbcl)))
1173 (build-system trivial-build-system)
1175 (outputs '("out" "image"))
1177 `(#:modules ((guix build union)
1179 (guix build lisp-utils))
1182 (use-modules (ice-9 match)
1185 (guix build lisp-utils))
1188 (assoc-ref %outputs "out")
1192 (if (string-prefix? "slynk" name) path #f)))
1195 (prepend-to-source-registry
1196 (string-append (assoc-ref %outputs "out") "//"))
1198 (parameterize ((%lisp-type "sbcl")
1199 (%lisp (string-append (assoc-ref %build-inputs "sbcl")
1201 (build-image (string-append
1202 (assoc-ref %outputs "image")
1205 #:dependencies ',slynk-systems)))))))
1207 (define-public ecl-slynk
1209 (inherit sbcl-slynk)
1214 (list name (sbcl-package->ecl-package pkg))))
1215 (package-inputs sbcl-slynk)))
1219 '(#:modules ((guix build union))
1222 (use-modules (ice-9 match)
1224 (match %build-inputs
1225 (((names . paths) ...)
1226 (union-build (assoc-ref %outputs "out")
1229 (define-public sbcl-stumpwm+slynk
1231 (inherit sbcl-stumpwm)
1232 (name "sbcl-stumpwm-with-slynk")
1235 `(("stumpwm" ,sbcl-stumpwm "lib")
1236 ("slynk" ,sbcl-slynk)))
1238 (substitute-keyword-arguments (package-arguments sbcl-stumpwm)
1240 `(modify-phases ,phases
1241 (replace 'build-program
1242 (lambda* (#:key inputs outputs #:allow-other-keys)
1243 (let* ((out (assoc-ref outputs "out"))
1244 (program (string-append out "/bin/stumpwm")))
1245 (build-program program outputs
1246 #:entry-program '((stumpwm:stumpwm) 0)
1247 #:dependencies '("stumpwm"
1249 #:dependency-prefixes
1250 (map (lambda (input) (assoc-ref inputs input))
1251 '("stumpwm" "slynk")))
1252 ;; Remove unneeded file.
1253 (delete-file (string-append out "/bin/stumpwm-exec.fasl"))
1255 (delete 'copy-source)
1258 (delete 'create-asd-file)
1260 (delete 'create-symlinks)))))))
1262 (define-public sbcl-parse-js
1263 (let ((commit "fbadc6029bec7039602abfc06c73bb52970998f6")
1266 (name "sbcl-parse-js")
1267 (version (string-append "0.0.0-" revision "." (string-take commit 9)))
1272 (url "http://marijn.haverbeke.nl/git/parse-js")
1274 (file-name (string-append name "-" commit "-checkout"))
1277 "1wddrnr5kiya5s3gp4cdq6crbfy9fqcz7fr44p81502sj3bvdv39"))))
1278 (build-system asdf-build-system/sbcl)
1279 (home-page "http://marijnhaverbeke.nl/parse-js/")
1280 (synopsis "Parse JavaScript")
1281 (description "Parse-js is a Common Lisp package for parsing
1282 JavaScript (ECMAScript 3). It has basic support for ECMAScript 5.")
1283 (license license:zlib))))
1285 (define-public sbcl-parse-number
1287 (name "sbcl-parse-number")
1292 (uri (string-append "https://github.com/sharplispers/parse-number/"
1293 "archive/v" version ".tar.gz"))
1294 (file-name (string-append name "-" version ".tar.gz"))
1297 "1k6s4v65ksc1j5i0dprvzfvj213v6nah7i0rgd0726ngfjisj9ir"))))
1298 (build-system asdf-build-system/sbcl)
1299 (home-page "http://www.cliki.net/PARSE-NUMBER")
1300 (synopsis "Parse numbers")
1301 (description "@code{parse-number} is a library of functions for parsing
1302 strings into one of the standard Common Lisp number types without using the
1303 reader. @code{parse-number} accepts an arbitrary string and attempts to parse
1304 the string into one of the standard Common Lisp number types, if possible, or
1305 else @code{parse-number} signals an error of type @code{invalid-number}.")
1306 (license license:bsd-3)))
1308 (define-public sbcl-iterate
1310 (name "sbcl-iterate")
1311 ;; The latest official release (1.4.3) fails to build so we have to take
1312 ;; the current darcs tarball from quicklisp.
1313 (version "20160825")
1317 (uri (string-append "http://beta.quicklisp.org/archive/iterate/"
1318 "2016-08-25/iterate-"
1319 version "-darcs.tgz"))
1322 "0kvz16gnxnkdz0fy1x8y5yr28nfm7i2qpvix7mgwccdpjmsb4pgm"))))
1323 (build-system asdf-build-system/sbcl)
1324 (home-page "https://common-lisp.net/project/iterate/")
1325 (synopsis "Iteration construct for Common Lisp")
1326 (description "@code{iterate} is an iteration construct for Common Lisp.
1327 It is similar to the @code{CL:LOOP} macro, with these distinguishing marks:
1330 @item it is extensible,
1331 @item it helps editors like Emacs indent iterate forms by having a more
1332 lisp-like syntax, and
1333 @item it isn't part of the ANSI standard for Common Lisp.
1335 (license license:expat)))
1337 (define-public sbcl-cl-uglify-js
1338 ;; There have been many bug fixes since the 2010 release.
1339 (let ((commit "429c5e1d844e2f96b44db8fccc92d6e8e28afdd5")
1342 (name "sbcl-cl-uglify-js")
1343 (version (string-append "0.1-" revision "." (string-take commit 9)))
1348 (url "https://github.com/mishoo/cl-uglify-js.git")
1352 "0k39y3c93jgxpr7gwz7w0d8yknn1fdnxrjhd03057lvk5w8js27a"))))
1353 (build-system asdf-build-system/sbcl)
1355 `(("sbcl-parse-js" ,sbcl-parse-js)
1356 ("sbcl-cl-ppcre" ,sbcl-cl-ppcre)
1357 ("sbcl-cl-ppcre-unicode" ,sbcl-cl-ppcre-unicode)
1358 ("sbcl-parse-number" ,sbcl-parse-number)
1359 ("sbcl-iterate" ,sbcl-iterate)))
1360 (home-page "https://github.com/mishoo/cl-uglify-js")
1361 (synopsis "JavaScript compressor library for Common Lisp")
1362 (description "This is a Common Lisp version of UglifyJS, a JavaScript
1363 compressor. It works on data produced by @code{parse-js} to generate a
1364 @dfn{minified} version of the code. Currently it can:
1367 @item reduce variable names (usually to single letters)
1368 @item join consecutive @code{var} statements
1369 @item resolve simple binary expressions
1370 @item group most consecutive statements using the ``sequence'' operator (comma)
1371 @item remove unnecessary blocks
1372 @item convert @code{IF} expressions in various ways that result in smaller code
1373 @item remove some unreachable code
1375 (license license:zlib))))
1377 (define-public uglify-js
1379 (inherit sbcl-cl-uglify-js)
1381 (build-system trivial-build-system)
1383 `(#:modules ((guix build utils))
1385 (let* ((bin (string-append (assoc-ref %outputs "out") "/bin/"))
1386 (script (string-append bin "uglify-js")))
1387 (use-modules (guix build utils))
1389 (with-output-to-file script
1391 (format #t "#!~a/bin/sbcl --script
1393 (push (truename \"~a/lib/sbcl\") asdf:*central-registry*)"
1394 (assoc-ref %build-inputs "sbcl")
1395 (assoc-ref %build-inputs "sbcl-cl-uglify-js"))
1396 ;; FIXME: cannot use progn here because otherwise it fails to
1397 ;; find cl-uglify-js.
1401 (let ((*standard-output* (make-broadcast-stream))
1402 (*error-output* (make-broadcast-stream)))
1403 (asdf:load-system :cl-uglify-js))
1404 (let ((file (cadr *posix-argv*)))
1407 (cl-uglify-js:ast-gen-code
1408 (cl-uglify-js:ast-mangle
1409 (cl-uglify-js:ast-squeeze
1410 (with-open-file (in file)
1411 (parse-js:parse-js in))))
1414 (format *error-output*
1415 "Please provide a JavaScript file.~%")
1416 (sb-ext:exit :code 1))))))))
1417 (chmod script #o755)
1421 ("sbcl-cl-uglify-js" ,sbcl-cl-uglify-js)))
1422 (synopsis "JavaScript compressor")))