[111704] trunk/dports/science/emos/Portfile

takeshi at macports.org takeshi at macports.org
Sat Sep 28 18:21:04 PDT 2013


Revision: 111704
          https://trac.macports.org/changeset/111704
Author:   takeshi at macports.org
Date:     2013-09-28 18:21:03 -0700 (Sat, 28 Sep 2013)
Log Message:
-----------
emos: Following Fortran recipe, set gcc48 as the default, closing #40610

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

Modified: trunk/dports/science/emos/Portfile
===================================================================
--- trunk/dports/science/emos/Portfile	2013-09-29 00:55:56 UTC (rev 111703)
+++ trunk/dports/science/emos/Portfile	2013-09-29 01:21:03 UTC (rev 111704)
@@ -5,6 +5,7 @@
 
 name                emos
 version             000392
+revision            1
 platforms           darwin
 maintainers         takeshi
 license             LGPL
@@ -94,45 +95,74 @@
 }
 
 use_parallel_build  no
-if {![variant_isset gcc43] && ![variant_isset gcc44] && ![variant_isset gcc45] && ![variant_isset gcc46] && ![variant_isset gcc48] && ![variant_isset g95]} {
-    default_variants    +gcc47
-}
-if {[variant_isset g95]} {
-    configure.fflags-append -r8 -fsloppy-char -fno-second-underscore -DUSE_NO_POINTERS -DINTEGER_IS_INT -Dlinux
-    configure.cflags-append -DPOINTER_64 -DINTEGER_IS_INT
-} else {
-    configure.fflags-append -fdefault-real-8 -fdefault-double-8 -fcray-pointer -fno-second-underscore -DPOINTER_64 -DINTEGER_IS_INT -Dlinux -Dgfortran
-    configure.cflags-append -DPOINTER_64 -DINTEGER_IS_INT
-}
 universal_variant   no
 
-variant gcc43 conflicts gcc44 gcc45 gcc46 gcc47 gcc48 g95 description {builds fortran interface with gfortran 4.3} {
-    configure.compiler      macports-gcc-4.3
-}
+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 {}
 
-variant gcc44 conflicts gcc43 gcc45 gcc46 gcc47 gcc48 g95 description {builds fortran interface with gfortran 4.4} {
-    configure.compiler      macports-gcc-4.4
-}
+foreach ver ${gcc_versions} {
+    set ver_no_dot [join [split ${ver} "."] ""]
 
-variant gcc45 conflicts gcc43 gcc44 gcc46 gcc47 gcc48 g95 description {builds fortran interface with gfortran 4.5} {
-    configure.compiler      macports-gcc-4.5
+    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 gcc46 conflicts gcc43 gcc44 gcc45 gcc47 gcc48 g95 description {builds fortran interface with gfortran 4.6} {
-    configure.compiler      macports-gcc-4.6
+eval [concat {variant g95 description {build with g95}} $g95_conflicts {{}}]
+
+if {[variant_isset g95]} {
+    if {${default_fortran_variant} != "+g95"} {
+        set default_fortran_variant ""
+    }
 }
 
-variant gcc47 conflicts gcc43 gcc44 gcc45 gcc46 gcc48 g95 description {builds fortran interface with gfortran 4.7} {
-    configure.compiler      macports-gcc-4.7
+if {${default_fortran_variant} != ""} {
+    default_variants-append "${default_fortran_variant}"
 }
 
-variant gcc48 conflicts gcc43 gcc44 gcc45 gcc46 gcc47 g95 description {builds fortran interface with gfortran 4.8} {
-    configure.compiler      macports-gcc-4.8
+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  ${prefix}/bin/gfortran-mp-${ver}
+        configure.f77 ${prefix}/bin/gfortran-mp-${ver}
+        configure.f90 ${prefix}/bin/gfortran-mp-${ver}
+        configure.fflags-append -fdefault-real-8 -fdefault-double-8 -fcray-pointer -fno-second-underscore -DPOINTER_64 -DINTEGER_IS_INT -Dlinux -Dgfortran
+        configure.cflags-append -DPOINTER_64 -DINTEGER_IS_INT
+    }
 }
 
-variant g95 conflicts gcc43 gcc44 gcc45 gcc46 gcc47 gcc48 description {builds fortran interface with g95} {
-    depends_build-append    port:g95
-    configure.fc            ${prefix}/bin/g95
+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
+    configure.f77 ${prefix}/bin/g95
+    configure.f90 ${prefix}/bin/g95
+    configure.fflags-append -r8 -fsloppy-char -fno-second-underscore -DUSE_NO_POINTERS -DINTEGER_IS_INT -Dlinux
+    configure.cflags-append -DPOINTER_64 -DINTEGER_IS_INT
 }
 
 livecheck.type      regex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130928/07040681/attachment.html>


More information about the macports-changes mailing list