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

commit 8ae288fdd507e6556ee5b1a5b14238d4f5f117c8
Author: Nicolas Graves <[email protected]>
AuthorDate: Wed Feb 18 10:06:38 2026 +0100

    gnu: glibc-headers-mesboot: Improve style.
    
    * gnu/packages/commencement.scm (glibc-headers-mesboot)
    [native-inputs]: Drop input labels.
    [arguments]<#:configure-flags, #:phases>: Improve style, use
    G-expressions and search-input-file, rewrite phase 'remove-sunrpc.
    
    Change-Id: I9062160a259d11a7c73041d8585f0b0c9f23c53b
    Signed-off-by: Ludovic Courtès <[email protected]>
---
 gnu/packages/commencement.scm | 67 ++++++++++++++++++++++---------------------
 1 file changed, 34 insertions(+), 33 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index f3dd2bf3fe6..cd61f288b58 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -1592,18 +1592,21 @@ ac_cv_c_float_format='IEEE (little-endian)'
                (sha256
                 (base32
                  "0vlz4x6cgz7h54qq4528q526qlhnsjzbsvgc4iizn76cb0bfanx7")))))
-    (native-inputs `(("headers" ,mesboot-headers)
-                     ,@(%boot-mesboot3-inputs)))
+    (native-inputs (cons* mesboot-headers
+                          (map cadr (%boot-mesboot3-inputs))))
     (arguments
      (substitute-keyword-arguments arguments
        ((#:configure-flags configure-flags)
-        #~(let ((out (assoc-ref %outputs "out"))
-                (headers (assoc-ref %build-inputs "headers")))
+        #~(let ((kernel-headers
+                 (search-input-directory %build-inputs
+                                         #$(if (system-hurd?)
+                                               "include/mach"
+                                               "include/linux"))))
             (list
-             (string-append "--prefix=" out)
+             (string-append "--prefix=" #$output)
              "--disable-obsolete-rpc"
              "--host=i686-unknown-linux-gnu"
-             (string-append "--with-headers=" headers "/include")
+             (string-append "--with-headers=" (dirname kernel-headers))
              "--enable-static-nss"
              "--with-pthread"
              "--without-cvs"
@@ -1624,9 +1627,9 @@ ac_cv_c_float_format='IEEE (little-endian)'
                 (chdir (string-append "glibc-" #$version))))
             (replace 'setenv
               (lambda* (#:key inputs #:allow-other-keys)
-                (let* ((headers  (assoc-ref inputs "headers"))
-                       (libc     (assoc-ref inputs "libc"))
-                       (gcc      (assoc-ref inputs "gcc"))
+                (let* ((libc.a   (search-input-file inputs "/lib/libc.a"))
+                       (libc     (dirname (dirname libc.a)))
+                       (gcc      (search-input-file inputs "/bin/gcc"))
                        (cppflags (string-append
                                   " -I " (getcwd) "/nptl/sysdeps/pthread/bits"
                                   " -D BOOTSTRAP_GLIBC=1"))
@@ -1636,8 +1639,8 @@ ac_cv_c_float_format='IEEE (little-endian)'
                   (setenv "CONFIG_SHELL" (which "sh"))
                   (setenv "SHELL" (which "sh"))
 
-                  (setenv "CPP" (string-append gcc "/bin/gcc -E " cppflags))
-                  (setenv "CC" (string-append gcc "/bin/gcc " cppflags cflags))
+                  (setenv "CPP" (string-append gcc " -E " cppflags))
+                  (setenv "CC" (string-append gcc " " cppflags cflags))
                   (setenv "LD" "gcc")
 
                   ;; avoid -fstack-protector
@@ -1645,11 +1648,15 @@ ac_cv_c_float_format='IEEE (little-endian)'
                   (substitute* "configure"
                     (("/bin/pwd") "pwd")))))
             (replace 'install
-              (lambda* (#:key outputs make-flags #:allow-other-keys)
-                (let ((kernel-headers (assoc-ref %build-inputs 
"kernel-headers"))
-                      (out (assoc-ref outputs "out")))
+              (lambda* (#:key inputs outputs make-flags #:allow-other-keys)
+                (let* ((kernel-headers
+                        (search-input-directory inputs
+                                                #$(if (system-hurd?)
+                                                      "include/mach"
+                                                      "include/linux")))
+                       (kernel-headers (dirname (dirname kernel-headers))))
                   (apply invoke "make" make-flags)
-                  (copy-recursively kernel-headers out))))
+                  (copy-recursively kernel-headers #$output))))
             (add-before 'configure 'remove-bashism
               (lambda _
                 (substitute* "sysdeps/unix/make-syscalls.sh"
@@ -1663,24 +1670,18 @@ ac_cv_c_float_format='IEEE (little-endian)'
                 (chdir "build")
                 (apply invoke "../configure" configure-flags)))
             (add-after 'configure 'remove-sunrpc
-              (lambda _
-                (let* ((out (assoc-ref %outputs "out"))
-                       (bash (assoc-ref %build-inputs "bash"))
-                       (shell (string-append bash "/bin/bash")))
-
-                  (let ((Makefile (open-file "Makefile" "a")))
-                    (display (string-append "
-
-SHELL := " shell "
-")
-                             Makefile)
-                    (close Makefile))
-                  (substitute* "../Makefile"
-                    (("^SHELL := /bin/sh") (string-append "SHELL := " shell)))
-                  (substitute* "../Makeconfig"
-                    (("^SHELL := /bin/sh") (string-append "SHELL := " shell)))
-                  (substitute* "../elf/Makefile"
-                    (("^SHELL := /bin/sh") (string-append "SHELL := " shell)))
+              (lambda* (#:key inputs #:allow-other-keys)
+                (let ((shell (search-input-file inputs "/bin/bash"))
+                      (Makefile (open-file "Makefile" "a")))
+                  (display (string-append "\n\nSHELL := " shell "\n")
+                           Makefile)
+                  (close Makefile)
+
+                  (substitute* (list "../Makefile"
+                                     "../Makeconfig"
+                                     "../elf/Makefile")
+                    (("^SHELL := /bin/sh")
+                     (string-append "SHELL := " shell)))
                   (invoke "make" (string-append (getcwd) "/sysd-sorted" ))
                   (substitute* "sysd-sorted"
                     ((" sunrpc") " ")

Reply via email to