summaryrefslogtreecommitdiff
blob: a122f6f303065c4ae43ab0d29a61db4300c69db0 (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=5

inherit cmake-utils multilib cuda

# change each release, to avoid git in tree dependency
DYND_GIT_SHA1=09fb7e5eccadbe1ec49ff4b05fec724939331e6d

DESCRIPTION="C++ dynamic multi-dimensionnal array library with Python exposure"
HOMEPAGE="https://github.com/ContinuumIO/libdynd"
SRC_URI="https://github.com/ContinuumIO/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="BSD"
SLOT="0/${PV}"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
IUSE="cuda doc fftw test"

RDEPEND="
	dev-libs/c-blosc:0=
	cuda? ( x11-drivers/nvidia-drivers dev-util/nvidia-cuda-toolkit )
	fftw? ( sci-libs/fftw:3.0 )
	"
DEPEND="${RDEPEND}"

DOCS=( README.md )

PATCHES=(
	"${FILESDIR}"/${PN}-0.6.0-dont-install-test.patch
)

src_prepare() {
	cmake-utils_src_prepare
	# each relase comes with a different set...
	# remove forced strong flags
	sed -i \
		-e "s|@DYND_GIT_SHA1@|${DYND_GIT_SHA1}|" \
		-e "s|@DYND_VERSION@|${PV}|" \
		-e 's|-fomit-frame-pointer||' \
		-e 's|-Werror||g' \
		CMakeLists.txt || die
}

src_configure() {
	sed -i \
		-e '/add_subdirectory(examples)/d' \
		CMakeLists.txt || die
	local mycmakeargs=(
		-DDYND_SHARED_LIB=ON
		-DDYND_INSTALL_LIB=ON
		$(cmake-utils_use cuda DYND_CUDA)
		$(cmake-utils_use test DYND_BUILD_TESTS)
	)
	cmake-utils_src_configure
}

src_test() {
	cd "${BUILD_DIR}" || die
	./tests/test_libdynd || die
}

src_install() {
	cmake-utils_src_install
	use doc && dodoc documents/*
}