# Buildsheet autogenerated by ravenadm tool -- Do not edit. NAMEBASE= nvi VERSION= 1.81.6 REVISION= 5 KEYWORDS= editors VARIANTS= std SDESC[std]= Berkeley nvi with additional features HOMEPAGE= none CONTACT= nobody DOWNLOAD_GROUPS= main SITES[main]= http://ravenports.elderlinux.org/distcache/ DISTFILE[1]= nvi-1.81.6.tar.bz2:main DF_INDEX= 1 SPKGS[std]= set primary dev man OPTIONS_AVAILABLE= BYTECHAR OPTIONS_STANDARD= BYTECHAR OPT_ON[sunos]= BYTECHAR OPT_ON[linux]= BYTECHAR BUILD_DEPENDS= db4:dev:std USES= libtool ncurses:build pkgconfig MUST_CONFIGURE= gnu CONFIGURE_OUTSOURCE= yes CONFIGURE_WRKSRC= {{WRKSRC}}/build_unix CONFIGURE_SCRIPT= dist/configure CONFIGURE_ARGS= --program-prefix=n --enable-shared=no --with-db=system --with-db-prefix={{LOCALBASE}}/db4 --with-curses={{NCURSESBASE}} CONFIGURE_ENV= vi_cv_have_curses_setupterm=yes vi_cv_path_preserve="/tmp" CPPFLAGS= -I{{NCURSESINC}} LDFLAGS= -L{{NCURSESLIB}} VAR_OPSYS[sunos]= CONFIGURE_ENV=LIBS="-lrt -lsocket" [BYTECHAR].DESCRIPTION= Disable widechar capability [BYTECHAR].CONFIGURE_ARGS_OFF= --enable-widechar [BYTECHAR].CPPFLAGS_OFF= -DNCURSES_WIDECHAR=1 post-install: ${RM} -r ${STAGEDIR}${MANPREFIX}/man/cat1 pre-configure: ${REINPLACE_CMD} -e '/libvi_la_LIBADD =/s,$$, ${ICONV_LIB},' \ ${WRKSRC}/dist/Makefile.in post-extract: # disable shared iconv and ncurses ${RM} ${LOCALBASE}/lib/libiconv.so ${RM} ${LOCALBASE}/lib/libncurses.so ${RM} ${LOCALBASE}/lib/libtinfo.so ${RM} ${LOCALBASE}/db4/lib/libdb.so [FILE:258:descriptions/desc.primary] Nvi is an implementation of the ex/vi text editor originally distributed as part of the Fourth Berkeley Software Distribution (4BSD), by the University of California, Berkeley. The source code to nvi is freely available, and nvi may be freely redistributed. [FILE:97:distinfo] 3441b8e3247b2b6dd19b5fd38355fe6593b2a92e960ecb3dd00d676f63d06b59 1758309 nvi-1.81.6.tar.bz2 [FILE:230:manifests/plist.primary] bin/ nex nvi nview share/vi/recover share/vi/catalog/ dutch english french german ru_SU.KOI8-R spanish swedish share/vi/perl/ forall.pl make.pl tk.pl wc.pl share/vi/tcl/ errors.tcl gnats.tcl mailprocs.tcl wc.tcl [FILE:12:manifests/plist.dev] lib/libvi.a [FILE:39:manifests/plist.man] share/man/man1/ nex.1 nvi.1 nview.1 [FILE:253:patches/patch-cl_cl__funcs.c] --- cl/cl_funcs.c.orig 2007-11-18 16:41:42 UTC +++ cl/cl_funcs.c @@ -18,6 +18,7 @@ static const char sccsid[] = "$Id: cl_fu #include #include +#include #include #include #include [FILE:273:patches/patch-cl_cl__main.c] --- cl/cl_main.c.orig 2007-11-18 16:41:42 UTC +++ cl/cl_main.c @@ -25,6 +25,7 @@ static const char sccsid[] = "$Id: cl_ma #include #include #include +#include #include "../common/common.h" #include "../ip/extern.h" [FILE:256:patches/patch-cl_cl__screen.c] --- cl/cl_screen.c.orig 2007-11-18 16:41:42 UTC +++ cl/cl_screen.c @@ -17,6 +17,7 @@ static const char sccsid[] = "$Id: cl_sc #include #include +#include #include #include #include [FILE:6300:patches/patch-common_conv.c] --- common/conv.c.orig 2025-07-04 16:57:38 UTC +++ common/conv.c @@ -61,29 +61,6 @@ raw2int(SCR *sp, const char * str, ssize } #define CONV_BUFFER_SIZE 512 -/* fill the buffer with codeset encoding of string pointed to by str - * left has the number of bytes left in str and is adjusted - * len contains the number of bytes put in the buffer - */ -#ifdef USE_ICONV -#define CONVERT(str, left, src, len) \ - do { \ - size_t outleft; \ - char *bp = buffer; \ - outleft = CONV_BUFFER_SIZE; \ - errno = 0; \ - if (iconv(id, (char **)&str, &left, &bp, &outleft) == -1 /*&& \ - errno != E2BIG*/) \ - goto err; \ - if ((len = CONV_BUFFER_SIZE - outleft) == 0) { \ - error = -left; \ - goto err; \ - } \ - src = buffer; \ - } while (0) -#else -#define CONVERT(str, left, src, len) -#endif int default_char2int(SCR *sp, const char * str, ssize_t len, CONVWIN *cw, @@ -109,7 +86,29 @@ default_char2int(SCR *sp, const char * s id = iconv_open(nl_langinfo(CODESET), enc); if (id == (iconv_t)-1) goto err; - CONVERT(str, left, src, len); + /* + * fill the buffer with codeset encoding of string pointed to by str + * left has the number of bytes left in str and is adjusted + * len contains the number of bytes put in the buffer (CONVERT macro) + */ + errno = 0; + do { + size_t outleft = CONV_BUFFER_SIZE; + char *pbuffer = buffer; +# if defined __sun__ + if (iconv(id, (const char **)&str, &left, &pbuffer, &outleft) == -1) +# else + if (iconv(id, (char **)&str, &left, &pbuffer, &outleft) == -1) +# endif + { + goto err; + } + if ((len = CONV_BUFFER_SIZE - outleft) == 0) { + error = -left; + goto err; + } + src = buffer; + } while (0); } #endif @@ -125,7 +124,27 @@ default_char2int(SCR *sp, const char * s BINC_RETW(NULL, *tostr, *blen, nlen); } if (id != (iconv_t)-1 && j == len && left) { - CONVERT(str, left, src, len); +#ifdef USE_ICONV + /* CONVERT macro */ + errno = 0; + do { + size_t outleft = CONV_BUFFER_SIZE; + char *pbuffer = buffer; +# if defined __sun__ + if (iconv(id, (const char **)&str, &left, &pbuffer, &outleft) == -1) +# else + if (iconv(id, (char **)&str, &left, &pbuffer, &outleft) == -1) +# endif + { + goto err; + } + if ((len = CONV_BUFFER_SIZE - outleft) == 0) { + error = -left; + goto err; + } + src = buffer; + } while (0); +#endif j = 0; } } @@ -210,7 +229,8 @@ int default_int2char(SCR *sp, const CHAR_T * str, ssize_t len, CONVWIN *cw, size_t *tolen, char **pdst, char *enc) { - int i, j, offset = 0; + int i, offset = 0; + size_t j; char **tostr = (char **)&cw->bp1; size_t *blen = &cw->blen1; mbstate_t mbs; @@ -221,32 +241,6 @@ default_int2char(SCR *sp, const CHAR_T * char buffer[CONV_BUFFER_SIZE]; iconv_t id = (iconv_t)-1; -/* convert first len bytes of buffer and append it to cw->bp - * len is adjusted => 0 - * offset contains the offset in cw->bp and is adjusted - * cw->bp is grown as required - */ -#ifdef USE_ICONV -#define CONVERT2(len, cw, offset) \ - do { \ - char *bp = buffer; \ - while (len != 0) { \ - size_t outleft = cw->blen1 - offset; \ - char *obp = (char *)cw->bp1 + offset; \ - if (cw->blen1 < offset + MB_CUR_MAX) { \ - nlen += 256; \ - BINC_RETC(NULL, cw->bp1, cw->blen1, nlen); \ - } \ - errno = 0; \ - if (iconv(id, &bp, &len, &obp, &outleft) == -1 && \ - errno != E2BIG) \ - goto err; \ - offset = cw->blen1 - outleft; \ - } \ - } while (0) -#else -#define CONVERT2(len, cw, offset) -#endif MEMSET(&mbs, 0, 1); @@ -268,7 +262,32 @@ default_int2char(SCR *sp, const CHAR_T * j += n; if (buflen < j + MB_CUR_MAX) { if (id != (iconv_t)-1) { - CONVERT2(j, cw, offset); +#ifdef USE_ICONV + /* convert first len bytes of buffer and append it to cw->bp + * len (aka j) is adjusted => 0 + * offset contains the offset in cw->bp and is adjusted + * cw->bp is grown as required + */ + errno = 0; + do { +# if defined(__sun__) + const char *pbuffer = buffer; +# else + char *pbuffer = buffer; +# endif + while (j != 0) { + size_t outleft = cw->blen1 - offset; + char *obp = (char *)cw->bp1 + offset; + if (cw->blen1 < offset + MB_CUR_MAX) { + nlen += 256; + BINC_RETC(NULL, cw->bp1, cw->blen1, nlen); + } + if (iconv(id, &pbuffer, &j, &obp, &outleft) == -1 && errno != E2BIG) + goto err; + offset = cw->blen1 - outleft; + } + } while(0); +#endif } else { nlen += 256; BINC_RETC(NULL, *tostr, *blen, nlen); @@ -282,7 +301,28 @@ default_int2char(SCR *sp, const CHAR_T * *tolen = j; if (id != (iconv_t)-1) { - CONVERT2(j, cw, offset); +#ifdef USE_ICONV + /* CONVERT2 macro */ + errno = 0; + do { +# if defined(__sun__) + const char *pbuffer = buffer; +# else + char *pbuffer = buffer; +# endif + while (j != 0) { + size_t outleft = cw->blen1 - offset; + char *obp = (char *)cw->bp1 + offset; + if (cw->blen1 < offset + MB_CUR_MAX) { + nlen += 256; + BINC_RETC(NULL, cw->bp1, cw->blen1, nlen); + } + if (iconv(id, &pbuffer, &j, &obp, &outleft) == -1 && errno != E2BIG) + goto err; + offset = cw->blen1 - outleft; + } + } while(0); +#endif *tolen = offset; } @@ -322,11 +362,16 @@ conv_init (SCR *orig, SCR *sp) else { setlocale(LC_ALL, ""); #ifdef USE_WIDECHAR - sp->conv.sys2int = cs_char2int; - sp->conv.int2sys = cs_int2char; - sp->conv.file2int = fe_char2int; - sp->conv.int2file = fe_int2char; - sp->conv.input2int = ie_char2int; + if (!strcmp(LANGCODESET, "ANSI_X3.4-1968")) { + sp->conv.file2int = sp->conv.input2int = sp->conv.sys2int = raw2int; + sp->conv.int2sys = sp->conv.int2file = int2raw; + } else { + sp->conv.sys2int = cs_char2int; + sp->conv.int2sys = cs_int2char; + sp->conv.file2int = fe_char2int; + sp->conv.int2file = fe_int2char; + sp->conv.input2int = ie_char2int; + } #endif #ifdef USE_ICONV o_set(sp, O_FILEENCODING, OS_STRDUP, nl_langinfo(CODESET), 0); [FILE:223:patches/patch-common_conv.h] --- common/conv.h.orig 2007-11-18 16:41:42 UTC +++ common/conv.h @@ -21,3 +21,6 @@ struct _conv { char2wchar_t input2int; wchar2char_t int2disp; }; + +int conv_enc (SCR *, int, char *); +void conv_init (SCR *, SCR *); [FILE:518:patches/patch-common_db.h] --- common/db.h.orig 2007-11-18 16:41:42 UTC +++ common/db.h @@ -16,7 +16,10 @@ (env)->remove(env, path, NULL, flags) #endif -#if DB_VERSION_MAJOR >= 4 && DB_VERSION_MINOR >= 1 +#if DB_VERSION_MAJOR >= 4 && DB_VERSION_MINOR >= 4 +#define db_open(db,file,type,flags,mode) \ + (db)->open(db, NULL, file, NULL, type, flags | DB_CREATE, mode) +#elif DB_VERSION_MAJOR >= 4 && DB_VERSION_MINOR >= 1 #define db_open(db,file,type,flags,mode) \ (db)->open(db, NULL, file, NULL, type, flags, mode) #else [FILE:1059:patches/patch-common_exf.c] Get rid of "page sizes must be a power-of-2" warning when loading a file. ffsl function is available on NetBSD 11, not NetBSD 10. Just use the GCC builtin for all platforms. --- common/exf.c.orig 2007-11-18 16:41:42 UTC +++ common/exf.c @@ -228,15 +228,17 @@ file_init(SCR *sp, FREF *frp, char *rcv_ /* * XXX * A seat of the pants calculation: try to keep the file in - * 15 pages or less. Don't use a page size larger than 10K + * 15 pages or less. Don't use a page size larger than 16K * (vi should have good locality) or smaller than 1K. */ - psize = ((sb.st_size / 15) + 1023) / 1024; - if (psize > 10) - psize = 10; - if (psize == 0) - psize = 1; - psize *= 1024; + psize = (sb.st_size > 0) ? __builtin_ffsl(sb.st_size - 1) + 1 : 0; + /* Do these very low limits make sense anymore? */ + if (psize < 10) + psize = 10; /* 1K */ + if (psize > 14) + psize = 14; /* 16K */ + /* Keep page size on power of 2 boundary to keep db4 happy. */ + psize = 1 << psize; F_SET(ep, F_DEVSET); ep->mdev = sb.st_dev; [FILE:604:patches/patch-common_msg.c] Ignore LANG=C or any value of LANG. It was causing exit messages of "./C" file does not exist when LANG was defined in the environment. --- common/msg.c.orig 2007-11-18 16:41:42 UTC +++ common/msg.c @@ -718,8 +718,7 @@ msg_open(SCR *sp, char *file) char *p, *t, buf[MAXPATHLEN]; if ((p = strrchr(file, '/')) != NULL && p[1] == '\0' && - (((t = getenv("LC_MESSAGES")) != NULL && t[0] != '\0') || - ((t = getenv("LANG")) != NULL && t[0] != '\0'))) { + (((t = getenv("LC_MESSAGES")) != NULL && t[0] != '\0'))) { (void)snprintf(buf, sizeof(buf), "%s%s", file, t); p = buf; } else [FILE:738:patches/patch-common_util.c] --- common/util.c.orig 2007-11-18 16:41:42 UTC +++ common/util.c @@ -163,7 +163,11 @@ enum nresult nget_uslong(SCR *sp, u_long *valp, const CHAR_T *p, CHAR_T **endp, int base) { errno = 0; +#if defined(__sun__) || defined(__linux__) + *valp = STRTOUL(p, (char **)endp, base); +#else *valp = STRTOUL(p, endp, base); +#endif if (errno == 0) return (NUM_OK); if (errno == ERANGE && *valp == ULONG_MAX) @@ -181,7 +185,11 @@ enum nresult nget_slong(SCR *sp, long int *valp, const CHAR_T *p, CHAR_T **endp, int base) { errno = 0; +#if defined(__sun__) || defined(__linux__) + *valp = STRTOL(p, (char **)endp, base); +#else *valp = STRTOL(p, endp, base); +#endif if (errno == 0) return (NUM_OK); if (errno == ERANGE) { [FILE:325:patches/patch-dist_config.h] --- dist/config.h.in.orig 2007-11-18 16:43:48 UTC +++ dist/config.h.in @@ -85,9 +85,6 @@ /* Define if you have */ #undef HAVE_SYS_SELECT_H -/* Define if you have the System V style pty calls. */ -#undef HAVE_SYS5_PTY - /* Define if you want to compile in the Tcl interpreter. */ #undef HAVE_TCL_INTERP [FILE:4717:patches/patch-dist_configure] --- dist/configure.orig 2007-11-18 16:43:54 UTC +++ dist/configure @@ -21142,7 +21142,7 @@ fi echo "${ECHO_T}$vi_cv_runpath" >&6; } if test "X$vi_cv_runpath" = "Xyes"; then - LRscript='s/^\(.*\)/-R\1 -L\1 /' + LRscript='s/^\(.*\)/-Wl,-rpath,\1 -L\1 /' else LRscript='s/^\(.*\)/-L\1 /' fi @@ -23510,7 +23510,7 @@ fi CPPFLAGS="$CURSCPPFLAGS $CPPFLAGS" if test "$vi_cv_widechar" = "yes"; then - for vi_cv_curses in ncurses ncursesw curses; do + for vi_cv_curses in "ncurses -ltinfo" curses; do as_ac_Lib=`echo "ac_cv_lib_$vi_cv_curses''_waddnwstr" | $as_tr_sh` { echo "$as_me:$LINENO: checking for waddnwstr in -l$vi_cv_curses" >&5 echo $ECHO_N "checking for waddnwstr in -l$vi_cv_curses... $ECHO_C" >&6; } @@ -23581,7 +23581,7 @@ fi vi_cv_curses=unknown done else - for vi_cv_curses in ncurses ncursesw curses; do + for vi_cv_curses in "ncurses -ltinfo" curses; do as_ac_Lib=`echo "ac_cv_lib_$vi_cv_curses''_initscr" | $as_tr_sh` { echo "$as_me:$LINENO: checking for initscr in -l$vi_cv_curses" >&5 echo $ECHO_N "checking for initscr in -l$vi_cv_curses... $ECHO_C" >&6; } @@ -23655,9 +23655,9 @@ fi if test "$vi_cv_curses" != "unknown"; then CURSHEADER=curses.h - if test "$vi_cv_curses" = "ncurses"; then + if test "$vi_cv_curses" = "ncurses -ltinfo"; then -for ac_header in ncurses.h +for ac_header in ncurses.h ncurses/ncurses.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then @@ -27631,6 +27631,8 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +#include +#include main(){char buf[20]; exit(sprintf(buf, "XXX") != 3);} _ACEOF rm -f conftest$ac_exeext @@ -27950,7 +27952,8 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -main(){exit(sizeof(unsigned char) != 1);} +#include +int main(){exit(sizeof(unsigned char) != 1);} _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" @@ -28056,7 +28059,8 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -main(){exit(sizeof(unsigned short) != 2);} +#include +int main(){exit(sizeof(unsigned short) != 2);} _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" @@ -28098,7 +28102,8 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -main(){exit(sizeof(unsigned int) != 2);} +#include +int main(){exit(sizeof(unsigned int) != 2);} _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" @@ -28209,7 +28214,8 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -main(){exit(sizeof(short) != 2);} +#include +int main(){exit(sizeof(short) != 2);} _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" @@ -28251,7 +28257,8 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -main(){exit(sizeof(int) != 2);} +#include +int main(){exit(sizeof(int) != 2);} _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" @@ -28362,7 +28369,8 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -main(){exit(sizeof(unsigned int) != 4);} +#include +int main(){exit(sizeof(unsigned int) != 4);} _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" @@ -28404,7 +28412,8 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -main(){exit(sizeof(unsigned long) != 4);} +#include +int main(){exit(sizeof(unsigned long) != 4);} _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" @@ -28515,7 +28524,8 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -main(){exit(sizeof(int) != 4);} +#include +int main(){exit(sizeof(int) != 4);} _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" @@ -28557,7 +28567,8 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -main(){exit(sizeof(long) != 4);} +#include +int main(){exit(sizeof(long) != 4);} _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" @@ -28624,7 +28635,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include -int fprintf (); +/*int fprintf ();*/ int main () @@ -28767,6 +28778,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +#include #include int main ()