gnu: sbcl: Update to 2.1.5.
[jackhill/guix/guix.git] / gnu / packages / lisp.scm
index 78f790c..55da4b0 100644 (file)
@@ -7,15 +7,17 @@
 ;;; Copyright © 2016, 2017 Andy Patterson <ajpatter@uwaterloo.ca>
 ;;; Copyright © 2017, 2019 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
-;;; Copyright © 2017, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2017, 2019–2021 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Benjamin Slade <slade@jnanam.net>
 ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
 ;;; Copyright © 2018, 2019, 2020 Pierre Neidhardt <mail@ambrevar.xyz>
 ;;; Copyright © 2018, 2019 Pierre Langlois <pierre.langlois@gmx.com>
 ;;; Copyright © 2019, 2020 Katherine Cox-Buday <cox.katherine.e@gmail.com>
 ;;; Copyright © 2019 Jesse Gildersleve <jessejohngildersleve@protonmail.com>
-;;; Copyright © 2019, 2020 Guillaume Le Vaillant <glv@posteo.net>
+;;; Copyright © 2019, 2020, 2021 Guillaume Le Vaillant <glv@posteo.net>
 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com>
+;;; Copyright © 2021 Sharlatan Hellseher <sharlatanus@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -90,6 +92,9 @@
        (sha256
         (base32 "1hpx30f6yrak15nw992k7x3pn75ahvjs04n4f134k68mhgs62km2"))))
     (build-system trivial-build-system)
+    (native-inputs
+     `(("config-patch" ,@(search-patches "cl-asdf-config-directories.patch"))
+       ("patch" ,patch)))
     (arguments
      `(#:modules ((guix build utils)
                   (guix build lisp-utils))
                 (asdf-install (string-append out %source-install-prefix
                                              "/source/asdf/"))
                 (src-asdf (string-append (assoc-ref %build-inputs "source")))
-                (dst-asdf (string-append asdf-install "asdf.lisp")))
+                (dst-asdf (string-append asdf-install "asdf.lisp"))
+                (patch (string-append (assoc-ref %build-inputs "patch")
+                                      "/bin/patch"))
+                (config-patch (assoc-ref %build-inputs "config-patch")))
            (mkdir-p asdf-install)
            (copy-file src-asdf dst-asdf)
