<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[125555] trunk/dports/lang/python33</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/125555">125555</a></dd>
<dt>Author</dt> <dd>larryv@macports.org</dd>
<dt>Date</dt> <dd>2014-09-20 19:20:41 -0700 (Sat, 20 Sep 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>python33: Apply upstream Yosemite fixes

Patches adapted from http://bugs.python.org/issue21811.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportslangpython33Portfile">trunk/dports/lang/python33/Portfile</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkdportslangpython33filesyosemiteconfigurefixespatch">trunk/dports/lang/python33/files/yosemite-configure-fixes.patch</a></li>
<li><a href="#trunkdportslangpython33filesyosemitepythonfixespatch">trunk/dports/lang/python33/files/yosemite-python-fixes.patch</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportslangpython33Portfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/lang/python33/Portfile (125554 => 125555)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/lang/python33/Portfile        2014-09-21 02:20:38 UTC (rev 125554)
+++ trunk/dports/lang/python33/Portfile        2014-09-21 02:20:41 UTC (rev 125555)
</span><span class="lines">@@ -8,6 +8,7 @@
</span><span class="cx"> 
</span><span class="cx"> # Remember to keep py33-tkinter and py33-gdbm's versions sync'd with this
</span><span class="cx"> version                 3.3.5
</span><ins>+revision                1
</ins><span class="cx"> # typo in epoch, day and month switched in previous, correct in September
</span><span class="cx"> epoch                   20140903
</span><span class="cx"> 
</span><span class="lines">@@ -40,6 +41,10 @@
</span><span class="cx">                         patch-setup.py-disabled_modules.diff \
</span><span class="cx">                         patch-libedit.diff
</span><span class="cx"> 
</span><ins>+# http://bugs.python.org/issue21811
+patchfiles-append       yosemite-configure-fixes.patch \
+                        yosemite-python-fixes.patch
+
</ins><span class="cx"> depends_lib             port:zlib port:openssl \
</span><span class="cx">                         port:sqlite3 port:ncurses \
</span><span class="cx">                         port:bzip2 port:libedit port:gettext \
</span></span></pre></div>
<a id="trunkdportslangpython33filesyosemiteconfigurefixespatch"></a>
<div class="addfile"><h4>Added: trunk/dports/lang/python33/files/yosemite-configure-fixes.patch (0 => 125555)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/lang/python33/files/yosemite-configure-fixes.patch                                (rev 0)
+++ trunk/dports/lang/python33/files/yosemite-configure-fixes.patch        2014-09-21 02:20:41 UTC (rev 125555)
</span><span class="lines">@@ -0,0 +1,124 @@
</span><ins>+Index: configure
+===================================================================
+--- configure.orig
++++ configure
+@@ -6459,10 +6459,16 @@ $as_echo &quot;$CC&quot; &gt;&amp;6; }

+             # Calculate the right deployment target for this build.
+             #
+-            cur_target=`sw_vers -productVersion | sed 's/\(10\.[0-9]*\).*/\1/'`
+-            if test ${cur_target} '&gt;' 10.2 &amp;&amp; \
+-               test ${cur_target} '&lt;' 10.6
++            cur_target_major=`sw_vers -productVersion | \
++                    sed 's/\([0-9]*\)\.\([0-9]*\).*/\1/'`
++            cur_target_minor=`sw_vers -productVersion | \
++                    sed 's/\([0-9]*\)\.\([0-9]*\).*/\2/'`
++            cur_target=&quot;${cur_target_major}.${cur_target_minor}&quot;
++            if test ${cur_target_major} -eq 10 &amp;&amp; \
++               test ${cur_target_minor} -ge 3 &amp;&amp; \
++               test ${cur_target_minor} -le 5
+             then
++                    # OS X 10.3 through 10.5
+                     cur_target=10.3
+                     if test ${enable_universalsdk}; then
+                             if test &quot;${UNIVERSAL_ARCHS}&quot; = &quot;all&quot;; then
+@@ -8481,15 +8487,14 @@ then
+                 # Use -undefined dynamic_lookup whenever possible (10.3 and later).
+                 # This allows an extension to be used in any Python

