[44989] trunk/dports/gnome/gconf/Portfile

jeremyhu at macports.org jeremyhu at macports.org
Mon Jan 5 21:22:48 PST 2009


Revision: 44989
          http://trac.macports.org/changeset/44989
Author:   jeremyhu at macports.org
Date:     2009-01-05 21:22:48 -0800 (Mon, 05 Jan 2009)
Log Message:
-----------
gconf: universal variant-fu

Modified Paths:
--------------
    trunk/dports/gnome/gconf/Portfile

Modified: trunk/dports/gnome/gconf/Portfile
===================================================================
--- trunk/dports/gnome/gconf/Portfile	2009-01-06 05:16:31 UTC (rev 44988)
+++ trunk/dports/gnome/gconf/Portfile	2009-01-06 05:22:48 UTC (rev 44989)
@@ -6,6 +6,7 @@
 name            gconf
 set my_name     GConf
 version         2.24.0
+revision	1
 set branch      [join [lrange [split ${version} .] 0 1] .]
 maintainers     nomaintainer
 categories      gnome
@@ -22,7 +23,6 @@
 master_sites    gnome:sources/${my_name}/${branch}/
 distname        ${my_name}-${version}
 use_bzip2       yes
-universal_variant   no
 
 checksums       md5     4971d96f5ba94fe4a69396267bd5afe8 \
                 sha1    e93ff2609c0278075acabdf609f42aa406e20c8e \
@@ -52,3 +52,72 @@
 livecheck.check regex
 livecheck.url   http://ftp.gnome.org/pub/gnome/sources/${my_name}/${branch}/
 livecheck.regex {LATEST-IS-(\d+(?:\.\d+)*)}
+
+if {![info exists universal_archs]} {
+    set universal_archs {i386 ppc}
+}
+set first_arch [lindex ${universal_archs} 0]
+
+set my_worksrcpaths ${worksrcpath}
+
+variant universal {
+    set my_worksrcpaths {}
+    foreach arch ${universal_archs} {
+        lappend my_worksrcpaths ${workpath}/${arch}
+    }
+
+    post-patch {
+        foreach arch ${universal_archs} {
+            if {[string equal ${arch} ${first_arch}]} {
+                move ${worksrcpath} ${workpath}/${first_arch}
+            } else {
+                copy ${workpath}/${first_arch} ${workpath}/${arch}
+            }
+        }
+    }
+    
+    configure {
+        foreach arch ${universal_archs} {
+            set my_arch_flag "-arch ${arch}"
+            set my_cflags "${configure.cflags} -isysroot ${sysroot} ${my_arch_flag}"
+            set my_ldflags "${configure.ldflags} ${my_arch_flag}"
+            system "cd ${workpath}/${arch} && CFLAGS=\"${my_cflags}\" CXXFLAGS=\"${my_cflags}\" LDFLAGS=\"${my_ldflags}\" ${configure.cmd} ${configure.pre_args}"
+        }
+    }
+    
+    build {
+        foreach arch ${universal_archs} {
+            system "cd ${workpath}/${arch} && ${build.cmd} ${build.pre_args}"
+        }
+    }
+    
+    destroot {
+        system "cd ${workpath}/${first_arch} && ${destroot.cmd} ${destroot.pre_args} ${destroot.post_args}"
+        foreach lib [list [file readlink ${workpath}/${first_arch}/gconf/.libs/libgconf-2.dylib] libgconf-2.a] {
+            set output_lib ${destroot}${prefix}/lib/${lib}
+            set lipo_args {}
+            foreach arch ${universal_archs} {
+                lappend lipo_args -arch ${arch} ${workpath}/${arch}/gconf/.libs/${lib}
+            }
+            lappend lipo_args -create -output ${output_lib}
+            delete ${output_lib}
+            system "lipo ${lipo_args}"
+        }
+
+        set lipo_args {}  
+        foreach arch ${universal_archs} {
+            lappend lipo_args -arch ${arch} ${workpath}/${arch}/gconf/gconftool-2
+        }
+        lappend lipo_args -create -output ${destroot}${prefix}/bin/gconftool-2
+        delete ${destroot}${prefix}/bin/gconftool-2
+        system "lipo ${lipo_args}"
+        
+        set lipo_args {}  
+        foreach arch ${universal_archs} {
+            lappend lipo_args -arch ${arch} ${workpath}/${arch}/backends/gconf-merge-tree
+        }
+        lappend lipo_args -create -output ${destroot}${prefix}/bin/gconf-merge-tree
+        delete ${destroot}${prefix}/bin/gconf-merge-tree
+        system "lipo ${lipo_args}"
+    }
+}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090105/0cfd0b53/attachment.html>


More information about the macports-changes mailing list