app-editors/nvi: Use longer description
[gentoo.git] / app-editors / nvi / nvi-1.81.6-r7.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit autotools db-use flag-o-matic
7
8 DESCRIPTION="Re-implementation of the classic 4BSD ex/vi"
9 HOMEPAGE="https://sites.google.com/a/bostic.com/keithbostic/vi"
10 SRC_URI="http://garage.linux.student.kuleuven.be/~skimo/nvi/devel/${P}.tar.bz2"
11
12 LICENSE="BSD"
13 SLOT="0"
14 KEYWORDS="alpha amd64 ~arm hppa ~mips ppc ppc64 sparc x86 ~amd64-fbsd ~x64-macos"
15 IUSE="perl tcl unicode"
16
17 CDEPEND=">=sys-libs/db-4.2.52_p5:=
18         >=sys-libs/ncurses-5.6-r2:=
19         perl? ( dev-lang/perl )
20         tcl? ( >=dev-lang/tcl-8.5:0= )"
21
22 DEPEND="${CDEPEND}
23         virtual/pkgconfig"
24
25 RDEPEND="${CDEPEND}
26         app-eselect/eselect-vi"
27
28 REQUIRED_USE="tcl? ( !unicode )"
29
30 PATCHES=(
31         "${FILESDIR}"/${P}-strlen-macro-renaming.patch
32         "${FILESDIR}"/${P}-db44.patch
33         "${FILESDIR}"/${P}-db.patch
34         "${FILESDIR}"/${P}-perl-as-needed.patch
35         "${FILESDIR}"/${P}-perl-shortnames.patch
36         "${FILESDIR}"/${P}-ac_config_header.patch
37         "${FILESDIR}"/${P}-use_pkgconfig_for_ncurses.patch
38         "${FILESDIR}"/${P}-printf-types.patch
39         )
40
41 src_prepare() {
42         default
43
44         cd dist || die
45         chmod +x findconfig || die
46
47         mv configure.{in,ac} || die
48         sed -i -e "s@-ldb@-l$(db_libname)@" configure.ac || die
49         sed -i -e "s@^install-\(.*\)-local:@install-\1-hook:@" Makefile.am || die
50         eautoreconf -Im4
51 }
52
53 src_configure() {
54         local myconf
55
56         use perl && myconf="${myconf} --enable-perlinterp"
57         use unicode && myconf="${myconf} --enable-widechar"
58         use tcl && myconf="${myconf} --enable-tclinterp"
59
60         append-cppflags "-D_PATH_MSGCAT=\"\\\"${EPREFIX%/}/usr/share/vi/catalog/\\\"\""
61         append-cppflags -I"$(db_includedir)"
62
63         # Darwin doesn't have stropts.h, bug #619416
64         [[ ${CHOST} == *-darwin* ]] && export vi_cv_sys5_pty=no
65
66         pushd dist 2>/dev/null || die
67         econf \
68                 --program-prefix=n \
69                 ${myconf}
70         popd 2>/dev/null || die
71 }
72
73 src_compile() {
74         emake -C dist
75 }
76
77 src_install() {
78         emake -C dist DESTDIR="${D}" install
79 }
80
81 pkg_postinst() {
82         einfo "Setting /usr/bin/vi symlink"
83         eselect vi update --if-unset
84 }
85
86 pkg_postrm() {
87         einfo "Updating /usr/bin/vi symlink"
88         eselect vi update --if-unset
89 }