From 21c203a53a617962586ef645b22f80814b05fd65 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 23 Jan 2013 23:21:59 +0100 Subject: packages: Mark the `arguments' field of as thunked. * guix/packages.scm (): Mark `arguments' as thunked. (package-derivation): Adjust accordingly. Parameterize %CURRENT-SYSTEM to SYSTEM, so that arguments can refer to it. * guix/build-system/gnu.scm (package-with-explicit-inputs): Expect `package-arguments' to always return a list, and return a list. (package-with-extra-configure-variable): Likewise. (static-package): Likewise. * gnu/packages/base.scm (patch, findutils, gcc-4.7, binutils-boot0, gcc-boot0, glibc-final-with-bootstrap-bash, cross-gcc-wrapper, static-bash-for-glibc, binutils-final, gcc-final): Change `arguments' from a lambda to a list, and use (%current-system) as needed. (nix-system->gnu-triplet, boot-triplet): Have the first argument default to (%current-system). * gnu/packages/bootstrap.scm (glibc-dynamic-linker): Have `system' default to (%current-system). (%bootstrap-gcc): Change `arguments' to a list. * gnu/packages/gawk.scm (gawk): Likewise. * gnu/packages/m4.scm (m4): Likewise. * gnu/packages/make-bootstrap.scm (%glibc-for-bootstrap): Likewise, and expect `package-arguments' to return a list. (%static-inputs, %gcc-static, tarball-package): Likewise. * gnu/packages/ncurses.scm (ncurses): Likewise. --- gnu/packages/bootstrap.scm | 61 +++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 31 deletions(-) (limited to 'gnu/packages/bootstrap.scm') diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm index 39cdea2f62..ea2cf618f2 100644 --- a/gnu/packages/bootstrap.scm +++ b/gnu/packages/bootstrap.scm @@ -133,7 +133,7 @@ (define rewritten-input (propagated-inputs (map rewritten-input (package-propagated-inputs p))))))) -(define (glibc-dynamic-linker system) +(define* (glibc-dynamic-linker #:optional (system (%current-system))) "Return the name of Glibc's dynamic linker for SYSTEM." (cond ((string=? system "x86_64-linux") "/lib/ld-linux-x86-64.so.2") ((string=? system "i686-linux") "/lib/ld-linux.so.2") @@ -301,42 +301,41 @@ (define %bootstrap-gcc (source #f) (build-system trivial-build-system) (arguments - (lambda (system) - `(#:guile ,%bootstrap-guile - #:modules ((guix build utils)) - #:builder - (let ((out (assoc-ref %outputs "out")) - (tar (assoc-ref %build-inputs "tar")) - (xz (assoc-ref %build-inputs "xz")) - (bash (assoc-ref %build-inputs "bash")) - (libc (assoc-ref %build-inputs "libc")) - (tarball (assoc-ref %build-inputs "tarball"))) - (use-modules (guix build utils) - (ice-9 popen)) + `(#:guile ,%bootstrap-guile + #:modules ((guix build utils)) + #:builder + (let ((out (assoc-ref %outputs "out")) + (tar (assoc-ref %build-inputs "tar")) + (xz (assoc-ref %build-inputs "xz")) + (bash (assoc-ref %build-inputs "bash")) + (libc (assoc-ref %build-inputs "libc")) + (tarball (assoc-ref %build-inputs "tarball"))) + (use-modules (guix build utils) + (ice-9 popen)) - (mkdir out) - (copy-file tarball "binaries.tar.xz") - (system* xz "-d" "binaries.tar.xz") - (let ((builddir (getcwd)) - (bindir (string-append out "/bin"))) - (with-directory-excursion out - (system* tar "xvf" - (string-append builddir "/binaries.tar"))) + (mkdir out) + (copy-file tarball "binaries.tar.xz") + (system* xz "-d" "binaries.tar.xz") + (let ((builddir (getcwd)) + (bindir (string-append out "/bin"))) + (with-directory-excursion out + (system* tar "xvf" + (string-append builddir "/binaries.tar"))) - (with-directory-excursion bindir - (chmod "." #o755) - (rename-file "gcc" ".gcc-wrapped") - (call-with-output-file "gcc" - (lambda (p) - (format p "#!~a + (with-directory-excursion bindir + (chmod "." #o755) + (rename-file "gcc" ".gcc-wrapped") + (call-with-output-file "gcc" + (lambda (p) + (format p "#!~a exec ~a/bin/.gcc-wrapped -B~a/lib \ -Wl,-rpath -Wl,~a/lib \ -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%" - bash - out libc libc libc - ,(glibc-dynamic-linker system)))) + bash + out libc libc libc + ,(glibc-dynamic-linker)))) - (chmod "gcc" #o555))))))) + (chmod "gcc" #o555)))))) (inputs `(("tar" ,(lambda (system) (search-bootstrap-binary "tar" system))) -- cgit v1.2.3