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.
This commit is contained in:
Pierre Neidhardt 2022-07-07 09:58:49 +02:00
parent 1051db2526
commit d14070bd29
No known key found for this signature in database
GPG Key ID: 9BDCF497A4BBCC7F

View File

@ -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"))