view gub/specs/python-2.6.py @ 6206:8021db07ffb8

Prepare for python-2.6 transition. tools.py: add python version switch. Also, rename python-2-6 to python-2.6 and add python-2.4 package.
author Jan Nieuwenhuizen <janneke@gnu.org>
date Tue, 28 Aug 2012 10:29:46 +0200
parents
children 895c23f49db3
line wrap: on
line source

from gub import target
from gub import tools
from gub.specs import python

class Python_2_6 (python.Python):
    source = 'http://www.python.org/ftp/python/2.6.4/Python-2.6.4.tar.bz2'
    dependencies = [
        'db-devel',
        'expat-devel',
        'zlib-devel',
        'tools::python',
        ]
    patches = [
        'python-2.6.4.patch',
        'python-configure.in-posix.patch&strip=0',
        'python-2.6.4-configure.in-sysname.patch',
        'python-2.4.2-configure.in-sysrelease.patch',
        'python-2.4.2-setup.py-import.patch&strip=0',
        'python-2.6.4-setup.py-cross_root.patch',
#        'python-2.4.2-fno-stack-protector.patch',
#        'python-2.4.5-python-2.6.patch',
        'python-2.4.5-native.patch',
#        'python-2.4.5-db4.7.patch',
        'python-2.6.4-configure.in-cross.patch',
        'python-2.6.4-include-pc.patch',
        'python-2.6.4-setup-cross.patch',
        ]
    config_cache_overrides = python.Python.config_cache_overrides + '''
ac_cv_have_chflags=no
ac_cv_have_lchflags=no
ac_cv_py_format_size_t=no
'''
    so_modules = [
        '_struct',
        'datetime',
        'itertools',
        'time',
        ]

class Python_2_6__mingw (python.Python__mingw):
    source = Python_2_6.source
    patches = Python_2_6.patches + [
        'python-2.4.2-winsock2.patch',
        'python-2.4.2-setup.py-selectmodule.patch',
        'python-2.4.5-disable-pwd-mingw.patch',
        'python-2.4.5-mingw-site.patch',
        'python-2.4.5-mingw-socketmodule.patch',
        ]
    dependencies = [
        'db-devel',
        'expat-devel',
        'zlib-devel',
        'tools::python-2-6',
        ]
    config_cache_overrides = python.Python__mingw.config_cache_overrides + '''
ac_cv_have_chflags=no
ac_cv_have_lchflags=no
ac_cv_py_format_size_t=no
'''
    so_modules = Python_2_6.so_modules
    def patch (self):
        python.Python__mingw.patch (self)
        self.system ('cd %(srcdir)s && cp -pv PC/dl_nt.c Python/fileblocks.c')
    def generate_dll_a_and_la (self, libname, depend=''):
        target.AutoBuild.generate_dll_a_and_la (self, 'python2.6', depend)

class Python_2_6__tools (python.Python__tools):
    source = Python_2_6.source
    patches = [
        'python-2.6.4-readline.patch',
        'python-2.6.4-setup-cross.patch',
        ]
    dependencies = ['autoconf', 'libtool']
    force_autoupdate = True
    make_flags = python.Python__tools.make_flags
    so_modules = Python_2_6.so_modules
    def patch (self):
        tools.AutoBuild.patch (self)