Exemple #1
0
 def patch(self):
     version = Version(self.pkg.version)
     # for ubuntu 11.04(Natty)
     if is_python24(version):
         patch_dir = os.path.join(PATH_PATCHES_ALL, "python24")
         self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     elif is_python25(version):
         patch_dir = os.path.join(PATH_PATCHES_ALL, "python25")
         self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     elif is_python26(version):
         patch_dir = os.path.join(PATH_PATCHES_ALL, "python26")
         self._add_patches_to_list(patch_dir, ['patch-_ssl.c-for-ubuntu-oneiric-and-later.diff'])
         if version < '2.6.6':
             patch_dir = os.path.join(PATH_PATCHES_ALL, "python26")
             self._add_patches_to_list(patch_dir, ['patch-setup.py-for-2.6.5-and-earlier.diff'])
         else:
             patch_dir = os.path.join(PATH_PATCHES_ALL, "common")
             self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     elif is_python27(version):
         if version < '2.7.2':
             patch_dir = os.path.join(PATH_PATCHES_ALL, "common")
             self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     elif is_python30(version):
         patch_dir = os.path.join(PATH_PATCHES_ALL, "python30")
         self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     elif is_python31(version):
         if version < '3.1.4':
             patch_dir = os.path.join(PATH_PATCHES_ALL, "common")
             self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     elif is_python32(version):
         if version == '3.2':
             patch_dir = os.path.join(PATH_PATCHES_ALL, "python32")
             self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     self._do_patch()
 def patch(self):
     version = Version(self.pkg.version)
     # for ubuntu 11.04(Natty)
     if is_python24(version):
         patch_dir = os.path.join(PATH_PATCHES_ALL, "python24")
         self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     elif is_python25(version):
         patch_dir = os.path.join(PATH_PATCHES_ALL, "python25")
         self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     elif is_python26(version):
         patch_dir = os.path.join(PATH_PATCHES_ALL, "common")
         self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     elif is_python27(version):
         if version < '2.7.2':
             patch_dir = os.path.join(PATH_PATCHES_ALL, "common")
             self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     elif is_python30(version):
         patch_dir = os.path.join(PATH_PATCHES_ALL, "python30")
         self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     elif is_python31(version):
         if version < '3.1.4':
             patch_dir = os.path.join(PATH_PATCHES_ALL, "common")
             self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     elif is_python32(version):
         if version == '3.2':
             patch_dir = os.path.join(PATH_PATCHES_ALL, "python32")
             self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     self._do_patch()
Exemple #3
0
 def patch(self):
     version = Version(self.pkg.version)
     # for ubuntu 11.04(Natty)
     if is_python24(version):
         patch_dir = os.path.join(PATH_PATCHES_ALL, "python24")
         self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     elif is_python25(version):
         patch_dir = os.path.join(PATH_PATCHES_ALL, "python25")
         self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     elif is_python26(version):
         if version < '2.6.6':
             patch_dir = os.path.join(PATH_PATCHES_ALL, "python26")
             self._add_patches_to_list(
                 patch_dir, ['patch-setup.py-for-2.6.5-and-earlier.diff'])
         else:
             patch_dir = os.path.join(PATH_PATCHES_ALL, "common")
             self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     elif is_python27(version):
         if version < '2.7.2':
             patch_dir = os.path.join(PATH_PATCHES_ALL, "common")
             self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     elif is_python30(version):
         patch_dir = os.path.join(PATH_PATCHES_ALL, "python30")
         self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     elif is_python31(version):
         if version < '3.1.4':
             patch_dir = os.path.join(PATH_PATCHES_ALL, "common")
             self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     elif is_python32(version):
         if version == '3.2':
             patch_dir = os.path.join(PATH_PATCHES_ALL, "python32")
             self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     self._do_patch()
Exemple #4
0
 def patch(self):
     version = self.pkg.version
     try:
         s = Subprocess(log=self.logfile, cwd=self.build_dir)
         patches = []
         eds = {}
         if is_python24(version):
             patch_dir = PATH_PATCHES_MACOSX_PYTHON24
             patches = ['patch-configure', 'patch-Makefile.pre.in',
                        'patch-Lib-cgi.py.diff', 'patch-Lib-site.py.diff',
                        'patch-setup.py.diff', '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',
                        'patch-gestaltmodule.c.diff']
         elif is_python25(version):
             patch_dir = PATH_PATCHES_MACOSX_PYTHON25
             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-gestaltmodule.c.diff']
             eds = {'_localemodule.c.ed': 'Modules/_localemodule.c', 
                    'locale.py.ed': 'Lib/locale.py'}
         elif is_python26(version):
             patch_dir = PATH_PATCHES_MACOSX_PYTHON26
             patches = ['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']
             eds = {'_localemodule.c.ed': 'Modules/_localemodule.c', 
                    'locale.py.ed': 'Lib/locale.py'}
             
         if patches or eds:
             logger.info("Patching %s" % self.pkg.name)
             for patch in patches:
                 s.check_call("patch -p0 < %s" % os.path.join(patch_dir, patch))
             for (ed, source) in eds.items():
                 ed = os.path.join(patch_dir, ed)
                 s.check_call('ed - %s < %s' % (source, ed))
     except:
         logger.error("Failed to patch `%s`" % self.build_dir)
         sys.exit(1)