+-                if test ${MACOSX_DEPLOYMENT_TARGET} '&gt;' 10.2
++                dep_target_major=`echo ${MACOSX_DEPLOYMENT_TARGET} | \
++                                sed 's/\([0-9]*\)\.\([0-9]*\).*/\1/'`
++                dep_target_minor=`echo ${MACOSX_DEPLOYMENT_TARGET} | \
++                                sed 's/\([0-9]*\)\.\([0-9]*\).*/\2/'`
++                if test ${dep_target_major} -eq 10 &amp;&amp; \
++                   test ${dep_target_minor} -le 2
+                 then
+-                        if test &quot;${enable_universalsdk}&quot;; then
+-                                LDFLAGS=&quot;${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}&quot;
+-                        fi
+-                        LDSHARED='$(CC) -bundle -undefined dynamic_lookup'
+-                        LDCXXSHARED='$(CXX) -bundle -undefined dynamic_lookup'
+-                        BLDSHARED=&quot;$LDSHARED&quot;
+-                else
++                        # building for OS X 10.0 through 10.2
+                         LDSHARED='$(CC) -bundle'
+                         LDCXXSHARED='$(CXX) -bundle'
+                         if test &quot;$enable_framework&quot; ; then
+@@ -8503,6 +8508,14 @@ then
+                                 LDSHARED=&quot;$LDSHARED &quot;'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
+                                 LDCXXSHARED=&quot;$LDCXXSHARED &quot;'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
+                         fi
++                else
++                        # building for OS X 10.3 and later
++                        if test &quot;${enable_universalsdk}&quot;; then
++                                LDFLAGS=&quot;${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}&quot;
++                        fi
++                        LDSHARED='$(CC) -bundle -undefined dynamic_lookup'
++                        LDCXXSHARED='$(CXX) -bundle -undefined dynamic_lookup'
++                        BLDSHARED=&quot;$LDSHARED&quot;
+                 fi
+                 ;
+         Linux*|GNU*|QNX*)
+Index: configure.ac
+===================================================================
+--- configure.ac.orig
++++ configure.ac
+@@ -1258,10 +1258,16 @@ yes)

+             # Calculate the right deployment target for this build.
+             #
+-            cur_target=`sw_vers -productVersion | sed 's/\(10\.[[0-9]]*\).*/\1/'`
+-            if test ${cur_target} '&gt;' 10.2 &amp;&amp; \
+-               test ${cur_target} '&lt;' 10.6
++            cur_target_major=`sw_vers -productVersion | \
++                    sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
++            cur_target_minor=`sw_vers -productVersion | \
++                    sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
++            cur_target=&quot;${cur_target_major}.${cur_target_minor}&quot;
++            if test ${cur_target_major} -eq 10 &amp;&amp; \
++               test ${cur_target_minor} -ge 3 &amp;&amp; \
++               test ${cur_target_minor} -le 5
+             then
++                    # OS X 10.3 through 10.5
+                     cur_target=10.3
+                     if test ${enable_universalsdk}; then
+                             if test &quot;${UNIVERSAL_ARCHS}&quot; = &quot;all&quot;; then
+@@ -1980,15 +1986,14 @@ then
+                 # Use -undefined dynamic_lookup whenever possible (10.3 and later).
+                 # This allows an extension to be used in any Python

