Bug 262162 - Mk/bsd.port.mk: Add USES_${ARCH} support
Summary: Mk/bsd.port.mk: Add USES_${ARCH} support
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Port Management Team
URL:
Keywords: feature, needs-patch
Depends on:
Blocks:
 
Reported: 2022-02-24 00:43 UTC by Robert Clausecker
Modified: 2022-02-24 00:51 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Clausecker freebsd_committer freebsd_triage 2022-02-24 00:43:22 UTC
It is currently very awkward to register USES that depend on architecture.  This is a use case that pops up every once in a while (e.g. when a port requires a certain build tools only on some architectures).  See e.g. bug #261247.

This is because USES cannot be set after <bsd.port.pre.mk> is included, but
including that is required to access the ARCH macro.  A possible workaround
is using a construct like

    USES+=${ARCH:Mamd64:S/amd64/something}

but that's hard to read and quite ugly.  As a solution, the ports infrastructure
should provide a macro USES_${ARCH} that if set is added to USES, permitting the definition of architecture specific USES.  For example, this could be achieved by placing

    USES+=${USES_${ARCH}}

after the definition of ARCH and before evaluation of USES in bsd.port.mk.