Ticket #49316: Portfile-R.diff

File Portfile-R.diff, 4.1 KB (added by dstrubbe (David Strubbe), 9 years ago)
  • Portfile

     
    22# $Id$
    33
    44PortSystem 1.0
     5PortGroup compilers 1.0
    56PortGroup active_variants 1.1
    67
    78name                        R
     
    3536checksums                   rmd160  0e8bf2ecca48f0f2433f6b07f422b7730a76fbb4 \
    3637                            sha256  9c9152e74134b68b0f3a1c7083764adc1cb56fd8336bec003fd0ca550cd2461d
    3738
     39compilers.choose            fc f77
     40compilers.setup             require_fortran
     41
    3842depends_build               port:pkgconfig
    3943
    4044depends_lib                 port:readline \
     
    5054    reinplace "s|R_HOME|\"${resources}\"|" "${worksrcpath}/src/unix/Rscript.c"
    5155}
    5256
     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.
     69
    5370configure.pre_args          --prefix=${frameworks_dir}
    5471
    5572configure.args              --enable-memory-profiling \
     
    6279                            --without-recommended-packages \
    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} {
    6886    configure.args-append --disable-openmp
     
    104122    configure.optflags-append -g
    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
    153127    configure.args-append   --with-recommended-packages
     
    158132                            port:tk \
    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 \
    164138                            --with-tcl-config=${prefix}/lib/tclConfig.sh \