def patch(self): version = self.pkg.version try: s = Subprocess(log=self.logfile, cwd=self.build_dir) patches = [] if is_macosx_snowleopard(): if is_python24(version): patch_dir = os.path.join(PATH_PATCHES_MACOSX_PYTHON24,'files') patches = ['patch-configure', 'patch-Makefile.pre.in', 'patch-Lib-cgi.py', 'patch-Lib-site.py', 'patch-setup.py', 'patch-Include-pyport.h', 'patch-Mac-OSX-Makefile.in', 'patch-Mac-OSX-IDLE-Makefile.in', 'patch-Mac-OSX-PythonLauncher-Makefile.in', 'patch-configure-badcflags.diff', 'patch-configure-arch_only.diff', 'patch-macosmodule.diff', 'patch-mactoolboxglue.diff', 'patch-pymactoolbox.diff'] elif is_python25(version): patch_dir = os.path.join(PATH_PATCHES_MACOSX_PYTHON25,'files') patches = ['patch-Makefile.pre.in.diff', 'patch-Lib-cgi.py.diff', 'patch-Lib-distutils-dist.py.diff', 'patch-setup.py.diff', 'patch-configure-badcflags.diff', 'patch-configure-arch_only.diff', 'patch-64bit.diff', 'patch-pyconfig.h.in.diff', 'patch-Modules-posixmodule.c.diff'] if patches: logger.info("Patching %s" % self.pkg.name) for patch in patches: s.check_call("patch -p0 < %s" % os.path.join(patch_dir, patch)) except: logger.error("Failed to patch `%s`" % self.build_dir) sys.exit(1)
def configure(self): configure_option = "" if is_macosx_snowleopard(): version = self.pkg.version if is_python24(version): configure_option = '--with-universal-archs="intel" MACOSX_DEPLOYMENT_TARGET=10.6 CPPFLAGS="-D__DARWIN_UNIX03"' elif is_python25(version): configure_option = '--with-universal-archs="intel" MACOSX_DEPLOYMENT_TARGET=10.6 CPPFLAGS="-D_DARWIN_C_SOURCE"' elif is_python26(version): configure_option = '--with-universal-archs="intel" MACOSX_DEPLOYMENT_TARGET=10.6' s = Subprocess(log=self.logfile, cwd=self.build_dir) s.check_call("./configure --prefix=%s %s %s" % (self.install_dir, self.options.configure, configure_option))
def run_command(self, options, args): if args: # Install pythons for arg in args: try: if is_macosx_snowleopard(): p = PythonInstallerMacOSX(arg, options) else: p = PythonInstaller(arg, options) p.install() except UnknownVersionException: continue except AlreadyInstalledException: continue except NotSupportedVersionException: continue else: logger.info("Unknown python version.")
def ensure(self): if is_macosx_snowleopard(): version = self.pkg.version if version < '2.6' and (version != '2.4.6' and version != '2.5.5'): logger.info("`%s` is not supported on MacOSX Snow Leopard" % self.pkg.name) sys.exit()