summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Neidhardt <mail@ambrevar.xyz>2020-06-18 16:41:08 +0200
committerPierre Neidhardt <mail@ambrevar.xyz>2020-06-18 17:14:08 +0200
commit5a08660ecb965783f581b95704c150e12d721891 (patch)
tree4e453e1d47db30a492dd3c8b70f03a0857901aac
parent04dd80181f6f643efff3b7ffe4441410a17f4ca6 (diff)
build-system/asdf: Add support for component-less systems.
* guix/build/lisp-utils.scm (make-asd-file): Ensure lib directory exists and check if prebuilt bundle system was generated. (generate-system-definition): Add :class and :components only if prebuilt system was generated.
-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))))