[62637] trunk/dports/x11/gtk2/Portfile

nox at macports.org nox at macports.org
Tue Jan 12 16:49:41 PST 2010


Revision: 62637
          http://trac.macports.org/changeset/62637
Author:   nox at macports.org
Date:     2010-01-12 16:49:39 -0800 (Tue, 12 Jan 2010)
Log Message:
-----------
Update gtk2 to 2.18.6

Use universal support was also improved, as we don't require `universal_archs`
setting to begin with a runnable architecture on the machine, e.g. "i386 ppc" on
a PowerPC Mac.

Furthermore, port groups xcodeversion and archcheck better error handling and
reporting.

>From NEWS:

> Overview of Changes from GTK+ 2.18.5 to 2.18.6
> ==============================================
>
> * Client-side windows:
>  - Send expose events from gdk_window_clear_area_e
>  - Ensure native windows in gdk_property_change
>  - Properly compute damage when drawing line segments
>  - Fix an infinite recursion causing stack overflows
>
> * Bugs fixed:
>   50942 selection/arrow key improvement
>  604747 Using gdk_draw_line, the expose area of damage...
>  604787	property-notify-event is not delivered...
>  605008 the region of damage event doens't be copied...
>  605036 commit adds not-yet-built libgtk-x11-2.0.la...
>  606068 Setup libjpeg error handling earlier...
>  606143 aisleriot grows X server without bounds
>
> * Translation update:
>  Assamese
>  Basque
>  British English
>  Kannada

Modified Paths:
--------------
    trunk/dports/x11/gtk2/Portfile

Modified: trunk/dports/x11/gtk2/Portfile
===================================================================
--- trunk/dports/x11/gtk2/Portfile	2010-01-12 20:54:43 UTC (rev 62636)
+++ trunk/dports/x11/gtk2/Portfile	2010-01-13 00:49:39 UTC (rev 62637)
@@ -2,10 +2,12 @@
 # $Id$
 
 PortSystem      1.0
+PortGroup       archcheck 1.0
 PortGroup       muniversal 1.0
+PortGroup       xcodeversion 1.0
 
 name            gtk2
-version         2.18.5
+version         2.18.6
 set branch      [join [lrange [split ${version} .] 0 1] .]
 categories      x11
 maintainers     nox openmaintainer
@@ -25,41 +27,12 @@
                 ftp://ftp.gtk.org/pub/gtk/${branch}/ \
                 http://ftp.gtk.org/pub/gtk/${branch}/
 
-if {[variant_isset no_x11]} {
-    default_variants    +quartz
-}
+minimum_xcodeversions {9.0 3.1}
 
-if {![variant_isset quartz]} {
-    default_variants    +x11
-}
+checksums       md5     3b32073cf1fad755f7c2b2db71aebe90 \
+                sha1    6190838c6c5e5cd3b0499d2a59ae06e517598bc9 \
+                rmd160  1e9b36cd2de8a472a3e550a1995978a3b783e455
 
-pre-fetch {
-    if {![variant_isset quartz] && ![variant_isset x11]} {
-        error "Either +x11 or +quartz is required"
-    }
-
-    if {[rpm-vercomp ${os.version} 9.0] >= 0} {
-        set minimum_xcodeversion 3.1
-        set current_xcodeversion [exec defaults read /Developer/Applications/Xcode.app/Contents/Info CFBundleShortVersionString]
-        if {[rpm-vercomp ${current_xcodeversion} ${minimum_xcodeversion}] < 0} {
-            ui_error "You have Xcode ${current_xcodeversion}. Please update to at least Xcode ${minimum_xcodeversion}."
-            error "Please update Xcode."
-        }
-    }
-
-    if {[variant_isset quartz]} {
-        if {![file exists ${prefix}/include/cairo/cairo-quartz.h]} {
-            error "cairo must be built with the +quartz variant enabled."
-        }
-    } elseif {![file exists ${prefix}/include/cairo/cairo-xlib.h]} {
-        error "cairo must be built without the +no_x11 variant."
-    }
-}
-
-checksums       md5     3047875309f7f6030e03b0a95cf99c8c \
-                sha1    ddb004f0f92f7c8e3b84237e05fcf0ef5affc79c \
-                rmd160  712098237fc31dcb99189645f0320aa165855577
-
 patchfiles      patch-gtk-builder-convert.diff \
                 patch-modules-gail.diff \
                 patch-modules-printbackends.diff
