entr.scm 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2016 Matthew Jordan <matthewjordandevops@yandex.com>
  3. ;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
  4. ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
  5. ;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
  6. ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
  7. ;;; Copyright © 2021 Solene Rapenne <solene@perso.pw>
  8. ;;;
  9. ;;; This file is part of GNU Guix.
  10. ;;;
  11. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  12. ;;; under the terms of the GNU General Public License as published by
  13. ;;; the Free Software Foundation; either version 3 of the License, or (at
  14. ;;; your option) any later version.
  15. ;;;
  16. ;;; GNU Guix is distributed in the hope that it will be useful, but
  17. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  18. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. ;;; GNU General Public License for more details.
  20. ;;;
  21. ;;; You should have received a copy of the GNU General Public License
  22. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  23. (define-module (gnu packages entr)
  24. #:use-module (gnu packages base)
  25. #:use-module (gnu packages bash)
  26. #:use-module (gnu packages ncurses)
  27. #:use-module (guix licenses)
  28. #:use-module (guix packages)
  29. #:use-module (guix download)
  30. #:use-module (guix build-system gnu)
  31. #:use-module (guix utils))
  32. (define-public entr
  33. (package
  34. (name "entr")
  35. (version "4.9")
  36. (source (origin
  37. (method url-fetch)
  38. (uri (string-append "http://entrproject.org/code/entr-"
  39. version ".tar.gz"))
  40. (sha256
  41. (base32
  42. "18h58k69f0qmqkknbcnhm5dz7mv5gr2blcq88qr62vz4zg9a8mp2"))))
  43. (build-system gnu-build-system)
  44. (arguments
  45. `(#:test-target "test"
  46. #:phases
  47. (modify-phases %standard-phases
  48. (replace 'configure
  49. (lambda* (#:key outputs #:allow-other-keys)
  50. (let ((out (assoc-ref outputs "out")))
  51. (setenv "CONFIG_SHELL" (which "bash"))
  52. (setenv "CC" ,(cc-for-target))
  53. (setenv "PREFIX" out)
  54. (setenv "MANPREFIX" (string-append out "/man"))
  55. (invoke "./configure"))))
  56. (add-before 'build 'remove-fhs-file-names
  57. (lambda* (#:key inputs #:allow-other-keys)
  58. (substitute* "entr.c"
  59. (("/bin/sh" command)
  60. (search-input-file inputs command))
  61. (("/bin/cat" command)
  62. (search-input-file inputs command))
  63. (("/usr(/bin/clear)" _ command)
  64. (search-input-file inputs command)))
  65. #t)))))
  66. (inputs
  67. `(("bash" ,bash)
  68. ("coreutils" ,coreutils)
  69. ("ncurses" ,ncurses)))
  70. (home-page "http://entrproject.org/")
  71. (synopsis "Run arbitrary commands when files change")
  72. (description
  73. "entr is a zero-configuration tool with no external build or run-time
  74. dependencies. The interface to entr is not only minimal, it aims to be simple
  75. enough to create a new category of ad hoc automation. These micro-tests
  76. reduce keystrokes, but more importantly they emphasize the utility of
  77. automated checks.")
  78. ;; Per 'LICENSE', portability code under missing/ is under BSD-2.
  79. (license isc)))