summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2025-03-08 14:22:57 +0000
committerCoprDistGit <infra@openeuler.org>2025-03-08 14:22:57 +0000
commit6e48eafe495952fdeabda9faf67fccd0d9e6efc8 (patch)
tree06451970a75db169e77ffc7d5289d5da55df45fd
parentfb5147627e988a30a063f74a51f43b93b11fb78b (diff)
automatic import of ros-humble-magic-enumopeneuler24.03_LTS
-rw-r--r--.gitignore1
-rw-r--r--magic-enum.spec102
-rw-r--r--magic_enum-fix-build_tests.patch12
-rw-r--r--sources1
4 files changed, 116 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..8bd21bd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/ros-humble-magic-enum_0.8.2.orig.tar.gz
diff --git a/magic-enum.spec b/magic-enum.spec
new file mode 100644
index 0000000..bb31836
--- /dev/null
+++ b/magic-enum.spec
@@ -0,0 +1,102 @@
+%bcond_without tests
+%bcond_without weak_deps
+
+%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}/.*$
+
+%define RosPkgName magic-enum
+%define ros_distro humble
+
+Name: ros-%{ros_distro}-%{RosPkgName}
+Version: 0.8.2
+Release: 2%{?dist}%{?release_suffix}
+Summary: ROS magic-enum package
+
+License: MIT
+Source0: %{name}_%{version}.orig.tar.gz
+Patch0: magic_enum-fix-build_tests.patch
+
+Requires: ros-%{ros_distro}-ros-workspace
+
+BuildRequires: cmake
+BuildRequires: ros-%{ros_distro}-ros-workspace
+
+%if 0%{?with_tests}
+%endif
+
+Provides: %{name}-devel = %{version}-%{release}
+Provides: %{name}-doc = %{version}-%{release}
+Provides: %{name}-runtime = %{version}-%{release}
+
+%description
+
+ Static reflection for enums (to string, from string, iteration) for modern C++,
+ work with any enum type without any macro or boilerplate code
+
+
+%prep
+%autosetup -p1
+
+%build
+# Needed to bootstrap since the ros_workspace package does not yet exist.
+export PYTHONPATH=/opt/ros/%{ros_distro}/lib/python%{python3_version}/site-packages
+
+# In case we're installing to a non-standard location, look for a setup.sh
+# in the install tree and source it. It will set things like
+# CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH.
+if [ -f "/opt/ros/%{ros_distro}/setup.sh" ]; then . "/opt/ros/%{ros_distro}/setup.sh"; fi
+mkdir -p .obj-%{_target_platform} && cd .obj-%{_target_platform}
+%cmake3 \
+ -UINCLUDE_INSTALL_DIR \
+ -ULIB_INSTALL_DIR \
+ -USYSCONF_INSTALL_DIR \
+ -USHARE_INSTALL_PREFIX \
+ -ULIB_SUFFIX \
+ -DCMAKE_INSTALL_PREFIX="/opt/ros/%{ros_distro}" \
+ -DAMENT_PREFIX_PATH="/opt/ros/%{ros_distro}" \
+ -DCMAKE_PREFIX_PATH="/opt/ros/%{ros_distro}" \
+ -DSETUPTOOLS_DEB_LAYOUT=OFF \
+%if !0%{?with_tests}
+ -DBUILD_TESTING=OFF \
+%endif
+ ..
+
+%make_build
+
+%install
+# Needed to bootstrap since the ros_workspace package does not yet exist.
+export PYTHONPATH=/opt/ros/%{ros_distro}/lib/python%{python3_version}/site-packages
+
+# In case we're installing to a non-standard location, look for a setup.sh
+# in the install tree and source it. It will set things like
+# CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH.
+if [ -f "/opt/ros/%{ros_distro}/setup.sh" ]; then . "/opt/ros/%{ros_distro}/setup.sh"; fi
+%make_install -C .obj-%{_target_platform}
+
+%if 0%{?with_tests}
+%check
+# Needed to bootstrap since the ros_workspace package does not yet exist.
+export PYTHONPATH=/opt/ros/%{ros_distro}/lib/python%{python3_version}/site-packages
+
+# Look for a Makefile target with a name indicating that it runs tests
+TEST_TARGET=$(%__make -qp -C .obj-%{_target_platform} | sed "s/^\(test\|check\):.*/\\1/;t f;d;:f;q0")
+if [ -n "$TEST_TARGET" ]; then
+# In case we're installing to a non-standard location, look for a setup.sh
+# in the install tree and source it. It will set things like
+# CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH.
+if [ -f "/opt/ros/%{ros_distro}/setup.sh" ]; then . "/opt/ros/%{ros_distro}/setup.sh"; fi
+CTEST_OUTPUT_ON_FAILURE=1 \
+ %make_build -C .obj-%{_target_platform} $TEST_TARGET || echo "RPM TESTS FAILED"
+else echo "RPM TESTS SKIPPED"; fi
+%endif
+
+%files
+/opt/ros/%{ros_distro}
+
+%changelog
+* Thu Oct 30 2023 619409713@qq.com - 0.8.2-2
+- fix build test by davidhan008
+* Thu May 04 2023 Neargye neargye@gmail.com - 0.8.2-1
+- Autogenerated by ros-porting-tools
diff --git a/magic_enum-fix-build_tests.patch b/magic_enum-fix-build_tests.patch
new file mode 100644
index 0000000..4031483
--- /dev/null
+++ b/magic_enum-fix-build_tests.patch
@@ -0,0 +1,12 @@
+diff -Naur ros-humble-magic-enum-0.8.2_orig/CMakeLists.txt ros-humble-magic-enum-0.8.2/CMakeLists.txt
+--- ros-humble-magic-enum-0.8.2_orig/CMakeLists.txt 2022-12-12 23:05:39.000000000 +0800
++++ ros-humble-magic-enum-0.8.2/CMakeLists.txt 2023-10-21 20:11:50.000000000 +0800
+@@ -10,7 +10,7 @@
+
+ option(MAGIC_ENUM_OPT_ENABLE_NONASCII "Enable support for non-ASCII enumeration identifier" OFF)
+ option(MAGIC_ENUM_OPT_BUILD_EXAMPLES "Build magic_enum examples" ${IS_TOPLEVEL_PROJECT})
+-option(MAGIC_ENUM_OPT_BUILD_TESTS "Build and perform magic_enum tests" ${IS_TOPLEVEL_PROJECT})
++option(MAGIC_ENUM_OPT_BUILD_TESTS "Build and perform magic_enum tests" OFF)
+ option(MAGIC_ENUM_OPT_INSTALL "Generate and install magic_enum target" ${IS_TOPLEVEL_PROJECT})
+
+ if(MAGIC_ENUM_OPT_BUILD_EXAMPLES)
diff --git a/sources b/sources
new file mode 100644
index 0000000..4a7344a
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+5706aecf3fd6913961b1834064a3d870 ros-humble-magic-enum_0.8.2.orig.tar.gz