aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--guix/build/lisp-utils.scm22
1 files changed, 16 insertions, 6 deletions
diff --git a/guix/build/lisp-utils.scm b/guix/build/lisp-utils.scm
index c7a589c902..5bb3d81c9e 100644
--- a/guix/build/lisp-utils.scm
+++ b/guix/build/lisp-utils.scm
@@ -186,13 +186,17 @@ asdf:system-depends-on. First load the system's ASD-FILE."
(_ system))))
(define* (generate-system-definition system
- #:key version dependencies)
+ #:key version dependencies component?)
`(asdf:defsystem
,(normalize-string system)
- :class asdf/bundle:prebuilt-system
+ ,@(if component?
+ '(:class asdf/bundle:prebuilt-system)
+ '())
:version ,version
:depends-on ,dependencies
- :components ((:compiled-file ,(compiled-system system)))
+ ,@(if component?
+ `(:components ((:compiled-file ,(compiled-system system))))
+ '())
,@(if (string=? "ecl" (%lisp-type))
`(:lib ,(string-append system ".a"))
'())))
@@ -311,14 +315,20 @@ system to find its dependencies, as described by GENERATE-DEPENDENCY-LINKS."
lisp-input-map)
(map dependency-name dependencies)))
+ ;; Ensure directory exists, which might not be the case for an .asd without components.
+ (mkdir-p (dirname asd-file))
(call-with-output-file asd-file
(lambda (port)
(display
(replace-escaped-macros
(format #f "~y~%~y~%"
- (generate-system-definition system
- #:version version
- #:dependencies dependencies)
+ (generate-system-definition
+ system
+ #:version version
+ #:dependencies dependencies
+ ;; Some .asd don't have components, and thus they don't generate any .fasl.
+ #:component? (pair?
+ (find-files (dirname asd-file) "--system\\.fasl$")))
(generate-dependency-links registry system)))
port))))