+(in-package :asdf)
+
+(defun keywordize (x)
+ (intern (string-upcase x) :keyword))
+
+(defun wrapping-source-registry ()
+ '(:source-registry (:tree #p"SYS:CONTRIB;") :ignore-inherited-configuration))
+
+
+(defun setup-asdf-contrib ()
+ ;;(setf *resolve-symlinks* nil)
+ (let* ((sbcl-pwd (getenv-pathname "SBCL_PWD" :ensure-directory t))
+ (src-contrib (subpathname sbcl-pwd "contrib/"))
+ (asdf-cache (subpathname sbcl-pwd "obj/asdf-cache/"))
+ (source-registry '(:source-registry :ignore-inherited-configuration))
+ (output-translations `(:output-translations (,(namestring src-contrib)
+ ,(namestring asdf-cache))
+ :ignore-inherited-configuration))
+ (src.pat (wilden src-contrib))
+ (src.dir.pat (merge-pathnames* *wild-inferiors* src-contrib))
+ (out.pat (wilden asdf-cache)))
+ (ensure-directories-exist asdf-cache)
+ (setf (logical-pathname-translations "SYS")
+ `(("CONTRIB;**;*.*.*" ,src.pat))) ;; this makes recursive tree search work.
+ (initialize-source-registry source-registry)
+ (initialize-output-translations output-translations)
+ (setf (logical-pathname-translations "SYS")
+ (labels ((typepat (type base)
+ `(,(format nil "CONTRIB;**;*.~:@(~A~).*" type)
+ ,(make-pathname :type (string-downcase type) :defaults base)))
+ (outpat (type) (typepat type out.pat))
+ (srcpat (type) (typepat type src.pat))
+ (outpats (&rest types) (mapcar #'outpat types))
+ (srcpats (&rest types) (mapcar #'srcpat types)))
+ `(,@(srcpats :lisp :asd)
+ ,@(outpats :fasl :sbcl-warnings :build-report
+ :out :exe :lisp-temp :o :c :test-report :html)
+ ("CONTRIB;**;" ,src.dir.pat)
+ #|("CONTRIB;**;*.*.*" ,src.pat)|#)))
+ (setf *central-registry* nil)))
+
+(defun build-asdf-contrib (system)