summaryrefslogtreecommitdiff
path: root/sci-geosciences/s2geometry/s2geometry-0.13.1-r3.ebuild
blob: 770f7ffa671e8389b6bc5691d943a0b21efb4035 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Copyright 2025-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit cmake flag-o-matic

DESCRIPTION="Computational geometry and spatial indexing on the sphere"
HOMEPAGE="http://s2geometry.io/"
SRC_URI="https://github.com/google/${PN}/archive/refs/tags/v${PV}.tar.gz
	-> ${P}.tar.gz"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64"
IUSE="debug test"
RESTRICT="!test? ( test )"

RDEPEND="
	>=dev-cpp/abseil-cpp-20250814.1:=
	dev-libs/openssl:=
"
DEPEND="${RDEPEND}"
BDEPEND="test? ( dev-cpp/gtest )"

PATCHES=( "${FILESDIR}"/${P}-test.patch )

src_configure() {
	append-cxxflags $(usex debug '-DDEBUG' '-DNDEBUG')

	local mycmakeargs=(
		-DBUILD_TESTS=$(usex test)
	)
	use test && mycmakeargs+=( -DGOOGLETEST_ROOT=/usr/include )
	cmake_src_configure
}

src_install() {
	cmake_src_install
	rm -f "${D}"/usr/$(get_libdir)/libs2testing.a \
		|| die
}