Ticket #38735: R-framework.Portfile.diff

File R-framework.Portfile.diff, 10.2 KB (added by kjellpk (Kjell Konis), 8 years ago)
  • Portfile

    old new  
    22
    33PortSystem 1.0
    44
    5 set major 2
    6 set minor 15
    7 set point 3
     5set major 3
     6set minor 0
     7set point 0
    88
    99name                        R-framework
    10 conflicts                   R
     10replaced_by                 R
    1111version                     ${major}.${minor}.${point}
    1212categories                  math science
    1313maintainers                 me.com:kjell.konis
     
    2525
    2626homepage                    http://www.r-project.org/
    2727
    28 master_sites                http://cran.us.r-project.org/src/base/R-2/ \
    29                             http://cran.ms.unimelb.edu.au/src/base/R-2/ \
    30                             http://cran.at.r-project.org/src/base/R-2/ \
    31                             http://cran.hu.r-project.org/src/base/R-2/ \
    32                             http://cran.r-project.org/src/base/R-2/
     28livecheck.type              none
    3329
    34 distname                    R-${version}
    35 dist_subdir                 R
    36 
    37 checksums                   rmd160  d588100f075e3a370a2cd6400e3c61dcc5b7a09e \
    38                             sha256  c583a38f8dad3bc012c08116f4ba1eb2182cadfad4b0f8d7bd3cdba24bc255d6
    39 
    40 depends_build               port:pkgconfig
    41 
    42 depends_lib                 port:readline \
    43                             port:icu \
    44                             port:libiconv
    45 
    46 universal_variant           no
    47 
    48 set resources ${frameworks_dir}/R.framework/Versions/${major}.${minor}/Resources
    49 
    50 post-patch {
    51     reinplace "s|R_HOME|\"${resources}\"|" "${worksrcpath}/src/unix/Rscript.c"
    52 }
    53 
    54 configure.env-append        r_arch=${build_arch}
    55 
    56 configure.pre_args          --prefix=${frameworks_dir}
    57 
    58 configure.cflags-append     -DOS_OBJECT_USE_OBJC=0
    59 
    60 configure.args              --enable-R-framework \
    61                             --enable-R-shlib \
    62                             --enable-BLAS-shlib \
    63                             --enable-openmp \
    64                             --with-readline \
    65                             --with-aqua \
    66                             --without-tcltk \
    67                             --without-cairo \
    68                             --with-libpng \
    69                             --without-jpeglib \
    70                             --without-recommended-packages \
    71                             --with-ICU \
    72                             --without-x \
    73                             --with-included-gettext
    74 
    75 variant cairo requires x11 description {Use cairo and pango} {
    76     depends_lib-append      path:lib/pkgconfig/cairo.pc:cairo \
    77                             path:lib/pkgconfig/pango.pc:pango \
    78                             path:lib/pkgconfig/glib-2.0.pc:glib2 \
    79                             port:freetype \
    80                             port:fontconfig \
    81                             port:gettext
    82     configure.args-delete   --without-cairo
    83     configure.args-append   --with-cairo
    84 }
    85 
    86 variant accelerate conflicts atlas builtin_lapack description {build using the BLAS and Lapack in Apple's Accelerate framework} {
    87     configure.args-append   --with-blas="-framework vecLib" \
    88                             --with-lapack="-framework vecLib"
    89 }
    90 
    91 variant atlas conflicts accelerate builtin_lapack description {build using the BLAS and Lapack provided by the atlas port} {
    92     #more in post-destroot phase
    93     configure.args-append   --without-blas --without-lapack
    94 }
    95 
    96 variant builtin_lapack conflicts accelerate atlas description {build using reference BLAS and Lapack} {
    97     configure.args-append   --without-blas --without-lapack
    98 }
    99 
    100 variant debug description {build with debug symbols} {
    101     configure.optflags-append -g
    102 }
    103 
    104 variant gcc45 conflicts gcc46 gcc47 description {build with gcc45} {
    105     depends_lib-append      port:gcc45
    106     configure.compiler      macports-gcc-4.5
    107     configure.objc          /usr/bin/gcc
    108     configure.env-append    "OBJCXX=${configure.objc}"
     30pre-configure {
     31    ui_error "Please do not install this port since it has been replaced by 'R'."
     32    return -code error
    10933}
    11034
    111 variant gcc46 conflicts gcc45 gcc47 description {build with gcc46} {
    112     depends_lib-append      port:gcc46
    113     configure.compiler      macports-gcc-4.6
    114     configure.objc          /usr/bin/gcc
    115     configure.env-append    "OBJCXX=${configure.objc}"
    116 }
    117 
    118 variant gcc47 conflicts gcc45 gcc46 description {build with gcc47} {
    119     depends_lib-append      port:gcc47
    120     configure.compiler      macports-gcc-4.7
    121     configure.objc          /usr/bin/gcc
    122     configure.env-append    "OBJCXX=${configure.objc}"
    123 }
    124 
    125 variant recommended description {Install recommended R packages} {
    126     configure.args-delete   --without-recommended-packages
    127     configure.args-append   --with-recommended-packages
    128 }
    129 
    130 variant tcltk requires x11 description {Use tcltk} {
    131     depends_lib-append      port:tcl \
    132                             port:tk \
    133                             port:xorg-libXScrnSaver \
    134                             port:xorg-libXext
    135     configure.args-delete   --without-tcltk
    136     configure.args-append   --with-tcltk \
    137                             --with-tcl-config=${prefix}/lib/tclConfig.sh \
    138                             --with-tk-config=${prefix}/lib/tkConfig.sh
    139 }
    140 
    141 variant x11 description {
    142     depends_lib-append      port:xorg-libsm \
    143                             port:xorg-libice \
    144                             port:xorg-libX11 \
    145                             port:xorg-libXt \
    146                             port:tiff \
    147                             port:jpeg \
    148                             port:libpng \
    149                             port:zlib
    150     configure.args-delete   --without-x \
    151                             --without-jpeglib
    152     configure.args-append   --with-x \
    153                             --with-jpeglib \
    154                             --x-include=${prefix}/include/X11 \
    155                             --x-lib=${prefix}/lib
    156 }
    157 
    158 default_variants +cairo +recommended +x11
    159 
    160 if {![variant_isset accelerate] && ![variant_isset atlas] && ![variant_isset builtin_lapack]} {
    161     default_variants-append +accelerate
    162 }
    163 
    164 if {![variant_isset gcc45] && ![variant_isset gcc46] && ![variant_isset gcc47]} {
    165     default_variants-append +gcc47
    166 }
    167 
    168 destroot.destdir prefix=${destroot}${frameworks_dir}
    169 
    170 post-destroot {
    171     move ${destroot}${frameworks_dir}/lib/pkgconfig/libR.pc ${destroot}${prefix}/lib/pkgconfig/libR.pc
    172 
    173     foreach v { "rhome" "rincludedir" } {
    174         reinplace "s|${v}=${destroot}|${v}=|" "${destroot}${prefix}/lib/pkgconfig/libR.pc"
    175     }
    176 
    177     foreach dir { "R_HOME_DIR" "R_SHARE_DIR" "R_INCLUDE_DIR" "R_DOC_DIR" } {
    178         reinplace "s|${dir}=${destroot}|${dir}=|" "${destroot}${resources}/bin/R"
    179     }
    180 
    181     reinplace "s|R_ARCH=/`arch`|R_ARCH=/${build_arch}|" "${destroot}${resources}/bin/R"
    182     reinplace "s|-F${destroot}|-F|" "${destroot}${resources}/etc/${build_arch}/Makeconf"
    183     reinplace "s|OBJCXX = |OBJCXX = /usr/bin/g++|" "${destroot}${resources}/etc/${build_arch}/Makeconf"
    184     reinplace "s|OBJC_LIBS = none |OBJC_LIBS = -lobjc |" "${destroot}${resources}/etc/${build_arch}/Makeconf"
    185 
    186     file delete ${destroot}${resources}/lib/libR.dylib
    187     file delete ${destroot}${resources}/lib/libRblas.dylib
    188     file delete ${destroot}${resources}/lib/libRlapack.dylib
    189 
    190     foreach dylib [ exec find ${destroot}${frameworks_dir}/R.framework -name "\*.dylib" ] {
    191         regsub ":$" ${dylib} "" destroot_dylib_path
    192         regsub ${destroot} ${destroot_dylib_path} "" dylib_path
    193         system "install_name_tool -id ${dylib_path} ${destroot_dylib_path}"
    194         system "install_name_tool -change ${destroot}${resources}/lib/libR.dylib ${resources}/lib/${build_arch}/libR.dylib \
    195             ${destroot_dylib_path}"
    196         system "install_name_tool -change ${destroot}${resources}/lib/libRblas.dylib ${resources}/lib/${build_arch}/libRblas.dylib \
    197             ${destroot_dylib_path}"
    198         system "install_name_tool -change ${destroot}${resources}/lib/libRlapack.dylib ${resources}/lib/${build_arch}/libRlapack.dylib \
    199             ${destroot_dylib_path}"
    200     }
    201 
    202     foreach so [ exec find ${destroot}${frameworks_dir}/R.framework -name "\*.so" ] {
    203         regsub ":$" ${so} "" destroot_so_path
    204         regsub ${destroot} ${destroot_so_path} "" so_path
    205         system "install_name_tool -id ${so_path} ${destroot_so_path}"
    206         system "install_name_tool -change ${destroot}${resources}/lib/libR.dylib ${resources}/lib/${build_arch}/libR.dylib \
    207             ${destroot_so_path}"
    208         system "install_name_tool -change ${destroot}${resources}/lib/libRblas.dylib ${resources}/lib/${build_arch}/libRblas.dylib \
    209             ${destroot_so_path}"
    210         system "install_name_tool -change ${destroot}${resources}/lib/libRlapack.dylib ${resources}/lib/${build_arch}/libRlapack.dylib \
    211             ${destroot_so_path}"
    212     }
    213 
    214     system "install_name_tool -change ${destroot}${resources}/lib/libR.dylib ${resources}/lib/${build_arch}/libR.dylib \
    215         ${destroot}${resources}/bin/exec/${build_arch}/R"
    216     system "install_name_tool -change ${destroot}${resources}/lib/libRblas.dylib ${resources}/lib/${build_arch}/libRblas.dylib \
    217         ${destroot}${resources}/bin/exec/${build_arch}/R"
    218 
    219     ln -s ${build_arch}/libR.dylib ${destroot}${resources}/lib/libR.dylib
    220 
    221     if {[variant_isset atlas]} {
    222         file delete ${destroot}${resources}/lib/${build_arch}/libRblas.dylib
    223         file delete ${destroot}${resources}/lib/${build_arch}/libRlapack.dylib
    224         ln -s ${prefix}/lib/libtatlas.dylib ${destroot}${resources}/lib/${build_arch}/libRblas.dylib
    225         ln -s ${prefix}/lib/libtatlas.dylib ${destroot}${resources}/lib/${build_arch}/libRlapack.dylib
    226         ln -s ${prefix}/lib/libtatlas.dylib ${destroot}${resources}/lib/libRblas.dylib
    227         ln -s ${prefix}/lib/libtatlas.dylib ${destroot}${resources}/lib/libRlapack.dylib
    228     } else {
    229         ln -s ${build_arch}/libRblas.dylib ${destroot}${resources}/lib/libRblas.dylib
    230         ln -s ${build_arch}/libRlapack.dylib ${destroot}${resources}/lib/libRlapack.dylib
    231     }
    232 
    233     ln -s ${resources}/bin/R ${destroot}${prefix}/bin/R
    234     ln -s ${resources}/bin/Rscript ${destroot}${prefix}/bin/Rscript
    235 }
    236 
    237 livecheck.type      regex
    238 livecheck.url       [lindex ${master_sites} 0]
    239 livecheck.regex     >R-(\[0-9.\]+)${extract.suffix}<
    240 
     35distfiles
    24136
    24237