For anyone looking for a worthy project -> not one of the boost ports can build universal x86_64/arm64, which prevents a lot of ports from building universal

John Ross Hunt johnrosshunt at gmail.com
Wed Feb 15 00:34:34 UTC 2023


Here's the patch I use for boost176.  It's a bit hackish, but builds an 
x86_64/arm64 universal binary on Intel.  Untested on Apple silicon, though.

On 2/14/23 10:19 AM, Ken Cunningham wrote:
> just thought I'd point that one out, for interested folks.
>
> Best,
>
> Ken

-jrh
-------------- next part --------------
--- Portfile	2023-02-14 18:20:34.128882644 -0600
+++ Portfile.new	2023-02-14 18:18:10.317949029 -0600
@@ -116,6 +116,17 @@
 
 # see https://trac.macports.org/wiki/UsingTheRightCompiler
 patchfiles-append patch-compiler.diff
+
+# see https://trac.macports.org/ticket/64954
+if {![info exists universal_possible]} {
+    set universal_possible [expr {${os.universal_supported} && [llength ${configure.universal_archs}] >= 2}]
+}
+if {${universal_possible} && [variant_isset universal]} {
+    if {${os.platform} eq "darwin" && ${os.major} >= 20} {
+        patchfiles-append universal-arm64.diff
+    }
+}
+
 post-patch {
     reinplace "s|__MACPORTS_CXX__|${configure.cxx}|g" ${worksrcpath}/tools/build/src/tools/clang-darwin.jam
 }
-------------- next part --------------
--- tools/build/src/tools/darwin.jam	2021-04-13 11:23:21.000000000 -0500
+++ tools/build/src/tools/darwin.jam.new	2022-08-11 14:20:54.625739214 -0500
@@ -463,8 +463,8 @@
                 if $(support-ppc64) {
                     options = -arch x86_64 -arch ppc64 ;
                 } else {
-                    errors.user-error "64-bit PPC compilation is not supported when targeting OSX 10.6 or later" ;
-                }                
+                    options = -arch x86_64 -arch arm64 ;
+                }
             } else {
                 options = -arch i386 -arch ppc ;
             }


More information about the macports-dev mailing list