gnu: nvi: Fix cross-compilation.

* gnu/packages/nvi.scm (nvi)[arguments]: Add "vi_cv_sprintf_count=yes" to
configure flags when cross-compiling. Also add 'fix-configure phase.
[native-inputs]: Add "automake" that is required by the new phase.
This commit is contained in:
Mathieu Othacehe 2020-10-27 13:11:15 +01:00
parent 559c134b0e
commit a01f329244
No known key found for this signature in database
GPG Key ID: 8354763531769CA6

View File

@ -64,17 +64,41 @@
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
`(#:out-of-source? #t `(#:out-of-source? #t
#:configure-flags '("--enable-widechar"))) #:configure-flags
'("--enable-widechar"
,@(if (%current-target-system)
'("vi_cv_sprintf_count=yes")
'()))
#:phases
(modify-phases %standard-phases
(add-before 'configure 'fix-configure
(lambda* (#:key inputs native-inputs #:allow-other-keys)
;; Replace outdated config.sub and config.guess:
(with-directory-excursion "dist"
(for-each (lambda (file)
(chmod file #o755)
(install-file
(string-append
(assoc-ref
(or native-inputs inputs) "automake")
"/share/automake-"
,(version-major+minor
(package-version automake))
"/" file) "."))
'("config.sub")))
#t)))))
(inputs (inputs
`(("bdb" ,bdb) `(("bdb" ,bdb)
("ncurses" ,ncurses))) ("ncurses" ,ncurses)))
(native-inputs
`(("automake" ,automake))) ;Up to date 'config.guess' and 'config.sub'.
(synopsis "The Berkeley Vi Editor") (synopsis "The Berkeley Vi Editor")
(description (description
"Vi is the original screen based text editor for Unix systems. It is "Vi is the original screen based text editor for Unix systems. It is
considered the standard text editor, and is available on almost all Unix considered the standard text editor, and is available on almost all Unix
systems. Nvi is intended as a \"bug-for-bug compatible\" clone of the original systems. Nvi is intended as a \"bug-for-bug compatible\" clone of the
BSD vi editor. As such, it doesn't have a lot of snazzy features as do some original BSD vi editor. As such, it doesn't have a lot of snazzy features as
of the other vi clones such as elvis and vim. However, if all you want is vi, do some of the other vi clones such as elvis and vim. However, if all you
this is the one to get.") want is vi, this is the one to get.")
(home-page "https://sites.google.com/a/bostic.com/keithbostic/vi") (home-page "https://sites.google.com/a/bostic.com/keithbostic/vi")
(license bsd-3))) (license bsd-3)))