gnu: entr: Fix references to external programs.

* gnu/packages/entr.scm (entr)[arguments](remove-fhs-file-names): Use 'which'
instead of relying on the runtime PATH.  Patch /bin/sh too.
[inputs]: Add NCURSES.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Jakub Kądziołka 2020-01-11 19:11:44 +01:00 committed by Ludovic Courtès
parent 58236d301c
commit 4897038983
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -3,6 +3,7 @@
;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -20,6 +21,7 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu packages entr) (define-module (gnu packages entr)
#:use-module (gnu packages ncurses)
#:use-module (guix licenses) #:use-module (guix licenses)
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (guix download) #:use-module (guix download)
@ -52,11 +54,13 @@ (define-public entr
(invoke "./configure")))) (invoke "./configure"))))
(add-before 'build 'remove-fhs-file-names (add-before 'build 'remove-fhs-file-names
(lambda _ (lambda _
;; Use the tools available in $PATH.
(substitute* "entr.c" (substitute* "entr.c"
(("/bin/cat") "cat") (("/bin/sh") (which "sh"))
(("/usr/bin/clear") "clear")) (("/bin/cat") (which "cat"))
(("/usr/bin/clear") (which "clear")))
#t))))) #t)))))
;; ncurses provides the `clear' binary
(inputs `(("ncurses" ,ncurses)))
(home-page "http://entrproject.org/") (home-page "http://entrproject.org/")
(synopsis "Run arbitrary commands when files change") (synopsis "Run arbitrary commands when files change")
(description (description