summaryrefslogtreecommitdiff
blob: 89ce35e4b3e3297085cef82c9c6631307ff7094a (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
47
48
49
50
51
52
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit cmake cuda

MY_COMMIT="c8df37f6ac73250998b90c397458469902d6d9b9"

DESCRIPTION="Struct of arrays library with object oriented interface for C++"
HOMEPAGE="
	http://www.libgeodecomp.org/libflatarray.html
	https://github.com/STEllAR-GROUP/libflatarray"
SRC_URI="https://github.com/STEllAR-GROUP/libflatarray/archive/${MY_COMMIT}.tar.gz -> ${P}.tar.gz"

LICENSE="Boost-1.0"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86"
IUSE="cuda examples test"
RESTRICT="!test? ( test )"

DEPEND="
	cuda? ( dev-util/nvidia-cuda-toolkit )"

S="${WORKDIR}/libflatarray-${MY_COMMIT}"

src_prepare() {
	cmake_src_prepare
	use cuda && cuda_src_prepare
}

src_configure() {
	local mycmakeargs=(
		-DWITH_CUDA=$(usex cuda)
	)
	cmake_src_configure
}

src_install() {
	cmake_src_install

	if use examples; then
		docompress -x /usr/share/doc/${PF}
		dodoc -r examples/
		dodoc -r "${WORKDIR}"/${P}_build/examples/
		find "${ED}"/usr/share/doc/${PF} -iname "*cmake*" -exec rm -r {} + || die
	fi
}

src_test() {
	cmake_build check
}