From d3d337d2d8f7152cb9ff3724f1cf240ce5ea5be2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 5 Oct 2014 16:32:25 +0200 Subject: build-system: Bags record their system and target. * guix/build-system.scm ()[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. --- guix/build-system.scm | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'guix/build-system.scm') diff --git a/guix/build-system.scm b/guix/build-system.scm index f185d5704f..4174972b98 100644 --- a/guix/build-system.scm +++ b/guix/build-system.scm @@ -28,6 +28,8 @@ bag bag? bag-name + bag-system + bag-target bag-build-inputs bag-host-inputs bag-target-inputs @@ -43,12 +45,19 @@ (description build-system-description) ; short description (lower build-system-lower)) ; args ... -> bags -;; "Bags" are low-level representations of "packages". Here we use -;; build/host/target in the sense of the GNU tool chain (info "(autoconf) -;; Specifying Target Triplets"). +;; "Bags" are low-level representations of "packages". The system and target +;; of a bag is fixed when it's created. This is because build systems may +;; choose inputs as a function of the system and target. (define-record-type* bag %make-bag bag? (name bag-name) ;string + + (system bag-system) ;string + (target bag-target ;string | #f + (default #f)) + + ;; Here we use build/host/target in the sense of the GNU tool chain (info + ;; "(autoconf) Specifying Target Triplets"). (build-inputs bag-build-inputs ;list of packages (default '())) (host-inputs bag-host-inputs ;list of packages @@ -72,7 +81,7 @@ (define* (make-bag build-system name #:key source (inputs '()) (native-inputs '()) (outputs '()) (arguments '()) - target) + system target) "Ask BUILD-SYSTEM to return a 'bag' for NAME, with the given SOURCE, INPUTS, NATIVE-INPUTS, OUTPUTS, and additional ARGUMENTS. If TARGET is not #f, it must be a string with the GNU triplet of a cross-compilation target. @@ -82,6 +91,7 @@ intermediate representation just above derivations." (match build-system (($ _ description lower) (apply lower name + #:system system #:source source #:inputs inputs #:native-inputs native-inputs -- cgit v1.2.3