gnu: static-binaries: Use gexps.
This fixes "guix build static-binaries-tarball". * gnu/packages/make-bootstrap.scm (%static-inputs): Use gexps.
This commit is contained in:
		
							parent
							
								
									476741c5bb
								
							
						
					
					
						commit
						4eda203420
					
				
					 1 changed files with 70 additions and 73 deletions
				
			
		| 
						 | 
					@ -159,10 +159,13 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(define %static-inputs
 | 
					(define %static-inputs
 | 
				
			||||||
  ;; Packages that are to be used as %BOOTSTRAP-INPUTS.
 | 
					  ;; Packages that are to be used as %BOOTSTRAP-INPUTS.
 | 
				
			||||||
  (let ((coreutils (package (inherit coreutils)
 | 
					  (let ((coreutils (package
 | 
				
			||||||
 | 
					                     (inherit coreutils)
 | 
				
			||||||
                     (arguments
 | 
					                     (arguments
 | 
				
			||||||
                       `(#:configure-flags
 | 
					                      (substitute-keyword-arguments
 | 
				
			||||||
                         '("--disable-nls"
 | 
					                          (package-arguments coreutils)
 | 
				
			||||||
 | 
					                        ((#:configure-flags _ #~'())
 | 
				
			||||||
 | 
					                         #~'("--disable-nls"
 | 
				
			||||||
                             "--disable-silent-rules"
 | 
					                             "--disable-silent-rules"
 | 
				
			||||||
                             "--enable-no-install-program=stdbuf,libstdbuf.so"
 | 
					                             "--enable-no-install-program=stdbuf,libstdbuf.so"
 | 
				
			||||||
                             "CFLAGS=-Os -g0"   ; smaller, please
 | 
					                             "CFLAGS=-Os -g0"   ; smaller, please
 | 
				
			||||||
| 
						 | 
					@ -171,45 +174,40 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
 | 
				
			||||||
                             ;; Work around a cross-compilation bug whereby libcoreutils.a
 | 
					                             ;; Work around a cross-compilation bug whereby libcoreutils.a
 | 
				
			||||||
                             ;; would provide '__mktime_internal', which conflicts with the
 | 
					                             ;; would provide '__mktime_internal', which conflicts with the
 | 
				
			||||||
                             ;; one in libc.a.
 | 
					                             ;; one in libc.a.
 | 
				
			||||||
                           ,@(if (%current-target-system)
 | 
					                             #$@(if (%current-target-system)
 | 
				
			||||||
                                 `("gl_cv_func_working_mktime=yes")
 | 
					                                    #~("gl_cv_func_working_mktime=yes")
 | 
				
			||||||
                                 '()))
 | 
					                                    #~())))
 | 
				
			||||||
 | 
					                        ((#:tests? _ #t)
 | 
				
			||||||
 | 
					                         #f)))               ;signal-related Gnulib tests fail
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                         #:tests? #f   ; signal-related Gnulib tests fail
 | 
					                      ;; Remove optional dependencies such as GMP.
 | 
				
			||||||
                         ,@(package-arguments coreutils)))
 | 
					                      (inputs '())
 | 
				
			||||||
 | 
					 | 
				
			||||||
                      ;; Remove optional dependencies such as GMP.  Keep Perl
 | 
					 | 
				
			||||||
                      ;; except if it's missing (which is the case when
 | 
					 | 
				
			||||||
                      ;; cross-compiling).
 | 
					 | 
				
			||||||
                      (inputs (match (assoc "perl" (package-inputs coreutils))
 | 
					 | 
				
			||||||
                                (#f '())
 | 
					 | 
				
			||||||
                                (x  (list x))))
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                      ;; Remove the 'debug' output (see above for the reason.)
 | 
					                      ;; Remove the 'debug' output (see above for the reason.)
 | 
				
			||||||
                      (outputs '("out"))))
 | 
					                      (outputs '("out"))))
 | 
				
			||||||
        (bzip2 (package (inherit bzip2)
 | 
					        (bzip2 (package
 | 
				
			||||||
 | 
					                 (inherit bzip2)
 | 
				
			||||||
                 (arguments
 | 
					                 (arguments
 | 
				
			||||||
                  (substitute-keyword-arguments (package-arguments bzip2)
 | 
					                  (substitute-keyword-arguments (package-arguments bzip2)
 | 
				
			||||||
                    ((#:phases phases)
 | 
					                    ((#:phases phases)
 | 
				
			||||||
                     `(modify-phases ,phases
 | 
					                     #~(modify-phases #$phases
 | 
				
			||||||
                         (add-before 'build 'dash-static
 | 
					                         (add-before 'build 'dash-static
 | 
				
			||||||
                           (lambda _
 | 
					                           (lambda _
 | 
				
			||||||
                             (substitute* "Makefile"
 | 
					                             (substitute* "Makefile"
 | 
				
			||||||
                               (("^LDFLAGS[[:blank:]]*=.*$")
 | 
					                               (("^LDFLAGS[[:blank:]]*=.*$")
 | 
				
			||||||
                               "LDFLAGS = -static"))
 | 
					                                "LDFLAGS = -static"))))))))))
 | 
				
			||||||
                            #t))))))))
 | 
					        (xz (package
 | 
				
			||||||
        (xz (package (inherit xz)
 | 
					              (inherit xz)
 | 
				
			||||||
              (outputs '("out"))
 | 
					              (outputs '("out"))
 | 
				
			||||||
              (arguments
 | 
					              (arguments
 | 
				
			||||||
               `(#:strip-flags '("--strip-all")
 | 
					               (list #:strip-flags #~'("--strip-all")
 | 
				
			||||||
                 #:phases (modify-phases %standard-phases
 | 
					                     #:phases #~(modify-phases %standard-phases
 | 
				
			||||||
                                  (add-before 'configure 'static-executable
 | 
					                                  (add-before 'configure 'static-executable
 | 
				
			||||||
                                    (lambda _
 | 
					                                    (lambda _
 | 
				
			||||||
                                      ;; Ask Libtool for a static executable.
 | 
					                                      ;; Ask Libtool for a static executable.
 | 
				
			||||||
                                      (substitute* "src/xz/Makefile.in"
 | 
					                                      (substitute* "src/xz/Makefile.in"
 | 
				
			||||||
                                        (("^xz_LDADD =")
 | 
					                                        (("^xz_LDADD =")
 | 
				
			||||||
                                   "xz_LDADD = -all-static"))
 | 
					                                         "xz_LDADD = -all-static")))))))))
 | 
				
			||||||
                                #t)))))))
 | 
					 | 
				
			||||||
        (gawk (package
 | 
					        (gawk (package
 | 
				
			||||||
                (inherit gawk)
 | 
					                (inherit gawk)
 | 
				
			||||||
                (source (origin
 | 
					                (source (origin
 | 
				
			||||||
| 
						 | 
					@ -225,45 +223,44 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
 | 
				
			||||||
                                         (origin-patches
 | 
					                                         (origin-patches
 | 
				
			||||||
                                          (package-source gawk))))))
 | 
					                                          (package-source gawk))))))
 | 
				
			||||||
                (arguments
 | 
					                (arguments
 | 
				
			||||||
                 `(;; Starting from gawk 4.1.0, some of the tests for the
 | 
					                 (substitute-keyword-arguments (package-arguments gawk)
 | 
				
			||||||
 | 
					                   ((#:configure-flags _ #~'())
 | 
				
			||||||
 | 
					                    ;; Starting from gawk 4.1.0, some of the tests for the
 | 
				
			||||||
                    ;; plug-in mechanism just fail on static builds:
 | 
					                    ;; plug-in mechanism just fail on static builds:
 | 
				
			||||||
                    ;;
 | 
					                    ;;
 | 
				
			||||||
                    ;; ./fts.awk:1: error: can't open shared library `filefuncs' for reading (No such file or directory)
 | 
					                    ;; ./fts.awk:1: error: can't open shared library `filefuncs' for reading (No such file or directory)
 | 
				
			||||||
                    ;;
 | 
					                    ;;
 | 
				
			||||||
                    ;; Therefore disable extensions support.
 | 
					                    ;; Therefore disable extensions support.
 | 
				
			||||||
                   #:configure-flags (list "--disable-extensions")
 | 
					                    #~(list "--disable-extensions"))
 | 
				
			||||||
 | 
					 | 
				
			||||||
                   ,@(substitute-keyword-arguments (package-arguments gawk)
 | 
					 | 
				
			||||||
                   ((#:phases phases)
 | 
					                   ((#:phases phases)
 | 
				
			||||||
                        `(modify-phases ,phases
 | 
					                    #~(modify-phases #$phases
 | 
				
			||||||
                        (add-before 'configure 'no-export-dynamic
 | 
					                        (add-before 'configure 'no-export-dynamic
 | 
				
			||||||
                          (lambda _
 | 
					                          (lambda _
 | 
				
			||||||
                            ;; Since we use `-static', remove
 | 
					                            ;; Since we use `-static', remove
 | 
				
			||||||
                            ;; `-export-dynamic'.
 | 
					                            ;; `-export-dynamic'.
 | 
				
			||||||
                            (substitute* "configure"
 | 
					                            (substitute* "configure"
 | 
				
			||||||
                                 (("-Wl,-export-dynamic") ""))
 | 
					                              (("-Wl,-export-dynamic") ""))))))))
 | 
				
			||||||
                               #t)))))))
 | 
					 | 
				
			||||||
                (inputs (if (%current-target-system)
 | 
					                (inputs (if (%current-target-system)
 | 
				
			||||||
                            `(("bash" ,static-bash))
 | 
					                            (list static-bash)
 | 
				
			||||||
                            '()))))
 | 
					                            '()))))
 | 
				
			||||||
	(tar (package (inherit tar)
 | 
						(tar (package
 | 
				
			||||||
 | 
					               (inherit tar)
 | 
				
			||||||
	       (arguments
 | 
						       (arguments
 | 
				
			||||||
                `(;; Work around a cross-compilation bug whereby libgnu.a would provide
 | 
					                `(;; Work around a cross-compilation bug whereby libgnu.a would provide
 | 
				
			||||||
                  ;; '__mktime_internal', which conflicts with the one in libc.a.
 | 
					                  ;; '__mktime_internal', which conflicts with the one in libc.a.
 | 
				
			||||||
                  ,@(if (%current-target-system)
 | 
					                  ;; ,@(if (%current-target-system)
 | 
				
			||||||
                        `(#:configure-flags '("gl_cv_func_working_mktime=yes"))
 | 
					                  ;;       `(#:configure-flags '("gl_cv_func_working_mktime=yes"))
 | 
				
			||||||
                        '())
 | 
					                  ;;       '())
 | 
				
			||||||
                  ,@(substitute-keyword-arguments (package-arguments tar)
 | 
					                  ,@(substitute-keyword-arguments (package-arguments tar)
 | 
				
			||||||
                      ((#:phases phases)
 | 
					                      ((#:phases phases)
 | 
				
			||||||
                       `(modify-phases ,phases
 | 
					                       #~(modify-phases #$phases
 | 
				
			||||||
                           (replace 'set-shell-file-name
 | 
					                           (replace 'set-shell-file-name
 | 
				
			||||||
                             (lambda _
 | 
					                             (lambda _
 | 
				
			||||||
                               ;; Do not use "/bin/sh" to run programs; see
 | 
					                               ;; Do not use "/bin/sh" to run programs; see
 | 
				
			||||||
                               ;; <http://lists.gnu.org/archive/html/guix-devel/2016-09/msg02272.html>.
 | 
					                               ;; <http://lists.gnu.org/archive/html/guix-devel/2016-09/msg02272.html>.
 | 
				
			||||||
                               (substitute* "src/system.c"
 | 
					                               (substitute* "src/system.c"
 | 
				
			||||||
                                 (("/bin/sh") "sh")
 | 
					                                 (("/bin/sh") "sh")
 | 
				
			||||||
                                (("execv ") "execvp "))
 | 
					                                 (("execv ") "execvp ")))))))))))
 | 
				
			||||||
                              #t)))))))))
 | 
					 | 
				
			||||||
        ;; We don't want to retain a reference to /gnu/store in the bootstrap
 | 
					        ;; We don't want to retain a reference to /gnu/store in the bootstrap
 | 
				
			||||||
        ;; versions of egrep/fgrep, so we remove the custom phase added since
 | 
					        ;; versions of egrep/fgrep, so we remove the custom phase added since
 | 
				
			||||||
        ;; grep@2.25. The effect is 'egrep' and 'fgrep' look for 'grep' in
 | 
					        ;; grep@2.25. The effect is 'egrep' and 'fgrep' look for 'grep' in
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue