Ticket #27343: qt4-mac-Portfile.2.diff

File qt4-mac-Portfile.2.diff, 2.8 KB (added by michaelld (Michael Dickens), 13 years ago)

2nd try: "svn diff" of 'qt4-mac' Portile, hopefully allowing the user to set TARGET and SDK

  • Portfile

     
    7474# only; this patch requires that (2) already be in place.
    7575patchfiles-append   patch-mkspecs_common_mac.conf.diff
    7676
     77global TARGET
     78set TARGET ""
     79
    7780post-patch {
    7881    # set ARCHES in configure (per the third patchfile above), for
    7982    # building QMake.  join any 2 or more arch entries with the GCC
     
    9194    # set MACOSX_DEPLOYMENT_TARGET version in various places.  These
    9295    # were all patched in (2) above, and can be easily changed or
    9396    # overridden by the user in a project-local qmake .pro script.
    94     set minor [expr [lindex [split ${os.version} "."] 0] - 4]
    95     set MACOSX_DEPLOYMENT_TARGET "10.${minor}"
     97    set TARGET ${macosx_deployment_target}
     98
     99    # hopefully the TARGET exists and is set by now.  if not, last
     100    # resort (which is not desirable) is to use the os.version.
     101    if {${TARGET} == ""} {
     102        set minor [expr [lindex [split ${os.version} "."] 0] - 4]
     103        set TARGET "10.${minor}"
     104    }
    96105    foreach fixfile {configure mkspecs/common/mac-g++.conf \
    97106                     mkspecs/common/mac.conf qmake/qmake.pri \
    98107                     src/tools/bootstrap/bootstrap.pro } {
    99         reinplace "s|@MACOSX_DEPLOYMENT_TARGET@|${MACOSX_DEPLOYMENT_TARGET}|g" \
     108        reinplace "s|@MACOSX_DEPLOYMENT_TARGET@|${TARGET}|g" \
    100109            ${worksrcpath}/${fixfile}
    101110    }
    102111
     
    273282            configure.args-delete -optimized-qmake
    274283        }
    275284
    276         # find a way to specify the SDK to use
    277         set SDK ""
    278         if {[variant_exists universal] && [variant_isset universal]} {
    279             if {[info exists universal_sysroot]} {
    280                 set SDK ${universal_sysroot}
     285        # find a way to specify the SDK to use; Qt will use the 10.4u
     286        # by default which won't work on 10.6 since it is not
     287        # supported.  Allow the user to specify the SDK if desired.
     288        set SDK ${configure.sdkroot}
     289        if {${SDK} == ""} {
     290            # find a way to specify the SDK to use, based on the TARGET
     291            # hopefully the TARGET exists and is set by now.
     292            # last resort: use os.version to get target (bad)
     293            set minor ""
     294            global TARGET
     295            if {${TARGET} == ""} {
     296                set minor [expr [lindex [split ${os.version} "."] 0] - 4]
     297            } else {
     298                set minor [lindex [split ${TARGET} "."] 1]
    281299            }
    282         }
    283         if {${SDK} == ""} {
    284             # else use the one for this OS version, if installed
    285             set minor [expr [lindex [split ${os.version} "."] 0] - 4]
    286300            # set SDK version depending on OS version
    287301            set sdk_version ""
    288302            if {${minor} == "4"} {