guix_mirror_bot pushed a commit to branch core-packages-team
in repository guix.

commit 917454b23391df5d202957884f6d8ce0df2616e9
Author: Nicolas Graves <[email protected]>
AuthorDate: Sat Feb 21 01:53:15 2026 +0100

    gnu: cross-gcc-wrapper: Improve style.
    
    * gnu/packages/commencement.scm (cross-gcc-wrapper)[arguments]:
    Improve style, use G-expressions.
    [native-inputs]: Drop input labels.
    
    Change-Id: I974a68e3fa380f6088a42d195e0d56e42fd4f796
    Signed-off-by: Ludovic Courtès <[email protected]>
---
 gnu/packages/commencement.scm | 75 ++++++++++++++++++++++---------------------
 1 file changed, 38 insertions(+), 37 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index ca2ea21a889..141e6cc7e60 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -3098,44 +3098,45 @@ that makes it available under the native tool names."
      (list
       #:guile %bootstrap-guile
       #:modules '((guix build utils))
-      #:builder #~(begin
-                    (use-modules (guix build utils))
-
-                    (let* ((binutils (assoc-ref %build-inputs "binutils"))
-                           (gcc      (assoc-ref %build-inputs "gcc"))
-                           (libc     (assoc-ref %build-inputs "libc"))
-                           (bash     (assoc-ref %build-inputs "bash"))
-                           (out      (assoc-ref %outputs "out"))
-                           (bindir   (string-append out "/bin"))
-                           (triplet  #$(boot-triplet)))
-                      (define (wrap-program program)
-                        ;; GCC-BOOT0 is a libc-less cross-compiler, so it
-                        ;; needs to be told where to find the crt files and
-                        ;; the dynamic linker.
-                        (call-with-output-file program
-                          (lambda (p)
-                            (format p "#!~a/bin/bash
+      #:builder
+      #~(begin
+          (use-modules (guix build utils))
+
+          (let* ((binutils-bin (dirname
+                                (search-input-file %build-inputs "bin/ar")))
+                 (gcc-libexec  (search-input-directory %build-inputs
+                                                       "libexec/gcc"))
+                 (gcc          (dirname (dirname gcc-libexec)))
+                 (libc.so      (search-input-file %build-inputs
+                                                  "/lib/libc.so"))
+                 (libc         (dirname (dirname libc.so)))
+                 (bash         (search-input-file %build-inputs "bin/bash"))
+                 (bindir       (string-append #$output "/bin"))
+                 (triplet      #$(boot-triplet)))
+            (define (wrap-program program)
+              ;; GCC-BOOT0 is a libc-less cross-compiler, so it
+              ;; needs to be told where to find the crt files and
+              ;; the dynamic linker.
+              (call-with-output-file program
+                (lambda (p)
+                  (format p "#!~a
 exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
-                                    bash
-                                    gcc triplet program
-                                    libc libc
-                                    #$(glibc-dynamic-linker))))
-
-                        (chmod program #o555))
-
-                      (mkdir-p bindir)
-                      (with-directory-excursion bindir
-                        (for-each (lambda (tool)
-                                    (symlink (string-append binutils "/bin/"
-                                                            triplet "-" tool)
-                                             tool))
-                                  '("ar" "ranlib"))
-                        (for-each wrap-program '("gcc" "g++")))))))
-    (native-inputs
-     `(("binutils" ,binutils)
-       ("gcc" ,gcc)
-       ("libc" ,glibc)
-       ("bash" ,bash)))
+                          bash
+                          gcc triplet program
+                          libc libc
+                          #$(glibc-dynamic-linker))))
+
+              (chmod program #o555))
+
+            (mkdir-p bindir)
+            (with-directory-excursion bindir
+              (for-each (lambda (tool)
+                          (symlink (string-append binutils-bin "/"
+                                                  triplet "-" tool)
+                                   tool))
+                        '("ar" "ranlib"))
+              (for-each wrap-program '("gcc" "g++")))))))
+    (native-inputs (list bash binutils gcc glibc))
     (inputs '())))
 
 (define/system-dependent gcc-boot0-intermediate-wrapped

Reply via email to