# $Id$ PortSystem 1.0 set major 3 set minor 0 set point 1 name R version ${major}.${minor}.${point} revision 2 categories math science maintainers me.com:kjell.konis license {GPL-2 GPL-3} platforms macosx description \ R is GNU S - an interpreted language for statistical computing long_description \ R is a language and environment for statistical computing and graphics. \ R provides a wide variety of statistical (linear and nonlinear modeling, \ classical statistical tests, time-series analysis, classification, \ clustering, ...) and graphical techniques, and is highly extensible. homepage http://www.r-project.org/ master_sites http://cran.us.r-project.org/src/base/R-3/ \ http://cran.ms.unimelb.edu.au/src/base/R-3/ \ http://cran.at.r-project.org/src/base/R-3/ \ http://cran.hu.r-project.org/src/base/R-3/ \ http://cran.r-project.org/src/base/R-3/ checksums rmd160 09910626891c2962b5c05d204b14d59444da0c3b \ sha256 af90488af3141103b211dc81b6f17d1f0faf4f17684c579a32dfeb25d0d87134 depends_build port:pkgconfig depends_lib port:readline \ port:icu \ port:libiconv universal_variant no set resources ${frameworks_dir}/R.framework/Versions/${major}.${minor}/Resources post-patch { reinplace "s|R_HOME|\"${resources}\"|" "${worksrcpath}/src/unix/Rscript.c" } configure.pre_args --prefix=${frameworks_dir} configure.args --enable-R-framework \ --enable-R-shlib \ --enable-BLAS-shlib \ --enable-openmp \ --with-readline \ --with-aqua \ --without-tcltk \ --without-cairo \ --with-libpng \ --without-jpeglib \ --without-recommended-packages \ --with-ICU \ --without-x \ --with-included-gettext platform darwin 13 { configure.cflags-append -flax-vector-conversions } variant cairo requires x11 description {Use cairo and pango} { depends_lib-append path:lib/pkgconfig/cairo.pc:cairo \ path:lib/pkgconfig/pango.pc:pango \ path:lib/pkgconfig/glib-2.0.pc:glib2 \ port:freetype \ port:fontconfig \ port:gettext configure.args-delete --without-cairo configure.args-append --with-cairo } variant accelerate conflicts builtin_lapack description {build using the BLAS and Lapack in Apple's Accelerate framework} { configure.args-append --with-blas="-framework vecLib" \ --with-lapack="-framework vecLib" } variant builtin_lapack conflicts accelerate description {build using reference BLAS and Lapack} { configure.args-append --without-blas --without-lapack } variant debug description {build with debug symbols} { configure.optflags-append -g } set gcc_versions {4.5 4.6 4.7 4.8 4.9} set default_fortran_variant +gcc48 foreach ver ${gcc_versions} { set ver_no_dot [join [split ${ver} "."] ""] set variant_line {variant gcc${ver_no_dot} description "build with gfortran from gcc${ver_no_dot}"} 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 if {[variant_isset gcc${ver_no_dot}]} { if {${default_fortran_variant} != "+gcc${ver_no_dot}"} { set default_fortran_variant "" } } } 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} configure.fc ${prefix}/bin/gfortran-mp-${ver} configure.f77 ${prefix}/bin/gfortran-mp-${ver} configure.f90 ${prefix}/bin/gfortran-mp-${ver} } } variant recommended description {Install recommended R packages} { configure.args-delete --without-recommended-packages configure.args-append --with-recommended-packages } variant tcltk requires x11 description {Use tcltk} { depends_lib-append port:tcl \ port:tk \ port:xorg-libXScrnSaver \ port:xorg-libXext configure.args-delete --without-tcltk configure.args-append --with-tcltk \ --with-tcl-config=${prefix}/lib/tclConfig.sh \ --with-tk-config=${prefix}/lib/tkConfig.sh } variant x11 description { depends_lib-append port:xorg-libsm \ port:xorg-libice \ port:xorg-libX11 \ port:xorg-libXt \ port:tiff \ port:jpeg \ port:libpng \ port:zlib configure.args-delete --without-x \ --without-jpeglib configure.args-append --with-x \ --with-jpeglib \ --x-include=${prefix}/include/X11 \ --x-lib=${prefix}/lib } default_variants +cairo +recommended +x11 if {![variant_isset accelerate] && ![variant_isset builtin_lapack]} { default_variants-append +accelerate } destroot.destdir prefix=${destroot}${frameworks_dir} post-destroot { move ${destroot}${frameworks_dir}/lib/pkgconfig/libR.pc ${destroot}${prefix}/lib/pkgconfig/libR.pc foreach v { "rhome" "rincludedir" } { reinplace "s|${v}=${destroot}|${v}=|" "${destroot}${prefix}/lib/pkgconfig/libR.pc" } foreach dir { "R_HOME_DIR" "R_SHARE_DIR" "R_INCLUDE_DIR" "R_DOC_DIR" } { reinplace "s|${dir}=${destroot}|${dir}=|" "${destroot}${resources}/bin/R" } reinplace "s|-F${destroot}|-F|" "${destroot}${resources}/etc/Makeconf" foreach dylib [ exec find ${destroot}${frameworks_dir}/R.framework -name "\*.dylib" ] { regsub ":$" ${dylib} "" destroot_dylib_path regsub ${destroot} ${destroot_dylib_path} "" dylib_path system "install_name_tool -id ${dylib_path} ${destroot_dylib_path}" system "install_name_tool -change ${destroot}${resources}/lib/libR.dylib ${resources}/lib/libR.dylib \ ${destroot_dylib_path}" system "install_name_tool -change ${destroot}${resources}/lib/libRblas.dylib ${resources}/lib/libRblas.dylib \ ${destroot_dylib_path}" system "install_name_tool -change ${destroot}${resources}/lib/libRlapack.dylib ${resources}/lib/libRlapack.dylib \ ${destroot_dylib_path}" } foreach so [ exec find ${destroot}${frameworks_dir}/R.framework -name "\*.so" ] { regsub ":$" ${so} "" destroot_so_path regsub ${destroot} ${destroot_so_path} "" so_path system "install_name_tool -id ${so_path} ${destroot_so_path}" system "install_name_tool -change ${destroot}${resources}/lib/libR.dylib ${resources}/lib/libR.dylib \ ${destroot_so_path}" system "install_name_tool -change ${destroot}${resources}/lib/libRblas.dylib ${resources}/lib/libRblas.dylib \ ${destroot_so_path}" system "install_name_tool -change ${destroot}${resources}/lib/libRlapack.dylib ${resources}/lib/libRlapack.dylib \ ${destroot_so_path}" } system "install_name_tool -change ${destroot}${resources}/lib/libR.dylib ${resources}/lib/libR.dylib \ ${destroot}${resources}/bin/exec/R" system "install_name_tool -change ${destroot}${resources}/lib/libRblas.dylib ${resources}/lib/libRblas.dylib \ ${destroot}${resources}/bin/exec/R" ln -s ${resources}/bin/R ${destroot}${prefix}/bin/R ln -s ${resources}/bin/Rscript ${destroot}${prefix}/bin/Rscript } livecheck.type regex livecheck.url [lindex ${master_sites} 0] livecheck.regex >${name}-(\[0-9.\]+)${extract.suffix}<