source: trunk/dports/science/wgrib2/Portfile

Last change on this file was 147494, checked in by mmoll@…, 20 months ago

hdf5: update to version 1.10.0, bump revision of ports that depend on hdf5 and need to be rebuilt. closes #51062

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.8 KB
Line 
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 147494 2016-04-05 20:52:07Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup compilers 1.0
6
7name                wgrib2
8version             2.0.0
9revision            6
10platforms           darwin
11maintainers         takeshi
12license             public-domain
13categories          science
14description         program to read atmospheric data files in GRIB2
15master_sites        ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/ \
16                    http://www.ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/
17distname            ${name}_nolib.tgz.v${version}
18extract.suffix     
19set version_iplib   2012
20set version_g2clib  1.4.0
21checksums           md5     47fcc30c1b4d4f883952fdd0cb683a97 \
22                    sha1    eee050b720ba4bc4891d41e7f5c81ad2033c091c \
23                    rmd160  f915db25714fb2af88c706988c0ac421e83321fc
24homepage            http://www.cpc.ncep.noaa.gov/products/wesley/wgrib2/
25long_description   \
26    wgrib2 is a swiss army knife for grib2 files. \
27    GRIB-2 has arrived and has begun replacing the the older standard GRIB-1. \
28    GRIB-2 can reduce the file size by up to 80% (NAM, JPEG2000 compression).
29
30compilers.choose    fc f77 f90
31compilers.setup
32
33depends_build       port:gctpc
34depends_lib         port:jasper \
35                    port:libpng \
36                    port:netcdf \
37                    port:hdf5
38
39worksrcdir          grib2
40
41patchfiles          patch-makefile.diff  \
42                    patch-g2clib-makefile.diff \
43                    patch-iplib-makefile.diff
44use_configure       no
45use_parallel_build  no
46
47set ip ${worksrcpath}/iplib.${version_iplib}
48set lipolate ${ip}/libipolate.a
49set g2c ${worksrcpath}/g2clib-${version_g2clib}
50set lg2c ${g2c}/libgrib2c.a
51set lgctpc -lgctpc
52
53configure.cppflags-append   -I${prefix}/include/gctpc
54variant universal {}
55if {[variant_isset universal]} {
56    set cflags "${configure.cflags} ${configure.universal_cflags}"
57    set ldflags "${configure.ldflags} ${configure.universal_ldflags}"
58} else {
59    set cflags "${configure.cflags} ${configure.cc_archflags}"
60    set ldflags "${configure.ldflags} ${configure.cc_archflags}"
61}
62build.args         "-f makefile \
63                    zlib=\"\" plib=\"\" jlib=\"\" h5lib=\"\" n4lib=\"\" "
64
65pre-build {
66    set fsymbol ""
67    if {[fortran_variant_isset]} {
68        set iip "-I${ip}"
69        set libs "${lg2c} ${lgctpc} ${lipolate} ${compilers.libfortran}"
70        build.args-append   USE_IPOLATES=1
71        if {[variant_isset g95]} {
72            set fsymbol -DG95
73        } else {
74            set fsymbol -DGFORTRAN
75            build.args-append   USE_OPENMP=1
76        }
77        build.env           FC=\"${configure.fc}\" \
78                            F90=\"${configure.fc}\" \
79                            FFLAGS=\"${configure.fflags}\"
80    } else {
81        set iip ""
82        set libs "${lg2c} ${lgctpc}"
83    }
84    build.env-append    LDFLAGS=\"${libs} ${configure.ldflags} -lpng -ljasper -lnetcdf\" \
85                        CC=\"${configure.cc}\" \
86                        CPPFLAGS=\"${fsymbol} ${configure.cppflags}\" \
87                        CFLAGS=\"${cflags}\"
88    build.args-append   iip=\"${iip}\"
89}
90
91destroot {
92    xinstall -m 644 ${g2c}/grib2.h ${destroot}${prefix}/include
93    xinstall -m 644 ${lg2c} ${destroot}${prefix}/lib
94    xinstall -m 755 ${worksrcpath}/${name}/${name} ${destroot}${prefix}/bin
95    foreach b {gmerge smallest_4 smallest_grib2} {
96        xinstall -m 755 ${worksrcpath}/aux_progs/${b} ${destroot}${prefix}/bin
97    }
98    if {[file exist ${lipolate}]} {
99        system "ranlib ${ip}/libipolate.a"
100        xinstall -m 644 ${lipolate} ${destroot}${prefix}/lib
101        xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name}
102        xinstall -m 644 ${worksrcpath}/README.ipolates ${destroot}${prefix}/share/doc/${name}
103    }
104}
Note: See TracBrowser for help on using the repository browser.