Ejemplo n.º 1
0
 def _setup_base_tools(self, base):
     if base in ("core", "core16", "core18"):
         self.stage_packages.extend(
             ["python3-pip", "python3-wheel", "python3-setuptools"])
         self.build_packages.append("intltool")
     else:
         raise errors.PluginBaseError(part_name=self.name, base=base)
Ejemplo n.º 2
0
 def _setup_base_tools(self, go_channel: str, base: Optional[str]) -> None:
     if go_channel:
         self.build_snaps.append("go/{}".format(go_channel))
     elif base in ("core", "core16", "core18"):
         self.build_packages.append("golang-go")
     else:
         raise errors.PluginBaseError(part_name=self.name, base=base)
Ejemplo n.º 3
0
    def __init__(self, name, options, project) -> None:
        super().__init__(name, options, project)
        if project._get_build_base() not in ("core", "core16", "core18"):
            raise errors.PluginBaseError(
                part_name=self.name, base=project._get_build_base()
            )

        self._conda_home = os.path.join(self.partdir, "miniconda")
        self._miniconda_script = os.path.join(self.partdir, "miniconda.sh")
Ejemplo n.º 4
0
 def _setup_base_tools(self, base):
     if base in ("core", "core16", "core18"):
         self.build_packages.append("python3-pip")
         self.build_packages.append("python3-setuptools")
         self.build_packages.append("python3-wheel")
         self.build_packages.append("ninja-build")
     else:
         raise errors.PluginBaseError(part_name=self.name, base=base)
     if base == "core18":
         self.build_packages.append("python3-distutils")
Ejemplo n.º 5
0
    def __init__(self, name, options, project):
        super().__init__(name, options, project)

        if project._get_build_base() not in ("core", "core16", "core18"):
            raise errors.PluginBaseError(part_name=self.name,
                                         base=project._get_build_base())

        self.build_packages.extend(["bc", "gcc", "make"])

        self.make_targets = []
        self.make_install_targets = ["install"]
        self.make_cmd = ["make", "-j{}".format(self.parallel_build_count)]
        if logger.isEnabledFor(logging.DEBUG):
            self.make_cmd.append("V=1")
Ejemplo n.º 6
0
    def __init__(self, name, options, project):
        super().__init__(name, options, project)

        if project._get_build_base() not in ("core", "core16", "core18"):
            raise errors.PluginBaseError(part_name=self.name,
                                         base=project._get_build_base())

        self.build_packages.append("make")
        if self.options.qt_version == "qt5":
            self.build_packages.extend(["qt5-qmake", "qtbase5-dev"])
        elif self.options.qt_version == "qt4":
            self.build_packages.extend(["qt4-qmake", "libqt4-dev"])
        else:
            raise RuntimeError("Unsupported Qt version: {!r}".format(
                self.options.qt_version))
Ejemplo n.º 7
0
    def __init__(self, name, options, project):
        super().__init__(name, options, project)

        base = self.project._get_build_base()
        if base not in ("core", "core16", "core18"):
            raise errors.PluginBaseError(part_name=self.name, base=base)

        self._rosdistro = _BASE_TO_ROS_RELEASE_MAP[base]

        self.build_packages.extend(
            ["gcc", "g++", "libc6-dev", "make", "python-pip"])
        self.__pip = None

        # roslib is the base requiremet to actually create a workspace with
        # setup.sh and the necessary hooks.
        self.stage_packages.append("ros-{}-roslib".format(self._rosdistro))

        # Get a unique set of packages
        self.catkin_packages = None
        if options.catkin_packages is not None:
            self.catkin_packages = set(options.catkin_packages)
        self.stage_packages_path = pathlib.Path(
            self.partdir) / "catkin_stage_packages"
        self._rosdep_path = os.path.join(self.partdir, "rosdep")
        self._catkin_path = os.path.join(self.partdir, "catkin")
        self._wstool_path = os.path.join(self.partdir, "wstool")

        # The path created via the `source` key (or a combination of `source`
        # and `source-subdir` keys) needs to point to a valid Catkin workspace
        # containing another subdirectory called the "source space." By
        # default, this is a directory named "src," but it can be remapped via
        # the `source-space` key. It's important that the source space is not
        # the root of the Catkin workspace, since Catkin won't work that way
        # and it'll create a circular link that causes rosdep to hang.
        if self.options.source_subdir:
            self._ros_package_path = os.path.join(self.sourcedir,
                                                  self.options.source_subdir,
                                                  self.options.source_space)
        else:
            self._ros_package_path = os.path.join(self.sourcedir,
                                                  self.options.source_space)

        if os.path.abspath(self.sourcedir) == os.path.abspath(
                self._ros_package_path):
            raise CatkinWorkspaceIsRootError()
Ejemplo n.º 8
0
 def _setup_base_tools(self, base):
     extra_packages = [
         "libcurl3",
         "libcurl3-gnutls",
         "liblttng-ust0",
         "libunwind8",
         "lldb",
         "libssl1.0.0",
         "libgssapi-krb5-2",
         "zlib1g",
         "libgcc1",
     ]
     if base in ("core", "core16"):
         self.stage_packages += extra_packages + ["libicu55"]
     elif base in ("core18", ):
         self.stage_packages += extra_packages + ["libicu60"]
     else:
         raise errors.PluginBaseError(part_name=self.name, base=base)