+-                if test ${MACOSX_DEPLOYMENT_TARGET} '&gt;' 10.2
++                dep_target_major=`echo ${MACOSX_DEPLOYMENT_TARGET} | \
++                                sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
++                dep_target_minor=`echo ${MACOSX_DEPLOYMENT_TARGET} | \
++                                sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
++                if test ${dep_target_major} -eq 10 &amp;&amp; \
++                   test ${dep_target_minor} -le 2
+                 then
+-                        if test &quot;${enable_universalsdk}&quot;; then
+-                                LDFLAGS=&quot;${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}&quot;
+-                        fi
+-                        LDSHARED='$(CC) -bundle -undefined dynamic_lookup'
+-                        LDCXXSHARED='$(CXX) -bundle -undefined dynamic_lookup'
+-                        BLDSHARED=&quot;$LDSHARED&quot;
+-                else
++                        # building for OS X 10.0 through 10.2
+                         LDSHARED='$(CC) -bundle'
+                         LDCXXSHARED='$(CXX) -bundle'
+                         if test &quot;$enable_framework&quot; ; then
+@@ -2002,6 +2007,14 @@ then
+                                 LDSHARED=&quot;$LDSHARED &quot;'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
+                                 LDCXXSHARED=&quot;$LDCXXSHARED &quot;'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
+                         fi
++                else
++                        # building for OS X 10.3 and later
++                        if test &quot;${enable_universalsdk}&quot;; then
++                                LDFLAGS=&quot;${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}&quot;
++                        fi
++                        LDSHARED='$(CC) -bundle -undefined dynamic_lookup'
++                        LDCXXSHARED='$(CXX) -bundle -undefined dynamic_lookup'
++                        BLDSHARED=&quot;$LDSHARED&quot;
+                 fi
+                 ;
+         Linux*|GNU*|QNX*)
</ins></span></pre></div>
<a id="trunkdportslangpython33filesyosemitepythonfixespatch"></a>
<div class="addfile"><h4>Added: trunk/dports/lang/python33/files/yosemite-python-fixes.patch (0 => 125555)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/lang/python33/files/yosemite-python-fixes.patch                                (rev 0)
+++ trunk/dports/lang/python33/files/yosemite-python-fixes.patch        2014-09-21 02:20:41 UTC (rev 125555)
</span><span class="lines">@@ -0,0 +1,158 @@
</span><ins>+Index: Lib/_osx_support.py
+===================================================================
+--- Lib/_osx_support.py.orig
++++ Lib/_osx_support.py
+@@ -450,8 +450,16 @@ def get_platform_osx(_config_vars, osnam
+         # case and disallow installs.
+         cflags = _config_vars.get(_INITPRE+'CFLAGS',
+                                     _config_vars.get('CFLAGS', ''))
+-        if ((macrelease + '.') &gt;= '10.4.' and
+-            '-arch' in cflags.strip()):
++        if macrelease:
++            try:
++                macrelease = tuple(int(i) for i in macrelease.split('.')[0:2])
++            except ValueError:
++                macrelease = (10, 0)
++        else:
++            # assume no universal support
++            macrelease = (10, 0)
++
++        if (macrelease &gt;= (10, 4)) and '-arch' in cflags.strip():
+             # The universal build will build fat binaries, but not on
+             # systems before 10.4

+Index: Lib/distutils/tests/test_build_ext.py
+===================================================================
+--- Lib/distutils/tests/test_build_ext.py.orig
++++ Lib/distutils/tests/test_build_ext.py
+@@ -444,8 +444,16 @@ class BuildExtTestCase(TempdirManager,

+         # get the deployment target that the interpreter was built with
+         target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
+-        target = tuple(map(int, target.split('.')))
+-        target = '%02d%01d0' % target
++        target = tuple(map(int, target.split('.')[0:2]))
++        # format the target value as defined in the Apple
++        # Availability Macros.  We can't use the macro names since
++        # at least one value we test with will not exist yet.
++        if target[1] &lt; 10:
++            # for 10.1 through 10.9.x -&gt; &quot;10n0&quot;
++            target = '%02d%01d0' % target
++        else:
++            # for 10.10 and beyond -&gt; &quot;10nn00&quot;
++            target = '%02d%02d00' % target
+         deptarget_ext = Extension(
+             'deptarget',
+             [deptarget_c],
+Index: Lib/test/test__osx_support.py
+===================================================================
+--- Lib/test/test__osx_support.py.orig
++++ Lib/test/test__osx_support.py
+@@ -109,7 +109,9 @@ class Test_OSXSupport(unittest.TestCase)

+     def test__supports_universal_builds(self):
+         import platform
+-        self.assertEqual(platform.mac_ver()[0].split('.') &gt;= ['10', '4'],
++        mac_ver_tuple = tuple(int(i) for i in
++                            platform.mac_ver()[0].split('.')[0:2])
++        self.assertEqual(mac_ver_tuple &gt;= (10, 4),
+                             _osx_support._supports_universal_builds())

+     def test__find_appropriate_compiler(self):
+Index: Lib/test/test_posix.py
+===================================================================
+--- Lib/test/test_posix.py.orig
++++ Lib/test/test_posix.py
+@@ -768,7 +768,7 @@ class PosixTester(unittest.TestCase):
+         if sys.platform == 'darwin':
+             import sysconfig
+             dt = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') or '10.0'
+-            if float(dt) &lt; 10.6:
++            if tuple(int(n) for n in dt.split('.')[0:2]) &lt; (10, 6):
+                 raise unittest.SkipTest(&quot;getgroups(2) is broken prior to 10.6&quot;)

+         # 'id -G' and 'os.getgroups()' should return the same
+Index: Mac/BuildScript/build-installer.py
+===================================================================
+--- Mac/BuildScript/build-installer.py.orig
++++ Mac/BuildScript/build-installer.py
+@@ -148,17 +148,19 @@ SRCDIR = os.path.dirname(
+ # $MACOSX_DEPLOYMENT_TARGET -&gt; minimum OS X level
+ DEPTARGET = '10.3'

+-target_cc_map = {
++def getDeptargetTuple():
++    return tuple([int(n) for n in DEPTARGET.split('.')[0:2]])
++
++def getTargetCompilers():
++    target_cc_map = {
+         '10.3': ('gcc-4.0', 'g++-4.0'),
+         '10.4': ('gcc-4.0', 'g++-4.0'),
+         '10.5': ('gcc-4.2', 'g++-4.2'),
+         '10.6': ('gcc-4.2', 'g++-4.2'),
+-        '10.7': ('clang', 'clang++'),
+-        '10.8': ('clang', 'clang++'),
+-        '10.9': ('clang', 'clang++'),
+-}
++    }
++    return target_cc_map.get(DEPTARGET, ('clang', 'clang++') )

+-CC, CXX = target_cc_map[DEPTARGET]
++CC, CXX = getTargetCompilers()

+ PYTHON_3 = getVersionTuple() &gt;= (3, 0)

+@@ -191,9 +193,9 @@ EXPECTED_SHARED_LIBS = {}
+ def library_recipes():
+     result = []

+-    LT_10_5 = bool(DEPTARGET &lt; '10.5')
++    LT_10_5 = bool(getDeptargetTuple() &lt; (10, 5))

+-    if (DEPTARGET &gt; '10.5') and (getVersionTuple() &gt;= (3, 4)):
++    if (getDeptargetTuple() &gt; (10, 5)) and (getVersionTuple() &gt;= (3, 4)):
+         result.extend([
+           dict(
+               name=&quot;Tcl 8.5.15&quot;,
+@@ -301,7 +303,7 @@ def library_recipes():
+           ),
+         ])

+-    if DEPTARGET &lt; '10.5':
++    if getDeptargetTuple() &lt; (10, 5):
+         result.extend([
+           dict(
+               name=&quot;Bzip2 1.0.6&quot;,
+@@ -436,7 +438,7 @@ def pkg_recipes():
+         ),
+     ]

+-    if DEPTARGET &lt; '10.4' and not PYTHON_3:
++    if getDeptargetTuple() &lt; (10, 4) and not PYTHON_3:
+         result.append(
+             dict(
+                 name=&quot;PythonSystemFixes&quot;,
+@@ -666,7 +668,7 @@ def parseOptions(args=None):
+     SDKPATH=os.path.abspath(SDKPATH)
+     DEPSRC=os.path.abspath(DEPSRC)

+-    CC, CXX=target_cc_map[DEPTARGET]
++    CC, CXX = getTargetCompilers()

+     print(&quot;Settings:&quot;)
+     print(&quot; * Source directory:&quot;, SRCDIR)
+Index: setup.py
+===================================================================
+--- setup.py.orig
++++ setup.py
+@@ -687,7 +687,9 @@ class PyBuildExt(build_ext):
+         if host_platform == 'darwin':
+             os_release = int(os.uname()[2].split('.')[0])
+             dep_target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
+-            if dep_target and dep_target.split('.') &lt; ['10', '5']:
++            if (dep_target and
++                    (tuple(int(n) for n in dep_target.split('.')[0:2])
++                        &lt; (10, 5) ) ):
+                 os_release = 8
+             if os_release &lt; 9:
+                 # MacOSX 10.4 has a broken readline. Don't try to build
</ins></span></pre>
</div>
</div>

</body>
</html>