diff options
author | Ludovic Courtès <ludo@gnu.org> | 2012-08-31 23:58:21 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2012-08-31 23:58:21 +0200 |
commit | 877217b85ac318a0a702578f183dd638c9704112 (patch) | |
tree | 38f4286e3896b2849282d9346bd26c60ccb1eeb6 | |
parent | 8759a648ba7fcf76fa2f63ed2d63bbd5ccb8a31c (diff) | |
download | patches-877217b85ac318a0a702578f183dd638c9704112.tar patches-877217b85ac318a0a702578f183dd638c9704112.tar.gz |
build-system/gnu: Honor the `patch-shebangs?' and `strip-binaries?' parameters.
* guix/build/gnu-build-system.scm (patch-shebangs): Honor
PATCH-SHEBANGS?.
(strip): Honor STRIP-BINARIES?. Display a message from `strip-dir'.
-rw-r--r-- | guix/build/gnu-build-system.scm | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index 4a83bd0637..4ff4aca6a0 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -152,13 +152,14 @@ (string-append dir "/sbin")))) outputs)) - (let ((path (append bindirs - (search-path-as-string->list (getenv "PATH"))))) - (for-each (lambda (dir) - (let ((files (list-of-files dir))) - (for-each (cut patch-shebang <> path) files))) - bindirs) - #t)) + (when patch-shebangs? + (let ((path (append bindirs + (search-path-as-string->list (getenv "PATH"))))) + (for-each (lambda (dir) + (let ((files (list-of-files dir))) + (for-each (cut patch-shebang <> path) files))) + bindirs))) + #t) (define* (strip #:key outputs (strip-binaries? #t) (strip-flags '("--strip-debug")) @@ -166,6 +167,8 @@ "bin" "sbin")) #:allow-other-keys) (define (strip-dir dir) + (format #t "stripping binaries in ~s with flags ~s~%" + dir strip-flags) (file-system-fold (const #t) (lambda (path stat result) ; leaf (zero? (apply system* "strip" @@ -181,14 +184,15 @@ #t dir)) - (every strip-dir - (append-map (match-lambda - ((_ . dir) - (filter-map (lambda (d) - (let ((sub (string-append dir "/" d))) - (and (directory-exists? sub) sub))) - strip-directories))) - outputs))) + (or (not strip-binaries?) + (every strip-dir + (append-map (match-lambda + ((_ . dir) + (filter-map (lambda (d) + (let ((sub (string-append dir "/" d))) + (and (directory-exists? sub) sub))) + strip-directories))) + outputs)))) (define %standard-phases ;; Standard build phases, as a list of symbol/procedure pairs. |