Dealing with options in dependent ports

Paul Schmehl pschmehl_lists at
Fri Nov 30 18:46:12 UTC 2012

--On November 30, 2012 7:07:20 PM +0100 Alberto Villa <avilla at> 

> On Fri, Nov 30, 2012 at 4:47 PM, Thierry Thomas <thierry at>
> wrote:
>> However, to enforce the right dependency, this option have to produce a
>> different plist.
> Really? Isn't enough to depend on the package name instead of a file?

No.  The dependency installs files that are not otherwise installed, so the 
pkg-plist has to reflect that.  Here's how I did it in the port I just 
created a slave for.

Created this section in the main port's Makefile:
.if defined(SLAVE)
BROCCOLI_DESC=  Build support for libbroccoli communications

This adds the option and enforces it being selected if you install the 
slave port.

Then created this section in the main port's Makefile:
        (cd ${WRKSRC}/aux/broccoli && ./configure)
        (cd ${WRKSRC}/aux/broccoli && ${MAKE})
        patch ${BUILD_WRKSRC}/cmake_install.cmake ${FILESDIR}/broccoli.patch
PLIST_SUB+=     BROCCOLI="@comment "

The PLIST_SUB section allows you to add files to the pkg-plist that are 
provisional, based on the install of the slave port.

Then the pkg_plist sub has the files included with the macro:

Those only get removed if the option was selected, so deinstall won't throw 
errors if you install the main port without that option.

Paul Schmehl, Senior Infosec Analyst
As if it wasn't already obvious, my opinions
are my own and not those of my employer.
"It is as useless to argue with those who have
renounced the use of reason as to administer
medication to the dead." Thomas Jefferson
"There are some ideas so wrong that only a very
intelligent person could believe in them." George Orwell

More information about the freebsd-ports mailing list