Exemple #5
0
    def patch(self):
        # note: want an interface to the source patching functionality. like a patchperl.
        version = Version(self.pkg.version)
        if is_python24(version):
            patch_dir = PATH_PATCHES_MACOSX_PYTHON24
            self._add_patches_to_list(patch_dir, [
                'patch-configure', 'patch-Makefile.pre.in',
                'patch-Lib-cgi.py.diff', 'patch-Lib-site.py.diff',
                'patch-setup.py.diff', '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',
                'patch-gestaltmodule.c.diff'
            ])
        elif is_python25(version):
            patch_dir = PATH_PATCHES_MACOSX_PYTHON25
            self._add_patches_to_list(patch_dir, [
                '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-configure-no-posix-c-source.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):
            patch_dir = PATH_PATCHES_MACOSX_PYTHON26
            self._add_patches_to_list(patch_dir, [
                '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'
                }
            ])
        elif is_python27(version):
            if version < '2.7.4':
                patch_dir = PATH_PATCHES_MACOSX_PYTHON27
                self._add_patches_to_list(patch_dir,
                                          ['patch-Modules-posixmodule.diff'])

        self._do_patch()
 def patch(self):
     version = Version(self.pkg.version)
     # for ubuntu 11.04(Natty)
     if is_python24(version):
         patch_dir = os.path.join(PATH_PATCHES_ALL, "python24")
         self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     elif is_python25(version):
         patch_dir = os.path.join(PATH_PATCHES_ALL, "python25")
         self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     elif is_python26(version):
         if version < '2.6.6':
             patch_dir = os.path.join(PATH_PATCHES_ALL, "python26")
             if version < '2.6.3':
                 self._add_patches_to_list(
                     patch_dir,
                     ['patch-Makefile.pre.in-for-2.6.2-and-earlier.diff'])
             self._add_patches_to_list(
                 patch_dir, ['patch-setup.py-for-2.6.5-and-earlier.diff'])
             self._add_patches_to_list(
                 patch_dir,
                 ['patch-_ssl.c-for-ubuntu-oneiric-and-later.diff'])
         else:
             patch_dir = os.path.join(PATH_PATCHES_ALL, "common")
             self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     elif is_python27(version):
         if version < '2.7.2':
             patch_dir = os.path.join(PATH_PATCHES_ALL, "common")
             self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
         if version == '2.7.3':
             patch_dir = os.path.join(PATH_PATCHES_ALL, "python27")
             self._add_patches_to_list(
                 patch_dir, ['patch-Modules-_sqlite-connection.c.diff'])
         if version == '2.7.4':
             patch_dir = os.path.join(PATH_PATCHES_ALL, "python27")
             self._add_patches_to_list(
                 patch_dir, ['patch-Modules-_sqlite-for-2.7.4.diff'])
     elif is_python30(version):
         patch_dir = os.path.join(PATH_PATCHES_ALL, "python30")
         self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     elif is_python31(version):
         if version < '3.1.4':
             patch_dir = os.path.join(PATH_PATCHES_ALL, "common")
             self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     elif is_python32(version):
         if version == '3.2':
             patch_dir = os.path.join(PATH_PATCHES_ALL, "python32")
             self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     elif is_python34(version):
         if version == '3.4.4':
             patch_dir = os.path.join(PATH_PATCHES_ALL, "python34")
             self._add_patches_to_list(patch_dir,
                                       ['patch-Modules-Setup.dist.diff'])
     self._do_patch()
Exemple #7
0
 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))
Exemple #8
0
 def __init__(self, arg, options):
     super(PythonInstallerMacOSX, self).__init__(arg, options)
     version = self.pkg.version
     # check for 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)
         raise NotSupportedVersionException
     # set configure options
     if is_python24(version):
         self.configure_options = '--with-universal-archs="intel" MACOSX_DEPLOYMENT_TARGET=10.6 CPPFLAGS="-D__DARWIN_UNIX03"'
     elif is_python25(version):
         self.configure_options = '--with-universal-archs="intel" MACOSX_DEPLOYMENT_TARGET=10.6 CPPFLAGS="-D_DARWIN_C_SOURCE"'
     elif is_python26(version):
         self.configure_options = '--with-universal-archs="intel" --enable-universalsdk=/ MACOSX_DEPLOYMENT_TARGET=10.6'
