Ticket #40249: Portfile.diff

File Portfile.diff, 2.0 KB (added by petrrr, 11 years ago)

Updated diff to the Portfile

  • ports/python/py-obspy/Portfile

    diff --git a/ports/python/py-obspy/Portfile b/ports/python/py-obspy/Portfile
    index 87af3dc..04d7d51 100644
    a b PortGroup python 1.0 
    66
    77name                py-obspy
    88version             0.8.4
     9revision            1
    910categories-append   science
    1011platforms           darwin
    1112maintainers         bo.ingv.it:Peter.Danecek openmaintainer
    if {${subport} != ${name}} { 
    4647
    4748    patchfiles          patch-setup.py.diff
    4849}
     50
     51# Use Fortran recipe (see below) w/o g95 as modules would not build with g95;
     52# https://trac.macports.org/wiki/PortfileRecipes#fortran
     53
     54if {${subport} != ${name}} {
     55    set gcc_versions {4.3 4.4 4.5 4.6 4.7 4.8 4.9}
     56    set default_fortran_variant +gcc48
     57
     58    foreach ver ${gcc_versions} {
     59        set ver_no_dot [join [split ${ver} "."] ""]
     60
     61        variant gcc${ver_no_dot} description {build with gfortran from gcc${ver_no_dot}} {}
     62
     63        foreach over ${gcc_versions} {
     64            if {${ver} == ${over}} {
     65                continue
     66            }
     67
     68            set over_no_dot [join [split ${over} "."] ""]
     69            variant gcc${ver_no_dot} conflicts gcc${over_no_dot} {}
     70        }
     71
     72        if {[variant_isset gcc${ver_no_dot}]} {
     73            if {${default_fortran_variant} != "+gcc${ver_no_dot}"} {
     74                set default_fortran_variant ""
     75            }
     76        }
     77    }
     78
     79    if {${default_fortran_variant} != ""} {
     80        default_variants-append "${default_fortran_variant}"
     81    }
     82
     83    foreach ver ${gcc_versions} {
     84        set ver_no_dot [join [split ${ver} "."] ""]
     85
     86        if {[variant_isset gcc${ver_no_dot}]} {
     87            depends_lib-append port:libgcc
     88            depends_build-append port:gcc${ver_no_dot}
     89
     90            configure.fc  ${prefix}/bin/gfortran-mp-${ver}
     91            configure.f77 ${prefix}/bin/gfortran-mp-${ver}
     92            configure.f90 ${prefix}/bin/gfortran-mp-${ver}
     93        }
     94    }
     95}