[slime-cvs] CVS slime

CVS User alendvai alendvai at common-lisp.net
Fri Oct 15 22:53:45 UTC 2010


Update of /project/slime/cvsroot/slime
In directory cl-net:/tmp/cvs-serv29005

Modified Files:
	ChangeLog swank-loader.lisp 
Log Message:
Better integration with ASDF.


--- /project/slime/cvsroot/slime/ChangeLog	2010/10/15 22:42:14	1.2151
+++ /project/slime/cvsroot/slime/ChangeLog	2010/10/15 22:53:45	1.2152
@@ -17,6 +17,10 @@
 	  - label-value-line* will evaluate and splice the result
 	    of the form after a @ character
 
+	* swank-loader.lisp: Optional integration with ASDF. When ASDF is
+	available, store slime fasl's where ASDF would store them. Also
+	make sure swank.asd is visible to ASDF.
+
 2010-10-09  Raymond Toy  <toy.raymond at gmail.com>
 
 	* swank-cmucl.lisp (codepoint-length): Implement codepoint-length
--- /project/slime/cvsroot/slime/swank-loader.lisp	2010/06/22 10:02:49	1.106
+++ /project/slime/cvsroot/slime/swank-loader.lisp	2010/10/15 22:53:45	1.107
@@ -124,12 +124,21 @@
     (and s (symbol-name (read s)))))
 
 (defun default-fasl-dir ()
-  (merge-pathnames
-   (make-pathname
-    :directory `(:relative ".slime" "fasl"
-                 ,@(if (slime-version-string) (list (slime-version-string)))
-                 ,(unique-dir-name)))
-   (user-homedir-pathname)))
+  (or
+   ;; If ASDF is available then store Slime's fasl's where ASDF stores them.
+   (let ((translate-fn (find-symbol "COMPILE-FILE-PATHNAME*" :asdf)))
+     (when translate-fn
+       (make-pathname
+        :name nil :type nil
+        :defaults (funcall translate-fn
+                           (make-pathname :name "foo"
+                                          :defaults *source-directory*)))))
+   (merge-pathnames
+    (make-pathname
+     :directory `(:relative ".slime" "fasl"
+                            ,@(if (slime-version-string) (list (slime-version-string)))
+                            ,(unique-dir-name)))
+    (user-homedir-pathname))))
 
 (defvar *fasl-directory* (default-fasl-dir)
   "The directory where fasl files should be placed.")
@@ -234,6 +243,16 @@
 
 (defun load-swank (&key (src-dir *source-directory*)
                         (fasl-dir *fasl-directory*))
+  (when (find-package :asdf)
+    ;; Make sure our swank.asd is visible to ASDF.
+    (eval
+     (let ((*package* (find-package :swank-loader)))
+       (read-from-string
+        "(let ((swank-system (asdf:find-system :swank nil)))
+          (unless (and swank-system
+                       (equal (asdf:component-pathname swank-system)
+                              (merge-pathnames \"swank.asd\" *source-directory*)))
+            (push *source-directory* asdf:*central-registry*)))"))))
   (compile-files (src-files *swank-files* src-dir) fasl-dir t)
   (funcall (q "swank::before-init")
            (slime-version-string)





More information about the slime-cvs mailing list