xref: /freebsd/contrib/nvi/INSTALL.md (revision 1719886f6d08408b834d270c59ffcfd821c8f63a)
1# Install from source
2
3For instructions to bring nvi2 as a part of your operating system's base system, see [Porting](https://github.com/lichray/nvi2/wiki/Porting) in the Wiki. This document is an overview of the build process that allows you to give nvi2 a try.
4
5## Prerequisites
6
7- CMake >= 3.17;
8- Ninja build system;
9- libiconv (for `USE_ICONV`);
10- libncursesw (for `USE_WIDECHAR`);
11
12Anything required by a minimal nvi, notably:
13
14- Berkeley DB1 in libc;
15- /var/tmp/vi.recover/ with mode 41777.
16
17## Building
18
19Nvi2 uses CMake build system generator. By specifying "Ninja Multi-Config" as the build system to generate, you can compile the project in both Debug and Release modes without re-running CMake. Under the project root directory, run
20
21```sh
22cmake -G "Ninja Multi-Config" -B build
23```
24
25Now `build` becomes your build directory to hold the artifacts. To build nvi2 in Debug mode, run
26
27```sh
28ninja -C build
29```
30
31Upon finishing, the nvi2 executable will be available as `build/Debug/nvi`. To launch it in `ex` mode, you can create a symlink
32
33```sh
34ln -s nvi build/Debug/ex
35```
36
37and run `./build/Debug/ex` rather than `./build/Debug/nvi`.
38
39To build nvi2 in Release mode, use the following command instead:
40
41```sh
42ninja -C build -f build-Release.ninja
43```
44
45Upon finishing, you will be able to edit files with `./build/Release/nvi`.
46
47To change configure-time options, such as disabling wide character support, use `ccmake build`.
48