diff --git a/asdf-bundle.lisp b/asdf-bundle.lisp index 9918d9677b5f4f8826fc5781881668761d5d36bf..9594a6d780aeedfda08ff593aa5458e01790d5d7 100644 --- a/asdf-bundle.lisp +++ b/asdf-bundle.lisp @@ -498,6 +498,31 @@ For the latter case, we ought pick random suffix and atomically open it." (declare (ignorable o c)) nil) +(defclass precompiled-system (system) + ((fasl :initarg :fasl :reader %system-fasl))) + +(defgeneric system-fasl (system) + (:method ((system precompiled-system)) + (let* ((f (%system-fasl system)) + (p (etypecase f + ((or pathname string) f) + (function (funcall f)) + (cons (eval f))))) + (pathname p)))) + +(defmethod input-files ((o load-op) (s precompiled-system)) + (declare (ignorable o)) + (list (system-fasl s))) + +(defmethod perform ((o load-op) (s precompiled-system)) + (declare (ignorable o)) + (load (system-fasl s))) + +#| ;; Example use: +(asdf:defsystem :precompiled-asdf-utils :class asdf::precompiled-system :fasl (asdf:apply-output-translations (asdf:system-relative-pathname :asdf-utils "asdf-utils.system.fasl"))) +(asdf:load-system :precompiled-asdf-utils) +|# + #+ecl (defmethod output-files ((o fasl-op) (c system)) (declare (ignorable o c)) @@ -594,7 +619,8 @@ For the latter case, we ought pick random suffix and atomically open it." ;;; Final integration steps ;;; -(export '(load-fasl-op #+ecl make-build #+mkcl bundle-system)) +(export '(load-fasl-op precompiled-system + #+ecl make-build #+mkcl bundle-system)) #+(or ecl mkcl) (pushnew '("fasb" . si::load-binary) si:*load-hooks* :test 'equal :key 'car)