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