dev-libs/libdynd: fix the git version mangling
authorSébastien Fabbro <bicatali@gentoo.org>
Sun, 8 Jan 2017 22:17:42 +0000 (22:17 +0000)
committerSébastien Fabbro <bicatali@gentoo.org>
Tue, 10 Jan 2017 05:26:40 +0000 (05:26 +0000)
also add cuda sanitizing, and basic cleaning

Package-Manager: Portage-2.3.3, Repoman-2.3.1

dev-libs/libdynd/libdynd-0.7.2.ebuild

index 37b608c9f81e1155e87eb8d3252c6fcaf8c9ebab..0ca75be0e865a111088486efd507b1c243a144a7 100644 (file)
@@ -6,6 +6,9 @@ EAPI=6
 
 inherit cmake-utils cuda
 
+# change each new libdynd version, to avoid git in tree dependency
+DYND_GIT_SHA1=341d6d91931fdb04ad657d27ed740cf533fc925b
+
 DESCRIPTION="C++ dynamic multi-dimensionnal array library with Python exposure"
 HOMEPAGE="http://libdynd.org"
 SRC_URI="https://github.com/libdynd/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
@@ -27,7 +30,7 @@ DEPEND="${RDEPEND}
 DOCS=( README.md )
 
 src_prepare() {
-       #use cuda && cuda_src_prepare
+       use cuda && cuda_src_prepare
        cmake-utils_src_prepare
        cmake_comment_add_subdirectory examples
        # fix forced cxxflags and doc installation directory
@@ -39,6 +42,15 @@ src_prepare() {
        sed -e 's|install(TARGETS test_libdynd||' \
                -e 's|RUNTIME DESTINATION bin)||' \
                -i tests/CMakeLists.txt || die
+
+       # remove the version mangling from git stuff it requires a git clone
+       # rather force set it a configure time
+       sed -e '/GetGitRev/d' \
+               -e '/get_git_/d' \
+               -e '/git_describe/d' \
+               -e '/dirty/d' \
+               -i CMakeLists.txt || die
+       sed -e s||${DYND_SHA1_VERSION}|
        # not tested
        if use mkl; then
                sed -e "s|/opt/intel/.*|$(ls -1d ${EPREFIX}/opt/intel/compilers*)|" \
@@ -48,6 +60,8 @@ src_prepare() {
 
 src_configure() {
        local mycmakeargs=(
+               -DDYND_GIT_SHA1="${DYND_GIT_SHA1}"
+               -DDYND_VERSION_STRING="v${PV}"
                -DDYND_INSTALL_LIB=ON
                -DDYND_SHARED_LIB=ON
                -DDYND_BUILD_BENCHMARKS=OFF
@@ -56,7 +70,7 @@ src_configure() {
                -DDYND_BUILD_TESTS="$(usex test)"
                -DDYND_CUDA="$(usex cuda)"
                -DDYND_FFTW="$(usex fftw)"
-               -DFFTW_PATH="${EPREFIX}/usr"
+               -DFFTW_PATH="${EPREFIX}/usr/include"
        )
        cmake-utils_src_configure
 }