1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 Marek Benc <merkur32@gmail.com>
3 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
5 ;;; This file is part of GNU Guix.
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.
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.
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/>.
20 (define-module (gnu packages nvi)
21 #:use-module (gnu packages)
22 #:use-module (gnu packages autotools)
23 #:use-module (gnu packages dbm)
24 #:use-module (gnu packages ncurses)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix build-system gnu)
28 #:use-module (guix licenses)
29 #:use-module (guix utils))
38 (uri ;; sites.google.coma/bostic.com/keithbostic/vi is stale.
39 (string-append "http://harrier.slackbuilds.org/misc/nvi-" version
42 (base32 "0nbbs1inyrqds0ywn3ln5slv54v5zraq7lszkg8nsavv4kivhh9l"))
43 (patches (search-patches "nvi-assume-preserve-path.patch"
44 "nvi-dbpagesize-binpower.patch"
46 (modules '((guix build utils)))
48 ;; Create a wrapper for the configure script, make it executable.
49 '(let ((conf-wrap (open-output-file "configure")))
50 (display "#!/bin/sh" conf-wrap)
53 "../nvi-1.81.6/dist/configure --srcdir=../nvi-1.81.6/dist $@"
56 (close-output-port conf-wrap)
57 (chmod "configure" #o0755)
59 ;; Glibc 2.30 removed the deprecated <sys/stropts.h>, so fall back
60 ;; to the internal PTY allocation logic.
61 (substitute* "ex/ex_script.c"
62 (("#ifdef HAVE_SYS5_PTY")
63 "#if defined(HAVE_SYS5_PTY) && !defined(__GLIBC__)"))
66 (build-system gnu-build-system)
71 ,@(if (%current-target-system)
72 '("vi_cv_sprintf_count=yes")
75 (modify-phases %standard-phases
76 (add-before 'configure 'fix-configure
77 (lambda* (#:key inputs native-inputs #:allow-other-keys)
78 ;; Replace outdated config.sub and config.guess:
79 (with-directory-excursion "dist"
80 (for-each (lambda (file)
85 (or native-inputs inputs) "automake")
88 (package-version automake))
94 ("ncurses" ,ncurses)))
96 `(("automake" ,automake))) ;Up to date 'config.guess' and 'config.sub'.
97 (synopsis "The Berkeley Vi Editor")
99 "Vi is the original screen based text editor for Unix systems. It is
100 considered the standard text editor, and is available on almost all Unix
101 systems. Nvi is intended as a \"bug-for-bug compatible\" clone of the
102 original BSD vi editor. As such, it doesn't have a lot of snazzy features as
103 do some of the other vi clones such as elvis and vim. However, if all you
104 want is vi, this is the one to get.")
105 (home-page "https://sites.google.com/a/bostic.com/keithbostic/vi")