# -*- 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 # $Id$ PortSystem 1.0 name wgrib2 version 1.9.8 revision 3 platforms darwin maintainers takeshi license public-domain categories science description program to read atmospheric data files in GRIB2 master_sites ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/ \ http://www.ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/ distname ${name}_nolib.tgz.v${version} extract.suffix set version_iplib 2012 set version_g2clib 1.4.0 checksums md5 6341cee894656ef41c8d964a53af2070 \ sha1 ff845f3b6996e7e6449e422153d47c1495274eb7 \ rmd160 af24bf99e2dc703419d48cc7bbb681a9655b0a58 homepage http://www.cpc.ncep.noaa.gov/products/wesley/wgrib2/ long_description \ wgrib2 is a swiss army knife for grib2 files. \ GRIB-2 has arrived and has begun replacing the the older standard GRIB-1. \ GRIB-2 can reduce the file size by up to 80% (NAM, JPEG2000 compression). depends_lib port:jasper \ port:libpng \ port:netcdf \ port:hdf5-18 worksrcdir grib2 patchfiles patch-makefile.diff configure {} use_parallel_build no if {[variant_isset universal]} { set cflags "${configure.cflags} ${configure.universal_cflags}" set ldflags "${configure.ldflags} ${configure.universal_ldflags}" } else { set cflags "${configure.cflags} ${configure.cc_archflags}" set ldflags "${configure.ldflags} ${configure.cc_archflags}" } set ip ${worksrcpath}/iplib.${version_iplib} set lipolate ${ip}/libipolate.a set g2c ${worksrcpath}/g2clib-${version_g2clib} set lg2c ${g2c}/libgrib2c.a set gctpc ${worksrcpath}/gctpc set lgeo ${gctpc}/source/libgeo.a set fsymbol "" if {[variant_isset gcc44] || [variant_isset gcc45] || [variant_isset gcc46] || [variant_isset gcc47] || [variant_isset gcc48]} { set fsymbol -DGFORTRAN } elseif {[variant_isset g95]} { set fsymbol -DG95 } if {[variant_isset g95] || [variant_isset gcc44] || [variant_isset gcc45] || [variant_isset gcc46] || [variant_isset gcc47] || [variant_isset gcc48]} { set iip "-I${ip}" set libs "${lg2c} ${lgeo} ${lipolate}" } else { set iip "" set libs "${lg2c} ${lgeo}" } if {[variant_isset g95]} { set libs "${libs} -lf95" configure.fc ${prefix}/bin/g95 } elseif {[variant_isset gcc44]} { set libs "${libs} -L${prefix}/lib/gcc44 -lgfortran" configure.fc ${prefix}/bin/gfortran-mp-4.4 } elseif {[variant_isset gcc45]} { set libs "${libs} -L${prefix}/lib/gcc45 -lgfortran" configure.fc ${prefix}/bin/gfortran-mp-4.5 } elseif {[variant_isset gcc46]} { set libs "${libs} -L${prefix}/lib/gcc46 -lgfortran" configure.fc ${prefix}/bin/gfortran-mp-4.6 } elseif {[variant_isset gcc47]} { set libs "${libs} -L${prefix}/lib/gcc47 -lgfortran" configure.fc ${prefix}/bin/gfortran-mp-4.7 } elseif {[variant_isset gcc48]} { set libs "${libs} -L${prefix}/lib/gcc48 -lgfortran" configure.fc ${prefix}/bin/gfortran-mp-4.8 } build.env LDFLAGS=\"${libs} ${configure.ldflags} -lpng -ljasper -lnetcdf\" \ CC=\"${configure.cc}\" \ CPPFLAGS=\"${fsymbol} ${configure.cppflags}\" \ CFLAGS=\"${cflags}\" build.args "-f makefile \ zlib=\"\" plib=\"\" jlib=\"\" h5lib=\"\" n4lib=\"\" \ iip=\"${iip}\" " if {[variant_isset g95] || [variant_isset gcc44] || [variant_isset gcc45] || [variant_isset gcc46] || [variant_isset gcc47] || [variant_isset gcc48]} { build.args-append USE_IPOLATES=1 build.env-append FC=\"${configure.fc}\" \ F90=\"${configure.fc}\" \ FFLAGS=\"${configure.fflags}\" } if {[variant_isset gcc45] || [variant_isset gcc46] || [variant_isset gcc47] || [variant_isset gcc48]} { build.args-append USE_OPENMP=1 } destroot { xinstall -m 644 ${g2c}/grib2.h ${destroot}${prefix}/include xinstall -m 644 ${lg2c} ${destroot}${prefix}/lib xinstall -m 755 ${worksrcpath}/${name}/${name} ${destroot}${prefix}/bin foreach b {gmerge smallest_4 smallest_grib2} { xinstall -m 755 ${worksrcpath}/aux_progs/${b} ${destroot}${prefix}/bin } if {[file exist ${lipolate}]} { system "ranlib ${ip}/libipolate.a" xinstall -m 644 ${lipolate} ${destroot}${prefix}/lib xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name} xinstall -m 644 ${worksrcpath}/README.ipolates ${destroot}${prefix}/share/doc/${name} } } variant g95 conflicts gcc44 gcc45 gcc46 gcc47 gcc48 description {build iplib with g95 (alpha)} { depends_build-append port:g95 } variant gcc44 conflicts g95 gcc45 gcc46 gcc47 gcc48 description {build iplib with gcc44 (alpha)} { depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc depends_build-append port:gcc44 } variant gcc45 conflicts g95 gcc44 gcc46 gcc47 gcc48 description {build iplib with gcc45 (alpha)} { depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc depends_build-append port:gcc45 } variant gcc46 conflicts g95 gcc44 gcc45 gcc47 gcc48 description {build iplib with gcc46 (alpha)} { depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc depends_build-append port:gcc46 } variant gcc47 conflicts g95 gcc44 gcc45 gcc46 gcc48 description {build iplib with gcc47 (alpha)} { depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc depends_build-append port:gcc47 } variant gcc48 conflicts g95 gcc44 gcc45 gcc46 gcc47 gcc48 description {build iplib with gcc48 (alpha)} { depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc depends_build-append port:gcc48 }