Ticket #50229: Portfile-py-ngl.diff

File Portfile-py-ngl.diff, 4.5 KB (added by dstrubbe (David Strubbe), 8 years ago)
  • Portfile

     
    33
    44PortSystem          1.0
    55PortGroup python    1.0
     6PortGroup compilers 1.0
    67
    78name                py-ngl
    8 version             1.3.0b1
    9 revision            1
     9version             1.4.0
    1010categories-append   science
    1111platforms           darwin
    1212license             PyNGL
     
    1515description         Python module to visualize scientific data
    1616long_description \
    1717    PyNGL is a Python language module used to visualize scientific data, \
    18     with an emphasis on high quality 2D visualizations.
     18    with an emphasis on high-quality 2D visualizations.
    1919
    2020homepage            http://www.pyngl.ucar.edu/
    2121master_sites        http://www.pyngl.ucar.edu/Download/
     
    2525                    sha1    76bbb03c05f0acb1591172543d3decc7c4397422 \
    2626                    rmd160  bd4357d46af0a723cd81c16bdb0ecc3df03fa6a2
    2727
    28 fetch {
    29     if {![file exists ${distpath}/${distfiles}]} {
    30         xinstall -d ${distpath}
    31         ui_error "Download ${distfiles} manually and place it in ${distpath}.\n \
    32             See instructions on ${master_sites}"
    33     }
    34 }
    35 
    3628python.versions     26 27
    3729
    3830if {${name} ne ${subport}} {
     
    4133                        port:xorg-libX11 \
    4234                        port:py${python.version}-nio
    4335
    44     # ncarg is not universal, thus py-ngl is neither
     36    # ncarg is not universal, thus py-ngl isn't either
    4537    universal_variant   no
    4638
    4739    patch {
     
    5244
    5345    build.env           PNG_PREFIX=${prefix} \
    5446                        ZLIB_PREFIX=${prefix} \
    55                         NCARG_ROOT=${prefix}
     47                        NCARG_ROOT=${prefix} \
     48                        CC=${configure.cc}
    5649
    5750    destroot.env        NCARG_ROOT=${prefix}
    5851
    59     set gcc_versions {4.3 4.4 4.5 4.6 4.7 4.8 4.9}
    60     set default_fortran_variant +gcc48
    61     set g95_conflicts {}
     52    compilers.choose    fc f77 f90
     53    compilers.setup     require_fortran -dragonegg
    6254
    63     foreach ver ${gcc_versions} {
    64         set ver_no_dot [join [split ${ver} "."] ""]
    65 
    66         set variant_line {variant gcc${ver_no_dot} description "build with gfortran from gcc${ver_no_dot}" conflicts g95}
    67 
    68         foreach over ${gcc_versions} {
    69             if {${ver} == ${over}} {
    70                 continue
    71             }
    72 
    73             set over_no_dot [join [split ${over} "."] ""]
    74             append variant_line " conflicts gcc${over_no_dot}"
    75         }
    76         append variant_line { {}}
    77 
    78         eval $variant_line
    79 
    80         append g95_conflicts " conflicts gcc${ver_no_dot}"
    81 
    82         if {[variant_isset gcc${ver_no_dot}]} {
    83             if {${default_fortran_variant} ne "+gcc${ver_no_dot}"} {
    84                 set default_fortran_variant ""
    85             }
    86         }
    87     }
    88 
    89     eval [concat {variant g95 description {build with g95}} $g95_conflicts {{}}]
    90 
    91     if {[variant_isset g95]} {
    92         if {${default_fortran_variant} ne "+g95"} {
    93             set default_fortran_variant ""
    94         }
    95     }
    96 
    97     if {${default_fortran_variant} ne ""} {
    98         default_variants-append "${default_fortran_variant}"
    99     }
    100 
    101     foreach ver ${gcc_versions} {
    102         set ver_no_dot [join [split ${ver} "."] ""]
    103 
    104         if {[variant_isset gcc${ver_no_dot}]} {
    105             depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc
    106             depends_build-append port:gcc${ver_no_dot}
    107 
    108             configure.fc  ${prefix}/bin/gfortran-mp-${ver}
    109             configure.f77 ${prefix}/bin/gfortran-mp-${ver}
    110             configure.f90 ${prefix}/bin/gfortran-mp-${ver}
    111 
    112             build.env-append    F2CLIBS=gfortran \
    113                                 F2CLIBS_PREFIX=${prefix}/lib/gcc${ver_no_dot} \
    114                                 CC=${configure.cc}
    115         }
    116     }
    117 
    118     if {[variant_isset g95]} {
    119         depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc
    120         depends_build-append port:g95
    121 
    122         configure.fc ${prefix}/bin/g95
    123         configure.f77 ${prefix}/bin/g95
    124         configure.f90 ${prefix}/bin/g95
    125 
     55    if {[gcc_variant_isset]} {
     56        build.env-append    F2CLIBS=gfortran \
     57                            F2CLIBS_PREFIX=${prefix}/lib/[gcc_variant_name]
     58    } else {
     59        # g95
    12660        configure.fflags-append -fno-second-underscore
    12761
    12862        build.env-append    F2CLIBS=f95 \
    129                             F2CLIBS_PREFIX=${prefix}/lib/ \
    130                             CC=${configure.cc}
     63                            F2CLIBS_PREFIX=${prefix}/lib/
    13164    }
    13265
    13366    livecheck.type   none