Can’t compile a port software. Error: Unable to determine OS version. Either define OSVERSION, install /usr/include/sys/param.h or define SRC_BASE
-
Hi,
I'm trying to compile a port and I get this error:
make: "/usr/ports/Mk/bsd.port.mk" line 1177: Unable to determine OS version. Either define OSVERSION, install /usr/include/sys/param.h or define SRC_BASE. make: stopped in /usr/ports/devel/gh
This is what I did:
git clone --depth 1 https://github.com/pfsense/FreeBSD-ports /usr/ports
cd /usr/ports/devel/gh
make install clean
How can I fix it?
Regards, Antoine
-
Where are you trying to compile this port? You can't do any development work on the firewall as none of the required supporting libraries and utilities are installed (and they should never be -- it's a firewall not a software development box).
The proper way to build ports is to create a totally separate FreeBSD machine (a virtual machine is great for this), install the required development tools, and then build the port of your choice.
One warning, don't expect a port built this way to seamlessly install on pfSense. It is likely you will see incompatibilities between the customized pfSense kernel and the stock FreeBSD one on your builder.
If you want to build a customized port that will actually install on a pfSense machine without issue, you will need to read through this very long thread and follow the steps outlined there in the various posts: https://forum.netgate.com/topic/169749/pfsense-compile-requirements-for-3rd-party-software. Be prepared to spend quite a bit of time getting it work correctly, but in the end it will work . I do this all the time to build and test new versions of the Snort and Suricata packages for which I am the volunteer maintainer. When you build the "package builder machine" described in the thread, you must select the proper pfSense branch (RELENG or DEVEL) for the target pfSense machine.