From e957a1d26391f7c0b53e84c5343c3f12a0acea0c Mon Sep 17 00:00:00 2001 From: Martin Jansa Date: Fri, 4 Dec 2020 15:14:36 -0800 Subject: [PATCH] yocto_recipe.py: Override the build_type from catkin_pkg in some cases (#267) * if get_build_type() returns 'catkin' and we're generating some ROS 2 distribution change it to 'ament_cmake' and show an error message * there are couple cases where is missing completely and then catkin_pkg get_build_type() will return the default value as 'catkin' as specified in https://www.ros.org/reps/rep-0149.html#build-type-multiple "If no is provided, catkin is assumed." but this assumption doesn't work for ROS 2 distributions and in meta-ros we had to override these cases (as of 2020-12-05): dashing: https://raw.github.com/ros2-gbp/async_web_server_cpp-release/release/dashing/async_web_server_cpp/1.0.0-1/package.xml https://raw.github.com/boschresearch/fmilibrary_vendor-release/release/dashing/fmilibrary_vendor/0.2.0-1/package.xml https://raw.github.com/ros-geographic-info/geographic_info-release/release/dashing/geographic_info/1.0.1-1/package.xml https://raw.github.com/swri-robotics-gbp/gps_umd-release/release/dashing/gps_umd/1.0.4-1/package.xml https://raw.github.com/ros2-gbp/web_video_server-release/release/dashing/web_video_server/1.0.0-1/package.xml https://raw.github.com/KIT-MRT/mrt_cmake_modules-release/release/dashing/mrt_cmake_modules/1.0.8-1/package.xml eloquent: https://raw.github.com/boschresearch/fmilibrary_vendor-release/release/eloquent/fmilibrary_vendor/0.2.0-1/package.xml https://raw.github.com/ros-geographic-info/geographic_info-release/release/eloquent/geographic_info/1.0.1-1/package.xml https://raw.github.com/swri-robotics-gbp/gps_umd-release/release/eloquent/gps_umd/1.0.2-1/package.xml foxy: https://raw.github.com/boschresearch/fmilibrary_vendor-release/release/foxy/fmilibrary_vendor/0.2.0-1/package.xml https://raw.github.com/swri-robotics-gbp/gps_umd-release/release/foxy/gps_umd/1.0.4-1/package.xml https://raw.github.com/KIT-MRT/mrt_cmake_modules-release/release/foxy/mrt_cmake_modules/1.0.8-1/package.xml rolling: https://raw.github.com/ros2-gbp/fmilibrary_vendor-release/release/rolling/fmilibrary_vendor/0.2.0-2/package.xml https://raw.github.com/ros2-gbp/gps_umd-release/release/rolling/gps_umd/1.0.3-2/package.xml Signed-off-by: Martin Jansa --- superflore/generators/bitbake/yocto_recipe.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/superflore/generators/bitbake/yocto_recipe.py b/superflore/generators/bitbake/yocto_recipe.py index 7b211ea6..b24ef650 100644 --- a/superflore/generators/bitbake/yocto_recipe.py +++ b/superflore/generators/bitbake/yocto_recipe.py @@ -91,7 +91,15 @@ def __init__( self.license = pkg_fields.upstream_license self.description = pkg_fields.description self.homepage = pkg_fields.homepage - self.build_type = pkg_fields.build_type + pkg_build_type = pkg_fields.build_type + if pkg_build_type == 'catkin' and \ + yoctoRecipe._get_ros_version(rosdistro.name) == 2: + err("Package " + pkg_name + " either doesn't have " + " element at all or it's set to 'catkin'" + " which isn't a valid option for ROS 2; changing it to" + " 'ament_cmake'") + pkg_build_type = 'ament_cmake' + self.build_type = pkg_build_type else: self.description = '' self.license = None