build-system/gnu: Make the strip behavior of `static-package' configurable.
* guix/build-system/gnu.scm (static-package): Add #:strip-all? keyword parameter.
This commit is contained in:
parent
ddff766e38
commit
790b8e0ebe
|
@ -111,20 +111,24 @@ flags for VARIABLE, the associated value is augmented."
|
||||||
"A version of P linked with `-static-gcc'."
|
"A version of P linked with `-static-gcc'."
|
||||||
(package-with-extra-configure-variable p "LDFLAGS" "-static-libgcc"))
|
(package-with-extra-configure-variable p "LDFLAGS" "-static-libgcc"))
|
||||||
|
|
||||||
(define* (static-package p #:optional (loc (current-source-location)))
|
(define* (static-package p #:optional (loc (current-source-location))
|
||||||
"Return a statically-linked version of package P."
|
#:key (strip-all? #t))
|
||||||
|
"Return a statically-linked version of package P. If STRIP-ALL? is true,
|
||||||
|
use `--strip-all' as the arguments to `strip'."
|
||||||
(let ((args (package-arguments p)))
|
(let ((args (package-arguments p)))
|
||||||
(package (inherit p)
|
(package (inherit p)
|
||||||
(location (source-properties->location loc))
|
(location (source-properties->location loc))
|
||||||
(arguments
|
(arguments
|
||||||
(let ((a (default-keyword-arguments args
|
(let ((a (default-keyword-arguments args
|
||||||
'(#:configure-flags '()
|
'(#:configure-flags '()
|
||||||
#:strip-flags #f))))
|
#:strip-flags '("--strip-debug")))))
|
||||||
(substitute-keyword-arguments a
|
(substitute-keyword-arguments a
|
||||||
((#:configure-flags flags)
|
((#:configure-flags flags)
|
||||||
`(cons* "--disable-shared" "LDFLAGS=-static" ,flags))
|
`(cons* "--disable-shared" "LDFLAGS=-static" ,flags))
|
||||||
((#:strip-flags _)
|
((#:strip-flags flags)
|
||||||
''("--strip-all"))))))))
|
(if strip-all?
|
||||||
|
''("--strip-all")
|
||||||
|
flags))))))))
|
||||||
|
|
||||||
|
|
||||||
(define %store
|
(define %store
|
||||||
|
|
Loading…
Reference in New Issue