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 121952 2014-07-12 05:25:04Z sean@macports.org $ |
---|
3 | |
---|
4 | PortSystem 1.0 |
---|
5 | PortGroup cmake 1.0 |
---|
6 | PortGroup compilers 1.0 |
---|
7 | |
---|
8 | name magicspp |
---|
9 | version 2.22.6 |
---|
10 | platforms darwin |
---|
11 | maintainers takeshi |
---|
12 | license Apache-2 |
---|
13 | categories science |
---|
14 | description ECMWF's Meteorological plotting software |
---|
15 | homepage http://software.ecmwf.int/wiki/display/MAGP/Magics |
---|
16 | master_sites https://software.ecmwf.int/wiki/download/attachments/3473464/ |
---|
17 | distname Magics-${version}-Source |
---|
18 | checksums md5 99ac8a9b50861f4632ca3b96099dc14b \ |
---|
19 | sha1 c61311413c396f74f04eecda3b51293cdfd9df48 \ |
---|
20 | rmd160 847e8a16fcf17c83410e82bdfe99dafc62d85c08 |
---|
21 | long_description \ |
---|
22 | Magics++ is the latest generation of the ECMWF's Meteorological plotting \ |
---|
23 | software MAGICS (Meteorological Applications Graphics Integrated Colour System) \ |
---|
24 | redesigned in C++. Magics++ offers interfaces in Fortran, C, and MagML, \ |
---|
25 | a plot description language based on XML. The library supports the plotting of \ |
---|
26 | contours, wind fields, observations, satellite images, symbols, text, axis \ |
---|
27 | and graphs (including boxplots). Input data can be in GRIB 1 and 2, BUFR and NetCDF \ |
---|
28 | or retrieved from an ODB database. The produced meteorological plots can be saved \ |
---|
29 | in various formats, such as PostScript, EPS, PDF, GIF, PNG and SVG. |
---|
30 | |
---|
31 | fetch.ignore_sslcert yes |
---|
32 | |
---|
33 | compilers.choose fc |
---|
34 | compilers.setup require_fortran -g95 |
---|
35 | |
---|
36 | depends_build port:cmake \ |
---|
37 | port:flex |
---|
38 | depends_lib port:emos \ |
---|
39 | port:grib_api \ |
---|
40 | port:netcdf-cxx \ |
---|
41 | port:mesa \ |
---|
42 | port:xorg-libXau \ |
---|
43 | port:xorg-libXdmcp \ |
---|
44 | port:p5.12-xml-parser \ |
---|
45 | port:gd2 \ |
---|
46 | path:lib/pkgconfig/pango.pc:pango \ |
---|
47 | port:ghostscript \ |
---|
48 | port:boost \ |
---|
49 | port:proj47 \ |
---|
50 | port:swig-python |
---|
51 | require_active_variants cairo x11 |
---|
52 | |
---|
53 | use_parallel_build no |
---|
54 | universal_variant no |
---|
55 | |
---|
56 | if {![fortran_variant_isset]} { |
---|
57 | default_variants-append +gcc48 |
---|
58 | } |
---|
59 | if {![variant_isset python25] && ![variant_isset python26]} { |
---|
60 | default_variants-append +python27 |
---|
61 | } |
---|
62 | |
---|
63 | configure.cmd cmake |
---|
64 | configure.dir ${workpath}/build |
---|
65 | configure.args-append -DBOOST_ROOT=${prefix} \ |
---|
66 | -DCMAKE_Fortran_COMPILER=${configure.fc} \ |
---|
67 | -DENABLE_BUFR=ON \ |
---|
68 | -DENABLE_CAIRO=ON \ |
---|
69 | -DENABLE_FORTRAN=OFF \ |
---|
70 | -DENABLE_GRIB=ON \ |
---|
71 | -DENABLE_LARGE_FILE_SUPPORT=ON \ |
---|
72 | -DENABLE_NETCDF=ON \ |
---|
73 | -DENABLE_PYTHON=ON \ |
---|
74 | -DEXPAT_INCLUDE_DIR=${prefix}/include \ |
---|
75 | -DEXPAT_LIBRARY=${prefix}/lib/libexpat.dylib \ |
---|
76 | -DFLEX_EXECUTABLE=${prefix}/bin/flex \ |
---|
77 | -DFLEX_INCLUDE_DIR=${prefix}/include \ |
---|
78 | -DFL_LIBRARY=${prefix}/lib/libfl.a \ |
---|
79 | -DGRIB_API_PATH=${prefix} \ |
---|
80 | -DGRIB_API_INCLUDE_DIR=${prefix}/include \ |
---|
81 | -DGRIB_API_INFO=${prefix}/bin/grib_info \ |
---|
82 | -DGRIB_API_JPG=ON \ |
---|
83 | -DGRIB_API_LIBRARY=${prefix}/lib/libgrib_api.dylib \ |
---|
84 | -DGRIB_API_PNG=ON \ |
---|
85 | -DGS_LIBRARIES=${prefix}/lib/libgs.dylib \ |
---|
86 | -DHDF5_CXX_COMPILER_EXECUTABLE=${prefix}/bin/h5c++ \ |
---|
87 | -DHDF5_CXX_INCLUDE_DIR=${prefix}/include \ |
---|
88 | -DHDF5_C_COMPILER_EXECUTABLE=${prefix}/bin/h5cc \ |
---|
89 | -DHDF5_C_INCLUDE_DIR=${prefix}/include \ |
---|
90 | -DHDF5_DIFF_EXECUTABLE=${prefix}/bin/h5diff \ |
---|
91 | -DHDF5_hdf5_cpp_LIBRARY_RELEASE=${prefix}/lib/libhdf5.dylib \ |
---|
92 | -DHDF5_hdf5_hl_LIBRARY_RELEASE=${prefix}/lib/libhdf5_hl.dylib \ |
---|
93 | -DJASPER_INCLUDE_DIR=${prefix}/include \ |
---|
94 | -DJASPER_LIBRARY_RELEASE=${prefix}/lib/libjasper.dylib \ |
---|
95 | -DJPEG_INCLUDE_DIR=${prefix}/include \ |
---|
96 | -DJPEG_LIBRARY=${prefix}/lib/libjpeg.dylib \ |
---|
97 | -DNETCDF_CONFIG_EXECUTABLE=${prefix}/bin/nc-config \ |
---|
98 | -DNETCDF_netcdf.h_INCLUDE_DIR=${prefix}/include \ |
---|
99 | -DNETCDF_netcdf_LIBRARY_RELEASE=${prefix}/lib/libnetcdf.dylib \ |
---|
100 | -DNETCDF_netcdf_c++_LIBRARY_RELEASE=${prefix}/lib/libnetcdf_c++.dylib \ |
---|
101 | -DNETCDF_netcdfcpp.h_INCLUDE_DIR=${prefix}/include \ |
---|
102 | -DOPENJPEG_INCLUDE_DIR=${prefix}/include \ |
---|
103 | -DOPENJPEG_LIBRARY=${prefix}/lib/libopenjpeg.dylib \ |
---|
104 | -DPERL_EXECUTABLE=${prefix}/bin/perl \ |
---|
105 | -DPKG_CONFIG_EXECUTABLE=${prefix}/bin/pkg-config \ |
---|
106 | -DPNG_LIBRARY_RELEASE=${prefix}/lib/libpng.dylib \ |
---|
107 | -DPNG_PNG_INCLUDE_DIR=${prefix}/include \ |
---|
108 | -DPROJ4_INCLUDE_DIR=${prefix}/include \ |
---|
109 | -DPROJ4_LIBRARY=${prefix}/lib/libproj.dylib \ |
---|
110 | -DSWIG_EXECUTABLE=${prefix}/bin/swig \ |
---|
111 | -DZLIB_INCLUDE_DIR=${prefix}/include \ |
---|
112 | -DZLIB_LIBRARY=${prefix}/lib/libz.dylib |
---|
113 | configure.post_args ../${distname} |
---|
114 | post-configure { |
---|
115 | reinplace "s|Magics-${version}-Source/python/Magics/Magics.i$|build/python/Magics/Magics.i|g" ${workpath}/build/python/Magics/CMakeFiles/_Magics.dir/build.make |
---|
116 | reinplace "s|-lcairo|-lcairo -lX11|" ${workpath}/build/src/CMakeFiles/MagPlusShared.dir/link.txt |
---|
117 | foreach d {bufr grib} { |
---|
118 | reinplace "s|${configure.fc}|${configure.cxx}|" ${workpath}/build/test/CMakeFiles/${d}_fortran.dir/link.txt |
---|
119 | reinplace "s|-I/opt/local/include||g" ${workpath}/build/src/magics.pc |
---|
120 | } |
---|
121 | } |
---|
122 | |
---|
123 | build.dir ${workpath}/build |
---|
124 | |
---|
125 | post-destroot { |
---|
126 | file rename ${destroot}${prefix}/share/templates ${destroot}${prefix}/share/magics |
---|
127 | if {[variant_isset python25] || [variant_isset python26] || [variant_isset python27]} { |
---|
128 | file mkdir ${destroot}${frameworks_dir}/Python.framework/Versions/${pyver}/lib/python${pyver}/site-packages |
---|
129 | file rename ${destroot}${prefix}/lib/python${pyver}/site-packages/Magics ${destroot}${frameworks_dir}/Python.framework/Versions/${pyver}/lib/python${pyver}/site-packages |
---|
130 | } |
---|
131 | } |
---|
132 | |
---|
133 | if {[fortran_variant_isset]} { |
---|
134 | configure.args-delete -DENABLE_FORTRAN=OFF |
---|
135 | configure.args-append -DGFORTRAN_EXECUTABLE=${configure.fc} \ |
---|
136 | -DGFORTRAN_LIB=${prefix}/lib/[fortran_variant_name]/libgfortran.dylib |
---|
137 | } |
---|
138 | |
---|
139 | if {[variant_isset python25]} { |
---|
140 | set pyver 2.5 |
---|
141 | } |
---|
142 | if {[variant_isset python26]} { |
---|
143 | set pyver 2.6 |
---|
144 | } |
---|
145 | if {[variant_isset python27]} { |
---|
146 | set pyver 2.7 |
---|
147 | } |
---|
148 | if {[variant_isset python25] || [variant_isset python26] || [variant_isset python27]} { |
---|
149 | configure.args-delete -DENABLE_PYTHON=OFF |
---|
150 | configure.args-append -DENABLE_PYTHON=ON |
---|
151 | configure.args-append -DPYTHON_EXECUTABLE=${prefix}/bin/python${pyver} \ |
---|
152 | -DPYTHON_CONFIG=${prefix}/bin/python${pyver}-config |
---|
153 | } |
---|
154 | |
---|
155 | variant python25 description {Add support for python25} { |
---|
156 | depends_lib-append port:py25-numpy |
---|
157 | } |
---|
158 | |
---|
159 | variant python26 description {Add support for python26} { |
---|
160 | depends_lib-append port:py26-numpy |
---|
161 | } |
---|
162 | |
---|
163 | variant python27 description {Add support for python27} { |
---|
164 | depends_lib-append port:py27-numpy |
---|
165 | } |
---|