1 diff -Naur distribute-0.6.16.ori/pkg_resources.py distribute-0.6.16/pkg_resources.py
2 --- distribute-0.6.16.ori/pkg_resources.py 2010-07-31 12:28:15.000000000 -0700
3 +++ distribute-0.6.16/pkg_resources.py 2011-05-03 10:29:38.757750390 -0700
5 needs some hacks for Linux and Mac OS X.
8 - from distutils.util import get_platform
10 + # Python 2.7 or >=3.2
11 from sysconfig import get_platform
13 + from distutils.util import get_platform
16 if sys.platform == "darwin" and not plat.startswith('macosx-'):
17 diff -Naur distribute-0.6.16.ori/setuptools/command/bdist_egg.py distribute-0.6.16/setuptools/command/bdist_egg.py
18 --- distribute-0.6.16.ori/setuptools/command/bdist_egg.py 2011-03-18 07:32:22.000000000 -0700
19 +++ distribute-0.6.16/setuptools/command/bdist_egg.py 2011-05-03 10:29:38.757750390 -0700
21 from setuptools import Command
22 from distutils.dir_util import remove_tree, mkpath
24 - from distutils.sysconfig import get_python_version, get_python_lib
25 + # Python 2.7 or >=3.2
26 + from sysconfig import get_path, get_python_version
28 + return get_path("purelib")
30 - from sysconfig import get_python_version
31 - from distutils.sysconfig import get_python_lib
32 + from distutils.sysconfig import get_python_version, get_python_lib
34 + return get_python_lib(False)
36 from distutils import log
37 from distutils.errors import DistutilsSetupError
39 # Hack for packages that install data to install's --install-lib
40 self.get_finalized_command('install').install_lib = self.bdist_dir
42 - site_packages = os.path.normcase(os.path.realpath(get_python_lib()))
43 + site_packages = os.path.normcase(os.path.realpath(_get_purelib()))
44 old, self.distribution.data_files = self.distribution.data_files,[]
47 diff -Naur distribute-0.6.16.ori/setuptools/command/build_ext.py distribute-0.6.16/setuptools/command/build_ext.py
48 --- distribute-0.6.16.ori/setuptools/command/build_ext.py 2010-07-31 12:28:15.000000000 -0700
49 +++ distribute-0.6.16/setuptools/command/build_ext.py 2011-05-03 10:29:38.757750390 -0700
51 from distutils.file_util import copy_file
52 from setuptools.extension import Library
53 from distutils.ccompiler import new_compiler
54 -from distutils.sysconfig import customize_compiler, get_config_var
55 -get_config_var("LDSHARED") # make sure _config_vars is initialized
56 -from distutils.sysconfig import _config_vars
58 + # Python 2.7 or >=3.2
59 + from distutils.ccompiler import customize_compiler
60 + from sysconfig import get_config_var, _CONFIG_VARS
62 + from distutils.sysconfig import customize_compiler, get_config_var
63 + get_config_var("LDSHARED") # make sure _config_vars is initialized
64 + from distutils.sysconfig import _config_vars as _CONFIG_VARS
65 from distutils import log
66 from distutils.errors import *
69 compiler=self.compiler, dry_run=self.dry_run, force=self.force
71 if sys.platform == "darwin":
72 - tmp = _config_vars.copy()
73 + tmp = _CONFIG_VARS.copy()
75 # XXX Help! I don't have any idea whether these are right...
76 - _config_vars['LDSHARED'] = "gcc -Wl,-x -dynamiclib -undefined dynamic_lookup"
77 - _config_vars['CCSHARED'] = " -dynamiclib"
78 - _config_vars['SO'] = ".dylib"
79 + _CONFIG_VARS['LDSHARED'] = "gcc -Wl,-x -dynamiclib -undefined dynamic_lookup"
80 + _CONFIG_VARS['CCSHARED'] = " -dynamiclib"
81 + _CONFIG_VARS['SO'] = ".dylib"
82 customize_compiler(compiler)
84 - _config_vars.clear()
85 - _config_vars.update(tmp)
86 + _CONFIG_VARS.clear()
87 + _CONFIG_VARS.update(tmp)
89 customize_compiler(compiler)
91 diff -Naur distribute-0.6.16.ori/setuptools/command/easy_install.py distribute-0.6.16/setuptools/command/easy_install.py
92 --- distribute-0.6.16.ori/setuptools/command/easy_install.py 2011-04-28 06:33:30.000000000 -0700
93 +++ distribute-0.6.16/setuptools/command/easy_install.py 2011-05-03 10:29:38.757750390 -0700
95 from setuptools import Command, _dont_write_bytecode
96 from setuptools.sandbox import run_setup
97 from distutils import log, dir_util
99 + # Python 2.7 or >=3.2
100 + from sysconfig import get_config_vars, get_path
101 + def _get_platlib():
102 + return get_path("platlib")
103 + def _get_purelib():
104 + return get_path("purelib")
106 + from distutils.sysconfig import get_config_vars, get_python_lib
107 + def _get_platlib():
108 + return get_python_lib(True)
109 + def _get_purelib():
110 + return get_python_lib(False)
112 from distutils.util import get_platform
113 from distutils.util import convert_path, subst_vars
114 -from distutils.sysconfig import get_python_lib, get_config_vars
115 from distutils.errors import DistutilsArgError, DistutilsOptionError, \
116 DistutilsError, DistutilsPlatformError
117 from distutils.command.install import INSTALL_SCHEMES, SCHEME_KEYS
118 @@ -1348,8 +1361,7 @@
122 - for plat_specific in (0,1):
123 - site_lib = get_python_lib(plat_specific)
124 + for site_lib in (_get_purelib(), _get_platlib()):
125 if site_lib not in sitedirs: sitedirs.append(site_lib)