guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/08: gnu: bootstrap: Move 'use-modules' forms to the beginning of buil


From: David Craven
Subject: 01/08: gnu: bootstrap: Move 'use-modules' forms to the beginning of build expressions.
Date: Fri, 6 Jan 2017 11:16:03 +0000 (UTC)

dvc pushed a commit to branch wip-build-systems-gexp
in repository guix.

commit 17350523837967028c70184d11b62bc943759634
Author: Ludovic Court├Ęs <address@hidden>
Date:   Thu Mar 26 23:01:12 2015 +0100

    gnu: bootstrap: Move 'use-modules' forms to the beginning of build 
expressions.
    
    * gnu/packages/bootstrap.scm (package-from-tarball)[arguments]: Move
      'use-modules' form to the beginning.
      (%bootstrap-glibc, %bootstrap-gcc): Likewise.
---
 gnu/packages/bootstrap.scm |  119 +++++++++++++++++++++++---------------------
 1 file changed, 62 insertions(+), 57 deletions(-)

diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index dd922c3..9e4a706 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -104,22 +104,23 @@ successful, or false to signal an error."
      `(#: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"))
-             (tarball (assoc-ref %build-inputs "tarball")))
+       (begin
          (use-modules (guix build utils))
 
-         (mkdir out)
-         (copy-file tarball "binaries.tar.xz")
-         (system* xz "-d" "binaries.tar.xz")
-         (let ((builddir (getcwd)))
-           (with-directory-excursion out
-             (and (zero? (system* tar "xvf"
-                                  (string-append builddir "/binaries.tar")))
-                  ,@(if snippet (list snippet) '())
-                  (zero? (system* (string-append "bin/" ,program-to-test)
-                                  "--version"))))))))
+         (let ((out     (assoc-ref %outputs "out"))
+               (tar     (assoc-ref %build-inputs "tar"))
+               (xz      (assoc-ref %build-inputs "xz"))
+               (tarball (assoc-ref %build-inputs "tarball")))
+           (mkdir out)
+           (copy-file tarball "binaries.tar.xz")
+           (system* xz "-d" "binaries.tar.xz")
+           (let ((builddir (getcwd)))
+             (with-directory-excursion out
+               (and (zero? (system* tar "xvf"
+                                    (string-append builddir "/binaries.tar")))
+                    ,@(if snippet (list snippet) '())
+                    (zero? (system* (string-append "bin/" ,program-to-test)
+                                    "--version")))))))))
     (inputs
      `(("tar" ,(search-bootstrap-binary "tar" (%current-system)))
        ("xz"  ,(search-bootstrap-binary "xz" (%current-system)))
@@ -368,26 +369,28 @@ $out/bin/guile --version~%"
      `(#: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"))
-             (tarball (assoc-ref %build-inputs "tarball")))
+       (begin
          (use-modules (guix build utils))
 
-         (mkdir out)
-         (copy-file tarball "binaries.tar.xz")
-         (system* xz "-d" "binaries.tar.xz")
-         (let ((builddir (getcwd)))
-           (with-directory-excursion out
-             (system* tar "xvf"
-                      (string-append builddir
-                                     "/binaries.tar"))
-             (chmod "lib" #o755)
-
-             ;; Patch libc.so so it refers to the right path.
-             (substitute* "lib/libc.so"
-               (("/[^ ]+/lib/(libc|ld)" _ prefix)
-                (string-append out "/lib/" prefix))))))))
+         (let ((out     (assoc-ref %outputs "out"))
+               (tar     (assoc-ref %build-inputs "tar"))
+               (xz      (assoc-ref %build-inputs "xz"))
+               (tarball (assoc-ref %build-inputs "tarball")))
+
+           (mkdir out)
+           (copy-file tarball "binaries.tar.xz")
+           (system* xz "-d" "binaries.tar.xz")
+           (let ((builddir (getcwd)))
+             (with-directory-excursion out
+               (system* tar "xvf"
+                        (string-append builddir
+                                       "/binaries.tar"))
+               (chmod "lib" #o755)
+
+               ;; Patch libc.so so it refers to the right path.
+               (substitute* "lib/libc.so"
+                 (("/[^ ]+/lib/(libc|ld)" _ prefix)
+                  (string-append out "/lib/" prefix)))))))))
     (inputs
      `(("tar" ,(search-bootstrap-binary "tar" (%current-system)))
        ("xz"  ,(search-bootstrap-binary "xz" (%current-system)))
@@ -432,38 +435,40 @@ $out/bin/guile --version~%"
      `(#: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")))
+       (begin
          (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")))
-
-           (with-directory-excursion bindir
-             (chmod "." #o755)
-             (rename-file "gcc" ".gcc-wrapped")
-             (call-with-output-file "gcc"
-               (lambda (p)
-                 (format p "#!~a
+         (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")))
+
+           (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
 exec ~a/bin/.gcc-wrapped -B~a/lib \
      -Wl,-rpath -Wl,~a/lib \
      -Wl,-dynamic-linker -Wl,~a/~a \"address@hidden"~%"
-                         bash
-                         out libc libc libc
-                         ,(glibc-dynamic-linker))))
+                           bash
+                           out libc libc libc
+                           ,(glibc-dynamic-linker))))
 
-             (chmod "gcc" #o555))))))
+               (chmod "gcc" #o555)))))))
     (inputs
      `(("tar" ,(search-bootstrap-binary "tar" (%current-system)))
        ("xz"  ,(search-bootstrap-binary "xz" (%current-system)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]