Ticket #39270: skip-Build-Applet.patch

File skip-Build-Applet.patch, 6.0 KB (added by larryv (Lawrence Velázquez), 11 years ago)

backport upstream fix

  • trunk/dports/lang/python27/Portfile

    diff --git a/trunk/dports/lang/python27/Portfile b/trunk/dports/lang/python27/Portfile
    a b  
    88epoch               2
    99# Remember to keep py27-tkinter and py27-gdbm's versions sync'd with this
    1010version             2.7.5
     11revision            1
    1112
    1213set major           [lindex [split $version .] 0]
    1314set branch          [join [lrange [split ${version} .] 0 1] .]
     
    3940                    patch-configure.diff \
    4041                    patch-libedit.diff
    4142
     43# TODO Delete when updating to 2.7.6, which will incorporate this fix.
     44patchfiles-append   skip-Build-Applet.patch
     45
    4246depends_lib         port:gettext \
    4347                    port:zlib \
    4448                    port:openssl \
  • new file trunk/dports/lang/python27/files/skip-Build-Applet.patch

    diff --git a/trunk/dports/lang/python27/files/skip-Build-Applet.patch b/trunk/dports/lang/python27/files/skip-Build-Applet.patch
    new file mode 10644
    - +  
     1
     2# HG changeset patch
     3# User Ned Deily <nad@acm.org>
     4# Date 1369898069 25200
     5# Node ID cfdb4598c935015e7b1dc93332d25792b9f49d28
     6# Parent  bcbad715c2ce45c09c4191e20ac097c3226fe3c5
     7Issue #18098: The deprecated OS X Build Applet.app fails to build on
     8OS X 10.8 systems because the Apple-deprecated QuickDraw headers have
     9been removed from Xcode 4.  Skip building it in this case.
     10
     11diff --git Lib/plat-mac/EasyDialogs.py Lib/plat-mac/EasyDialogs.py
     12--- Lib/plat-mac/EasyDialogs.py
     13+++ Lib/plat-mac/EasyDialogs.py
     14@@ -243,8 +243,15 @@ def AskYesNoCancel(question, default = 0
     15 
     16 
     17 
     18+# The deprecated Carbon QuickDraw APIs are no longer available as of
     19+# OS X 10.8.  Raise an ImportError here in that case so that callers
     20+# of EasyDialogs, like BuildApplet, will do the right thing.
     21 
     22-screenbounds = Qd.GetQDGlobalsScreenBits().bounds
     23+try:
     24+    screenbounds = Qd.GetQDGlobalsScreenBits().bounds
     25+except AttributeError:
     26+    raise ImportError("QuickDraw APIs not available")
     27+
     28 screenbounds = screenbounds[0]+4, screenbounds[1]+4, \
     29     screenbounds[2]-4, screenbounds[3]-4
     30 
     31diff --git Mac/Makefile.in Mac/Makefile.in
     32--- Mac/Makefile.in
     33+++ Mac/Makefile.in
     34@@ -202,15 +202,22 @@ install_IDLE:
     35        cd IDLE && make install
     36 
     37 install_BuildApplet:
     38-       $(RUNSHARED) @ARCH_RUN_32BIT@ $(BUILDPYTHON) $(srcdir)/scripts/BuildApplet.py \
     39-               --destroot "$(DESTDIR)" \
     40-               --python=$(prefix)/Resources/Python.app/Contents/MacOS/Python \
     41-               --output "$(DESTDIR)$(PYTHONAPPSDIR)/Build Applet.app" \
     42-               $(srcdir)/scripts/BuildApplet.py
     43-ifneq ($(LIPO_32BIT_FLAGS),)
     44-       rm "$(DESTDIR)$(PYTHONAPPSDIR)/Build Applet.app/Contents/MacOS/Python"
     45-       lipo $(LIPO_32BIT_FLAGS) -output "$(DESTDIR)$(PYTHONAPPSDIR)/Build Applet.app/Contents/MacOS/Python" $(BUILDPYTHON)
     46-endif   
     47+       if ! $(RUNSHARED) @ARCH_RUN_32BIT@ $(BUILDPYTHON) \
     48+                       -c 'import EasyDialogs' 2>/dev/null ; then \
     49+               echo "EasyDialogs not available in this Python - skipping Build Applet.app" ; \
     50+       else \
     51+               $(RUNSHARED) @ARCH_RUN_32BIT@ $(BUILDPYTHON) $(srcdir)/scripts/BuildApplet.py \
     52+                       --destroot "$(DESTDIR)" \
     53+                       --python=$(prefix)/Resources/Python.app/Contents/MacOS/Python \
     54+                       --output "$(DESTDIR)$(PYTHONAPPSDIR)/Build Applet.app" \
     55+                       $(srcdir)/scripts/BuildApplet.py && \
     56+               if [ -n "$(LIPO_32BIT_FLAGS)" ] ; then \
     57+                       rm "$(DESTDIR)$(PYTHONAPPSDIR)/Build Applet.app/Contents/MacOS/Python" && \
     58+                       lipo $(LIPO_32BIT_FLAGS) \
     59+                               -output "$(DESTDIR)$(PYTHONAPPSDIR)/Build Applet.app/Contents/MacOS/Python" \
     60+                               $(BUILDPYTHON) ; \
     61+               fi \
     62+       fi
     63 
     64 MACLIBDEST=$(LIBDEST)/plat-mac
     65 MACTOOLSDEST=$(prefix)/Mac/Tools
     66diff --git Mac/README Mac/README
     67--- Mac/README
     68+++ Mac/README
     69@@ -209,9 +209,11 @@ script to set runtime options. These opt
     70 through PythonLauncher's preferences dialog.
     71 
     72 "BuildApplet.app" creates an applet from a Python script. Drop the script on it
     73-and out comes a full-featured MacOS application. There is much more to this,
     74-to be supplied later. Some useful (but outdated) info can be found in
     75-Mac/Demo.
     76+and out comes a full-featured MacOS application.  BuildApplet.app is now
     77+deprecated and has been removed in Python 3.  As of OS X 10.8, Xcode 4 no
     78+longer supplies the headers for the deprecated QuickDraw APIs used by
     79+the EasyDialogs module making BuildApplet unusable as an app.  It will
     80+not be built by the Mac/Makefile in this case.
     81 
     82 The commandline scripts /usr/local/bin/python and pythonw can be used to run
     83 non-GUI and GUI python scripts from the command line, respectively.
     84diff --git Misc/NEWS Misc/NEWS
     85--- Misc/NEWS
     86+++ Misc/NEWS
     87@@ -37,6 +37,13 @@ Library
     88   the default for linking if LDSHARED is not also overriden.  This restores
     89   Distutils behavior introduced in 2.7.3 and inadvertently dropped in 2.7.4.
     90 
     91+Build
     92+-----
     93+
     94+- Issue #18098: The deprecated OS X Build Applet.app fails to build on
     95+  OS X 10.8 systems because the Apple-deprecated QuickDraw headers have
     96+  been removed from Xcode 4.  Skip building it in this case.
     97+
     98 IDLE
     99 ----
     100 
     101diff --git configure configure
     102--- configure
     103+++ configure
     104@@ -2981,6 +2981,7 @@ fi
     105 
     106 
     107 
     108+ARCH_RUN_32BIT=""
     109 
     110 UNIVERSAL_ARCHS="32-bit"
     111 
     112@@ -7996,7 +7997,6 @@ case $ac_sys_system/$ac_sys_release in
     113 esac
     114 
     115 
     116-ARCH_RUN_32BIT=""
     117 
     118 case $ac_sys_system/$ac_sys_release in
     119   Darwin/[01567]\..*)
     120diff --git configure.ac configure.ac
     121--- configure.ac
     122+++ configure.ac
     123@@ -145,6 +145,7 @@ fi
     124 AC_SUBST(UNIVERSALSDK)
     125 
     126 AC_SUBST(ARCH_RUN_32BIT)
     127+ARCH_RUN_32BIT=""
     128 
     129 UNIVERSAL_ARCHS="32-bit"
     130 AC_SUBST(LIPO_32BIT_FLAGS)
     131@@ -1801,7 +1802,6 @@ case $ac_sys_system/$ac_sys_release in
     132 esac
     133 
     134 
     135-ARCH_RUN_32BIT=""
     136 AC_SUBST(LIBTOOL_CRUFT)
     137 case $ac_sys_system/$ac_sys_release in
     138   Darwin/@<:@01567@:>@\..*)
     139