diff options
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | google-cpu_features-create_soname.patch | 13 | ||||
| -rw-r--r-- | google-cpu_features-unbundle_gtest.patch | 45 | ||||
| -rw-r--r-- | google-cpu_features.spec | 68 | ||||
| -rw-r--r-- | sources | 1 | 
5 files changed, 128 insertions, 0 deletions
| @@ -0,0 +1 @@ +/cpu_features-0.9.0.tar.gz diff --git a/google-cpu_features-create_soname.patch b/google-cpu_features-create_soname.patch new file mode 100644 index 0000000..556ca78 --- /dev/null +++ b/google-cpu_features-create_soname.patch @@ -0,0 +1,13 @@ +From https://src.fedoraproject.org/rpms/google-cpu_features/blob/rawhide/f/google-cpu_features-create_soname.patch + +--- a/CMakeLists.orig.txt 2021-02-26 22:26:45.246246073 +0100 ++++ b/CMakeLists.txt      2021-02-26 22:26:09.153781594 +0100 +@@ -129,7 +129,7 @@ +   list(APPEND CPU_FEATURES_SRCS $<TARGET_OBJECTS:unix_based_hardware_detection>) + endif() + add_library(cpu_features ${CPU_FEATURES_HDRS} ${CPU_FEATURES_SRCS}) +-set_target_properties(cpu_features PROPERTIES PUBLIC_HEADER "${CPU_FEATURES_HDRS}") ++set_target_properties(cpu_features PROPERTIES PUBLIC_HEADER "${CPU_FEATURES_HDRS}" SOVERSION "${CPUFEATURES_VERSION_MAJOR}" VERSION "${CPUFEATURES_VERSION}") + setup_include_and_definitions(cpu_features) + target_link_libraries(cpu_features PUBLIC ${CMAKE_DL_LIBS}) + target_include_directories(cpu_features diff --git a/google-cpu_features-unbundle_gtest.patch b/google-cpu_features-unbundle_gtest.patch new file mode 100644 index 0000000..468cb39 --- /dev/null +++ b/google-cpu_features-unbundle_gtest.patch @@ -0,0 +1,45 @@ +From https://src.fedoraproject.org/rpms/google-cpu_features/blob/rawhide/f/google-cpu_features-unbundle_gtest.patch + +--- cpu_features-0.9.0.old/CMakeLists.txt	2023-09-14 13:15:33.000000000 +0100 ++++ cpu_features-0.9.0.new/CMakeLists.txt	2024-03-25 09:46:42.619143407 +0000 +@@ -215,39 +215,7 @@ +   set(CMAKE_CXX_EXTENSIONS OFF) # prefer use of -std14 instead of -gnustd14 +  +   if(NOT TARGET gtest OR NOT TARGET gmock_main) +-    # Download and unpack googletest at configure time. +-    configure_file( +-      cmake/googletest.CMakeLists.txt.in +-      googletest-download/CMakeLists.txt +-    ) +- +-    execute_process( +-      COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . +-      RESULT_VARIABLE result +-      WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download) +- +-    if(result) +-      message(FATAL_ERROR "CMake step for googletest failed: ${result}") +-    endif() +- +-    execute_process( +-      COMMAND ${CMAKE_COMMAND} --build . +-      RESULT_VARIABLE result +-      WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download) +- +-    if(result) +-      message(FATAL_ERROR "Build step for googletest failed: ${result}") +-    endif() +- +-    # Prevent overriding the parent project's compiler/linker settings on +-    # Windows. +-    set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) +- +-    # Add googletest directly to our build. This defines the gtest and +-    # gtest_main targets. +-    add_subdirectory(${CMAKE_BINARY_DIR}/googletest-src +-                     ${CMAKE_BINARY_DIR}/googletest-build +-                     EXCLUDE_FROM_ALL) ++    find_package(GTest) +   endif() +  +   add_subdirectory(test) diff --git a/google-cpu_features.spec b/google-cpu_features.spec new file mode 100644 index 0000000..9213142 --- /dev/null +++ b/google-cpu_features.spec @@ -0,0 +1,68 @@ +# Modified from https://src.fedoraproject.org/rpms/google-cpu_features/blob/rawhide/f/google-cpu_features.spec + +# Unsupported +# https://github.com/google/cpu_features#support +# https://bugzilla.redhat.com/show_bug.cgi?id=1997167 +ExcludeArch: s390x + +Name:    google-cpu_features +Version: 0.9.0 +Release: 1 +Summary: A cross-platform C library to retrieve CPU features at runtime +# Automatically converted from old format: ASL 2.0 - review is highly recommended. +License: Apache-2.0 +URL:     https://github.com/google/cpu_features +Source0: https://github.com/google/cpu_features/archive/v%{version}/cpu_features-%{version}.tar.gz + +Patch0:  google-cpu_features-unbundle_gtest.patch +Patch1:  google-cpu_features-create_soname.patch + +BuildRequires: cmake +BuildRequires: gcc +BuildRequires: gcc-c++ +BuildRequires: gmock-devel +BuildRequires: gtest-devel +BuildRequires: make + +%description +A cross-platform C library to retrieve CPU features at runtime. + +%package devel +Summary: %{name} headers and development-related files +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +%{name} headers and development-related files, CMake config files. + +%prep +%autosetup -n cpu_features-%{version} -p1 + +%build +cmake \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ + -DCPUFEATURES_VERSION_MAJOR:STRING=0 \ + -DCPUFEATURES_VERSION:STRING=0.7 \ + -DCMAKE_SKIP_INSTALL_RPATH:BOOL=YES \ + -DBUILD_PIC:BOOL=ON -DBUILD_TESTING:BOOL=ON +cmake --build . + +%install +DESTDIR="%{buildroot}" cmake --install . + +%files +%license LICENSE +%doc README.md CONTRIBUTING.md +%{_bindir}/list_cpu_features +%{_libdir}/libcpu_features.so.0.7 +%{_libdir}/libcpu_features.so.0 + +%files devel +%{_libdir}/libcpu_features.so +%{_includedir}/cpu_features/ +%{_libdir}/cmake/CpuFeatures/ + +%changelog +* Thu Nov 21 2024 Suyun <ziyu.oerv@isrc.iscas.ac.cn> - 0.9.0-1 +- Init package at 0.2.25 @@ -0,0 +1 @@ +383ee74871f1e85e625a32c7e72e7777  cpu_features-0.9.0.tar.gz | 
