commit:     5be1efe1c29a989f03b635bc179b5181150f45eb
Author:     Horea Christian <chr <AT> chymera <DOT> eu>
AuthorDate: Mon Nov 25 17:58:40 2019 +0000
Commit:     Horea Christian <horea.christ <AT> gmail <DOT> com>
CommitDate: Mon Nov 25 17:58:40 2019 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=5be1efe1

sci-biology/ants: EAPI bump and other live ebuild fixes

Package-Manager: Portage-2.3.79, Repoman-2.3.18
Signed-off-by: Horea Christian <chr <AT> chymera.eu>

 sci-biology/ants/ants-9999.ebuild | 60 +++++++++++++++++++++++++++++++++------
 1 file changed, 51 insertions(+), 9 deletions(-)

diff --git a/sci-biology/ants/ants-9999.ebuild 
b/sci-biology/ants/ants-9999.ebuild
index da7514fca..b759acb50 100644
--- a/sci-biology/ants/ants-9999.ebuild
+++ b/sci-biology/ants/ants-9999.ebuild
@@ -1,28 +1,70 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=7
+
+CMAKE_MAKEFILE_GENERATOR="emake"
 
 inherit cmake-utils git-r3 multilib
 
 DESCRIPTION="Advanced Normalitazion Tools for neuroimaging"
 HOMEPAGE="http://stnava.github.io/ANTs/";
-SRC_URI=""
+SRC_URI="
+       test? (
+               http://chymera.eu/distfiles/ants_testdata-2.3.1_p20191013.tar.xz
+       )
+"
 EGIT_REPO_URI="https://github.com/stnava/ANTs.git";
 
 SLOT="0"
 LICENSE="BSD"
 KEYWORDS=""
+IUSE="test vtk"
+
+DEPEND="
+       vtk? (
+               ~sci-libs/itk-5.0.1[vtkglue]
+               sci-libs/vtk
+       )
+       !vtk? ( ~sci-libs/itk-5.0.1 )
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-2.3.1_p20191013-paths.patch"
+)
 
-DEPEND=">=dev-util/cmake-3.10.3"
-RDEPEND=""
+src_unpack() {
+       git-r3_src_unpack
+       if use test; then
+               mkdir -p "${S}/.ExternalData/MD5" || die "Could not create test 
data directory."
+               tar xvf "${DISTDIR}/ants_testdata-2.3.1_p20191013.tar.xz" -C 
"${S}/.ExternalData/MD5/" > /dev/null || die "Could not unpack test data."
+       fi
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DUSE_SYSTEM_ITK=ON
+               -DITK_DIR="/usr/include/ITK-5.0/"
+               -DBUILD_TESTING="$(usex test ON OFF)"
+               -DUSE_VTK=$(usex vtk ON OFF)
+               -DUSE_SYSTEM_VTK=$(usex vtk ON OFF)
+       )
+       use vtk && mycmakeargs+=(
+               -DVTK_DIR="/usr/include/vtk-8.1/"
+       )
+       use test && mycmakeargs+=(
+               -DExternalData_OBJECT_STORES="${S}/.ExternalData/MD5"
+       )
+       cmake-utils_src_configure
+}
 
 src_install() {
-       cd "${WORKDIR}/${P}_build/ANTS-build" || die "build dir not found"
-       default
-       cd "${WORKDIR}/ANTs-${PV}/Scripts" || die "scripts dir not found"
+       BUILD_DIR="${WORKDIR}/${P}_build/ANTS-build"
+       cmake-utils_src_install
+       cd "${WORKDIR}/${P}/Scripts" || die "scripts dir not found"
        dobin *.sh
        dodir /usr/$(get_libdir)/ants
-       install -t "${D}"usr/$(get_libdir)/ants *
+       install -t "${D}"/usr/$(get_libdir)/ants * || die
        doenvd "${FILESDIR}"/99ants
 }

Reply via email to