1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit cmake-utils cuda
8 # change each new libdynd version, to avoid git in tree dependency
9 DYND_GIT_SHA1=341d6d91931fdb04ad657d27ed740cf533fc925b
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"
17 KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
18 IUSE="cuda doc fftw mkl test"
19 RESTRICT="!test? ( test )"
23 cuda? ( dev-util/nvidia-cuda-toolkit )
24 fftw? ( sci-libs/fftw:3.0 )
27 doc? ( app-doc/doxygen[dot] )
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||' \
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' \
49 -e '/git_describe/d' \
51 -i CMakeLists.txt || die
54 sed -e "s|/opt/intel/.*|$(ls -1d ${EPREFIX}/opt/intel/compilers*)|" \
55 -i tests/CMakeLists.txt || die
61 -DDYND_GIT_SHA1="${DYND_GIT_SHA1}"
62 -DDYND_VERSION_STRING="v${PV}"
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"
73 cmake-utils_src_configure
77 cd "${BUILD_DIR}" || die
78 ./tests/test_libdynd || die