[125558] trunk/dports/lang/python26
larryv at macports.org
larryv at macports.org
Sat Sep 20 19:20:50 PDT 2014
Revision: 125558
https://trac.macports.org/changeset/125558
Author: larryv at macports.org
Date: 2014-09-20 19:20:50 -0700 (Sat, 20 Sep 2014)
Log Message:
-----------
python26: Apply upstream Yosemite fixes
Patches adapted from http://bugs.python.org/issue21811.
Modified Paths:
--------------
trunk/dports/lang/python26/Portfile
Added Paths:
-----------
trunk/dports/lang/python26/files/yosemite-configure-fixes.patch
trunk/dports/lang/python26/files/yosemite-python-fixes.patch
Modified: trunk/dports/lang/python26/Portfile
===================================================================
--- trunk/dports/lang/python26/Portfile 2014-09-21 02:20:47 UTC (rev 125557)
+++ trunk/dports/lang/python26/Portfile 2014-09-21 02:20:50 UTC (rev 125558)
@@ -7,6 +7,7 @@
name python26
# Remember to keep py26-tkinter and py26-gdbm's versions sync'd with this
version 2.6.9
+revision 1
set major [lindex [split $version .] 0]
set branch [join [lrange [split ${version} .] 0 1] .]
categories lang
@@ -46,6 +47,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:gettext port:zlib port:openssl \
port:sqlite3 port:db46 port:ncurses \
port:bzip2 port:libedit
Added: trunk/dports/lang/python26/files/yosemite-configure-fixes.patch
===================================================================
--- trunk/dports/lang/python26/files/yosemite-configure-fixes.patch (rev 0)
+++ trunk/dports/lang/python26/files/yosemite-configure-fixes.patch 2014-09-21 02:20:50 UTC (rev 125558)
@@ -0,0 +1,114 @@
+Index: configure
+===================================================================
+--- configure.orig
++++ configure
+@@ -5313,8 +5313,14 @@ $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
++ then
+ cur_target=10.3
+ if test ${enable_universalsdk}; then
+ if test "${UNIVERSAL_ARCHS}" = "all"; then
+@@ -7366,14 +7372,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.
+@@ -7384,6 +7390,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.in
+===================================================================
+--- configure.in.orig
++++ configure.in
+@@ -1011,8 +1011,14 @@ 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
++ then
+ cur_target=10.3
+ if test ${enable_universalsdk}; then
+ if test "${UNIVERSAL_ARCHS}" = "all"; then
+@@ -1809,14 +1815,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.
+@@ -1827,6 +1833,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/python26/files/yosemite-python-fixes.patch
===================================================================
--- trunk/dports/lang/python26/files/yosemite-python-fixes.patch (rev 0)
+++ trunk/dports/lang/python26/files/yosemite-python-fixes.patch 2014-09-21 02:20:50 UTC (rev 125558)
@@ -0,0 +1,91 @@
+Index: Lib/distutils/util.py
+===================================================================
+--- Lib/distutils/util.py.orig
++++ Lib/distutils/util.py
+@@ -132,7 +132,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
+@@ -105,14 +105,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()
+
+ USAGE = textwrap.dedent("""\
+ Usage: build_python [options]
+@@ -136,7 +141,7 @@ USAGE = textwrap.dedent("""\
+ def library_recipes():
+ result = []
+
+- if DEPTARGET < '10.5':
++ if getDeptargetTuple() < (10, 5):
+ result.extend([
+ dict(
+ name="Bzip2 1.0.5",
+@@ -307,7 +312,7 @@ def pkg_recipes():
+ ),
+ ]
+
+- if DEPTARGET < '10.4':
++ if getDeptargetTuple() < (10, 4):
+ result.append(
+ dict(
+ name="PythonSystemFixes",
+@@ -497,7 +502,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
+Index: setup.py
+===================================================================
+--- setup.py.orig
++++ setup.py
+@@ -637,7 +637,9 @@ class PyBuildExt(build_ext):
+ if 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('.') < ['10', '5']:
++ if (dep_target and
++ (tuple(int(n) for n in dep_target.split('.')[0:2])
++ < (10, 5) ) ):
+ os_release = 8
+ if os_release < 9:
+ # MacOSX 10.4 has a broken readline. Don't try to build
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140920/2674ba52/attachment.html>
More information about the macports-changes
mailing list