mpkg build with Apple Silicon

Joshua Root jmr at macports.org
Tue Jan 28 20:47:49 UTC 2025


> Hello,
>
> We've build a few packages using the mpkg command on an Apple Silicon
> Mac.
> When we want to install any of these packages, Rosetta 2 installation is
> required.
>
> We want to avoid using Rosseta 2, if there a way of forcing the
> architecture to arm64 when building a mpkg?

Unfortunately Apple's Installer started assuming in Big Sur that 
packages require Rosetta 2 unless they set the previously optional 
hostArchitectures key in the Distribution file to something including 
arm64. This was reported for the MacPorts base installer and was fixed: 
<https://trac.macports.org/ticket/63096>

However 'port mpkg' still does not set this, partly because it's not 
straightforward to figure out whether any of the included dependencies 
need Rosetta 2. If you know you're only including arm64 code in the 
mpkg, possible solutions would be to have the top level port provide a 
custom Distribution file that sets hostArchitectures like the MacPorts 
port does, or patch portmpkg::write_distribution in base to set it.

- Josh



More information about the macports-users mailing list