[110094] trunk/dports/math/shogun/Portfile

jeremyhu at macports.org jeremyhu at macports.org
Sun Aug 25 23:45:46 PDT 2013


Revision: 110094
          https://trac.macports.org/changeset/110094
Author:   jeremyhu at macports.org
Date:     2013-08-25 23:45:46 -0700 (Sun, 25 Aug 2013)
Log Message:
-----------
shogun: Use fortran recipe, Mavericks build fix (modulo python variants)

Modified Paths:
--------------
    trunk/dports/math/shogun/Portfile

Modified: trunk/dports/math/shogun/Portfile
===================================================================
--- trunk/dports/math/shogun/Portfile	2013-08-26 06:41:30 UTC (rev 110093)
+++ trunk/dports/math/shogun/Portfile	2013-08-26 06:45:46 UTC (rev 110094)
@@ -63,40 +63,48 @@
 }
 
 # Define compilers variants
-variant gcc45 conflicts gcc46 gcc47 gcc48 clang33 description {Compile with gcc 4.5} {
-    configure.compiler      macports-gcc-4.5
-    configure.args-append   --ldflags=-lgfortran
-}
+configure.args-append   --ldflags=-lgfortran
+configure.env-append    POSTLINKFLAGS="-L${prefix}/lib/gcc47"
 
-variant gcc46 conflicts gcc45 gcc47 gcc48 clang33 description {Compile with gcc 4.6} {
-    configure.compiler      macports-gcc-4.6
-    configure.args-append   --ldflags=-lgfortran
-}
+set gcc_versions {4.3 4.4 4.5 4.6 4.7 4.8 4.9}
+set default_fortran_variant +gcc48
 
-variant gcc47 conflicts gcc45 gcc46 gcc48 clang33 description {Compile with gcc 4.7} {
-    configure.compiler      macports-gcc-4.7
-    configure.args-append   --ldflags=-lgfortran
-}
+foreach ver ${gcc_versions} {
+    set ver_no_dot [join [split ${ver} "."] ""]
 
-variant gcc48 conflicts gcc45 gcc46 gcc47 clang33 description {Compile with gcc 4.8} {
-    configure.compiler      macports-gcc-4.8
-    configure.args-append   --ldflags=-lgfortran
+    variant gcc${ver_no_dot} description {build with gfortran from gcc${ver_no_dot}} {}
+
+    foreach over ${gcc_versions} {
+        if {${ver} == ${over}} {
+            continue
+        }
+
+        set over_no_dot [join [split ${over} "."] ""]
+        variant gcc${ver_no_dot} conflicts gcc${over_no_dot} {}
+    }
+
+    if {[variant_isset gcc${ver_no_dot}]} {
+        if {${default_fortran_variant} != "+gcc${ver_no_dot}"} {
+            set default_fortran_variant ""
+        }
+    }
 }
 
-variant clang33 conflicts gcc45 gcc46 gcc47 gcc48 description {Compile with clang 3.3} {
-    configure.compiler      macports-clang-3.3
-    depends_build-append    port:gcc47
-    depends_lib-append      port:libgcc
-    configure.args-delete   --disable-cpudetection
-    configure.args-append   --enable-cpudetection \
-                            --ldflags=-lgfortran
-    configure.env-append    POSTLINKFLAGS="-L${prefix}/lib/gcc47"
+if {${default_fortran_variant} != ""} {
+    default_variants "${default_fortran_variant}"
 }
 
-if {![variant_isset gcc45] && ![variant_isset gcc46] &&
-    ![variant_isset gcc48] && ![variant_isset clang33]
-} then {
-    default_variants +gcc47
+foreach ver ${gcc_versions} {
+    set ver_no_dot [join [split ${ver} "."] ""]
+
+    if {[variant_isset gcc${ver_no_dot}]} {
+        depends_lib-append port: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}
+    }
 }
 
 # Define python variants
@@ -265,3 +273,8 @@
 livecheck.type      regex
 livecheck.url       http://www.shogun-toolbox.org
 livecheck.regex     {SHOGUN ([0-9.]+)}
+
+if {[string match "*clang*" ${configure.compiler}]} {
+    configure.args-delete   --disable-cpudetection
+    configure.args-append   --enable-cpudetection
+}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130825/d1eb5f8f/attachment.html>


More information about the macports-changes mailing list