mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 05:48:07 -05:00
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
e3b2cf4c7a
commit
9011e97f8d
1 changed files with 9 additions and 5 deletions
|
@ -111,20 +111,24 @@ (define (static-libgcc-package p)
|
|||
"A version of P linked with `-static-gcc'."
|
||||
(package-with-extra-configure-variable p "LDFLAGS" "-static-libgcc"))
|
||||
|
||||
(define* (static-package p #:optional (loc (current-source-location)))
|
||||
"Return a statically-linked version of package P."
|
||||
(define* (static-package p #:optional (loc (current-source-location))
|
||||
#: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)))
|
||||
(package (inherit p)
|
||||
(location (source-properties->location loc))
|
||||
(arguments
|
||||
(let ((a (default-keyword-arguments args
|
||||
'(#:configure-flags '()
|
||||
#:strip-flags #f))))
|
||||
#:strip-flags '("--strip-debug")))))
|
||||
(substitute-keyword-arguments a
|
||||
((#:configure-flags flags)
|
||||
`(cons* "--disable-shared" "LDFLAGS=-static" ,flags))
|
||||
((#:strip-flags _)
|
||||
''("--strip-all"))))))))
|
||||
((#:strip-flags flags)
|
||||
(if strip-all?
|
||||
''("--strip-all")
|
||||
flags))))))))
|
||||
|
||||
|
||||
(define %store
|
||||
|
|
Loading…
Reference in a new issue