suggestion for Fortran recipe

Jeremy Huddleston Sequoia jeremyhu at macports.org
Fri Oct 4 07:32:24 PDT 2013


Yeah, that sounds reasonable.

As for the PortGroup, IIRC, someone was working on a general compilers PortGroup which would incorporate this.

On Oct 3, 2013, at 18:47, David Strubbe <dstrubbe at mit.edu> wrote:

> Hi Jeremy and others,
> 
> I think a few lines can be simplified in the new Fortran recipe. For default variants, it seems to me that it makes no difference whether it is set when the variant was explicitly selected.
> 
> i.e this code from the Portfile recipe
> 
> if {![variant_isset q8] && ![variant_isset q32]} {
>     default_variants +q16
> }
> 
> is functionally equivalent to
> 
> 
> if {![variant_isset q8] && ![variant_isset q16] && ![variant_isset q32]} {
>     default_variants +q16
> }
> 
> since if +q16 is selected it is not important whether we consider that choice to have been made by default or not.
> 
> As a result, in the Fortran recipe,
> 
>     if {[variant_isset gcc${ver_no_dot}]} {
>         if {${default_fortran_variant} != "+gcc${ver_no_dot}"} {
>             set default_fortran_variant ""
>         }
>     }
> 
> is equivalent in functionality to
> 
>     if {[variant_isset gcc${ver_no_dot}]} {
>         set default_fortran_variant ""
>     }
> 
> and the corresponding if-condition can be removed in the g95 statement, thus removing some lines and simplifying it.
> 
> I am also wondering, can't the Fortran recipe be made a PortGroup? It seems problematic for the maintainability of the portfiles for there to be such a large block duplicated in many portfiles. If it were a PortGroup, then issues like the one above could be settled centrally.
> 
> Best,
> David

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4145 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/macports-dev/attachments/20131004/476706d5/attachment-0001.p7s>


More information about the macports-dev mailing list