Fix cartographer for ROS 2
Some checks failed
Build / build (humble, aarch64-linux) (push) Has been cancelled
Build / build (humble, x86_64-linux) (push) Has been cancelled
Build / build (jazzy, aarch64-linux) (push) Has been cancelled
Build / build (jazzy, x86_64-linux) (push) Has been cancelled
Build / build (noetic, aarch64-linux) (push) Has been cancelled
Build / build (noetic, x86_64-linux) (push) Has been cancelled
Build / build (rolling, aarch64-linux) (push) Has been cancelled
Build / build (rolling, x86_64-linux) (push) Has been cancelled

With this, cartographer builds at least for Humble, Jazzy and Rolling.

Closes #430
This commit is contained in:
Michal Sojka 2025-04-02 12:43:51 +02:00 committed by Ben Wolsieffer
parent 7f759739c2
commit 215f4895bf

View file

@ -51,6 +51,24 @@ rosSelf: rosSuper: with rosSelf.lib; {
'';
});
# Cartographer is unmaintained upstream:
# https://github.com/cartographer-project/cartographer?tab=readme-ov-file#a-note-for-ros-users
cartographer = rosSuper.cartographer.overrideAttrs ({
nativeBuildInputs ? [],
postPatch ? "", ...
}: {
nativeBuildInputs = nativeBuildInputs ++ [ self.pkg-config ];
# Add ABSL_ prefix to thread annotation macros. See
# https://github.com/abseil/abseil-cpp/commit/6acb60c161f1203e6eca929b87f2041da7714bfe
# Note that the mentioned ABSL_LEGACY_THREAD_ANNOTATIONS is no
# longer available so we have to patch all call sites.
postPatch = ''
sed -i -Ee 's/\<(LOCKS_EXCLUDED|EXCLUSIVE_LOCKS_REQUIRED|GUARDED_BY)\>/ABSL_\1/g' \
$(find -name \*.h -o -name \*.cc )
'';
});
cyclonedds = rosSuper.cyclonedds.overrideAttrs ({
cmakeFlags ? [], ...
}: {