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