[Bug 262162] ports infrastructure: provide USES_${ARCH}

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 24 Feb 2022 00:43:22 UTC

            Bug ID: 262162
           Summary: ports infrastructure: provide USES_${ARCH}
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Keywords: feature
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: ports-bugs@FreeBSD.org
          Reporter: fuz@fuz.su
                CC: koobs@FreeBSD.org

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

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


but that's hard to read and quite ugly.  As a solution, the ports
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


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

You are receiving this mail because:
You are the assignee for the bug.