gnu: cl-asdf: Improve priorities of configuration file search.
[jackhill/guix/guix.git] / gnu / packages / lisp.scm
index bc4fc6c..0038cb0 100644 (file)
@@ -3,18 +3,19 @@
 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2016 Federico Beffa <beffa@fbengineering.ch>
-;;; Copyright © 2016, 2017 ng0 <ng0@n0.is>
+;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
 ;;; 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 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2017, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Benjamin Slade <slade@jnanam.net>
 ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
-;;; Copyright © 2018, 2019 Pierre Neidhardt <mail@ambrevar.xyz>
+;;; 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 © 2020 Marius Bakke <mbakke@fastmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -43,6 +44,7 @@
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils)
+  #:use-module (guix build-system copy)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system ant)
   #:use-module (guix build-system asdf)
   #:use-module (gnu packages admin)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bdw-gc)
-  #:use-module (gnu packages bison)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages ed)
-  #:use-module (gnu packages flex)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages xorg)
   #:use-module (ice-9 match))
 
-(define (asdf-substitutions lisp)
-  ;; Prepend XDG_DATA_DIRS/LISP-bundle-systems to ASDF's
-  ;; 'default-system-source-registry'.
-  `((("\\(,dir \"systems/\"\\)\\)")
-     (format #f
-             "(,dir \"~a-bundle-systems\")))
-
-      ,@(loop :for dir :in (xdg-data-dirs \"common-lisp/\")
-              :collect `(:directory (,dir \"systems\"))"
-             ,lisp))))
-
 (define-public cl-asdf
   (package
     (name "cl-asdf")
-    (version "3.3.3")
+    (version "3.3.4")
     (source
      (origin
        (method url-fetch)
         (string-append "https://common-lisp.net/project/asdf/archives/asdf-"
                        version ".lisp"))
        (sha256
-        (base32 "18lr6kxvzhr79c9rx3sdricz30aby866fj0m24w27zxsqlyvn3rd"))))
+        (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))
          (let* ((out (string-append (assoc-ref %outputs "out")))
                 (asdf-install (string-append out %source-install-prefix
                                              "/source/asdf/"))
-                (asdf (string-append (assoc-ref %build-inputs "source"))))
+                (src-asdf (string-append (assoc-ref %build-inputs "source")))
+                (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 asdf (string-append asdf-install "asdf.lisp"))))))
+           (copy-file src-asdf dst-asdf)
+           (invoke patch "-p1" "-i" config-patch dst-asdf)))))
     (home-page "https://common-lisp.net/project/asdf/")
     (synopsis "Another System Definition Facility")
     (description
@@ -222,7 +219,7 @@ interface to the Tk widget system.")
 (define-public ecl
   (package
     (name "ecl")
-    (version "16.1.3")
+    (version "20.4.24")
     (source
      (origin
        (method url-fetch)
@@ -230,28 +227,38 @@ interface to the Tk widget system.")
              "https://common-lisp.net/project/ecl/static/files/release/"
              name "-" version ".tgz"))
        (sha256
-        (base32 "0m0j24w5d5a9dwwqyrg0d35c0nys16ijb4r0nyk87yp82v38b9bn"))
-       (modules '((guix build utils)))
-       (snippet
-        ;; Add ecl-bundle-systems to 'default-system-source-registry'.
-        `(begin
-           (substitute* "contrib/asdf/asdf.lisp"
-             ,@(asdf-substitutions name))
-           #t))))
+        (base32 "01qgdmr54wkj854f69qdm9sybrvd6gd21dpx4askdaaqybnkh237"))))
     (build-system gnu-build-system)
     ;; src/configure uses 'which' to confirm the existence of 'gzip'.
-    (native-inputs `(("which" ,which)))
-    (inputs `(("gmp" ,gmp)
-              ("libatomic-ops" ,libatomic-ops)
-              ("libgc" ,libgc)
-              ("libffi" ,libffi)))
+    (native-inputs
+     `(("cl-asdf" ,cl-asdf)
+       ("which" ,which)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("gmp" ,gmp)
+       ("libatomic-ops" ,libatomic-ops)
+       ("libgc" ,libgc)
+       ("libffi" ,libffi)))
     (arguments
-     '(#:configure-flags '("--without-rt")
+     `(#:configure-flags '("--without-rt")
+       ;; FIXME: As of version 20.4.24, we pass 17995 tests and fail 7.
+       ;; 2-3 tests may be due to FHS assumptions.
        #:tests? #t
        #:parallel-tests? #f
        #:phases
        (modify-phases %standard-phases
          (delete 'check)
+         (add-after 'unpack 'replace-asdf
+           ;; Use system ASDF instead of bundled one.
+           (lambda* (#:key inputs outputs #: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
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let* ((ecl (assoc-ref outputs "out"))
@@ -284,7 +291,10 @@ interface to the Tk widget system.")
     (native-search-paths
      (list (search-path-specification
             (variable "XDG_DATA_DIRS")
-            (files '("share")))))
+            (files '("share")))
+           (search-path-specification
+            (variable "XDG_CONFIG_DIRS")
+            (files '("etc")))))
     (home-page "http://ecls.sourceforge.net/")
     (synopsis "Embeddable Common Lisp")
     (description "ECL is an implementation of the Common Lisp language as
@@ -293,9 +303,10 @@ bytecode compiler and interpreter, being able to compile Common Lisp with any
 C/C++ compiler, being able to build standalone executables and libraries, and
 supporting ASDF, Sockets, Gray streams, MOP, and other useful components.")
     ;; Note that the file "Copyright" points to some files and directories
-    ;; which aren't under the lgpl2.0+ and instead contain many different,
+    ;; which aren't under the lgpl2.1+ and instead contain many different,
     ;; non-copyleft licenses.
-    (license license:lgpl2.0+)))
+    ;; See https://common-lisp.net/project/ecl/posts/ECL-license.html.
+    (license license:lgpl2.1+)))
 
 (define-public clisp
   (package
@@ -309,8 +320,7 @@ supporting ASDF, Sockets, Gray streams, MOP, and other useful components.")
              (commit "clisp-2.49.92-2018-02-18")))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "0k2dmgl0miz3767iks4p0mvp6xw0ysyxhjpklyh11j010rmh6hqb"))
-       (patches (search-patches "clisp-remove-failing-test.patch"))))
+        (base32 "0k2dmgl0miz3767iks4p0mvp6xw0ysyxhjpklyh11j010rmh6hqb"))))
     (build-system gnu-build-system)
     (inputs `(("libffcall" ,libffcall)
               ("ncurses" ,ncurses)
@@ -324,8 +334,11 @@ supporting ASDF, Sockets, Gray streams, MOP, and other useful components.")
                                  '())
                             "--with-dynamic-ffi"
                             "--with-dynamic-modules"
+                            "--with-ffcall"
+                            "--with-readline"
+                            "--with-sigsegv"
+                            "--with-module=asdf"
                             "--with-module=rawsock")
-       #:build #f
        #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'patch-sh-and-pwd
@@ -343,9 +356,7 @@ supporting ASDF, Sockets, Gray streams, MOP, and other useful components.")
                (("/bin/sh") "sh"))
              (substitute* '("src/clisp-link.in")
                (("/bin/pwd") "pwd"))
-             #t)))
-       ;; Makefiles seem to have race conditions.
-       #:parallel-build? #f))
+             #t)))))
     (home-page "https://clisp.sourceforge.io/")
     (synopsis "A Common Lisp implementation")
     (description
@@ -357,14 +368,14 @@ an interpreter, a compiler, a debugger, and much more.")
 (define-public sbcl
   (package
     (name "sbcl")
-    (version "2.0.0")
+    (version "2.0.11")
     (source
      (origin
        (method url-fetch)
        (uri (string-append "mirror://sourceforge/sbcl/sbcl/" version "/sbcl-"
                            version "-source.tar.bz2"))
        (sha256
-        (base32 "1krgd69cirp4ili2pfsh1a0mfvq722jbknlvmf17qhsxh1b94dlh"))))
+        (base32 "07cpswxh2f38b440xdn3fjk7b4r0ipj3sbwb3jd134phrr9smll7"))))
     (build-system gnu-build-system)
     (outputs '("out" "doc"))
     (native-inputs
@@ -382,12 +393,13 @@ an interpreter, a compiler, a debugger, and much more.")
      ;;     ABCL and ECL (as well as CCL, CMUCL, CLISP and SBCL itself)
      ;;
      ;; CCL is not bootstrappable so it won't do.  CLISP 2.49 seems to work.
-     ;; ECL too.  ECL builds SBCL about 20% slower than CLISP.  As of
-     ;; 2019-09-05, ECL was last updated in 2016 while CLISP was last updated
-     ;; in 2010.
+     ;; ECL too.  As of 2020-07-01, ECL was last updated in 2020 while CLISP
+     ;; was last updated in 2010, and both take about the same time to build SBCL.
      ;;
-     ;; For now we stick to CLISP for all systems.  We keep the `match' here to
-     ;; make it easier to change the host compiler for various architectures.
+     ;; For now we stick to CLISP for all systems.  We keep the `match' here
+     ;; to make it easier to change the host compiler for various
+     ;; architectures.  Consider switching to ECL if it gets faster than CLISP
+     ;; (maybe post 2020 release).
      `(,@(match (%current-system)
            ((or "x86_64-linux" "i686-linux")
             `(("clisp" ,clisp)))
@@ -421,9 +433,7 @@ an interpreter, a compiler, a debugger, and much more.")
                                 "/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)
-               (substitute* contrib-asdf
-                 ,@(asdf-substitutions name)))
+               (copy-file guix-asdf contrib-asdf))
              #t))
          (add-before 'build 'patch-unix-tool-paths
            (lambda* (#:key outputs inputs #:allow-other-keys)
@@ -486,6 +496,7 @@ an interpreter, a compiler, a debugger, and much more.")
                                          `("clisp")))
                      (string-append "--prefix="
                                     (assoc-ref outputs "out"))
+                     "--dynamic-space-size=3072"
                      "--with-sb-core-compression"
                      "--with-sb-xref-for-internals")))
          (replace 'install
@@ -529,7 +540,10 @@ an interpreter, a compiler, a debugger, and much more.")
     (native-search-paths
      (list (search-path-specification
             (variable "XDG_DATA_DIRS")
-            (files '("share")))))
+            (files '("share")))
+           (search-path-specification
+            (variable "XDG_CONFIG_DIRS")
+            (files '("etc")))))
     (home-page "http://www.sbcl.org/")
     (synopsis "Common Lisp implementation")
     (description "Steel Bank Common Lisp (SBCL) is a high performance Common
@@ -553,8 +567,16 @@ 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.11.5")
-    (source #f)
+    (version "1.12")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/Clozure/ccl/")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name "ccl" version))
+              (sha256
+               (base32
+                "0kxr24d2fzsmpsilijpwwfl6g89y7fcrwb80kai5nx9pwgxmjbp3"))))
     (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
@@ -562,59 +584,51 @@ statistical profiler, a code coverage tool, and many other extensions.")
     ;; generated without an already working copy of CCL, and is platform
     ;; dependent, so we need to fetch the correct tarball for the platform.
     (inputs
-     `(("ccl"
+     `(("ccl-bootstrap"
         ,(origin
            (method url-fetch)
            (uri (string-append
-                 "https://github.com/Clozure/ccl/releases/download/v" version
-                 "/ccl-" version "-"
+                 "https://github.com/Clozure/ccl/releases/download/v" version "/"
                  (match (%current-system)
-                   ((or "i686-linux" "x86_64-linux") "linuxx86")
                    ("armhf-linux" "linuxarm")
-                   ;; Prevent errors when querying this package on unsupported
-                   ;; platforms, e.g. when running "guix package --search="
-                   (_ "UNSUPPORTED"))
+                   ;; 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"))
                  ".tar.gz"))
            (sha256
             (base32
              (match (%current-system)
-               ((or "i686-linux" "x86_64-linux")
-                "0hs1f3z7crgzvinpj990kv9gvbsipxvcvwbmk54n51nasvc5025q")
                ("armhf-linux"
-                "0p0l1dzsygb6i1xxgbipjpxkn46xhq3jm41a34ga1qqp4x8lkr62")
-               (_ ""))))))))
+                "0x4bjx6cxsjvxyagijhlvmc7jkyxifdvz5q5zvz37028va65243c")
+               (_ "15l7cfa4a7jkfwdzsfm4q3n22jnb57imxahpql3h77xin57v1gbz"))))))))
     (native-inputs
-     `(("m4" ,m4)
-       ("subversion" ,subversion)))
+     `(("m4" ,m4)))
     (arguments
      `(#:tests? #f                      ;no 'check' target
-       #:modules ((srfi srfi-26)
+       #:modules ((ice-9 match)
+                  (srfi srfi-26)
                   (guix build utils)
                   (guix build gnu-build-system))
        #:phases
        (modify-phases %standard-phases
-         (replace 'unpack
+         (add-after 'unpack 'unpack-image
            (lambda* (#:key inputs #:allow-other-keys)
-             (invoke "tar" "xzvf" (assoc-ref inputs "ccl"))
-             (chdir "ccl")
-             #t))
+             (invoke "tar" "xzvf" (assoc-ref inputs "ccl-bootstrap"))))
          (delete 'configure)
          (add-before 'build 'pre-build
            ;; Enter the source directory for the current platform's lisp
            ;; kernel, and run 'make clean' to remove the precompiled one.
-           (lambda _
+           (lambda* (#:key system #:allow-other-keys)
              (substitute* "lisp-kernel/m4macros.m4"
                (("/bin/pwd") (which "pwd")))
              (chdir (string-append
                      "lisp-kernel/"
-                     ,(match (or (%current-target-system) (%current-system))
-                        ("i686-linux"   "linuxx8632")
-                        ("x86_64-linux" "linuxx8664")
-                        ("armhf-linux"  "linuxarm")
-                        ;; Prevent errors when querying this package
-                        ;; on unsupported platforms, e.g. when running
-                        ;; "guix package --search="
-                        (_              "UNSUPPORTED"))))
+                     (match system
+                       ("i686-linux" "linuxx8632")
+                       ("x86_64-linux" "linuxx8664")
+                       ("armhf-linux" "linuxarm")
+                       (_ (string-append "unknown system: " system)))))
              (substitute* '("Makefile")
                (("/bin/rm") "rm"))
              (setenv "CC" "gcc")
@@ -622,7 +636,7 @@ statistical profiler, a code coverage tool, and many other extensions.")
          ;; XXX Do we need to recompile the heap image as well for Guix?
          ;; For now just use the one we already got in the tarball.
          (replace 'install
-           (lambda* (#:key outputs inputs #:allow-other-keys)
+           (lambda* (#:key outputs inputs system #:allow-other-keys)
              ;; The lisp kernel built by running 'make' in lisp-kernel/$system
              ;; is put back into the original directory, so go back.  The heap
              ;; image is there as well.
@@ -633,25 +647,23 @@ statistical profiler, a code coverage tool, and many other extensions.")
                     (wrapper (string-append bindir "ccl"))
                     (bash (assoc-ref inputs "bash"))
                     (kernel
-                     ,(match (or (%current-target-system) (%current-system))
-                        ("i686-linux"   "lx86cl")
-                        ("x86_64-linux" "lx86cl64")
-                        ("armhf-linux"  "armcl")
-                        ;; Prevent errors when querying this package
-                        ;; on unsupported platforms, e.g. when running
-                        ;; "guix package --search="
-                        (_              "UNSUPPORTED")))
+                     (match system
+                       ("i686-linux" "lx86cl")
+                       ("x86_64-linux" "lx86cl64")
+                       ("armhf-linux" "armcl")
+                       ;; Unlikely to work, but try it anyway...
+                       (_ system)))
                     (heap (string-append kernel ".image")))
                (install-file kernel libdir)
                (install-file heap libdir)
 
-               (let ((dirs '("lib" "library" "examples" "tools" "objc-bridge"
-                             ,@(match (%current-system)
-                                ("x86_64-linux"
-                                 '("x86-headers64"))
-                                ("i686-linux"
-                                 '("x86-headers"))
-                                (_ '())))))
+               (let ((dirs `("lib" "library" "examples" "tools" "objc-bridge"
+                             ,@(match system
+                                 ("x86_64-linux"
+                                  '("x86-headers64"))
+                                 ("i686-linux"
+                                  '("x86-headers"))
+                                 (_ '())))))
                  (for-each copy-recursively
                            dirs
                            (map (cut string-append libdir <>) dirs)))
@@ -673,10 +685,7 @@ statistical profiler, a code coverage tool, and many other extensions.")
 implementation featuring fast compilation speed, native threads, a precise,
 generational, compacting garbage collector, and a convenient foreign-function
 interface.")
-    ;; See file doc/LICENSE for clarifications it makes regarding how the LGPL
-    ;; applies to Lisp code according to them.
-    (license (list license:lgpl2.1
-                   license:clarified-artistic)))) ;TRIVIAL-LDAP package
+    (license license:asl2.0)))
 
 (define-public lush2
   (package
@@ -789,7 +798,7 @@ enough to play the original mainframe Zork all the way through.")
 (define-public txr
   (package
     (name "txr")
-    (version "230")
+    (version "244")
     (source
      (origin
        (method git-fetch)
@@ -797,27 +806,29 @@ enough to play the original mainframe Zork all the way through.")
              (url "http://www.kylheku.com/git/txr/")
              (commit (string-append "txr-" version))))
        (file-name (git-file-name name version))
-       (patches (search-patches "txr-shell.patch"))
        (sha256
-        (base32
-         "1ma6nbqsnl4f8ndh47zzc8n5vzcny66v0z3ndddgm3g0bqaxzjzm"))))
+        (base32 "1bzhb1pms6gjzphbsimhwdyq46ik1m7sgldigg5l1q7bppg9r3i0"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:configure-flags '("cc=gcc")
-       #:phases (modify-phases %standard-phases
-                  (add-after 'configure 'fix-tests
-                    (lambda _
-                      (substitute* "tests/017/realpath.tl"
-                        (("/usr/bin") "/"))
-                      (substitute* "tests/017/realpath.expected"
-                        (("/usr/bin") "/"))
-                      #t))
-                  (replace 'check
-                    (lambda _
-                      (invoke "make" "tests"))))))
-    (native-inputs
-     `(("bison" ,bison)
-       ("flex" ,flex)))
+     `(#:configure-flags
+       (list ,(string-append "cc=" (cc-for-target))
+             (string-append "--prefix=" (assoc-ref %outputs "out")))
+       #:test-target "tests"
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'configure
+           ;; ./configure is a hand-written script that can't handle standard
+           ;; autotools arguments like CONFIG_SHELL.
+           (lambda* (#:key configure-flags #:allow-other-keys)
+             (setenv "txr_shell" (which "bash"))
+             (apply invoke "./configure" configure-flags)
+             #t))
+         (add-after 'configure 'fix-tests
+           (lambda _
+             (substitute* (list "tests/017/realpath.tl"
+                                "tests/017/realpath.expected")
+               (("/usr/bin") "/"))
+             #t)))))
     (inputs
      `(("libffi" ,libffi)))
     (synopsis "General-purpose, multi-paradigm programming language")
@@ -989,3 +1000,87 @@ including a built-in database engine and a GUI system.")
      (package
        (inherit picolisp32)
        (name "picolisp")))))
+
+(define-public janet
+  (package
+    (name "janet")
+    (version "1.12.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/janet-lang/janet")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0if514zdmbjvvrsa9x5yfvg2b14sz53yaka12g3yhwkq8ls3qk0c"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:make-flags (list
+                     (string-append "DESTDIR=" (assoc-ref %outputs "out"))
+                     (string-append "PREFIX=")
+                     (string-append "CC=" (assoc-ref %build-inputs "gcc")
+                                    "/bin/gcc"))
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (replace 'check
+           (lambda _
+             (invoke "make" "test"))))))
+    (home-page "https://janet-lang.org/")
+    (synopsis "Functional, imperative and embeddable programming language")
+    (description
+     "Janet is a functional and imperative programming language.  It can be
+used for rapid prototyping, dynamic systems, and other domains where dynamic
+languages shine.  You can also add Janet scripting to an application by
+embedding a single C file and two headers.  It can be easily ported to new
+platforms.  The entire language (core library, interpreter, compiler,
+assembler, PEG) is less than 1MB.")
+    (license license:expat)))
+
+(define-public lisp-repl-core-dumper
+  (package
+    (name "lisp-repl-core-dumper")
+    (version "0.3.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://gitlab.com/ambrevar/lisp-repl-core-dumper.git")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1w7x7d7bnrdj0bd04vnjy7d7sngvcx1yjr4iw429hdd9lzlg8rbg"))))
+    (build-system copy-build-system)
+    (arguments
+     '(#:install-plan
+       '(("lisp-repl-core-dumper" "bin/"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'install 'fix-utils-path
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let* ((coreutils (string-append (assoc-ref inputs "coreutils") "/bin/"))
+                    (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))
+                 (("\\<paste\\>") paste)
+                 (("\\<sed\\>") sed)
+                 (("\\<sort\\>") sort))))))))
+    (inputs
+     `(("coreutils" ,coreutils-minimal)
+       ("sed" ,sed)))
+    (home-page "https://gitlab.com/ambrevar/lisp-repl-core-dumper")
+    (synopsis "Generate REPL-optimized Lisp cores on demand")
+    (description
+     "This tool generates Lisp images that can embed the provided systems
+and make for REPLs that start blazing fast.
+
+@itemize
+@item It’s portable and should work with any compiler.
+@item It works for any REPL.
+@item It allows you to include arbitrary libraries.
+@end itemize\n")
+    (license license:gpl3+)))