1 |
1 |
# Copyright 2011-2022 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 |
|
inherit autotools multilib-minimal
|
|
6 |
inherit cmake-multilib
|
7 |
7 |
|
8 |
|
DESCRIPTION="Google's C++ logging library"
|
|
8 |
if [[ "${PV}" == "9999" ]]; then
|
|
9 |
inherit git-r3
|
|
10 |
|
|
11 |
EGIT_REPO_URI="https://github.com/google/glog"
|
|
12 |
fi
|
|
13 |
|
|
14 |
DESCRIPTION="Google Logging library"
|
9 |
15 |
HOMEPAGE="https://github.com/google/glog"
|
10 |
|
SRC_URI="https://github.com/google/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
|
16 |
if [[ "${PV}" == "9999" ]]; then
|
|
17 |
SRC_URI=""
|
|
18 |
else
|
|
19 |
SRC_URI="https://github.com/google/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
|
20 |
fi
|
11 |
21 |
|
12 |
22 |
LICENSE="BSD"
|
13 |
23 |
SLOT="0"
|
14 |
|
# -sparc as libunwind is not ported on sparc
|
15 |
|
KEYWORDS="amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 -sparc x86 ~amd64-linux ~x86-linux"
|
16 |
|
IUSE="gflags static-libs test"
|
17 |
|
RESTRICT="test"
|
18 |
|
|
19 |
|
RDEPEND="sys-libs/libunwind[${MULTILIB_USEDEP}]
|
20 |
|
gflags? ( dev-cpp/gflags[${MULTILIB_USEDEP}] )"
|
|
24 |
KEYWORDS="amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux"
|
|
25 |
IUSE="gflags +libunwind llvm-libunwind test"
|
|
26 |
RESTRICT="!test? ( test )"
|
|
27 |
|
|
28 |
RDEPEND="gflags? ( dev-cpp/gflags:0=[${MULTILIB_USEDEP}] )
|
|
29 |
libunwind? (
|
|
30 |
llvm-libunwind? ( sys-libs/llvm-libunwind:0=[${MULTILIB_USEDEP}] )
|
|
31 |
!llvm-libunwind? ( sys-libs/libunwind:0=[${MULTILIB_USEDEP}] )
|
|
32 |
)"
|
21 |
33 |
DEPEND="${RDEPEND}
|
22 |
34 |
test? ( >=dev-cpp/gtest-1.8.0[${MULTILIB_USEDEP}] )"
|
23 |
35 |
|
24 |
36 |
PATCHES=(
|
25 |
|
"${FILESDIR}"/${PN}-0.4.0-fix-x32-build.patch
|
26 |
|
"${FILESDIR}"/${PN}-0.4.0-errnos.patch
|
27 |
|
"${FILESDIR}"/${PN}-0.4.0-fix-test-on-ports.patch
|
|
37 |
"${FILESDIR}/${P}-IsGoogleLoggingInitialized_public.patch"
|
|
38 |
"${FILESDIR}/${P}-vmodule_levels_changeability.patch"
|
28 |
39 |
)
|
29 |
40 |
|
30 |
|
src_prepare() {
|
31 |
|
default
|
32 |
|
eautoreconf
|
33 |
|
}
|
|
41 |
src_configure() {
|
|
42 |
local mycmakeargs=(
|
|
43 |
-DBUILD_TESTING=$(usex test ON OFF)
|
|
44 |
-DWITH_CUSTOM_PREFIX=ON
|
|
45 |
-DWITH_GFLAGS=$(usex gflags ON OFF)
|
|
46 |
-DWITH_GTEST=$(usex test ON OFF)
|
|
47 |
-DWITH_UNWIND=$(usex libunwind ON OFF)
|
|
48 |
)
|
|
49 |
if use libunwind; then
|
|
50 |
mycmakeargs+=(
|
|
51 |
-DUnwind_PLATFORM_LIBRARY="${ESYSROOT}/usr/$(get_libdir)/libunwind.so"
|
|
52 |
)
|
|
53 |
fi
|
34 |
54 |
|
35 |
|
multilib_src_configure() {
|
36 |
|
ECONF_SOURCE="${S}" econf \
|
37 |
|
$(use_enable static-libs static) \
|
38 |
|
ac_cv_lib_gflags_main="$(usex gflags)"
|
|
55 |
cmake-multilib_src_configure
|
39 |
56 |
}
|
40 |
57 |
|
41 |
|
multilib_src_install_all() {
|
42 |
|
einstalldocs
|
43 |
|
|
44 |
|
# package provides .pc files
|
45 |
|
find "${D}" -name '*.la' -delete || die
|
|
58 |
src_test() {
|
|
59 |
# See bug #832355
|
|
60 |
cmake-multilib_src_test -j1
|
46 |
61 |
}
|