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