gnu: automake: Use 'modify-phases'.
* gnu/packages/autotools.scm (automake)[arguments]: Use 'modify-phases' syntax.
This commit is contained in:
parent
79272039a9
commit
759807e872
|
@ -267,47 +267,47 @@ output is indexed in many ways to simplify browsing.")
|
|||
(srfi srfi-1)
|
||||
(srfi srfi-26)
|
||||
(rnrs io ports))
|
||||
#:phases (alist-cons-before
|
||||
'patch-source-shebangs 'patch-tests-shebangs
|
||||
(lambda _
|
||||
(let ((sh (which "sh")))
|
||||
(substitute* (find-files "t" "\\.(sh|tap)$")
|
||||
(("#![[:blank:]]?/bin/sh")
|
||||
(string-append "#!" sh)))
|
||||
#:phases
|
||||
(modify-phases %standard-phases
|
||||
(add-before 'patch-source-shebangs 'patch-tests-shebangs
|
||||
(lambda _
|
||||
(let ((sh (which "sh")))
|
||||
(substitute* (find-files "t" "\\.(sh|tap)$")
|
||||
(("#![[:blank:]]?/bin/sh")
|
||||
(string-append "#!" sh)))
|
||||
|
||||
;; Set these variables for all the `configure' runs
|
||||
;; that occur during the test suite.
|
||||
(setenv "SHELL" sh)
|
||||
(setenv "CONFIG_SHELL" sh)))
|
||||
;; Set these variables for all the `configure' runs
|
||||
;; that occur during the test suite.
|
||||
(setenv "SHELL" sh)
|
||||
(setenv "CONFIG_SHELL" sh)
|
||||
#t)))
|
||||
|
||||
;; Files like `install-sh', `mdate.sh', etc. must use
|
||||
;; #!/bin/sh, otherwise users could leak erroneous shebangs
|
||||
;; in the wild. See <http://bugs.gnu.org/14201> for an
|
||||
;; example.
|
||||
(alist-cons-after
|
||||
'install 'unpatch-shebangs
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(dir (string-append out "/share")))
|
||||
(define (starts-with-shebang? file)
|
||||
(equal? (call-with-input-file file
|
||||
(lambda (p)
|
||||
(list (get-u8 p) (get-u8 p))))
|
||||
(map char->integer '(#\# #\!))))
|
||||
;; Files like `install-sh', `mdate.sh', etc. must use
|
||||
;; #!/bin/sh, otherwise users could leak erroneous shebangs
|
||||
;; in the wild. See <http://bugs.gnu.org/14201> for an
|
||||
;; example.
|
||||
(add-after 'install 'unpatch-shebangs
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(dir (string-append out "/share")))
|
||||
(define (starts-with-shebang? file)
|
||||
(equal? (call-with-input-file file
|
||||
(lambda (p)
|
||||
(list (get-u8 p) (get-u8 p))))
|
||||
(map char->integer '(#\# #\!))))
|
||||
|
||||
(for-each (lambda (file)
|
||||
(when (and (starts-with-shebang? file)
|
||||
(executable-file? file))
|
||||
(format #t "restoring shebang on `~a'~%"
|
||||
file)
|
||||
(substitute* file
|
||||
(("^#!.*/bin/sh")
|
||||
"#!/bin/sh")
|
||||
(("^#!.*/bin/env(.*)$" _ args)
|
||||
(string-append "#!/usr/bin/env"
|
||||
args)))))
|
||||
(find-files dir ".*"))))
|
||||
%standard-phases))))
|
||||
(for-each (lambda (file)
|
||||
(when (and (starts-with-shebang? file)
|
||||
(executable-file? file))
|
||||
(format #t "restoring shebang on `~a'~%"
|
||||
file)
|
||||
(substitute* file
|
||||
(("^#!.*/bin/sh")
|
||||
"#!/bin/sh")
|
||||
(("^#!.*/bin/env(.*)$" _ args)
|
||||
(string-append "#!/usr/bin/env"
|
||||
args)))))
|
||||
(find-files dir ".*"))))))))
|
||||
(home-page "https://www.gnu.org/software/automake/")
|
||||
(synopsis "Making GNU standards-compliant Makefiles")
|
||||
(description
|
||||
|
|
Loading…
Reference in New Issue