[127714] trunk/dports/science/berkeleygw/Portfile

dstrubbe at macports.org dstrubbe at macports.org
Sat Nov 1 12:17:33 PDT 2014


Revision: 127714
          https://trac.macports.org/changeset/127714
Author:   dstrubbe at macports.org
Date:     2014-11-01 12:17:33 -0700 (Sat, 01 Nov 2014)
Log Message:
-----------
berkeleygw: Use compilers PortGroup. Add note about registering account. Consolidate common part of build.args between variants.

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

Modified: trunk/dports/science/berkeleygw/Portfile
===================================================================
--- trunk/dports/science/berkeleygw/Portfile	2014-11-01 18:45:54 UTC (rev 127713)
+++ trunk/dports/science/berkeleygw/Portfile	2014-11-01 19:17:33 UTC (rev 127714)
@@ -2,6 +2,7 @@
 # $Id$
 
 PortSystem          1.0
+PortGroup           compilers 1.0
 
 name                berkeleygw
 version             1.0.6
@@ -20,16 +21,25 @@
 checksums           rmd160  7d4861abdc7592a0768420df2fd9014918de8bd4 \
                     sha256  8912a5654d2b343689ec6c0ccd6b355ad336d04e46592684a1125573a6544ea7
 
+distfiles           BGW-${version}.tar.gz
+
 depends_lib         port:atlas \
                     port:fftw
+# do we need Fortran variant for fftw?
 
+compilers.choose    fc cpp
+compilers.setup     require_fortran -dragonegg
+
+if {![fortran_variant_isset]} {
+    default_variants-append +gcc48
+}
+
 # fftw is not universal
 universal_variant   no
 
-distfiles           BGW-${version}.tar.gz
+patchfiles          patch-testsuite-Silane-PARATEC-Silane.test.diff \
+                    patch-Common-common-rules.mk.diff
 
-patchfiles          patch-testsuite-Silane-PARATEC-Silane.test.diff
-
 configure {
     system -W ${worksrcpath} "sed 's|/opt/local|${prefix}|' < config/generic.serial.macos.mk > arch.mk"
 }
@@ -43,76 +53,30 @@
 test.cmd            make
 test.target         check
 
-# more options that could be added: threads, openmpi, mpich
-
-# This is from the Fortran recipe, but with some customization
-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 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 ""
-        }
-    }
+notes {
+    For the purposes of record-keeping and support, please register an account at www.berkeleygw.org.
 }
 
-eval [concat {variant g95 description {build with clang/g95}} $g95_conflicts {{}}]
+# more options that could be added: threads, openmpi, mpich
 
-if {[variant_isset g95]} {
-    if {${default_fortran_variant} != "+g95"} {
-        set default_fortran_variant ""
-    }
-}
+pre-build {
+    build.args      LINK="${configure.fc}" CC_COMP=${configure.cxx} C_COMP=${configure.cc} C_LINK=${configure.cxx} \
+                    LAPACKLIB="-L${prefix}/lib/ -lsatlas"
 
-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}
-
-        build.args VERSION=-mp-${ver}
+    if {[variant_isset g95]} {
+                    build.args-append COMPFLAG="-DG95" FCPP="${configure.cc} -P -E -ansi" \
+                        F90free="${prefix}/bin/g95 -ffree-form -ffree-line-length-huge -fno-second-underscore" \
+                        MOD_OPT="-fmod="
+        # test, destroot args needed just to avoid trying to build in the test/openmp directory unnecessarily
+        test.args       COMPFLAG="-DG95"
+        destroot.args   COMPFLAG="-DG95"
+    } else {
+        # gcc is default in arch.mk so most things do not need to be modified
+        build.args-append FCPP="${configure.cpp} -ansi" \
+            F90free="${configure.fc} -ffree-form -ffree-line-length-none -fno-second-underscore"
     }
 }
 
-if {[variant_isset g95]} {
-    depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc
-    depends_build-append port:g95
-
-    build.args COMPFLAG="-DG95" FCPP="${configure.cc} -P -E -ansi" LINK="${prefix}/bin/g95" \
-        F90free="${prefix}/bin/g95 -ffree-form -ffree-line-length-huge -fno-second-underscore" \
-        MOD_OPT="-fmod=" CC_COMP=${configure.cxx} C_COMP=${configure.cc} C_LINK=${configure.cxx} \
-        LAPACKLIB="-L${prefix}/lib/ -lsatlas"
-    # test, destroot args needed just to avoid trying to build in the test/openmp directory unnecessarily
-    test.args COMPFLAG="-DG95"
-    destroot.args COMPFLAG="-DG95"
-    patchfiles-append patch-Common-common-rules.mk.diff
-}
-
 livecheck.type      regex
 livecheck.url       ${master_sites}
 livecheck.regex     BGW-(\[0-9.\]+).tar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20141101/6bb3887b/attachment.html>


More information about the macports-changes mailing list