[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
18/18: gnu: cl-slime-swank: Store .fasl in the ASDF registry.
From: |
guix-commits |
Subject: |
18/18: gnu: cl-slime-swank: Store .fasl in the ASDF registry. |
Date: |
Fri, 8 Jul 2022 13:33:26 -0400 (EDT) |
ambrevar pushed a commit to branch master
in repository guix.
commit 114b40ed675d0543058b5bdea86e561eff7c6b6e
Author: Pierre Neidhardt <mail@ambrevar.xyz>
AuthorDate: Fri Jul 8 19:19:13 2022 +0200
gnu: cl-slime-swank: Store .fasl in the ASDF registry.
* gnu/packages/lisp-xyz.scm (sbcl-slime-swank)[arguments]: Patch swank.asd
to
store the .fasl in the ASDF registry so that they are found in the
package.
Also patch swank-loader.lisp so that it does not try to remove the .fasl
from
the store.
(cl-slime-swank)[arguments]: Revert above patch of the swank.ask so that the
source package does not get bound to the SBCL package.
We would not have to do this if SLIME/Swank used ASDF properly instead of
working around it.
---
gnu/packages/lisp-xyz.scm | 42 ++++++++++++++++++++++++++++++++++++++++--
1 file changed, 40 insertions(+), 2 deletions(-)
diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 705c68e10e..062de8c8e9 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -2302,7 +2302,31 @@ writing code that contains string literals that contain
code themselves.")
#t))))
(build-system asdf-build-system/sbcl)
(arguments
- '(#:asd-systems '("swank")))
+ '(#:asd-systems '("swank")
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'set-fasl-directory
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (lib-dir (string-append out "/lib/common-lisp/"
+ (%lisp-type)
+ "/slime-swank/")))
+ ;; Use the ASDF registry instead of Swank's default that places
+ ;; the .fasl files in ~/.slime.
+ (substitute* "swank.asd"
+ (("\\(load \\(asdf::component-pathname f\\)\\)" all)
+ (string-append
+ all "\n"
+ "(setf (symbol-value"
+ "(read-from-string \"swank-loader::*fasl-directory*\"))"
+ "\"" lib-dir "\")")))
+ (substitute* "swank-loader.lisp"
+ (("\\(probe-file fasl\\)" all)
+ ;; Do not try to delete Guix store files.
+ (string-append
+ all "\n"
+ " (not (equal (subseq (pathname-directory fasl) 1 3)"
+ " '(\"gnu\" \"store\"))) ; XXX: GUIX PATCH")))))))))
(home-page "https://github.com/slime/slime")
(synopsis "Common Lisp Swank server")
(description
@@ -2312,7 +2336,21 @@ processes that doesn't run under Emacs. Lisp processes
created by
(license (list license:gpl2+ license:public-domain))))
(define-public cl-slime-swank
- (sbcl-package->cl-source-package sbcl-slime-swank))
+ (let ((pkg (sbcl-package->cl-source-package sbcl-slime-swank)))
+ (package
+ (inherit pkg)
+ (arguments
+ (substitute-keyword-arguments (package-arguments pkg)
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (add-after 'install 'revert-asd-patch
+ ;; We do not want to include the Guix patch in the cl- package
+ ;; since it would include the sbcl- package in the closure.
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (source-path (string-append out
"/share/common-lisp/source/")))
+ (substitute* (string-append source-path
"/cl-slime-swank/swank.asd")
+ ((".*fasl-directory.*") ""))))))))))))
(define-public ecl-slime-swank
(sbcl-package->ecl-package sbcl-slime-swank))
- 03/18: gnu: sbcl-ptester: Remove Make reference from closure., (continued)
- 03/18: gnu: sbcl-ptester: Remove Make reference from closure., guix-commits, 2022/07/08
- 02/18: gnu: sbcl-rt: Remove Make reference from closure., guix-commits, 2022/07/08
- 08/18: gnu: sbcl-rss: Remove Make reference from closure., guix-commits, 2022/07/08
- 14/18: gnu: sbcl-cluffer: Remove bash reference from the closure., guix-commits, 2022/07/08
- 15/18: gnu: sbcl-trivial-clipboard: Replace xclip with xsel to reduce closure size., guix-commits, 2022/07/08
- 16/18: gnu: sbcl-osicat: Remove bash reference from the closure., guix-commits, 2022/07/08
- 06/18: gnu: sbcl-kmrcl: Remove Make reference from closure., guix-commits, 2022/07/08
- 07/18: gnu: sbcl-cl-base64: Remove Make reference from closure., guix-commits, 2022/07/08
- 12/18: gnu: sbcl-moptilities: Remove sbcl-moptilities reference in cl-moptilities., guix-commits, 2022/07/08
- 04/18: gnu: sbcl-xlunit: Remove Make reference from closure., guix-commits, 2022/07/08
- 18/18: gnu: cl-slime-swank: Store .fasl in the ASDF registry.,
guix-commits <=
- 10/18: gnu: sbcl-clsql: Remove Make reference from closure., guix-commits, 2022/07/08
- 11/18: gnu: sbcl-slime-swank: Remove gawk reference from closure., guix-commits, 2022/07/08
- 17/18: gnu: sbcl-dexador: Remove unneeded depedencies to reduce closure size., guix-commits, 2022/07/08