Beispiel #1
0
    def __init__(self, config, name, version, source_url='', source_size='', source_md5=None,uri=[],
                 patches=[], configure_commands=[], build_commands=[], install_commands=[], 
                 dependencies=[], after=[], suggests=[]):
        self.name = name
        self.version = version

        # create a fake TarballRepository, and give it the moduleset uri
        repo = TarballRepository(config, None, None)
        repo.moduleset_uri = uri
        branch = TarballBranch(repo, source_url, version, None, source_size, source_md5, 
                               None, source_subdir=None, expect_standard_tarball=False)
        branch.patches = patches

        # Set a second-level checkout root, because binary archives often unzip to cwd. We also set
        # expect_standard_tarball to False to allow these packages through.
        branch.checkoutroot = os.path.join(config.checkoutroot, "%s-%s-binary" % (name, version))

        AutogenModule.__init__(self, name, branch, None, None, '', dependencies,
                              after, suggests, supports_non_srcdir_builds=False,
                              skip_autogen=False)

        self.static = True
        self.configure_commands = configure_commands
        self.build_commands = build_commands
        self.install_commands = install_commands
Beispiel #2
0
    def __init__(self,
                 config,
                 name,
                 version,
                 source_url='',
                 source_size='',
                 source_md5=None,
                 uri=[],
                 patches=[],
                 configure_commands=[],
                 build_commands=[],
                 install_commands=[],
                 dependencies=[],
                 after=[],
                 suggests=[]):
        self.name = name
        self.version = version

        # create a fake TarballRepository, and give it the moduleset uri
        repo = TarballRepository(config, None, None)
        repo.moduleset_uri = uri
        branch = TarballBranch(repo,
                               source_url,
                               version,
                               None,
                               source_size,
                               source_md5,
                               None,
                               source_subdir=None,
                               expect_standard_tarball=False)
        branch.patches = patches

        # Set a second-level checkout root, because binary archives often unzip to cwd. We also set
        # expect_standard_tarball to False to allow these packages through.
        branch.checkoutroot = os.path.join(config.checkoutroot,
                                           "%s-%s-binary" % (name, version))

        AutogenModule.__init__(self,
                               name,
                               branch,
                               None,
                               None,
                               '',
                               dependencies,
                               after,
                               suggests,
                               supports_non_srcdir_builds=False,
                               skip_autogen=False)

        self.static = True
        self.configure_commands = configure_commands
        self.build_commands = build_commands
        self.install_commands = install_commands
Beispiel #3
0
def parse_tarball(node, config, uri, repositories, default_repo):
    name = node.getAttribute('id')
    version = node.getAttribute('version')
    source_url = None
    source_size = None
    source_hash = None
    patches = []
    checkoutdir = None
    autogenargs = ''
    makeargs = ''
    makeinstallargs = ''
    supports_non_srcdir_builds = True
    makefile = 'Makefile'
    if node.hasAttribute('checkoutdir'):
        checkoutdir = node.getAttribute('checkoutdir')
    if node.hasAttribute('autogenargs'):
        autogenargs = node.getAttribute('autogenargs')
    if node.hasAttribute('makeargs'):
        makeargs = node.getAttribute('makeargs')
    if node.hasAttribute('makeinstallargs'):
        makeinstallargs = node.getAttribute('makeinstallargs')
    if node.hasAttribute('supports-non-srcdir-builds'):
        supports_non_srcdir_builds = \
            (node.getAttribute('supports-non-srcdir-builds') != 'no')
    if node.hasAttribute('makefile'):
        makefile = node.getAttribute('makefile')

    for childnode in node.childNodes:
        if childnode.nodeType != childnode.ELEMENT_NODE: continue
        if childnode.nodeName == 'source':
            source_url = childnode.getAttribute('href')
            if childnode.hasAttribute('size'):
                try:
                    source_size = int(childnode.getAttribute('size'))
                except ValueError:
                    logging.warning(
                        _('module \'%(module)s\' has invalid size attribute (\'%(size)s\')'
                          ) % {
                              'module': name,
                              'size': childnode.getAttribute('size')
                          })
            if childnode.hasAttribute('md5sum'):
                source_hash = 'md5:' + childnode.getAttribute('md5sum')
            if childnode.hasAttribute('hash') and hashlib:
                source_hash = childnode.getAttribute('hash')
        elif childnode.nodeName == 'patches':
            for patch in childnode.childNodes:
                if patch.nodeType != patch.ELEMENT_NODE: continue
                if patch.nodeName != 'patch': continue
                patchfile = patch.getAttribute('file')
                if patch.hasAttribute('strip'):
                    patchstrip = int(patch.getAttribute('strip'))
                else:
                    patchstrip = 0
                patches.append((patchfile, patchstrip))

    # for tarballs, don't ever pass --enable-maintainer-mode
    autogenargs = autogenargs.replace('--enable-maintainer-mode', '')

    dependencies, after, suggests = get_dependencies(node)

    from autotools import AutogenModule
    from jhbuild.versioncontrol.tarball import TarballBranch, TarballRepository

    # create a fake TarballRepository, and give it the moduleset uri
    repo = TarballRepository(config, None, None)
    repo.moduleset_uri = uri

    branch = TarballBranch(repo, source_url, version, checkoutdir, source_size,
                           source_hash, None)
    branch.patches = patches

    instance = AutogenModule(
        name,
        branch,
        autogenargs,
        makeargs,
        makeinstallargs,
        supports_non_srcdir_builds=supports_non_srcdir_builds,
        skip_autogen=False,
        autogen_sh='configure',
        makefile=makefile)
    instance.dependencies = dependencies
    instance.after = after
    instance.suggests = suggests
    instance.pkg_config = find_first_child_node_content(node, 'pkg-config')

    return instance
