/[gentoo-x86]/sci-libs/vtk/vtk-4.2.6.ebuild
Gentoo

Contents of /sci-libs/vtk/vtk-4.2.6.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (show annotations) (download)
Fri Sep 8 12:54:08 2006 UTC (13 years, 11 months ago) by markusle
Branch: MAIN
CVS Tags: HEAD
Changes since 1.11: +1 -1 lines
FILE REMOVED
Removed old version since it doesn't build any more. Also fixed permissions for the vtk-qt patch (see bug #146826).
(Portage version: 2.1.1_rc1-r3)
 (Unsigned Manifest commit)

1 # Copyright 1999-2006 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sci-libs/vtk/vtk-4.2.6.ebuild,v 1.11 2006/07/10 12:41:27 markusle Exp $
4
5 # TODO: need to fix Examples/CMakeLists.txt to build other examples
6
7 inherit distutils eutils flag-o-matic toolchain-funcs versionator java-pkg python
8
9 MY_PV="$(get_version_component_range 1-2)"
10
11 DESCRIPTION="The Visualization Toolkit"
12 HOMEPAGE="http://www.vtk.org"
13 SRC_URI="mirror://sourceforge/${PN}/VTK-${MY_PV}-LatestRelease.tar.gz
14 doc? ( mirror://sourceforge/${PN}/VTKDocHtml-${MY_PV}.tar.gz )
15 examples? ( mirror://sourceforge/${PN}/VTKData-${MY_PV}.tar.gz )"
16
17 LICENSE="BSD"
18 KEYWORDS="~x86"
19 SLOT="0"
20 IUSE="doc examples java mpi patented python tcltk threads"
21 RDEPEND="java? ( =virtual/jdk-1.4* )
22 mpi? ( sys-cluster/mpich )
23 python? ( >=dev-lang/python-2.0 )
24 >=dev-lang/tcl-8.2.3
25 >=dev-lang/tk-8.2.3
26 dev-libs/expat
27 media-libs/jpeg
28 media-libs/libpng
29 media-libs/tiff
30 virtual/opengl
31 || ( x11-libs/libXmu virtual/x11 )"
32
33 DEPEND="${RDEPEND}
34 >=dev-util/cmake-1.8"
35
36 S=${WORKDIR}/VTK
37
38 src_unpack() {
39 unpack ${A}
40 epatch ${FILESDIR}/${P}-gcc34.patch
41 }
42
43 src_compile() {
44 # gcc versions 3.2.x seem to have sse-related bugs that are triggered
45 # by VTK when compiling for pentium3/4
46 if [ "$(gcc-major-version)" -eq 3 -a "$(gcc-minor-version)" -eq 2 -a \
47 "$(get-flag -march)" == "-march=pentium4" ]; then
48 filter-mfpmath sse
49 filter-flags "-msse -msse2"
50 echo "$(get-flag -march)"
51 fi
52
53 # build list of config variable define's to pass to cmake
54 local CMAKE_VARIABLES=""
55 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DCMAKE_SKIP_RPATH:BOOL=YES"
56 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DCMAKE_INSTALL_PREFIX:PATH=/usr"
57 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DBUILD_SHARED_LIBS:BOOL=ON"
58 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_SYSTEM_JPEG:BOOL=ON"
59 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_SYSTEM_PNG:BOOL=ON"
60 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_SYSTEM_TIFF:BOOL=ON"
61 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_SYSTEM_ZLIB:BOOL=ON"
62 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_SYSTEM_EXPAT:BOOL=ON"
63 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DBUILD_TESTING:BOOL=OFF"
64 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_HYBRID:BOOL=ON"
65 use examples && CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_DATA_ROOT:PATH=/usr/share/${PN}/data -DBUILD_EXAMPLES:BOOL=ON"
66 if use java; then
67 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_WRAP_JAVA:BOOL=ON"
68 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DJAVA_AWT_LIBRARY:PATH=`java-config -O`/jre/lib/i386/libjawt.so"
69 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DJAVA_AWT_INCLUDE_PATH:PATH=`java-config -O`/include"
70 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DJAVA_INCLUDE_PATH:PATH=`java-config -O`/include"
71 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DJAVA_INCLUDE_PATH2:PATH=`java-config -O`/include/linux"
72 fi
73 if use mpi; then
74 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_MPI:BOOL=ON"
75 use !threads && CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_PARALLEL:BOOL=ON"
76 fi
77
78 if use python; then
79 python_version
80 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_WRAP_PYTHON:BOOL=ON"
81 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DPYTHON_INCLUDE_PATH:PATH=/usr/include/python${PYVER}"
82 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DPYTHON_LIBRARY:PATH=/usr/$(get_libdir)/libpython${PYVER}.so"
83 fi
84
85 use tcltk && CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_WRAP_TCL:BOOL=ON"
86 use threads && CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_PARALLEL:BOOL=ON"
87 use patented && CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_PATENTED:BOOL=ON"
88
89 # run cmake twice to achieve proper
90 # configuration with cmake 2.2.x
91 cmake ${CMAKE_VARIABLES} . && cmake ${CMAKE_VARIABLES} . \
92 || die "cmake configuration failed"
93
94 emake || die "emake failed"
95 }
96
97 src_install() {
98 make DESTDIR=${D} install || die "make install failed"
99
100 # fix config file
101 sed -i -e "s:${D}:/:g" ${D}/usr/$(get_libdir)/${PN}/VTKConfig.cmake
102
103 LDPATH="/usr/$(get_libdir)/${PN}"
104 # install python modules
105 if use python; then
106 distutils_python_version
107 LDPATH="${LDPATH}:/usr/$(get_libdir)/python${PYVER}/site-packages/${PN}_python"
108 cd ${S}/Wrapping/Python
109 docinto vtk_python
110 distutils_src_install
111
112 # make symlinks to vtk python modules
113 FILES="${D}/usr/$(get_libdir)/vtk/libvtk*Python*.so"
114 for file in ${FILES}
115 do
116 dosym ${file} /usr/$(get_libdir)/python${PYVER}/site-packages/${PN}_python
117 done
118 fi
119
120 # install jar
121 use java && java-pkg_dojar ${S}/bin/vtk.jar
122
123 # install documentation
124 use doc && dohtml -r ${WORKDIR}/html/
125
126 # install examples
127 if use examples; then
128 dodir /usr/share/${PN}
129 cp -pPR ${S}/Examples ${D}/usr/share/${PN}/examples
130
131 # fix example's permissions
132 find ${D}/usr/share/${PN}/examples -type d -exec chmod 0755 {} \;
133 find ${D}/usr/share/${PN}/examples -type f -exec chmod 0644 {} \;
134
135 # VTKData uses a hyphen instead of a dot
136 MY_PV_HYPHEN=`echo ${MY_PV} | sed -e "s/\./-/"`
137 dodir /usr/share/${PN}
138 cp -pPR ${WORKDIR}/VTKData-release-${MY_PV_HYPHEN} ${D}/usr/share/${PN}/data
139
140 # fix data's permissions
141 find ${D}/usr/share/${PN}/data -type d -exec chmod 0755 {} \;
142 find ${D}/usr/share/${PN}/data -type f -exec chmod 0644 {} \;
143 fi
144
145 # environment
146 echo "LDPATH=${LDPATH}" > ${T}/40${PN}
147 echo "VTK_DATA_ROOT=/usr/share/${PN}/data" >> ${T}/40${PN}
148 echo "LD_LIBRARY_PATH=/usr/$(get_libdir)/${PN}" >> ${T}/40${PN}
149 if use java; then
150 echo "CLASSPATH=/usr/share/${PN}/lib/${PN}.jar" >> ${T}/40${PN}
151 fi
152 use tcltk && echo "TCLLIBPATH=/usr/$(get_libdir)/${PN}/tcl" >> ${T}/40${PN}
153 doenvd ${T}/40${PN}
154 }
155
156 pkg_postinst() {
157 if use patented; then
158 ewarn "Using patented code in VTK may require a license."
159 ewarn "For more information, please read:"
160 ewarn "http://public.kitware.com/cgi-bin/vtkfaq?req=show&file=faq07.005.htp"
161 fi
162 }

  ViewVC Help
Powered by ViewVC 1.1.20