Add ipe-7.2.3
[shuber-gentoo-overlay.git] / sci-libs / itk / itk-4.4.2.ebuild
1 # Copyright 2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI=5
6
7 PYTHON_COMPAT=( python{2_5,2_6,2_7} )
8
9 inherit eutils toolchain-funcs cmake-utils python-single-r1
10
11 MYP=InsightToolkit-${PV}
12
13 DESCRIPTION="NLM Insight Segmentation and Registration Toolkit"
14 HOMEPAGE="http://www.itk.org"
15 SRC_URI="mirror://sourceforge/${PN}/${MYP}.tar.gz"
16
17 RESTRICT="primaryuri"
18
19 LICENSE="Apache-2.0"
20 SLOT="0"
21 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
22 IUSE="debug examples fftw itkv3compat python review sse2 test"
23
24 RDEPEND="
25 sci-libs/hdf5[cxx]
26 virtual/jpeg
27 media-libs/libpng
28 media-libs/tiff:0
29 sys-libs/zlib
30 fftw? ( sci-libs/fftw:3.0 )
31 "
32 DEPEND="${RDEPEND}
33 python? ( ${PYTHON_DEPS}
34 >=dev-lang/swig-2.0
35 >=dev-cpp/gccxml-0.9.0_pre20120309 )
36 "
37
38 S="${WORKDIR}/${MYP}"
39
40 pkg_pretend() {
41 if [[ -z ${ITK_COMPUTER_MEMORY_SIZE} ]]; then
42 elog "To tune ITK to make the best use ouf working memory you can set"
43 elog " ITK_COMPUTER_MEMORY_SIZE=XX"
44 elog "in make.conf, default is 1 (unit is GB)"
45 fi
46 if use python && [[ -z ${ITK_WRAP_DIMS} ]]; then
47 elog "For Python language bindings, you can define the dimensions"
48 elog "you want to create bindings for by setting"
49 elog " ITK_WRAP_DIMS=X;Y;Z..."
50 elog "in make.conf, default is 2;3 for 2D and 3D data"
51 fi
52 }
53
54 src_configure() {
55 local mycmakeargs=(
56 -DWRAP_ITK_JAVA=OFF
57 -DWRAP_ITK_TCL=OFF
58 -DITK_USE_SYSTEM_HDF5=ON
59 -DITK_USE_SYSTEM_JPEG=ON
60 -DITK_USE_SYSTEM_PNG=ON
61 -DITK_USE_SYSTEM_TIFF=ON
62 -DITK_USE_SYSTEM_ZLIB=ON
63 -DITK_USE_SYSTEM_GCCXML=ON
64 -DITK_USE_SYSTEM_SWIG=ON
65 -DITK_BUILD_ALL_MODULES=ON
66 -DBUILD_SHARED_LIBS=ON
67 -DBUILD_EXAMPLES=OFF
68 -DITK_COMPUTER_MEMORY_SIZE="${ITK_COMPUTER_MEMORY_SIZE:-1}"
69 $(cmake-utils_use_build test TESTING)
70 $(cmake-utils_use review ITK_USE_REVIEW)
71 $(cmake-utils_use itkv3compat ITKV3_COMPATIBILITY)
72 $(cmake-utils_use sse2 VNL_CONFIG_ENABLE_SSE2)
73 )
74 if use fftw; then
75 mycmakeargs+=(
76 -DUSE_FFTWD=ON
77 -DUSE_FFTWF=ON
78 -DUSE_SYSTEM_FFTW=ON
79 -DITK_WRAP_double=ON
80 -DITK_WRAP_vector_double=ON
81 -DITK_WRAP_covariant_vector_double=ON
82 -DITK_WRAP_complex_double=ON
83 )
84 fi
85 if use python; then
86 mycmakeargs+=(
87 -DITK_WRAP_PYTHON=ON
88 -DITK_WRAP_DIMS="${ITK_WRAP_DIMS:-2;3}"
89 )
90 else
91 mycmakeargs+=(
92 -DITK_WRAP_PYTHON=OFF
93 )
94 fi
95 cmake-utils_src_configure
96 }
97
98 src_install() {
99 cmake-utils_src_install
100
101 if use examples; then
102 insinto /usr/share/doc/${PF}/examples
103 docompress -x /usr/share/doc/${PF}/examples
104 doins -r "${S}"/Examples/*
105 fi
106
107 echo "ITK_DATA_ROOT=${EROOT}/usr/share/${PN}/data" > ${T}/40${PN}
108 local ldpath="${EROOT}/usr/$(get_libdir)/InsightToolkit"
109 if use python; then
110 echo "PYTHONPATH=${EROOT}/usr/$(get_libdir)/InsightToolkit/WrapITK/Python" >> ${T}/40${PN}
111 ldpath="${ldpath}:${EROOT}/usr/$(get_libdir)/InsightToolkit/WrapITK/lib"
112 fi
113 echo "LDPATH=${ldpath}" >> ${T}/40${PN}
114
115 doenvd "${T}"/40${PN}
116 }