Example #1
0
File: mingw.py Project: marnen/gub
def change_target_package (package):
    cross.change_target_package (package)
    w32.change_target_package (package)

    return

    # Too crude?
    # We need pthreads-w32 with python for openoffice
    # but db breaks with threads (although uses its own
    # interesting --disable-* naming), but libicu breaks,
    # libxml2 breaks...
    package.configure_command = (package.configure_command
                                 + w32.configure_no_threads)
Example #2
0
File: cygwin.py Project: epronk/gub
def change_target_package (package):
    cross.change_target_package (package)
    w32.change_target_package (package)

    package.get_build_dependencies \
            = misc.MethodOverrider (package.get_build_dependencies,
                                    lambda d, extra: d + extra, (['cygwin'],))

    def cyg_defs (d):
        k = 'runtime'
        if k not in d:
            k = ''
        d[k].append ('/usr/bin/cyg*dll')
        d[k].append ('/etc/postinstall')
        return d

    package.get_subpackage_definitions \
        = misc.MethodOverrider (package.get_subpackage_definitions, cyg_defs)

    package.configure_command = (package.configure_command
                                 .replace ('--disable-static', '--enable-static'))

    def install (whatsthis):
        package.install_readmes ()

    package.install = misc.MethodOverrider (package.install, install)

    def category_dict (d):
        default = {
            '': 'Utils',
            'devel': 'Devel',
            'doc': 'Doc',
            'runtime': 'Libs',
            'x11': 'X11',
            }
        full = default.copy ()
        full.update (d)
        for i in package.subpackage_names:
            if not full.get (i):
                full[i] = full['']
        return full

    package.category_dict = misc.MethodOverrider (package.category_dict,
                                                  category_dict)

    def description_dict (d):
        # FIXME: fairly uninformative description for packages,
        # unlike, eg, guile-devel.  This is easier, though.
        def get_subpackage_doc (split):
            flavor = package.category_dict ()[split]
            doc = package.__class__.__doc__
            if not doc:
                doc = misc.get_from_parents (package.__class__, '__doc__')
            if not doc:
                doc = '\n'
            return (doc.replace ('\n', ' - %(flavor)s\n', 1) % locals ())

        for i in package.subpackage_names:
            if not d.get (i):
                d[i] = get_subpackage_doc (i)
        return d

    package.description_dict = misc.MethodOverrider (package.description_dict,
                                                     description_dict)
Example #3
0
def change_target_package(package):
    cross.change_target_package(package)
    w32.change_target_package(package)

    # Hmm, why not in mingw? -> w32.py?
    @context.subst_method
    def rpath(foo):
        return ''

    package.rpath = misc.MethodOverrider(package.nop, rpath)

    package.get_build_dependencies \
            = misc.MethodOverrider (package.get_build_dependencies,
                                    lambda d, extra: d + extra, (['cygwin'],))

    def cyg_defs(d):
        k = 'runtime'
        if k not in d:
            k = ''
        d[k].append('/usr/bin/cyg*dll')
        d[k].append('/etc/postinstall')
        return d

    package.get_subpackage_definitions \
        = misc.MethodOverrider (package.get_subpackage_definitions, cyg_defs)

    package.configure_command = (package.configure_command.replace(
        '--disable-static', '--enable-static'))

    def install(whatsthis):
        package.install_readmes()

    package.install = misc.MethodOverrider(package.install, install)

    def category_dict(d):
        default = {
            '': 'Utils',
            'devel': 'Devel',
            'doc': 'Doc',
            'runtime': 'Libs',
            'x11': 'X11',
        }
        full = default.copy()
        full.update(d)
        for i in package.subpackage_names:
            if not full.get(i):
                full[i] = full['']
        return full

    package.category_dict = misc.MethodOverrider(package.category_dict,
                                                 category_dict)

    def description_dict(d):
        # FIXME: fairly uninformative description for packages,
        # unlike, eg, guile-devel.  This is easier, though.
        def get_subpackage_doc(split):
            flavor = package.category_dict()[split]
            doc = package.__class__.__doc__
            if not doc:
                doc = misc.get_from_parents(package.__class__, '__doc__')
            if not doc:
                doc = '\n'
            return (doc.replace('\n', ' - %(flavor)s\n', 1) % locals())

        for i in package.subpackage_names:
            if not d.get(i):
                d[i] = get_subpackage_doc(i)
        return d

    package.description_dict = misc.MethodOverrider(package.description_dict,
                                                    description_dict)