Ejemplo n.º 9
0
    def __init__(self, name, options, project):
        super().__init__(name, options, project)

        if project._get_build_base() not in ("core", "core16", "core18"):
            raise errors.PluginBaseError(part_name=self.name,
                                         base=project._get_build_base())

        self.build_snaps.append("crystal/{}".format(
            self.options.crystal_channel))
        self.build_packages.extend([
            "gcc",
            "pkg-config",
            "libpcre3-dev",
            "libevent-dev",
            "libyaml-dev",
            "libgmp-dev",
            "libxml2-dev",
        ])
Ejemplo n.º 10
0
 def _setup_base_tools(self, base):
     # NOTE: stage-packages are lazily loaded.
     if base in ("core", "core16", "core18"):
         if self.options.python_version == "python3":
             self.build_packages.extend([
                 "python3-dev",
                 "python3-pip",
                 "python3-pkg-resources",
                 "python3-setuptools",
             ])
         elif self.options.python_version == "python2":
             self.build_packages.extend([
                 "python-dev",
                 "python-pip",
                 "python-pkg-resources",
                 "python-setuptools",
             ])
     else:
         raise errors.PluginBaseError(part_name=self.name, base=base)
Ejemplo n.º 11
0
    def _create_symlinks(self):
        if self.project._get_build_base() not in ("core18", "core16", "core"):
            raise errors.PluginBaseError(part_name=self.name,
                                         base=self.project._get_build_base())

        os.makedirs(os.path.join(self.installdir, "bin"), exist_ok=True)
        java_bin = glob(
            os.path.join(
                self.installdir,
                "usr",
                "lib",
                "jvm",
                "java-{}-openjdk-*".format(self._java_version),
                "bin",
                "java",
            ))[0]
        os.symlink(
            os.path.relpath(java_bin, os.path.join(self.installdir, "bin")),
            os.path.join(self.installdir, "bin", "java"),
        )
Ejemplo n.º 12
0
    def __init__(self, name, options, project):
        super().__init__(name, options, project)

        if project._get_build_base() not in ("core", "core16", "core18"):
            raise errors.PluginBaseError(part_name=self.name,
                                         base=project._get_build_base())

        self.build_packages.extend(["gcc", "git", "curl", "file"])
        self._rustup_dir = os.path.expanduser(os.path.join("~", ".rustup"))
        self._cargo_dir = os.path.expanduser(os.path.join("~", ".cargo"))
        self._rustup_cmd = os.path.join(self._cargo_dir, "bin", "rustup")
        self._cargo_cmd = os.path.join(self._cargo_dir, "bin", "cargo")
        self._rustc_cmd = os.path.join(self._cargo_dir, "bin", "rustc")
        self._rustdoc_cmd = os.path.join(self._cargo_dir, "bin", "rustdoc")

        self._manifest = collections.OrderedDict()

        if self.options.source_subdir:
            self.source_path = Path(self.sourcedir, self.options.source_subdir)
        else:
            self.source_path = Path(self.sourcedir)
Ejemplo n.º 13
0
    def _setup_base_tools(self, base):
        if base not in ("core", "core16", "core18"):
            raise errors.PluginBaseError(part_name=self.name,
                                         base=self.project._get_build_base())

        if base in ("core", "core16"):
            valid_versions = ["8", "9"]
        elif base == "core18":
            valid_versions = ["8", "11"]

        version = self.options.ant_openjdk_version
        if not version:
            version = valid_versions[-1]
        elif version not in valid_versions:
            raise UnsupportedJDKVersionError(version=version,
                                             base=base,
                                             valid_versions=valid_versions)

        self.stage_packages.append("openjdk-{}-jre-headless".format(version))
        self.build_packages.append("openjdk-{}-jdk-headless".format(version))
        self._java_version = version
Ejemplo n.º 14
0
    def __init__(self, name, options, project):
        super().__init__(name, options, project)

        if project._get_build_base() not in ("core", "core16", "core18"):
            raise errors.PluginBaseError(part_name=self.name,
                                         base=project._get_build_base())

        # Beta Warning
        # Remove this comment and warning once ruby plugin is stable.
        logger.warning("The ruby plugin is currently in beta, "
                       "its API may break. Use at your own risk")

        self._ruby_version = options.ruby_version
        self._ruby_part_dir = os.path.join(self.partdir, "ruby")
        feature_pattern = re.compile(r"^(\d+\.\d+)\..*$")
        feature_version = feature_pattern.sub(r"\1", self._ruby_version)
        self._ruby_download_url = "https://cache.ruby-lang.org/pub/ruby/{}/ruby-{}.tar.gz".format(
            feature_version, self._ruby_version)
        self._ruby_tar = Tar(self._ruby_download_url, self._ruby_part_dir)
        self._gems = options.gems or []
        self.build_packages.extend([
            "gcc", "g++", "make", "zlib1g-dev", "libssl-dev", "libreadline-dev"
        ])
Ejemplo n.º 15
0
 def _setup_base_tools(self, base):
     if base in ("core", "core16", "core18"):
         self.build_packages.append("scons")
     else:
         raise errors.PluginBaseError(part_name=self.name, base=base)