build-system: Bags record their system and target.

* guix/build-system.scm (<bag>)[system, target]: New fields.
  (make-bag): Add #:system parameter and pass it to LOWER.
* gnu/packages/bootstrap.scm (make-raw-bag): Initialize 'system' field.
* guix/build-system/cmake.scm (lower): Likewise.
* guix/build-system/perl.scm (lower): Likewise.
* guix/build-system/python.scm (lower): Likewise.
* guix/build-system/ruby.scm (lower): Likewise.
* guix/build-system/trivial.scm (lower): Likewise.
* guix/build-system/gnu.scm (lower): Initialize 'system' and 'target'
  fields.
* guix/packages.scm (bag->derivation, bag->cross-derivation): New
  procedures.
  (package-derivation, package-cross-derivation): Use 'bag->derivation'.
* tests/packages.scm ("search paths"): Initialize 'system' and 'target'
  fields.
  ("package->bag", "package->bag, cross-compilation", "bag->derivation",
  "bag->derivation, cross-compilation"): New tests.
This commit is contained in:
Ludovic Courtès 2014-10-05 16:32:25 +02:00
parent b4469d8c12
commit d3d337d2d8
10 changed files with 137 additions and 69 deletions

View file

@ -43,7 +43,8 @@
(module-ref module 'perl)))
(define* (lower name
#:key source inputs native-inputs outputs target
#:key source inputs native-inputs outputs
system target
(perl (default-perl))
#:allow-other-keys
#:rest arguments)
@ -54,6 +55,7 @@
(and (not target) ;XXX: no cross-compilation
(bag
(name name)
(system system)
(host-inputs `(,@(if source
`(("source" ,source))
'())