Blame abseil-cpp.spec

71f808
# Installed library version
71f808
%global lib_version 2111.0.0
71f808
71f808
Name:           abseil-cpp
71f808
Version:        20211102.0
71f808
Release:        2%{?dist}
71f808
Summary:        C++ Common Libraries
71f808
71f808
License:        ASL 2.0
71f808
URL:            https://abseil.io
71f808
Source0:        https://github.com/abseil/abseil-cpp/archive/%{version}/%{name}-%{version}.tar.gz
71f808
71f808
# Remove test assertions that use ::testing::Conditional, which is not in a
71f808
# released version of GTest. Not submitted upstream, as this is a workaround
71f808
# rather than a fix. https://github.com/abseil/abseil-cpp/issues/1063
71f808
Patch0:         abseil-cpp-20211102.0-gtest-unreleased-features.patch
71f808
# SysinfoTest.NominalCPUFrequency in absl_sysinfo_test fails occasionally
71f808
# on aarch64, but see:
71f808
#
71f808
# NominalCPUFrequency Test from SysInfoTest Suite Fails on M1 Mac
71f808
# https://github.com/abseil/abseil-cpp/issues/1053#issuecomment-961432444
71f808
#
71f808
# in which an upstream author opines:
71f808
#
71f808
#   If the only problem you are trying to solve is a failing test, this is safe
71f808
#   to ignore since this code is never called. I should consider stripping this
71f808
#   test out of the open source release. NominalCPUFrequency is only called in
71f808
#   code private to Google and we do have tests on the platforms we use it on.
71f808
#
71f808
# We therefore disable it on all architectures, since any future failures
71f808
# will also not be meaningful.
71f808
#
71f808
# Note also that this test is removed upstream in commit
71f808
# 732b5580f089101ce4b8cdff55bb6461c59a6720 (internal commit
71f808
# 7e8da4f14afd25d11713eee6b743ba31605332bf).
71f808
Patch1:         abseil-cpp-20211102.0-disable-nominalcpufrequency.patch
71f808
71f808
BuildRequires:  cmake
71f808
# The default make backend would work just as well; ninja is observably faster
71f808
BuildRequires:  ninja-build
71f808
BuildRequires:  gcc-c++
71f808
71f808
BuildRequires:  gmock-devel
71f808
BuildRequires:  gtest-devel
71f808
71f808
%ifarch s390x
71f808
# Symbolize.SymbolizeWithMultipleMaps fails in absl_symbolize_test on s390x
71f808
# with LTO
71f808
# https://github.com/abseil/abseil-cpp/issues/1133
71f808
%global _lto_cflags %{nil}
71f808
%endif
71f808
71f808
%description
71f808
Abseil is an open-source collection of C++ library code designed to augment
71f808
the C++ standard library. The Abseil library code is collected from
71f808
Google's own C++ code base, has been extensively tested and used in
71f808
production, and is the same code we depend on in our daily coding lives.
71f808
71f808
In some cases, Abseil provides pieces missing from the C++ standard; in
71f808
others, Abseil provides alternatives to the standard for special needs we've
71f808
found through usage in the Google code base. We denote those cases clearly
71f808
within the library code we provide you.
71f808
71f808
Abseil is not meant to be a competitor to the standard library; we've just
71f808
found that many of these utilities serve a purpose within our code base,
71f808
and we now want to provide those resources to the C++ community as a whole.
71f808
71f808
%package devel
71f808
Summary: Development files for %{name}
71f808
Requires: %{name}%{?_isa} = %{version}-%{release}
71f808
71f808
%description devel
71f808
Development headers for %{name}
71f808
71f808
%prep
71f808
%autosetup -p1 -S gendiff
71f808
71f808
# Replace GTEST_FLAG_GET, which is not in a released version of GTest, with an
71f808
# appropriate default value. Not submitted upstream, as this is a workaround
71f808
# rather than a fix. https://github.com/abseil/abseil-cpp/issues/1063
71f808
#
71f808
# The find-then-sed pattern means we only discard mtimes on files that actually
71f808
# needed to be modified.
71f808
find . -type f -name '*.cc' \
71f808
    -exec gawk '/GTEST_FLAG_GET/ { print FILENAME ; nextfile }' '{}' '+' |
