[125557] trunk/dports/lang/python31
larryv at macports.org
larryv at macports.org
Sat Sep 20 19:20:47 PDT 2014
Revision: 125557
https://trac.macports.org/changeset/125557
Author: larryv at macports.org
Date: 2014-09-20 19:20:47 -0700 (Sat, 20 Sep 2014)
Log Message:
-----------
python31: Apply upstream Yosemite fixes
Patches adapted from http://bugs.python.org/issue21811.
Modified Paths:
--------------
trunk/dports/lang/python31/Portfile
Added Paths:
-----------
trunk/dports/lang/python31/files/yosemite-configure-fixes.patch
trunk/dports/lang/python31/files/yosemite-python-fixes.patch
Modified: trunk/dports/lang/python31/Portfile
===================================================================
--- trunk/dports/lang/python31/Portfile 2014-09-21 02:20:44 UTC (rev 125556)
+++ trunk/dports/lang/python31/Portfile 2014-09-21 02:20:47 UTC (rev 125557)
@@ -8,6 +8,7 @@
epoch 1
# Remember to keep py31-tkinter and py31-gdbm's versions sync'd with this
version 3.1.5
+revision 1
set major [lindex [split $version .] 0]
set branch [join [lrange [split ${version} .] 0 1] .]
categories lang
@@ -35,6 +36,10 @@
patch-setup.py-disabled_modules.diff \
patch-libedit.diff
+# http://bugs.python.org/issue21811
+patchfiles-append yosemite-configure-fixes.patch \
+ yosemite-python-fixes.patch
+
depends_lib port:zlib port:openssl \
port:sqlite3 port:ncurses \
port:bzip2 port:libedit port:gettext
Added: trunk/dports/lang/python31/files/yosemite-configure-fixes.patch
===================================================================
--- trunk/dports/lang/python31/files/yosemite-configure-fixes.patch (rev 0)
+++ trunk/dports/lang/python31/files/yosemite-configure-fixes.patch 2014-09-21 02:20:47 UTC (rev 125557)
@@ -0,0 +1,118 @@
+Index: configure
+===================================================================
+--- configure.orig
++++ configure
+@@ -5522,8 +5522,16 @@ $as_echo "$CC" >&6; }
+
+ # Calculate the right deployment target for this build.
+ #
+- cur_target=`sw_vers -productVersion | sed 's/\(10\.[0-9]*\).*/\1/'`
+- if test ${cur_target} '>' 10.2; then
++ 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="${cur_target_major}.${cur_target_minor}"
++ if test ${cur_target_major} -eq 10 && \
++ test ${cur_target_minor} -ge 3 && \
++ 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 "${UNIVERSAL_ARCHS}" = "all"; then
+@@ -7585,14 +7593,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} '>' 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 && \
++ test ${dep_target_minor} -le 2
+ then
+- if test "${enable_universalsdk}"; then
+- LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
+- fi
+- LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup'
+- BLDSHARED="$LDSHARED"
+- else
++ # building for OS X 10.0 through 10.2
+ LDSHARED='$(CC) $(LDFLAGS) -bundle'
+ if test "$enable_framework" ; then
+ # Link against the framework. All externals should be defined.
+@@ -7603,6 +7611,13 @@ then
+ BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)'
+ LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
+ fi
++ else
++ # building for OS X 10.3 and later
++ if test "${enable_universalsdk}"; then
++ LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
++ fi
++ LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup'
++ BLDSHARED="$LDSHARED"
+ fi
+ ;;
+ Linux*|GNU*|QNX*) LDSHARED='$(CC) -shared';;
+Index: configure.ac
+===================================================================
+--- configure.ac.orig
++++ configure.ac
+@@ -1010,8 +1010,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} '>' 10.2; then
++ 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="${cur_target_major}.${cur_target_minor}"
++ if test ${cur_target_major} -eq 10 && \
++ test ${cur_target_minor} -ge 3 && \
++ 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 "${UNIVERSAL_ARCHS}" = "all"; then
+@@ -1792,14 +1800,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} '>' 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 && \
++ test ${dep_target_minor} -le 2
+ then
+- if test "${enable_universalsdk}"; then
+- LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
+- fi
+- LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup'
+- BLDSHARED="$LDSHARED"
+- else
++ # building for OS X 10.0 through 10.2
+ LDSHARED='$(CC) $(LDFLAGS) -bundle'
+ if test "$enable_framework" ; then
+ # Link against the framework. All externals should be defined.
+@@ -1810,6 +1818,13 @@ then
+ BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)'
+ LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
+ fi
++ else
++ # building for OS X 10.3 and later
++ if test "${enable_universalsdk}"; then
++ LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
++ fi
++ LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup'
++ BLDSHARED="$LDSHARED"
+ fi
+ ;;
+ Linux*|GNU*|QNX*) LDSHARED='$(CC) -shared';;
Added: trunk/dports/lang/python31/files/yosemite-python-fixes.patch
===================================================================
--- trunk/dports/lang/python31/files/yosemite-python-fixes.patch (rev 0)
+++ trunk/dports/lang/python31/files/yosemite-python-fixes.patch 2014-09-21 02:20:47 UTC (rev 125557)
@@ -0,0 +1,76 @@
+Index: Lib/distutils/util.py
+===================================================================
+--- Lib/distutils/util.py.orig
++++ Lib/distutils/util.py
+@@ -133,7 +133,16 @@ def get_platform ():
+ release = macver
+ osname = "macosx"
+
+- if (macrelease + '.') >= '10.4.' and \
++ 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 >= (10, 4)) and \
+ '-arch' in get_config_vars().get('CFLAGS', '').strip():
+ # The universal build will build fat binaries, but not on
+ # systems before 10.4
+Index: Mac/BuildScript/build-installer.py
+===================================================================
+--- Mac/BuildScript/build-installer.py.orig
++++ Mac/BuildScript/build-installer.py
+@@ -108,14 +108,19 @@ SRCDIR = os.path.dirname(
+ # $MACOSX_DEPLOYMENT_TARGET -> minimum OS X level
+ DEPTARGET = '10.3'
+
+-target_cc_map = {
++def getDeptargetTuple():
++ return tuple([int(n) for n in DEPTARGET.split('.')[0:2]])
++
++def getTargetCompiler():
++ target_cc_map = {
+ '10.3': 'gcc-4.0',
+ '10.4': 'gcc-4.0',
+ '10.5': 'gcc-4.0',
+ '10.6': 'gcc-4.2',
+-}
++ }
++ return target_cc_map.get(DEPTARGET, 'clang')
+
+-CC = target_cc_map[DEPTARGET]
++CC = getTargetCompiler()
+
+ PYTHON_3 = getVersionTuple() >= (3, 0)
+
+@@ -141,7 +146,7 @@ USAGE = textwrap.dedent("""\
+ def library_recipes():
+ result = []
+
+- if DEPTARGET < '10.5':
++ if getDeptargetTuple() < (10, 5):
+ result.extend([
+ dict(
+ name="Bzip2 1.0.5",
+@@ -318,7 +323,7 @@ def pkg_recipes():
+ ),
+ ]
+
+- if DEPTARGET < '10.4':
++ if getDeptargetTuple() < (10, 4):
+ result.append(
+ dict(
+ name="PythonSystemFixes",
+@@ -509,7 +514,7 @@ def parseOptions(args=None):
+ SDKPATH=os.path.abspath(SDKPATH)
+ DEPSRC=os.path.abspath(DEPSRC)
+
+- CC=target_cc_map[DEPTARGET]
++ CC=getTargetCompiler()
+
+ print "Settings:"
+ print " * Source directory:", SRCDIR
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140920/0196be3e/attachment-0001.html>
More information about the macports-changes
mailing list