Beispiel #4
0
def parse_tarball(node, config, uri, repositories, default_repo):
    name = node.getAttribute('id')
    version = node.getAttribute('version')
    source_url = None
    source_size = None
    source_hash = None
    patches = []
    checkoutdir = None
    autogenargs = ''
    makeargs = ''
    makeinstallargs = ''
    supports_non_srcdir_builds = True
    makefile = 'Makefile'
    if node.hasAttribute('checkoutdir'):
        checkoutdir = node.getAttribute('checkoutdir')
    if node.hasAttribute('autogenargs'):
        autogenargs = node.getAttribute('autogenargs')
    if node.hasAttribute('makeargs'):
        makeargs = node.getAttribute('makeargs')
    if node.hasAttribute('makeinstallargs'):
        makeinstallargs = node.getAttribute('makeinstallargs')
    if node.hasAttribute('supports-non-srcdir-builds'):
        supports_non_srcdir_builds = \
            (node.getAttribute('supports-non-srcdir-builds') != 'no')
    if node.hasAttribute('makefile'):
        makefile = node.getAttribute('makefile')

    for childnode in node.childNodes:
        if childnode.nodeType != childnode.ELEMENT_NODE: continue
        if childnode.nodeName == 'source':
            source_url = childnode.getAttribute('href')
            if childnode.hasAttribute('size'):
                try:
                    source_size = int(childnode.getAttribute('size'))
                except ValueError:
                    logging.warning(
                            _('module \'%(module)s\' has invalid size attribute (\'%(size)s\')') % {
                                'module': name, 'size': childnode.getAttribute('size')})
            if childnode.hasAttribute('md5sum'):
                source_hash = 'md5:' + childnode.getAttribute('md5sum')
            if childnode.hasAttribute('hash') and hashlib:
                source_hash = childnode.getAttribute('hash')
        elif childnode.nodeName == 'patches':
            for patch in childnode.childNodes:
                if patch.nodeType != patch.ELEMENT_NODE: continue
                if patch.nodeName != 'patch': continue
                patchfile = patch.getAttribute('file')
                if patch.hasAttribute('strip'):
                    patchstrip = int(patch.getAttribute('strip'))
                else:
                    patchstrip = 0
                patches.append((patchfile, patchstrip))

    # for tarballs, don't ever pass --enable-maintainer-mode
    autogenargs = autogenargs.replace('--enable-maintainer-mode', '')

    dependencies, after, suggests, systemdependencies = get_dependencies(node)

    from autotools import AutogenModule
    from jhbuild.versioncontrol.tarball import TarballBranch, TarballRepository

    # create a fake TarballRepository, and give it the moduleset uri
    repo = TarballRepository(config, None, None)
    repo.moduleset_uri = uri

    branch = TarballBranch(repo, source_url, version, checkoutdir,
            source_size, source_hash, None)
    branch.patches = patches

    instance = AutogenModule(name, branch,
                             autogenargs, makeargs, makeinstallargs,
                             supports_non_srcdir_builds = supports_non_srcdir_builds,
                             skip_autogen = False, autogen_sh = 'configure',
                             makefile = makefile)
    instance.dependencies = dependencies
    instance.after = after
    instance.suggests = suggests
    instance.systemdependencies = systemdependencies
    instance.pkg_config = find_first_child_node_content(node, 'pkg-config')
    instance.config = config

    return instance