mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 22:08:16 -05:00
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.
This commit is contained in:
parent
04dd80181f
commit
5a08660ecb
1 changed files with 16 additions and 6 deletions
|
@ -186,13 +186,17 @@ (define (compiled-system system)
|
|||
(_ 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 @@ (define registry
|
|||
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
|
||||
(generate-system-definition
|
||||
system
|
||||
#:version version
|
||||
#:dependencies dependencies)
|
||||
#: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))))
|
||||
|
||||
|
|
Loading…
Reference in a new issue