This commit is contained in:
Daniel Ziltener 2024-03-07 23:33:24 +01:00
parent 2ad1a98a44
commit 64436218a0
Signed by: zilti
GPG key ID: B38976E82C9DAE42

View file

@ -63,39 +63,36 @@ EXTENSION is the file name extension, such as '.tar.gz'."
(define private-keywords
'(#:target #:chicken #:inputs #:native-inputs #:outputs))
(bag
(name name)
(system system)
(target target)
(build-inputs `(,@(if source
`(("source" ,source))
'())
,@`(("chicken" ,chicken))
,@native-inputs
,@(if target '() inputs)
,@(if target
(standard-cross-packages target 'host)
'())
,@standard-packages))
(host-inputs (if target inputs '()))
(target-inputs (if target
(standard-cross-packages target 'target)
'()))
(outputs outputs)
;; TODO: Cross-build support
(build (if target '() chicken-build))
(arguments
(substitute-keyword-arguments
(strip-keyword-arguments private-keywords arguments)
((#:extra-directories extra-directories)
`(list (,@(append-map
(lambda (name)
(match (assoc name inputs)
((_ pkg)
(match (package-transitive-propagated-inputs pkg)
(((propagated-names . _) ...)
(cons name propagated-names))))))
extra-directories))))))))
;; TODO: cross-compilation support
(and (not target)
(bag
(name name)
(system system)
(host-inputs `(,@(if source
`(("source" ,source))
'())
,@inputs
;; Keep the standard inputs of 'gnu-build-system', since
;; Chicken compiles Scheme by using C as an intermediate
;; language.
,@(standard-packages)))
(build-inputs `(("chicken" ,chicken)
,@native-inputs))
(outputs outputs)
(build chicken-build)
(arguments
(substitute-keyword-arguments
(strip-keyword-arguments private-keywords arguments)
((#:extra-directories extra-directories)
`(list ,@(append-map
(lambda (name)
(match (assoc name inputs)
((_ pkg)
(match (package-transitive-propagated-inputs pkg)
(((propagated-names . _) ...)
(cons name propagated-names))))))
extra-directories))))))))
(define* (chicken-build name inputs
#:key source