I am attempting to install the x11/nvidia-driver. Unfortunately, it will not install. This is the error message, which is emitted immediately when attempting to build the port.
/usr/ports/x11/nvidia-driver # make
===> nvidia-driver-440.31 requires kernel source files in SRC_BASE=/usr/src.
*** Error code 1
make: stopped in /usr/ports/x11/nvidia-driver
The "/usr/src" directory is in fact, completely empty.
So, what's the actual issue?
If you want/need to build the driver from the ports tree (that is, from source), just like any other kernel module, it requires kernel sources under SRC_BASE (typically /usr/src). If this directory is empty, it means that you had neither installed the corresponding FreeBSD distribution set (src.txz) nor checked the source code out from the Subversion repository -- you should do one of those things prior to building the port.
Alternatively, you might want to install the driver in a pre-compiled form from the binary packages with pkg(8) tool.
Please tell us if you manage to successfully install the driver so this bug can be closed (even though it is technically not a bug).
(In reply to Alexey Dokuchaev from comment #2)
I can build this port via 'poudriere', but not from the command line.
At the very least, the port should announce that it will not build sans kernel sources under SRC_BASE (typically /usr/src). Perhaps a note in 'pkg-descr' or a mention of this in "UPDATING" when the port is updated.
Feel free to close this report.