aboutsummaryrefslogtreecommitdiff
blob: c4d3153a06350aed75c761974b4a09c3f1ec2db9 (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
43
44
45
46
# Copyright 2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit cmake

DESCRIPTION="scanf for modern C++ "
HOMEPAGE="https://scnlib.dev/"
SRC_URI="https://github.com/eliaskosunen/scnlib/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64"
IUSE="test"

BDEPEND="
	dev-cpp/fast_float
	>=dev-cpp/simdutf-5.2.0:=
	test? ( dev-cpp/gtest )
"

RESTRICT="!test? ( test )"

PATCHES=(
	"${FILESDIR}/${P}-accept-simdutf-5.2.x.patch"
)

src_prepare() {
	use test && eapply "${FILESDIR}/${P}-no-external-test-deps.patch"
	cmake_src_prepare
}

src_configure() {
	local mycmakeargs=(
		-DSCN_BENCHMARKS=OFF
		-DSCN_BENCHMARKS_BINARYSIZE=OFF
		-DSCN_BENCHMARKS_BUILDTIME=OFF
		-DSCN_DOCS=OFF
		-DSCN_EXAMPLES=$(usex test ON OFF)
		-DSCN_TESTS=$(usex test ON OFF)
		-DSCN_USE_EXTERNAL_FAST_FLOAT=ON
		-DSCN_USE_EXTERNAL_SIMDUTF=ON
	)
	cmake_src_configure
}