summaryrefslogtreecommitdiff
path: root/guix/build/gnu-build-system.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/build/gnu-build-system.scm')
-rw-r--r--guix/build/gnu-build-system.scm28
1 files changed, 15 insertions, 13 deletions
diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm
index 18c66e5256..b5eaa26bf5 100644
--- a/guix/build/gnu-build-system.scm
+++ b/guix/build/gnu-build-system.scm
@@ -84,24 +84,26 @@
(chdir (first-subdirectory "."))))
(define* (patch-source-shebangs #:key source #:allow-other-keys)
- ;; Patch shebangs in executable source files. Most scripts honor
- ;; $SHELL and $CONFIG_SHELL, but some don't, such as `mkinstalldirs'
- ;; or Automake's `missing' script.
+ "Patch shebangs in all source files; this includes non-executable
+files such as `.in' templates. Most scripts honor $SHELL and
+$CONFIG_SHELL, but some don't, such as `mkinstalldirs' or Automake's
+`missing' script."
+ (for-each patch-shebang
+ (remove file-is-directory? (find-files "." ".*"))))
+
+(define (patch-generated-file-shebangs . rest)
+ "Patch shebangs in generated files, including `SHELL' variables in
+makefiles."
+ ;; Patch executable files, some of which might have been generated by
+ ;; `configure'.
(for-each patch-shebang
(filter (lambda (file)
(and (executable-file? file)
(not (file-is-directory? file))))
(find-files "." ".*")))
- ;; Gettext-generated po/Makefile.in.in does not honor $SHELL.
- (let ((bash (search-path (search-path-as-string->list (getenv "PATH"))
- "bash")))
- (when (file-exists? "po/Makefile.in.in")
- (substitute* "po/Makefile.in.in"
- (("^SHELL[[:blank:]]*=.*$")
- (string-append "SHELL = " bash "\n"))))))
-
-(define patch-generated-files patch-source-shebangs)
+ ;; Patch `SHELL' in generated makefiles.
+ (for-each patch-makefile-SHELL (find-files "." "^(GNU)?[mM]akefile$")))
(define* (patch #:key (patches '()) (patch-flags '("--batch" "-p1"))
#:allow-other-keys)
@@ -253,7 +255,7 @@
(let-syntax ((phases (syntax-rules ()
((_ p ...) `((p . ,p) ...)))))
(phases set-paths unpack patch
- patch-source-shebangs configure patch-generated-files
+ patch-source-shebangs configure patch-generated-file-shebangs
build check install
patch-shebangs strip)))