Skip to content

Commit

Permalink
Update packagegroup-ros-world.bb and .conf(s) as per OE recipe genera…
Browse files Browse the repository at this point in the history
…tion scheme rev 16
  • Loading branch information
andre-rosa committed Apr 3, 2019
1 parent a52e949 commit c477977
Showing 1 changed file with 34 additions and 10 deletions.
44 changes: 34 additions & 10 deletions superflore/generators/bitbake/yocto_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class yoctoRecipe(object):
unresolved_deps_cache = set()
generated_recipes = set()
generated_components = set()
generated_native_recipes = set()

def __init__(
self, component_name, num_pkgs, pkg_name, pkg_xml, distro, src_uri,
Expand Down Expand Up @@ -276,8 +277,8 @@ def get_dependencies(
info('Resolved in OE: ' + dep + ' as ' + oe_query.name +
' in ' + oe_query.layer + ' as recipe ' + recipe)
else:
dependencies.append(
dep + yoctoRecipe.get_native_suffix(is_native))
recipe = dep + yoctoRecipe.get_native_suffix(is_native)
dependencies.append(recipe)
yoctoRecipe.unresolved_deps_cache.add(dep)
info('Failed to resolve: ' + dep)

Expand Down Expand Up @@ -324,20 +325,25 @@ def get_recipe_text(self, distributor, license_text):
ret += yoctoRecipe.generate_multiline_variable(
'ROS_BUILD_DEPENDS', self.get_dependencies(
self.depends, self.depends_external)) + '\n'
native_deps = self.get_dependencies(
self.buildtool_depends,
self.buildtool_depends_external,
is_native=True
)
yoctoRecipe.generated_native_recipes |= set(native_deps)
ret += yoctoRecipe.generate_multiline_variable(
'ROS_BUILDTOOL_DEPENDS', self.get_dependencies(
self.buildtool_depends, self.buildtool_depends_external,
is_native=True)) + '\n'
'ROS_BUILDTOOL_DEPENDS', native_deps) + '\n'
ret += yoctoRecipe.generate_multiline_variable(
'ROS_EXPORT_DEPENDS', self.get_dependencies(
self.export_depends, self.export_depends_external)) + '\n'
export_depends = self.get_dependencies(
native_deps = self.get_dependencies(
self.buildtool_export_depends,
self.buildtool_export_depends_external,
is_native=True
)
yoctoRecipe.generated_native_recipes |= set(native_deps)
ret += yoctoRecipe.generate_multiline_variable(
'ROS_BUILDTOOL_EXPORT_DEPENDS', export_depends) + '\n'
'ROS_BUILDTOOL_EXPORT_DEPENDS', native_deps) + '\n'
ret += yoctoRecipe.generate_multiline_variable(
'ROS_EXEC_DEPENDS', self.get_dependencies(
self.rdepends, self.rdepends_external)) + '\n'
Expand Down Expand Up @@ -398,6 +404,10 @@ def generate_rosdistro_conf(basepath, distro, skip_keys=[]):
conf_file.write(
'\nROS_SUPERFLORE_GENERATION_DATETIME = "{0}"\n\n'.format(
datetime.utcnow().strftime('%Y%m%d%H%M%S')))
conf_file.write('# ROS 2 distros only (can\'t set in '
+ 'ros2.bbclass because not all recipes'
+ ' are generated).\n')
conf_file.write('ROS_USE_PYTHON3 = "yes"\n\n')
conf_file.write(yoctoRecipe.generate_multiline_variable(
'ROS_SUPERFLORE_GENERATION_SKIP_LIST', skip_keys, True))
conf_file.write(
Expand All @@ -408,6 +418,13 @@ def generate_rosdistro_conf(basepath, distro, skip_keys=[]):
yoctoRecipe.generate_multiline_variable(
'ROS_SUPERFLORE_GENERATED_RECIPES_FOR_COMPONENTS',
yoctoRecipe.generated_components, True))
conf_file.write('\n# Packages found in the <buildtool_depend>'
+ ' and <buildtool_export_depend> items, ie,'
+ ' ones for which a -native is built.\n')
conf_file.write(
yoctoRecipe.generate_multiline_variable(
'ROS_SUPERFLORE_GENERATED_BUILDTOOLS',
sorted(yoctoRecipe.generated_native_recipes)))
ok('Wrote {0}'.format(conf_file_path))
except Exception as e:
err("Failed to write conf {0} to disk!".format(conf_file_path))
Expand All @@ -430,12 +447,19 @@ def generate_packagegroup_ros_world(basepath, distro, skip_keys=[]):
pkggrp_file.write('\nDESCRIPTION = "All packages listed in ')
pkggrp_file.write('${ROS_DISTRO}-cache.yaml"\n')
pkggrp_file.write('LICENSE = "MIT"\n\n')
pkggrp_file.write('inherit ros_superflore_generated\n')
pkggrp_file.write('inherit ros_${ROS_DISTRO}\n')
pkggrp_file.write('inherit packagegroup\n\n')
pkggrp_file.write('PACKAGES = "${PN}"\n\n')
pkggrp_file.write(yoctoRecipe.generate_multiline_variable(
'RDEPENDS_${PN}', yoctoRecipe.generated_recipes, True))
'RDEPENDS_${PN}', yoctoRecipe.generated_recipes
- yoctoRecipe.generated_native_recipes, True))
pkggrp_file.write('\n# Allow the above settings to be'
+ ' overridden.\n')
pkggrp_file.write('include ${ROS_LAYERDIR}/recipes-ros/'
+ 'packagegroups/packagegroup-ros-world-'
+ '${ROS_DISTRO}.inc\n\n')
pkggrp_file.write('inherit ros_superflore_generated\n')
pkggrp_file.write('inherit ros_${ROS_DISTRO}\n')

ok('Wrote {0}'.format(pkggrp_file_path))
except Exception as e:
err("Failed to write packagegroup {0} to disk!".format(
Expand Down

0 comments on commit c477977

Please sign in to comment.