[110141] trunk/dports/math/fftw-3/Portfile

Joshua Root jmr at macports.org
Tue Aug 27 11:23:39 PDT 2013


I think it actually declares multiple variants with the same name, but
only one gets found when iterating through all a port's variants for
display or checking conflicts. I think all of the code in the variant
bodies would get executed though (if there was any)?

The attached patch should work.

On 2013-8-28 03:55 , Jeremy Huddleston Sequoia wrote:
> So that clobbers the previous rather than appending?  That seems counter intuitive since the block is executed in each case (and it seemed to work fine for me with the original version).
> 
> Do you have a suggestion for how to do what is intended?  The approach used my mpich (constructing a variable listing all conflicts) doesn't work.
> 
> On Aug 27, 2013, at 10:51, Joshua Root <jmr at macports.org> wrote:
> 
>> I'd say the problem is declaring each variant gcc${ver_no_dot} multiple
>> times.

-------------- next part --------------
Index: Portfile
===================================================================
--- Portfile	(revision 110153)
+++ Portfile	(working copy)
@@ -180,15 +180,13 @@
 
 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} "."] ""]
 
-    variant gcc${ver_no_dot} description {build with gfortran from gcc${ver_no_dot}} {}
+    set variant_line {variant gcc${ver_no_dot} description "build with gfortran from gcc${ver_no_dot}" conflicts g95}
 
-    variant gcc${ver_no_dot} conflicts g95 {}
-    variant g95 conflicts gcc${ver_no_dot} {}
-
     foreach over ${gcc_versions} {
         if {${ver} == ${over}} {
             continue
@@ -195,9 +193,14 @@
         }
 
         set over_no_dot [join [split ${over} "."] ""]
-        variant gcc${ver_no_dot} conflicts gcc${over_no_dot} {}
+        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 ""
@@ -205,7 +208,7 @@
     }
 }
 
-variant g95 description {build with g95} {}
+eval [concat {variant g95 description {build with g95}} $g95_conflicts {{}}]
 
 if {[variant_isset g95]} {
     if {${default_fortran_variant} != "+g95"} {


More information about the macports-dev mailing list