def do_install(self, buildscript): buildscript.set_action(_("Installing"), self) builddir = self.get_builddir(buildscript) destdir = self.prepare_installroot(buildscript) self.make(buildscript, "install DESTDIR={}".format(destdir)) self.process_install(buildscript, self.get_revision()) do_install.depends = [PHASE_BUILD] def xml_tag_and_attrs(self): return "cmake", [("id", "name", None)] def parse_cmake(node, config, uri, repositories, default_repo): instance = CMakeModule.parse_from_xml(node, config, uri, repositories, default_repo) instance.dependencies += ["cmake", instance.get_makecmd(config)] instance.cmakeargs = collect_args(instance, node, "cmakeargs") instance.makeargs = collect_args(instance, node, "makeargs") if node.hasAttribute("supports-non-srcdir-builds"): instance.supports_non_srcdir_builds = node.getAttribute("supports-non-srcdir-builds") != "no" if node.hasAttribute("force-non-srcdir-builds"): instance.force_non_srcdir_builds = node.getAttribute("force-non-srcdir-builds") != "no" return instance register_module_type("cmake", parse_cmake)
srcdir = self.get_srcdir(buildscript) builddir = self.get_builddir(buildscript) python = os.environ.get('PYTHON', 'python') cmd = [python, 'setup.py', 'sdist'] cmd.extend(['--dist-dir', builddir]) buildscript.execute(cmd, cwd = srcdir, extra_env = self.extra_env) def xml_tag_and_attrs(self): return 'distutils', [('id', 'name', None), ('supports-non-srcdir-builds', 'supports_non_srcdir_builds', True), ('buildargs', 'buildargs', '')] def parse_distutils(node, config, uri, repositories, default_repo): instance = DistutilsModule.parse_from_xml(node, config, uri, repositories, default_repo) if node.hasAttribute('supports-non-srcdir-builds'): instance.supports_non_srcdir_builds = \ (node.getAttribute('supports-non-srcdir-builds') != 'no') if node.hasAttribute('buildargs'): instance.buildargs = node.getAttribute('buildargs') if node.hasAttribute('python3'): instance.python = os.environ.get('PYTHON3', 'python3') return instance register_module_type('distutils', parse_distutils)
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 register_module_type('tarball', parse_tarball)
if buildscript.config.makedistcheck: cmd = [self.waf_cmd, 'distcheck'] else: cmd = [self.waf_cmd, 'dist'] buildscript.execute(cmd, cwd=self.get_builddir(buildscript)) do_dist.depends = [PHASE_BUILD] do_dist.error_phases = [PHASE_FORCE_CHECKOUT, PHASE_CONFIGURE] def do_install(self, buildscript): buildscript.set_action(_('Installing'), self) destdir = self.prepare_installroot(buildscript) cmd = [self.waf_cmd, 'install', '--destdir', destdir] buildscript.execute(cmd, cwd=self.get_builddir(buildscript)) self.process_install(buildscript, self.get_revision()) do_install.depends = [PHASE_BUILD] def xml_tag_and_attrs(self): return 'waf', [('id', 'name', None), ('waf-command', 'waf_cmd', 'waf')] def parse_waf(node, config, uri, repositories, default_repo): instance = WafModule.parse_from_xml(node, config, uri, repositories, default_repo) if node.hasAttribute('waf-command'): instance.waf_cmd = node.getAttribute('waf-command') return instance register_module_type('waf', parse_waf)
if childnode.hasAttribute('config'): path = os.path.join(kconfig.srcdir, childnode.getAttribute('config')) else: path = kconfig.srcdir kconfig = LinuxConfig(version, path, branch) kconfigs.append(kconfig) if not kconfigs: kconfig = LinuxConfig('default', None, None) kconfigs.append(kconfig) return kconfigs def parse_linux(node, config, uri, repositories, default_repo): id = node.getAttribute('id') makeargs = '' if node.hasAttribute('makeargs'): makeargs = node.getAttribute('makeargs') makeargs = makeargs.replace('${prefix}', config.prefix) dependencies, after, suggests = get_dependencies(node) branch = get_branch(node, repositories, default_repo, config) kconfigs = get_kconfigs(node, repositories, default_repo) return LinuxModule(id, branch, dependencies, after, suggests, kconfigs, makeargs) register_module_type('linux', parse_linux)
path = os.path.join(kconfig.srcdir, childnode.getAttribute('config')) else: path = kconfig.srcdir kconfig = LinuxConfig(version, path, branch) kconfigs.append(kconfig) if not kconfigs: kconfig = LinuxConfig('default', None, None) kconfigs.append(kconfig) return kconfigs def parse_linux(node, config, uri, repositories, default_repo): id = node.getAttribute('id') makeargs = '' if node.hasAttribute('makeargs'): makeargs = node.getAttribute('makeargs') makeargs = makeargs.replace('${prefix}', config.prefix) branch = get_branch(node, repositories, default_repo, config) kconfigs = get_kconfigs(node, repositories, default_repo) return LinuxModule(id, branch, kconfigs, makeargs) register_module_type('linux', parse_linux)
kwargs["supports_non_srcdir_builds"] = \ (node.getAttribute('supports-non-srcdir-builds') != 'no') if node.hasAttribute('autogen-sh'): kwargs["autogen_sh"] = node.getAttribute('autogen-sh') if node.hasAttribute('makefile'): kwargs["makefile"] = makefile = node.getAttribute('makefile') if node.hasAttribute('alwaysautogen'): kwargs["alwaysautogen"] = node.getAttribute('alwaysautogen') != 'no' if node.hasAttribute('skipinstall'): kwargs["skipinstall"] = node.getAttribute('skipinstall') != 'no' dependencies, after = get_dependencies(node) branch = get_branch(node, repositories, default_repo) return AutogenModule(id, branch, dependencies, after, **kwargs) register_module_type('autotools', parse_autotools) # deprecated module types below: def parse_cvsmodule(node, config, repositories, default_repo): id = node.getAttribute('id') module = None revision = None checkoutdir = None autogenargs = '' makeargs = '' supports_non_srcdir_builds = True if node.hasAttribute('module'): module = node.getAttribute('module') if node.hasAttribute('revision'): revision = node.getAttribute('revision')
return buildscript.config.nobuild def do_install(self, buildscript): buildscript.set_action('Installing', self) builddir = self.get_builddir(buildscript) make = os.environ.get('MAKE', 'make') buildscript.execute([make, 'install', 'PREFIX=%s' % buildscript.config.prefix], cwd=builddir) buildscript.packagedb.add(self.name, self.get_revision() or '') do_install.next_state = Package.STATE_DONE do_install.error_states = [] def parse_perl(node, config, repositories, default_repo): id = node.getAttribute('id') makeargs = '' if node.hasAttribute('makeargs'): makeargs = node.getAttribute('makeargs') # override revision tag if requested. makeargs += ' ' + config.module_makeargs.get(id, config.makeargs) dependencies, after = get_dependencies(node) branch = get_branch(node, repositories, default_repo) return PerlModule(id, branch, makeargs, dependencies=dependencies, after=after) register_module_type('perl', parse_perl)
'--src', os.path.join(tempdir, 'src'), '--root', destdir] + self.branch.version.split()) buildscript.execute(cmd, cwd=tempdir, extra_env=self.extra_env) self.process_install(buildscript, self.branch.version) shutil.rmtree(tempdir) def xml_tag_and_attrs(self): return 'pip', [ ('id', 'name', None), ('python', 'python', None), ('supports-stripping-debug-symbols', 'supports_stripping_debug_symbols', None), ] def parse_pip(node, config, uri, repositories, default_repo): instance = PipModule.parse_from_xml(node, config, uri, repositories, default_repo) instance.dependencies += ['pip'] # allow to specify python executable separated by space if node.hasAttribute('python'): instance.python = node.getAttribute('python').split() if node.hasAttribute('supports-stripping-debug-symbols'): instance.supports_stripping_debug_symbols = (node.getAttribute('supports-stripping-debug-symbols') != 'no') return instance register_module_type('pip', parse_pip)
else: instance.skip_install_phase = False if node.hasAttribute("uninstall-before-install"): instance.uninstall_before_install = node.getAttribute("uninstall-before-install") == "true" if node.hasAttribute("check-target"): instance.check_target = node.getAttribute("check-target") == "true" if node.hasAttribute("supports-static-analyzer"): instance.supports_static_analyzer = node.getAttribute("supports-static-analyzer") == "true" from jhbuild.versioncontrol.tarball import TarballBranch if node.hasAttribute("autogen-sh"): autogen_sh = node.getAttribute("autogen-sh") if autogen_sh is not None: instance.autogen_sh = autogen_sh elif isinstance(instance.branch, TarballBranch): # in tarballs, force autogen-sh to be configure, unless autogen-sh is # already set instance.autogen_sh = "configure" if node.hasAttribute("makefile"): instance.makefile = node.getAttribute("makefile") if node.hasAttribute("autogen-template"): instance.autogen_template = node.getAttribute("autogen-template") return instance register_module_type("autotools", parse_autotools)
do_build.depends = [PHASE_CHECKOUT] do_build.error_phases = [PHASE_FORCE_CHECKOUT] def do_install(self, buildscript): buildscript.set_action(_("Installing"), self) builddir = self.get_builddir(buildscript) make = os.environ.get("MAKE", "make") buildscript.execute( [make, "install", "PREFIX=%s" % buildscript.config.prefix], cwd=builddir, extra_env=self.extra_env ) buildscript.moduleset.packagedb.add(self.name, self.get_revision() or "", self.get_destdir(buildscript)) do_install.depends = [PHASE_BUILD] def xml_tag_and_attrs(self): return "perl", [("id", "name", None), ("makeargs", "makeargs", "")] def parse_perl(node, config, uri, repositories, default_repo): instance = PerlModule.parse_from_xml(node, config, uri, repositories, default_repo) if node.hasAttribute("makeargs"): makeargs = node.getAttribute("makeargs") instance.makeargs = instance.eval_args(makeargs) return instance register_module_type("perl", parse_perl)
extra_env = (self.extra_env or {}).copy() extra_env['DESTDIR'] = destdir self.ensure_ninja_binary() buildscript.execute(self.ninja_binary + ' install', cwd=builddir, extra_env=extra_env) self.process_install(buildscript, self.get_revision()) do_install.depends = [PHASE_BUILD] def xml_tag_and_attrs(self): return 'meson', [('id', 'name', None), ('skip-install', 'skip_install_phase', False)] def parse_meson(node, config, uri, repositories, default_repo): instance = MesonModule.parse_from_xml(node, config, uri, repositories, default_repo) instance.dependencies += ['meson', instance.get_makecmd(config)] instance.mesonargs = collect_args(instance, node, 'mesonargs') instance.makeargs = collect_args(instance, node, 'makeargs') if node.hasAttribute('skip-install'): skip_install = node.getAttribute('skip-install') if skip_install.lower() in ('true', 'yes'): instance.skip_install_phase = True else: instance.skip_install_phase = False return instance register_module_type('meson', parse_meson)
def collect_args(instance, node, argtype): if node.hasAttribute(argtype): args = node.getAttribute(argtype) else: args = '' for child in node.childNodes: if child.nodeType == child.ELEMENT_NODE and child.nodeName == argtype: if not child.hasAttribute('value'): raise FatalError( _("<%s/> tag must contain value=''") % argtype) args += ' ' + child.getAttribute('value') return instance.eval_args(args) def parse_makesys(node, config, uri, repositories, default_repo): instance = MakesysModule.parse_from_xml(node, config, uri, repositories, default_repo) if node.hasAttribute("preset"): instance.preset = node.getAttribute('preset') instance.makeargs = collect_args(instance, node, 'makeargs') instance.makeinstallargs = collect_args(instance, node, 'makeinstallargs') return instance register_module_type('makesys', parse_makesys)
def do_install(self, buildscript): # Quoting David Schleef: # "It's not clear to me how to install a typical # ant-based project, so I left that out." # -- http://bugzilla.gnome.org/show_bug.cgi?id=537037 buildscript.set_action(_('Installing'), self) buildscript.packagedb.add(self.name, self.get_revision() or '') do_install.depends = [PHASE_BUILD] def xml_tag_and_attrs(self): return 'ant', [('id', 'name', None), ('supports-non-srcdir-builds', 'supports_non_srcdir_builds', False)] def parse_ant(node, config, uri, repositories, default_repo): id = node.getAttribute('id') supports_non_srcdir_builds = False if node.hasAttribute('supports-non-srcdir-builds'): supports_non_srcdir_builds = \ (node.getAttribute('supports-non-srcdir-builds') != 'no') dependencies, after, suggests = get_dependencies(node) branch = get_branch(node, repositories, default_repo) return AntModule(id, branch, dependencies=dependencies, after=after, supports_non_srcdir_builds=supports_non_srcdir_builds) register_module_type('ant', parse_ant)
cmd = [python, 'setup.py'] if srcdir != builddir: cmd.extend(['build', '--build-base', builddir]) cmd.extend(['install', '--prefix', buildscript.config.prefix]) buildscript.execute(cmd, cwd = srcdir, extra_env = self.extra_env) buildscript.packagedb.add(self.name, self.get_revision() or '') do_install.depends = [PHASE_BUILD] def xml_tag_and_attrs(self): return 'distutils', [('id', 'name', None), ('supports-non-srcdir-builds', 'supports_non_srcdir_builds', True)] def parse_distutils(node, config, uri, repositories, default_repo): id = node.getAttribute('id') supports_non_srcdir_builds = True if node.hasAttribute('supports-non-srcdir-builds'): supports_non_srcdir_builds = \ (node.getAttribute('supports-non-srcdir-builds') != 'no') dependencies, after, suggests = get_dependencies(node) branch = get_branch(node, repositories, default_repo, config) return DistutilsModule(id, branch, dependencies = dependencies, after = after, suggests = suggests, supports_non_srcdir_builds = supports_non_srcdir_builds) register_module_type('distutils', parse_distutils)
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 register_module_type('tarball', parse_tarball)
self.process_install(buildscript, self.branch.version) shutil.rmtree(tempdir) def xml_tag_and_attrs(self): return 'pip', [ ('id', 'name', None), ('python', 'python', None), ('supports-stripping-debug-symbols', 'supports_stripping_debug_symbols', None), ] def parse_pip(node, config, uri, repositories, default_repo): instance = PipModule.parse_from_xml(node, config, uri, repositories, default_repo) instance.dependencies += ['pip'] # allow to specify python executable separated by space if node.hasAttribute('python'): instance.python = node.getAttribute('python').split() if node.hasAttribute('supports-stripping-debug-symbols'): instance.supports_stripping_debug_symbols = ( node.getAttribute('supports-stripping-debug-symbols') != 'no') return instance register_module_type('pip', parse_pip)
patchstrip = int(patch.getAttribute("strip")) else: patchstrip = 0 patches.append((patchfile, patchstrip)) autogenargs += " " + config.module_autogenargs.get(name, config.autogenargs) makeargs += " " + config.module_makeargs.get(name, config.makeargs) # for tarballs, don't ever pass --enable-maintainer-mode autogenargs = autogenargs.replace("--enable-maintainer-mode", "") dependencies, after = get_dependencies(node) return Tarball( name, version, source_url, source_size, source_md5, patches, checkoutdir, autogenargs, makeargs, dependencies, after, supports_non_srcdir_builds=supports_non_srcdir_builds, ) register_module_type("tarball", parse_tarball)
# along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA __metaclass__ = type from jhbuild.modtypes import Package, register_module_type __all__ = ['SystemModule'] class SystemModule(Package): @classmethod def create_virtual(cls, name, branch, deptype, value): return cls(name, branch=branch, systemdependencies=[(deptype, value, [])]) def parse_systemmodule(node, config, uri, repositories, default_repo): instance = SystemModule.parse_from_xml(node, config, uri, repositories, default_repo) if any(deptype == 'xml' for deptype, value, altdeps in instance.systemdependencies): instance.dependencies += ['xmlcatalog'] return instance register_module_type('systemmodule', parse_systemmodule)
for x in glob.glob(builddir + '/lib/*_dri.so'): buildscript.execute(['cp', x, prefix + '/lib/dri'], cwd=builddir) for x in glob.glob(builddir + '/include/GL/*.h'): buildscript.execute(['cp', x, prefix + '/include/GL'], cwd=builddir) buildscript.packagedb.add(self.name, self.get_revision() or '') do_install.next_state = Package.STATE_DONE do_install.error_states = [] def parse_mesa(node, config, repositories, default_repo): id = node.getAttribute('id') makeargs = '' if node.hasAttribute('makeargs'): makeargs = node.getAttribute('makeargs') # override revision tag if requested. makeargs += ' ' + config.module_makeargs.get(id, config.makeargs) dependencies, after = get_dependencies(node) branch = get_branch(node, repositories, default_repo) return MesaModule(id, branch, makeargs, dependencies=dependencies, after=after) register_module_type('mesa', parse_mesa)
if skip_install.lower() in ('true', 'yes'): instance.skip_install_phase = True else: instance.skip_install_phase = False if node.hasAttribute('uninstall-before-install'): instance.uninstall_before_install = (node.getAttribute('uninstall-before-install') == 'true') if node.hasAttribute('check-target'): instance.check_target = (node.getAttribute('check-target') == 'true') if node.hasAttribute('static-analyzer'): instance.supports_static_analyzer = (node.getAttribute('static-analyzer') == 'true') from jhbuild.versioncontrol.tarball import TarballBranch if node.hasAttribute('autogen-sh'): autogen_sh = node.getAttribute('autogen-sh') if autogen_sh is not None: instance.autogen_sh = autogen_sh elif isinstance(instance.branch, TarballBranch): # in tarballs, force autogen-sh to be configure, unless autogen-sh is # already set instance.autogen_sh = 'configure' if node.hasAttribute('makefile'): instance.makefile = node.getAttribute('makefile') if node.hasAttribute('autogen-template'): instance.autogen_template = node.getAttribute('autogen-template') return instance register_module_type('autotools', parse_autotools)
# but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA __metaclass__ = type from jhbuild.modtypes import Package, register_module_type __all__ = [ 'SystemModule' ] class SystemModule(Package): @classmethod def create_virtual(cls, name, branch, deptype, value): return cls(name, branch=branch, systemdependencies=[(deptype, value, [])]) def parse_systemmodule(node, config, uri, repositories, default_repo): instance = SystemModule.parse_from_xml(node, config, uri, repositories, default_repo) if any(deptype == 'xml' for deptype, value, altdeps in instance.systemdependencies): instance.dependencies += ['xmlcatalog'] return instance register_module_type('systemmodule', parse_systemmodule)
instance.skip_install_phase = False if node.hasAttribute('uninstall-before-install'): instance.uninstall_before_install = ( node.getAttribute('uninstall-before-install') == 'true') if node.hasAttribute('check-target'): instance.check_target = (node.getAttribute('check-target') == 'true') if node.hasAttribute('supports-static-analyzer'): instance.supports_static_analyzer = ( node.getAttribute('supports-static-analyzer') == 'true') from jhbuild.versioncontrol.tarball import TarballBranch if node.hasAttribute('autogen-sh'): autogen_sh = node.getAttribute('autogen-sh') if autogen_sh is not None: instance.autogen_sh = autogen_sh elif isinstance(instance.branch, TarballBranch): # in tarballs, force autogen-sh to be configure, unless autogen-sh is # already set instance.autogen_sh = 'configure' if node.hasAttribute('makefile'): instance.makefile = node.getAttribute('makefile') if node.hasAttribute('autogen-template'): instance.autogen_template = node.getAttribute('autogen-template') return instance register_module_type('autotools', parse_autotools)
patchfile = patch.getAttribute('file') if patch.hasAttribute('strip'): patchstrip = int(patch.getAttribute('strip')) else: patchstrip = 0 patches.append((patchfile, patchstrip)) elif childnode.nodeName == 'configure': for cmd in childnode.childNodes: if cmd.nodeType != cmd.ELEMENT_NODE: continue if cmd.nodeName == 'cmd': configure_commands.append(parse_command(cmd)) elif childnode.nodeName == 'build': for cmd in childnode.childNodes: if cmd.nodeType != cmd.ELEMENT_NODE: continue if cmd.nodeName == 'cmd': build_commands.append(parse_command(cmd)) elif childnode.nodeName == 'install': for cmd in childnode.childNodes: if cmd.nodeType != cmd.ELEMENT_NODE: continue if cmd.nodeName == 'cmd': install_commands.append(parse_command(cmd)) dependencies, after, suggests = get_dependencies(node) return Binary(config, name, version, source_url, source_size, source_md5, uri, patches, configure_commands, build_commands, install_commands, dependencies, after, suggests) register_module_type('binary', parse_binary)
patchfile = patch.getAttribute('file') if patch.hasAttribute('strip'): patchstrip = int(patch.getAttribute('strip')) else: patchstrip = 0 patches.append((patchfile, patchstrip)) elif childnode.nodeName == 'configure': for cmd in childnode.childNodes: if cmd.nodeType != cmd.ELEMENT_NODE: continue if cmd.nodeName == 'cmd': configure_commands.append( parse_command(cmd) ) elif childnode.nodeName == 'build': for cmd in childnode.childNodes: if cmd.nodeType != cmd.ELEMENT_NODE: continue if cmd.nodeName == 'cmd': build_commands.append( parse_command(cmd) ) elif childnode.nodeName == 'install': for cmd in childnode.childNodes: if cmd.nodeType != cmd.ELEMENT_NODE: continue if cmd.nodeName == 'cmd': install_commands.append( parse_command(cmd) ) dependencies, after, suggests = get_dependencies(node) return Binary(config, name, version, source_url, source_size, source_md5, uri, patches, configure_commands, build_commands, install_commands, dependencies, after, suggests) register_module_type('binary', parse_binary)
buildscript.set_action(_('Installing'), self) builddir = self.get_builddir(buildscript) make = os.environ.get('MAKE', 'make') buildscript.execute( [make, 'install', 'PREFIX=%s' % buildscript.config.prefix], cwd=builddir, extra_env=self.extra_env) buildscript.moduleset.packagedb.add(self.name, self.get_revision() or '', self.get_destdir(buildscript)) do_install.depends = [PHASE_BUILD] def xml_tag_and_attrs(self): return 'perl', [('id', 'name', None), ('makeargs', 'makeargs', '')] def parse_perl(node, config, uri, repositories, default_repo): instance = PerlModule.parse_from_xml(node, config, uri, repositories, default_repo) if node.hasAttribute('makeargs'): makeargs = node.getAttribute('makeargs') instance.makeargs = instance.eval_args(makeargs) return instance register_module_type('perl', parse_perl)
def parse_cmake(node, config, uri, repositories, default_repo): instance = CMakeModule.parse_from_xml(node, config, uri, repositories, default_repo) instance.dependencies += ['cmake', instance.get_makecmd(config)] instance.cmakeargs = collect_args(instance, node, 'cmakeargs') instance.makeargs = collect_args(instance, node, 'makeargs') if node.hasAttribute('skip-install'): skip_install = node.getAttribute('skip-install') if skip_install.lower() in ('true', 'yes'): instance.skip_install_phase = True else: instance.skip_install_phase = False if node.hasAttribute('supports-non-srcdir-builds'): instance.supports_non_srcdir_builds = \ (node.getAttribute('supports-non-srcdir-builds') != 'no') if node.hasAttribute('force-non-srcdir-builds'): instance.force_non_srcdir_builds = \ (node.getAttribute('force-non-srcdir-builds') != 'no') if node.hasAttribute('use-ninja'): use_ninja = node.getAttribute('use-ninja') if use_ninja.lower() in ('false', 'no'): instance.use_ninja = False return instance register_module_type('cmake', parse_cmake)
projects = node.getAttribute("projects") revision = None autogenargs = "" makeargs = "" dependencies = [] if node.hasAttribute("revision"): revision = node.getAttribute("revision") if node.hasAttribute("autogenargs"): autogenargs = node.getAttribute("autogenargs") if node.hasAttribute("makeargs"): makeargs = node.getAttribute("makeargs") # override revision tag if requested. revision = config.branches.get(name, revision) autogenargs += " " + config.module_autogenargs.get(name, config.autogenargs) makeargs += " " + config.module_makeargs.get(name, config.makeargs) dependencies, after = get_dependencies(node) for attrname in ["cvsroot", "root"]: if node.hasAttribute(attrname): repo = repositories[node.getAttribute(attrname)] break else: repo = repositories.get(default_repo, None) return MozillaModule(name, projects, revision, autogenargs, makeargs, dependencies, after, repo) register_module_type("mozillamodule", parse_mozillamodule)
def parse_scons(node, config, uri, repositories, default_repo): id = node.getAttribute('id') sconsargs = '' supports_non_srcdir_builds = True if node.hasAttribute('sconsargs'): autogenargs = node.getAttribute('sconsargs') if node.hasAttribute('supports-non-srcdir-builds'): supports_non_srcdir_builds = \ (node.getAttribute('supports-non-srcdir-builds') != 'no') # Make some substitutions; do special handling of '${prefix}' and '${libdir}' p = re.compile('(\${prefix})') sconsargs = p.sub(config.prefix, sconsargs) # I'm not sure the replacement of ${libdir} is necessary for firefox... p = re.compile('(\${libdir})') libsubdir = '/lib' if config.use_lib64: libsubdir = '/lib64' sconsargs = p.sub(config.prefix + libsubdir, autogenargs) dependencies, after, suggests = get_dependencies(node) branch = get_branch(node, repositories, default_repo, config) return SconsModule(id, branch, sconsargs=sconsargs, dependencies=dependencies, after=after, suggests=suggests, supports_non_srcdir_builds=supports_non_srcdir_builds) register_module_type('scons', parse_scons)
buildscript.set_action(_('Installing'), self) builddir = self.get_builddir(buildscript) destdir = self.prepare_installroot(buildscript) self.make(buildscript, 'install DESTDIR={}'.format(destdir)) self.process_install(buildscript, self.get_revision()) do_install.depends = [PHASE_BUILD] def xml_tag_and_attrs(self): return 'cmake', [('id', 'name', None)] def parse_cmake(node, config, uri, repositories, default_repo): instance = CMakeModule.parse_from_xml(node, config, uri, repositories, default_repo) instance.dependencies += ['cmake', instance.get_makecmd(config)] if node.hasAttribute('supports-non-srcdir-builds'): instance.supports_non_srcdir_builds = \ (node.getAttribute('supports-non-srcdir-builds') != 'no') if node.hasAttribute('force-non-srcdir-builds'): instance.force_non_srcdir_builds = \ (node.getAttribute('force-non-srcdir-builds') != 'no') if node.hasAttribute('cmakeargs'): instance.cmakeargs = node.getAttribute('cmakeargs') if node.hasAttribute('makeargs'): instance.makeargs = node.getAttribute('makeargs') return instance register_module_type('cmake', parse_cmake)
do_clean.depends = [PHASE_CONFIGURE] do_clean.error_phases = [PHASE_FORCE_CHECKOUT, PHASE_CONFIGURE] def do_build(self, buildscript): buildscript.set_action(_('Building'), self) self.make(buildscript) do_build.depends = [PHASE_CONFIGURE] do_build.error_phases = [PHASE_FORCE_CHECKOUT] def do_install(self, buildscript): buildscript.set_action(_('Installing'), self) self.make(buildscript, 'install') self.process_install(buildscript, self.get_revision()) do_install.depends = [PHASE_BUILD] def xml_tag_and_attrs(self): return 'qmake', [('id', 'name', None)] def parse_qmake(node, config, uri, repositories, default_repo): instance = QMakeModule.parse_from_xml(node, config, uri, repositories, default_repo) instance.dependencies += ['qmake', instance.get_makecmd(config)] if node.hasAttribute('qmakeargs'): instance.qmakeargs = node.getAttribute('qmakeargs') if node.hasAttribute('makeargs'): instance.makeargs = node.getAttribute('makeargs') return instance register_module_type('qmake', parse_qmake)
cwd=src_dir, extra_env=extra_env) except CommandError as e: if e.returncode != 0: raise BuildStateError('%s failed' % test_case) def xml_tag_and_attrs(self): return 'testmodule', [('id', 'name', None), ('type', 'test_type', None)] def get_tested_packages(node): tested_pkgs = [] for tested_module in node.getElementsByTagName('testedmodules'): for mod in tested_module.getElementsByTagName('tested'): tested_pkgs.append(mod.getAttribute('package')) return tested_pkgs def parse_testmodule(node, config, uri, repositories, default_repo): instance = TestModule.parse_from_xml(node, config, uri, repositories, default_repo) test_type = node.getAttribute('type') if test_type not in __test_types__: # FIXME: create an error here pass instance.test_type = test_type instance.tested_pkgs = get_tested_packages(node) return instance register_module_type('testmodule', parse_testmodule)
self.process_install(buildscript, self.get_revision()) do_install.depends = [PHASE_BUILD] do_install.error_phases = [PHASE_FORCE_CHECKOUT] def get_srcdir(self, buildscript): """ source file folder """ return self.branch.srcdir def get_builddir(self, buildscript): return os.path.join(buildscript.config.buildroot, self.name) def xml_tag_and_attrs(self): return 'node', [ ('id', 'name', None), ('nodescript', 'nodescript', None), ] def parse_node(node, config, uri, repositories, default_repo): instance = NodeModule.parse_from_xml(node, config, uri, repositories, default_repo) instance.dependencies += ['node'] # add node to the dep if node.hasAttribute('nodescript'): instance.nodescript = node.getAttribute('nodescript') return instance register_module_type('node', parse_node)