Exemple #9
0
    def patch(self):
        # note: want an interface to the source patching functionality. like a patchperl.
        version = Version(self.pkg.version)
        if is_python24(version):
            patch_dir = PATH_PATCHES_MACOSX_PYTHON24
            self._add_patches_to_list(patch_dir, ['patch-configure', 'patch-Makefile.pre.in',
                                                  'patch-Lib-cgi.py.diff', 'patch-Lib-site.py.diff',
                                                  'patch-setup.py.diff', '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',
                                                  'patch-gestaltmodule.c.diff'])
        elif is_python25(version):
            patch_dir = PATH_PATCHES_MACOSX_PYTHON25
            self._add_patches_to_list(patch_dir, ['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-configure-no-posix-c-source.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):
            patch_dir = PATH_PATCHES_MACOSX_PYTHON26
            self._add_patches_to_list(patch_dir, ['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'}])
        elif is_python27(version):
            # patch impossible with 2.7.4, experimental fix until the official one is published    
            if version < '2.7.4':
                patch_dir = PATH_PATCHES_MACOSX_PYTHON27
                self._add_patches_to_list(patch_dir, ['patch-Modules-posixmodule.diff'])

        self._do_patch()
 def patch(self):
     version = Version(self.pkg.version)
     # for ubuntu 11.04(Natty)
     if is_python24(version):
         patch_dir = os.path.join(PATH_PATCHES_ALL, "python24")
         self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     elif is_python25(version):
         patch_dir = os.path.join(PATH_PATCHES_ALL, "python25")
         self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     elif is_python26(version):
         if version < '2.6.6':
             patch_dir = os.path.join(PATH_PATCHES_ALL, "python26")
             if version < '2.6.3':
                 self._add_patches_to_list(patch_dir, ['patch-Makefile.pre.in-for-2.6.2-and-earlier.diff'])
             self._add_patches_to_list(patch_dir, ['patch-setup.py-for-2.6.5-and-earlier.diff'])
             self._add_patches_to_list(patch_dir, ['patch-_ssl.c-for-ubuntu-oneiric-and-later.diff'])
         else:
             patch_dir = os.path.join(PATH_PATCHES_ALL, "common")
             self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     elif is_python27(version):
         if version < '2.7.2':
             patch_dir = os.path.join(PATH_PATCHES_ALL, "common")
             self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
         if version == '2.7.3':
             patch_dir = os.path.join(PATH_PATCHES_ALL, "python27")
             self._add_patches_to_list(patch_dir, ['patch-Modules-_sqlite-connection.c.diff'])
         if version == '2.7.4':
             patch_dir = os.path.join(PATH_PATCHES_ALL, "python27")
             self._add_patches_to_list(patch_dir, ['patch-Modules-_sqlite-for-2.7.4.diff'])
     elif is_python30(version):
         patch_dir = os.path.join(PATH_PATCHES_ALL, "python30")
         self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     elif is_python31(version):
         if version < '3.1.4':
             patch_dir = os.path.join(PATH_PATCHES_ALL, "common")
             self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     elif is_python32(version):
         if version == '3.2':
             patch_dir = os.path.join(PATH_PATCHES_ALL, "python32")
             self._add_patches_to_list(patch_dir, ['patch-setup.py.diff'])
     elif is_python34(version):
         if version == '3.4.4':
             patch_dir = os.path.join(PATH_PATCHES_ALL, "python34")
             self._add_patches_to_list(patch_dir, ['patch-Modules-Setup.dist.diff'])
     self._do_patch()
    def patch(self):
        # note: want an interface to the source patching functionality. like a patchperl.
        version = Version(self.pkg.version)
        if is_python24(version):
            patch_dir = PATH_PATCHES_MACOSX_PYTHON24
            self._add_patches_to_list(
                patch_dir,
                [
                    "patch-configure",
                    "patch-Makefile.pre.in",
                    "patch-Lib-cgi.py.diff",
                    "patch-Lib-site.py.diff",
                    "patch-setup.py.diff",
                    "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",
                    "patch-gestaltmodule.c.diff",
                ],
            )
        elif is_python25(version):
            patch_dir = PATH_PATCHES_MACOSX_PYTHON25
            self._add_patches_to_list(
                patch_dir,
                [
                    "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-gestaltmodule.c.diff",
                    {"_localemodule.c.ed": "Modules/_localemodule.c"},
                    {"locale.py.ed": "Lib/locale.py"},
                ],
            )
        elif is_python26(version):
            patch_dir = PATH_PATCHES_MACOSX_PYTHON26
            self._add_patches_to_list(
                patch_dir,
                [
                    "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"},
                ],
            )
        elif is_python27(version):
            patch_dir = PATH_PATCHES_MACOSX_PYTHON27
            self._add_patches_to_list(patch_dir, ["patch-Modules-posixmodule.diff"])

        self._do_patch()