@@ -82,93 +55,64 @@
 
 depends_run     port:shared-mime-info
 
+archcheck.files \
+    lib/libatk-1.0.dylib \
+    lib/libcairo.dylib \
+    lib/libfontconfig.dylib \
+    lib/libfreetype.dylib \
+    lib/libglib-2.0.dylib \
+    lib/libintl.dylib \
+    lib/libjasper.dylib \
+    lib/libjpeg.dylib \
+    lib/libiconv.dylib \
+    lib/libpango-1.0.dylib \
+    lib/libpng.dylib \
+    lib/libtiff.dylib \
+    lib/libz.dylib
+
 configure.args  --enable-static \
                 --disable-glibtest
 
-if { [variant_isset universal] } {
-    if {[info exists universal_sysroot]} {
-        configure.env-append    CUPS_CONFIG="${universal_sysroot}/usr/bin/cups-config"
-    } else {
-        configure.env-append    CUPS_CONFIG="/usr/bin/cups-config"
-    }
+configure.cppflags-append   -DX_LOCALE
+configure.cflags-append     -fstrict-aliasing
 
-    # cups is not 32/64-bit universal on Tiger. 
-    if {${os.major} == "8"} {
-        set merger_configure_args(ppc64)   --disable-cups
-        set merger_configure_args(x86_64)  --disable-cups
+pre-configure {
+    if {![variant_isset quartz] && ![variant_isset x11]} {
+        error "Either +x11 or +quartz is required"
     }
-    
-    # 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
-        lappend merger_build_env(${arch}) \
-            GDK_PIXBUF_MODULE_FILE=${worksrcpath}-${run_arch}/gdk-pixbuf/gdk-pixbuf.loaders
-    }
-
-    pre-configure {
-        # Let gtk_host in .pc files be the same on all architectures
-        foreach arch ${host_archs} {
-            if { [lsearch ${universal_archs_to_use} ${arch}] >= 0 } {
-                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}
-                    }
-                }
-            }
+    if {[variant_isset quartz]} {
+        if {![file exists ${prefix}/include/cairo/cairo-quartz.h]} {
+            error "cairo must be built with the +quartz variant enabled."
         }
+    } elseif {![file exists ${prefix}/include/cairo/cairo-xlib.h]} {
+        error "cairo must be built without the +no_x11 variant."
     }
 }
 
