[79660] trunk/dports/devel/icu/Portfile

jmr at macports.org jmr at macports.org
Wed Jun 22 13:11:46 PDT 2011


Revision: 79660
          http://trac.macports.org/changeset/79660
Author:   jmr at macports.org
Date:     2011-06-22 13:11:46 -0700 (Wed, 22 Jun 2011)
Log Message:
-----------
icu: satisfy the rather inconvenient requirements for cross compiling (#29904)

Modified Paths:
--------------
    trunk/dports/devel/icu/Portfile

Modified: trunk/dports/devel/icu/Portfile
===================================================================
--- trunk/dports/devel/icu/Portfile	2011-06-22 19:40:24 UTC (rev 79659)
+++ trunk/dports/devel/icu/Portfile	2011-06-22 20:11:46 UTC (rev 79660)
@@ -37,7 +37,34 @@
 
 if {[variant_isset universal]} {
     patchfiles-append   patch-universal.diff
-    set merger_must_run_binaries yes
+
+    # weirdly, icu needs a separate source dir built for the build
+    # machine in order to cross-compile
+    pre-configure {
+        global merger_configure_args
+        set cross 0
+        set 32bit 0
+        set crosspath ${worksrcpath}-cross
+        if {${os.major} < 9 || [sysctl hw.cpu64bit_capable] == 0} {
+            set 32bit 1
+        }
+        foreach a $universal_archs_to_use {
+            if {($32bit && ($a == "x86_64" || $a == "ppc64")) 
+                || (${os.arch} == "powerpc" && ($a == "x86_64" || $a == "i386"))
+                || (${os.arch} == "i386" && ($a == "ppc" || $a == "ppc64"))} {
+                set cross 1
+                set merger_configure_args($a) --with-cross-build=${crosspath}
+            }
+        }
+        if {$cross} {
+            copy ${worksrcpath} ${crosspath}
+            set configure_dir_save  ${configure.dir}
+            configure.dir ${crosspath}
+            portconfigure::configure_main
+            configure.dir $configure_dir_save
+            system "cd ${crosspath} && ${build.cmd}[portbuild::build_getjobsarg]"
+        }
+    }
 }
 
 post-patch {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110622/c6cb2ee1/attachment.html>


More information about the macports-changes mailing list