diff options
author | Ludovic Courtès <ludo@gnu.org> | 2012-12-15 16:35:26 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2012-12-15 16:35:26 +0100 |
commit | d008415219df27f0b0ab000ceed12226183cd9b2 (patch) | |
tree | 83debd8ecf8b08bd89646d36c251b8755da1b2c6 /guix/build/utils.scm | |
parent | c1c94acf3206a086358e2ea39aa011c8299d29e5 (diff) | |
download | gnu-guix-d008415219df27f0b0ab000ceed12226183cd9b2.tar gnu-guix-d008415219df27f0b0ab000ceed12226183cd9b2.tar.gz |
build-system/gnu: Patch shebangs in executable source files.
This allows many packages to build in a chroot that lacks /bin and
thus /bin/sh.
* guix/build/gnu-build-system.scm (patch-source-shebangs): New
procedure.
(%standard-phases): Add it.
* guix/build/utils.scm (executable-file?): New procedure.
* distro/packages/perl.scm (perl): Don't use /bin/sh to run `Configure'.
Diffstat (limited to 'guix/build/utils.scm')
-rw-r--r-- | guix/build/utils.scm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/guix/build/utils.scm b/guix/build/utils.scm index 8f0eb66d39..99a43cfebd 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -26,6 +26,7 @@ #:use-module (rnrs bytevectors) #:use-module (rnrs io ports) #:export (directory-exists? + executable-file? with-directory-excursion mkdir-p copy-recursively @@ -56,6 +57,12 @@ (and s (eq? 'directory (stat:type s))))) +(define (executable-file? file) + "Return #t if FILE exists and is executable." + (let ((s (stat file #f))) + (and s + (not (zero? (logand (stat:mode s) #o100)))))) + (define-syntax-rule (with-directory-excursion dir body ...) "Run BODY with DIR as the process's current directory." (let ((init (getcwd))) |