#! /usr/bin/python # -*- Mode: Python -*- # vi:si:et:sw=4:sts=4:ts=4 # GStreamer specific classes to help write config files from twisted.python import log from buildbot.process import step, factory from buildbot.fluendo import step as fstep s = factory.s class GstRegister(step.ShellCommand): name = "gst-register" warnOnFailure = 1 description = ["running", "gst-register"] descriptionDone = ["gst-register"] command = ["gst-register"] def __init__(self, prefix=None, uninstalledBase=None, **kwargs): command = self.command if prefix: command = ["%s/bin/gst-register" % prefix] if uninstalledBase: command = ["%s/gstreamer/tools/gst-register" % uninstalledBase] kwargs['command'] = command step.ShellCommand.__init__(self, **kwargs) class StepsFactory: def __init__(self, branch="HEAD", prefix=None): self.cvsroot = ":pserver:anonymous@freedesktop.org:/cvs/gstreamer" self.prefix = prefix self.branch = branch def get_steps(self, module, type="full", prefix=None): from buildbot.process import step from buildbot.fluendo import step as fstep from buildbot.process.factory import s steps = [] if not prefix: prefix = self.prefix pkg_config_path = "%s/lib/pkgconfig" % prefix # FIXME: depending on full/installed or quick/uninstalled, set PATH # FIXME: figure out how to ---add--- to env var and use $PATH path = "%s/bin:$PATH" % prefix #env = { 'PKG_CONFIG_PATH': pkg_config_path, 'PATH': path } env = { 'PKG_CONFIG_PATH': pkg_config_path } # uninstall, source, incmake if type == "full": steps.append(s(fstep.Make, target="uninstall")) source = s(step.CVS, cvsroot=self.cvsroot, cvsmodule=module, login="", branch=self.branch, mode="update") steps.append(source) steps.append(s(fstep.IncMake, env=env)) # conditional autogen options = [] if prefix: options.append("--prefix=%s" % prefix) if module == "gstreamer": options.append("--disable-plugin-builddir") if type == "options": options.append("--disable-gst-debug") #options.append("--disable-loadsave") #options.append("--disable-parse") #options.append("--disable-trace") #options.append("--disable-alloc-trace") #options.append("--disable-registry") steps.append(s(fstep.AutogenAfterIncMake, options=options, env=env)) steps.append(s(fstep.CompileAfterIncMake)) steps.append(s(fstep.Make, target="check", haltOnFailure=1)) if type == "full": steps.append(s(fstep.Make, target="distcheck", env=env, haltOnFailure=1)) steps.append(s(fstep.Make, target="install", warnOnFailure=1)) steps.append(s(GstRegister, prefix=self.prefix)) return steps