71f808
  xargs -r -t sed -r -i 's/GTEST_FLAG_GET/::testing::GTEST_FLAG/g'
71f808
71f808
71f808
%build
71f808
%cmake \
71f808
  -GNinja \
71f808
  -DABSL_USE_EXTERNAL_GOOGLETEST:BOOL=ON \
71f808
  -DABSL_FIND_GOOGLETEST:BOOL=ON \
71f808
  -DABSL_ENABLE_INSTALL:BOOL=ON \
71f808
  -DBUILD_TESTING:BOOL=ON \
71f808
  -DCMAKE_BUILD_TYPE:STRING=None \
71f808
  -DCMAKE_CXX_STANDARD:STRING=17
71f808
%cmake_build
71f808
71f808
71f808
%install
71f808
%cmake_install
71f808
71f808
%check
71f808
%ctest
71f808
71f808
%files
71f808
%license LICENSE
71f808
%doc FAQ.md README.md UPGRADES.md
71f808
%{_libdir}/libabsl_*.so.%{lib_version}
71f808
71f808
%files devel
71f808
%{_includedir}/absl
71f808
%{_libdir}/libabsl_*.so
71f808
%{_libdir}/cmake/absl
71f808
%{_libdir}/pkgconfig/*.pc
71f808
71f808
%changelog
71f808
* Tue Mar 15 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 20211102.0-2
71f808
- Disable LTO on s390x to work around test failure
71f808
- Skip SysinfoTest.NominalCPUFrequency on all architectures; it fails
71f808
  occasionally on aarch64, and upstream says we should not care
71f808
71f808
* Fri Feb 18 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 20211102.0-1
71f808
- Update to 20211102.0 (close RHBZ#2019691)
71f808
- Drop --output-on-failure, already in %%ctest expansion
71f808
- On s390x, instead of ignoring all tests, skip only the single failing test
71f808
- Use ninja backend for CMake: speeds up build with no downsides
71f808
- Drop patch for armv7hl
71f808
71f808
* Mon Jan 31 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 20210324.2-4
71f808
- Fix test failure (fix RHBZ#2045186)
71f808
71f808
* Wed Jan 19 2022 Fedora Release Engineering <releng@fedoraproject.org> - 20210324.2-3
71f808
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
71f808
71f808
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 20210324.2-2
71f808
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
71f808
71f808
* Fri May 21 2021 Rich Mattes <richmattes@gmail.com> - 20210324.1-2
71f808
- Update to release 20210324.2
71f808
- Enable and run test suite
71f808
71f808
* Mon Mar 08 2021 Rich Mattes <richmattes@gmail.com> - 20200923.3-1
71f808
- Update to release 20200923.3
71f808
71f808
* Mon Jan 25 2021 Fedora Release Engineering <releng@fedoraproject.org> - 20200923.2-2
71f808
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
71f808
71f808
* Sat Dec 19 2020 Rich Mattes <richmattes@gmail.com> - 20200923.2-1
71f808
- Update to release 20200923.2
71f808
- Rebuild to fix tagging in koji (rhbz#1885561)
71f808
71f808
* Fri Jul 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 20200225.2-4
71f808
- Second attempt - Rebuilt for
71f808
  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
71f808
71f808
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 20200225.2-3
71f808
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
71f808
71f808
* Wed May 27 2020 Rich Mattes <richmattes@gmail.com> - 20200225.2-2
71f808
- Don't remove buildroot in install
71f808
71f808
* Sun May 24 2020 Rich Mattes <richmattes@gmail.com> - 20200225.2-1
71f808
- Initial package.