[141198] trunk/dports/science/cdf/Portfile

dstrubbe at macports.org dstrubbe at macports.org
Mon Oct 12 09:30:15 PDT 2015


Revision: 141198
          https://trac.macports.org/changeset/141198
Author:   dstrubbe at macports.org
Date:     2015-10-12 09:30:14 -0700 (Mon, 12 Oct 2015)
Log Message:
-----------
cdf: Use compilers portgroup. Remove unnecessary explicit mention of libgcc in link line.

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

Modified: trunk/dports/science/cdf/Portfile
===================================================================
--- trunk/dports/science/cdf/Portfile	2015-10-12 16:14:25 UTC (rev 141197)
+++ trunk/dports/science/cdf/Portfile	2015-10-12 16:30:14 UTC (rev 141198)
@@ -2,6 +2,7 @@
 # $Id$
 
 PortSystem              1.0
+PortGroup               compilers 1.0
 
 name                    cdf
 epoch                   1
@@ -40,25 +41,21 @@
 }
 
 use_configure           no
+compilers.choose        cc fc
+compilers.setup
 
 pre-build {
     set cdf_os          macosx
     #set cdf_env         ${configure.build_arch}
     set cdf_env         gnu
 
-    if {[string match *gcc* ${configure.compiler}]} {
-        set libgcc [exec ${configure.cc} -print-libgcc-file-name]
-    } else {
-        set libgcc ""
-    }
-
     build.args-append   ENV=${cdf_env} \
                         OS=${cdf_os} \
                         COPTIONSld_${cdf_os}_${cdf_env}= \
                         CURSESLIB_${cdf_os}_${cdf_env}=${prefix}/lib/libncurses.dylib \
                         LDOPTIONS_${cdf_os}_${cdf_env}="-dynamiclib -install_name ${prefix}/lib/libcdf.dylib" \
                         MACOSxFopt= \
-                        MACOSxlink="-lc -lm ${libgcc}" \
+                        MACOSxlink="-lc -lm" \
                         MACOSxmin=
 
     if {${os.endian} eq "little"} {
@@ -73,7 +70,7 @@
                         CC="${configure.cc} ${configure.cc_archflags}" \
                         LD="${configure.cc} ${configure.cc_archflags}"
 
-    if {${configure.fc} eq ""} {
+    if {![fortran_variant_isset]} {
         build.args-append \
                         FORTRAN=no
     } else {
@@ -97,49 +94,5 @@
     move ${destroot}${prefix}/CDFLeapSeconds.txt ${docdir}
 }
 
-set gcc_versions {4.4 4.5 4.6 4.7 4.8 4.9}
-set default_fortran_variant +gcc49
-
-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}"}
-
-    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
-
-    if {[variant_isset gcc${ver_no_dot}]} {
-        if {${default_fortran_variant} != "+gcc${ver_no_dot}"} {
-            set default_fortran_variant ""
-        }
-    }
-}
-
-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  ${prefix}/bin/gfortran-mp-${ver}
-        configure.f77 ${prefix}/bin/gfortran-mp-${ver}
-        configure.f90 ${prefix}/bin/gfortran-mp-${ver}
-    }
-}
-
 livecheck.type          regex
 livecheck.regex         {latest released version \(V([0-9.]+)\)}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20151012/4f8cc45b/attachment.html>


More information about the macports-changes mailing list