Page MenuHomeFreeBSD

Add Flavor helpers for PLIST_FILES, COMMENT, CONFIGURE_[ARGS|ENV]
Needs ReviewPublic

Authored by fluffy on Nov 16 2018, 1:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 13 2024, 6:04 PM
Unknown Object (File)
Feb 18 2024, 3:44 PM
Unknown Object (File)
Dec 19 2023, 11:49 PM
Unknown Object (File)
Dec 3 2023, 1:04 AM
Unknown Object (File)
Dec 2 2023, 7:41 AM
Unknown Object (File)
Sep 21 2023, 5:36 PM
Unknown Object (File)
Sep 13 2023, 2:45 AM
Unknown Object (File)
Sep 11 2023, 1:45 PM
Subscribers

Details

Reviewers
None
Group Reviewers
portmgr
Summary

If a port have dozen of flavors, using additional helpers allow to dramatically desrease size of Makefile

PLIST is always handled by helper, wonder why PLIST_FILES was missed.
Override COMMENT is useful for flavored plugins, CONFIGURE_[ARGS|ENV] is also useful as helper — it allow to avoid extra .ifdef in Makefile

For example, with additional helpers I can simply use

filter-clamav_COMMENT=                  Check messages with ClamAV in OpenSMTPD
filter-clamav_RUN_DEPENDS=              clamscan:security/clamav
filter-clamav_PLIST_FILES=              libexec/opensmtpd/filter-clamav \
                                        man/man8/filter-clamav.8.gz
filter-clamav_CONFIGURE_ARGS=           --with-experimental-filter-clamav

instead of two blocks

filter-clamav_RUN_DEPENDS=              clamscan:security/clamav

and

.if ${FLAVOR:M*clamav}
COMMENT=                  Check messages with ClamAV in OpenSMTPD
PLIST_FILES=              libexec/opensmtpd/filter-clamav \
                                        man/man8/filter-clamav.8.gz
CONFIGURE_ARGS=           --with-experimental-filter-clamav
.endif
Test Plan

exp-run?

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

No port will ever have a dozen flavors. Flavors are few, not many.

I do not see a reason to change the COMMENT, it is the same software, it is just built differently, and I don't think I ever saw COMMENT being changed when options changes.

Also, from your example, it seems you are trying to abuse flavors to get some sort of subpackages, which will never be approved.