[111630] trunk/dports/science/etsf_io/Portfile

macsforever2000 at macports.org macsforever2000 at macports.org
Fri Sep 27 08:11:47 PDT 2013


Revision: 111630
          https://trac.macports.org/changeset/111630
Author:   macsforever2000 at macports.org
Date:     2013-09-27 08:11:47 -0700 (Fri, 27 Sep 2013)
Log Message:
-----------
etsf_io: Use FORTRAN recipe. (#40595)

Modified Paths:
--------------
    trunk/dports/science/etsf_io/Portfile

Modified: trunk/dports/science/etsf_io/Portfile
===================================================================
--- trunk/dports/science/etsf_io/Portfile	2013-09-27 15:10:59 UTC (rev 111629)
+++ trunk/dports/science/etsf_io/Portfile	2013-09-27 15:11:47 UTC (rev 111630)
@@ -40,19 +40,70 @@
 test.cmd            make
 test.target         check
 
-variant gcc46 conflicts gcc47 description {Build with GCC 4.6} {
-    configure.compiler  macports-gcc-4.6
-    require_active_variants netcdf-fortran gcc46
+# Fortran recipe
+set gcc_versions {4.3 4.4 4.5 4.6 4.7 4.8 4.9}
+set default_fortran_variant +gcc48
+set g95_conflicts {}
+
+foreach ver ${gcc_versions} {
+    set ver_no_dot [join [split ${ver} "."] ""]
+
+    set variant_line {variant gcc${ver_no_dot} description "build with gfortran from gcc${ver_no_dot}" conflicts g95}
+
+    foreach over ${gcc_versions} {
+        if {${ver} == ${over}} {
+            continue
+        }
+
+        set over_no_dot [join [split ${over} "."] ""]
+        append variant_line " conflicts gcc${over_no_dot}"
+    }
+    append variant_line { {}}
+
+    eval $variant_line
+
+    append g95_conflicts " conflicts gcc${ver_no_dot}"
+
+    if {[variant_isset gcc${ver_no_dot}]} {
+        if {${default_fortran_variant} != "+gcc${ver_no_dot}"} {
+            set default_fortran_variant ""
+        }
+    }
 }
-variant gcc47 conflicts gcc46 description {Build with GCC 4.7} {
-    configure.compiler  macports-gcc-4.7
-    require_active_variants netcdf-fortran gcc47
+
+eval [concat {variant g95 description {build with g95}} $g95_conflicts {{}}]
+
+if {[variant_isset g95]} {
+    if {${default_fortran_variant} != "+g95"} {
+        set default_fortran_variant ""
+    }
 }
 
-if {![variant_isset gcc46]} {
-    default_variants    +gcc47
+if {${default_fortran_variant} != ""} {
+    default_variants-append "${default_fortran_variant}"
 }
 
+foreach ver ${gcc_versions} {
+    set ver_no_dot [join [split ${ver} "."] ""]
+
+    if {[variant_isset gcc${ver_no_dot}]} {
+        depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc
+        depends_build-append port:gcc${ver_no_dot}
+
+        configure.fc              gfortran-mp-${ver}
+        require_active_variants   netcdf-fortran gcc${ver_no_dot}
+    }
+}
+
+if {[variant_isset g95]} {
+    depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc
+    depends_build-append port:g95
+
+    configure.fc              ${prefix}/bin/g95
+    require_active_variants   netcdf-fortran g95
+    # Warning: a few tests will fail with g95.
+}
+
 livecheck.url       ${homepage}
 livecheck.type      regex
 livecheck.regex     ${name}-(\[0-9.\]+)${extract.suffix}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130927/e8c82aff/attachment-0001.html>


More information about the macports-changes mailing list