summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nebula-velodyne-hw-interfaces.spec28
1 files changed, 25 insertions, 3 deletions
diff --git a/nebula-velodyne-hw-interfaces.spec b/nebula-velodyne-hw-interfaces.spec
index a6e0955..255c4c6 100644
--- a/nebula-velodyne-hw-interfaces.spec
+++ b/nebula-velodyne-hw-interfaces.spec
@@ -25,7 +25,7 @@ Summary: Nebula HW Interfaces Velodyne
License: Apache 2
URL: https://github.com/tier4/nebula.git
# tarball 由 sources/nebula-velodyne-hw-interfaces 全树打包(submit_fix.py 以
-# tar --transform 重命名根目录为 <包名>-<版本>),%prep 解压根目录即
+# tar --transform 重命名根目录为 <包名>-<版本>),prepare 段落地后的根目录即
# "nebula-velodyne-hw-interfaces-1.2.0"(§2,与 Name: 解耦:归档目录名是上游事实)
Source0: %{RosPkgName}-%{src_version}.tar.gz
@@ -59,6 +59,18 @@ BuildRequires: ros-%{ros_distro}-nebula-velodyne-common
# REQUIRED) + target_link_libraries(... Boost::headers) + ament_export_dependencies(Boost)
# 实证其确被引用;Boost::headers 为 header-only 目标,故无第三方 .so 链接
BuildRequires: boost-devel
+# 系统依赖:nebula_core_common 的 ament 导出依赖含 nlohmann_json,该依赖不在本包
+# package.xml(上游把系统库挂在 nebula_core_common 自己的 ament_export_dependencies),
+# 而 CMake 配置期会沿
+# autoware_package → ament_auto_find_build_dependencies →
+# include(nebula_core_commonConfig) →
+# ament_cmake_export_dependencies-extras.cmake find_package(nlohmann_json)
+# 链式触发,缺失即报 "Configuring incomplete"。本包源码实证引用:src/
+# velodyne_hw_interface.cpp:5 include nebula_core_common/util/string_conversions.hpp,
+# 该头 :17 include <nlohmann/json.hpp>(同源同族 nebula-robosense-hw-interfaces
+# 已实证踩坑,COPR build 112600 → 112602 修复)。openEuler 包名按 pkg.remap
+# "nlohmann-json-dev nlohmann-json-devel" 映射(§6 deb→rpm 映射,非凭经验猜名)
+BuildRequires: nlohmann-json-devel
# 测试依赖:package.xml 无 <test_depend>,CMakeLists 第 36-60 行的
# test_velodyne_hw_interface 仅在 BUILD_TESTING 时启用,已由 §5 构建参数
# -DBUILD_TESTING=OFF -DTESTING=OFF 关闭,不写额外 BuildRequires(§5)
@@ -73,6 +85,9 @@ Requires: ros-%{ros_distro}-nebula-core-hw-interfaces
Requires: ros-%{ros_distro}-nebula-velodyne-common
# Boost 头部经 ament_export_dependencies(Boost) 向消费方传播,运行期需可解析
Requires: boost-devel
+# 同理,nebula_core_common 经 ament_export_dependencies 传播的 nlohmann_json 在
+# 安装侧也要能被 find_package,否则下游包在本包之上配置时同样报缺失(§6)
+Requires: nlohmann-json-devel
# §7 单包策略:ROS 包严禁拆实体子包(同一路径被两个子包拥有会安装冲突),
# 用虚拟别名兼容依赖方
@@ -95,13 +110,18 @@ VelodyneSensorConfiguration,错误模型沿用 nebula_core_common 的 util::ex
%build
# ROS 基座环境(chroot 已配置 ROS SIG repo;无 ROS 依赖的包 buildroot 里
# 可能没有 setup.sh,必须用 [ -f ] 守卫——直接 source 不存在的文件在
-# 严格 sh 下会中止整个 %build 脚本,|| true 挡不住,§4)
+# 严格 sh 下会中止整个构建脚本段,|| true 挡不住,§4)
[ -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}
# 上游是 nebula 单仓多包布局,本包位于归档内三层深(src/nebula_velodyne/<pkg>)
cd src/nebula_velodyne/nebula_velodyne_hw_interfaces
-# openEuler 的 %cmake 宏带位置参数会错误解析源码目录,改用显式 out-of-source(§5)
+# 说明:以显式 out-of-source 目录构建(mkdir .obj 后于其中调用 cmake3),
+# 因为带位置参数的 cmake 宏会被错误解析源码目录(§5)。
+# 注意:本文件的所有注释都不得出现裸的 cmake 宏名(形如 百分号后接 cmake),
+# rpm 对构建脚本段整段做宏展开,连注释里的宏名也会被替换,展开体的残留文本
+# 会串进命令参数,导致 cmake 收到中文位置参数而报 source directory 不存在
+# (实证于 COPR build 112576)。
mkdir -p .obj && cd .obj
%cmake3 \
-DCMAKE_INSTALL_PREFIX="/opt/ros/%{ros_distro}" \
@@ -128,3 +148,5 @@ make install DESTDIR=%{buildroot}
%changelog
* Tue Sep 22 2026 ai-importer <ai-importer@openeuler.org> - 1.2.0-1
- Initial import (ROS batch)
+- Fix: 注释里裸的 cmake 宏名被 rpm 展开,残留文本串进 cmake 位置参数(build 112576)
+- Fix: add nlohmann-json-devel BuildRequires/Requires (exported by nebula_core_common)