1 |
1 |
# Copyright 2020-2023 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
|
EAPI=7
|
|
4 |
EAPI=8
|
5 |
5 |
|
6 |
6 |
PYTHON_COMPAT=( python3_{9..11} )
|
7 |
7 |
|
8 |
|
inherit cmake flag-o-matic python-any-r1 toolchain-funcs
|
|
8 |
inherit cmake python-any-r1
|
9 |
9 |
|
10 |
10 |
# yes, it needs SOURCE, not just installed one
|
11 |
|
GTEST_COMMIT="aee0f9d9b5b87796ee8a0ab26b7587ec30e8858e"
|
12 |
|
GTEST_FILE="gtest-1.10.0_p20200702.tar.gz"
|
|
11 |
# and no, 1.11.0 is not enough
|
|
12 |
GTEST_COMMIT="1b18723e874b256c1e39378c6774a90701d70f7a"
|
|
13 |
GTEST_FILE="gtest-${GTEST_COMMIT}.tar.gz"
|
13 |
14 |
|
14 |
15 |
DESCRIPTION="Abseil Common Libraries (C++), LTS Branch"
|
15 |
16 |
HOMEPAGE="https://abseil.io"
|
16 |
17 |
SRC_URI="https://github.com/abseil/abseil-cpp/archive/${PV}.tar.gz -> ${P}.tar.gz
|
17 |
|
https://github.com/google/googletest/archive/${GTEST_COMMIT}.tar.gz -> ${GTEST_FILE}"
|
|
18 |
test? ( https://github.com/google/googletest/archive/${GTEST_COMMIT}.tar.gz -> ${GTEST_FILE} )"
|
18 |
19 |
|
19 |
20 |
LICENSE="
|
20 |
21 |
Apache-2.0
|
21 |
22 |
test? ( BSD )
|
22 |
23 |
"
|
23 |
24 |
SLOT="0/${PV%%.*}"
|
24 |
|
KEYWORDS="amd64 ~arm64 ~ppc64 x86"
|
25 |
|
IUSE="+cxx17 test"
|
|
25 |
KEYWORDS="amd64 ~arm arm64 ~loong ppc64 ~riscv x86"
|
|
26 |
IUSE="test"
|
26 |
27 |
|
27 |
28 |
BDEPEND="
|
28 |
29 |
${PYTHON_DEPS}
|
... | ... | |
32 |
33 |
RESTRICT="!test? ( test )"
|
33 |
34 |
|
34 |
35 |
PATCHES=(
|
35 |
|
"${FILESDIR}/${PN}-20200923-arm_no_crypto.patch"
|
|
36 |
"${FILESDIR}/${PN}-20211102.0-fix-cuda-nvcc-build.patch"
|
|
37 |
"${FILESDIR}/${PN}-20211102.0-r2-cuda11.6-compile-fix.patch"
|
|
38 |
"${FILESDIR}/${PN}-20211102.0-r2-loong.patch"
|
36 |
39 |
"${FILESDIR}/${PN}-20211102.0-r2-gcc-13.patch"
|
37 |
|
"${FILESDIR}/${PN}-20210324.1-glibc-2.34.patch"
|
38 |
40 |
)
|
39 |
41 |
|
40 |
42 |
src_prepare() {
|
... | ... | |
52 |
54 |
python_fix_shebang absl/copts/generate_copts.py
|
53 |
55 |
absl/copts/generate_copts.py || die
|
54 |
56 |
|
55 |
|
sed -i 's/-Werror//g' \
|
56 |
|
"${WORKDIR}/googletest-${GTEST_COMMIT}"/googletest/cmake/internal_utils.cmake || die
|
|
57 |
if use test; then
|
|
58 |
sed -i 's/-Werror//g' \
|
|
59 |
"${WORKDIR}/googletest-${GTEST_COMMIT}"/googletest/cmake/internal_utils.cmake || die
|
|
60 |
fi
|
57 |
61 |
}
|
58 |
62 |
|
59 |
63 |
src_configure() {
|
60 |
|
if use arm || use arm64; then
|
61 |
|
# bug #778926
|
62 |
|
if [[ $($(tc-getCXX) ${CXXFLAGS} -E -P - <<<$'#if defined(__ARM_FEATURE_CRYPTO)\nHAVE_ARM_FEATURE_CRYPTO\n#endif') != *HAVE_ARM_FEATURE_CRYPTO* ]]; then
|
63 |
|
append-cxxflags -DABSL_ARCH_ARM_NO_CRYPTO
|
64 |
|
fi
|
65 |
|
fi
|
66 |
|
|
67 |
64 |
local mycmakeargs=(
|
68 |
65 |
-DABSL_ENABLE_INSTALL=TRUE
|
69 |
66 |
-DABSL_LOCAL_GOOGLETEST_DIR="${WORKDIR}/googletest-${GTEST_COMMIT}"
|
70 |
|
-DABSL_RUN_TESTS=$(usex test)
|
71 |
|
-DBUILD_SHARED_LIBS=TRUE
|
72 |
|
$(usex cxx17 -DCMAKE_CXX_STANDARD=17 '') # it has to be a useflag for some consumers
|
|
67 |
-DCMAKE_CXX_STANDARD=17
|
|
68 |
-DABSL_PROPAGATE_CXX_STD=TRUE
|
73 |
69 |
$(usex test -DBUILD_TESTING=ON '') #intentional usex
|
74 |
70 |
)
|
75 |
71 |
cmake_src_configure
|