source: trunk/dports/science/grib_api/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.3 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                grib_api
8version             1.12.1
9platforms           darwin
10maintainers         takeshi
11license             Apache-2
12categories          science
13description         GRIB decoder
14homepage            https://software.ecmwf.int/wiki/display/GRIB/Home
15master_sites        https://software.ecmwf.int/wiki/download/attachments/3473437
16checksums           md5     d9a90daa94766617831cf37ccac1e296 \
17                    sha1    b769ac5db70703f0d944d93aafbbeee7513958f1 \
18                    rmd160  4efcd11a359ae28d0675e99c7a4f69c407fa0a66
19long_description \
20    The ECMWF GRIB API is an application program interface accessible \
21    from C and FORTRAN programs developed for encoding and decoding   \
22    WMO FM-92 GRIB edition 1 and edition 2 messages. A useful set of  \
23    command line tools is also provided to give quick access to grib messages.
24
25compilers.choose    fc f77 f90
26compilers.setup
27
28depends_lib         port:jasper \
29                    port:openjpeg15 \
30                    port:libpng
31
32fetch.ignore_sslcert    yes
33
34post-patch {
35    if {${os.major} == 8} {
36        reinplace "s| -Wl,-rpath \$fortranlibdir||" ${worksrcpath}/configure
37    }
38    reinplace "s|share\/samples|share/$name/samples|" ${worksrcpath}/configure
39    reinplace "s|share\/samples|share/$name/samples|" ${worksrcpath}/configure
40    reinplace "s|share\/definitions|share/$name/definitions|" ${worksrcpath}/configure
41# avoid installation to non-existent directory 'none'
42    reinplace "s|'none'|''|" ${worksrcpath}/configure
43# avoid auto detection of g95 or gfortran that may prevent generation of shared library
44    reinplace "s|g95|''|" ${worksrcpath}/configure
45    reinplace "s|gfortran|''|" ${worksrcpath}/configure
46# avoid duplicated symbol error
47    reinplace "s|-fno-common||" ${worksrcpath}/configure
48}
49
50configure.args      --disable-dependency-tracking \
51                    --disable-fortran \
52                    --with-ifs-samples=${prefix}/share/${name}/ifs_samples \
53                    --with-jasper=${prefix} \
54                    --with-openjpeg=${prefix} \
55                    --with-png-support=${prefix} \
56                    --disable-python
57
58test.run            yes
59test.target         check
60
61post-destroot {
62    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
63    eval xinstall -m 644 [glob ${worksrcpath}/html/*.html] \
64        ${destroot}${prefix}/share/doc/${name}
65    foreach b {parser points} {
66        file rename ${destroot}${prefix}/bin/${b} ${destroot}${prefix}/bin/grib_${b}
67    }
68}
69
70variant emos description {deprecated to remove dependency to emos} {
71}
72 
73set gcc_versions {43 44 45 46 47 48 49}
74
75if {[fortran_variant_isset]} {
76    configure.args-delete   --disable-fortran
77    if {[variant_isset g95]} {
78        configure.args-append   --with-fortranlibdir=${prefix}/lib \
79                                --with-fortranlibs=-lf95
80    } else {
81        configure.args-append   --with-fortranlibs=-lgfortran
82        foreach ver_no_dot ${gcc_versions} {
83            if {[variant_isset gcc${ver_no_dot}]} {
84                configure.args-append   --with-fortranlibdir=${prefix}/lib/gcc${ver_no_dot}
85            }
86        }
87    }
88}
89
90variant python25 conflicts python26 python27 description {Add support for python25} {
91    depends_lib-append      port:py25-numpy
92    configure.args-delete   --disable-python
93    configure.args-append   --enable-python
94    configure.env-append    PYTHON=${prefix}/bin/python2.5 \
95                            PYTHON_CONFIG=${prefix}/bin/python2.5-config
96}
97
98variant python26 conflicts python25 python27 description {Add support for python26} {
99    depends_lib-append      port:py26-numpy
100    configure.args-delete   --disable-python
101    configure.args-append   --enable-python
102    configure.env-append    PYTHON=${prefix}/bin/python2.6 \
103                            PYTHON_CONFIG=${prefix}/bin/python2.6-config
104}
105
106variant python27 conflicts python25 python26 description {Add support for python27} {
107    depends_lib-append      port:py27-numpy
108    configure.args-delete   --disable-python
109    configure.args-append   --enable-python
110    configure.env-append    PYTHON=${prefix}/bin/python2.7 \
111                            PYTHON_CONFIG=${prefix}/bin/python2.7-config
112}
Note: See TracBrowser for help on using the repository browser.