[50234] trunk/dports/x11/gtk2/Portfile
mcalhoun at macports.org
mcalhoun at macports.org
Mon Apr 27 17:09:46 PDT 2009
Revision: 50234
http://trac.macports.org/changeset/50234
Author: mcalhoun at macports.org
Date: 2009-04-27 17:09:45 -0700 (Mon, 27 Apr 2009)
Log Message:
-----------
gtk2: Build universal binaries with muniversal PortGroup.
Modified Paths:
--------------
trunk/dports/x11/gtk2/Portfile
Modified: trunk/dports/x11/gtk2/Portfile
===================================================================
--- trunk/dports/x11/gtk2/Portfile 2009-04-28 00:08:29 UTC (rev 50233)
+++ trunk/dports/x11/gtk2/Portfile 2009-04-28 00:09:45 UTC (rev 50234)
@@ -2,6 +2,7 @@
# $Id$
PortSystem 1.0
+PortGroup muniversal 1.0
name gtk2
version 2.16.1
@@ -33,10 +34,6 @@
default_variants +x11
}
-if {[variant_isset universal]} {
- configure.env-append CUPS_CONFIG="${configure.universal_sysroot}/usr/bin/cups-config"
-}
-
pre-fetch {
if {![variant_isset quartz] && ![variant_isset x11]} {
error "Either +x11 or +quartz is required"
@@ -95,6 +92,60 @@
configure.args --enable-static \
--disable-glibtest
+if { [variant_isset universal] } {
+ configure.env-append CUPS_CONFIG="${configure.universal_sysroot}/usr/bin/cups-config"
+
+ # cups is not 32/64-bit universal on Tiger.
+ if { ${universal_sysroot}=="/Developer/SDKs/MacOSX10.4u.sdk" } {
+ set merger_configure_args(ppc64) --disable-cups
+ set merger_configure_args(x86_64) --disable-cups
+ }
+
+ # Find architectures which will not run on build platform.
+ if { ${os.arch}=="i386" } {
+ if { ${os.major} >= 10 } {
+ set cross_archs "ppc ppc64"
+ } else {
+ set cross_archs "ppc64"
+ }
+ set host_archs "ppc ppc64"
+ } else {
+ set cross_archs "i386 x86_64"
+ set host_archs "i386 x86_64"
+ }
+
+ set run_arch [lindex ${universal_archs} 0]
+ if { [lsearch ${cross_archs} ${run_arch}] >= 0 } {
+ ui_msg "When building a universal binary of ${name}, make sure none of {${cross_archs}} is first in universal_archs in ${prefix}/etc/macports/macports.conf"
+ error "incompatible universal_archs value"
+ }
+
+ foreach arch ${host_archs} {
+ lappend merger_configure_env(${arch}) \
+ NM='/usr/bin/nm -p'
+ }
+
+ foreach arch ${cross_archs} {
+ lappend merger_configure_env(${arch}) \
+ gio_can_sniff=yes \
+ GTK_UPDATE_ICON_CACHE=${worksrcpath}-${run_arch}/gtk/gtk-update-icon-cache \
+ GDK_PIXBUF_CSOURCE=${worksrcpath}-${run_arch}/gdk-pixbuf/gdk-pixbuf-csource
+ }
+
+ post-configure {
+ # Let gtk_host in .pc files be the same on all architectures
+ foreach arch ${host_archs} {
+ foreach pc [glob -directory ${worksrcpath}-${arch} *.pc.in] {
+ if { ${os.arch}=="i386" } {
+ reinplace "s|gtk_host=@host@|gtk_host=i686-apple-darwin${os.version}|" ${pc}
+ } else {
+ reinplace "s|gtk_host=@host@|gtk_host=powerpc-apple-darwin${os.version}|" ${pc}
+ }
+ }
+ }
+ }
+}
+
configure.ccache no
configure.cppflags-append -DX_LOCALE
configure.cflags-append -fstrict-aliasing
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090427/cc482c4e/attachment.html>
More information about the macports-changes
mailing list