source: trunk/dports/science/wgrib2/Portfile @ 121952

Last change on this file since 121952 was 121952, checked in by sean@…, 5 years ago

compilers-1.0: move setup call in all ports to after setting of name

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