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