-           ;; Patch ASDF to make it read the configuration files in all
-           ;; the direcories listed in '$XDG_CONFIG_DIRS' instead of just
-           ;; the first.
-           (substitute* dst-asdf
-             (("\\(xdg-config-pathname \\*source-registry-directory\\* direction\\)")
-              "`(:source-registry
-                 ,@(loop
-                      for dir in (xdg-config-dirs
-                                  \"common-lisp/source-registry.conf.d/\")
-                      collect `(:include ,dir))
-                 :inherit-configuration)")
-             (("\\(xdg-config-pathname \\*output-translations-directory\\* direction\\)")
-              "`(:output-translations
-                 ,@(loop
-                      for dir in (xdg-config-dirs
-                                  \"common-lisp/asdf-output-translations.conf.d/\")
-                      collect `(:include ,dir))
-                 :inherit-configuration)")))
-         #t)))
+           (invoke patch "-p1" "-i" config-patch dst-asdf)))))
     (home-page "https://common-lisp.net/project/asdf/")
     (synopsis "Another System Definition Facility")
     (description
@@ -231,7 +221,7 @@ interface to the Tk widget system.")
 (define-public ecl
   (package
     (name "ecl")
-    (version "20.4.24")
+    (version "21.2.1")
     (source
      (origin
        (method url-fetch)
@@ -239,14 +229,20 @@ interface to the Tk widget system.")
              "https://common-lisp.net/project/ecl/static/files/release/"
              name "-" version ".tgz"))
        (sha256
-        (base32 "01qgdmr54wkj854f69qdm9sybrvd6gd21dpx4askdaaqybnkh237"))))
+        (base32 "000906nnq25177bgsfndiw3iqqgrjc9spk10hzk653sbz3f7anmi"))))
     (build-system gnu-build-system)
     ;; src/configure uses 'which' to confirm the existence of 'gzip'.
     (native-inputs
      `(("cl-asdf" ,cl-asdf)
        ("which" ,which)
        ("texinfo" ,texinfo)))
-    (inputs
+    ;; When ECL is embedded in a program that wants to use Common Lisp as an
+    ;; extension language, libgmp, libatomic-ops, libgc and libffi must be
+    ;; present when compiling the program because they are required by ECL's
+    ;; header file.
+    ;; Therefore we put these libraries in 'propagated-inputs' instead
+    ;; of 'inputs'.
+    (propagated-inputs
      `(("gmp" ,gmp)
        ("libatomic-ops" ,libatomic-ops)
        ("libgc" ,libgc)
@@ -262,16 +258,20 @@ interface to the Tk widget system.")
          (delete 'check)
          (add-after 'unpack 'replace-asdf
            ;; Use system ASDF instead of bundled one.
-           (lambda* (#:key inputs outputs #:allow-other-keys)
+           (lambda* (#:key inputs #:allow-other-keys)
              (let* ((cl-asdf (assoc-ref inputs "cl-asdf"))
                     (guix-asdf (string-append
                                 cl-asdf
                                 "/share/common-lisp/source/asdf/asdf.lisp"))
-                    (out (string-append (assoc-ref outputs "out")))
                     (contrib-asdf "contrib/asdf/asdf.lisp"))
                (copy-file guix-asdf contrib-asdf))
              #t))
-         (add-after 'install 'wrap
+         (add-after 'install 'remove-build-stamp
+           (lambda* (#:key outputs #:allow-other-keys)
+             (delete-file (string-append (assoc-ref outputs "out")
+                                         "/lib/ecl-" ,version "/build-stamp"))
+             #t))
+         (add-after 'remove-build-stamp 'wrap
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let* ((ecl (assoc-ref outputs "out"))
                     (input-path (lambda (lib path)
@@ -293,7 +293,8 @@ interface to the Tk widget system.")
                            (input-path lib "/include"))
                          `("kernel-headers" ,@libraries)))
                  `("LIBRARY_PATH" suffix ,library-directories)
-                 `("LD_LIBRARY_PATH" suffix ,library-directories)))))
+                 `("LD_LIBRARY_PATH" suffix ,library-directories))
+               #t)))
          (add-after 'wrap 'check (assoc-ref %standard-phases 'check))
          (add-before 'check 'fix-path-to-ecl
            (lambda _
@@ -334,6 +335,8 @@ supporting ASDF, Sockets, Gray streams, MOP, and other useful components.")
        (sha256
         (base32 "0k2dmgl0miz3767iks4p0mvp6xw0ysyxhjpklyh11j010rmh6hqb"))))
     (build-system gnu-build-system)
+    (native-inputs
+     `(("cl-asdf" ,cl-asdf)))
     (inputs `(("libffcall" ,libffcall)
               ("ncurses" ,ncurses)
               ("readline" ,readline)
@@ -368,7 +371,24 @@ supporting ASDF, Sockets, Gray streams, MOP, and other useful components.")
                (("/bin/sh") "sh"))
              (substitute* '("src/clisp-link.in")
                (("/bin/pwd") "pwd"))
-             #t)))))
+             #t))
+         (add-after 'unpack 'replace-asdf
+           ;; Use system ASDF instead of bundled one.
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let* ((cl-asdf (assoc-ref inputs "cl-asdf"))
+                    (guix-asdf (string-append
+                                cl-asdf
+                                "/share/common-lisp/source/asdf/asdf.lisp"))
+                    (contrib-asdf "modules/asdf/asdf.lisp"))
+               (delete-file contrib-asdf)
+               (copy-file guix-asdf contrib-asdf)))))))
+    (native-search-paths
+     (list (search-path-specification
+            (variable "XDG_DATA_DIRS")
+            (files '("share")))
+           (search-path-specification
+            (variable "XDG_CONFIG_DIRS")
+            (files '("etc")))))
     (home-page "https://clisp.sourceforge.io/")
     (synopsis "A Common Lisp implementation")
     (description
@@ -380,14 +400,14 @@ an interpreter, a compiler, a debugger, and much more.")
 (define-public sbcl
   (package
     (name "sbcl")
-    (version "2.0.11")
+    (version "2.1.5")
     (source
      (origin
        (method url-fetch)
        (uri (string-append "mirror://sourceforge/sbcl/sbcl/" version "/sbcl-"
                            version "-source.tar.bz2"))
        (sha256
-        (base32 "07cpswxh2f38b440xdn3fjk7b4r0ipj3sbwb3jd134phrr9smll7"))))
+        (base32 "1id8r2y8hiz34lmvszikdqgrmr778jshim0fibb915assvn0fn4n"))))
     (build-system gnu-build-system)
     (outputs '("out" "doc"))
     (native-inputs
@@ -438,12 +458,11 @@ an interpreter, a compiler, a debugger, and much more.")
            ;; of ASDF we use to build software; therefore, replace the contrib
            ;; ASDF with the version packaged into Guix.
            ;; [1] - https://bugs.launchpad.net/sbcl/+bug/1823442
-           (lambda* (#:key inputs outputs #:allow-other-keys)
+           (lambda* (#:key inputs #:allow-other-keys)
              (let* ((cl-asdf (assoc-ref inputs "cl-asdf"))
                     (guix-asdf (string-append
                                 cl-asdf
                                 "/share/common-lisp/source/asdf/asdf.lisp"))
-                    (out (string-append (assoc-ref outputs "out")))
                     (contrib-asdf "contrib/asdf/asdf.lisp"))
                (copy-file guix-asdf contrib-asdf))
              #t))
@@ -579,7 +598,9 @@ statistical profiler, a code coverage tool, and many other extensions.")
   ;;     it, as is the case for SBCL, but I know of no attempt to do so."
   (package
     (name "ccl")
-    (version "1.12")
+    ;; XXX When updating this package, check whether we can simply append
+    ;; VERSION to the ccl-bootstrap URL again, instead of per architecture.
+    (version "1.12.1")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -588,7 +609,7 @@ statistical profiler, a code coverage tool, and many other extensions.")
               (file-name (git-file-name "ccl" version))
               (sha256
                (base32
-                "0kxr24d2fzsmpsilijpwwfl6g89y7fcrwb80kai5nx9pwgxmjbp3"))))
+                "1zz291lvsrr7pps8wfl2kdxsnzjngqi4v3mil14pga4r5zanmsi7"))))
     (build-system gnu-build-system)
     ;; CCL consists of a "lisp kernel" and "heap image", both of which are
     ;; shipped in precompiled form in source tarballs.  The former is a C
@@ -600,22 +621,23 @@ statistical profiler, a code coverage tool, and many other extensions.")
         ,(origin
            (method url-fetch)
            (uri (string-append
-                 "https://github.com/Clozure/ccl/releases/download/v" version "/"
+                 "https://github.com/Clozure/ccl/releases/download/v"
                  (match (%current-system)
-                   ("armhf-linux" "linuxarm")
+                   ("armhf-linux" "1.12/linuxarm")
                    ;; XXX: This source only works on x86, but provide it as a
                    ;; catch-all to prevent errors when querying this package
                    ;; on unsupported platforms.
-                   (_ "linuxx86"))
+                   (_ "1.12.1/linuxx86"))
                  ".tar.gz"))
            (sha256
             (base32
              (match (%current-system)
                ("armhf-linux"
                 "0x4bjx6cxsjvxyagijhlvmc7jkyxifdvz5q5zvz37028va65243c")
-               (_ "15l7cfa4a7jkfwdzsfm4q3n22jnb57imxahpql3h77xin57v1gbz"))))))))
+               (_ "0ll017ajcfsyx8f7zsy4394y8xxvz40iz0gcsmznp0n3mf0xi67c"))))))))
     (native-inputs
-     `(("m4" ,m4)))
+     `(("cl-asdf" ,cl-asdf)
+       ("m4" ,m4)))
     (arguments
      `(#:tests? #f                      ;no 'check' target
        #:modules ((ice-9 match)
@@ -627,6 +649,16 @@ statistical profiler, a code coverage tool, and many other extensions.")
          (add-after 'unpack 'unpack-image
            (lambda* (#:key inputs #:allow-other-keys)
              (invoke "tar" "xzvf" (assoc-ref inputs "ccl-bootstrap"))))
+         (add-after 'unpack 'replace-asdf
+           ;; Use system ASDF instead of bundled one.
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let* ((cl-asdf (assoc-ref inputs "cl-asdf"))
+                    (guix-asdf (string-append
+                                cl-asdf
+                                "/share/common-lisp/source/asdf/asdf.lisp"))
+                    (contrib-asdf "tools/asdf.lisp"))
+               (delete-file contrib-asdf)
+               (copy-file guix-asdf contrib-asdf))))
          (delete 'configure)
          (add-before 'build 'pre-build
            ;; Enter the source directory for the current platform's lisp
@@ -690,6 +722,13 @@ statistical profiler, a code coverage tool, and many other extensions.")
                      "exec -a \"$0\" " libdir kernel " \"$@\"\n"))))
                (chmod wrapper #o755))
              #t)))))
+    (native-search-paths
+     (list (search-path-specification
+            (variable "XDG_DATA_DIRS")
+            (files '("share")))
+           (search-path-specification
+            (variable "XDG_CONFIG_DIRS")
+            (files '("etc")))))
     (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))
     (home-page "https://ccl.clozure.com/")
     (synopsis "Common Lisp implementation")
@@ -810,7 +849,7 @@ enough to play the original mainframe Zork all the way through.")
 (define-public txr
   (package
     (name "txr")
-    (version "244")
+    (version "259")
     (source
      (origin
        (method git-fetch)
@@ -819,7 +858,7 @@ enough to play the original mainframe Zork all the way through.")
              (commit (string-append "txr-" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "1bzhb1pms6gjzphbsimhwdyq46ik1m7sgldigg5l1q7bppg9r3i0"))))
+        (base32 "1awg6l458pl2y340l0vja2j5q636vh2mx2mllxqydg36j89lfniz"))))
     (build-system gnu-build-system)
     (arguments
      `(#:configure-flags
@@ -1053,7 +1092,7 @@ assembler, PEG) is less than 1MB.")
 (define-public lisp-repl-core-dumper
   (package
     (name "lisp-repl-core-dumper")
-    (version "0.2.0")
+    (version "0.7.0")
     (source
      (origin
        (method git-fetch)
@@ -1062,7 +1101,7 @@ assembler, PEG) is less than 1MB.")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "0ghiqwl7bgzxfqg6hpmyqazr9mi0v5k9byqa3myg5462csvgb754"))))
+        (base32 "0yfsyxj462yi3bx587yssp4gwb54jdm6fjk9q93gjrfv8a65ilp7"))))
     (build-system copy-build-system)
     (arguments
      '(#:install-plan
@@ -1072,12 +1111,14 @@ assembler, PEG) is less than 1MB.")
          (add-before 'install 'fix-utils-path
            (lambda* (#:key inputs #:allow-other-keys)
              (let* ((coreutils (string-append (assoc-ref inputs "coreutils") "/bin/"))
+                    (cat (string-append coreutils "cat"))
                     (paste (string-append coreutils "paste"))
                     (sort (string-append coreutils "sort"))
                     (basename (string-append coreutils "basename"))
                     (sed (string-append (assoc-ref inputs "sed") "/bin/sed")))
                (substitute* "lisp-repl-core-dumper"
                  (("\\$\\(basename") (string-append "$(" basename))
+                 (("\\<cat\\>") cat)
                  (("\\<paste\\>") paste)
                  (("\\<sed\\>") sed)
                  (("\\<sort\\>") sort))))))))
@@ -1096,3 +1137,43 @@ and make for REPLs that start blazing fast.
 @item It allows you to include arbitrary libraries.
 @end itemize\n")
     (license license:gpl3+)))
+
+(define-public buildapp
+  (package
+    (name "buildapp")
+    (version "1.5.6")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/xach/buildapp")
+             (commit (string-append "release-" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "020ipjfqa3l8skd97cj5kq837wgpj28ygfxnkv64cnjrlbnzh161"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("sbcl" ,sbcl)))
+    (arguments
+     `(#:tests? #f
+       #:make-flags
+       (list (string-append "DESTDIR=" (assoc-ref %outputs "out")))
+       #:strip-binaries? #f
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (add-after 'unpack 'set-home
+           (lambda _
+             (setenv "HOME" "/tmp")
+             #t))
+         (add-before 'install 'create-target-directory
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((bin (string-append (assoc-ref outputs "out") "/bin")))
+               (mkdir-p bin)
+               #t))))))
+    (home-page "https://www.xach.com/lisp/buildapp/")
+    (synopsis "Makes easy to build application executables with SBCL")
+    (description
+     "Buildapp is an application for SBCL or CCL that configures and saves an
+executable Common Lisp image.  It is similar to cl-launch and hu.dwim.build. ")
+    (license license:bsd-2)))