[CFT] New helpers now that new options frameworks allow them :)

Baptiste Daroussin bapt at FreeBSD.org
Sun Jun 9 22:12:13 UTC 2013


Hi,

Here is a couple of new helpers that the new options framework allows.

To simplify some ports here is a couple of helpers I propose to add to the ports
tree:

OPTIONS_SUB= yes

if set, the framework will automatically some new PLIST_SUB:
for example: OPTIONS_DEFINE= OPT1

if OPT1 is set OPT1="" will be added to PLIST_SUB
if OPT1 is unset OPT1="@comment " will be added to the PLIST_SUB

OPT1_CONFIGURE_ENABLE= option

if OPT1 is set --enable-option will be added to CONFIGURE_ARGS
if OPT1 is unset --disable-option will be added to CONFIGURE_ARGS

OPT1_CONFIGURE_ON= --with-bla
OPT1_CONFIGURE_OFF= --no-something

if OPT1 is set --with-bla will be added to CONFIGURE_ARGS
if OPT1 is unset --no-something will be added to CONFIGURE_ARGS

OPT1_CFLAGS
OPT1_LDFLAGS
OPT1_CXXFLAGS
OPT1_MAKE_ENV
OPT1_CONFIGURE_ENV

if OPT1 is set the flags will be appended to the corresponding MACROS.

OPT1_USES=	bla

if OP1 is set bla will be added to USES

OPT1_TYPE_DEPENDS=	XXX:${PORTSDIR}/cat/port

with TYPE being PKG EXTRACT PATCH FETCH BUILD LIB or RUN

Will add the given dependency to the right place if OPT1 is set

Patch is here:
http://people.freebsd.org/~bapt/optionsng.diff

An example of usage is:
http://people.freebsd.org/~bapt/zsh-new-options.diff

(on top of the zsh Makefile)

Any opinion?

regards,
Bapt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20130610/d2564ff2/attachment.sig>


More information about the freebsd-ports mailing list