gnu: make-bootstrap: Abstract things with `package-with-relocatable-glibc'.

* gnu/packages/make-bootstrap.scm (%glibc-for-bootstrap): Replace with...
  (glibc-for-bootstrap): ... this.  New procedure.
  (%standard-inputs-with-relocatable-glibc): Replace with...
  (package-with-relocatable-glibc): ... this.  New procedure.
  (%static-inputs, %gcc-static, %guile-static): Use it.
master
Ludovic Courtès 2013-06-14 15:29:08 +02:00
parent af5cb60fec
commit 62751a5ddd
1 changed files with 83 additions and 83 deletions

View File

@ -49,12 +49,12 @@
;;;
;;; Code:
(define %glibc-for-bootstrap
;; A libc whose `system' and `popen' functions looks for `sh' in $PATH,
;; without nscd, and with static NSS modules.
(package (inherit glibc-final)
(define* (glibc-for-bootstrap #:optional (base glibc-final))
"Return a libc deriving from BASE whose `system' and `popen' functions looks
for `sh' in $PATH, and without nscd, and with static NSS modules."
(package (inherit base)
(arguments
(substitute-keyword-arguments (package-arguments glibc-final)
(substitute-keyword-arguments (package-arguments base)
((#:patches patches)
`(cons (assoc-ref %build-inputs "patch/system") ,patches))
((#:configure-flags flags)
@ -65,18 +65,24 @@
,flags))))
(inputs
`(("patch/system" ,(search-patch "glibc-bootstrap-system.patch"))
,@(package-inputs glibc-final)))))
,@(package-inputs base)))))
(define %standard-inputs-with-relocatable-glibc
;; Standard inputs with the above libc and corresponding GCC.
`(("libc", %glibc-for-bootstrap)
(define (package-with-relocatable-glibc p)
"Return a variant of P that uses the libc as defined by
`glibc-for-bootstrap'."
(define inputs
`(("libc", (glibc-for-bootstrap))
("gcc" ,(package-with-explicit-inputs
gcc-4.7
`(("libc",%glibc-for-bootstrap)
`(("libc",(glibc-for-bootstrap))
,@(alist-delete "libc" %final-inputs))
(current-source-location)))
,@(fold alist-delete %final-inputs '("libc" "gcc"))))
(package-with-explicit-inputs p inputs
(current-source-location)))
(define %bash-static
(static-package bash-light))
@ -135,11 +141,8 @@
(("-export-dynamic") "")))
,phases)))))
(inputs `(("patch/sh" ,(search-patch "gawk-shell.patch"))))))
(finalize (lambda (p)
(static-package (package-with-explicit-inputs
p
%standard-inputs-with-relocatable-glibc)
(current-source-location)))))
(finalize (compose static-package
package-with-relocatable-glibc)))
`(,@(map (match-lambda
((name package)
(list name (finalize package))))
@ -284,7 +287,7 @@
;; GNU libc's essential shared libraries, dynamic linker, and headers,
;; with all references to store directories stripped. As a result,
;; libc.so is unusable and need to be patched for proper relocation.
(let ((glibc %glibc-for-bootstrap))
(let ((glibc (glibc-for-bootstrap)))
(package (inherit glibc)
(name "glibc-stripped")
(build-system trivial-build-system)
@ -335,7 +338,7 @@
(define %gcc-static
;; A statically-linked GCC, with stripped-down functionality.
(package-with-explicit-inputs
(package-with-relocatable-glibc
(package (inherit gcc-final)
(name "gcc-static")
(arguments
@ -365,8 +368,7 @@
("mpfr-source" ,(package-source mpfr))
("mpc-source" ,(package-source mpc))
("binutils" ,binutils-final)
,@(package-inputs gcc-4.7))))
%standard-inputs-with-relocatable-glibc))
,@(package-inputs gcc-4.7))))))
(define %gcc-stripped
;; The subset of GCC files needed for bootstrap.
@ -460,9 +462,7 @@
;; There are uses of `dynamic-link' in
;; {foreign,coverage}.test that don't fly here.
#:tests? #f)))))
(package-with-explicit-inputs (static-package guile)
%standard-inputs-with-relocatable-glibc
(current-source-location))))
(package-with-relocatable-glibc (static-package guile))))
(define %guile-static-stripped
;; A stripped static Guile binary, for use during bootstrap.