diff options
author | Ludovic Courtès <ludo@gnu.org> | 2014-10-03 18:06:16 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2014-10-05 21:58:42 +0200 |
commit | 0d5a559f0f81e14c695e5aab178b30edf66088f3 (patch) | |
tree | fe43647edc18b8a85885436f9a40a6ff4281e19f /gnu | |
parent | 2348fd0f51b6eeabde2e384ef495b3a0adbd6bfb (diff) | |
download | guix-0d5a559f0f81e14c695e5aab178b30edf66088f3.tar guix-0d5a559f0f81e14c695e5aab178b30edf66088f3.tar.gz |
build-system: Introduce "bags" as an intermediate representation.
* guix/build-system.scm (<build-system>)[build, cross-build]: Remove.
[lower]: New field.
(<bag>): New record type.
(make-bag): New procedure.
* guix/packages.scm (bag-transitive-inputs, bag-transitive-build-inputs,
bag-transitive-host-inputs, bag-transitive-target-inputs,
package->bag): New procedures.
(package-derivation): Use it; use the bag, apply its build procedure,
etc.
(package-cross-derivation): Likewise.
* gnu/packages/bootstrap.scm (raw-build, make-raw-bag): New procedure.
(%bootstrap-guile): Use them.
* guix/build-system/trivial.scm (lower): New procedure.
(trivial-build, trivial-cross-build): Remove 'source' parameter. Pass
INPUTS as is.
(trivial-build-system): Adjust accordingly.
* guix/build-system/gnu.scm (%store, inputs-search-paths,
standard-search-paths, expand-inputs, standard-inputs): Remove.
(gnu-lower): New procedure.
(gnu-build): Remove 'source' and #:implicit-inputs? parameters.
Remove 'implicit-inputs' and 'implicit-search-paths' variables. Get
the source from INPUT-DRVS.
(gnu-cross-build): Likewise.
(standard-cross-packages): Remove call to 'standard-packages'.
(standard-cross-inputs, standard-cross-search-paths): Remove.
(gnu-build-system): Remove 'build' and 'cross-build'; add 'lower'.
* guix/build-system/cmake.scm (lower): New procedure.
(cmake-build): Remove 'source' and #:cmake parameters. Use INPUTS and
SEARCH-PATHS as is. Get the source from INPUTS.
* guix/build-system/perl.scm: Likewise.
* guix/build-system/python.scm: Likewise.
* guix/build-system/ruby.scm: Likewise.
* gnu/packages/cross-base.scm (cross-gcc): Change "cross-linux-headers"
to "linux-headers".
(cross-libc)[xlinux-headers]: Pass #:implicit-cross-inputs? #f.
Likewise. In 'propagated-inputs', change "cross-linux-headers" to
"linux-headers".
* guix/git-download.scm (git-fetch): Use 'standard-packages' instead of
'standard-inputs'.
* tests/builders.scm ("gnu-build-system"): Remove use of
'build-system-builder'.
("gnu-build"): Remove 'source' and #:implicit-inputs? arguments to
'gnu-build'.
* tests/packages.scm ("search paths"): Adjust to new build system API.
("package-cross-derivation, no cross builder"): Likewise.
* doc/guix.texi (Build Systems): Add paragraph on bags.
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/packages/bootstrap.scm | 76 | ||||
-rw-r--r-- | gnu/packages/cross-base.scm | 22 |
2 files changed, 60 insertions, 38 deletions
diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm index 71ccb19597..efa8cd89eb 100644 --- a/gnu/packages/bootstrap.scm +++ b/gnu/packages/bootstrap.scm @@ -164,6 +164,46 @@ check whether everything is alright." ;;; Bootstrap packages. ;;; +(define* (raw-build store name inputs + #:key outputs system search-paths + #:allow-other-keys) + (define (->store file) + (add-to-store store file #t "sha256" + (or (search-bootstrap-binary file + system) + (error "bootstrap binary not found" + file system)))) + + (let* ((tar (->store "tar")) + (xz (->store "xz")) + (mkdir (->store "mkdir")) + (bash (->store "bash")) + (guile (->store "guile-2.0.9.tar.xz")) + (builder + (add-text-to-store store + "build-bootstrap-guile.sh" + (format #f " +echo \"unpacking bootstrap Guile to '$out'...\" +~a $out +cd $out +~a -dc < ~a | ~a xv + +# Sanity check. +$out/bin/guile --version~%" + mkdir xz guile tar) + (list mkdir xz guile tar)))) + (derivation store name + bash `(,builder) + #:system system + #:inputs `((,bash) (,builder))))) + +(define* (make-raw-bag name + #:key source inputs native-inputs outputs target) + (bag + (name name) + (build-inputs inputs) + (build raw-build))) + (define %bootstrap-guile ;; The Guile used to run the build scripts of the initial derivations. ;; It is just unpacked from a tarball containing a pre-built binary. @@ -172,39 +212,9 @@ check whether everything is alright." ;; XXX: Would need libc's `libnss_files2.so' for proper `getaddrinfo' ;; support (for /etc/services). (let ((raw (build-system - (name "raw") - (description "Raw build system with direct store access") - (build (lambda* (store name source inputs - #:key outputs system search-paths) - (define (->store file) - (add-to-store store file #t "sha256" - (or (search-bootstrap-binary file - system) - (error "bootstrap binary not found" - file system)))) - - (let* ((tar (->store "tar")) - (xz (->store "xz")) - (mkdir (->store "mkdir")) - (bash (->store "bash")) - (guile (->store "guile-2.0.9.tar.xz")) - (builder - (add-text-to-store store - "build-bootstrap-guile.sh" - (format #f " -echo \"unpacking bootstrap Guile to '$out'...\" -~a $out -cd $out -~a -dc < ~a | ~a xv - -# Sanity check. -$out/bin/guile --version~%" - mkdir xz guile tar) - (list mkdir xz guile tar)))) - (derivation store name - bash `(,builder) - #:system system - #:inputs `((,bash) (,builder))))))))) + (name 'raw) + (description "Raw build system with direct store access") + (lower make-raw-bag)))) (package (name "guile-bootstrap") (version "2.0") diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 90fc606d94..46909cb597 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -154,7 +154,7 @@ GCC that does not target a libc; otherwise, target that libc." ;; them from CPATH. (let ((libc (assoc-ref inputs "libc")) (linux (assoc-ref inputs - "libc/cross-linux-headers"))) + "libc/linux-headers"))) (define (cross? x) ;; Return #t if X is a cross-libc or cross Linux. (or (string-prefix? libc x) @@ -224,7 +224,9 @@ XBINUTILS and the cross tool chain." (name (string-append (package-name linux-libre-headers) "-cross-" target)) (arguments - (substitute-keyword-arguments (package-arguments linux-libre-headers) + (substitute-keyword-arguments + `(#:implicit-cross-inputs? #f + ,@(package-arguments linux-libre-headers)) ((#:phases phases) `(alist-replace 'build @@ -243,7 +245,14 @@ XBINUTILS and the cross tool chain." (name (string-append "glibc-cross-" target)) (arguments (substitute-keyword-arguments - `(#:strip-binaries? #f ; disable stripping (see above) + `(;; Disable stripping (see above.) + #:strip-binaries? #f + + ;; This package is used as a target input, but it should not have + ;; the usual cross-compilation inputs since that would include + ;; itself. + #:implicit-cross-inputs? #f + ,@(package-arguments glibc)) ((#:configure-flags flags) `(cons ,(string-append "--host=" target) @@ -252,13 +261,16 @@ XBINUTILS and the cross tool chain." `(alist-cons-before 'configure 'set-cross-linux-headers-path (lambda* (#:key inputs #:allow-other-keys) - (let ((linux (assoc-ref inputs "cross-linux-headers"))) + (let ((linux (assoc-ref inputs "linux-headers"))) (setenv "CROSS_CPATH" (string-append linux "/include")) #t)) ,phases)))) - (propagated-inputs `(("cross-linux-headers" ,xlinux-headers))) + ;; Shadow the native "linux-headers" because glibc's recipe expect the + ;; "linux-headers" input to point to the right thing. + (propagated-inputs `(("linux-headers" ,xlinux-headers))) + (native-inputs `(("cross-gcc" ,xgcc) ("cross-binutils" ,xbinutils) ,@(package-native-inputs glibc))))) |