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-

Converting an existing

Ports/FlavorsMigration (last edited 2022-04-20T11:10:00+0000 by StefanEsser)