diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2023-02-28 17:09:00 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2023-02-28 17:10:40 +0100 |
| commit | 4eda2034201e39edb077f0160554fabbed0e0cdb (patch) | |
| tree | a318f26a7ce0967695927e055055aa20ef938e8b /gnu/packages/make-bootstrap.scm | |
| parent | 476741c5bbe92da4a1393724971036f1ada416da (diff) | |
gnu: static-binaries: Use gexps.
This fixes "guix build static-binaries-tarball".
* gnu/packages/make-bootstrap.scm (%static-inputs): Use gexps.
Diffstat (limited to 'gnu/packages/make-bootstrap.scm')
| -rw-r--r-- | gnu/packages/make-bootstrap.scm | 147 |
1 files changed, 72 insertions, 75 deletions
diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm index affdd30946b..5a9f6f42677 100644 --- a/gnu/packages/make-bootstrap.scm +++ b/gnu/packages/make-bootstrap.scm | |||
| @@ -159,57 +159,55 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." | |||
| 159 | 159 | ||
| 160 | (define %static-inputs | 160 | (define %static-inputs |
| 161 | ;; Packages that are to be used as %BOOTSTRAP-INPUTS. | 161 | ;; Packages that are to be used as %BOOTSTRAP-INPUTS. |
| 162 | (let ((coreutils (package (inherit coreutils) | 162 | (let ((coreutils (package |
| 163 | (arguments | 163 | (inherit coreutils) |
| 164 | `(#:configure-flags | 164 | (arguments |
| 165 | '("--disable-nls" | 165 | (substitute-keyword-arguments |
| 166 | "--disable-silent-rules" | 166 | (package-arguments coreutils) |
| 167 | "--enable-no-install-program=stdbuf,libstdbuf.so" | 167 | ((#:configure-flags _ #~'()) |
| 168 | "CFLAGS=-Os -g0" ; smaller, please | 168 | #~'("--disable-nls" |
| 169 | "LDFLAGS=-static -pthread" | 169 | "--disable-silent-rules" |
| 170 | 170 | "--enable-no-install-program=stdbuf,libstdbuf.so" | |
| 171 | ;; Work around a cross-compilation bug whereby libcoreutils.a | 171 | "CFLAGS=-Os -g0" ; smaller, please |
| 172 | ;; would provide '__mktime_internal', which conflicts with the | 172 | "LDFLAGS=-static -pthread" |
| 173 | ;; one in libc.a. | 173 | |
| 174 | ,@(if (%current-target-system) | 174 | ;; Work around a cross-compilation bug whereby libcoreutils.a |
| 175 | `("gl_cv_func_working_mktime=yes") | 175 | ;; would provide '__mktime_internal', which conflicts with the |
| 176 | '())) | 176 | ;; one in libc.a. |
| 177 | 177 | #$@(if (%current-target-system) | |
| 178 | #:tests? #f ; signal-related Gnulib tests fail | 178 | #~("gl_cv_func_working_mktime=yes") |
| 179 | ,@(package-arguments coreutils))) | 179 | #~()))) |
| 180 | 180 | ((#:tests? _ #t) | |
| 181 | ;; Remove optional dependencies such as GMP. Keep Perl | 181 | #f))) ;signal-related Gnulib tests fail |
| 182 | ;; except if it's missing (which is the case when | 182 | |
| 183 | ;; cross-compiling). | 183 | ;; Remove optional dependencies such as GMP. |
| 184 | (inputs (match (assoc "perl" (package-inputs coreutils)) | 184 | (inputs '()) |
| 185 | (#f '()) | ||
| 186 | (x (list x)))) | ||
| 187 | 185 | ||
| 188 | ;; Remove the 'debug' output (see above for the reason.) | 186 | ;; Remove the 'debug' output (see above for the reason.) |
| 189 | (outputs '("out")))) | 187 | (outputs '("out")))) |
| 190 | (bzip2 (package (inherit bzip2) | 188 | (bzip2 (package |
| 189 | (inherit bzip2) | ||
| 191 | (arguments | 190 | (arguments |
| 192 | (substitute-keyword-arguments (package-arguments bzip2) | 191 | (substitute-keyword-arguments (package-arguments bzip2) |
| 193 | ((#:phases phases) | 192 | ((#:phases phases) |
| 194 | `(modify-phases ,phases | 193 | #~(modify-phases #$phases |
| 195 | (add-before 'build 'dash-static | 194 | (add-before 'build 'dash-static |
| 196 | (lambda _ | 195 | (lambda _ |
| 197 | (substitute* "Makefile" | 196 | (substitute* "Makefile" |
| 198 | (("^LDFLAGS[[:blank:]]*=.*$") | 197 | (("^LDFLAGS[[:blank:]]*=.*$") |
| 199 | "LDFLAGS = -static")) | 198 | "LDFLAGS = -static")))))))))) |
| 200 | #t)))))))) | 199 | (xz (package |
| 201 | (xz (package (inherit xz) | 200 | (inherit xz) |
| 202 | (outputs '("out")) | 201 | (outputs '("out")) |
| 203 | (arguments | 202 | (arguments |
| 204 | `(#:strip-flags '("--strip-all") | 203 | (list #:strip-flags #~'("--strip-all") |
| 205 | #:phases (modify-phases %standard-phases | 204 | #:phases #~(modify-phases %standard-phases |
| 206 | (add-before 'configure 'static-executable | 205 | (add-before 'configure 'static-executable |
| 207 | (lambda _ | 206 | (lambda _ |
| 208 | ;; Ask Libtool for a static executable. | 207 | ;; Ask Libtool for a static executable. |
| 209 | (substitute* "src/xz/Makefile.in" | 208 | (substitute* "src/xz/Makefile.in" |
| 210 | (("^xz_LDADD =") | 209 | (("^xz_LDADD =") |
| 211 | "xz_LDADD = -all-static")) | 210 | "xz_LDADD = -all-static"))))))))) |
| 212 | #t))))))) | ||
| 213 | (gawk (package | 211 | (gawk (package |
| 214 | (inherit gawk) | 212 | (inherit gawk) |
| 215 | (source (origin | 213 | (source (origin |
| @@ -225,45 +223,44 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." | |||
| 225 | (origin-patches | 223 | (origin-patches |
| 226 | (package-source gawk)))))) | 224 | (package-source gawk)))))) |
| 227 | (arguments | 225 | (arguments |
| 228 | `(;; Starting from gawk 4.1.0, some of the tests for the | 226 | (substitute-keyword-arguments (package-arguments gawk) |
| 229 | ;; plug-in mechanism just fail on static builds: | 227 | ((#:configure-flags _ #~'()) |
| 230 | ;; | 228 | ;; Starting from gawk 4.1.0, some of the tests for the |
| 231 | ;; ./fts.awk:1: error: can't open shared library `filefuncs' for reading (No such file or directory) | 229 | ;; plug-in mechanism just fail on static builds: |
| 232 | ;; | 230 | ;; |
| 233 | ;; Therefore disable extensions support. | 231 | ;; ./fts.awk:1: error: can't open shared library `filefuncs' for reading (No such file or directory) |
| 234 | #:configure-flags (list "--disable-extensions") | 232 | ;; |
| 235 | 233 | ;; Therefore disable extensions support. | |
| 236 | ,@(substitute-keyword-arguments (package-arguments gawk) | 234 | #~(list "--disable-extensions")) |
| 237 | ((#:phases phases) | 235 | ((#:phases phases) |
| 238 | `(modify-phases ,phases | 236 | #~(modify-phases #$phases |
| 239 | (add-before 'configure 'no-export-dynamic | 237 | (add-before 'configure 'no-export-dynamic |
| 240 | (lambda _ | 238 | (lambda _ |
| 241 | ;; Since we use `-static', remove | 239 | ;; Since we use `-static', remove |
| 242 | ;; `-export-dynamic'. | 240 | ;; `-export-dynamic'. |
| 243 | (substitute* "configure" | 241 | (substitute* "configure" |
| 244 | (("-Wl,-export-dynamic") "")) | 242 | (("-Wl,-export-dynamic") "")))))))) |
| 245 | #t))))))) | ||
| 246 | (inputs (if (%current-target-system) | 243 | (inputs (if (%current-target-system) |
| 247 | `(("bash" ,static-bash)) | 244 | (list static-bash) |
| 248 | '())))) | 245 | '())))) |
| 249 | (tar (package (inherit tar) | 246 | (tar (package |
| 247 | (inherit tar) | ||
| 250 | (arguments | 248 | (arguments |
| 251 | `(;; Work around a cross-compilation bug whereby libgnu.a would provide | 249 | `(;; Work around a cross-compilation bug whereby libgnu.a would provide |
| 252 | ;; '__mktime_internal', which conflicts with the one in libc.a. | 250 | ;; '__mktime_internal', which conflicts with the one in libc.a. |
| 253 | ,@(if (%current-target-system) | 251 | ;; ,@(if (%current-target-system) |
| 254 | `(#:configure-flags '("gl_cv_func_working_mktime=yes")) | 252 | ;; `(#:configure-flags '("gl_cv_func_working_mktime=yes")) |
| 255 | '()) | 253 | ;; '()) |
| 256 | ,@(substitute-keyword-arguments (package-arguments tar) | 254 | ,@(substitute-keyword-arguments (package-arguments tar) |
| 257 | ((#:phases phases) | 255 | ((#:phases phases) |
| 258 | `(modify-phases ,phases | 256 | #~(modify-phases #$phases |
| 259 | (replace 'set-shell-file-name | 257 | (replace 'set-shell-file-name |
| 260 | (lambda _ | 258 | (lambda _ |
| 261 | ;; Do not use "/bin/sh" to run programs; see | 259 | ;; Do not use "/bin/sh" to run programs; see |
| 262 | ;; <http://lists.gnu.org/archive/html/guix-devel/2016-09/msg02272.html>. | 260 | ;; <http://lists.gnu.org/archive/html/guix-devel/2016-09/msg02272.html>. |
| 263 | (substitute* "src/system.c" | 261 | (substitute* "src/system.c" |
| 264 | (("/bin/sh") "sh") | 262 | (("/bin/sh") "sh") |
| 265 | (("execv ") "execvp ")) | 263 | (("execv ") "execvp "))))))))))) |
| 266 | #t))))))))) | ||
| 267 | ;; We don't want to retain a reference to /gnu/store in the bootstrap | 264 | ;; We don't want to retain a reference to /gnu/store in the bootstrap |
| 268 | ;; versions of egrep/fgrep, so we remove the custom phase added since | 265 | ;; versions of egrep/fgrep, so we remove the custom phase added since |
| 269 | ;; grep@2.25. The effect is 'egrep' and 'fgrep' look for 'grep' in | 266 | ;; grep@2.25. The effect is 'egrep' and 'fgrep' look for 'grep' in |
