Skip to content

Commit ecb174a

Browse files
committed
Replace patches for mavros/mavlink with sed one-liners.
1 parent 0a78221 commit ecb174a

File tree

4 files changed

+12
-53
lines changed

4 files changed

+12
-53
lines changed

.docker/Dockerfile

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,18 @@ ARG MAVROS_RELEASE=ros2
114114
ARG MAVLINK_RELEASE=release/rolling/mavlink
115115
RUN git clone --depth 1 -b ${MAVROS_RELEASE} https://github.com/mavlink/mavros.git
116116
RUN 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

126130
WORKDIR $USER_WORKSPACE
127131
RUN sudo apt-get -q update \

.docker/patches/mavlink_standard_library.patch

Lines changed: 0 additions & 15 deletions
This file was deleted.

.docker/patches/mavros_extra_yaml_linkage.patch

Lines changed: 0 additions & 29 deletions
This file was deleted.

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@
99
!blue.repos
1010
!sim.repos
1111
!.docker/entrypoints
12-
!.docker/patches
1312
!requirements-build.txt

0 commit comments

Comments
 (0)