Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial OpenEmbedded support for rosdep #673

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion doc/rosdep_yaml_format.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ rosdep supports both a *simple* and *versioned* syntax.
The names above resolve as follows:

* ``ROSDEP_NAME`` is the name referred to by manifest files. Examples: ``log4cxx`` or ``gtest``.
* ``OS_NAME`` is the name of an OS. Examples: ``ubuntu``, ``osx``, ``fedora``, ``debian``, or ``windows``.
* ``OS_NAME`` is the name of an OS. Examples: ``ubuntu``, ``osx``, ``fedora``, ``debian``, ``openembedded``, or ``windows``.
* ``OS_VERSION`` (*optional*) is the name of specific versions in the OS. Examples: ``lucid`` or ``squeeze``. If no ``OS_VERSION`` is specified, the rule is assumed to apply to all versions.
* ``PACKAGE_MANAGER`` (*optional in ROS Electric, required in ROS Fuerte*) is a key to select which package manager to use for this rosdep. Examples: ``apt``, ``pip``, ``macports``.
* ``PACKAGE_ARGUMENT`` is free-form YAML that is be passed to the handler for the specified ``PACKAGE_MANAGER``.
Expand Down Expand Up @@ -100,6 +100,10 @@ OS name identifiers and supported package managers
* ``portage`` (default)
* ``source``

* ``openembedded`` : OpenEmbedded

* TODO: define a remote installation method for cross compiled packages

* ``osx`` : Apple OS X

* TODO: special notes on macports vs. homebrew
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
version=__version__, # noqa:F821
packages=['rosdep2', 'rosdep2.platforms'],
package_dir={'': 'src'},
install_requires=['catkin_pkg >= 0.4.0', 'rospkg >= 1.0.37', 'rosdistro >= 0.7.0', 'PyYAML >= 3.1'],
install_requires=['catkin_pkg >= 0.4.0', 'rospkg >= 1.1.8', 'rosdistro >= 0.7.0', 'PyYAML >= 3.1'],
test_suite='nose.collector',
test_requires=['mock', 'nose >= 1.0'],
scripts=['scripts/rosdep', 'scripts/rosdep-source'],
Expand Down
3 changes: 2 additions & 1 deletion src/rosdep2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def create_default_installer_context(verbose=False):
from .platforms import arch
from .platforms import cygwin
from .platforms import debian
from .platforms import openembedded
from .platforms import gentoo
from .platforms import opensuse
from .platforms import osx
Expand All @@ -69,7 +70,7 @@ def create_default_installer_context(verbose=False):
from .platforms import slackware
from .platforms import source

platform_mods = [alpine, arch, cygwin, debian, gentoo, opensuse, osx, redhat, slackware, freebsd]
platform_mods = [alpine, arch, cygwin, debian, gentoo, openembedded, opensuse, osx, redhat, slackware, freebsd]
installer_mods = [source, pip, gem] + platform_mods

context = InstallerContext()
Expand Down
77 changes: 77 additions & 0 deletions src/rosdep2/platforms/openembedded.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Copyright (c) 2019, LG Electronics, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the Willow Garage, Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

# Author Andre Rosa/[email protected]

import subprocess
from rospkg.os_detect import OS_OPENEMBEDDED, OsDetect
from ..installers import PackageManagerInstaller
OPKG_INSTALLER = 'opkg'


def register_installers(context):
context.set_installer(OPKG_INSTALLER, OpkgInstaller())


def register_platforms(context):
register_oe(context)


def register_oe(context):
context.add_os_installer_key(OS_OPENEMBEDDED, OPKG_INSTALLER)
context.set_default_os_installer_key(OS_OPENEMBEDDED, lambda self: OPKG_INSTALLER)
context.set_os_version_type(OS_OPENEMBEDDED, OsDetect.get_codename)


def opkg_detect(pkgs, exec_fn=None):
"""
Given a list of package, return the list of installed packages.
NOTE: These are stubs currently and will be filled after semantics are fully defined.

:param pkgs: list of package names, optionally followed by a fixed version (`foo=3.0`)
:param exec_fn: function to execute Popen and read stdout (for testing)
:return: list elements in *pkgs* that were found installed on the system
"""
raise NotImplementedError("opkg_detect is not implemented yet")


class OpkgInstaller(PackageManagerInstaller):
"""
An implementation of the Installer for use on oe systems.
NOTE: These are stubs currently and will be filled after semantics are fully defined.
"""

def __init__(self):
super(OpkgInstaller, self).__init__(opkg_detect)

def get_version_strings(self):
output = subprocess.check_output(['opkg', '--version'])
version = output.splitlines()[0].split(' ')[2]
return [('opkg {}').format(version)]

def get_install_command(self, resolved, interactive=True, reinstall=False, quiet=False):
raise NotImplementedError('get_install_command is not implemented yet')
4 changes: 2 additions & 2 deletions stdeb.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[DEFAULT]
Depends: ca-certificates, python-rospkg (>= 1.0.37), python-yaml, python-catkin-pkg (>= 0.4.0), python-rosdistro (>= 0.7.0)
Depends3: ca-certificates, python3-rospkg (>= 1.0.37), python3-yaml, python3-catkin-pkg (>= 0.4.0), python3-rosdistro (>= 0.7.0)
Depends: ca-certificates, python-rospkg (>= 1.1.8), python-yaml, python-catkin-pkg (>= 0.4.0), python-rosdistro (>= 0.7.0)
Depends3: ca-certificates, python3-rospkg (>= 1.1.8), python3-yaml, python3-catkin-pkg (>= 0.4.0), python3-rosdistro (>= 0.7.0)
Conflicts: python3-rosdep, python-rosdep2, python3-rosdep2
Conflicts3: python-rosdep, python-rosdep2, python3-rosdep2
Copyright-File: LICENSE
Expand Down