nvi.scm 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2014 Marek Benc <merkur32@gmail.com>
  3. ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
  4. ;;;
  5. ;;; This file is part of GNU Guix.
  6. ;;;
  7. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  8. ;;; under the terms of the GNU General Public License as published by
  9. ;;; the Free Software Foundation; either version 3 of the License, or (at
  10. ;;; your option) any later version.
  11. ;;;
  12. ;;; GNU Guix is distributed in the hope that it will be useful, but
  13. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. ;;; GNU General Public License for more details.
  16. ;;;
  17. ;;; You should have received a copy of the GNU General Public License
  18. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  19. (define-module (gnu packages nvi)
  20. #:use-module (gnu packages)
  21. #:use-module (gnu packages autotools)
  22. #:use-module (gnu packages dbm)
  23. #:use-module (gnu packages ncurses)
  24. #:use-module (guix packages)
  25. #:use-module (guix download)
  26. #:use-module (guix build-system gnu)
  27. #:use-module (guix licenses)
  28. #:use-module (guix utils))
  29. (define-public nvi
  30. (package
  31. (name "nvi")
  32. (version "1.81.6")
  33. (source
  34. (origin
  35. (method url-fetch)
  36. (uri ;; sites.google.coma/bostic.com/keithbostic/vi is stale.
  37. (string-append "http://harrier.slackbuilds.org/misc/nvi-" version
  38. ".tar.bz2"))
  39. (sha256
  40. (base32 "0nbbs1inyrqds0ywn3ln5slv54v5zraq7lszkg8nsavv4kivhh9l"))
  41. (patches (search-patches "nvi-assume-preserve-path.patch"
  42. "nvi-dbpagesize-binpower.patch"
  43. "nvi-db4.patch"))
  44. (modules '((guix build utils)))
  45. (snippet
  46. ;; Create a wrapper for the configure script, make it executable.
  47. '(let ((conf-wrap (open-output-file "configure")))
  48. (display "#!/bin/sh" conf-wrap)
  49. (newline conf-wrap)
  50. (display
  51. "../nvi-1.81.6/dist/configure --srcdir=../nvi-1.81.6/dist $@"
  52. conf-wrap)
  53. (newline conf-wrap)
  54. (close-output-port conf-wrap)
  55. (chmod "configure" #o0755)
  56. ;; Glibc 2.30 removed the deprecated <sys/stropts.h>, so fall back
  57. ;; to the internal PTY allocation logic.
  58. (substitute* "ex/ex_script.c"
  59. (("#ifdef HAVE_SYS5_PTY")
  60. "#if defined(HAVE_SYS5_PTY) && !defined(__GLIBC__)"))
  61. #t))))
  62. (build-system gnu-build-system)
  63. (arguments
  64. `(#:out-of-source? #t
  65. #:configure-flags
  66. '("--enable-widechar"
  67. ,@(if (%current-target-system)
  68. '("vi_cv_sprintf_count=yes")
  69. '()))
  70. #:phases
  71. (modify-phases %standard-phases
  72. (add-before 'configure 'fix-configure
  73. (lambda* (#:key inputs native-inputs #:allow-other-keys)
  74. ;; Replace outdated config.sub and config.guess:
  75. (with-directory-excursion "dist"
  76. (for-each (lambda (file)
  77. (chmod file #o755)
  78. (install-file
  79. (string-append
  80. (assoc-ref
  81. (or native-inputs inputs) "automake")
  82. "/share/automake-"
  83. ,(version-major+minor
  84. (package-version automake))
  85. "/" file) "."))
  86. '("config.sub")))
  87. #t)))))
  88. (inputs
  89. `(("bdb" ,bdb)
  90. ("ncurses" ,ncurses)))
  91. (native-inputs
  92. `(("automake" ,automake))) ;Up to date 'config.guess' and 'config.sub'.
  93. (synopsis "The Berkeley Vi Editor")
  94. (description
  95. "Vi is the original screen based text editor for Unix systems. It is
  96. considered the standard text editor, and is available on almost all Unix
  97. systems. Nvi is intended as a \"bug-for-bug compatible\" clone of the
  98. original BSD vi editor. As such, it doesn't have a lot of snazzy features as
  99. do some of the other vi clones such as elvis and vim. However, if all you
  100. want is vi, this is the one to get.")
  101. (home-page "https://sites.google.com/a/bostic.com/keithbostic/vi")
  102. (license bsd-3)))