| 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 133428 2015-03-01 13:18:57Z takeshi@macports.org $ |
|---|
| 3 | |
|---|
| 4 | PortSystem 1.0 |
|---|
| 5 | PortGroup cmake 1.0 |
|---|
| 6 | PortGroup compilers 1.0 |
|---|
| 7 | PortGroup wxWidgets 1.0 |
|---|
| 8 | |
|---|
| 9 | name plplot |
|---|
| 10 | version 5.10.0 |
|---|
| 11 | revision 3 |
|---|
| 12 | platforms darwin |
|---|
| 13 | maintainers takeshi openmaintainer |
|---|
| 14 | categories science |
|---|
| 15 | license LGPL |
|---|
| 16 | description Scientific plotting package, double precision version |
|---|
| 17 | master_sites sourceforge |
|---|
| 18 | checksums rmd160 16e353cf410232da700d5f2edd1533006f2dc4c4 \ |
|---|
| 19 | sha256 d4e930b8b9d43cd1663408986218d61f166de7cbc9ef5bed111b0bdea934f9d5 |
|---|
| 20 | homepage http://plplot.sourceforge.net/ |
|---|
| 21 | set description_base "PLplot is a cross-platform software package for \ |
|---|
| 22 | creating scientific plots. To help accomplish that task it is organized as a \ |
|---|
| 23 | core C library, language bindings for that library, and device drivers which \ |
|---|
| 24 | control how the plots are presented in non-interactive and interactive \ |
|---|
| 25 | plotting contexts." |
|---|
| 26 | |
|---|
| 27 | long_description ${description_base} This port uses double precision. |
|---|
| 28 | |
|---|
| 29 | compilers.choose fc f90 |
|---|
| 30 | compilers.setup |
|---|
| 31 | |
|---|
| 32 | # depends_build-append \ |
|---|
| 33 | # port:pkgconfig |
|---|
| 34 | |
|---|
| 35 | depends_lib port:qhull \ |
|---|
| 36 | port:fontconfig \ |
|---|
| 37 | port:freefont-ttf \ |
|---|
| 38 | port:freetype \ |
|---|
| 39 | port:libLASi \ |
|---|
| 40 | port:swig-tcl \ |
|---|
| 41 | port:tcl |
|---|
| 42 | |
|---|
| 43 | patchfiles patch-CMakeLists.txt.diff \ |
|---|
| 44 | patch-plConfig.h.in.diff \ |
|---|
| 45 | patch-cmake-modules-pkg-config.cmake.diff |
|---|
| 46 | post-patch { |
|---|
| 47 | reinplace "s|-ObjC|-ObjC -framework AquaTerm|" ${worksrcpath}/cmake/modules/aqt.cmake |
|---|
| 48 | reinplace "s|-framework AquaTerm|-F${frameworks_dir} -framework AquaTerm|" ${worksrcpath}/cmake/modules/aqt.cmake |
|---|
| 49 | if {[variant_isset python26]} { |
|---|
| 50 | reinplace "s|\${CMAKE_INSTALL_EXEC_PREFIX}|${frameworks_dir}/Python.framework/Versions/2.6|" \ |
|---|
| 51 | ${worksrcpath}/cmake/modules/python.cmake |
|---|
| 52 | } elseif {[variant_isset python27]} { |
|---|
| 53 | reinplace "s|\${CMAKE_INSTALL_EXEC_PREFIX}|${frameworks_dir}/Python.framework/Versions/2.7|" \ |
|---|
| 54 | ${worksrcpath}/cmake/modules/python.cmake |
|---|
| 55 | } |
|---|
| 56 | } |
|---|
| 57 | |
|---|
| 58 | configure.cppflags-append -DUSE_INTERP_RESULT \ |
|---|
| 59 | -DTcl_Import_TCL_DECLARED |
|---|
| 60 | if {[variant_isset universal]} { |
|---|
| 61 | set cflags "${configure.cppflags} ${configure.cflags} ${configure.universal_cflags}" |
|---|
| 62 | set cxxflags "${configure.cppflags} ${configure.cxxflags} ${configure.universal_cxxflags}" |
|---|
| 63 | } else { |
|---|
| 64 | set cflags "${configure.cppflags} ${configure.cflags}" |
|---|
| 65 | set cxxflags "${configure.cppflags} ${configure.cxxflags}" |
|---|
| 66 | } |
|---|
| 67 | |
|---|
| 68 | cmake.out_of_source yes |
|---|
| 69 | |
|---|
| 70 | configure.env HOME=${workpath} |
|---|
| 71 | |
|---|
| 72 | configure.args-append -DTCL_INCLUDE_PATH=${prefix}/include \ |
|---|
| 73 | -DTCL_LIBRARY=${prefix}/lib/libtcl.dylib \ |
|---|
| 74 | -DFREETYPE_INCLUDE_DIR=${prefix}/include/freetype2 \ |
|---|
| 75 | -DFREETYPE_LIBRARY=${prefix}/lib/libfreetype.dylib \ |
|---|
| 76 | -DPL_FREETYPE_FONT_PATH=${prefix}/share/fonts/freefont-ttf \ |
|---|
| 77 | -DWITH_FREETYPE=ON \ |
|---|
| 78 | -DQHULL_INCLUDE_DIR=${prefix}/include \ |
|---|
| 79 | -DPLD_aqt=OFF \ |
|---|
| 80 | -DPLD_extcairo=ON \ |
|---|
| 81 | -DPLD_memcairo=ON \ |
|---|
| 82 | -DPLD_ps=ON \ |
|---|
| 83 | -DPLD_psttf=ON \ |
|---|
| 84 | -DPLD_pscairo=ON \ |
|---|
| 85 | -DPLD_pdfcairo=ON \ |
|---|
| 86 | -DPLD_pngcairo=ON \ |
|---|
| 87 | -DPLD_svgcairo=ON \ |
|---|
| 88 | -DPLD_tk=OFF \ |
|---|
| 89 | -DPLD_wxwidgets=OFF \ |
|---|
| 90 | -DPLD_wxpng=OFF \ |
|---|
| 91 | -DPLD_xcairo=OFF \ |
|---|
| 92 | -DPLD_xwin=OFF \ |
|---|
| 93 | -DPLD_xfig=OFF \ |
|---|
| 94 | -DPLD_tkwin=OFF \ |
|---|
| 95 | -DPLD_bmpqt=OFF \ |
|---|
| 96 | -DPLD_jpgqt=OFF \ |
|---|
| 97 | -DPLD_pngqt=OFF \ |
|---|
| 98 | -DPLD_ppmqt=OFF \ |
|---|
| 99 | -DPLD_epsqt=OFF \ |
|---|
| 100 | -DPLD_pdfqt=OFF \ |
|---|
| 101 | -DPLD_tiffqt=OFF \ |
|---|
| 102 | -DPLD_qtwidget=OFF \ |
|---|
| 103 | -DPLD_svgqt=OFF \ |
|---|
| 104 | -DPLD_extqt=OFF \ |
|---|
| 105 | -DPLD_memqt=OFF \ |
|---|
| 106 | -DPLD_qtwidget=OFF \ |
|---|
| 107 | -DENABLE_ada=OFF \ |
|---|
| 108 | -DENABLE_d=OFF \ |
|---|
| 109 | -DENABLE_f95=OFF \ |
|---|
| 110 | -DENABLE_itcl=OFF \ |
|---|
| 111 | -DENABLE_itk=OFF \ |
|---|
| 112 | -DENABLE_java=OFF \ |
|---|
| 113 | -DENABLE_lua=OFF \ |
|---|
| 114 | -DENABLE_ocaml=OFF \ |
|---|
| 115 | -DENABLE_octave=OFF \ |
|---|
| 116 | -DENABLE_pdl=OFF \ |
|---|
| 117 | -DENABLE_pyqt4=OFF \ |
|---|
| 118 | -DENABLE_python=OFF \ |
|---|
| 119 | -DENABLE_qt=OFF \ |
|---|
| 120 | -DENABLE_tcl=ON \ |
|---|
| 121 | -DENABLE_tk=OFF \ |
|---|
| 122 | -DENABLE_wxwidgets=OFF \ |
|---|
| 123 | -DBUILD_TEST=OFF \ |
|---|
| 124 | -DHAVE_AGG=OFF \ |
|---|
| 125 | -DSWIG_DIR=${prefix}/bin \ |
|---|
| 126 | -DPLPLOT_HAVE_CONFIG_H=ON |
|---|
| 127 | |
|---|
| 128 | # if {[variant_isset universal]} { |
|---|
| 129 | # configure.args-append -DCMAKE_OSX_ARCHITECTURES=\"[strsed ${configure.universal_archs} "g| |;|"]\" -DENABLE_f95:BOOL=OFF |
|---|
| 130 | # } else { |
|---|
| 131 | # # Adhoc fix |
|---|
| 132 | # # cmake passes -arch to Fortran compiler |
|---|
| 133 | # # g95 ignores -arch but gfortran fails with it |
|---|
| 134 | # if {[variant_isset g95]} { |
|---|
| 135 | # configure.args-append -DCMAKE_OSX_ARCHITECTURES=\"[strsed ${build_arch} "g| |;|"]\" |
|---|
| 136 | # } |
|---|
| 137 | # } |
|---|
| 138 | |
|---|
| 139 | pre-destroot { |
|---|
| 140 | set mods "${workpath}/build/bindings/f95/plplot.mod |
|---|
| 141 | ${workpath}/build/bindings/f95/plplotp.mod |
|---|
| 142 | ${workpath}/build/bindings/f95/plplot_flt.mod" |
|---|
| 143 | foreach m $mods { |
|---|
| 144 | if {[file exists $m]} { |
|---|
| 145 | file copy $m ${workpath}/build/ |
|---|
| 146 | } |
|---|
| 147 | } |
|---|
| 148 | } |
|---|
| 149 | |
|---|
| 150 | #platform i386 { |
|---|
| 151 | # configure.args-append -DCMAKE_MODULE_LINKER_FLAGS=\"-undefined dynamic_lookup\" \ |
|---|
| 152 | # -DCMAKE_EXE_LINKER_FLAGS=\"-undefined dynamic_lookup\" |
|---|
| 153 | #} |
|---|
| 154 | |
|---|
| 155 | if {${os.platform} eq "darwin"} { |
|---|
| 156 | default_variants +aquaterm |
|---|
| 157 | } |
|---|
| 158 | default_variants-append +x11 |
|---|
| 159 | |
|---|
| 160 | subport ${name}-single { |
|---|
| 161 | description Scientific plotting package, single precision version |
|---|
| 162 | long_description ${description_base} This port uses single precision. |
|---|
| 163 | |
|---|
| 164 | configure.pre_args -DCMAKE_INSTALL_PREFIX=${prefix}/lib/${subport} |
|---|
| 165 | configure.args-append -DPL_DOUBLE=OFF |
|---|
| 166 | } |
|---|
| 167 | |
|---|
| 168 | if {[variant_isset py27_pyqt4]} { |
|---|
| 169 | default_variants +qt4 |
|---|
| 170 | } |
|---|
| 171 | |
|---|
| 172 | # variant gcw is deleted since it has been deprecated |
|---|
| 173 | # gd driver (gif, jpeg, png, svg) has been deprecated |
|---|
| 174 | |
|---|
| 175 | # Fortran notes: |
|---|
| 176 | # * In build/language_tests/Fortran, FC and LDFLAGS are used. |
|---|
| 177 | # * CMAKE_Fortran_COMPILER is used later in build. |
|---|
| 178 | # * To avoid -arch ${build_arch} to be passed configure.ld_archflags is unset. |
|---|
| 179 | |
|---|
| 180 | if {[fortran_variant_isset]} { |
|---|
| 181 | configure.ld_archflags "" |
|---|
| 182 | configure.args-delete -DENABLE_f95=OFF |
|---|
| 183 | configure.args-append -DCMAKE_Fortran_COMPILER=\"${configure.fc}\" |
|---|
| 184 | if {[variant_isset g95]} { |
|---|
| 185 | configure.args-append -DCMAKE_Fortran_FLAGS=\"${configure.fflags} -fno-second-underscore\" |
|---|
| 186 | } else { |
|---|
| 187 | configure.args-append -DCMAKE_Fortran_FLAGS=\"${configure.fflags}\" |
|---|
| 188 | } |
|---|
| 189 | } |
|---|
| 190 | |
|---|
| 191 | if {[variant_isset g95]} { |
|---|
| 192 | # Ad hoc fix to enable build of f95 binding by disabling some features |
|---|
| 193 | if {${os.major}<10} { |
|---|
| 194 | patchfiles-append patch-sfstubsf95.f90.diff |
|---|
| 195 | } |
|---|
| 196 | # configure.args-append -DCMAKE_OSX_DEPLOYMENT_TARGET=\"\" |
|---|
| 197 | } |
|---|
| 198 | |
|---|
| 199 | variant octave description {Add support for Octave} { |
|---|
| 200 | depends_lib-append port:swig-octave |
|---|
| 201 | configure.args-delete -DENABLE_octave=OFF |
|---|
| 202 | configure.args-append -DENABLE_octave=ON |
|---|
| 203 | license-append GPL-2+ |
|---|
| 204 | } |
|---|
| 205 | |
|---|
| 206 | variant java description {Add support for Java} { |
|---|
| 207 | depends_lib-append port:swig-java |
|---|
| 208 | configure.args-delete -DENABLE_java=OFF |
|---|
| 209 | configure.args-append -DENABLE_java=ON |
|---|
| 210 | } |
|---|
| 211 | |
|---|
| 212 | # TODO: Remove after 2015-12-27. |
|---|
| 213 | variant python25 requires python27 description {Legacy variant} {} |
|---|
| 214 | |
|---|
| 215 | variant python26 conflicts python27 description {Add support for python26} { |
|---|
| 216 | depends_lib-append port:python26 \ |
|---|
| 217 | port:py26-numpy \ |
|---|
| 218 | port:swig-python |
|---|
| 219 | configure.args-delete -DENABLE_python=OFF |
|---|
| 220 | configure.args-append -DENABLE_python=ON \ |
|---|
| 221 | -DHAVE_NUMPY:BOOL=ON \ |
|---|
| 222 | -DPYTHON_INCLUDE_PATH=${frameworks_dir}/Python.framework/Versions/2.6/Headers |
|---|
| 223 | } |
|---|
| 224 | variant python27 conflicts python26 description {Add support for python27} { |
|---|
| 225 | depends_lib-append port:python27 \ |
|---|
| 226 | port:py27-numpy \ |
|---|
| 227 | port:swig-python |
|---|
| 228 | configure.args-delete -DENABLE_python=OFF |
|---|
| 229 | configure.args-append -DENABLE_python=ON \ |
|---|
| 230 | -DHAVE_NUMPY:BOOL=ON \ |
|---|
| 231 | -DPYTHON_INCLUDE_PATH=${frameworks_dir}/Python.framework/Versions/2.7/Headers |
|---|
| 232 | } |
|---|
| 233 | |
|---|
| 234 | # TODO: Remove after 2015-12-27. |
|---|
| 235 | variant py25_pyqt4 requires py27_pyqt4 description {Legacy variant} {} |
|---|
| 236 | variant py26_pyqt4 requires py27_pyqt4 description {Legacy variant} {} |
|---|
| 237 | |
|---|
| 238 | variant py27_pyqt4 requires python27 description {Add support for pyQT4 using python27} { |
|---|
| 239 | # Can use either py*-pyqt4 or py*-pyqt4-devel. |
|---|
| 240 | depends_lib-append path:share/py27-sip/PyQt4:py27-pyqt4 |
|---|
| 241 | configure.args-delete -DENABLE_pyqt4=OFF |
|---|
| 242 | configure.args-append -DENABLE_pyqt4=ON |
|---|
| 243 | } |
|---|
| 244 | |
|---|
| 245 | variant gdc description {Add support for D} { |
|---|
| 246 | depends_lib-append port:gdc |
|---|
| 247 | configure.args-delete -DENABLE_d=OFF |
|---|
| 248 | configure.args-append -DENABLE_d=ON |
|---|
| 249 | } |
|---|
| 250 | |
|---|
| 251 | variant aquaterm description {Add support for Aquaterm} { |
|---|
| 252 | depends_lib-append port:aquaterm |
|---|
| 253 | configure.args-delete -DPLD_aqt=OFF |
|---|
| 254 | configure.args-append -DPLD_aqt=ON \ |
|---|
| 255 | -DAQT_FRAMEWORK=${frameworks_dir}/AquaTerm.framework |
|---|
| 256 | } |
|---|
| 257 | |
|---|
| 258 | variant qt4 description {Add support for Qt4} { |
|---|
| 259 | depends_lib-append bin:qmake:qt4-mac |
|---|
| 260 | configure.args-delete -DENABLE_qt=OFF \ |
|---|
| 261 | -DPLD_bmpqt=OFF \ |
|---|
| 262 | -DPLD_jpgqt=OFF \ |
|---|
| 263 | -DPLD_pngqt=OFF \ |
|---|
| 264 | -DPLD_ppmqt=OFF \ |
|---|
| 265 | -DPLD_epsqt=OFF \ |
|---|
| 266 | -DPLD_pdfqt=OFF \ |
|---|
| 267 | -DPLD_tiffqt=OFF \ |
|---|
| 268 | -DPLD_qtwidget=OFF \ |
|---|
| 269 | -DPLD_svgqt=OFF \ |
|---|
| 270 | -DPLD_extqt=OFF \ |
|---|
| 271 | -DPLD_memqt=OFF \ |
|---|
| 272 | -DPLD_qtwidget=OFF |
|---|
| 273 | configure.args-append -DENABLE_qt=ON \ |
|---|
| 274 | -DPLD_bmpqt=ON \ |
|---|
| 275 | -DPLD_jpgqt=ON \ |
|---|
| 276 | -DPLD_pngqt=ON \ |
|---|
| 277 | -DPLD_ppmqt=ON \ |
|---|
| 278 | -DPLD_epsqt=ON \ |
|---|
| 279 | -DPLD_pdfqt=ON \ |
|---|
| 280 | -DPLD_tiffqt=ON \ |
|---|
| 281 | -DPLD_qtwidget=ON \ |
|---|
| 282 | -DPLD_svgqt=ON \ |
|---|
| 283 | -DPLD_extqt=ON \ |
|---|
| 284 | -DPLD_memqt=ON \ |
|---|
| 285 | -DPLD_qtwidget=ON |
|---|
| 286 | } |
|---|
| 287 | |
|---|
| 288 | variant wxwidgets description {Add support for wxWidgets} { |
|---|
| 289 | wxWidgets.use wxWidgets-3.0 |
|---|
| 290 | depends_lib-append port:${wxWidgets.port} |
|---|
| 291 | configure.args-delete -DPLD_wxwidgets=OFF \ |
|---|
| 292 | -DPLD_wxpng=OFF \ |
|---|
| 293 | -DENABLE_wxwidgets=OFF |
|---|
| 294 | configure.args-append -DPLD_wxwidgets=ON \ |
|---|
| 295 | -DPLD_wxpng=ON \ |
|---|
| 296 | -DENABLE_wxwidgets=ON \ |
|---|
| 297 | -DwxWidgets_CONFIG_EXECUTABLE=${wxWidgets.wxconfig} \ |
|---|
| 298 | -DwxWidgets_wxrc_EXECUTABLE=${wxWidgets.wxrc} \ |
|---|
| 299 | -Dwxwidgets_LINK_FLAGS=-lplplotd |
|---|
| 300 | } |
|---|
| 301 | |
|---|
| 302 | |
|---|
| 303 | variant x11 { |
|---|
| 304 | depends_lib-append path:lib/pkgconfig/pango.pc:pango \ |
|---|
| 305 | port:tk |
|---|
| 306 | configure.args-append -DPLD_xcairo=ON \ |
|---|
| 307 | -DPLD_xwin=ON \ |
|---|
| 308 | -DPLD_xfig=ON \ |
|---|
| 309 | -DPLD_tk=ON \ |
|---|
| 310 | -DENABLE_tk=ON \ |
|---|
| 311 | -DTK_INCLUDE_PATH=${prefix}/include \ |
|---|
| 312 | -DTK_LIBRARY=${prefix}/lib/libtk.dylib |
|---|
| 313 | configure.args-delete -DPLD_xcairo=OFF \ |
|---|
| 314 | -DPLD_xwin=OFF \ |
|---|
| 315 | -DPLD_xfig=OFF \ |
|---|
| 316 | -DENABLE_tk=OFF |
|---|
| 317 | } |
|---|
| 318 | |
|---|
| 319 | livecheck.type regex |
|---|
| 320 | livecheck.url http://sourceforge.net/p/${name}/news/ |
|---|
| 321 | livecheck.regex {PLplot-([0-9]+\.[0-9]+\.[0-9]+)} |
|---|