1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit autotools db-use flag-o-matic
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"
14 KEYWORDS="~alpha amd64 ~arm hppa ~mips ppc ppc64 sparc x86 ~x64-macos"
15 IUSE="perl tcl unicode"
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= )"
26 app-eselect/eselect-vi"
28 REQUIRED_USE="tcl? ( !unicode )"
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
45 chmod +x findconfig || die
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
56 use perl && myconf="${myconf} --enable-perlinterp"
57 use unicode && myconf="${myconf} --enable-widechar"
58 use tcl && myconf="${myconf} --enable-tclinterp"
60 append-cppflags "-D_PATH_MSGCAT=\"\\\"${EPREFIX%/}/usr/share/vi/catalog/\\\"\""
61 append-cppflags -I"$(db_includedir)"
63 # Darwin doesn't have stropts.h, bug #619416
64 [[ ${CHOST} == *-darwin* ]] && export vi_cv_sys5_pty=no
66 pushd dist 2>/dev/null || die
70 popd 2>/dev/null || die
78 emake -C dist DESTDIR="${D}" install
82 einfo "Setting /usr/bin/vi symlink"
83 eselect vi update --if-unset
87 einfo "Updating /usr/bin/vi symlink"
88 eselect vi update --if-unset