diff --git a/.abseil-cpp.metadata b/.abseil-cpp.metadata new file mode 100644 index 0000000..418cfc1 --- /dev/null +++ b/.abseil-cpp.metadata @@ -0,0 +1 @@ +2d46ae096bfbdab19de1d65079b95e0fae9efe2e SOURCES/abseil-cpp-20210324.2.tar.gz diff --git a/SOURCES/abseil-cpp-20210324-gtest.patch b/SOURCES/abseil-cpp-20210324-gtest.patch new file mode 100644 index 0000000..a43b5ca --- /dev/null +++ b/SOURCES/abseil-cpp-20210324-gtest.patch @@ -0,0 +1,26 @@ +diff -up ./CMakeLists.txt.2 ./CMakeLists.txt +--- ./CMakeLists.txt.2 2021-04-20 12:55:14.000000000 -0400 ++++ ./CMakeLists.txt 2021-05-21 22:26:12.910191071 -0400 +@@ -127,6 +127,22 @@ if(BUILD_TESTING) + set(absl_gtest_src_dir ${ABSL_LOCAL_GOOGLETEST_DIR}) + endif() + include(CMake/Googletest/DownloadGTest.cmake) ++ else() ++ # Set up gtest targets ++ find_library(GTEST_LIB gtest) ++ add_library(gtest UNKNOWN IMPORTED) ++ set_target_properties(gtest PROPERTIES IMPORTED_LOCATION ${GTEST_LIB}) ++ find_library(GTEST_MAIN_LIB gtest_main) ++ add_library(gtest_main UNKNOWN IMPORTED) ++ set_target_properties(gtest_main PROPERTIES IMPORTED_LOCATION ${GTEST_MAIN_LIB} INTERFACE_LINK_LIBRARIES gtest) ++ ++ # Set up gmock targets ++ find_library(GMOCK_LIB gmock) ++ add_library(gmock UNKNOWN IMPORTED) ++ set_target_properties(gmock PROPERTIES IMPORTED_LOCATION ${GMOCK_LIB} INTERFACE_LINK_LIBRARIES gtest) ++ find_library(GMOCK_MAIN_LIB gmock_main) ++ add_library(gmock_main UNKNOWN IMPORTED) ++ set_target_properties(gmock_main PROPERTIES IMPORTED_LOCATION ${GMOCK_MAIN_LIB} INTERFACE_LINK_LIBRARIES "gmock;Threads::Threads") + endif() + + check_target(gtest) diff --git a/SOURCES/abseil-cpp-20210324.2-armv7.patch b/SOURCES/abseil-cpp-20210324.2-armv7.patch new file mode 100644 index 0000000..9a5eaec --- /dev/null +++ b/SOURCES/abseil-cpp-20210324.2-armv7.patch @@ -0,0 +1,19 @@ +diff -up ./absl/base/internal/sysinfo_test.cc.armv7 ./absl/base/internal/sysinfo_test.cc +--- ./absl/base/internal/sysinfo_test.cc.armv7 2021-06-09 21:54:44.503755718 -0400 ++++ ./absl/base/internal/sysinfo_test.cc 2021-06-09 22:56:14.459611843 -0400 +@@ -43,13 +43,13 @@ TEST(SysinfoTest, NumCPUs) { + // POWER is particularly problematic here; some Linux kernels expose the CPU + // frequency, while others do not. Since we can't predict a priori what a given + // machine is going to do, just disable this test on POWER on Linux. +-#if !(defined(__linux) && (defined(__ppc64__) || defined(__PPC64__))) ++#if !(defined(__linux) && (defined(__ppc64__) || defined(__PPC64__) || defined(__aarch64__) || defined(__arm__))) + TEST(SysinfoTest, NominalCPUFrequency) { + // Linux only exposes the CPU frequency on certain architectures, and + // Emscripten doesn't expose it at all. + #if defined(__linux__) && \ + (defined(__aarch64__) || defined(__hppa__) || defined(__mips__) || \ +- defined(__riscv) || defined(__s390x__)) || \ ++ defined(__riscv) || defined(__s390x__)) || \ + defined(__EMSCRIPTEN__) + EXPECT_EQ(NominalCPUFrequency(), 1.0) + << "CPU frequency detection was fixed! Please update unittest."; diff --git a/SPECS/abseil-cpp.spec b/SPECS/abseil-cpp.spec new file mode 100644 index 0000000..1fc5623 --- /dev/null +++ b/SPECS/abseil-cpp.spec @@ -0,0 +1,121 @@ +# Force out of source build +%undefine __cmake_in_source_build + +# Installed library version +%global lib_version 2103.0.1 + +Name: abseil-cpp +Version: 20210324.2 +Release: 2%{?dist} +Summary: C++ Common Libraries + +License: ASL 2.0 +URL: https://abseil.io +Source0: https://github.com/abseil/abseil-cpp/archive/%{version}/%{name}-%{version}.tar.gz + +# Set up system gtest and gmock targets to allow test suite to be built. +# abseil-cpp expects the targets to be created by a bundled copy of gtest/gmock. +# This patch replicates those targets via find_library and imported targets. +# Not submitted upstream. +Patch1: abseil-cpp-20210324-gtest.patch + +# Disable CPU frequency detection on armv7hl architectures. +# Makes test consistent with aarch64 CPUs. +# Not submitted upstream. +Patch2: abseil-cpp-20210324.2-armv7.patch + +BuildRequires: cmake +BuildRequires: gcc-c++ +BuildRequires: gmock-devel +BuildRequires: gtest-devel +BuildRequires: make + +%description +Abseil is an open-source collection of C++ library code designed to augment +the C++ standard library. The Abseil library code is collected from +Google's own C++ code base, has been extensively tested and used in +production, and is the same code we depend on in our daily coding lives. + +In some cases, Abseil provides pieces missing from the C++ standard; in +others, Abseil provides alternatives to the standard for special needs we've +found through usage in the Google code base. We denote those cases clearly +within the library code we provide you. + +Abseil is not meant to be a competitor to the standard library; we've just +found that many of these utilities serve a purpose within our code base, +and we now want to provide those resources to the C++ community as a whole. + +%package devel +Summary: Development files for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +Development headers for %{name} + +%prep +%autosetup -p1 -S gendiff +# Remove macro only defined in googletest git master +#sed -i 's|GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST|//|' absl/container/internal/unordered_map_modifiers_test.h + +%build +%cmake \ + -DABSL_USE_EXTERNAL_GOOGLETEST:BOOL=ON \ + -DBUILD_TESTING:BOOL=ON \ + -DCMAKE_BUILD_TYPE:STRING=None \ + -DCMAKE_CXX_STANDARD:STRING=17 +%cmake_build + + +%install +%cmake_install + +%check +# s390x does not seem to be supported, several tests fail. +# Make tests informational until failures are resolved. +%ifarch s390x +%ctest --output-on-failure || : +%else +%ctest --output-on-failure +%endif + +%files +%license LICENSE +%doc FAQ.md README.md UPGRADES.md +%{_libdir}/libabsl_*.so.%{lib_version} + +%files devel +%{_includedir}/absl +%{_libdir}/libabsl_*.so +%{_libdir}/cmake/absl +%{_libdir}/pkgconfig/*.pc + +%changelog +* Wed Jul 21 2021 Fedora Release Engineering - 20210324.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Fri May 21 2021 Rich Mattes - 20210324.1-2 +- Update to release 20210324.2 +- Enable and run test suite + +* Mon Mar 08 2021 Rich Mattes - 20200923.3-1 +- Update to release 20200923.3 + +* Mon Jan 25 2021 Fedora Release Engineering - 20200923.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Sat Dec 19 2020 Rich Mattes - 20200923.2-1 +- Update to release 20200923.2 +- Rebuild to fix tagging in koji (rhbz#1885561) + +* Fri Jul 31 2020 Fedora Release Engineering - 20200225.2-4 +- Second attempt - Rebuilt for + https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Mon Jul 27 2020 Fedora Release Engineering - 20200225.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed May 27 2020 Rich Mattes - 20200225.2-2 +- Don't remove buildroot in install + +* Sun May 24 2020 Rich Mattes - 20200225.2-1 +- Initial package.