-configure.cppflags-append   -DX_LOCALE
-configure.cflags-append     -fstrict-aliasing
-
 use_parallel_build  yes
 
 test.run        yes
 test.target     check
 
 post-destroot {
-    set docdir ${prefix}/share/doc/gtk+-${version}
+    set docdir ${prefix}/share/doc/${name}
     xinstall -d ${destroot}${docdir}
-    xinstall -m 644 -W ${worksrcpath} AUTHORS COPYING HACKING NEWS README ${destroot}${docdir}
+    xinstall -m 644 -W ${worksrcpath} AUTHORS COPYING HACKING NEWS README \
+        ${destroot}${docdir}
 
     ui_debug "Creating gtk.immodules..."
-    system "DYLD_LIBRARY_PATH=${destroot}${prefix}/lib ${destroot}${prefix}/bin/gtk-query-immodules-2.0 \
-        ${destroot}${prefix}/lib/gtk-2.0/2.10.0/immodules/*.so >${destroot}${prefix}/etc/gtk-2.0/gtk.immodules"
+    system "DYLD_LIBRARY_PATH=${destroot}${prefix}/lib \
+        ${destroot}${prefix}/bin/gtk-query-immodules-2.0 \
+        ${destroot}${prefix}/lib/gtk-2.0/2.10.0/immodules/*.so \
+        >${destroot}${prefix}/etc/gtk-2.0/gtk.immodules"
     reinplace "s|${destroot}||" ${destroot}${prefix}/etc/gtk-2.0/gtk.immodules
 }
 
 post-activate {
     ui_debug "Updating gdk-pixbuf.loaders..."
-    system "${prefix}/bin/gdk-pixbuf-query-loaders >${prefix}/etc/gtk-2.0/gdk-pixbuf.loaders"
+    system "${prefix}/bin/gdk-pixbuf-query-loaders \
+        >${prefix}/etc/gtk-2.0/gdk-pixbuf.loaders"
 }
 
 platform darwin 8 {
@@ -177,6 +121,90 @@
     }
 }
 
+if {[variant_isset no_x11]} {
+    default_variants +quartz
+} elseif {![variant_isset quartz]} {
+    default_variants +x11
+}
+
+if {[variant_isset universal]} {
+    set cups /usr/bin/cups-config
+    if {[info exists universal_sysroot]} {
+        set cups ${universal_sysroot}${cups}
+    }
+    configure.env-append CUPS_CONFIG=${cups}
+
+    # cups is not 32/64-bit universal on Tiger.
+    if {${os.major} == "8"} {
+        set merger_configure_args(ppc64)   --disable-cups
+        set merger_configure_args(x86_64)  --disable-cups
+    }
+
+    # Find architectures which will not run on build platform.
+    set cpu64bit_capable [sysctl hw.cpu64bit_capable]
+    if {${os.arch} eq "i386"} {
+        set cross_archs ppc64
+        if {${os.major} >= 10} {
+            lappend cross_archs ppc
+        }
+        set host_archs "ppc ppc64"
+        set run_archs i386
+        if {${cpu64bit_capable}} {
+            set run_archs "x86_64 ${run_archs}"
+        }
+    } else {
+        set cross_archs "i386 x86_64"
+        set host_archs "i386 x86_64"
+        set run_archs ppc
+        if {${cpu64bit_capable}} {
+            set run_archs "ppc64 ${run_archs}"
+        }
+    }
+
+    pre-configure {
+        set run_arch ""
+        foreach arch ${run_archs} {
+            if {[lsearch ${universal_archs_to_use} ${arch}] != -1} {
+                set run_arch ${arch}
+                break
+            }
+        }
+
+        if {${run_arch} eq ""} {
+            ui_error ""
+            ui_error "gtk2 requires at least one architecture runnable on this"
+            ui_error "machine to be able to build universally. Please add at least"
+            ui_error "one of the following architectures to `universal_archs` in"
+            ui_error "\"${prefix}/etc/macports/macports.conf\":"
+            ui_error ""
+            ui_error "\t${run_archs}"
+            ui_error ""
+        }
+
+        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
+            lappend merger_build_env(${arch}) \
+                GDK_PIXBUF_MODULE_FILE=${worksrcpath}-${run_arch}/gdk-pixbuf/gdk-pixbuf.loaders
+        }
+
+        # Let gtk_host in .pc files be the same on all architectures
+        set host powerpc
+        if {${os.arch} eq "i386"} {
+            set host i686
+        }
+        eval reinplace s/@host@/${host}-apple-darwin${os.version}/ \
+            [glob -directory ${worksrcpath} *.pc.in]
+    }
+}
+
 variant no_x11 {
     pre-fetch {
         if {[file exists ${prefix}/lib/libpangox-1.0.dylib]} {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100112/1299ba46/attachment-0001.html>


More information about the macports-changes mailing list