Ticket #26426: Portfile-R.diff

File Portfile-R.diff, 3.9 KB (added by kjell.konis@…, 14 years ago)

Try number two, sets r_arch explicitly.

  • Portfile

    old new  
    44
    55name             R
    66version          2.11.1
     7revision         1
    78categories       math science
    89maintainers      epfl.ch:kjell.konis
    910platforms        darwin
     
    4344
    4445universal_variant no
    4546
     47variant recommended description {Install recommended R packages} {
     48    configure.args-delete --without-recommended-packages
     49    configure.args-append --with-recommended-packages
     50}
     51
    4652variant gcc42 conflicts gcc43 gcc44 description {Build with gcc42} {
    4753    configure.compiler macports-gcc-4.2
    4854    depends_lib-append port:gcc42
     
    5864    depends_lib-append port:gcc44
    5965}
    6066
     67default_variants +recommended
     68
    6169if {![variant_isset gcc42] && ![variant_isset gcc43] && ![variant_isset gcc44]} {
    62     default_variants +gcc44
     70    default_variants-append +gcc44
    6371}
    6472
    6573post-extract {
    6674  reinplace "s|R_HOME|\"${prefix}/lib/R\"|" "${worksrcpath}/src/unix/Rscript.c"
    6775}
    6876
     77configure.env-append r_arch=${build_arch}
     78
    6979configure.args   --mandir=\\\${prefix}/share/man \
    7080                 --enable-BLAS-shlib \
    7181                 --enable-R-shlib \
     
    7686                 --with-tcl-config=${prefix}/lib/tclConfig.sh \
    7787                 --with-tk-config=${prefix}/lib/tkConfig.sh \
    7888                 --x-include=${prefix}/include \
    79                  --x-lib=${prefix}/lib
     89                 --x-lib=${prefix}/lib \
     90                 --without-recommended-packages
    8091
    8192test.run         yes
    8293test.target      check
     
    93104    reinplace "s|${v}=${destroot}|${v}=|" "${destroot}${prefix}/lib/pkgconfig/libR.pc"
    94105  }
    95106
    96   foreach dylib [ exec find ${destroot}${prefix}/lib/R/lib -name "\*.dylib" ] {
     107  reinplace "s|rlibdir=\$\{rhome\}/lib|rlibdir=\$\{rhome\}/lib/${build_arch}|" \
     108            "${destroot}${prefix}/lib/pkgconfig/libR.pc"
     109
     110  foreach dylib [ exec find ${destroot}${prefix}/lib/R/lib/${build_arch} -name "\*.dylib" ] {
    97111    regsub ":$" ${dylib} "" destroot_dylib_path
    98112    regsub ${destroot} ${destroot_dylib_path} "" dylib_path
    99113    system "install_name_tool -id ${dylib_path} ${destroot_dylib_path}"
    100     system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/libR.dylib \
     114    system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/${build_arch}/libR.dylib \
    101115      ${destroot_dylib_path}"
    102     system "install_name_tool -change libRblas.dylib ${prefix}/lib/R/lib/libRblas.dylib \
     116    system "install_name_tool -change libRblas.dylib ${prefix}/lib/R/lib/${build_arch}/libRblas.dylib \
    103117      ${destroot_dylib_path}"
    104     system "install_name_tool -change libRlapack.dylib ${prefix}/lib/R/lib/libRlapack.dylib \
     118    system "install_name_tool -change libRlapack.dylib ${prefix}/lib/R/lib/${build_arch}/libRlapack.dylib \
    105119      ${destroot_dylib_path}"
    106120  }
    107121
     
    109123    regsub ":$" ${so} "" destroot_so_path
    110124    regsub ${destroot} ${destroot_so_path} "" so_path
    111125    system "install_name_tool -id ${so_path} ${destroot_so_path}"
    112     system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/libR.dylib \
     126    system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/${build_arch}/libR.dylib \
    113127      ${destroot_so_path}"
    114     system "install_name_tool -change libRblas.dylib ${prefix}/lib/R/lib/libRblas.dylib \
     128    system "install_name_tool -change libRblas.dylib ${prefix}/lib/R/lib/${build_arch}/libRblas.dylib \
    115129      ${destroot_so_path}"
    116     system "install_name_tool -change libRlapack.dylib ${prefix}/lib/R/lib/libRlapack.dylib \
     130    system "install_name_tool -change libRlapack.dylib ${prefix}/lib/R/lib/${build_arch}/libRlapack.dylib \
    117131      ${destroot_so_path}"
    118132  }
    119133
    120134  reinplace "s|-dylib_file libRblas\.dylib:\$\(R_HOME\)/lib\$\(R_ARCH\)/libRblas\.dylib| |" \
    121             "${destroot}${prefix}/lib/R/etc/Makeconf"
     135            "${destroot}${prefix}/lib/R/etc/${build_arch}/Makeconf"
    122136}