summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2026-10-12 11:02:15 +0000
committerCoprDistGit <infra@openeuler.org>2026-10-12 11:02:15 +0000
commit6269525eb31254e54723b43516f0abb95a6a6205 (patch)
treef98b015d3884b85389078b6f4c10313d108720e2
parent0ea95015c451870650bc17980ef5965a57b6c931 (diff)
automatic import of ros-humble-aruco-markers
-rw-r--r--aruco-markers.spec20
1 files changed, 14 insertions, 6 deletions
diff --git a/aruco-markers.spec b/aruco-markers.spec
index 8891033..5112c7a 100644
--- a/aruco-markers.spec
+++ b/aruco-markers.spec
@@ -4,7 +4,7 @@
Name: ros-%{ros_distro}-%{RosPkgName}
Version: 0.0.3
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: A ros2 node for detecting aruco markers in camera images
License: MIT
URL: https://github.com/namo-robotics/aruco_markers/tree/humble
@@ -56,19 +56,21 @@ export PYTHONPATH=/opt/ros/%{ros_distro}/lib/python%{python3_version}/site-packa
export PKG_CONFIG_PATH=/opt/ros/%{ros_distro}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}
# Build bundled opencv_contrib aruco module as static library
-# openEuler opencv 4.5.2 does not include aruco contrib (headers or library)
+# openEuler opencv 4.8+ has aruco in mainline with new API that shadows bundled
+# old API 4.5.x headers; put bundled include path FIRST to avoid shadowing.
+# Skip charuco.cpp: project does not use CharucoBoard, and it uses old API
+# (CharucoBoard::create/ids/chessboardCorners/draw) incompatible with system core.
ARUCO_DIR=%{_builddir}/%{RosPkgName}-%{src_version}/opencv_contrib_aruco
ARUCO_BUILD=%{_builddir}/aruco_build
ARUCO_INC=%{_builddir}/aruco_include
mkdir -p "$ARUCO_BUILD" "$ARUCO_INC/opencv2/aruco"
cd "$ARUCO_BUILD"
g++ -c -O2 -g -fPIC -std=c++14 \
- -I/usr/include/opencv4 \
-I"$ARUCO_DIR/include" \
-I"$ARUCO_DIR/src" \
+ -I/usr/include/opencv4 \
"$ARUCO_DIR/src/aruco.cpp" \
"$ARUCO_DIR/src/dictionary.cpp" \
- "$ARUCO_DIR/src/charuco.cpp" \
"$ARUCO_DIR/src/apriltag_quad_thresh.cpp" \
"$ARUCO_DIR/src/zmaxheap.cpp"
ar rcs libaruco_contrib.a *.o
@@ -77,6 +79,7 @@ cp "$ARUCO_DIR/include/opencv2/aruco.hpp" "$ARUCO_INC/opencv2/"
cp "$ARUCO_DIR/include/opencv2/aruco/"*.hpp "$ARUCO_INC/opencv2/aruco/"
# Patch CMakeLists.txt to use bundled aruco headers and static library
+# BEFORE keyword ensures bundled include path takes precedence over system OpenCV
export ARUCO_INC ARUCO_DIR ARUCO_BUILD
cd %{_builddir}/%{RosPkgName}-%{src_version}/aruco_markers
python3 << 'PYEOF'
@@ -89,12 +92,12 @@ with open("CMakeLists.txt") as f:
c = c.replace(
"target_link_libraries(aruco_markers_lib ${OpenCV_LIBRARIES})",
"target_link_libraries(aruco_markers_lib ${OpenCV_LIBRARIES} " + lib + ")\n"
- "target_include_directories(aruco_markers_lib PUBLIC " + inc + " " + src_dir + ")"
+ "target_include_directories(aruco_markers_lib BEFORE PUBLIC " + inc + " " + src_dir + ")"
)
c = c.replace(
"target_link_libraries(aruco_markers aruco_markers_lib ${OpenCV_LIBRARIES})",
"target_link_libraries(aruco_markers aruco_markers_lib ${OpenCV_LIBRARIES} " + lib + ")\n"
- "target_include_directories(aruco_markers PUBLIC " + inc + " " + src_dir + ")"
+ "target_include_directories(aruco_markers BEFORE PUBLIC " + inc + " " + src_dir + ")"
)
with open("CMakeLists.txt", "w") as f:
f.write(c)
@@ -123,6 +126,11 @@ make install DESTDIR=%{buildroot}
/opt/ros/%{ros_distro}
%changelog
+* Mon Oct 12 2026 ai-importer <ai-importer@openeuler.org> - 0.0.3-3
+- Fix include path ordering: bundled aruco headers before system OpenCV
+- Skip charuco.cpp compilation (project does not use CharucoBoard)
+- Add BEFORE keyword to cmake target_include_directories
+
* Mon Oct 12 2026 ai-importer <ai-importer@openeuler.org> - 0.0.3-2
- Bundle opencv_contrib 4.5.2 aruco module (openEuler opencv lacks it)