[86490] trunk/dports/lang/python25

jmr at macports.org jmr at macports.org
Wed Oct 26 12:56:13 PDT 2011


Revision: 86490
          http://trac.macports.org/changeset/86490
Author:   jmr at macports.org
Date:     2011-10-26 12:56:13 -0700 (Wed, 26 Oct 2011)
Log Message:
-----------
python25: fix platform.mac_ver output on 64-bit (#27735), fix build failure with svn 1.7 installed (#31697)

Modified Paths:
--------------
    trunk/dports/lang/python25/Portfile
    trunk/dports/lang/python25/files/patch-Makefile.pre.in.diff

Added Paths:
-----------
    trunk/dports/lang/python25/files/patch-mac_ver.diff

Modified: trunk/dports/lang/python25/Portfile
===================================================================
--- trunk/dports/lang/python25/Portfile	2011-10-26 19:38:42 UTC (rev 86489)
+++ trunk/dports/lang/python25/Portfile	2011-10-26 19:56:13 UTC (rev 86490)
@@ -36,7 +36,8 @@
                         patch-setup.py.diff \
                         patch-configure.diff \
                         patch-64bit.diff \
-                        patch-setup_no_tkinter.py.diff
+                        patch-setup_no_tkinter.py.diff \
+                        patch-mac_ver.diff
 
 depends_lib             port:gettext port:zlib port:openssl \
                         port:sqlite3 port:db46 port:bzip2 \

Modified: trunk/dports/lang/python25/files/patch-Makefile.pre.in.diff
===================================================================
--- trunk/dports/lang/python25/files/patch-Makefile.pre.in.diff	2011-10-26 19:38:42 UTC (rev 86489)
+++ trunk/dports/lang/python25/files/patch-Makefile.pre.in.diff	2011-10-26 19:56:13 UTC (rev 86490)
@@ -1,5 +1,5 @@
 --- Makefile.pre.in.orig	2008-09-22 10:22:44.000000000 +1000
-+++ Makefile.pre.in	2011-05-10 16:46:43.000000000 +1000
++++ Makefile.pre.in	2011-10-27 06:47:17.000000000 +1100
 @@ -348,8 +348,8 @@
  # Build the shared modules
  sharedmods: $(BUILDPYTHON)
@@ -20,6 +20,15 @@
  			-isysroot "${UNIVERSALSDK}" \
  			-all_load $(LIBRARY) -Wl,-single_module \
  			-install_name $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/Python \
+@@ -458,7 +458,7 @@
+ 		$(SIGNAL_OBJS) \
+ 		$(MODOBJS) \
+ 		$(srcdir)/Modules/getbuildinfo.c
+-	$(CC) -c $(PY_CFLAGS) -DSVNVERSION=\"`LC_ALL=C $(SVNVERSION)`\" -o $@ $(srcdir)/Modules/getbuildinfo.c
++	$(CC) -c $(PY_CFLAGS) -DSVNVERSION="\"`LC_ALL=C $(SVNVERSION)`\"" -o $@ $(srcdir)/Modules/getbuildinfo.c
+ 
+ Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
+ 	$(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
 @@ -894,7 +894,7 @@
  # Install the dynamically loadable modules
  # This goes into $(exec_prefix)

Added: trunk/dports/lang/python25/files/patch-mac_ver.diff
===================================================================
--- trunk/dports/lang/python25/files/patch-mac_ver.diff	                        (rev 0)
+++ trunk/dports/lang/python25/files/patch-mac_ver.diff	2011-10-26 19:56:13 UTC (rev 86490)
@@ -0,0 +1,114 @@
+
+# HG changeset patch
+# User Ronald Oussoren <ronaldoussoren at mac.com>
+# Date 1279889153 0
+# Node ID e267ee9760bd14a8b4270e12af982c941fa7a67d
+# Parent  bdc069a1a721b28ad21849232bd5426dda871506
+Merged revisions 83085 via svnmerge from
+svn+ssh://pythondev@svn.python.org/python/branches/release27-maint
+
+................
+  r83085 | ronald.oussoren | 2010-07-23 13:41:00 +0100 (Fri, 23 Jul 2010) | 12 lines
+
+  Merged revisions 83075 via svnmerge from
+  svn+ssh://pythondev@svn.python.org/python/branches/py3k
+
+  ........
+    r83075 | ronald.oussoren | 2010-07-23 12:54:59 +0100 (Fri, 23 Jul 2010) | 5 lines
+
+    Fix for issue 7895. Avoid crashing the interpreter
+    when calling platform.mac_ver after calling os.fork by
+    reading from a system configuration file instead of
+    using OSX APIs.
+  ........
+................
+
+diff --git a/Lib/platform.py b/Lib/platform.py
+--- Lib/platform.py
++++ Lib/platform.py
+@@ -562,28 +562,20 @@ def _bcd2str(bcd):
+ 
+     return hex(bcd)[2:]
+ 
+-def mac_ver(release='',versioninfo=('','',''),machine=''):
+-
+-    """ Get MacOS version information and return it as tuple (release,
+-        versioninfo, machine) with versioninfo being a tuple (version,
+-        dev_stage, non_release_version).
+-
+-        Entries which cannot be determined are set to the paramter values
+-        which default to ''. All tuple entries are strings.
+-
++def _mac_ver_gestalt():
++    """
+         Thanks to Mark R. Levinson for mailing documentation links and
+         code examples for this function. Documentation for the
+         gestalt() API is available online at:
+ 
+            http://www.rgaros.nl/gestalt/
+-
+     """
+     # Check whether the version info module is available
+     try:
+         import gestalt
+         import MacOS
+     except ImportError:
+-        return release,versioninfo,machine
++        return None
+     # Get the infos
+     sysv,sysu,sysa = _mac_ver_lookup(('sysv','sysu','sysa'))
+     # Decode the infos
+@@ -619,6 +611,53 @@ def mac_ver(release='',versioninfo=('','
+         machine = {0x1: '68k',
+                    0x2: 'PowerPC',
+                    0xa: 'i386'}.get(sysa,'')
++
++    return release,versioninfo,machine
++
++def _mac_ver_xml():
++    fn = '/System/Library/CoreServices/SystemVersion.plist'
++    if not os.path.exists(fn):
++        return None
++
++    try:
++        import plistlib
++    except ImportError:
++        return None
++
++    pl = plistlib.readPlist(fn)
++    release = pl['ProductVersion']
++    versioninfo=('', '', '')
++    machine = os.uname()[4]
++    if machine == 'ppc':
++        # for compatibility with the gestalt based code
++        machine = 'PowerPC'
++
++    return release,versioninfo,machine
++
++
++def mac_ver(release='',versioninfo=('','',''),machine=''):
++
++    """ Get MacOS version information and return it as tuple (release,
++        versioninfo, machine) with versioninfo being a tuple (version,
++        dev_stage, non_release_version).
++
++        Entries which cannot be determined are set to the paramter values
++        which default to ''. All tuple entries are strings.
++    """
++
++    # First try reading the information from an XML file which should
++    # always be present
++    info = _mac_ver_xml()
++    if info is not None:
++        return info
++
++    # If that doesn't work for some reason fall back to reading the
++    # information using gestalt calls.
++    info = _mac_ver_gestalt()
++    if info is not None:
++        return info
++
++    # If that also doesn't work return the default values
+     return release,versioninfo,machine
+ 
+ def _java_getprop(name,default):
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20111026/ce0eb129/attachment.html>


More information about the macports-changes mailing list