Changeset 141379 for trunk/dports/math


Ignore:
Timestamp:
Oct 16, 2015, 7:18:06 PM (4 years ago)
Author:
dstrubbe@…
Message:

R: Use compilers PortGroup to manage Fortran variants (which adds support for gcc5, gcc6, g95, and dragonegg, and sets gcc5 as default -- passes test phase on my machine). Comments on necessity of clang for the C compiler (at least on Yosemite). Two small fixes: comment in configure.args was ending up in the middle of the configure line since more args are appended to this line, and therefore were probably ignored since they fall after the '#'. The require_active_variants line for tk should not use the path: dependency since tk is set as a port: dependency. Closes ticket #49316.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/math/R/Portfile

    r139462 r141379  
    33
    44PortSystem 1.0
     5PortGroup compilers 1.0
    56PortGroup active_variants 1.1
    67
     
    3637                            sha256  9c9152e74134b68b0f3a1c7083764adc1cb56fd8336bec003fd0ca550cd2461d
    3738
     39compilers.choose            fc f77
     40compilers.setup             require_fortran
     41
    3842depends_build               port:pkgconfig
    3943
     
    5054    reinplace "s|R_HOME|\"${resources}\"|" "${worksrcpath}/src/unix/Rscript.c"
    5155}
     56
     57# Note: gcc cannot be used for the C compiler. It will give:
     58#:info:build In file included from /usr/include/dispatch/dispatch.h:51:0,
     59#:info:build                  from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:15,
     60#:info:build                  from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h:13,
     61#:info:build                  from langprefs.c:30:
     62#:info:build /usr/include/dispatch/object.h:143:15: error: expected identifier or '(' before '^' token
     63#:info:build  typedef void (^dispatch_block_t)(void);
     64#:info:build                ^
     65#:info:build /usr/include/dispatch/object.h:362:3: error: unknown type name 'dispatch_block_t'
     66#:info:build    dispatch_block_t notification_block);
     67#:info:build    ^
     68# However, use of compiler.blacklist *gcc* would remove the GCC Fortran compilers too.
    5269
    5370configure.pre_args          --prefix=${frameworks_dir}
     
    6380                            --without-x \
    6481                            --with-included-gettext \
    65                             --without-system-xz #bug introduced in R-3.2.0, doesn't link to system copy, put port:xz back too
     82                            --without-system-xz
     83#bug introduced in R-3.2.0, doesn't link to system copy, put port:xz back too
    6684
    6785if {${os.major} < 13} {
     
    105123}
    106124
    107 set gcc_versions {4.5 4.6 4.7 4.8 4.9}
    108 set default_fortran_variant +gfortran48
    109 
    110 foreach ver ${gcc_versions} {
    111     set ver_no_dot [join [split ${ver} "."] ""]
    112 
    113     set variant_line {variant gfortran${ver_no_dot} description "build with gfortran from gcc${ver_no_dot}"}
    114 
    115     foreach over ${gcc_versions} {
    116         if {${ver} == ${over}} {
    117             continue
    118         }
    119 
    120         set over_no_dot [join [split ${over} "."] ""]
    121         append variant_line " conflicts gfortran${over_no_dot}"
    122     }
    123     append variant_line { {}}
    124 
    125     eval $variant_line
    126 
    127     if {[variant_isset gfortran${ver_no_dot}]} {
    128         if {${default_fortran_variant} != "+gfortran${ver_no_dot}"} {
    129             set default_fortran_variant ""
    130         }
    131     }
    132 }
    133 
    134 if {${default_fortran_variant} != ""} {
    135     default_variants-append "${default_fortran_variant}"
    136 }
    137 
    138 foreach ver ${gcc_versions} {
    139     set ver_no_dot [join [split ${ver} "."] ""]
    140 
    141     if {[variant_isset gfortran${ver_no_dot}]} {
    142         depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc
    143         depends_build-append port:gcc${ver_no_dot}
    144 
    145         configure.fc  ${prefix}/bin/gfortran-mp-${ver}
    146         configure.f77 ${prefix}/bin/gfortran-mp-${ver}
    147         configure.f90 ${prefix}/bin/gfortran-mp-${ver}
    148     }
    149 }
    150 
    151125variant recommended description {install recommended R packages} {
    152126    configure.args-delete   --without-recommended-packages
     
    159133                            port:xorg-libXScrnSaver \
    160134                            port:xorg-libXext
    161     require_active_variants path:lib/pkgconfig/tk.pc:tk x11
     135    require_active_variants tk x11
    162136    configure.args-delete   --without-tcltk
    163137    configure.args-append   --with-tcltk \
Note: See TracChangeset for help on using the changeset viewer.