2020-05-16 05:57:01 -04:00
|
|
|
# Copyright 1999-2020 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
|
|
|
|
2020-08-04 03:36:59 -04:00
|
|
|
inherit cmake multilib
|
2020-05-16 05:57:01 -04:00
|
|
|
|
|
|
|
MY_PN="ANTs"
|
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="
|
2020-08-04 03:36:59 -04:00
|
|
|
https://github.com/ANTsX/ANTs/archive/v${PV}.tar.gz -> ${P}.tar.gz
|
2019-10-13 23:16:50 +02:00
|
|
|
test? (
|
2019-12-14 11:28:21 +01:00
|
|
|
http://chymera.eu/distfiles/ants_testdata-${PV}.tar.xz
|
2019-10-13 23:16:50 +02:00
|
|
|
)
|
|
|
|
"
|
2019-03-25 04:03:48 +01:00
|
|
|
|
|
|
|
SLOT="0"
|
|
|
|
LICENSE="BSD"
|
2019-12-14 11:28:21 +01:00
|
|
|
KEYWORDS="~amd64 ~x86"
|
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? (
|
2020-08-04 03:36:59 -04:00
|
|
|
~sci-libs/itk-5.1.0[vtkglue]
|
2019-10-13 23:16:50 +02:00
|
|
|
sci-libs/vtk
|
|
|
|
)
|
2020-08-04 03:36:59 -04:00
|
|
|
!vtk? ( ~sci-libs/itk-5.1.0 )
|
2019-10-13 23:16:50 +02:00
|
|
|
"
|
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=(
|
2020-08-04 03:36:59 -04:00
|
|
|
"${FILESDIR}/${P}-version.patch"
|
|
|
|
"${FILESDIR}/${P}-libdir.patch"
|
2019-10-13 23:16:50 +02:00
|
|
|
)
|
2019-09-20 02:36:59 +02:00
|
|
|
|
2020-08-04 03:36:59 -04:00
|
|
|
S="${WORKDIR}/${MY_PN}-${PV}"
|
2020-05-16 05:57:01 -04:00
|
|
|
|
2019-10-14 01:36:35 +02:00
|
|
|
src_unpack() {
|
2020-05-16 05:57:01 -04:00
|
|
|
default
|
2019-10-14 01:36:35 +02:00
|
|
|
if use test; then
|
|
|
|
mkdir -p "${S}/.ExternalData/MD5" || die "Could not create test data directory."
|
2019-12-14 11:28:21 +01:00
|
|
|
tar xvf "${DISTDIR}/ants_testdata-${PV}.tar.xz" -C "${S}/.ExternalData/MD5/" > /dev/null || die "Could not unpack test data."
|
2019-10-14 01:36:35 +02:00
|
|
|
fi
|
2019-09-20 02:36:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
src_configure() {
|
|
|
|
local mycmakeargs=(
|
|
|
|
-DUSE_SYSTEM_ITK=ON
|
2020-08-04 03:36:59 -04:00
|
|
|
-DITK_DIR="${EROOT}/usr/include/ITK-5.1/"
|
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)
|
2020-08-04 03:36:59 -04:00
|
|
|
-DANTS_SNAPSHOT_VERSION:STRING=${PV}
|
2019-10-13 23:16:50 +02:00
|
|
|
)
|
|
|
|
use vtk && mycmakeargs+=(
|
2019-12-14 11:28:21 +01:00
|
|
|
-DVTK_DIR="${EROOT}/usr/include/vtk-8.1/"
|
2019-10-13 23:16:50 +02:00
|
|
|
)
|
|
|
|
use test && mycmakeargs+=(
|
|
|
|
-DExternalData_OBJECT_STORES="${S}/.ExternalData/MD5"
|
2019-09-20 02:36:59 +02:00
|
|
|
)
|
2020-08-04 03:36:59 -04:00
|
|
|
cmake_src_configure
|
2019-09-20 02:36:59 +02:00
|
|
|
}
|
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"
|
2020-08-04 03:36:59 -04:00
|
|
|
cmake_src_install
|
|
|
|
cd "${S}/Scripts" || die "scripts dir not found"
|
2019-03-25 04:03:48 +01:00
|
|
|
dobin *.sh
|
|
|
|
dodir /usr/$(get_libdir)/ants
|
2020-05-14 05:50:18 -04:00
|
|
|
insinto "/usr/$(get_libdir)/ants"
|
|
|
|
doins *
|
2019-03-25 04:03:48 +01:00
|
|
|
doenvd "${FILESDIR}"/99ants
|
|
|
|
}
|