dev-python/agate: Bump to 1.13.0
[gentoo/gentoo.git] / dev-cpp / abseil-cpp / abseil-cpp-20240722.0.ebuild
blobcb780cd9e37c92e78d40492aa7d984a90abcf910
1 # Copyright 2020-2025 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 PYTHON_COMPAT=( python3_{10..13} )
8 inherit cmake-multilib python-any-r1
10 DESCRIPTION="Abseil Common Libraries (C++), LTS Branch"
11 HOMEPAGE="https://abseil.io/"
12 SRC_URI="https://github.com/abseil/abseil-cpp/archive/${PV}.tar.gz -> ${P}.tar.gz"
14 LICENSE="Apache-2.0"
15 SLOT="0/${PV:2:4}.$(ver_cut 2).0"
16 KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~mips ppc64 ~riscv ~s390 sparc x86 ~arm64-macos ~x64-macos"
17 IUSE="test"
19 RDEPEND=">=dev-cpp/gtest-1.13.0[${MULTILIB_USEDEP}]"
20 DEPEND="${RDEPEND}"
21 BDEPEND="
22         ${PYTHON_DEPS}
23         test? (
24                 sys-libs/timezone-data
25         )
28 RESTRICT="!test? ( test )"
30 PATCHES=(
31         "${FILESDIR}/${PN}-20230802.0-sdata-tests.patch"
32         # "${FILESDIR}/${PN}-random-tests.patch" #935417
33         # "${FILESDIR}/${PN}-20230802.0-conditional-use-of-lzcnt.patch" #934337
34         "${FILESDIR}/${PN}-include-cstdint.patch" #937307
35         "${FILESDIR}/${PN}-20240722.0-lto-odr.patch"
38 src_prepare() {
39         cmake_src_prepare
41         use ppc && eapply "${FILESDIR}/${PN}-atomic.patch"
43         # un-hardcode abseil compiler flags
44         sed -i \
45                 -e '/"-maes",/d' \
46                 -e '/"-msse4.1",/d' \
47                 -e '/"-mfpu=neon"/d' \
48                 -e '/"-march=armv8-a+crypto"/d' \
49                 absl/copts/copts.py || die
51         # now generate cmake files
52         python_fix_shebang absl/copts/generate_copts.py
53         absl/copts/generate_copts.py || die
56 multilib_src_configure() {
57         local mycmakeargs=(
58                 -DABSL_ENABLE_INSTALL=TRUE
59                 -DABSL_USE_EXTERNAL_GOOGLETEST=ON
60                 -DABSL_PROPAGATE_CXX_STD=TRUE
61                 # TEST_HELPERS needed for protobuf (bug #915902)
62                 -DABSL_BUILD_TEST_HELPERS=ON
63                 -DABSL_BUILD_TESTING="$(usex test)"
64         )
65         # intentional use, it uses both variables for tests.
66         if use test; then
67                 mycmakeargs+=(
68                         -DBUILD_TESTING="yes"
69                 )
70         fi
72         cmake_src_configure
75 multilib_src_test() {
76         if ! use amd64; then
77                 CMAKE_SKIP_TESTS=(
78                         absl_symbolize_test
79                 )
81                 if use ppc; then
82                         CMAKE_SKIP_TESTS+=(
83                                 absl_failure_signal_handler_test
84                         )
85                 fi
86         fi
88         cmake_src_test