dev-libs/leatherman: 1.12.0 stable amd64/x86 with cleanup
[gentoo.git] / dev-libs / libdynd / libdynd-0.7.2.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit cmake-utils cuda
7
8 # change each new libdynd version, to avoid git in tree dependency
9 DYND_GIT_SHA1=341d6d91931fdb04ad657d27ed740cf533fc925b
10
11 DESCRIPTION="C++ dynamic multi-dimensionnal array library with Python exposure"
12 HOMEPAGE="http://libdynd.org"
13 SRC_URI="https://github.com/libdynd/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
14
15 LICENSE="BSD"
16 SLOT="0/${PV}"
17 KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
18 IUSE="cuda doc fftw mkl test"
19 RESTRICT="!test? ( test )"
20
21 RDEPEND="
22         dev-libs/c-blosc:0=
23         cuda? ( dev-util/nvidia-cuda-toolkit )
24         fftw? ( sci-libs/fftw:3.0 )
25 "
26 DEPEND="${RDEPEND}
27         doc? ( app-doc/doxygen[dot] )
28 "
29
30 DOCS=( README.md )
31
32 src_prepare() {
33         use cuda && cuda_src_prepare
34         cmake-utils_src_prepare
35         cmake_comment_add_subdirectory examples
36         # fix forced cxxflags and doc installation directory
37         sed -e 's|-O3 -fomit-frame-pointer||' \
38                 -e 's|-Werror||g' \
39                 -e "s|docs DESTINATION docs|docs/html DESTINATION share/doc/${PF}|" \
40                 -i CMakeLists.txt || die
41         # don't install test exec
42         sed -e 's|install(TARGETS test_libdynd||' \
43                 -e 's|RUNTIME DESTINATION bin)||' \
44                 -i tests/CMakeLists.txt || die
45         # remove the version mangling from git stuff it requires a git clone
46         # rather force set it a configure time
47         sed -e '/GetGitRev/d' \
48                 -e '/get_git_/d' \
49                 -e '/git_describe/d' \
50                 -e '/dirty/d' \
51                 -i CMakeLists.txt || die
52         # not tested
53         if use mkl; then
54                 sed -e "s|/opt/intel/.*|$(ls -1d ${EPREFIX}/opt/intel/compilers*)|" \
55                         -i tests/CMakeLists.txt || die
56         fi
57 }
58
59 src_configure() {
60         local mycmakeargs=(
61                 -DDYND_GIT_SHA1="${DYND_GIT_SHA1}"
62                 -DDYND_VERSION_STRING="v${PV}"
63                 -DDYND_INSTALL_LIB=ON
64                 -DDYND_SHARED_LIB=ON
65                 -DDYND_BUILD_BENCHMARKS=OFF
66                 -DDYND_BUILD_DOCS="$(usex doc)"
67                 -DDYND_BUILD_PLUGIN="$(usex mkl)"
68                 -DDYND_BUILD_TESTS="$(usex test)"
69                 -DDYND_CUDA="$(usex cuda)"
70                 -DDYND_FFTW="$(usex fftw)"
71                 -DFFTW_PATH="${EPREFIX}/usr/include"
72         )
73         cmake-utils_src_configure
74 }
75
76 src_test() {
77         cd "${BUILD_DIR}" || die
78         ./tests/test_libdynd || die
79 }