diff options
| -rw-r--r-- | cartographer-ros.spec | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/cartographer-ros.spec b/cartographer-ros.spec index b747976..0439a4c 100644 --- a/cartographer-ros.spec +++ b/cartographer-ros.spec @@ -4,7 +4,7 @@ Name: ros-%{ros_distro}-%{RosPkgName} Version: 2.0.9002 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Cartographer is a system that provides real-time simultaneous localization and License: Apache 2.0 URL: https://github.com/ros2/cartographer_ros/tree/ros2 @@ -86,11 +86,47 @@ Cartographer is a system that provides real-time simultaneous localization %prep %autosetup -n %{RosPkgName}-%{src_version} +cat > cartographer_ros/include/cartographer_ros/thread_safety_shim.h << 'SHIM' +#ifndef THREAD_SAFETY_SHIM_H +#define THREAD_SAFETY_SHIM_H +#ifndef GUARDED_BY +#define GUARDED_BY(x) +#endif +#ifndef EXCLUSIVE_LOCKS_REQUIRED +#define EXCLUSIVE_LOCKS_REQUIRED(x) +#endif +#ifndef LOCKS_EXCLUDED +#define LOCKS_EXCLUDED(x) +#endif +#ifndef EXCLUSIVE_LOCK_FUNCTION +#define EXCLUSIVE_LOCK_FUNCTION(x) +#endif +#ifndef UNLOCK_FUNCTION +#define UNLOCK_FUNCTION(x) +#endif +#ifndef SHARED_LOCKS_REQUIRED +#define SHARED_LOCKS_REQUIRED(x) +#endif +#ifndef ASSERT_EXCLUSIVE_LOCK +#define ASSERT_EXCLUSIVE_LOCK(x) +#endif +#ifndef NO_THREAD_SAFETY_ANALYSIS +#define NO_THREAD_SAFETY_ANALYSIS +#endif +#endif +SHIM + +for f in cartographer_ros/include/cartographer_ros/node.h \ + cartographer_ros/include/cartographer_ros/map_builder_bridge.h \ + cartographer_ros/include/cartographer_ros/metrics/internal/histogram.h \ + cartographer_ros/include/cartographer_ros/metrics/internal/gauge.h; do + sed -i '1i#include "cartographer_ros/thread_safety_shim.h"' "$f" +done + %build [ -f /opt/ros/%{ros_distro}/setup.sh ] && source /opt/ros/%{ros_distro}/setup.sh || true export PYTHONPATH=/opt/ros/%{ros_distro}/lib/python%{python3_version}/site-packages${PYTHONPATH:+:$PYTHONPATH} export PKG_CONFIG_PATH=/opt/ros/%{ros_distro}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH} -export CXXFLAGS="${CXXFLAGS} -include absl/base/thread_annotations.h" cd cartographer_ros mkdir -p .obj && cd .obj %cmake3 \ @@ -115,6 +151,9 @@ make install DESTDIR=%{buildroot} /opt/ros/%{ros_distro} %changelog +* Tue Sep 29 2026 ai-importer <ai-importer@openeuler.org> - 2.0.9002-4 +- Define thread safety annotation macros via shim header (GUARDED_BY etc.) + * Tue Sep 29 2026 ai-importer <ai-importer@openeuler.org> - 2.0.9002-3 - Force-include absl/base/thread_annotations.h for GUARDED_BY macro definition |
