git.fiddlerwoaroof.com
Browse code

chore(asdf-translation): misc improvements

Ed Langley authored on 01/09/2020 21:14:48
Showing 1 changed files
... ...
@@ -1,5 +1,7 @@
1
+(in-package :cl-user)
1 2
 (defun homedir-translation (input dd)
2
-  (declare (ignore dd))
3
+  (declare (ignorable dd))
4
+  (format t "~&input ~s ~s~%" input dd)
3 5
   (merge-pathnames
4 6
    (make-pathname :directory
5 7
                   (list* :relative
... ...
@@ -13,36 +15,54 @@
13 15
                   :defaults input)
14 16
    (merge-pathnames "asdf-corral/Contents/Resources/"
15 17
                     (user-homedir-pathname))))
18
+(defun in-homedir ()
19
+  (merge-pathnames (make-pathname :directory (list :relative :wild-inferiors)
20
+                                  :name :wild
21
+                                  :type :wild
22
+                                  :version :wild)
23
+                   (user-homedir-pathname)))
16 24
 
17 25
 (defun do-translation (input dd)
18
-  (declare (ignore dd))
26
+  (declare (ignorable dd))
19 27
   (merge-pathnames
20 28
    (make-pathname :directory
21 29
                   (list :relative
22 30
                         "build-cache"
23
-                        "root"
24 31
                         (format nil "~{~a~^-~}"(cdr (pathname-directory input))))
25 32
                   :defaults input)
26 33
    (merge-pathnames "asdf-corral/Contents/Resources/"
27 34
                     (user-homedir-pathname))))
28 35
 
29
-(defun in-homedir ()
36
+(defun dylib-translation (input dd)
37
+  (declare (ignorable dd))
38
+  (format t "~&NOTICE ME: input ~s dd ~s~%" input dd)
39
+  (merge-pathnames
40
+   (make-pathname :directory
41
+                  (list :relative
42
+                        (format nil "~{~a~^-~}"(cdr (pathname-directory input))))
43
+                  :defaults input)
44
+   (merge-pathnames "asdf-corral/Contents/Library/"
45
+                    (user-homedir-pathname))))
46
+
47
+(defun is-dylib ()
30 48
   (merge-pathnames (make-pathname :directory (list :relative :wild-inferiors)
31 49
                                   :name :wild
32
-                                  :type :wild
50
+                                  :type "dylib"
33 51
                                   :version :wild)
34 52
                    (user-homedir-pathname)))
35 53
 
36 54
 (asdf:initialize-output-translations
37 55
  `(:output-translations
38
-   :ignore-inherited-configuration
39
-   :disable-cache
40
-   (,(in-homedir) (:function homedir-translation))
41
-   ("/" (:function do-translation))))
56
+   #+(or):ignore-inherited-configuration
57
+   :inherit-configuration
58
+   #+(or):disable-cache
59
+   (,(is-dylib) (:function dylib-translation))
60
+   #+(or)("/" (:function do-translation))))
42 61
 
43 62
 (load "~/quicklisp/setup.lisp")
44 63
 
45
-(eval-when (:compile-toplevel :load-toplevel :execute)
46
-  (trace homedir-translation do-translation))
64
+(eval-when (:execute)
65
+  (trace dylib-translation))
47 66
 
67
+#+nil
48 68
 (ql:quickload :data-lens)