Ticket #50230: Portfile-py-pymc.diff

File Portfile-py-pymc.diff, 3.3 KB (added by dstrubbe (David Strubbe), 9 years ago)
  • Portfile

     
    1 # -*- coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
     1# -*- coding: utf-8;  mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
    22# $Id$
    33
    44PortSystem          1.0
    55PortGroup           python 1.0
    66PortGroup           github 1.0
     7PortGroup           compilers 1.0
    78
    89github.setup        pymc-devs pymc 2.3.6 v
    910name                py-pymc
     
    2425
    2526if {${name} ne ${subport}} {
    2627    depends_lib-append  port:py${python.version}-numpy
     28    compilers.enforce_fortran  port:py${python.version}-numpy
    2729
    2830    checksums       rmd160  b4eac13ae502bb3e8ec3f314deb73750edcb6a8a \
    2931                    sha256  9c33a3430e8d55dbe0beaa79394e866f9115c4ec84615e24dabc154334538a6a
    3032
    31     set gcc_versions {4.3 4.4 4.5 4.6 4.7 4.8 4.9 5}
    32     set default_fortran_variant +gcc5
    33     set g95_conflicts {}
     33    compilers.choose   fc f77 f90
     34    compilers.setup    require_fortran -dragonegg
    3435
    35     foreach ver ${gcc_versions} {
    36         set ver_no_dot [join [split ${ver} "."] ""]
    37 
    38         set variant_line {variant gcc${ver_no_dot} description "build with gfortran from gcc${ver_no_dot}" conflicts g95}
    39 
    40         foreach over ${gcc_versions} {
    41             if {${ver} == ${over}} {
    42                 continue
    43             }
    44 
    45             set over_no_dot [join [split ${over} "."] ""]
    46             append variant_line " conflicts gcc${over_no_dot}"
    47         }
    48         append variant_line { {}}
    49 
    50         eval $variant_line
    51 
    52         append g95_conflicts " conflicts gcc${ver_no_dot}"
    53 
    54         if {[variant_isset gcc${ver_no_dot}]} {
    55             if {${default_fortran_variant} != "+gcc${ver_no_dot}"} {
    56                 set default_fortran_variant ""
    57             }
    58         }
    59     }
    60 
    61     eval [concat {variant g95 description {build with g95}} $g95_conflicts {{}}]
    62 
    63     if {[variant_isset g95]} {
    64         if {${default_fortran_variant} != "+g95"} {
    65             set default_fortran_variant ""
    66         }
    67     }
    68 
    69     if {${default_fortran_variant} != ""} {
    70         default_variants-append "${default_fortran_variant}"
    71     }
    72 
    73     foreach ver ${gcc_versions} {
    74         set ver_no_dot [join [split ${ver} "."] ""]
    75 
    76         if {[variant_isset gcc${ver_no_dot}]} {
    77             depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc
    78             depends_build-append port:gcc${ver_no_dot}
    79 
    80             build.cmd "${build.cmd} config_fc --fcompiler gfortran"
    81 
    82             configure.fc  ${prefix}/bin/gfortran-mp-${ver}
    83             configure.f77 ${prefix}/bin/gfortran-mp-${ver}
    84             configure.f90 ${prefix}/bin/gfortran-mp-${ver}
    85         }
    86     }
    87 
    88     if {[variant_isset g95]} {
    89         depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc
    90         depends_build-append port:g95
    91 
     36    if {[gcc_variant_isset]} {
     37        build.cmd "${build.cmd} config_fc --fcompiler gfortran"
     38    } elseif {[variant_isset g95]} {
    9239        build.cmd "${build.cmd} config_fc --fcompiler g95"
    93 
    94         configure.fc ${prefix}/bin/g95
    95         configure.f77 ${prefix}/bin/g95
    96         configure.f90 ${prefix}/bin/g95
    9740    }
    9841
    9942    # Insert my own archflags, so I can edit LDFLAGS