def _patch_osx(self): version = Version(self.pkg.version) if is_python24(version): PATH_PATCHES_OSX_PYTHON24 = os.path.join(PATH_PATCHES_OSX, "python24") if version == '2.4': self._append_patch(PATH_PATCHES_OSX_PYTHON24, ['patch240-configure', 'patch240-setup.py.diff', 'patch240-Mac-OSX-Makefile.in', 'patch240-gestaltmodule.c.diff', 'patch240-sysconfig.py.diff']) elif version < '2.4.4': self._append_patch(PATH_PATCHES_OSX_PYTHON24, ['patch241-configure', 'patch240-setup.py.diff', 'patch240-Mac-OSX-Makefile.in', 'patch240-gestaltmodule.c.diff']) else: self._append_patch(PATH_PATCHES_OSX_PYTHON24, ['patch244-configure', 'patch244-setup.py.diff', 'patch244-Mac-OSX-Makefile.in', 'patch244-gestaltmodule.c.diff']) self._append_patch(PATH_PATCHES_OSX_PYTHON24, [ 'patch-Makefile.pre.in', 'patch-Lib-cgi.py.diff', 'patch-Lib-site.py.diff', 'patch-Include-pyport.h', 'patch-configure-badcflags.diff', 'patch-macosmodule.diff', 'patch-mactoolboxglue.diff', 'patch-pymactoolbox.diff']) elif is_python25(version): PATH_PATCHES_OSX_PYTHON25 = os.path.join(PATH_PATCHES_OSX, "python25") if version == '2.5': self._append_patch(PATH_PATCHES_OSX_PYTHON25, ['patch250-setup.py.diff']) elif version == '2.5.1': self._append_patch(PATH_PATCHES_OSX_PYTHON25, ['patch251-setup.py.diff']) else: self._append_patch(PATH_PATCHES_OSX_PYTHON25, ['patch252-setup.py.diff']) self._append_patch(PATH_PATCHES_OSX_PYTHON25, [ 'patch-Makefile.pre.in.diff', 'patch-Lib-cgi.py.diff', 'patch-Lib-distutils-dist.py.diff', 'patch-configure-badcflags.diff', 'patch-configure-arch_only.diff', 'patch-64bit.diff', 'patch-pyconfig.h.in.diff', 'patch-gestaltmodule.c.diff', {'_localemodule.c.ed': 'Modules/_localemodule.c'}, {'locale.py.ed': 'Lib/locale.py'}]) elif is_python26(version): PATH_PATCHES_OSX_PYTHON26 = os.path.join(PATH_PATCHES_OSX, "python26") self._append_patch(PATH_PATCHES_OSX_PYTHON26, [ 'patch-Lib-cgi.py.diff', 'patch-Lib-distutils-dist.py.diff', 'patch-Mac-IDLE-Makefile.in.diff', 'patch-Mac-Makefile.in.diff', 'patch-Mac-PythonLauncher-Makefile.in.diff', 'patch-Mac-Tools-Doc-setup.py.diff', 'patch-setup.py-db46.diff', 'patch-Lib-ctypes-macholib-dyld.py.diff', 'patch-setup_no_tkinter.py.diff', {'_localemodule.c.ed': 'Modules/_localemodule.c'}, {'locale.py.ed': 'Lib/locale.py'}]) if version < '2.6.9': patch_dir = os.path.join(PATH_PATCHES_ALL, "python26") self._append_patch(patch_dir, ['patch-nosslv2-3.diff']) elif is_python27(version): PATH_PATCHES_OSX_PYTHON27 = os.path.join(PATH_PATCHES_OSX, "python27") if version < '2.7.4': self._append_patch(PATH_PATCHES_OSX_PYTHON27, ['patch-Modules-posixmodule.diff']) elif version == '2.7.6': self._append_patch(PATH_PATCHES_OSX_PYTHON27, ['python-276-dtrace.diff']) elif is_python33(version): PATH_PATCHES_OSX_PYTHON33 = os.path.join(PATH_PATCHES_OSX, "python33") if version == '3.3.4': self._append_patch(PATH_PATCHES_OSX_PYTHON33, ['python-334-dtrace.diff'])