source: trunk/dports/graphics/vtk5/Portfile

Last change on this file was 145015, checked in by khindenburg@…, 20 months ago

vtk5: remove legacy variants

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 8.9 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 145015 2016-01-23 20:26:52Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           cmake 1.0
6
7name                vtk5
8version             5.10.1
9revision            3
10set branch          [join [lrange [split ${version} .] 0 1] .]
11#
12# There was a stealth-update of vtkdata-5.10.1 that invalidated the checksums
13# of that file.
14# (see https://trac.macports.org/wiki/PortfileRecipes#stealth-updates)
15# Remove the 'dist_subdir' line when the next proper version of vtk5 is
16# released...
17#
18dist_subdir         ${name}/${version}_1
19
20categories          graphics devel
21platforms           darwin freebsd
22license             BSD
23maintainers         nomaintainer
24
25description         3D visualization toolkit
26long_description    an open source, freely available software system  \
27    for 3D computer graphics, image processing, and visualization     \
28    used by thousands of researchers and developers around the world. \
29    VTK consists of a C++ class library, and several interpreted      \
30    interface layers including Tcl/Tk, Java, and Python.
31
32homepage            http://www.vtk.org/
33master_sites        http://www.vtk.org/files/release/${branch}/
34
35distname            VTK${version}
36distfiles           vtk-${version}${extract.suffix}
37checksums           vtk-${version}${extract.suffix} \
38                    md5     264b0052e65bd6571a84727113508789 \
39                    sha1    deb834f46b3f7fc3e122ddff45e2354d69d2adc3 \
40                    rmd160  3b0b138bf45743e925a905fb2eccb6b3ab3dada4
41
42
43depends_build-append    port:readline
44
45patchfiles          patch-tiff-inline.diff legacy.patch
46post-patch {
47    # Xcode 5.1 breaks vtk build. A backwards compatible fix is to remove
48    # -fobjc-gc; see http://review.source.kitware.com/#/c/14424/
49    reinplace -W ${worksrcpath} "s,-fobjc-gc,,g" CMakeLists.txt
50}
51
52configure.args-append  \
53    -DBUILD_SHARED_LIBS:BOOL=ON \
54    -DVTK_USE_RPATH:BOOL=ON \
55    -DCMAKE_INSTALL_RPATH:STRING=${prefix}/lib/vtk-${branch} \
56    -DCMAKE_INSTALL_NAME_DIR:STRING=${prefix}/lib/vtk-${branch} \
57    -DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON \
58    -DVTK_INSTALL_PREFIX:PATH=${prefix} \
59    -DVTK_USE_HYBRID:BOOL=ON \
60    -DVTK_USE_TK:BOOL=OFF \
61    -DVTK_WRAP_TCL:BOOL=OFF \
62    -DTK_INCLUDE_PATH=${prefix}/include \
63    -DTK_LIBRARY=${prefix}/lib/libtk.dylib \
64    -DVTK_USE_CARBON:BOOL=OFF \
65    -DVTK_USE_COCOA:BOOL=ON \
66    -DVTK_DATA_ROOT:PATH=${prefix}/share/VTKData \
67    -DVTK_USE_GL2PS:BOOL=ON \
68    -DVTK_WRAP_PYTHON:BOOL=OFF
69configure.cxxflags-append \
70    -DUSE_INTERP_ERRORLINE
71configure.cppflags-replace \
72    -I${prefix}/include -isystem${prefix}/include
73
74if {${os.major} <= 10} {
75    configure.args-append  \
76        -DIOKit:FILEPATH=/System/Library/Frameworks/IOKit.framework
77}
78
79post-configure {
80    reinplace "s|c++|c++ -L${prefix}/lib |" \
81    ${worksrcpath}/Infovis/Testing/Cxx/CMakeFiles/InfovisCxxTests.dir/link.txt \
82    ${worksrcpath}/IO/Testing/Cxx/CMakeFiles/IOCxxTests.dir/link.txt \
83    ${worksrcpath}/Views/Testing/Cxx/CMakeFiles/ViewsCxxTests.dir/link.txt
84
85    if {[variant_isset tcltk]} {
86      reinplace "s|c++|c++ -L${prefix}/lib |" \
87      ${worksrcpath}/Wrapping/Tcl/CMakeFiles/vtk.dir/link.txt
88    }
89}
90
91use_parallel_build  yes
92
93build.env-append \
94    DYLD_LIBRARY_PATH=${worksrcpath}/bin
95
96if {![variant_isset carbon] && ![variant_isset qt4_mac]} {
97    default_variants +x11 +tcltk
98}
99
100post-destroot {
101    set vtkdest ${destroot}${prefix}/share/doc/${name}
102    xinstall -d ${vtkdest}
103    xinstall -m 644 -W ${worksrcpath} Copyright.txt README.html Testing.txt ${vtkdest}
104}
105
106variant x11 conflicts carbon qt4_mac {
107    depends_lib-append port:mesa port:libGLU port:Xft2 port:xorg-libXScrnSaver port:xorg-libXt
108    configure.args-delete \
109        -DVTK_USE_COCOA:BOOL=ON
110    configure.args-append \
111        -DVTK_USE_COCOA:BOOL=OFF \
112        -DVTK_USE_X:BOOL=ON \
113        -DOPENGL_gl_LIBRARY:FILEPATH=${prefix}/lib/libGL.dylib \
114        -DOPENGL_glu_LIBRARY:FILEPATH=${prefix}/lib/libGLU.dylib
115}
116
117variant tcltk conflicts carbon description {Build with Tcl wrappers and Tk support} {
118    depends_lib-append port:tcl port:tk
119    configure.args-delete \
120        -DVTK_USE_TK:BOOL=OFF \
121        -DVTK_WRAP_TCL:BOOL=OFF
122    configure.args-append \
123        -DVTK_USE_TK:BOOL=ON \
124        -DVTK_WRAP_TCL:BOOL=ON \
125        -DTCL_INCLUDE_PATH=${prefix}/include \
126        -DTCL_LIBRARY=${prefix}/lib/libtcl.dylib
127}
128
129variant carbon conflicts x11 tcltk description {Use Carbon.  Allows embedding VTK within qt4-mac (and py*-pyqt4 when used with Python)} {
130    supported_archs i386 ppc
131    if {${os.platform} eq "darwin" && ${os.major} >= 12} {
132        ui_error "${name}: 'carbon' is not supported on OS X 10.8 or greater"
133        return -code error "incompatible OS X version"
134    }
135    configure.args-delete \
136        -DVTK_USE_COCOA:BOOL=ON \
137        -DVTK_USE_CARBON:BOOL=OFF
138    configure.args-append \
139        -DVTK_USE_COCOA:BOOL=OFF \
140        -DVTK_USE_CARBON:BOOL=ON
141}
142
143set pythons_suffixes {27}
144
145set pythons_ports {}
146foreach s ${pythons_suffixes} {
147    lappend pythons_ports python${s}
148}
149
150foreach s ${pythons_suffixes} {
151    set p python${s}
152    set v [string index ${s} 0].[string index ${s} 1]
153    set i [lsearch -exact ${pythons_ports} ${p}]
154    set c [lreplace ${pythons_ports} ${i} ${i}]
155    eval [subst {
156        variant ${p} description "Build Python ${v} wrappers" conflicts ${c} {
157            depends_lib-append    port:${p}
158
159            configure.args-delete   \
160                -DVTK_WRAP_PYTHON:BOOL=OFF
161            configure.args-append   \
162                -DPYTHON_DEBUG_LIBRARY:FILEPATH=${prefix}/lib/libpython${v}.dylib \
163                -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/bin/python${v} \
164                -DPYTHON_INCLUDE_PATH:FILEPATH=${frameworks_dir}/Python.framework/Versions/${v}/Headers \
165                -DPYTHON_LIBRARY:FILEPATH=${prefix}/lib/libpython${v}.dylib \
166                -DVTK_WRAP_PYTHON:BOOL=ON \
167                -DVTK_INSTALL_NO_PYTHON:BOOL=ON
168
169            post-configure {
170                system -W ${worksrcpath}/Wrapping/Python/CMakeFiles/vtkpython.dir "echo `cat link.txt` -L../../bin > link.txt"
171                system -W ${worksrcpath}/Wrapping/Python/CMakeFiles/vtkPythonCore.dir "echo `cat link.txt` -L../../bin > link.txt"
172            }
173
174            post-destroot {
175                file mkdir ${destroot}${prefix}/lib/python${v}/site-packages
176                system "cd ${worksrcpath}/Wrapping/Python && ${prefix}/bin/python${v} setup.py install --prefix=${frameworks_dir}/Python.framework/Versions/${v} --root=${destroot}"
177            }
178        }
179    }]
180}
181
182if {[variant_isset qt4_mac]} {
183    PortGroup qt4 1.0
184}
185
186variant qt4_mac conflicts x11 description {Build GUI support with Qt4 (Mac)} {
187    depends_lib-append      port:phonon
188    configure.args-append   -DVTK_USE_QT:BOOL=ON \
189                            -DVTK_USE_GUISUPPORT:BOOL=ON \
190                            -DQT_PHONON_INCLUDE_DIR=${prefix}/include/phonon \
191                            ${qt_cmake_defines}
192    post-destroot {
193        xinstall -m 755 -d ${destroot}${qt_plugins_dir}/designer
194        move ${destroot}${prefix}/plugins/designer/libQVTKWidgetPlugin.dylib \
195            ${destroot}${qt_plugins_dir}/designer/
196        set fixfile ${qt_plugins_dir}/designer/libQVTKWidgetPlugin.dylib
197        system "install_name_tool -id ${fixfile} ${destroot}${fixfile}"
198    }
199}
200
201variant mysql description {Build the MySQL driver for vtkSQLDatabase} {
202    depends_build-append    port:zlib \
203                            port:mysql5
204    configure.args-append   -DVTK_USE_MYSQL:BOOL=ON \
205                            -DMYSQL_LIBRARY:FILEPATH=${prefix}/lib/mysql5/mysql/libmysqlclient.dylib \
206                            -DMYSQL_INCLUDE_DIRECTORIES:FILEPATH=${prefix}/include/mysql5/mysql/ \
207                            -DMYSQL_EXTRA_LIBRARIES:FILEPATH=${prefix}/lib/libz.dylib
208}
209
210variant data description {Install data and examples} {
211    distfiles-append    vtkdata-${version}${extract.suffix}
212    checksums-append    vtkdata-${version}${extract.suffix} \
213                        md5     b6355063264cd56bcd1396c92f6ca59a \
214                        sha1    9fb9b3324dc5960813fbffd4111562f7b717a483 \
215                        rmd160  950f4dcc52ae077fb3b0d385fdd33d4dc18fdb1a
216
217    post-destroot {
218        set vtkdest ${destroot}${prefix}/share/doc/${name}
219        # Provide some examples
220        file copy ${worksrcpath}/Examples ${vtkdest}
221        xinstall -W ${worksrcpath}/bin \
222            CommonCxxTests \
223            FilteringCxxTests \
224            GenericFilteringCxxTests \
225            GraphicsCxxTests \
226            IOCxxTests \
227            ImagingCxxTests \
228            RenderingCxxTests \
229            TestCxxFeatures \
230            TestInstantiator \
231            VTKBenchMark \
232            VolumeRenderingCxxTests \
233            WidgetsCxxTests \
234            ${vtkdest}/Examples
235
236        # Provide data files
237        system "tar -C ${destroot}${prefix}/share -xzvf ${distpath}/vtkdata-${version}${extract.suffix}"
238    }
239}
Note: See TracBrowser for help on using the repository browser.