mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-26 06:18:07 -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))))
|
(_ system))))
|
||||||
|
|
||||||
(define* (generate-system-definition system
|
(define* (generate-system-definition system
|
||||||
#:key version dependencies)
|
#:key version dependencies component?)
|
||||||
`(asdf:defsystem
|
`(asdf:defsystem
|
||||||
,(normalize-string system)
|
,(normalize-string system)
|
||||||
:class asdf/bundle:prebuilt-system
|
,@(if component?
|
||||||
|
'(:class asdf/bundle:prebuilt-system)
|
||||||
|
'())
|
||||||
:version ,version
|
:version ,version
|
||||||
:depends-on ,dependencies
|
:depends-on ,dependencies
|
||||||
:components ((:compiled-file ,(compiled-system system)))
|
,@(if component?
|
||||||
|
`(:components ((:compiled-file ,(compiled-system system))))
|
||||||
|
'())
|
||||||
,@(if (string=? "ecl" (%lisp-type))
|
,@(if (string=? "ecl" (%lisp-type))
|
||||||
`(:lib ,(string-append system ".a"))
|
`(:lib ,(string-append system ".a"))
|
||||||
'())))
|
'())))
|
||||||
|
@ -311,14 +315,20 @@ (define registry
|
||||||
lisp-input-map)
|
lisp-input-map)
|
||||||
(map dependency-name dependencies)))
|
(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
|
(call-with-output-file asd-file
|
||||||
(lambda (port)
|
(lambda (port)
|
||||||
(display
|
(display
|
||||||
(replace-escaped-macros
|
(replace-escaped-macros
|
||||||
(format #f "~y~%~y~%"
|
(format #f "~y~%~y~%"
|
||||||
(generate-system-definition system
|
(generate-system-definition
|
||||||
|
system
|
||||||
#:version version
|
#: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)))
|
(generate-dependency-links registry system)))
|
||||||
port))))
|
port))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue