Exemplo n.º 1
0
    def add_package(self,
                    name,
                    package_name,
                    package_version="r1",
                    build_depends=None,
                    run_depends=None,
                    test_depends=None):
        toolchain = qitoolchain.get_toolchain(name)
        package_path = self.tmp.mkdir(package_name)
        package = qitoolchain.qipackage.QiPackage(package_name,
                                                  package_version)
        package.path = package_path.strpath
        package.build_depends = build_depends
        package.run_depends = run_depends
        package.test_depends = test_depends
        package_xml = self.tmp.join(package_name, "package.xml")
        xml_elem = qisys.qixml.etree.Element("package")
        xml_elem.set("name", package_name)
        if package_version:
            xml_elem.set("version", package_version)
        qibuild.deps.dump_deps_to_xml(package, xml_elem)
        qisys.qixml.write(xml_elem, package_xml.strpath)

        toolchain.add_package(package)
        return package
Exemplo n.º 2
0
 def add_package(self, name, package_name, package_version="r1"):
     toolchain = qitoolchain.get_toolchain(name)
     package_path = self.tmp.mkdir(package_name)
     package = qitoolchain.qipackage.QiPackage(package_name, package_version)
     package.path = package_path.strpath
     toolchain.add_package(package)
     return package
Exemplo n.º 3
0
def test_sysroot(tmpdir):
    ctc_package = qitoolchain.qipackage.QiPackage("ctc")
    ctc_package.sysroot = "sysroot"
    ctc_package.cross_gdb = "cross-gdb"
    toolchain = qitoolchain.toolchain.Toolchain("test")
    toolchain.add_package(ctc_package)
    assert toolchain.get_sysroot() == "sysroot"
    assert toolchain.get_cross_gdb() == "cross-gdb"
Exemplo n.º 4
0
 def add_package(self, name, package_name, package_version="r1"):
     toolchain = qitoolchain.get_toolchain(name)
     package_path = self.tmp.mkdir(package_name)
     package = qitoolchain.qipackage.QiPackage(package_name,
                                               package_version)
     package.path = package_path.strpath
     toolchain.add_package(package)
     return package
Exemplo n.º 5
0
def test_sysroot(tmpdir):
    ctc_package = qitoolchain.qipackage.QiPackage("ctc")
    ctc_package.sysroot = "sysroot"
    ctc_package.cross_gdb = "cross-gdb"
    ctc_package.path = tmpdir.strpath
    toolchain = qitoolchain.toolchain.Toolchain("test")
    toolchain.add_package(ctc_package)
    path = toolchain.get_package("ctc").path
    assert toolchain.get_sysroot() == os.path.join(path, "sysroot")
    assert toolchain.get_cross_gdb() == os.path.join(path, "cross-gdb")
Exemplo n.º 6
0
def test_sysroot(tmpdir):
    ctc_package = qitoolchain.qipackage.QiPackage("ctc")
    ctc_package.sysroot = "sysroot"
    ctc_package.cross_gdb = "cross-gdb"
    ctc_package.path = tmpdir.strpath
    toolchain = qitoolchain.toolchain.Toolchain("test")
    toolchain.add_package(ctc_package)
    path = toolchain.get_package("ctc").path
    assert toolchain.get_sysroot() == os.path.join(path, "sysroot")
    assert toolchain.get_cross_gdb() == os.path.join(path, "cross-gdb")
Exemplo n.º 7
0
    def add_package(self, name, package_name, package_version="r1",
                    build_depends=None, run_depends=None, test_depends=None):
        toolchain = qitoolchain.get_toolchain(name)
        package_path = self.tmp.mkdir(package_name)
        package = qitoolchain.qipackage.QiPackage(package_name, package_version)
        package.path = package_path.strpath
        package.build_depends = build_depends
        package.run_depends = run_depends
        package.test_depends = test_depends
        package_xml = self.tmp.join(package_name, "package.xml")
        xml_elem = qisys.qixml.etree.Element("package")
        xml_elem.set("name", package_name)
        if package_version:
            xml_elem.set("version", package_version)
        qibuild.deps.dump_deps_to_xml(package, xml_elem)
        qisys.qixml.write(xml_elem, package_xml.strpath)

        toolchain.add_package(package)
        return package
Exemplo n.º 8
0
    def add_package(self, name, package_name, package_version="r1",
                    build_depends=None, run_depends=None, test_depends=None,
                    host_depends=None):
        toolchain = qitoolchain.get_toolchain(name)
        package_path = self.tmp.mkdir(package_name)
        package = qitoolchain.qipackage.QiPackage(package_name, package_version)
        package.path = package_path.strpath

        # Make sure self.*_depends are sets
        for dep_type in ["build", "run", "test", "host"]:
            attr_name = "%s_depends" % dep_type
            value = locals()[attr_name]
            if value:
                setattr(package, attr_name, set(value))
            else:
                setattr(package, attr_name, set())

        package.write_package_xml()
        toolchain.add_package(package)
        return package
Exemplo n.º 9
0
 def add_package(self, name, package_name):
     toolchain = qitoolchain.get_toolchain(name)
     package_path = self.tmp.mkdir(package_name)
     package = qitoolchain.Package(package_name, package_path.strpath)
     toolchain.add_package(package)
     return package