gnu: make-bootstrap: Remove more input labels.
* gnu/packages/make-bootstrap.scm (%binutils-static-stripped)[inputs]: Remove. [arguments]: Turn #:builder into a gexp. (%mes-minimal-stripped)[inputs]: Remove. [arguments]: Turn #:builder into a gexp. (make-guile-static-stripped): Likewise.master
parent
26d31db742
commit
191c1992b8
|
@ -398,32 +398,31 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
|
||||||
|
|
||||||
(define %binutils-static-stripped
|
(define %binutils-static-stripped
|
||||||
;; The subset of Binutils that we need.
|
;; The subset of Binutils that we need.
|
||||||
(package (inherit %binutils-static)
|
(package
|
||||||
|
(inherit %binutils-static)
|
||||||
(name (string-append (package-name %binutils-static) "-stripped"))
|
(name (string-append (package-name %binutils-static) "-stripped"))
|
||||||
(build-system trivial-build-system)
|
(build-system trivial-build-system)
|
||||||
(outputs '("out"))
|
(outputs '("out"))
|
||||||
(arguments
|
(arguments
|
||||||
`(#:modules ((guix build utils))
|
(list #:modules '((guix build utils))
|
||||||
#:builder
|
#:builder
|
||||||
(begin
|
#~(begin
|
||||||
(use-modules (guix build utils))
|
(use-modules (guix build utils))
|
||||||
|
|
||||||
(setvbuf (current-output-port)
|
(setvbuf (current-output-port)
|
||||||
(cond-expand (guile-2.0 _IOLBF) (else 'line)))
|
(cond-expand (guile-2.0 _IOLBF) (else 'line)))
|
||||||
(let* ((in (assoc-ref %build-inputs "binutils"))
|
(let* ((in #$%binutils-static)
|
||||||
(out (assoc-ref %outputs "out"))
|
(out #$output)
|
||||||
(bin (string-append out "/bin")))
|
(bin (string-append out "/bin")))
|
||||||
(mkdir-p bin)
|
(mkdir-p bin)
|
||||||
(for-each (lambda (file)
|
(for-each (lambda (file)
|
||||||
(let ((target (string-append bin "/" file)))
|
(let ((target (string-append bin "/" file)))
|
||||||
(format #t "copying `~a'...~%" file)
|
(format #t "copying `~a'...~%" file)
|
||||||
(copy-file (string-append in "/bin/" file)
|
(copy-file (string-append in "/bin/" file)
|
||||||
target)
|
target)
|
||||||
(remove-store-references target)))
|
(remove-store-references target)))
|
||||||
'("ar" "as" "ld" "nm" "objcopy" "objdump"
|
'("ar" "as" "ld" "nm" "objcopy" "objdump"
|
||||||
"ranlib" "readelf" "size" "strings" "strip"))
|
"ranlib" "readelf" "size" "strings" "strip"))))))))
|
||||||
#t))))
|
|
||||||
(inputs `(("binutils" ,%binutils-static)))))
|
|
||||||
|
|
||||||
(define (%glibc-stripped)
|
(define (%glibc-stripped)
|
||||||
;; GNU libc's essential shared libraries, dynamic linker, and headers,
|
;; GNU libc's essential shared libraries, dynamic linker, and headers,
|
||||||
|
@ -536,56 +535,54 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
|
||||||
|
|
||||||
(define %gcc-stripped
|
(define %gcc-stripped
|
||||||
;; The subset of GCC files needed for bootstrap.
|
;; The subset of GCC files needed for bootstrap.
|
||||||
(package (inherit gcc-7)
|
(package
|
||||||
|
(inherit gcc-7)
|
||||||
(name "gcc-stripped")
|
(name "gcc-stripped")
|
||||||
(build-system trivial-build-system)
|
(build-system trivial-build-system)
|
||||||
(source #f)
|
(source #f)
|
||||||
(outputs '("out")) ;only one output
|
(outputs '("out")) ;only one output
|
||||||
(arguments
|
(arguments
|
||||||
`(#:modules ((guix build utils))
|
(list #:modules '((guix build utils))
|
||||||
#:builder
|
#:builder
|
||||||
(begin
|
#~(begin
|
||||||
(use-modules (srfi srfi-1)
|
(use-modules (srfi srfi-1)
|
||||||
(srfi srfi-26)
|
(srfi srfi-26)
|
||||||
(guix build utils))
|
(guix build utils))
|
||||||
|
|
||||||
(setvbuf (current-output-port)
|
(setvbuf (current-output-port)
|
||||||
(cond-expand (guile-2.0 _IOLBF) (else 'line)))
|
(cond-expand (guile-2.0 _IOLBF) (else 'line)))
|
||||||
(let* ((out (assoc-ref %outputs "out"))
|
(let* ((out #$output)
|
||||||
(bindir (string-append out "/bin"))
|
(bindir (string-append out "/bin"))
|
||||||
(libdir (string-append out "/lib"))
|
(libdir (string-append out "/lib"))
|
||||||
(includedir (string-append out "/include"))
|
(includedir (string-append out "/include"))
|
||||||
(libexecdir (string-append out "/libexec"))
|
(libexecdir (string-append out "/libexec"))
|
||||||
(gcc (assoc-ref %build-inputs "gcc")))
|
(gcc #$%gcc-static))
|
||||||
(copy-recursively (string-append gcc "/bin") bindir)
|
(copy-recursively (string-append gcc "/bin") bindir)
|
||||||
(for-each remove-store-references
|
(for-each remove-store-references
|
||||||
(find-files bindir ".*"))
|
(find-files bindir ".*"))
|
||||||
|
|
||||||
(copy-recursively (string-append gcc "/lib") libdir)
|
(copy-recursively (string-append gcc "/lib") libdir)
|
||||||
(for-each remove-store-references
|
(for-each remove-store-references
|
||||||
(remove (cut string-suffix? ".h" <>)
|
(remove (cut string-suffix? ".h" <>)
|
||||||
(find-files libdir ".*")))
|
(find-files libdir ".*")))
|
||||||
|
|
||||||
(copy-recursively (string-append gcc "/libexec")
|
(copy-recursively (string-append gcc "/libexec")
|
||||||
libexecdir)
|
libexecdir)
|
||||||
(for-each remove-store-references
|
(for-each remove-store-references
|
||||||
(find-files libexecdir ".*"))
|
(find-files libexecdir ".*"))
|
||||||
|
|
||||||
;; Starting from GCC 4.8, helper programs built natively
|
;; Starting from GCC 4.8, helper programs built natively
|
||||||
;; (‘genchecksum’, ‘gcc-nm’, etc.) rely on C++ headers.
|
;; (‘genchecksum’, ‘gcc-nm’, etc.) rely on C++ headers.
|
||||||
(copy-recursively (string-append gcc "/include/c++")
|
(copy-recursively (string-append gcc "/include/c++")
|
||||||
(string-append includedir "/c++"))
|
(string-append includedir "/c++"))
|
||||||
|
|
||||||
;; For native builds, check whether the binaries actually work.
|
;; For native builds, check whether the binaries actually work.
|
||||||
,@(if (%current-target-system)
|
#$@(if (%current-target-system)
|
||||||
'()
|
'()
|
||||||
'((for-each (lambda (prog)
|
'((for-each (lambda (prog)
|
||||||
(invoke (string-append gcc "/bin/" prog)
|
(invoke (string-append gcc "/bin/" prog)
|
||||||
"--version"))
|
"--version"))
|
||||||
'("gcc" "g++" "cpp"))))
|
'("gcc" "g++" "cpp"))))))))))
|
||||||
|
|
||||||
#t))))
|
|
||||||
(inputs `(("gcc" ,%gcc-static)))))
|
|
||||||
|
|
||||||
;; Two packages: first build static, bare minimum content.
|
;; Two packages: first build static, bare minimum content.
|
||||||
(define %mescc-tools-static
|
(define %mescc-tools-static
|
||||||
|
@ -608,23 +605,21 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
|
||||||
(name (string-append (package-name %mescc-tools-static) "-stripped"))
|
(name (string-append (package-name %mescc-tools-static) "-stripped"))
|
||||||
(build-system trivial-build-system)
|
(build-system trivial-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
`(#:modules ((guix build utils))
|
(list #:modules '((guix build utils))
|
||||||
#:builder
|
#:builder
|
||||||
(begin
|
#~(begin
|
||||||
(use-modules (guix build utils))
|
(use-modules (guix build utils))
|
||||||
(let* ((in (assoc-ref %build-inputs "mescc-tools"))
|
(let* ((in #$%mescc-tools-static)
|
||||||
(out (assoc-ref %outputs "out"))
|
(out #$output)
|
||||||
(bin (string-append out "/bin")))
|
(bin (string-append out "/bin")))
|
||||||
(mkdir-p bin)
|
(mkdir-p bin)
|
||||||
(for-each (lambda (file)
|
(for-each (lambda (file)
|
||||||
(let ((target (string-append bin "/" file)))
|
(let ((target (string-append bin "/" file)))
|
||||||
(format #t "copying `~a'...~%" file)
|
(format #t "copying `~a'...~%" file)
|
||||||
(copy-file (string-append in "/bin/" file)
|
(copy-file (string-append in "/bin/" file)
|
||||||
target)
|
target)
|
||||||
(remove-store-references target)))
|
(remove-store-references target)))
|
||||||
'( "M1" "blood-elf" "hex2"))
|
'( "M1" "blood-elf" "hex2"))))))))
|
||||||
#t))))
|
|
||||||
(inputs `(("mescc-tools" ,%mescc-tools-static)))))
|
|
||||||
|
|
||||||
;; Two packages: first build static, bare minimum content.
|
;; Two packages: first build static, bare minimum content.
|
||||||
(define-public %mes-minimal
|
(define-public %mes-minimal
|
||||||
|
@ -660,22 +655,20 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
|
||||||
(name (string-append (package-name %mes-minimal) "-stripped"))
|
(name (string-append (package-name %mes-minimal) "-stripped"))
|
||||||
(build-system trivial-build-system)
|
(build-system trivial-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
`(#:modules ((guix build utils))
|
(list #:modules '((guix build utils))
|
||||||
#:allowed-references ()
|
#:allowed-references '()
|
||||||
#:builder
|
#:builder
|
||||||
(begin
|
#~(begin
|
||||||
(use-modules (guix build utils))
|
(use-modules (guix build utils))
|
||||||
(let ((in (assoc-ref %build-inputs "mes"))
|
(let ((in #$%mes-minimal)
|
||||||
(out (assoc-ref %outputs "out")))
|
(out #$output))
|
||||||
|
|
||||||
(copy-recursively in out)
|
(copy-recursively in out)
|
||||||
(for-each (lambda (dir)
|
(for-each (lambda (dir)
|
||||||
(for-each remove-store-references
|
(for-each remove-store-references
|
||||||
(find-files (string-append out "/" dir)
|
(find-files (string-append out "/" dir)
|
||||||
".*")))
|
".*")))
|
||||||
'("bin" "share/mes"))
|
'("bin" "share/mes"))))))))
|
||||||
#t))))
|
|
||||||
(inputs `(("mes" ,%mes-minimal)))))
|
|
||||||
|
|
||||||
(define* (make-guile-static guile patches)
|
(define* (make-guile-static guile patches)
|
||||||
(package-with-relocatable-glibc
|
(package-with-relocatable-glibc
|
||||||
|
@ -754,44 +747,41 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
|
||||||
(build-system trivial-build-system)
|
(build-system trivial-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
;; The end result should depend on nothing but itself.
|
;; The end result should depend on nothing but itself.
|
||||||
`(#:allowed-references ("out")
|
(list #:allowed-references '("out")
|
||||||
#:modules ((guix build utils))
|
#:modules '((guix build utils))
|
||||||
#:builder
|
#:builder
|
||||||
(let ((version ,(version-major+minor (package-version static-guile))))
|
#~(let ((version #$(version-major+minor (package-version static-guile))))
|
||||||
(use-modules (guix build utils))
|
(use-modules (guix build utils))
|
||||||
|
|
||||||
(let* ((in (assoc-ref %build-inputs "guile"))
|
(let* ((in #$static-guile)
|
||||||
(out (assoc-ref %outputs "out"))
|
(out #$output)
|
||||||
(guile1 (string-append in "/bin/guile"))
|
(guile1 (string-append in "/bin/guile"))
|
||||||
(guile2 (string-append out "/bin/guile")))
|
(guile2 (string-append out "/bin/guile")))
|
||||||
(mkdir-p (string-append out "/share/guile/" version))
|
(mkdir-p (string-append out "/share/guile/" version))
|
||||||
(copy-recursively (string-append in "/share/guile/" version)
|
(copy-recursively (string-append in "/share/guile/" version)
|
||||||
(string-append out "/share/guile/" version))
|
(string-append out "/share/guile/" version))
|
||||||
|
|
||||||
(mkdir-p (string-append out "/lib/guile/" version "/ccache"))
|
(mkdir-p (string-append out "/lib/guile/" version "/ccache"))
|
||||||
(copy-recursively (string-append in "/lib/guile/" version "/ccache")
|
(copy-recursively (string-append in "/lib/guile/" version "/ccache")
|
||||||
(string-append out "/lib/guile/" version "/ccache"))
|
(string-append out "/lib/guile/" version "/ccache"))
|
||||||
|
|
||||||
(mkdir (string-append out "/bin"))
|
(mkdir (string-append out "/bin"))
|
||||||
(copy-file guile1 guile2)
|
(copy-file guile1 guile2)
|
||||||
|
|
||||||
;; Verify that the relocated Guile works.
|
;; Verify that the relocated Guile works.
|
||||||
,@(if (%current-target-system)
|
#$@(if (%current-target-system)
|
||||||
'()
|
'()
|
||||||
'((invoke guile2 "--version")))
|
'((invoke guile2 "--version")))
|
||||||
|
|
||||||
;; Strip store references.
|
;; Strip store references.
|
||||||
(remove-store-references guile2)
|
(remove-store-references guile2)
|
||||||
|
|
||||||
;; Verify that the stripped Guile works. If it aborts, it could be
|
;; Verify that the stripped Guile works. If it aborts, it could be
|
||||||
;; that it tries to open iconv descriptors and fails because libc's
|
;; that it tries to open iconv descriptors and fails because libc's
|
||||||
;; iconv data isn't available (see `guile-default-utf8.patch'.)
|
;; iconv data isn't available (see `guile-default-utf8.patch'.)
|
||||||
,@(if (%current-target-system)
|
#$@(if (%current-target-system)
|
||||||
'()
|
'()
|
||||||
'((invoke guile2 "--version")))
|
'((invoke guile2 "--version")))))))
|
||||||
|
|
||||||
#t))))
|
|
||||||
(inputs `(("guile" ,static-guile)))
|
|
||||||
(outputs '("out"))
|
(outputs '("out"))
|
||||||
(synopsis "Minimal statically-linked and relocatable Guile")))
|
(synopsis "Minimal statically-linked and relocatable Guile")))
|
||||||
|
|
||||||
|
|
Reference in New Issue