Skip to content
Open
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
1 change: 1 addition & 0 deletions bloom/generators/debian/generate_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def get_subs(pkg, os_name, os_version, ros_distro, deb_inc=0, native=False):
os_name,
os_version,
ros_distro,
lambda name, _rosdistro: name,
deb_inc=deb_inc,
native=native
)
Expand Down
51 changes: 50 additions & 1 deletion bloom/generators/debian/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@

from bloom.packages import get_package_data

from bloom.rosdistro_api import get_index

from bloom.util import code
from bloom.util import to_unicode
from bloom.util import execute_command
Expand Down Expand Up @@ -285,6 +287,7 @@ def generate_substitutions_from_package(
os_name,
os_version,
ros_distro,
rosify_package_name,
installation_prefix='/usr',
deb_inc=0,
peer_packages=None,
Expand All @@ -309,7 +312,8 @@ def generate_substitutions_from_package(
# Debian Package Format
data['format'] = 'native' if native else 'quilt'
# Package name
data['Package'] = sanitize_package_name(package.name)
data['Package'] = rosify_package_name(sanitize_package_name(package.name), ros_distro)

# Installation prefix
data['InstallationPrefix'] = installation_prefix
# Resolve dependencies
Expand Down Expand Up @@ -472,6 +476,50 @@ def convertToUnicode(obj):
for item in data.items():
data[item[0]] = convertToUnicode(item[1])

# ROS 2 specific bloom extensions.
ros2_distros = [
name for name, values in get_index().distributions.items()
if values.get('distribution_type') == 'ros2']
if ros_distro in ros2_distros:
# Add ros-workspace package as a dependency to any package other
# than ros_workspace and its dependencies.
if package.name not in ['ament_cmake_core', 'ament_package', 'ros_workspace']:
workspace_pkg_name = rosify_package_name('ros-workspace', ros_distro)
data['BuildDepends'].append(workspace_pkg_name)
data['Depends'].append(workspace_pkg_name)

# Add packages necessary to build vendor typesupport for rosidl_interface_packages to their
# build dependencies.
if ros_distro in ros2_distros and \
ros_distro not in ('r2b2', 'r2b3', 'ardent') and \
'rosidl_interface_packages' in [p.name for p in package.member_of_groups]:
ROS2_VENDOR_TYPESUPPORT_DEPENDENCIES = [
'rosidl-typesupport-fastrtps-c',
'rosidl-typesupport-fastrtps-cpp',
]

# Connext was changed to a new rmw that doesn't require typesupport after Foxy
if ros_distro in ('bouncy', 'crystal', 'dashing', 'eloquent', 'foxy'):
ROS2_VENDOR_TYPESUPPORT_DEPENDENCIES.extend([
'rosidl-typesupport-connext-c',
'rosidl-typesupport-connext-cpp',
])

# OpenSplice was dropped after Eloquent.
# rmw implementations are required as dependencies up to Eloquent.
if ros_distro in ('bouncy', 'crystal', 'dashing', 'eloquent'):
ROS2_VENDOR_TYPESUPPORT_DEPENDENCIES.extend([
'rmw-connext-cpp',
'rmw-fastrtps-cpp',
'rmw-implementation',
'rmw-opensplice-cpp',
'rosidl-typesupport-opensplice-c',
'rosidl-typesupport-opensplice-cpp',
])

data['BuildDepends'] += [
rosify_package_name(name, ros_distro) for name in ROS2_VENDOR_TYPESUPPORT_DEPENDENCIES]

return data


Expand Down Expand Up @@ -887,6 +935,7 @@ def get_subs(self, package, debian_distro, releaser_history=None):
self.os_name,
debian_distro,
self.rosdistro,
lambda name, _rosdistro: name,
self.install_prefix,
self.debian_inc,
[p.name for p in self.packages.values()],
Expand Down
51 changes: 2 additions & 49 deletions bloom/generators/rosdebian.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@

from bloom.logging import info

from bloom.rosdistro_api import get_index

from bloom.util import get_distro_list_prompt


Expand Down Expand Up @@ -81,58 +79,13 @@ def fallback_resolver(key, peer_packages, rosdistro=self.rosdistro):
self.os_name,
debian_distro,
self.rosdistro,
rosify_package_name,
self.install_prefix,
self.debian_inc,
[p.name for p in self.packages.values()],
releaser_history=releaser_history,
fallback_resolver=fallback_resolver
)
subs['Rosdistro'] = self.rosdistro
subs['Package'] = rosify_package_name(subs['Package'], self.rosdistro)

# ROS 2 specific bloom extensions.
ros2_distros = [
name for name, values in get_index().distributions.items()
if values.get('distribution_type') == 'ros2']
if self.rosdistro in ros2_distros:
# Add ros-workspace package as a dependency to any package other
# than ros_workspace and its dependencies.
if package.name not in ['ament_cmake_core', 'ament_package', 'ros_workspace']:
workspace_pkg_name = rosify_package_name('ros-workspace', self.rosdistro)
subs['BuildDepends'].append(workspace_pkg_name)
subs['Depends'].append(workspace_pkg_name)

# Add packages necessary to build vendor typesupport for rosidl_interface_packages to their
# build dependencies.
if self.rosdistro in ros2_distros and \
self.rosdistro not in ('r2b2', 'r2b3', 'ardent') and \
'rosidl_interface_packages' in [p.name for p in package.member_of_groups]:
ROS2_VENDOR_TYPESUPPORT_DEPENDENCIES = [
'rosidl-typesupport-fastrtps-c',
'rosidl-typesupport-fastrtps-cpp',
]

# Connext was changed to a new rmw that doesn't require typesupport after Foxy
if self.rosdistro in ('bouncy', 'crystal', 'dashing', 'eloquent', 'foxy'):
ROS2_VENDOR_TYPESUPPORT_DEPENDENCIES.extend([
'rosidl-typesupport-connext-c',
'rosidl-typesupport-connext-cpp',
])

# OpenSplice was dropped after Eloquent.
# rmw implementations are required as dependencies up to Eloquent.
if self.rosdistro in ('bouncy', 'crystal', 'dashing', 'eloquent'):
ROS2_VENDOR_TYPESUPPORT_DEPENDENCIES.extend([
'rmw-connext-cpp',
'rmw-fastrtps-cpp',
'rmw-implementation',
'rmw-opensplice-cpp',
'rosidl-typesupport-opensplice-c',
'rosidl-typesupport-opensplice-cpp',
])

subs['BuildDepends'] += [
rosify_package_name(name, self.rosdistro) for name in ROS2_VENDOR_TYPESUPPORT_DEPENDENCIES]
return subs

def generate_branching_arguments(self, package, branch):
Expand Down Expand Up @@ -160,11 +113,11 @@ def get_subs(pkg, os_name, os_version, ros_distro, deb_inc, native):
os_name,
os_version,
ros_distro,
rosify_package_name,
RosDebianGenerator.default_install_prefix + ros_distro,
deb_inc=deb_inc,
native=native
)
subs['Package'] = rosify_package_name(subs['Package'], ros_distro)
return subs


Expand Down