Do not start migrating *any* ports

Once this work is well tested, an all clear will be emailed to the FreeBSD Ports list.

New Port

Add

FLAVORS=  default foo bar

Note: The first in the list is the default, so depending on the use case it might be needed to have one that is the default case and does not change anything.

After either bsd.port.pre.mk or bsd.port.options.mk, check for the specific flavor option and tweak such as adding depends.

.if ${FLAVOR} == foo
[[ .. do foo stuff .. ]
.endif
.if ${FLAVOR} == bar
[[ .. do bar stuff .. ]
.endif

Future helpers

Some helpers https://reviews.freebsd.org/D12483 make your work easier. They must be used before any include (bsd.port.options.mk or bsd.port.pre.mk).

All packages must have a different PKGNAME, so for flavored packages adding a PKGNAMEPREFIX or PKGNAMESUFFIX is required.

foo_PKGNAMESUFFIX=  -foo
bar_PKGNAMEPREFIX=  bar-

If the packages conflicts with one another, it should also be noted (CONFLICTS, CONFLICTS_BUILD and CONFLICTS_INSTALL are supported).

default_CONFLICTS_INSTALL= pkgname-foo bar-pkgname
foo_CONFLICTS_INSTALL=     pkgname bar-pkgname
bar_CONFLICTS_INSTALL=     pkgname pkgname-foo

Converting an existing

Ports/FlavorsMigration (last edited 2017-11-29T08:21:15+0000 by MathieuArnold)