me
/
guix
Archived
1
0
Fork 0

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'.
master
Ludovic Courtès 2012-08-31 23:58:21 +02:00
parent 8759a648ba
commit 877217b85a
1 changed files with 19 additions and 15 deletions

View File

@ -152,13 +152,14 @@
(string-append dir "/sbin")))) (string-append dir "/sbin"))))
outputs)) outputs))
(when patch-shebangs?
(let ((path (append bindirs (let ((path (append bindirs
(search-path-as-string->list (getenv "PATH"))))) (search-path-as-string->list (getenv "PATH")))))
(for-each (lambda (dir) (for-each (lambda (dir)
(let ((files (list-of-files dir))) (let ((files (list-of-files dir)))
(for-each (cut patch-shebang <> path) files))) (for-each (cut patch-shebang <> path) files)))
bindirs) bindirs)))
#t)) #t)
(define* (strip #:key outputs (strip-binaries? #t) (define* (strip #:key outputs (strip-binaries? #t)
(strip-flags '("--strip-debug")) (strip-flags '("--strip-debug"))
@ -166,6 +167,8 @@
"bin" "sbin")) "bin" "sbin"))
#:allow-other-keys) #:allow-other-keys)
(define (strip-dir dir) (define (strip-dir dir)
(format #t "stripping binaries in ~s with flags ~s~%"
dir strip-flags)
(file-system-fold (const #t) (file-system-fold (const #t)
(lambda (path stat result) ; leaf (lambda (path stat result) ; leaf
(zero? (apply system* "strip" (zero? (apply system* "strip"
@ -181,6 +184,7 @@
#t #t
dir)) dir))
(or (not strip-binaries?)
(every strip-dir (every strip-dir
(append-map (match-lambda (append-map (match-lambda
((_ . dir) ((_ . dir)
@ -188,7 +192,7 @@
(let ((sub (string-append dir "/" d))) (let ((sub (string-append dir "/" d)))
(and (directory-exists? sub) sub))) (and (directory-exists? sub) sub)))
strip-directories))) strip-directories)))
outputs))) outputs))))
(define %standard-phases (define %standard-phases
;; Standard build phases, as a list of symbol/procedure pairs. ;; Standard build phases, as a list of symbol/procedure pairs.