diff options
author | Harald van Dijk <truedfx@gentoo.org> | 2006-07-24 08:47:27 +0000 |
---|---|---|
committer | Harald van Dijk <truedfx@gentoo.org> | 2006-07-24 08:47:27 +0000 |
commit | 18ec857ab15428def03c778a34128901f5c63d3f (patch) | |
tree | 8b544ed3d8d058dcc1ab7ee35c4b43a7d9f1d81d /app-editors/nvi | |
parent | Stable on alpha wrt bug #129126 (diff) | |
download | gentoo-2-18ec857ab15428def03c778a34128901f5c63d3f.tar.gz gentoo-2-18ec857ab15428def03c778a34128901f5c63d3f.tar.bz2 gentoo-2-18ec857ab15428def03c778a34128901f5c63d3f.zip |
Add USE='perl unicode', use db4, don't break with gcc4
(Portage version: 2.1.1_pre3-r3)
Diffstat (limited to 'app-editors/nvi')
-rw-r--r-- | app-editors/nvi/ChangeLog | 10 | ||||
-rw-r--r-- | app-editors/nvi/files/digest-nvi-1.81.5-r3 | 3 | ||||
-rw-r--r-- | app-editors/nvi/files/nvi-1.81.5-build.patch | 145 | ||||
-rw-r--r-- | app-editors/nvi/files/nvi-1.81.5-db4.patch | 33 | ||||
-rw-r--r-- | app-editors/nvi/files/nvi-1.81.5-gcc4.patch | 172 | ||||
-rw-r--r-- | app-editors/nvi/nvi-1.81.5-r3.ebuild | 67 |
6 files changed, 429 insertions, 1 deletions
diff --git a/app-editors/nvi/ChangeLog b/app-editors/nvi/ChangeLog index 4dcf7071f401..0e2419505494 100644 --- a/app-editors/nvi/ChangeLog +++ b/app-editors/nvi/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for app-editors/nvi # Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-editors/nvi/ChangeLog,v 1.25 2006/07/23 12:04:12 truedfx Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-editors/nvi/ChangeLog,v 1.26 2006/07/24 08:47:27 truedfx Exp $ + +*nvi-1.81.5-r3 (24 Jul 2006) + + 24 Jul 2006; Harald van Dijk <truedfx@gentoo.org> + +files/nvi-1.81.5-build.patch, +files/nvi-1.81.5-db4.patch, + +files/nvi-1.81.5-gcc4.patch, +nvi-1.81.5-r3.ebuild: + Fix compilation with GCC4, add support for USE=perl and USE=unicode, and use + db4 instead of db3 23 Jul 2006; Harald van Dijk <truedfx@gentoo.org> files/nvi-1.79-build.patch, nvi-1.79.ebuild: diff --git a/app-editors/nvi/files/digest-nvi-1.81.5-r3 b/app-editors/nvi/files/digest-nvi-1.81.5-r3 new file mode 100644 index 000000000000..ebc8a212032c --- /dev/null +++ b/app-editors/nvi/files/digest-nvi-1.81.5-r3 @@ -0,0 +1,3 @@ +MD5 5cc674f049054f3e8f7600df8d8d5cf4 nvi-1.81.5.tar.gz 1628555 +RMD160 d1cfd4a87250baea4832ed6cac69ed18e6880915 nvi-1.81.5.tar.gz 1628555 +SHA256 4c6b5c13999d8883da85e49e6dc2d02dddc084ac24fc72102cc372c5a0b7e745 nvi-1.81.5.tar.gz 1628555 diff --git a/app-editors/nvi/files/nvi-1.81.5-build.patch b/app-editors/nvi/files/nvi-1.81.5-build.patch new file mode 100644 index 000000000000..80b93389df8c --- /dev/null +++ b/app-editors/nvi/files/nvi-1.81.5-build.patch @@ -0,0 +1,145 @@ +--- nvi-1.81.5/dist/Makefile.am ++++ nvi-1.81.5/dist/Makefile.am +@@ -268,35 +268,12 @@ + fmode= 444 + + install-exec-local: +- cd $(DESTDIR)$(bindir) && $(rm) -f `echo ex | sed '$(transform)'` +- cd $(DESTDIR)$(bindir) && $(rm) -f `echo view | sed '$(transform)'` +- cd $(DESTDIR)$(bindir) && $(ln) \ +- `echo vi | sed '$(transform)'` `echo ex | sed '$(transform)'` +- cd $(DESTDIR)$(bindir) && $(ln) \ +- `echo vi | sed '$(transform)'` `echo view | sed '$(transform)'` + + install-data-local: install_common + @[ -d $(DESTDIR)$(mandir) ] || \ + ($(mkdir) $(DESTDIR)$(mandir) && \ + $(chmod) $(dmode) $(DESTDIR)$(mandir)) +- @[ -d $(DESTDIR)$(mandir)/cat1 ] || \ +- ($(mkdir) $(DESTDIR)$(mandir)/cat1 && \ +- $(chmod) $(dmode) $(DESTDIR)$(mandir)/cat1) + @echo "Installing man pages: $(DESTDIR)$(mandir) ..." +- @cd $(DESTDIR)$(mandir)/cat1 && \ +- $(rm) -f `echo vi.0 | sed '$(transform)'` +- @$(cp) $(visrcdir)/docs/vi.man/vi.0 \ +- $(DESTDIR)$(mandir)/cat1/`echo vi.0 | sed '$(transform)'` +- @cd $(DESTDIR)$(mandir)/cat1 && \ +- $(chmod) $(fmode) `echo vi.0 | sed '$(transform)'` +- @cd $(DESTDIR)$(mandir)/cat1 && \ +- $(rm) -f `echo ex.0 | sed '$(transform)'` +- @cd $(DESTDIR)$(mandir)/cat1 && \ +- $(rm) -f `echo view.0 | sed '$(transform)'` +- @cd $(DESTDIR)$(mandir)/cat1 && $(ln) \ +- `echo vi.0 | sed '$(transform)'` `echo ex.0 | sed '$(transform)'` +- @cd $(DESTDIR)$(mandir)/cat1 && $(ln) \ +- `echo vi.0 | sed '$(transform)'` `echo view.0 | sed '$(transform)'` + @[ -d $(DESTDIR)$(mandir)/man1 ] || \ + ($(mkdir) $(DESTDIR)$(mandir)/man1 && \ + $(chmod) $(dmode) $(DESTDIR)$(mandir)/man1) +@@ -306,14 +283,6 @@ + $(DESTDIR)$(mandir)/man1/`echo vi.1 | sed '$(transform)'` + @cd $(DESTDIR)$(mandir)/man1 && \ + $(chmod) $(fmode) `echo vi.1 | sed '$(transform)'` +- @cd $(DESTDIR)$(mandir)/man1 && \ +- $(rm) -f `echo ex.1 | sed '$(transform)'` +- @cd $(DESTDIR)$(mandir)/man1 && \ +- $(rm) -f `echo view.1 | sed '$(transform)'` +- @cd $(DESTDIR)$(mandir)/man1 && $(ln) \ +- `echo vi.1 | sed '$(transform)'` `echo ex.1 | sed '$(transform)'` +- @cd $(DESTDIR)$(mandir)/man1 && $(ln) \ +- `echo vi.1 | sed '$(transform)'` `echo view.1 | sed '$(transform)'` + + cat= dutch english french german ru_SU.KOI8-R spanish swedish + install_common: +@@ -361,17 +330,5 @@ + + uninstall-local: + $(rm) -rf $(DESTDIR)$(datadir)/vi +- cd $(DESTDIR)$(bindir) && $(rm) -f `echo ex | sed '$(transform)'` +- cd $(DESTDIR)$(bindir) && $(rm) -f `echo view | sed '$(transform)'` +- cd $(DESTDIR)$(mandir)/cat1 && \ +- $(rm) -f `echo ex.0 | sed '$(transform)'` +- cd $(DESTDIR)$(mandir)/cat1 && \ +- $(rm) -f `echo vi.0 | sed '$(transform)'` +- cd $(DESTDIR)$(mandir)/cat1 && \ +- $(rm) -f `echo view.0 | sed '$(transform)'` +- cd $(DESTDIR)$(mandir)/man1 && \ +- $(rm) -f `echo ex.1 | sed '$(transform)'` + cd $(DESTDIR)$(mandir)/man1 && \ + $(rm) -f `echo vi.1 | sed '$(transform)'` +- cd $(DESTDIR)$(mandir)/man1 && \ +- $(rm) -f `echo view.1 | sed '$(transform)'` +--- nvi-1.81.5/dist/Makefile.in ++++ nvi-1.81.5/dist/Makefile.in +@@ -2554,35 +2554,12 @@ + perl -MExtUtils::Embed -e xsinit -- -std VI + + install-exec-local: +- cd $(DESTDIR)$(bindir) && $(rm) -f `echo ex | sed '$(transform)'` +- cd $(DESTDIR)$(bindir) && $(rm) -f `echo view | sed '$(transform)'` +- cd $(DESTDIR)$(bindir) && $(ln) \ +- `echo vi | sed '$(transform)'` `echo ex | sed '$(transform)'` +- cd $(DESTDIR)$(bindir) && $(ln) \ +- `echo vi | sed '$(transform)'` `echo view | sed '$(transform)'` + + install-data-local: install_common + @[ -d $(DESTDIR)$(mandir) ] || \ + ($(mkdir) $(DESTDIR)$(mandir) && \ + $(chmod) $(dmode) $(DESTDIR)$(mandir)) +- @[ -d $(DESTDIR)$(mandir)/cat1 ] || \ +- ($(mkdir) $(DESTDIR)$(mandir)/cat1 && \ +- $(chmod) $(dmode) $(DESTDIR)$(mandir)/cat1) + @echo "Installing man pages: $(DESTDIR)$(mandir) ..." +- @cd $(DESTDIR)$(mandir)/cat1 && \ +- $(rm) -f `echo vi.0 | sed '$(transform)'` +- @$(cp) $(visrcdir)/docs/vi.man/vi.0 \ +- $(DESTDIR)$(mandir)/cat1/`echo vi.0 | sed '$(transform)'` +- @cd $(DESTDIR)$(mandir)/cat1 && \ +- $(chmod) $(fmode) `echo vi.0 | sed '$(transform)'` +- @cd $(DESTDIR)$(mandir)/cat1 && \ +- $(rm) -f `echo ex.0 | sed '$(transform)'` +- @cd $(DESTDIR)$(mandir)/cat1 && \ +- $(rm) -f `echo view.0 | sed '$(transform)'` +- @cd $(DESTDIR)$(mandir)/cat1 && $(ln) \ +- `echo vi.0 | sed '$(transform)'` `echo ex.0 | sed '$(transform)'` +- @cd $(DESTDIR)$(mandir)/cat1 && $(ln) \ +- `echo vi.0 | sed '$(transform)'` `echo view.0 | sed '$(transform)'` + @[ -d $(DESTDIR)$(mandir)/man1 ] || \ + ($(mkdir) $(DESTDIR)$(mandir)/man1 && \ + $(chmod) $(dmode) $(DESTDIR)$(mandir)/man1) +@@ -2592,14 +2569,6 @@ + $(DESTDIR)$(mandir)/man1/`echo vi.1 | sed '$(transform)'` + @cd $(DESTDIR)$(mandir)/man1 && \ + $(chmod) $(fmode) `echo vi.1 | sed '$(transform)'` +- @cd $(DESTDIR)$(mandir)/man1 && \ +- $(rm) -f `echo ex.1 | sed '$(transform)'` +- @cd $(DESTDIR)$(mandir)/man1 && \ +- $(rm) -f `echo view.1 | sed '$(transform)'` +- @cd $(DESTDIR)$(mandir)/man1 && $(ln) \ +- `echo vi.1 | sed '$(transform)'` `echo ex.1 | sed '$(transform)'` +- @cd $(DESTDIR)$(mandir)/man1 && $(ln) \ +- `echo vi.1 | sed '$(transform)'` `echo view.1 | sed '$(transform)'` + install_common: + @[ -f $(chmod) ] || (echo 'chmod not found.'; exit 1) + @[ -f $(cp) ] || (echo 'cp not found.'; exit 1) +@@ -2645,20 +2614,8 @@ + + uninstall-local: + $(rm) -rf $(DESTDIR)$(datadir)/vi +- cd $(DESTDIR)$(bindir) && $(rm) -f `echo ex | sed '$(transform)'` +- cd $(DESTDIR)$(bindir) && $(rm) -f `echo view | sed '$(transform)'` +- cd $(DESTDIR)$(mandir)/cat1 && \ +- $(rm) -f `echo ex.0 | sed '$(transform)'` +- cd $(DESTDIR)$(mandir)/cat1 && \ +- $(rm) -f `echo vi.0 | sed '$(transform)'` +- cd $(DESTDIR)$(mandir)/cat1 && \ +- $(rm) -f `echo view.0 | sed '$(transform)'` +- cd $(DESTDIR)$(mandir)/man1 && \ +- $(rm) -f `echo ex.1 | sed '$(transform)'` + cd $(DESTDIR)$(mandir)/man1 && \ + $(rm) -f `echo vi.1 | sed '$(transform)'` +- cd $(DESTDIR)$(mandir)/man1 && \ +- $(rm) -f `echo view.1 | sed '$(transform)'` + # Tell versions [3.59,3.63) of GNU make to not export all variables. + # Otherwise a system limit (for SysV at least) may be exceeded. + .NOEXPORT: diff --git a/app-editors/nvi/files/nvi-1.81.5-db4.patch b/app-editors/nvi/files/nvi-1.81.5-db4.patch new file mode 100644 index 000000000000..38248b6eed39 --- /dev/null +++ b/app-editors/nvi/files/nvi-1.81.5-db4.patch @@ -0,0 +1,33 @@ +--- nvi-1.81.5/common/exf.c ++++ nvi-1.81.5/common/exf.c +@@ -282,7 +282,7 @@ + #define NOMMAPIFFCNTL 0 + #endif + +- if ((sp->db_error = ep->db->open(ep->db, ep->rcv_path, NULL, DB_RECNO, ++ if ((sp->db_error = ep->db->open(ep->db, NULL, ep->rcv_path, NULL, DB_RECNO, + ((rcv_name == 0) ? DB_TRUNCATE : 0) | VI_DB_THREAD | NOMMAPIFFCNTL, + S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)) != 0) { + msgq_str(sp, +--- nvi-1.81.5/common/log.c ++++ nvi-1.81.5/common/log.c +@@ -108,7 +108,7 @@ + ep->l_high = ep->l_cur = 1; + + if (db_create(&ep->log, sp->gp->env, 0) != 0 || +- ep->log->open(ep->log, NULL, NULL, DB_RECNO, ++ ep->log->open(ep->log, NULL, NULL, NULL, DB_RECNO, + DB_CREATE | VI_DB_THREAD, S_IRUSR | S_IWUSR) != 0) { + msgq(sp, M_SYSERR, "009|Log file"); + F_SET(ep, F_NOLOG); +--- nvi-1.81.5/common/msg.c ++++ nvi-1.81.5/common/msg.c +@@ -721,7 +721,7 @@ + p = file; + if ((sp->db_error = db_create(&db, sp->gp->env, 0)) != 0 || + (sp->db_error = db->set_re_source(db, p)) != 0 || +- (sp->db_error = db->open(db, NULL, NULL, DB_RECNO, 0, 0)) != 0) { ++ (sp->db_error = db->open(db, NULL, NULL, NULL, DB_RECNO, 0, 0)) != 0) { + if (first) { + first = 0; + return (1); diff --git a/app-editors/nvi/files/nvi-1.81.5-gcc4.patch b/app-editors/nvi/files/nvi-1.81.5-gcc4.patch new file mode 100644 index 000000000000..8d486fbaa257 --- /dev/null +++ b/app-editors/nvi/files/nvi-1.81.5-gcc4.patch @@ -0,0 +1,172 @@ +--- nvi-1.81.5/cl/cl_funcs.c ++++ nvi-1.81.5/cl/cl_funcs.c +@@ -381,7 +381,7 @@ + + if (CLSP(discardp)) { + delwin(CLSP(discardp)); +- CLSP(discardp) = NULL; ++ discardp->cl_private = NULL; + } + } + +@@ -395,7 +395,7 @@ + + if (CLSP(tsp)) + delwin(CLSP(tsp)); +- CLSP(tsp) = subwin(stdscr, tsp->rows, tsp->cols, ++ tsp->cl_private = subwin(stdscr, tsp->rows, tsp->cols, + tsp->roff, tsp->coff); + } + +@@ -716,9 +716,9 @@ + if (CLSP(origp)) + delwin(CLSP(origp)); + +- CLSP(origp) = subwin(stdscr, origp->rows, origp->cols, ++ origp->cl_private = subwin(stdscr, origp->rows, origp->cols, + origp->roff, origp->coff); +- CLSP(newp) = subwin(stdscr, newp->rows, newp->cols, ++ newp->cl_private = subwin(stdscr, newp->rows, newp->cols, + newp->roff, newp->coff); + + /* origp is the original screen, giving up space to newp. */ +--- nvi-1.81.5/cl/cl_screen.c ++++ nvi-1.81.5/cl/cl_screen.c +@@ -56,7 +56,7 @@ + if (F_ISSET(gp, G_SRESTART)) { + if (CLSP(sp)) { + delwin(CLSP(sp)); +- CLSP(sp) = NULL; ++ sp->cl_private = NULL; + } + if (cl_quit(gp)) + return (1); +--- nvi-1.81.5/common/db.c ++++ nvi-1.81.5/common/db.c +@@ -94,6 +94,7 @@ + CHAR_T *wp; + size_t wlen; + size_t nlen; ++ char *c_lp; + + /* + * The underlying recno stuff handles zero by returning NULL, but +@@ -164,7 +165,9 @@ + nlen = 1024; + retry: + /* data.size contains length in bytes */ +- BINC_GOTO(sp, (char *)ep->c_lp, ep->c_blen, nlen); ++ c_lp = (char *) ep->c_lp; ++ BINC_GOTO(sp, c_lp, ep->c_blen, nlen); ++ ep->c_lp = (CHAR_T *) c_lp; + + /* Get the line from the underlying database. */ + memset(&key, 0, sizeof(key)); +--- nvi-1.81.5/common/key.c ++++ nvi-1.81.5/common/key.c +@@ -829,11 +829,14 @@ + { + WIN *wp; + size_t new_nelem, olen; ++ char *i_event; + + wp = sp->wp; + new_nelem = wp->i_nelem + add; + olen = wp->i_nelem * sizeof(wp->i_event[0]); +- BINC_RET(sp, (char *)wp->i_event, olen, new_nelem * sizeof(wp->i_event[0])); ++ i_event = (char *) wp->i_event; ++ BINC_RET(sp, i_event, olen, new_nelem * sizeof(wp->i_event[0])); ++ wp->i_event = (EVENT *) i_event; + wp->i_nelem = olen / sizeof(wp->i_event[0]); + return (0); + } +--- nvi-1.81.5/common/mem.h ++++ nvi-1.81.5/common/mem.h +@@ -25,9 +25,10 @@ + lp = L__bincp; \ + } \ + } +-#define BINC_GOTOW(sp, lp, llen, nlen) { \ +- CHAR_T *L__bp = lp; \ +- BINC_GOTO(sp, (char *)lp, llen, (nlen) * sizeof(CHAR_T)) \ ++#define BINC_GOTOW(sp, lp, llen, nlen) { \ ++ char *L__bp = (char *) lp; \ ++ BINC_GOTO(sp, L__bp, llen, (nlen) * sizeof(CHAR_T)) \ ++ lp = (CHAR_T *) L__bp; \ + } + #define BINC_RET(sp, lp, llen, nlen) { \ + char *L__p = lp; \ +@@ -43,8 +44,9 @@ + } \ + } + #define BINC_RETW(sp, lp, llen, nlen) { \ +- CHAR_T *L__bp = lp; \ +- BINC_RET(sp, (char *)lp, llen, (nlen) * sizeof(CHAR_T)) \ ++ char *L__bp = (char *) lp; \ ++ BINC_RET(sp, L__bp, llen, (nlen) * sizeof(CHAR_T)) \ ++ lp = (CHAR_T *) L__bp; \ + } + + /* +@@ -66,8 +68,9 @@ + } \ + } + #define GET_SPACE_GOTOW(sp, bp, blen, nlen) { \ +- CHAR_T *L__bp = bp; \ +- GET_SPACE_GOTO(sp, (char *)bp, blen, (nlen) * sizeof(CHAR_T)) \ ++ char *L__bp = (char *) bp; \ ++ GET_SPACE_GOTO(sp, L__bp, blen, (nlen) * sizeof(CHAR_T)) \ ++ bp = (CHAR_T *) L__bp; \ + } + #define GET_SPACE_RET(sp, bp, blen, nlen) { \ + WIN *L__wp = (sp) == NULL ? NULL : (sp)->wp; \ +@@ -83,8 +86,9 @@ + } \ + } + #define GET_SPACE_RETW(sp, bp, blen, nlen) { \ +- CHAR_T *L__bp = bp; \ +- GET_SPACE_RET(sp, (char *)bp, blen, (nlen) * sizeof(CHAR_T)) \ ++ char *L__bp = (char *) bp; \ ++ GET_SPACE_RET(sp, L__bp, blen, (nlen) * sizeof(CHAR_T)) \ ++ bp = (CHAR_T *) L__bp; \ + } + + /* +@@ -103,8 +107,9 @@ + BINC_GOTO(sp, bp, blen, nlen); \ + } + #define ADD_SPACE_GOTOW(sp, bp, blen, nlen) { \ +- CHAR_T *L__bp = bp; \ +- ADD_SPACE_GOTO(sp, (char *)bp, blen, (nlen) * sizeof(CHAR_T)) \ ++ char *L__bp = (char *) bp; \ ++ ADD_SPACE_GOTO(sp, L__bp, blen, (nlen) * sizeof(CHAR_T)) \ ++ bp = (CHAR_T *) L__bp; \ + } + #define ADD_SPACE_RET(sp, bp, blen, nlen) { \ + WIN *L__wp = (sp) == NULL ? NULL : (sp)->wp; \ +@@ -118,8 +123,9 @@ + BINC_RET(sp, bp, blen, nlen); \ + } + #define ADD_SPACE_RETW(sp, bp, blen, nlen) { \ +- CHAR_T *L__bp = bp; \ +- ADD_SPACE_RET(sp, (char *)bp, blen, (nlen) * sizeof(CHAR_T)) \ ++ char *L__bp = (char *) bp; \ ++ ADD_SPACE_RET(sp, bp, blen, (nlen) * sizeof(CHAR_T)) \ ++ bp = (CHAR_T *) L__bp; \ + } + + /* Free a GET_SPACE returned buffer. */ +--- nvi-1.81.5/vi/v_txt.c ++++ nvi-1.81.5/vi/v_txt.c +@@ -589,8 +589,10 @@ + + /* Check to see if the character fits into the replay buffers. */ + if (LF_ISSET(TXT_RECORD)) { +- BINC_GOTO(sp, (char *)vip->rep, ++ char *rep = (char *) vip->rep; ++ BINC_GOTO(sp, rep, + vip->rep_len, (rcol + 1) * sizeof(EVENT)); ++ vip->rep = (EVENT *) rep; + vip->rep[rcol++] = *evp; + } + diff --git a/app-editors/nvi/nvi-1.81.5-r3.ebuild b/app-editors/nvi/nvi-1.81.5-r3.ebuild new file mode 100644 index 000000000000..ab2c3f11f2e0 --- /dev/null +++ b/app-editors/nvi/nvi-1.81.5-r3.ebuild @@ -0,0 +1,67 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-editors/nvi/nvi-1.81.5-r3.ebuild,v 1.1 2006/07/24 08:47:27 truedfx Exp $ + +inherit eutils + +DESCRIPTION="Vi clone" +HOMEPAGE="http://www.bostic.com/vi/" +SRC_URI="http://www.kotnet.org/~skimo/nvi/devel/${P}.tar.gz" + +LICENSE="Sleepycat" +SLOT="0" +KEYWORDS="~x86 ~ppc ~sparc ~mips ~alpha ~hppa ~amd64 ~ppc64" +IUSE="perl unicode" + +DEPEND="=sys-libs/db-4*" +RDEPEND="${DEPEND} + !app-editors/vim + !app-editors/gvim" +PROVIDE="virtual/editor" + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}"/${P}-build.patch + # Fix bug 23888 + epatch "${FILESDIR}"/${P}-tcsetattr.patch + epatch "${FILESDIR}"/${P}-gcc4.patch + epatch "${FILESDIR}"/${P}-db4.patch +} + +src_compile() { + local myconf + + use perl && myconf="${myconf} --enable-perlinterp" + use unicode && myconf="${myconf} --enable-widechar" + + cd build.unix + ECONF_SOURCE=../dist econf \ + --program-prefix=n \ + ${myconf} \ + || die "configure failed" + emake || die "make failed" +} + +src_install() { + cd build.unix + emake DESTDIR="${D}" install || die "install failed" +} + +pkg_postinst() { + [[ ! -e "${ROOT}"/usr/bin/vi ]] && + ln -sf nvi "${ROOT}"/usr/bin/vi + [[ ! -e "${ROOT}"/usr/bin/ex ]] && + ln -sf nvi "${ROOT}"/usr/bin/ex + [[ ! -e "${ROOT}"/usr/bin/view ]] && + ln -sf nvi "${ROOT}"/usr/bin/view +} + +pkg_postrm() { + [[ -L "${ROOT}"/usr/bin/vi && ! -f "${ROOT}"/usr/bin/vi ]] && + rm -f "${ROOT}"/usr/bin/vi + [[ -L "${ROOT}"/usr/bin/ex && ! -f "${ROOT}"/usr/bin/ex ]] && + rm -f "${ROOT}"/usr/bin/ex + [[ -L "${ROOT}"/usr/bin/view && ! -f "${ROOT}"/usr/bin/view ]] && + rm -f "${ROOT}"/usr/bin/view +} |