guix-commits
[Top][All Lists]
Advanced

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

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


From: Ludovic Courtès
Subject: 01/06: gnu: bootstrap: Move 'use-modules' forms to the beginning of build expressions.
Date: Wed, 02 Sep 2015 21:39:50 +0000

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

commit d255c1228d93b2f8efc1a1c91a72c91dd479e9cb
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 files changed, 62 insertions(+), 57 deletions(-)

diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index f3c1c5a..028bc2a 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -103,22 +103,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)))
@@ -360,26 +361,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)))
@@ -424,38 +427,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]