summaryrefslogtreecommitdiff
path: root/data/python/distutils.diff
diff options
context:
space:
mode:
Diffstat (limited to 'data/python/distutils.diff')
-rw-r--r--data/python/distutils.diff115
1 files changed, 115 insertions, 0 deletions
diff --git a/data/python/distutils.diff b/data/python/distutils.diff
new file mode 100644
index 000000000..dacfdee33
--- /dev/null
+++ b/data/python/distutils.diff
@@ -0,0 +1,115 @@
+diff -ru BuildPython-2.5.1/Lib/distutils/util.py Python-2.5.1/Lib/distutils/util.py
+--- BuildPython-2.5.1/Lib/distutils/util.py 2006-05-23 21:54:23.000000000 +0000
++++ Python-2.5.1/Lib/distutils/util.py 2008-01-09 07:47:28.000000000 +0000
+@@ -13,110 +13,7 @@
+ from distutils import log
+
+ def get_platform ():
+- """Return a string that identifies the current platform. This is used
+- mainly to distinguish platform-specific build directories and
+- platform-specific built distributions. Typically includes the OS name
+- and version and the architecture (as supplied by 'os.uname()'),
+- although the exact information included depends on the OS; eg. for IRIX
+- the architecture isn't particularly important (IRIX only runs on SGI
+- hardware), but for Linux the kernel version isn't particularly
+- important.
+-
+- Examples of returned values:
+- linux-i586
+- linux-alpha (?)
+- solaris-2.6-sun4u
+- irix-5.3
+- irix64-6.2
+-
+- For non-POSIX platforms, currently just returns 'sys.platform'.
+- """
+- if os.name != "posix" or not hasattr(os, 'uname'):
+- # XXX what about the architecture? NT is Intel or Alpha,
+- # Mac OS is M68k or PPC, etc.
+- return sys.platform
+-
+- # Try to distinguish various flavours of Unix
+-
+- (osname, host, release, version, machine) = os.uname()
+-
+- # Convert the OS name to lowercase, remove '/' characters
+- # (to accommodate BSD/OS), and translate spaces (for "Power Macintosh")
+- osname = string.lower(osname)
+- osname = string.replace(osname, '/', '')
+- machine = string.replace(machine, ' ', '_')
+- machine = string.replace(machine, '/', '-')
+-
+- if osname[:5] == "linux":
+- # At least on Linux/Intel, 'machine' is the processor --
+- # i386, etc.
+- # XXX what about Alpha, SPARC, etc?
+- return "%s-%s" % (osname, machine)
+- elif osname[:5] == "sunos":
+- if release[0] >= "5": # SunOS 5 == Solaris 2
+- osname = "solaris"
+- release = "%d.%s" % (int(release[0]) - 3, release[2:])
+- # fall through to standard osname-release-machine representation
+- elif osname[:4] == "irix": # could be "irix64"!
+- return "%s-%s" % (osname, release)
+- elif osname[:3] == "aix":
+- return "%s-%s.%s" % (osname, version, release)
+- elif osname[:6] == "cygwin":
+- osname = "cygwin"
+- rel_re = re.compile (r'[\d.]+')
+- m = rel_re.match(release)
+- if m:
+- release = m.group()
+- elif osname[:6] == "darwin":
+- #
+- # For our purposes, we'll assume that the system version from
+- # distutils' perspective is what MACOSX_DEPLOYMENT_TARGET is set
+- # to. This makes the compatibility story a bit more sane because the
+- # machine is going to compile and link as if it were
+- # MACOSX_DEPLOYMENT_TARGET.
+- from distutils.sysconfig import get_config_vars
+- cfgvars = get_config_vars()
+-
+- macver = os.environ.get('MACOSX_DEPLOYMENT_TARGET')
+- if not macver:
+- macver = cfgvars.get('MACOSX_DEPLOYMENT_TARGET')
+-
+- if not macver:
+- # Get the system version. Reading this plist is a documented
+- # way to get the system version (see the documentation for
+- # the Gestalt Manager)
+- try:
+- f = open('/System/Library/CoreServices/SystemVersion.plist')
+- except IOError:
+- # We're on a plain darwin box, fall back to the default
+- # behaviour.
+- pass
+- else:
+- m = re.search(
+- r'<key>ProductUserVisibleVersion</key>\s*' +
+- r'<string>(.*?)</string>', f.read())
+- f.close()
+- if m is not None:
+- macver = '.'.join(m.group(1).split('.')[:2])
+- # else: fall back to the default behaviour
+-
+- if macver:
+- from distutils.sysconfig import get_config_vars
+- release = macver
+- osname = "macosx"
+-
+-
+- if (release + '.') < '10.4.' and \
+- get_config_vars().get('UNIVERSALSDK', '').strip():
+- # The universal build will build fat binaries, but not on
+- # systems before 10.4
+- machine = 'fat'
+-
+- elif machine in ('PowerPC', 'Power_Macintosh'):
+- # Pick a sane name for the PPC architecture.
+- machine = 'ppc'
+-
+- return "%s-%s-%s" % (osname, release, machine)
++ return 'darwin-10.5-arm'
+
+ # get_platform ()
+