diff --git a/meta-ros-common/classes/ros_cmake.bbclass b/meta-ros-common/classes/ros_cmake.bbclass index 75e53c5304c..fd4a0d00600 100644 --- a/meta-ros-common/classes/ros_cmake.bbclass +++ b/meta-ros-common/classes/ros_cmake.bbclass @@ -3,7 +3,7 @@ inherit cmake -EXTRA_OECMAKE:prepend = "\ +EXTRA_OECMAKE:prepend:class-target = "\ -DCMAKE_PREFIX_PATH='${STAGING_DIR_HOST}${ros_prefix};${STAGING_DIR_HOST}${prefix}' \ -DCMAKE_INSTALL_PREFIX:PATH='${ros_prefix}' \ -DCMAKE_MODULE_PATH='${STAGING_DIR_HOST}${ros_datadir}/cmake/Modules/' \ @@ -13,3 +13,8 @@ EXTRA_OECMAKE:prepend:class-native = "\ -DCMAKE_PREFIX_PATH='${STAGING_DIR_NATIVE}${ros_prefix};${STAGING_DIR_NATIVE}${prefix}' \ -DCMAKE_INSTALL_PREFIX:PATH='${ros_prefix}' \ " + +EXTRA_OECMAKE:prepend:class-nativesdk = "\ + -DCMAKE_PREFIX_PATH='${STAGING_DIR_NATIVE}${ros_prefix};${STAGING_DIR_NATIVE}${prefix}' \ + -DCMAKE_INSTALL_PREFIX:PATH='${ros_prefix}' \ +" diff --git a/meta-ros-common/classes/ros_opt_prefix.bbclass b/meta-ros-common/classes/ros_opt_prefix.bbclass index 58c05e58d2b..05bf739088c 100644 --- a/meta-ros-common/classes/ros_opt_prefix.bbclass +++ b/meta-ros-common/classes/ros_opt_prefix.bbclass @@ -4,7 +4,8 @@ # Copyright (c) Qualcomm Innovation Center, Inc. All rights reserved # -ros_prefix ?= "${base_prefix}/opt/ros/${ROS_DISTRO}" +ros_base_prefix ?= "/opt/ros/${ROS_DISTRO}" +ros_prefix = "${base_prefix}${ros_base_prefix}" ros_bindir = "${ros_prefix}/bin" ros_sbindir = "${ros_prefix}/sbin" diff --git a/meta-ros-common/recipes-core/images/ros2-image-sdktest.bb b/meta-ros-common/recipes-core/images/ros2-image-sdktest.bb new file mode 100644 index 00000000000..84199acf405 --- /dev/null +++ b/meta-ros-common/recipes-core/images/ros2-image-sdktest.bb @@ -0,0 +1,33 @@ +SUMMARY = "ROS2 SDK Image" +DESCRIPTION = "${SUMMARY}" + +inherit core-image +inherit ros_distro_${ROS_DISTRO} +inherit ${ROS_DISTRO_TYPE}_image + +IMAGE_INSTALL:append = " \ + packagegroup-core-boot \ + ${CORE_IMAGE_EXTRA_INSTALL} \ +" + +TOOLCHAIN_TARGET_TASK:append = " \ + opencv-staticdev \ + python3-numpy-staticdev \ + libeigen \ + eigen3-cmake-module \ + boost \ + libstdc++-staticdev \ + pcl-dev \ + python3-pykdl \ + bullet \ + qhull-staticdev \ + orocos-kdl \ + yaml-cpp-vendor \ + pybind11-vendor \ + rttest \ + tlsf-staticdev \ + tlsf-cpp \ + python-cmake-module \ + python3-opencv \ + tinyxml-vendor \ +" diff --git a/meta-ros-common/recipes-devtools/colcon/python3-colcon-core/0003-Force-shebang-to-usr-bin-env-python3.patch b/meta-ros-common/recipes-devtools/colcon/python3-colcon-core/0003-Force-shebang-to-usr-bin-env-python3.patch new file mode 100644 index 00000000000..74d61643d9c --- /dev/null +++ b/meta-ros-common/recipes-devtools/colcon/python3-colcon-core/0003-Force-shebang-to-usr-bin-env-python3.patch @@ -0,0 +1,13 @@ +diff --git a/colcon_core/task/python/build.py b/colcon_core/task/python/build.py +index 7181d20..eb82058 100644 +--- a/colcon_core/task/python/build.py ++++ b/colcon_core/task/python/build.py +@@ -73,7 +73,7 @@ class PythonBuildTask(TaskExtensionPoint): + os.path.realpath(args.build_base), + os.path.realpath(args.path)), + 'build', '--build-base', os.path.join( +- args.build_base, 'build'), ++ args.build_base, 'build'), '--executable', '/usr/bin/env python3', + 'install', '--prefix', args.install_base, + '--record', os.path.join(args.build_base, 'install.log'), + # prevent installation of dependencies specified in setup.py diff --git a/meta-ros-common/recipes-devtools/colcon/python3-colcon-core_0.6.1.bb b/meta-ros-common/recipes-devtools/colcon/python3-colcon-core_0.6.1.bb index c0826580c3c..f8c72cf3837 100644 --- a/meta-ros-common/recipes-devtools/colcon/python3-colcon-core_0.6.1.bb +++ b/meta-ros-common/recipes-devtools/colcon/python3-colcon-core_0.6.1.bb @@ -6,6 +6,7 @@ LIC_FILES_CHKSUM = "file://setup.cfg;beginline=22;endline=22;md5=3d0bd1ac53c1dd5 SRC_URI += "file://0001-Remove-optional-pytest-dependencies.patch \ file://0002-Fix-regression-when-enitre-workspace-is-symlinked.patch \ + file://0003-Force-shebang-to-usr-bin-env-python3.patch \ " SRC_URI[sha256sum] = "fc14534b2ce745fcc332afc0bb0ddf3e45d5d69c15da15b9471cfb7b0b9edbe9" diff --git a/meta-ros-common/recipes-devtools/python/python3-coloredlogs_%.bbappend b/meta-ros-common/recipes-devtools/python/python3-coloredlogs_%.bbappend new file mode 100644 index 00000000000..2a590838b56 --- /dev/null +++ b/meta-ros-common/recipes-devtools/python/python3-coloredlogs_%.bbappend @@ -0,0 +1 @@ +BBCLASSEXTEND += "nativesdk" diff --git a/meta-ros-common/recipes-devtools/python/python3-dateutil_%.bbappend b/meta-ros-common/recipes-devtools/python/python3-dateutil_%.bbappend new file mode 100644 index 00000000000..2a590838b56 --- /dev/null +++ b/meta-ros-common/recipes-devtools/python/python3-dateutil_%.bbappend @@ -0,0 +1 @@ +BBCLASSEXTEND += "nativesdk" diff --git a/meta-ros-common/recipes-devtools/python/python3-docutils_%.bbappend b/meta-ros-common/recipes-devtools/python/python3-docutils_%.bbappend new file mode 100644 index 00000000000..2a590838b56 --- /dev/null +++ b/meta-ros-common/recipes-devtools/python/python3-docutils_%.bbappend @@ -0,0 +1 @@ +BBCLASSEXTEND += "nativesdk" diff --git a/meta-ros-common/recipes-devtools/python/python3-humanfriendly_%.bbappend b/meta-ros-common/recipes-devtools/python/python3-humanfriendly_%.bbappend new file mode 100644 index 00000000000..2a590838b56 --- /dev/null +++ b/meta-ros-common/recipes-devtools/python/python3-humanfriendly_%.bbappend @@ -0,0 +1 @@ +BBCLASSEXTEND += "nativesdk" diff --git a/meta-ros-common/recipes-devtools/python/python3-lark-parser_0.7.0.bb b/meta-ros-common/recipes-devtools/python/python3-lark-parser_0.7.0.bb index 14989f873bb..b1c5e4aa56d 100644 --- a/meta-ros-common/recipes-devtools/python/python3-lark-parser_0.7.0.bb +++ b/meta-ros-common/recipes-devtools/python/python3-lark-parser_0.7.0.bb @@ -5,3 +5,5 @@ require python-lark-parser.inc inherit setuptools3 + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-ros-common/recipes-extended/pcl/pcl/0002-Do-not-leak-build-directory-paths-1.12.1.patch b/meta-ros-common/recipes-extended/pcl/pcl/0002-Do-not-leak-build-directory-paths-1.12.1.patch new file mode 100644 index 00000000000..cba4f9a1bf9 --- /dev/null +++ b/meta-ros-common/recipes-extended/pcl/pcl/0002-Do-not-leak-build-directory-paths-1.12.1.patch @@ -0,0 +1,55 @@ +From 4dc28976e88af60e273e670f824cf9b30281e86d Mon Sep 17 00:00:00 2001 +From: Stephen Street +Date: Tue, 5 Nov 2024 09:04:23 -0800 +Subject: [PATCH] Do not leak build directory paths in sdk + +Signed-off-by: Stephen Street +--- + PCLConfig.cmake.in | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/PCLConfig.cmake.in b/PCLConfig.cmake.in +index 1e923a3e9..4a8a3a35e 100644 +--- a/PCLConfig.cmake.in ++++ b/PCLConfig.cmake.in +@@ -23,6 +23,7 @@ if(POLICY CMP0074) + # NEW behavior, we need to push a policy stack. + cmake_policy(SET CMP0074 NEW) + endif() ++cmake_policy(SET CMP0144 NEW) + + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/Modules") + +@@ -91,9 +92,9 @@ macro(find_boost) + if(PCL_ALL_IN_ONE_INSTALLER) + set(BOOST_ROOT "${PCL_ROOT}/3rdParty/Boost") + elseif(NOT BOOST_INCLUDEDIR) +- set(BOOST_INCLUDEDIR "@Boost_INCLUDE_DIR@") ++ set(BOOST_INCLUDEDIR "/usr/include") + endif() +- ++ + set(Boost_ADDITIONAL_VERSIONS + "@Boost_MAJOR_VERSION@.@Boost_MINOR_VERSION@.@Boost_SUBMINOR_VERSION@" "@Boost_MAJOR_VERSION@.@Boost_MINOR_VERSION@" + "1.84.0" "1.84" "1.83.0" "1.83" "1.82.0" "1.82" "1.81.0" "1.81" "1.80.0" "1.80" +@@ -117,7 +118,7 @@ macro(find_eigen) + if(PCL_ALL_IN_ONE_INSTALLER) + set(EIGEN_ROOT "${PCL_ROOT}/3rdParty/Eigen") + elseif(NOT EIGEN_ROOT) +- get_filename_component(EIGEN_ROOT "@EIGEN_INCLUDE_DIRS@" ABSOLUTE) ++ get_filename_component(EIGEN_ROOT "/usr/include/eigen3" ABSOLUTE) + endif() + find_package(Eigen 3.1) + endmacro() +@@ -225,7 +226,7 @@ macro(find_flann) + if(PCL_ALL_IN_ONE_INSTALLER) + set(FLANN_ROOT "${PCL_ROOT}/3rdParty/Flann") + elseif(NOT FLANN_ROOT) +- set(FLANN_ROOT "@FLANN_ROOT@") ++ set(FLANN_ROOT "/usr") + endif() + + set(PCL_FLANN_REQUIRED_TYPE @PCL_FLANN_REQUIRED_TYPE@) +-- +2.43.0 + diff --git a/meta-ros-common/recipes-extended/pcl/pcl/0002-Do-not-leak-build-directory-paths-1.13.0.patch b/meta-ros-common/recipes-extended/pcl/pcl/0002-Do-not-leak-build-directory-paths-1.13.0.patch new file mode 100644 index 00000000000..0bfc2bec9b5 --- /dev/null +++ b/meta-ros-common/recipes-extended/pcl/pcl/0002-Do-not-leak-build-directory-paths-1.13.0.patch @@ -0,0 +1,55 @@ +From 15cfff0eb7fb7ca58550f6259f0935ca7710a6b4 Mon Sep 17 00:00:00 2001 +From: Stephen Street +Date: Tue, 5 Nov 2024 08:47:17 -0800 +Subject: [PATCH] Do not leak build directory paths in sdk + +Signed-off-by: Stephen Street +--- + PCLConfig.cmake.in | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/PCLConfig.cmake.in b/PCLConfig.cmake.in +index b6322c623..b7e290c23 100644 +--- a/PCLConfig.cmake.in ++++ b/PCLConfig.cmake.in +@@ -23,6 +23,7 @@ if(POLICY CMP0074) + # NEW behavior, we need to push a policy stack. + cmake_policy(SET CMP0074 NEW) + endif() ++cmake_policy(SET CMP0144 NEW) + + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/Modules") + +@@ -91,9 +92,9 @@ macro(find_boost) + if(PCL_ALL_IN_ONE_INSTALLER) + set(BOOST_ROOT "${PCL_ROOT}/3rdParty/Boost") + elseif(NOT BOOST_INCLUDEDIR) +- set(BOOST_INCLUDEDIR "@Boost_INCLUDE_DIR@") ++ set(BOOST_INCLUDEDIR "/usr/include") + endif() +- ++ + set(Boost_ADDITIONAL_VERSIONS + "@Boost_MAJOR_VERSION@.@Boost_MINOR_VERSION@.@Boost_SUBMINOR_VERSION@" "@Boost_MAJOR_VERSION@.@Boost_MINOR_VERSION@" + "1.84.0" "1.84" "1.83.0" "1.83" "1.82.0" "1.82" "1.81.0" "1.81" "1.80.0" "1.80" +@@ -117,7 +118,7 @@ macro(find_eigen) + if(PCL_ALL_IN_ONE_INSTALLER) + set(EIGEN_ROOT "${PCL_ROOT}/3rdParty/Eigen") + elseif(NOT EIGEN_ROOT) +- get_filename_component(EIGEN_ROOT "@EIGEN_INCLUDE_DIRS@" ABSOLUTE) ++ get_filename_component(EIGEN_ROOT "/usr/include/eigen3" ABSOLUTE) + endif() + find_package(Eigen 3.3) + endmacro() +@@ -225,7 +226,7 @@ macro(find_flann) + if(PCL_ALL_IN_ONE_INSTALLER) + set(FLANN_ROOT "${PCL_ROOT}/3rdParty/Flann") + elseif(NOT FLANN_ROOT) +- set(FLANN_ROOT "@FLANN_ROOT@") ++ set(FLANN_ROOT "/usr") + endif() + + set(PCL_FLANN_REQUIRED_TYPE @PCL_FLANN_REQUIRED_TYPE@) +-- +2.43.0 + diff --git a/meta-ros-common/recipes-extended/pcl/pcl_1.12.1.bb b/meta-ros-common/recipes-extended/pcl/pcl_1.12.1.bb index 13f027361d9..dae52af57f8 100644 --- a/meta-ros-common/recipes-extended/pcl/pcl_1.12.1.bb +++ b/meta-ros-common/recipes-extended/pcl/pcl_1.12.1.bb @@ -4,6 +4,7 @@ require pcl.inc SRC_URI += "file://0001-Make-PCL-compatible-with-Boost-1.84-1.12.1.patch" +SRC_URI += "file://0002-Do-not-leak-build-directory-paths-1.12.1.patch" PV = "1.12.1+git${SRCPV}" SRCREV = "e8ed4be802f7d0b1acff2f8b01d7c5f381190e05" diff --git a/meta-ros-common/recipes-extended/pcl/pcl_1.13.0.bb b/meta-ros-common/recipes-extended/pcl/pcl_1.13.0.bb index 56e0d989e07..1170824d461 100644 --- a/meta-ros-common/recipes-extended/pcl/pcl_1.13.0.bb +++ b/meta-ros-common/recipes-extended/pcl/pcl_1.13.0.bb @@ -4,6 +4,7 @@ require pcl.inc SRC_URI += "file://0001-Make-PCL-compatible-with-Boost-1.84-1.13.0.patch" +SRC_URI += "file://0002-Do-not-leak-build-directory-paths-1.13.0.patch" PV = "1.13.0+git${SRCPV}" SRCREV = "371a8e1373f7b2f66bbb92291be2f3e50dc19856" diff --git a/meta-ros-common/recipes-infrastructure/python/python3-catkin-pkg/0002-package-py-remove-newline-in-description-warning.patch b/meta-ros-common/recipes-infrastructure/python/python3-catkin-pkg/0002-package-py-remove-newline-in-description-warning.patch new file mode 100644 index 00000000000..3c46f73c9d0 --- /dev/null +++ b/meta-ros-common/recipes-infrastructure/python/python3-catkin-pkg/0002-package-py-remove-newline-in-description-warning.patch @@ -0,0 +1,14 @@ +diff --git a/src/catkin_pkg/package.py b/src/catkin_pkg/package.py +index da2b1b8..e2c8f2d 100644 +--- a/src/catkin_pkg/package.py ++++ b/src/catkin_pkg/package.py +@@ -253,9 +253,6 @@ class Package(object): + + if not self.description: + errors.append('Package description must not be empty') +- else: +- if '\n' in self.description: +- new_warnings.append('Package "%s" has newlines in the description') + + if not self.maintainers: + errors.append("Package '{0}' must declare at least one maintainer".format(self.name)) diff --git a/meta-ros-common/recipes-infrastructure/python/python3-catkin-pkg_0.4.24.bb b/meta-ros-common/recipes-infrastructure/python/python3-catkin-pkg_0.4.24.bb index 3cf6595f42d..76ced47c858 100644 --- a/meta-ros-common/recipes-infrastructure/python/python3-catkin-pkg_0.4.24.bb +++ b/meta-ros-common/recipes-infrastructure/python/python3-catkin-pkg_0.4.24.bb @@ -1,5 +1,6 @@ require python-catkin-pkg.inc SRC_URI += "file://0001-python_setup.py-fix-build-with-setuptools-v59.0.0-an.patch" +SRC_URI += "file://0002-package-py-remove-newline-in-description-warning.patch" inherit setuptools3 diff --git a/meta-ros-common/recipes-support/asio/asio_%.bbappend b/meta-ros-common/recipes-support/asio/asio_%.bbappend index 13661a581e9..821ee7e7596 100644 --- a/meta-ros-common/recipes-support/asio/asio_%.bbappend +++ b/meta-ros-common/recipes-support/asio/asio_%.bbappend @@ -1,3 +1,3 @@ # Copyright (c) 2019-2020 LG Electronics, Inc. -BBCLASSEXTEND = "native" +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-ros-common/recipes-support/libtinyxml2/libtinyxml2_%.bbappend b/meta-ros-common/recipes-support/libtinyxml2/libtinyxml2_%.bbappend new file mode 100644 index 00000000000..2a590838b56 --- /dev/null +++ b/meta-ros-common/recipes-support/libtinyxml2/libtinyxml2_%.bbappend @@ -0,0 +1 @@ +BBCLASSEXTEND += "nativesdk" diff --git a/meta-ros2-humble/conf/layer.conf b/meta-ros2-humble/conf/layer.conf index 7b9b8e60b16..f353a4622db 100644 --- a/meta-ros2-humble/conf/layer.conf +++ b/meta-ros2-humble/conf/layer.conf @@ -24,3 +24,4 @@ LAYERDEPENDS_ros2-humble-layer = " \ LAYERSERIES_COMPAT_ros2-humble-layer = "scarthgap" require conf/ros-distro/include/humble/ros-distro.inc +require conf/ros-distro/include/humble/ros-sdk.inc diff --git a/meta-ros2-humble/conf/ros-distro/include/humble/ros-sdk.inc b/meta-ros2-humble/conf/ros-distro/include/humble/ros-sdk.inc new file mode 100644 index 00000000000..14984b47d41 --- /dev/null +++ b/meta-ros2-humble/conf/ros-distro/include/humble/ros-sdk.inc @@ -0,0 +1,62 @@ +TOOLCHAIN_HOST_TASK:append = " \ + nativesdk-ament-package \ + nativesdk-python3-colcon-common-extensions \ + nativesdk-python3-numpy \ + nativesdk-rosidl-adapter \ + nativesdk-rosidl-cli \ + nativesdk-rosidl-cmake \ + nativesdk-rosidl-default-generators \ + nativesdk-rosidl-generator-c \ + nativesdk-rosidl-generator-cpp \ + nativesdk-rosidl-parser \ + nativesdk-rosidl-typesupport-c \ + nativesdk-rosidl-typesupport-cpp \ + nativesdk-rosidl-typesupport-fastrtps-c \ + nativesdk-rosidl-typesupport-fastrtps-cpp \ + nativesdk-rosidl-typesupport-introspection-c \ + nativesdk-rosidl-typesupport-introspection-cpp \ + nativesdk-ros-sdk-env \ +" + +TOOLCHAIN_TARGET_TASK:append = " \ + ament-cmake-python \ + ament-cmake-ros \ + ament-package \ + ament-lint \ + ament-cmake \ + ament-cmake-auto \ + ament-cmake-core \ + ament-cmake-export-definitions \ + ament-cmake-export-dependencies \ + ament-cmake-export-include-directories \ + ament-cmake-export-interfaces \ + ament-cmake-export-libraries \ + ament-cmake-export-link-flags \ + ament-cmake-export-targets \ + ament-cmake-gen-version-h \ + ament-cmake-gmock \ + ament-cmake-gtest \ + ament-cmake-include-directories \ + ament-cmake-libraries \ + ament-cmake-pytest \ + ament-cmake-python \ + ament-cmake-target-dependencies \ + ament-cmake-test \ + ament-cmake-vendor-package \ + ament-cmake-version \ + foonathan-memory-staticdev \ + \ + rclcpp \ + rclcpp-lifecycle \ + rclcpp-action \ + rclcpp-components \ + builtin-interfaces \ + common-interfaces \ + fastrtps-cmake-module \ + rosidl-default-generators \ + rosidl-generator-c \ + rosidl-generator-cpp \ + rosidl-cmake \ + ros-workspace \ + pluginlib \ +" diff --git a/meta-ros2-humble/recipes-bbappends/fastrtps/fastrtps/0001-FindTinyXML2.cmake-fix-find_library-libtinyxml2.patch b/meta-ros2-humble/recipes-bbappends/fastrtps/fastrtps/0001-FindTinyXML2.cmake-fix-find_library-libtinyxml2.patch new file mode 100644 index 00000000000..dc9126a64d4 --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/fastrtps/fastrtps/0001-FindTinyXML2.cmake-fix-find_library-libtinyxml2.patch @@ -0,0 +1,16 @@ +diff --git a/cmake/modules/FindTinyXML2.cmake b/cmake/modules/FindTinyXML2.cmake +index 44b8e645..ba964578 100644 +--- a/cmake/modules/FindTinyXML2.cmake ++++ b/cmake/modules/FindTinyXML2.cmake +@@ -39,7 +39,10 @@ else() + if(TINYXML2_FROM_SOURCE) + find_path(TINYXML2_SOURCE_DIR NAMES tinyxml2.cpp NO_CMAKE_FIND_ROOT_PATH) + else() +- find_library(TINYXML2_LIBRARY tinyxml2) ++ find_library(TINYXML2_LIBRARIES tinyxml2) ++ add_library(tinyxml2 SHARED IMPORTED) ++ set_property(TARGET tinyxml2 APPEND PROPERTY IMPORTED_LOCATION "${TINYXML2_LIBRARIES}") ++ set(TINYXML2_LIBRARY tinyxml2) + endif() + + include(FindPackageHandleStandardArgs) diff --git a/meta-ros2-humble/recipes-bbappends/fastrtps/fastrtps_%.bbappend b/meta-ros2-humble/recipes-bbappends/fastrtps/fastrtps_%.bbappend index 2e8afcb9691..288d2e1c346 100644 --- a/meta-ros2-humble/recipes-bbappends/fastrtps/fastrtps_%.bbappend +++ b/meta-ros2-humble/recipes-bbappends/fastrtps/fastrtps_%.bbappend @@ -1,8 +1,11 @@ # Copyright (c) 2019-2021 LG Electronics, Inc. +# Copyright (c) 2023 Wind River Systems, Inc. inherit ros_insane_dev_so FILES:${PN} += "${prefix}/tools" +# ERROR: fastrtps-2.10.2-1-r0 do_package: QA Issue: fastrtps: Files/directories were installed but not shipped in any package: +FILES:${PN} += "${datadir}/fastRTPS_profiles.xsd ${datadir}/fastdds_static_discovery.xsd" # CMake Error: TRY_RUN() invoked in cross-compiling mode, please set the # following cache variables appropriately: @@ -19,3 +22,6 @@ EXTRA_OECMAKE += " -DSM_RUN_RESULT=0 -DSM_RUN_RESULT__TRYRUN_OUTPUT=PTHREAD_RWLO sysroot_stage_all:append() { sysroot_stage_dir ${D}${bindir} ${SYSROOT_DESTDIR}${bindir} } + +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" +SRC_URI += "file://0001-FindTinyXML2.cmake-fix-find_library-libtinyxml2.patch" diff --git a/meta-ros2-humble/recipes-bbappends/rcl/rcl-yaml-param-parser/0001-CMakeLists.txt-use-find-package-yaml.patch b/meta-ros2-humble/recipes-bbappends/rcl/rcl-yaml-param-parser/0001-CMakeLists.txt-use-find-package-yaml.patch new file mode 100644 index 00000000000..db57bd890ef --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/rcl/rcl-yaml-param-parser/0001-CMakeLists.txt-use-find-package-yaml.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 96ef1b3e..b7487bf6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,6 +6,7 @@ find_package(ament_cmake_ros REQUIRED) + find_package(rcutils REQUIRED) + find_package(rmw REQUIRED) + find_package(libyaml_vendor REQUIRED) ++find_package(yaml) + + # Default to C++14 + if(NOT CMAKE_CXX_STANDARD) diff --git a/meta-ros2-humble/recipes-bbappends/rcl/rcl-yaml-param-parser/0001-CMakeLists.txt-use-pkg-config-to-find-yaml.patch b/meta-ros2-humble/recipes-bbappends/rcl/rcl-yaml-param-parser/0001-CMakeLists.txt-use-pkg-config-to-find-yaml.patch deleted file mode 100644 index df173150d87..00000000000 --- a/meta-ros2-humble/recipes-bbappends/rcl/rcl-yaml-param-parser/0001-CMakeLists.txt-use-pkg-config-to-find-yaml.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 1eb7cb44355b3bbc39a14570d3dc81bd69825c39 Mon Sep 17 00:00:00 2001 -From: Martin Jansa -Date: Thu, 9 Jul 2020 01:44:31 -0700 -Subject: [PATCH] CMakeLists.txt: use pkg-config to find yaml - -* yaml-0.1.8 built with CMake in libyaml-vendor ExternalProject_add call - provides yamlConfig, but platform yaml-0.2* from oe-core built with - autotools provides only pkg-config file yaml-1.0.pc, I've tried to change - oe-core recipe from autotools to cmake, but it seems to be broken in - upstream libyaml as shown bellow, we should continue to use upstream preferred autotools - https://github.com/yaml/libyaml/issues/141 - https://github.com/yaml/libyaml/issues/138 - -| CMake Error: File /OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/libyaml/0.2.5-r0/yaml-0.2.5/cmake/config.h.in does not exist. -| CMake Error at CMakeLists.txt:51 (configure_file): -| configure_file Problem configuring file -| -| -| CMake Error at CMakeLists.txt:103 (add_subdirectory): -| The source directory -| -| /OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/libyaml/0.2.5-r0/yaml-0.2.5/tests -| -| does not contain a CMakeLists.txt file. -| -| -| CMake Error: File /OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/libyaml/0.2.5-r0/yaml-0.2.5/yamlConfig.cmake.in does not exist. -| CMake Error at /OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/libyaml/0.2.5-r0/recipe-sysroot-native/usr/share/cmake-3.17/Modules/CMakePackageConfigHelpers.cmake:330 (configure_file): -| configure_file Problem configuring file -| Call Stack (most recent call first): -| CMakeLists.txt:114 (configure_package_config_file) -| -| -| CMake Error: File /OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/libyaml/0.2.5-r0/yaml-0.2.5/yamlConfig.cmake.in does not exist. -| CMake Error at /OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/libyaml/0.2.5-r0/recipe-sysroot-native/usr/share/cmake-3.17/Modules/CMakePackageConfigHelpers.cmake:330 (configure_file): -| configure_file Problem configuring file -| Call Stack (most recent call first): -| CMakeLists.txt:130 (configure_package_config_file) -| -| -| -- Configuring incomplete, errors occurred! -| See also "/OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/libyaml/0.2.5-r0/build/CMakeFiles/CMakeOutput.log". -| WARNING: exit code 1 from a shell command. - -Upstream-Status: Pending - -Signed-off-by: Martin Jansa ---- - CMakeLists.txt | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 397f662..341aeaf 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -6,6 +6,8 @@ find_package(ament_cmake_ros REQUIRED) - find_package(rcutils REQUIRED) - find_package(rmw REQUIRED) - find_package(libyaml_vendor REQUIRED) -+find_package(PkgConfig REQUIRED) -+pkg_check_modules(yaml REQUIRED yaml-0.1) - - # Default to C++14 - if(NOT CMAKE_CXX_STANDARD) diff --git a/meta-ros2-humble/recipes-bbappends/rcl/rcl-yaml-param-parser_5.3.9-1.bbappend b/meta-ros2-humble/recipes-bbappends/rcl/rcl-yaml-param-parser_5.3.9-1.bbappend index 93e9e23ba1c..a5fc022473b 100644 --- a/meta-ros2-humble/recipes-bbappends/rcl/rcl-yaml-param-parser_5.3.9-1.bbappend +++ b/meta-ros2-humble/recipes-bbappends/rcl/rcl-yaml-param-parser_5.3.9-1.bbappend @@ -1,8 +1,6 @@ # Copyright (c) 2020-2021 LG Electronics, Inc. -inherit pkgconfig - DEPENDS += "libyaml" FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" -SRC_URI += "file://0001-CMakeLists.txt-use-pkg-config-to-find-yaml.patch" +SRC_URI += "file://0001-CMakeLists.txt-use-find-package-yaml.patch" diff --git a/meta-ros2-jazzy/conf/layer.conf b/meta-ros2-jazzy/conf/layer.conf index 37f2d6ee500..271da5fa65b 100644 --- a/meta-ros2-jazzy/conf/layer.conf +++ b/meta-ros2-jazzy/conf/layer.conf @@ -24,3 +24,4 @@ LAYERDEPENDS_ros2-jazzy-layer = " \ LAYERSERIES_COMPAT_ros2-jazzy-layer = "scarthgap" require conf/ros-distro/include/jazzy/ros-distro.inc +require conf/ros-distro/include/jazzy/ros-sdk.inc diff --git a/meta-ros2-jazzy/conf/ros-distro/include/jazzy/ros-sdk.inc b/meta-ros2-jazzy/conf/ros-distro/include/jazzy/ros-sdk.inc new file mode 100644 index 00000000000..c358ca904df --- /dev/null +++ b/meta-ros2-jazzy/conf/ros-distro/include/jazzy/ros-sdk.inc @@ -0,0 +1,61 @@ +TOOLCHAIN_HOST_TASK:append = " \ + nativesdk-ament-package \ + nativesdk-python3-colcon-common-extensions \ + nativesdk-python3-numpy \ + nativesdk-rosidl-adapter \ + nativesdk-rosidl-cli \ + nativesdk-rosidl-cmake \ + nativesdk-rosidl-default-generators \ + nativesdk-rosidl-generator-c \ + nativesdk-rosidl-generator-cpp \ + nativesdk-rosidl-parser \ + nativesdk-rosidl-typesupport-c \ + nativesdk-rosidl-typesupport-cpp \ + nativesdk-rosidl-typesupport-fastrtps-c \ + nativesdk-rosidl-typesupport-fastrtps-cpp \ + nativesdk-rosidl-typesupport-introspection-c \ + nativesdk-rosidl-typesupport-introspection-cpp \ + nativesdk-ros-sdk-env \ +" + +TOOLCHAIN_TARGET_TASK = " \ + ament-cmake-python \ + ament-cmake-ros \ + ament-package \ + ament-lint \ + ament-cmake \ + ament-cmake-auto \ + ament-cmake-core \ + ament-cmake-export-definitions \ + ament-cmake-export-dependencies \ + ament-cmake-export-include-directories \ + ament-cmake-export-interfaces \ + ament-cmake-export-libraries \ + ament-cmake-export-link-flags \ + ament-cmake-export-targets \ + ament-cmake-gen-version-h \ + ament-cmake-gmock \ + ament-cmake-gtest \ + ament-cmake-include-directories \ + ament-cmake-libraries \ + ament-cmake-pytest \ + ament-cmake-python \ + ament-cmake-target-dependencies \ + ament-cmake-test \ + ament-cmake-vendor-package \ + ament-cmake-version \ + foonathan-memory-staticdev \ + \ + rclcpp \ + rclcpp-lifecycle \ + rclcpp-action \ + rclcpp-components \ + builtin-interfaces \ + common-interfaces \ + fastrtps-cmake-module \ + rosidl-default-generators \ + rosidl-core-generators \ + rosidl-cmake \ + ros-workspace \ + pluginlib \ +" diff --git a/meta-ros2-jazzy/recipes-bbappends/fastrtps/fastrtps/0001-FindTinyXML2.cmake-fix-find_library-libtinyxml2.patch b/meta-ros2-jazzy/recipes-bbappends/fastrtps/fastrtps/0001-FindTinyXML2.cmake-fix-find_library-libtinyxml2.patch new file mode 100644 index 00000000000..dc9126a64d4 --- /dev/null +++ b/meta-ros2-jazzy/recipes-bbappends/fastrtps/fastrtps/0001-FindTinyXML2.cmake-fix-find_library-libtinyxml2.patch @@ -0,0 +1,16 @@ +diff --git a/cmake/modules/FindTinyXML2.cmake b/cmake/modules/FindTinyXML2.cmake +index 44b8e645..ba964578 100644 +--- a/cmake/modules/FindTinyXML2.cmake ++++ b/cmake/modules/FindTinyXML2.cmake +@@ -39,7 +39,10 @@ else() + if(TINYXML2_FROM_SOURCE) + find_path(TINYXML2_SOURCE_DIR NAMES tinyxml2.cpp NO_CMAKE_FIND_ROOT_PATH) + else() +- find_library(TINYXML2_LIBRARY tinyxml2) ++ find_library(TINYXML2_LIBRARIES tinyxml2) ++ add_library(tinyxml2 SHARED IMPORTED) ++ set_property(TARGET tinyxml2 APPEND PROPERTY IMPORTED_LOCATION "${TINYXML2_LIBRARIES}") ++ set(TINYXML2_LIBRARY tinyxml2) + endif() + + include(FindPackageHandleStandardArgs) diff --git a/meta-ros2-jazzy/recipes-bbappends/fastrtps/fastrtps_%.bbappend b/meta-ros2-jazzy/recipes-bbappends/fastrtps/fastrtps_%.bbappend index e9ebdc0a717..288d2e1c346 100644 --- a/meta-ros2-jazzy/recipes-bbappends/fastrtps/fastrtps_%.bbappend +++ b/meta-ros2-jazzy/recipes-bbappends/fastrtps/fastrtps_%.bbappend @@ -22,3 +22,6 @@ EXTRA_OECMAKE += " -DSM_RUN_RESULT=0 -DSM_RUN_RESULT__TRYRUN_OUTPUT=PTHREAD_RWLO sysroot_stage_all:append() { sysroot_stage_dir ${D}${bindir} ${SYSROOT_DESTDIR}${bindir} } + +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" +SRC_URI += "file://0001-FindTinyXML2.cmake-fix-find_library-libtinyxml2.patch" diff --git a/meta-ros2-rolling/conf/layer.conf b/meta-ros2-rolling/conf/layer.conf index d19c079c9e0..d80a56426df 100644 --- a/meta-ros2-rolling/conf/layer.conf +++ b/meta-ros2-rolling/conf/layer.conf @@ -24,3 +24,4 @@ LAYERDEPENDS_ros2-rolling-layer = " \ LAYERSERIES_COMPAT_ros2-rolling-layer = "scarthgap" require conf/ros-distro/include/rolling/ros-distro.inc +require conf/ros-distro/include/rolling/ros-sdk.inc diff --git a/meta-ros2-rolling/conf/ros-distro/include/rolling/ros-sdk.inc b/meta-ros2-rolling/conf/ros-distro/include/rolling/ros-sdk.inc new file mode 100644 index 00000000000..c358ca904df --- /dev/null +++ b/meta-ros2-rolling/conf/ros-distro/include/rolling/ros-sdk.inc @@ -0,0 +1,61 @@ +TOOLCHAIN_HOST_TASK:append = " \ + nativesdk-ament-package \ + nativesdk-python3-colcon-common-extensions \ + nativesdk-python3-numpy \ + nativesdk-rosidl-adapter \ + nativesdk-rosidl-cli \ + nativesdk-rosidl-cmake \ + nativesdk-rosidl-default-generators \ + nativesdk-rosidl-generator-c \ + nativesdk-rosidl-generator-cpp \ + nativesdk-rosidl-parser \ + nativesdk-rosidl-typesupport-c \ + nativesdk-rosidl-typesupport-cpp \ + nativesdk-rosidl-typesupport-fastrtps-c \ + nativesdk-rosidl-typesupport-fastrtps-cpp \ + nativesdk-rosidl-typesupport-introspection-c \ + nativesdk-rosidl-typesupport-introspection-cpp \ + nativesdk-ros-sdk-env \ +" + +TOOLCHAIN_TARGET_TASK = " \ + ament-cmake-python \ + ament-cmake-ros \ + ament-package \ + ament-lint \ + ament-cmake \ + ament-cmake-auto \ + ament-cmake-core \ + ament-cmake-export-definitions \ + ament-cmake-export-dependencies \ + ament-cmake-export-include-directories \ + ament-cmake-export-interfaces \ + ament-cmake-export-libraries \ + ament-cmake-export-link-flags \ + ament-cmake-export-targets \ + ament-cmake-gen-version-h \ + ament-cmake-gmock \ + ament-cmake-gtest \ + ament-cmake-include-directories \ + ament-cmake-libraries \ + ament-cmake-pytest \ + ament-cmake-python \ + ament-cmake-target-dependencies \ + ament-cmake-test \ + ament-cmake-vendor-package \ + ament-cmake-version \ + foonathan-memory-staticdev \ + \ + rclcpp \ + rclcpp-lifecycle \ + rclcpp-action \ + rclcpp-components \ + builtin-interfaces \ + common-interfaces \ + fastrtps-cmake-module \ + rosidl-default-generators \ + rosidl-core-generators \ + rosidl-cmake \ + ros-workspace \ + pluginlib \ +" diff --git a/meta-ros2-rolling/recipes-bbappends/fastrtps/fastrtps/0001-FindTinyXML2.cmake-fix-find_library-libtinyxml2.patch b/meta-ros2-rolling/recipes-bbappends/fastrtps/fastrtps/0001-FindTinyXML2.cmake-fix-find_library-libtinyxml2.patch new file mode 100644 index 00000000000..dc9126a64d4 --- /dev/null +++ b/meta-ros2-rolling/recipes-bbappends/fastrtps/fastrtps/0001-FindTinyXML2.cmake-fix-find_library-libtinyxml2.patch @@ -0,0 +1,16 @@ +diff --git a/cmake/modules/FindTinyXML2.cmake b/cmake/modules/FindTinyXML2.cmake +index 44b8e645..ba964578 100644 +--- a/cmake/modules/FindTinyXML2.cmake ++++ b/cmake/modules/FindTinyXML2.cmake +@@ -39,7 +39,10 @@ else() + if(TINYXML2_FROM_SOURCE) + find_path(TINYXML2_SOURCE_DIR NAMES tinyxml2.cpp NO_CMAKE_FIND_ROOT_PATH) + else() +- find_library(TINYXML2_LIBRARY tinyxml2) ++ find_library(TINYXML2_LIBRARIES tinyxml2) ++ add_library(tinyxml2 SHARED IMPORTED) ++ set_property(TARGET tinyxml2 APPEND PROPERTY IMPORTED_LOCATION "${TINYXML2_LIBRARIES}") ++ set(TINYXML2_LIBRARY tinyxml2) + endif() + + include(FindPackageHandleStandardArgs) diff --git a/meta-ros2-rolling/recipes-bbappends/fastrtps/fastrtps_%.bbappend b/meta-ros2-rolling/recipes-bbappends/fastrtps/fastrtps_%.bbappend index e9ebdc0a717..288d2e1c346 100644 --- a/meta-ros2-rolling/recipes-bbappends/fastrtps/fastrtps_%.bbappend +++ b/meta-ros2-rolling/recipes-bbappends/fastrtps/fastrtps_%.bbappend @@ -22,3 +22,6 @@ EXTRA_OECMAKE += " -DSM_RUN_RESULT=0 -DSM_RUN_RESULT__TRYRUN_OUTPUT=PTHREAD_RWLO sysroot_stage_all:append() { sysroot_stage_dir ${D}${bindir} ${SYSROOT_DESTDIR}${bindir} } + +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" +SRC_URI += "file://0001-FindTinyXML2.cmake-fix-find_library-libtinyxml2.patch" diff --git a/meta-ros2/classes/ros_ament_cmake.bbclass b/meta-ros2/classes/ros_ament_cmake.bbclass index 49249dea79b..3f0c4260e3d 100644 --- a/meta-ros2/classes/ros_ament_cmake.bbclass +++ b/meta-ros2/classes/ros_ament_cmake.bbclass @@ -25,11 +25,13 @@ export AMENT_PREFIX_PATH="${STAGING_DIR_HOST}${prefix};${STAGING_DIR_NATIVE}${pr inherit cmake python3native +PYTHONPATH:prepend:class-nativesdk = "${STAGING_DIR_NATIVE}${ros_base_prefix}/lib/python${PYTHON_BASEVERSION}/site-packages:" + FILES:${PN}:prepend = " \ ${datadir}/ament_index \ " -EXTRA_OECMAKE:prepend = "\ +EXTRA_OECMAKE:prepend:class-target = "\ -DCMAKE_PREFIX_PATH='${STAGING_DIR_HOST}${ros_prefix};${STAGING_DIR_HOST}${prefix}' \ -DCMAKE_INSTALL_PREFIX:PATH='${ros_prefix}' \ " @@ -38,3 +40,8 @@ EXTRA_OECMAKE:prepend:class-native = "\ -DCMAKE_PREFIX_PATH='${ros_prefix}' \ -DCMAKE_INSTALL_PREFIX:PATH='${ros_prefix}' \ " + +EXTRA_OECMAKE:prepend:class-nativesdk = "\ + -DCMAKE_PREFIX_PATH='${STAGING_DIR_NATIVE}${ros_base_prefix};${STAGING_DIR_NATIVE}${ros_prefix};${STAGING_DIR_NATIVE}${prefix}' \ + -DCMAKE_INSTALL_PREFIX:PATH='${ros_prefix}' \ +" diff --git a/meta-ros2/recipes-devtools/ros-sdk-env/ros-sdk-env_1.0.bb b/meta-ros2/recipes-devtools/ros-sdk-env/ros-sdk-env_1.0.bb new file mode 100644 index 00000000000..f1961c1717f --- /dev/null +++ b/meta-ros2/recipes-devtools/ros-sdk-env/ros-sdk-env_1.0.bb @@ -0,0 +1,45 @@ +# Copyright (c) Stephen Street stephen@redrocketcomputing.com + +SUMMARY = "Add ROS2 SDK enviroment variable" +HOMEPAGE = "https://github.com/meta-ros" +SECTION = "devel" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" + +FILESEXTRAPATHS:prepend := "${THISDIR}/ros-sdk-env:" + +inherit python3native ros_opt_prefix + +FILES:${PN} = "${base_prefix}/environment-setup.d/ros-sdk-env.sh" + +S = "${WORKDIR}" + +# This was pulled from meta-ros/meta-ros2/classes/ros_ament_cmake.bbclass +PYTHON_SOABI_ARCH = "${TUNE_ARCH}-${TARGET_OS}" +PYTHON_SOABI_ARCH_SUFFIX = "-gnu" + +# The suffix is already included in TARGET_OS +PYTHON_SOABI_ARCH_SUFFIX:arm = "" + +# Another exception is i686 TUNE_ARCH in dunfell and newer with this change: +# https://git.openembedded.org/openembedded-core/commit/?h=dunfell&id=6beab388e73b3ac6157650855a6c1fb1d71e8015 +PYTHON_SOABI_ARCH:i686 = "i386-${TARGET_OS}" + +PYTHON_SOABI = "cpython-${@d.getVar('PYTHON_BASEVERSION').replace('.', '')}${PYTHON_ABI}-${PYTHON_SOABI_ARCH}${PYTHON_SOABI_ARCH_SUFFIX}" + +do_install () { + echo "export ROS_VERSION=${ROS_VERSION}" > ${S}/ros-sdk-env.sh + echo "export ROS_PYTHON_VERSION=${ROS_PYTHON_VERSION}" >> ${S}/ros-sdk-env.sh + echo "export ROS_DISTRO=${ROS_DISTRO}" >> ${S}/ros-sdk-env.sh + echo "export PYTHONPATH="'$OECORE_NATIVE_SYSROOT'"/usr/lib/python${PYTHON_BASEVERSION}/site-packages:"'$OECORE_TARGET_SYSROOT'"${ros_base_prefix}/lib/python${PYTHON_BASEVERSION}/site-packages" >> ${S}/ros-sdk-env.sh + echo "export AMENT_PREFIX_PATH="'$OECORE_TARGET_SYSROOT'"${ros_base_prefix}" >> ${S}/ros-sdk-env.sh + echo "export PYTHON_SOABI=${PYTHON_SOABI}.so" >> ${S}/ros-sdk-env.sh + echo "export CMAKE_PYTHON_SOABI=${PYTHON_SOABI}" >> ${S}/ros-sdk-env.sh + echo "export PYTHON3_NUMPY_INCLUDE_DIR="'$OECORE_TARGET_SYSROOT'"/usr/lib/python${PYTHON_BASEVERSION}/site-packages/numpy/core/include" >> ${S}/ros-sdk-env.sh + echo "export PYTHONWARNINGS=ignore" >> ${S}/ros-sdk-env.sh + mkdir -p ${D}${base_prefix}/environment-setup.d + install -m 644 ${S}/ros-sdk-env.sh ${D}${base_prefix}/environment-setup.d +} + +BBCLASSEXTEND = "native nativesdk"