# -*- 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
categories-append science
maintainers {petr @petrrr} openmaintainer
description Python module to visualize scientific data
PyNGL is a Python language module used to visualize scientific data, \
with an emphasis on high-quality 2D visualizations.
homepage http://www.pyngl.ucar.edu/
distname PyNGL-${version}
master_sites https://www.earthsystemgrid.org/download/fileDownload.htm?logicalFileId=40003c7a-306d-11df-8e89-00c0f03d5b7c&dummy=
checksums md5 231e0ad8ab7f295483f131367ab856cc \
rmd160 bd4357d46af0a723cd81c16bdb0ecc3df03fa6a2 \
sha256 0666f605033609680f3e7312ae412a5a5b8792bc8f423b3cae3ae3e4af235a25
if {${name} ne ${subport}} {
depends_lib-append port:zlib \
port:py${python.version}-nio
# ncarg is not universal, thus py-ngl isn't either
reinplace "s|/usr/X11R6/lib|${prefix}/lib|" ${worksrcpath}/setup.py
reinplace "s|/usr/bin/env python|${python.bin}|" ${worksrcpath}/examples/pynglex
reinplace "s|py_cmd = 'python'|py_cmd = '${python.bin}'|" ${worksrcpath}/examples/pynglex
build.env PNG_PREFIX=${prefix} \
destroot.env NCARG_ROOT=${prefix}
compilers.choose fc f77 f90
compilers.setup require_fortran
if {[gcc_variant_isset]} {
build.env-append F2CLIBS=gfortran \
F2CLIBS_PREFIX=${prefix}/lib/[gcc_variant_name]
configure.fflags-append -fno-second-underscore
build.env-append F2CLIBS=f95 \
F2CLIBS_PREFIX=${prefix}/lib/
test.env-append PYTHONPATH=[glob -nocomplain ${worksrcpath}/build/lib*]
test.cmd ${python.bin} ./build/scripts-${python.branch}/pynglex
livecheck.url http://www.pyngl.ucar.edu/Download/
livecheck.regex {of PyNGL is ([0-9]\.[0-9]\.[0-9]+)}