def get_subs(self, package, rpm_distro, releaser_history): def fallback_resolver(key, peer_packages, rosdistro=self.rosdistro): if key in peer_packages: return [sanitize_package_name(rosify_package_name(key, rosdistro))] return default_fallback_resolver(key, peer_packages) subs = generate_substitutions_from_package( package, self.os_name, rpm_distro, self.rosdistro, self.install_prefix, self.rpm_inc, [p.name for p in self.packages.values()], releaser_history=releaser_history, fallback_resolver=fallback_resolver ) subs['Package'] = rosify_package_name(subs['Package'], self.rosdistro) # Virtual packages subs['Provides'] += [ '%%{name}-%s = %%{version}-%%{release}' % subpackage for subpackage in [ 'devel', 'doc', 'runtime']] # Group membership subs['Provides'].extend( sanitize_package_name(rosify_package_name(g.name, self.rosdistro)) + '(member)' for g in package.member_of_groups) subs['Supplements'].extend( sanitize_package_name(rosify_package_name(g.name, self.rosdistro)) + '(all)' for g in package.member_of_groups) # 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 = [ '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 fallback_resolver(key, peer_packages, rosdistro=self.rosdistro): if key in peer_packages: return [sanitize_package_name(rosify_package_name(key, rosdistro))] return default_fallback_resolver(key, peer_packages)