-
Notifications
You must be signed in to change notification settings - Fork 32
Porting
Zhihao Yuan edited this page Jan 23, 2023
·
5 revisions
Nvi2 is a POSIX-compatible Vi implementation written for the modern BSDs, including FreeBSD, NetBSD, OpenBSD, DragonFly BSD, and other OSs based on them. The main goal of the project is to replace the old nvi-1.79 or nvi-1.81.6 in their base systems. Since Mac OS X already choose vim-lite as its vi implementation, some parts in this article may not apply to that platform.
- CMake >= 3.9;
- POSIX.1-2008-compatible libc;
- libiconv (for USE_ICONV);
- libncursesw (for USE_WIDECHAR);
- libutil;
- uudecode(1) with -m option (Base64);
-
- Anything required by a minimal nvi-1.79, notably:
-
- Berkeley DB1 in libc;
- /var/tmp/vi.recover/ with mode 41777.
- Program
- Run
cmake -B build -DCMAKE_BUILD_TYPE=Releaseunder the source tree, followed byccmake build/to confirm all the options and libraries. Upon success, build thenvibinary withmake -C build/. - Catalog
-
cdto thecatalog/directory under the source tree, runmake.
- Program
- Install
build/nvito/usr/bin/, and point the symbol links,nexnviewviexandviewto it. - Manpage
- Install
man/vi.1to/usr/share/man/man1, and point the symbol linksnvi.1nex.1nview.1ex.1andview.1to it. - Catalog
- Install the files, dutch english french german polish ru_RU.KOI8-R spanish swedish tr_TR.ISO8859-9 tr_TR.UTF-8 uk_UA.KOI8-U zh_CN.GB2312, under the
catalog/directory to/usr/share/vi/catalog/, and create sufficient symbol links with the POSIX locale(1) names and point them to the corresponding catalog files. For example, en_US.ISO8859-1 -> english, zh_CN.GBK -> zh_CN.GB2312. - Recovery script
-
build/recovershows the basic logic of sending the recovery notification emails to the users. A system-wide rc.d script,/etc/rc.d/virecover, for example, need to be prepared. Note that the recovery files start to use the newX-vi-data:header, in the form ofX-vi-data: <file|path>;<MIME folding base64 sequence>, since nvi-2.1.0, so the logic in the old rc.d scripts need to be changed.
Ask me if you have any questions. I'm a BSD guy.
| Author: | Zhihao Yuan |
|---|---|
| Email: | lichray@gmail.com |