blob: bb633bf09e7f00aa62718db73bff91e24be34be3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
# ROS humble C++ 包:qt_gui_cpp
# 上游 monorepo:https://github.com/ros-visualization/qt_gui_core(humble 分支)
# 本包只取 monorepo 中 qt_gui_cpp 子目录构建,--transform 统一顶层目录为 %%{name}-%%{version}
# topdir: ros-humble-qt-gui-cpp-2.2.5
# 子包目录(CMakeLists.txt 所在):qt_gui_cpp
%define ros_distro humble
%define RosPkgName qt-gui-cpp
Name: ros-%{ros_distro}-%{RosPkgName}
Version: 2.2.5
Release: 1%{?dist}
Summary: qt_gui_cpp provides C++-bindings for qt_gui and creates bindings for every generator available
License: BSD
URL: https://github.com/ros-visualization/qt_gui_core
# 上游为 monorepo;#/ 强制 rpm 内部文件名,--transform 已统一顶层目录为 %%{name}-%%{version}
Source0: https://github.com/ros-visualization/qt_gui_core/archive/refs/heads/humble.tar.gz#/%{name}-%{version}.tar.gz
# debug 子包无意义(/opt 前缀,strip/debugedit 路径非常规),SIG 模板统一关闭
%global debug_package %{nil}
# /opt 下 python 字节码编译会写标准 sitelib 路径,摘掉 brp-python-bytecompile
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
# ROS 包不做自动依赖扫描(.so 全在 /opt/ros 下,由 ament 间接依赖模型替代)
%global __provides_exclude_from ^/opt/ros/%{ros_distro}/.*$
%global __requires_exclude_from ^/opt/ros/%{ros_distro}/.*$
BuildRequires: cmake
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: make
BuildRequires: pkgconf
# ROS 基座构建工具(ament_cmake 形态强制)
BuildRequires: ros-%{ros_distro}-ament-cmake
# package.xml <build_depend>
BuildRequires: ros-%{ros_distro}-pluginlib
BuildRequires: ros-%{ros_distro}-python-qt-binding
BuildRequires: ros-%{ros_distro}-rcpputils
BuildRequires: ros-%{ros_distro}-tinyxml2-vendor
# package.xml <build_depend>qt5-qmake</build_depend> / qtbase5-dev -> openEuler 名 qt5-qtbase-devel
BuildRequires: qt5-qtbase-devel
# TinyXML2(tinyxml2_vendor 包提供 cmake config,tinyxml2-devel 提供库和头文件)
BuildRequires: tinyxml2-devel
# SIP 绑定生成器(python_qt_binding 的 sip_helper.cmake 调用 sip 二进制)
BuildRequires: python3-sip-devel
# Python 开发(ament_python_install_package 需要)
BuildRequires: python3-devel
# 运行时 Requires(/opt/ros 被 __requires_exclude_from 豁免、autodeps 扫不到,必须手写)
Requires: ros-%{ros_distro}-ros-workspace
Requires: ros-%{ros_distro}-ament-cmake
Requires: ros-%{ros_distro}-pluginlib
Requires: ros-%{ros_distro}-qt-gui
Requires: ros-%{ros_distro}-python-qt-binding
Requires: ros-%{ros_distro}-rcpputils
Requires: ros-%{ros_distro}-tinyxml2-vendor
# 单包策略:ROS 包严禁拆实体子包,用虚拟别名兼容依赖方
Provides: %{name}-devel = %{version}-%{release}
Provides: %{name}-doc = %{version}-%{release}
Provides: %{name}-runtime = %{version}-%{release}
%description
qt_gui_cpp provides the foundation for C++-bindings for qt_gui and creates
bindings for every generator available. At least one specific binding must
be available in order to use C++-plugins.
This is the humble (ROS 2) release of the qt_gui_cpp package, built with
the ament_cmake build system and installed under /opt/ros/humble.
%prep
%autosetup -n %{name}-%{version}
%build
# ROS 基座环境(chroot 已配置 ROS SIG repo;setup.sh 不存在时用守卫)
[ -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}
# 显式 out-of-source 构建(避免 openEuler %%cmake 宏位置参数坑)
# monorepo tarball 解压后 CMakeLists.txt 在 qt_gui_cpp/ 子目录,需先 cd 进去
cd qt_gui_cpp
mkdir -p .obj
cd .obj
cmake .. \
-DCMAKE_INSTALL_PREFIX="/opt/ros/%{ros_distro}" \
-DAMENT_PREFIX_PATH="/opt/ros/%{ros_distro}" \
-DCMAKE_PREFIX_PATH="/opt/ros/%{ros_distro}" \
-DCMAKE_C_FLAGS="%{optflags}" \
-DCMAKE_CXX_FLAGS="%{optflags}" \
-UINCLUDE_INSTALL_DIR -ULIB_INSTALL_DIR -USYSCONF_INSTALL_DIR -USHARE_INSTALL_PREFIX -ULIB_SUFFIX \
-DSETUPTOOLS_DEB_LAYOUT=OFF \
-DBUILD_TESTING=OFF
%make_build
%install
cd qt_gui_cpp/.obj
%make_install
%files
# %%files 整树拥有 /opt/ros/%%{ros_distro}(对"装了没打包"类错误免疫)
/opt/ros/%{ros_distro}
%changelog
* Thu Sep 24 2026 openEuler ROS SIG <ros@openeuler.org> - 2.2.5-1
- Initial package for openEuler 24.03 LTS (ROS 2 humble)
|