diff options
| author | CoprDistGit <infra@openeuler.org> | 2026-10-09 04:36:11 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2026-10-09 04:36:11 +0000 |
| commit | b32f8bf0156d2188b53b08375b38a37ff23601ca (patch) | |
| tree | e2b6f72928180969ca2b75a529bdcb06c4a7375c | |
| parent | ad16a5f96b1fdd067a3bc0c16883df05ee400fd3 (diff) | |
automatic import of ament_cmake
| -rw-r--r-- | ament_cmake.spec | 124 | ||||
| -rw-r--r-- | sources | 2 |
2 files changed, 73 insertions, 53 deletions
diff --git a/ament_cmake.spec b/ament_cmake.spec index 2dba03a..c09126a 100644 --- a/ament_cmake.spec +++ b/ament_cmake.spec @@ -1,13 +1,7 @@ -# topdir: ament_cmake-2.9.2 -# ROS 2 ament_cmake meta-package: 22 CMake-based sub-packages built in staged order -# Build type: ament_cmake (CMake with ROS ament macros) -# Staged build: sub-packages built in dependency order, each installed to staging -# area so subsequent packages can find_package() their dependencies - -%global debug_package %{nil} -%global __provides_exclude_from ^/opt/ros/.* -%global __requires_exclude_from ^/opt/ros/.* -%global __os_install_post %{nil} +# topdir: ament_cmake-2.9.2 (from --transform; no upstream release tag for 2.9.2, +# source is rolling branch HEAD commit 3148e68c3a0fe34cec40c6563c9020261f010fab) +%define ros_distro humble +# ros_distro is not in session.json; derived from COPR project name ROS-humble-2. Name: ament_cmake Version: 2.9.2 @@ -16,76 +10,102 @@ Summary: The entry point package for the ament buildsystem in CMake License: Apache-2.0 URL: https://github.com/ament/ament_cmake -Source0: https://github.com/ament/ament_cmake/archive/3148e68c3a0fe34cec40c6563c9020261f010fab.tar.gz#/ament_cmake-%{version}.tar.gz - -BuildArch: noarch +Source0: https://github.com/ament/ament_cmake/archive/3148e68c3a0fe34cec40c6563c9020261f010fab.tar.gz#/%{name}-%{version}.tar.gz +# ament_cmake is the ROS 2 ament CMake buildsystem. It is a monorepo of ~22 +# sub-packages, each with its own package.xml + CMakeLists.txt (no top-level +# CMakeLists.txt). This SRPM builds them all in topological order into one RPM. BuildRequires: cmake +BuildRequires: make +BuildRequires: gcc-c++ BuildRequires: python3-devel -BuildRequires: python3-setuptools -BuildRequires: python3-ament-package -BuildRequires: python3-catkin-pkg-modules +BuildRequires: python3-catkin_pkg +# package_xml_2_cmake.py (ament_cmake_core) imports catkin_pkg.package at configure time + +# ROS layout: install to /opt/ros/<distro>; no debug subpackage; strip brp bytecompile +%global debug_package %{nil} +%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g') +%global __provides_exclude_from ^/opt/ros/%{ros_distro}/.*$ +%global __requires_exclude_from ^/opt/ros/%{ros_distro}/.*$ + +# Single package, no real subpackages; provide the conventional aliases. +Provides: %{name}-devel = %{version}-%{release} +Provides: %{name}-doc = %{version}-%{release} +Provides: %{name}-runtime = %{version}-%{release} %description The entry point package for the ament buildsystem in CMake. -Contains the core CMake macros and utilities used by ROS 2 packages -to build with the ament build system. This meta-package aggregates -all ament_cmake sub-packages including ament_cmake_core, -ament_cmake_export_*, ament_cmake_test, ament_cmake_python, and others. +This package aggregates the ament_cmake CMake buildsystem components +(ament_cmake_core and the export/test/python/gmock/gtest sub-packages), +installed under /opt/ros/%{ros_distro}. %prep -%autosetup -n %{name}-%{version} -p1 +%autosetup -n %{name}-%{version} %build -# Staged build: each sub-package built and installed to staging area -# so subsequent packages can find_package() their dependencies -STAGING=%{_builddir}/staging -ROS_PREFIX=/opt/ros/humble +# ament_cmake IS the ROS buildsystem bootstrap: the buildroot has no +# pre-existing /opt/ros/<distro>/setup.sh, so guard any sourcing. +[ -f /opt/ros/%{ros_distro}/setup.sh ] && . /opt/ros/%{ros_distro}/setup.sh || true +export CMAKE_PREFIX_PATH="%{buildroot}/opt/ros/%{ros_distro}${CMAKE_PREFIX_PATH:+:${CMAKE_PREFIX_PATH}}" +export AMENT_PREFIX_PATH="%{buildroot}/opt/ros/%{ros_distro}" +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}" -# Build order (topological by find_package dependencies): -# Level 0: ament_cmake_core (self-referencing cmake dir, no ament deps) -# Level 1: packages depending only on ament_cmake_core -# Level 2: packages depending on level 1 (e.g. ament_cmake_test -> python) -# Level 3: packages depending on level 2 (e.g. ament_cmake_auto -> ament_cmake) -for pkg in \ +# Topological build order (derived from each package.xml buildtool/build deps). +# With BUILD_TESTING=OFF the test-only find_package() calls are skipped, so +# ament_cmake_gen_version_h does not need ament_cmake_gtest, etc. +SUBPKGS=" \ ament_cmake_core \ - ament_cmake_version \ - ament_cmake_export_dependencies \ ament_cmake_export_definitions \ + ament_cmake_export_dependencies \ ament_cmake_export_include_directories \ ament_cmake_export_libraries \ ament_cmake_export_link_flags \ ament_cmake_export_targets \ - ament_cmake_libraries \ + ament_cmake_gen_version_h \ + ament_cmake_gmock \ + ament_cmake_gtest \ ament_cmake_include_directories \ - ament_cmake_target_dependencies \ + ament_cmake_libraries \ ament_cmake_python \ - ament_cmake_gtest \ - ament_cmake_gmock \ - ament_cmake_google_benchmark \ - ament_cmake_gen_version_h \ + ament_cmake_target_dependencies \ + ament_cmake_version \ ament_cmake_vendor_package \ ament_cmake_test \ + ament_cmake \ + ament_cmake_google_benchmark \ ament_cmake_pytest \ + ament_cmake_auto \ ament_cmake_python_test \ - ament_cmake \ - ament_cmake_auto -do - cmake -S ${pkg} -B build/${pkg} \ - -DCMAKE_INSTALL_PREFIX=${ROS_PREFIX} \ - -DCMAKE_PREFIX_PATH=${STAGING}${ROS_PREFIX} \ - -DBUILD_TESTING=OFF - cmake --build build/${pkg} - DESTDIR=${STAGING} cmake --install build/${pkg} +" + +for pkg in $SUBPKGS; do + echo "===== building $pkg =====" + cmake -S "$pkg" -B ".obj/$pkg" \ + -DCMAKE_INSTALL_PREFIX="/opt/ros/%{ros_distro}" \ + -DCMAKE_PREFIX_PATH="%{buildroot}/opt/ros/%{ros_distro}" \ + -DAMENT_PREFIX_PATH="%{buildroot}/opt/ros/%{ros_distro}" \ + -DBUILD_TESTING=OFF \ + -DTESTING=OFF \ + -DCMAKE_SUPPRESS_REGENERATION=ON \ + -DSETUPTOOLS_DEB_LAYOUT=OFF \ + -UINCLUDE_INSTALL_DIR -ULIB_INSTALL_DIR -USYSCONF_INSTALL_DIR \ + -USHARE_INSTALL_PREFIX -ULIB_SUFFIX \ + -DCMAKE_C_FLAGS="%{optflags}" \ + -DCMAKE_CXX_FLAGS="%{optflags}" \ + -G "Unix Makefiles" + cmake --build ".obj/$pkg" --verbose -- -j%{?_smp_mflags} + DESTDIR="%{buildroot}" cmake --install ".obj/$pkg" done %install -cp -a %{_builddir}/staging/opt %{buildroot}/opt +# Everything installed into the buildroot by %build; nothing more to do. %files +/opt/ros/%{ros_distro} %license LICENSE -/opt/ros/humble/ %changelog -* Fri Oct 09 2026 openEuler Builder <builder@openeuler.org> - 2.9.2-1 -- Initial package +* Fri Oct 09 2026 AI Importer <ai-importer@openeuler.org> - 2.9.2-1 +- Initial packaging of ament_cmake 2.9.2 (ROS ament CMake buildsystem) +- Builds all 22 sub-packages in topological order into /opt/ros/humble @@ -1 +1 @@ -4cdcdebd0e4fce372db35160b03551f9 ament_cmake-2.9.2.tar.gz +dd18b6cbbd38ddcac813da8a86741c08 ament_cmake-2.9.2.tar.gz |
