1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-05-28 20:12:11 +02:00

gnu: glibc-mesboot0: Improve style.

* gnu/packages/commencement.scm (glibc-mesboot0)[arguments]
<#:make-flags, #:configure-flags, #:phases>: Improve style, use
G-expressions and search-input-file.  In phase 'fixup-configure, drop
duplicate string substitution.

Change-Id: If2f08e5c776384d77182180ca8992fa67bf0a235
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Nicolas Graves
2026-02-17 14:24:04 +01:00
committed by Ludovic Courtès
parent ddfa1235b2
commit e639999ba7
+61 -68
View File
@@ -1117,74 +1117,67 @@ ac_cv_c_float_format='IEEE (little-endian)'
,@(%boot-mesboot-core-inputs))) ,@(%boot-mesboot-core-inputs)))
(outputs '("out")) (outputs '("out"))
(arguments (arguments
(list #:implicit-inputs? #f (list
#:guile %bootstrap-guile #:implicit-inputs? #f
#:tests? #f #:guile %bootstrap-guile
#:strip-binaries? #f #:tests? #f
#:validate-runpath? #f ; no dynamic executables #:strip-binaries? #f
#:parallel-build? #f ; gcc-2.95.3 ICEs on massively parallel builds #:validate-runpath? #f ; no dynamic executables
#:make-flags #~(list (string-append #:parallel-build? #f ; gcc-2.95.3 ICEs on massively parallel builds
"SHELL=" #:make-flags
(assoc-ref %build-inputs "bash") #~(list (string-append "SHELL="
"/bin/sh")) (search-input-file %build-inputs "/bin/sh")))
#:configure-flags #:configure-flags
#~(let ((out (assoc-ref %outputs "out")) #~(let ((ioctl.h (search-input-file %build-inputs
(headers (assoc-ref %build-inputs "headers"))) "/include/asm/ioctl.h")))
`("--disable-shared" (list "--disable-shared"
"--enable-static" "--enable-static"
"--disable-sanity-checks" "--disable-sanity-checks"
"--build=i686-unknown-linux-gnu" "--build=i686-unknown-linux-gnu"
"--host=i686-unknown-linux-gnu" "--host=i686-unknown-linux-gnu"
,(string-append "--with-headers=" headers "/include") (string-append "--with-headers=" (dirname (dirname ioctl.h)))
"--enable-static-nss" "--enable-static-nss"
"--without-__thread" "--without-__thread"
"--without-cvs" "--without-cvs"
"--without-gd" "--without-gd"
"--without-tls" "--without-tls"
,(string-append "--prefix=" out))) (string-append "--prefix=" #$output)))
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
(add-after 'unpack 'apply-boot-patch (add-after 'unpack 'apply-boot-patch
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(invoke "patch" "--force" "-p1" "-i" (invoke "patch" "--force" "-p1" "-i"
#$(local-file #$(local-file
(search-patch "glibc-boot-2.2.5.patch"))) (search-patch "glibc-boot-2.2.5.patch")))
(invoke "patch" "--force" "-p1" "-i" (invoke "patch" "--force" "-p1" "-i"
#$(local-file #$(local-file
(search-patch "glibc-bootstrap-system-2.2.5.patch"))))) (search-patch "glibc-bootstrap-system-2.2.5.patch")))))
(add-before 'configure 'setenv (add-before 'configure 'setenv
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out")) (let ((bash (search-input-file inputs "/bin/bash"))
(bash (assoc-ref %build-inputs "bash")) (gcc (search-input-file inputs "/bin/gcc"))
(shell (string-append bash "/bin/bash")) (cppflags (string-append
(gcc (assoc-ref %build-inputs "gcc")) ;;" -D __STDC__=1"
(headers (assoc-ref %build-inputs "headers")) " -D MES_BOOTSTRAP=1"
(cppflags (string-append " -D BOOTSTRAP_GLIBC=1"))
;;" -D __STDC__=1" (cflags (string-append " -L " (getcwd))))
" -D MES_BOOTSTRAP=1" (setenv "CONFIG_SHELL" bash)
" -D BOOTSTRAP_GLIBC=1")) (setenv "SHELL" bash)
(cflags (string-append " -L " (getcwd)))) (setenv "CPP" (string-append gcc " -E " cppflags))
(setenv "CONFIG_SHELL" shell) (setenv "CC" (string-append gcc " " cppflags cflags)))))
(setenv "SHELL" shell) (replace 'configure ; needs classic invocation of configure
(setenv "CPP" (string-append gcc "/bin/gcc -E " cppflags)) (lambda* (#:key configure-flags #:allow-other-keys)
(setenv "CC" (string-append gcc "/bin/gcc " cppflags cflags))))) (format (current-error-port)
(replace 'configure ; needs classic invocation of configure "running ./configure ~a\n" (string-join configure-flags))
(lambda* (#:key configure-flags #:allow-other-keys) (apply invoke "./configure" configure-flags)))
(format (current-error-port) (add-after 'configure 'fixup-configure
"running ./configure ~a\n" (string-join configure-flags)) (lambda* (#:key inputs #:allow-other-keys)
(apply invoke "./configure" configure-flags))) (let ((bash (search-input-file inputs "/bin/bash")))
(add-after 'configure 'fixup-configure (substitute* "config.make"
(lambda _ (("INSTALL = scripts/")
(let* ((out (assoc-ref %outputs "out")) "INSTALL = $(..)./scripts/")
(bash (assoc-ref %build-inputs "bash")) (("BASH = ")
(shell (string-append bash "/bin/bash"))) (string-append "SHELL = " bash "\nBASH = ")))))))))))
(substitute* "config.make"
(("INSTALL = scripts/") "INSTALL = $(..)./scripts/"))
(substitute* "config.make"
(("INSTALL = scripts/") "INSTALL = $(..)./scripts/")
(("BASH = ") (string-append
"SHELL = " shell "
BASH = ")))))))))))
(define gcc-mesboot0 (define gcc-mesboot0
(package (package