2019-09-21 17:19:27 +02:00
|
|
|
# Copyright 1999-2019 Gentoo Authors
|
2019-03-25 04:03:48 +01:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
2019-09-20 02:36:59 +02:00
|
|
|
EAPI=7
|
2019-03-25 04:03:48 +01:00
|
|
|
|
2019-10-13 23:16:50 +02:00
|
|
|
CMAKE_MAKEFILE_GENERATOR="emake"
|
2019-03-25 04:03:48 +01:00
|
|
|
|
2019-10-13 23:16:50 +02:00
|
|
|
inherit cmake-utils git-r3 multilib
|
2019-09-20 02:36:59 +02:00
|
|
|
|
2019-03-25 04:03:48 +01:00
|
|
|
DESCRIPTION="Advanced Normalitazion Tools for neuroimaging"
|
|
|
|
HOMEPAGE="http://stnava.github.io/ANTs/"
|
2019-10-13 23:16:50 +02:00
|
|
|
SRC_URI="
|
|
|
|
test? (
|
|
|
|
http://chymera.eu/distfiles/ants_testdata-2.3.1_p20191013.tar.xz
|
|
|
|
)
|
|
|
|
"
|
2019-03-25 04:03:48 +01:00
|
|
|
EGIT_REPO_URI="https://github.com/stnava/ANTs.git"
|
|
|
|
|
|
|
|
SLOT="0"
|
|
|
|
LICENSE="BSD"
|
|
|
|
KEYWORDS=""
|
2019-10-13 23:16:50 +02:00
|
|
|
IUSE="test vtk"
|
2019-03-25 04:03:48 +01:00
|
|
|
|
2019-10-13 23:16:50 +02:00
|
|
|
DEPEND="
|
|
|
|
vtk? (
|
|
|
|
~sci-libs/itk-5.0.1[vtkglue]
|
|
|
|
sci-libs/vtk
|
|
|
|
)
|
|
|
|
!vtk? ( ~sci-libs/itk-5.0.1 )
|
|
|
|
"
|
2019-10-14 01:36:35 +02:00
|
|
|
RDEPEND="${DEPEND}"
|
2019-09-20 02:36:59 +02:00
|
|
|
|
2019-10-13 23:16:50 +02:00
|
|
|
PATCHES=(
|
2019-10-14 01:36:35 +02:00
|
|
|
"${FILESDIR}/${PN}-2.3.1_p20191013-paths.patch"
|
2019-10-13 23:16:50 +02:00
|
|
|
)
|
2019-09-20 02:36:59 +02:00
|
|
|
|
2019-10-14 01:36:35 +02:00
|
|
|
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
|
2019-09-20 02:36:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
src_configure() {
|
|
|
|
local mycmakeargs=(
|
|
|
|
-DUSE_SYSTEM_ITK=ON
|
2019-10-13 23:16:50 +02:00
|
|
|
-DITK_DIR="/usr/include/ITK-5.0/"
|
2019-09-20 02:36:59 +02:00
|
|
|
-DBUILD_TESTING="$(usex test ON OFF)"
|
2019-10-13 23:16:50 +02:00
|
|
|
-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"
|
2019-09-20 02:36:59 +02:00
|
|
|
)
|
|
|
|
cmake-utils_src_configure
|
|
|
|
}
|
2019-03-25 04:03:48 +01:00
|
|
|
|
|
|
|
src_install() {
|
2019-10-13 23:16:50 +02:00
|
|
|
BUILD_DIR="${WORKDIR}/${P}_build/ANTS-build"
|
|
|
|
cmake-utils_src_install
|
2019-09-20 02:36:59 +02:00
|
|
|
cd "${WORKDIR}/${P}/Scripts" || die "scripts dir not found"
|
2019-03-25 04:03:48 +01:00
|
|
|
dobin *.sh
|
|
|
|
dodir /usr/$(get_libdir)/ants
|
2019-10-13 23:16:50 +02:00
|
|
|
install -t "${D}"/usr/$(get_libdir)/ants * || die
|
2019-03-25 04:03:48 +01:00
|
|
|
doenvd "${FILESDIR}"/99ants
|
|
|
|
}
|