aboutsummaryrefslogtreecommitdiff
blob: 383d6326897a2b24033792356f64c1c91a1745d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

PYTHON_COMPAT=( python3_{6..9} )
LUA_COMPAT=( lua5-{1..3} )

inherit lua-single toolchain-funcs cmake python-single-r1

MY_PN="SimpleITK"

DESCRIPTION="Layer on top of ITK for rapid prototyping, education and interpreted languages."
HOMEPAGE="https://simpleitk.org/"
SRC_URI="
	https://github.com/SimpleITK/SimpleITK/releases/download/v${PV}/SimpleITK-${PV}.tar.gz
	https://github.com/SimpleITK/SimpleITK/releases/download/v${PV}/SimpleITKData-${PV}.tar.gz
"
RESTRICT="primaryuri"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~x86"

IUSE="python"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"

BDEPEND="dev-lang/swig"
RDEPEND="
	${LUA_DEPS}
	dev-cpp/gtest
	sci-libs/itk
	dev-python/virtualenv
	python? ( ${PYTHON_DEPS} )
"
DEPEND="${RDEPEND}"

PATCHES=(
	"${FILESDIR}/${P}-module.patch"
	"${FILESDIR}/${P}-int-cast.patch"
)

S="${WORKDIR}/${MY_PN}-${PV}"

src_prepare() {
	cmake_src_prepare
	cp -rf "../${MY_PN}-${PV}/.ExternalData" "${BUILD_DIR}/" || die
}

src_configure() {
	local mycmakeargs=(
		-DUSE_SYSTEM_GTEST=ON
		-DUSE_SYSTEM_ITK=ON
		-DUSE_SYSTEM_LUA=ON
		-DUSE_SYSTEM_SWIG=ON
		-DUSE_SYSTEM_VIRTUALENV=ON
		-DBUILD_TESTING:BOOL=OFF
		-DSimpleITK_FORBID_DOWNLOADS=ON
		-DSimpleITK_PYTHON_USE_VIRTUALENV:BOOL=OFF
		-DSimpleITK_EXPLICIT_INSTANTIATION=OFF
		-DModule_SimpleITKFilters:BOOL=ON
		-DExternalData_OBJECT_STORES:STRING="${BUILD_DIR}/.ExternalData"
		-DSimpleITK_INSTALL_LIBRARY_DIR=$(get_libdir)
	)
	cmake_src_configure
}