summary refs log tree commit diff
path: root/gnu/packages/lisp.scm
diff options
context:
space:
mode:
authorPierre Neidhardt <mail@ambrevar.xyz>2022-07-07 09:58:49 +0200
committerPierre Neidhardt <mail@ambrevar.xyz>2022-07-08 19:32:41 +0200
commitd14070bd29de2edd25a57c4618cb3fae6445b47d (patch)
tree008a5a24901bcf850a289f51e8983c2e2fe9c8cb /gnu/packages/lisp.scm
parent1051db25267a9bbc0ad38be2f3ec92af40f18e18 (diff)
downloadguix-d14070bd29de2edd25a57c4618cb3fae6445b47d.tar.gz
gnu: sbcl: Remove Coreutils reference from closure.
* gnu/packages/lisp.scm (sbcl)[arguments]: Add phase to do it.

This shrinks SBCL from 167MiB to 150MiB.
Most importantly, this propagates to all sbcl-* packages.
Diffstat (limited to 'gnu/packages/lisp.scm')
-rw-r--r--gnu/packages/lisp.scm15
1 files changed, 15 insertions, 0 deletions
diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 02abdd1e37..636221af35 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -605,6 +605,21 @@ an interpreter, a compiler, a debugger, and much more.")
                     (string-append "(sb-ext:set-sbcl-source-location \""
                                    source-dir "\")") )))
                #t)))
+         (add-after 'install 'remove-coreutils-references
+           ;; They are only useful on non-Linux, non-SBCL.
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (share-dir (string-append out "/share/sbcl/")))
+               (substitute* (string-append share-dir "src/code/run-program.lisp")
+                 (("\\(run-program \".*uname\"")
+                  "(run-program \"uname\""))
+               (substitute* (string-append share-dir "contrib/asdf/asdf.lisp")
+                 (("\\(\".*/usr/bin/env\"")
+                  "(\"/usr/bin/env\""))
+               (substitute* (string-append share-dir "contrib/asdf/uiop.lisp")
+                 (("\\(\".*/usr/bin/env\"")
+                  "(\"/usr/bin/env\""))
+               #t)))
          (add-after 'install 'install-shared-library
            (lambda* (#:key outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))