Ticket #40638: Portfile-sparskit.diff

File Portfile-sparskit.diff, 2.8 KB (added by dstrubbe (David Strubbe), 11 years ago)
  • Portfile

    old new  
    2727
    2828use_configure       no
    2929
    30 pre-build {
    31     build.args      F77=${configure.f90} OPT="-c -O3"
    32 }
     30patchfiles          patch-makefile.diff \
     31                    patch-INFO-makefile.diff \
     32                    patch-INOUT-makefile.diff \
     33                    patch-MATGEN-FEM-makefile.diff
     34
     35build.args          OPT="-c -O3"
    3336
    3437use_parallel_build  yes
    3538
     39test.run            yes
     40test.args           FFLAGS=-O3
     41# test requires FC, FFLAGS set because test makefiles lack explicit rule for .f -> .o and these are in the implicit rule
     42
    3643destroot {
    3744    xinstall ${worksrcpath}/libskit.a ${destroot}${prefix}/lib/
    3845}
    3946
    40 variant gcc46 conflicts gcc47 description {Build with GCC 4.6} {
    41     configure.compiler  macports-gcc-4.6
     47set gcc_versions {4.3 4.4 4.5 4.6 4.7 4.8 4.9}
     48set default_fortran_variant +gcc48
     49set g95_conflicts {}
     50
     51foreach ver ${gcc_versions} {
     52    set ver_no_dot [join [split ${ver} "."] ""]
     53
     54    set variant_line {variant gcc${ver_no_dot} description "build with gfortran from gcc${ver_no_dot}" conflicts g95}
     55
     56    foreach over ${gcc_versions} {
     57        if {${ver} == ${over}} {
     58            continue
     59        }
     60
     61        set over_no_dot [join [split ${over} "."] ""]
     62        append variant_line " conflicts gcc${over_no_dot}"
     63    }
     64    append variant_line { {}}
     65
     66    eval $variant_line
     67
     68    append g95_conflicts " conflicts gcc${ver_no_dot}"
     69
     70    if {[variant_isset gcc${ver_no_dot}]} {
     71        if {${default_fortran_variant} != "+gcc${ver_no_dot}"} {
     72            set default_fortran_variant ""
     73        }
     74    }
     75}
     76
     77eval [concat {variant g95 description {build with g95}} $g95_conflicts {{}}]
     78
     79if {[variant_isset g95]} {
     80    if {${default_fortran_variant} != "+g95"} {
     81        set default_fortran_variant ""
     82    }
    4283}
    4384
    44 variant gcc47 conflicts gcc46 description {Build with GCC 4.7} {
    45     configure.compiler  macports-gcc-4.7
     85if {${default_fortran_variant} != ""} {
     86    default_variants-append "${default_fortran_variant}"
    4687}
    4788
    48 if {![variant_isset gcc46]} {
    49     default_variants    +gcc47
     89foreach ver ${gcc_versions} {
     90    set ver_no_dot [join [split ${ver} "."] ""]
     91
     92    if {[variant_isset gcc${ver_no_dot}]} {
     93        depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc
     94        depends_build-append port:gcc${ver_no_dot}
     95
     96        build.args-append  F77=${prefix}/bin/gfortran-mp-${ver}
     97        test.args-append   F77=${prefix}/bin/gfortran-mp-${ver} FC=${prefix}/bin/gfortran-mp-${ver}
     98    }
     99}
     100
     101if {[variant_isset g95]} {
     102    depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc
     103    depends_build-append port:g95
     104
     105    build.args-append  F77=${prefix}/bin/g95
     106    test.args-append   F77=${prefix}/bin/g95 FC=${prefix}/bin/g95
    50107}
    51108
    52109livecheck.type      regex