@@ -114,14 +114,18 @@ ARG MAVROS_RELEASE=ros2
114114ARG MAVLINK_RELEASE=release/rolling/mavlink
115115RUN git clone --depth 1 -b ${MAVROS_RELEASE} https://github.com/mavlink/mavros.git
116116RUN git clone --depth 1 --recursive -b ${MAVLINK_RELEASE} https://github.com/mavlink/mavlink-gbp-release.git mavlink
117- # mavgen uses future.standard_library for backwards compatibility with Python2;
118- # However, this caused issues Python3.12 as installed in "noble".
119- # Comment those lines out in mavlink.
120- # n.b. This may not be the best way to do this. A sed one-liner?
121- RUN patch -d mavlink -p 1 < $USER_WORKSPACE/src/blue/.docker/patches/mavlink_standard_library.patch
122- # Fix linkage for yaml-cpp in mavros_extra_plugins
123- RUN patch -d mavros -p 1 < $USER_WORKSPACE/src/blue/.docker/patches/mavros_extra_yaml_linkage.patch
124-
117+ # - mavgen uses future.standard_library for backwards compatibility with Python2;
118+ # However, this caused issues with Python 3.12 installed in "noble".
119+ # Comment those lines out in mavlink.
120+ #
121+ # - Fix linkage for yaml-cpp in mavros_extra_plugins
122+ RUN sed -i -e 's/^from future import standard_library/#from future import standard_library/' \
123+ -e 's/standard_library.install_aliases()/#standard_library.install_aliases()/' \
124+ mavlink/pymavlink/generator/mavgen.py && \
125+ sed -i -e 's/^# find_package(yaml_cpp REQUIRED)/find_package(yaml-cpp REQUIRED)/' \
126+ -e '/^ament_target_dependencies(mavros_extras_plugins$/i target_link_libraries(mavros_extras_plugins yaml-cpp::yaml-cpp)' \
127+ -e '/^ament_target_dependencies(mavros_extras$/i target_link_libraries(mavros_extras yaml-cpp::yaml-cpp)' \
128+ mavros/mavros_extras/CMakeLists.txt
125129
126130WORKDIR $USER_WORKSPACE
127131RUN sudo apt-get -q update \
0 commit comments