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$ |
---|
3 | |
---|
4 | # Used the VTK5-Portfile as a basis |
---|
5 | |
---|
6 | PortSystem 1.0 |
---|
7 | |
---|
8 | PortGroup qt4 1.0 |
---|
9 | PortGroup mpi 1.0 |
---|
10 | PortGroup cmake 1.0 |
---|
11 | PortGroup select 1.0 |
---|
12 | |
---|
13 | name paraview42 |
---|
14 | version 4.2.0 |
---|
15 | revision 1 |
---|
16 | set branch [join [lrange [split ${version} .] 0 1] .] |
---|
17 | # |
---|
18 | # There was a stealth-update of vtkdata-5.10.1 that invalidated the checksums of that file. |
---|
19 | # (see https://trac.macports.org/wiki/PortfileRecipes#stealth-updates) Remove the 'dist_subdir' |
---|
20 | # line when the next proper version of vtk5 is released... |
---|
21 | # |
---|
22 | dist_subdir ${name}/${version}_1 |
---|
23 | # |
---|
24 | categories science graphics |
---|
25 | maintainers nomaintainer |
---|
26 | description 3D data analysis and visualization application |
---|
27 | long_description ParaView is an open-source, multi-platform data \ |
---|
28 | analysis and visualization application. ParaView users can quickly \ |
---|
29 | build visualizations to analyze their data using qualitative and \ |
---|
30 | quantitative techniques. The data exploration can be done \ |
---|
31 | interactively in 3D or programmatically using ParaView’s batch \ |
---|
32 | processing capabilities. |
---|
33 | |
---|
34 | license BSD |
---|
35 | |
---|
36 | homepage http://www.paraview.org/ |
---|
37 | platforms darwin |
---|
38 | master_sites http://www.paraview.org/files/v${branch}/ |
---|
39 | |
---|
40 | distfiles ParaView-v${version}-source${extract.suffix} |
---|
41 | checksums ParaView-v${version}-source${extract.suffix} \ |
---|
42 | sha256 ac26cc5fe5ce82d27531727a01242353d40984826eaa580edea0791887a07b6b \ |
---|
43 | rmd160 c326c70e15c2555ddf0700020b8f62c5f69b7a92 |
---|
44 | |
---|
45 | depends_build-append port:readline \ |
---|
46 | port:gmake \ |
---|
47 | port:netcdf \ |
---|
48 | port:qt4-mac-sqlite3-plugin |
---|
49 | |
---|
50 | depends_run port:paraview_select |
---|
51 | |
---|
52 | distname ${name}-${version}-src |
---|
53 | |
---|
54 | patchfiles patch-vtkProcessModuleInitializePython.h.diff |
---|
55 | patch.dir ${workpath}/ParaView-v${version}-source |
---|
56 | |
---|
57 | default_variants +python27 +llvm +openmpi +ffmpeg |
---|
58 | # +gcc49 causes a segmentation fault |
---|
59 | |
---|
60 | # patchfiles |
---|
61 | |
---|
62 | use_parallel_build yes |
---|
63 | # use_parallel_build no |
---|
64 | |
---|
65 | compilers.choose cxx cc |
---|
66 | mpi.choose |
---|
67 | mpi.setup |
---|
68 | compilers.setup |
---|
69 | |
---|
70 | configure.args-append \ |
---|
71 | -DBUILD_SHARED_LIBS:BOOL=ON \ |
---|
72 | -DPARAVIEW_DO_UNIX_STYLE_INSTALLS:BOOL=ON |
---|
73 | |
---|
74 | configure.cxxflags-append \ |
---|
75 | -DUSE_INTERP_ERRORLINE |
---|
76 | configure.cppflags-replace -I${prefix}/include -isystem${prefix}/include |
---|
77 | |
---|
78 | build.env-append DYLD_LIBRARY_PATH=${worksrcpath}/bin |
---|
79 | |
---|
80 | variant ffmpeg description {Add support for FFMPEG} { |
---|
81 | depends_lib-append port:ffmpeg |
---|
82 | configure.args-append -DPARAVIEW_ENABLE_FFMPEG:BOOL=ON |
---|
83 | } |
---|
84 | |
---|
85 | set pythons_suffixes {27} |
---|
86 | |
---|
87 | set pythons_ports {} |
---|
88 | foreach s ${pythons_suffixes} { |
---|
89 | lappend pythons_ports python${s} |
---|
90 | } |
---|
91 | |
---|
92 | foreach s ${pythons_suffixes} { |
---|
93 | set p python${s} |
---|
94 | set v [string index ${s} 0].[string index ${s} 1] |
---|
95 | set i [lsearch -exact ${pythons_ports} ${p}] |
---|
96 | set c [lreplace ${pythons_ports} ${i} ${i}] |
---|
97 | eval [subst { |
---|
98 | variant ${p} description "Use Python" conflicts ${c} { |
---|
99 | depends_lib-append port:${p} |
---|
100 | |
---|
101 | configure.args-append \ |
---|
102 | -DPARAVIEW_ENABLE_PYTHON:BOOL=ON \ |
---|
103 | -DPYTHON_DEBUG_LIBRARY:FILEPATH=${prefix}/lib/libpython${v}.dylib \ |
---|
104 | -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/bin/python${v} \ |
---|
105 | -DPYTHON_INCLUDE_PATH:FILEPATH=${frameworks_dir}/Python.framework/Versions/${v}/Headers \ |
---|
106 | -DPYTHON_LIBRARY:FILEPATH=${prefix}/lib/libpython${v}.dylib |
---|
107 | depends_lib-append port:py${s}-numpy port:py${s}-matplotlib |
---|
108 | } |
---|
109 | }] |
---|
110 | } |
---|
111 | |
---|
112 | select.group paraview |
---|
113 | select.file ${filespath}/paraview[string map {. {}} ${branch}] |
---|
114 | set confdir config-${branch}m |
---|
115 | |
---|
116 | notes " |
---|
117 | To make paraview ${branch} the default (i.e. the version you get when you run\ |
---|
118 | 'paraview'), please run: |
---|
119 | |
---|
120 | sudo port select --set ${select.group} [file tail ${select.file}] |
---|
121 | " |
---|
122 | |
---|
123 | pre-configure { |
---|
124 | configure.args-delete -DCMAKE_OSX_SYSROOT="/" |
---|
125 | |
---|
126 | configure.args-append \ |
---|
127 | -DBUILD_TESTING:BOOL=OFF \ |
---|
128 | -DPARAVIEW_INSTALL_DEVELOPMENT_FILES:BOOL=ON \ |
---|
129 | -DCMAKE_CXX_COMPILER=${configure.cxx} \ |
---|
130 | -DCMAKE_C_COMPILER=${configure.cc} |
---|
131 | |
---|
132 | if {[mpi_variant_isset]} { |
---|
133 | configure.args-append \ |
---|
134 | -DPARAVIEW_USE_MPI:BOOL=ON \ |
---|
135 | -DMPI_C_COMPILER=${mpi.cc} \ |
---|
136 | -DMPI_CXX_COMPILER=${mpi.cxx} \ |
---|
137 | -DMPIEXEC=${mpi.exec} \ |
---|
138 | -DMPI_EXEC=${mpi.exec} |
---|
139 | } |
---|
140 | |
---|
141 | configure.args-append ${workpath}/ParaView-v${version}-source |
---|
142 | } |
---|
143 | |
---|
144 | post-configure { |
---|
145 | system "cd ${worksrcpath}/lib && ln -s . paraview-${branch}" |
---|
146 | } |
---|
147 | |
---|
148 | post-build { |
---|
149 | # copy ${worksrcpath}/bin/paraview.app/Contents/MacOS/paraview ${worksrcpath}/bin/ |
---|
150 | } |
---|
151 | |
---|
152 | post-destroot { |
---|
153 | # copy ${worksrcpath}/bin/paraview ${destroot}${prefix}/bin |
---|
154 | copy ${worksrcpath}/bin/paraview.app/Contents/MacOS/paraview ${destroot}${prefix}/bin |
---|
155 | system "rm -r ${destroot}${prefix}/var/macports" |
---|
156 | system "rm -r ${destroot}${prefix}/share/man/man3" |
---|
157 | system "/usr/bin/install_name_tool -change ${worksrcpath}/lib/libprotobuf.dylib @executable_path/../lib/paraview-${branch}/libprotobuf.dylib ${destroot}${prefix}/bin/paraview" |
---|
158 | foreach f [glob ${destroot}${prefix}/bin/*] { |
---|
159 | if {![string match {*-pv*} ${f}]} { |
---|
160 | if {![string match {*.app} ${f}]} { |
---|
161 | move ${f} ${f}-${branch} |
---|
162 | } |
---|
163 | } |
---|
164 | } |
---|
165 | foreach f [glob ${destroot}${prefix}/lib/cmake/*.cmake] { |
---|
166 | move ${f} ${f}-${branch} |
---|
167 | } |
---|
168 | } |
---|