I have a bunch of FreeBSD VMs running in VirtualBox. They all share a number of virtual harddrives, and among them are a virtual harddrive with the common contents of /var/db/ports.

My ports configuration of emulators/virtualbox-ose-additions have the OPENGL and X11 options set. This is useless on some of my simpler VMs, as those VMs have no need for any X11 ports, but they could sure benefit from having the VirtualBox additions installed. These simpler VMs are usually used only to test ZFS in FreeBSD in various configurations.

I could juggle the settings for emulators/virtualbox-ose-additions for each time I’m updating the VirtualBox additions port on my VMs, but I decided to create a local slave port disabling the OPENGL and X11 options. Maybe this port, with the necessary tweaking, could sit among its siblings in the official emulators category.

OPTIONS_EXCLUDE=	OPENGL X11

MASTERDIR=	${.CURDIR}/../../emulators/virtualbox-ose-additions
.include "${MASTERDIR}/Makefile"

CATEGORIES=		local
VALID_CATEGORIES+=	local

COMMENT=	VirtualBox additions for FreeBSD guests without OPENGL and X11

PATCHDIR=	${MASTERDIR}/../${PORTNAME}/files

PKGNAMESUFFIX=	-additions-nox11

PKGORIGIN=	${CATEGORIES}/${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}

# EOF

For now you must copy the /var/db/ports/local_virtualbox-ose-additions-additions-nox11/options file to /var/db/ports/emulators_virtualbox-ose-additions-additions-nox11/options, or else dialog4ports(1) will keep nagging you until kingdom come.

I guess this problem stems from early processing of bsd.port.mk as done by the master Makefile at a time when the CATEGORIES variable was set to emulators.