Ticket #11363: setuptools-update.patch

File setuptools-update.patch, 6.6 KB (added by François Bissey, 12 years ago)

update patch, for reviewer only

  • SPKG.txt

    # HG changeset patch
    # User Francois Bissey <francois.bissey@canterbury.ac.nz>
    # Date 1305934131 -43200
    # Node ID 5d40224177cc0476ab996fcc707d635d3c4331a5
    # Parent  3cd04be203f9b7c7150558c840a2845fbe6b3036
    #11363 update setuptools to a newer version.
    
    diff --git a/SPKG.txt b/SPKG.txt
    a b  
    2323
    2424== Changelog ==
    2525
     26=== setuptools-0.6.16 (François Bissey, May 21, 2011) ===
     27 * Update to 0.6.16, adopt a Gentoo patch to avoid warnings
     28   with python-2.7 (works with 2.6 too).
     29 * Remove the two windows binaries and patch so setup.py doesn't
     30   try to install them.
     31
    2632=== setuptools-0.6c9 (Mike Hansen, February 19, 2008) ===
    2733 * Update to 0.6c9
    2834
  • new file patches/distribute-0.6.16-fix_deprecation_warnings.patch

    diff --git a/patches/distribute-0.6.16-fix_deprecation_warnings.patch b/patches/distribute-0.6.16-fix_deprecation_warnings.patch
    new file mode 100644
    - +  
     1--- pkg_resources.py
     2+++ pkg_resources.py
     3@@ -210,9 +210,10 @@
     4     needs some hacks for Linux and Mac OS X.
     5     """
     6     try:
     7-        from distutils.util import get_platform
     8-    except ImportError:
     9+        # Python 2.7 or >=3.2
     10         from sysconfig import get_platform
     11+    except ImportError:
     12+        from distutils.util import get_platform
     13 
     14     plat = get_platform()
     15     if sys.platform == "darwin" and not plat.startswith('macosx-'):
     16--- setuptools/command/bdist_egg.py
     17+++ setuptools/command/bdist_egg.py
     18@@ -7,10 +7,14 @@
     19 from setuptools import Command
     20 from distutils.dir_util import remove_tree, mkpath
     21 try:
     22-    from distutils.sysconfig import get_python_version, get_python_lib
     23+    # Python 2.7 or >=3.2
     24+    from sysconfig import get_path, get_python_version
     25+    def _get_purelib():
     26+        return get_path("purelib")
     27 except ImportError:
     28-    from sysconfig import get_python_version
     29-    from distutils.sysconfig import get_python_lib
     30+    from distutils.sysconfig import get_python_version, get_python_lib
     31+    def _get_purelib():
     32+        return get_python_lib(False)
     33 
     34 from distutils import log
     35 from distutils.errors import DistutilsSetupError
     36@@ -130,7 +134,7 @@
     37         # Hack for packages that install data to install's --install-lib
     38         self.get_finalized_command('install').install_lib = self.bdist_dir
     39 
     40-        site_packages = os.path.normcase(os.path.realpath(get_python_lib()))
     41+        site_packages = os.path.normcase(os.path.realpath(_get_purelib()))
     42         old, self.distribution.data_files = self.distribution.data_files,[]
     43 
     44         for item in old:
     45--- setuptools/command/build_ext.py
     46+++ setuptools/command/build_ext.py
     47@@ -9,9 +9,14 @@
     48 from distutils.file_util import copy_file
     49 from setuptools.extension import Library
     50 from distutils.ccompiler import new_compiler
     51-from distutils.sysconfig import customize_compiler, get_config_var
     52-get_config_var("LDSHARED")  # make sure _config_vars is initialized
     53-from distutils.sysconfig import _config_vars
     54+try:
     55+    # Python 2.7 or >=3.2
     56+    from distutils.ccompiler import customize_compiler
     57+    from sysconfig import get_config_var, _CONFIG_VARS
     58+except ImportError:
     59+    from distutils.sysconfig import customize_compiler, get_config_var
     60+    get_config_var("LDSHARED")  # make sure _config_vars is initialized
     61+    from distutils.sysconfig import _config_vars as _CONFIG_VARS
     62 from distutils import log
     63 from distutils.errors import *
     64 
     65@@ -133,16 +138,16 @@
     66             compiler=self.compiler, dry_run=self.dry_run, force=self.force
     67         )
     68         if sys.platform == "darwin":
     69-            tmp = _config_vars.copy()
     70+            tmp = _CONFIG_VARS.copy()
     71             try:
     72                 # XXX Help!  I don't have any idea whether these are right...
     73-                _config_vars['LDSHARED'] = "gcc -Wl,-x -dynamiclib -undefined dynamic_lookup"
     74-                _config_vars['CCSHARED'] = " -dynamiclib"
     75-                _config_vars['SO'] = ".dylib"
     76+                _CONFIG_VARS['LDSHARED'] = "gcc -Wl,-x -dynamiclib -undefined dynamic_lookup"
     77+                _CONFIG_VARS['CCSHARED'] = " -dynamiclib"
     78+                _CONFIG_VARS['SO'] = ".dylib"
     79                 customize_compiler(compiler)
     80             finally:
     81-                _config_vars.clear()
     82-                _config_vars.update(tmp)
     83+                _CONFIG_VARS.clear()
     84+                _CONFIG_VARS.update(tmp)
     85         else:
     86             customize_compiler(compiler)
     87 
     88--- setuptools/command/easy_install.py
     89+++ setuptools/command/easy_install.py
     90@@ -15,9 +15,22 @@
     91 from setuptools import Command, _dont_write_bytecode
     92 from setuptools.sandbox import run_setup
     93 from distutils import log, dir_util
     94+try:
     95+    # Python 2.7 or >=3.2
     96+    from sysconfig import get_config_vars, get_path
     97+    def _get_platlib():
     98+        return get_path("platlib")
     99+    def _get_purelib():
     100+        return get_path("purelib")
     101+except ImportError:
     102+    from distutils.sysconfig import get_config_vars, get_python_lib
     103+    def _get_platlib():
     104+        return get_python_lib(True)
     105+    def _get_purelib():
     106+        return get_python_lib(False)
     107+
     108 from distutils.util import get_platform
     109 from distutils.util import convert_path, subst_vars
     110-from distutils.sysconfig import get_python_lib, get_config_vars
     111 from distutils.errors import DistutilsArgError, DistutilsOptionError, \
     112     DistutilsError, DistutilsPlatformError
     113 from distutils.command.install import INSTALL_SCHEMES, SCHEME_KEYS
     114@@ -1348,8 +1361,7 @@
     115                                          'Python',
     116                                          sys.version[:3],
     117                                          'site-packages'))
     118-    for plat_specific in (0,1):
     119-        site_lib = get_python_lib(plat_specific)
     120+    for site_lib in (_get_purelib(), _get_platlib()):
     121         if site_lib not in sitedirs: sitedirs.append(site_lib)
     122 
     123     if HAS_USER_SITE:
  • new file patches/setuptools-noexecs.patch

    diff --git a/patches/setuptools-noexecs.patch b/patches/setuptools-noexecs.patch
    new file mode 100644
    - +  
     1--- setup.py    2007-09-04 19:18:46.000000000 +0300
     2+++ setup.py    2007-11-04 09:49:18.000000000 +0200
     3@@ -26,7 +26,6 @@
     4     url = "http://pypi.python.org/pypi/setuptools",
     5     test_suite = 'setuptools.tests',
     6     packages = find_packages(),
     7-    package_data = {'setuptools':['*.exe']},
     8 
     9     py_modules = ['pkg_resources', 'easy_install', 'site'],
     10 
  • spkg-install

    diff --git a/spkg-install b/spkg-install
    a b  
    22
    33cd src
    44
     5patch -p0 < ../patches/setuptools-noexecs.patch
     6patch -p0 < ../patches/distribute-0.6.16-fix_deprecation_warnings.patch
     7
    58python setup.py install
    69