mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-23 21:17:11 -05:00
gnu: grep: Fix egrep/fgrep to work regardless of PATH.
* gnu/packages/base.scm (grep)[arguments]: New field. Add 'fix-egrep-and-fgrep' phase.
This commit is contained in:
parent
5cbc24de44
commit
1063d325ea
1 changed files with 14 additions and 0 deletions
|
@ -88,6 +88,20 @@ (define-public grep
|
|||
(patches (search-patches "grep-timing-sensitive-test.patch"))))
|
||||
(build-system gnu-build-system)
|
||||
(native-inputs `(("perl" ,perl))) ;some of the tests require it
|
||||
(arguments
|
||||
`(#:phases
|
||||
(modify-phases %standard-phases
|
||||
(add-after 'install 'fix-egrep-and-fgrep
|
||||
;; Patch 'egrep' and 'fgrep' to execute 'grep' via its
|
||||
;; absolute file name instead of searching for it in $PATH.
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(bin (string-append out "/bin")))
|
||||
(substitute* (list (string-append bin "/egrep")
|
||||
(string-append bin "/fgrep"))
|
||||
(("^exec grep")
|
||||
(string-append "exec " bin "/grep")))
|
||||
#t))))))
|
||||
(synopsis "Print lines matching a pattern")
|
||||
(description
|
||||
"grep is a tool for finding text inside files. Text is found by
|
||||
|
|
Loading…
Reference in a new issue