Ticket #15743: Portfile-R.diff

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

R 2.7.0 to R 2.7.1 upgrade + post-destroot cleanup

  • Portfile

    old new  
    33PortSystem 1.0
    44
    55name             R
    6 version          2.7.0
     6version          2.7.1
    77categories       math science
    88maintainers      kjell.konis@epfl.ch
    99platforms        darwin
    10 revision         1
    1110
    1211description      R is GNU S - an interpreted language for statistical computing
    1312
     
    2524                 http://cran.hu.r-project.org/src/base/R-2/ \
    2625                 http://cran.r-project.org/src/base/R-2/
    2726
    28 checksums        md5    9eaee3eceec1d5f72cea5640ca90768c \
    29                  sha1   d0a3193e474696ad767845ef6b8ee1555a26b898 \
    30                  rmd160 c3c9cf0c0a1eb6191492f1be19e277e8223a42c9
     27checksums        md5    565b06a1f3f11020399934cc7b47a59d \
     28                 sha1   cdf5f6f85463c7be007306add2f4ca7cf7babfb7 \
     29                 rmd160 ac98e39d46ebc7581dd53da7f69a1e7abad269a4
    3130
    3231depends_lib      port:cairo \
    3332                 port:expat \
     
    4847                 port:zlib \
    4948                 lib:libX11.6:XFree86
    5049
    51 variant gcc42 description {Build with gcc42 (default)} {
     50variant gcc42 description {Build with gcc42} {
    5251    configure.compiler macports-gcc-4.2
    5352    depends_lib-append port:gcc42
    5453}
    5554
    56 variant gcc43 description {Build with gcc43} {
     55variant gcc43 description {Build with gcc43 (default)} {
    5756    configure.compiler macports-gcc-4.3
    5857    depends_lib-append port:gcc43
    5958}
    6059
    6160if {![variant_isset gcc42] && ![variant_isset gcc43]} {
    62     default_variants +gcc42
     61    default_variants +gcc43
    6362}
    6463
    6564post-extract {
     
    8079destroot.destdir prefix=${destroot}${prefix}
    8180
    8281post-destroot {
    83   reinplace "s|R_HOME_DIR=${destroot}|R_HOME_DIR=|" \
    84     "${destroot}${prefix}/bin/R"
    85   reinplace "s|R_HOME_DIR=${destroot}|R_HOME_DIR=|" \
    86     "${destroot}${prefix}/lib/R/bin/R"
    87   reinplace "s|R_SHARE_DIR=${destroot}|R_SHARE_DIR=|" \
    88     "${destroot}${prefix}/bin/R"
    89   reinplace "s|R_SHARE_DIR=${destroot}|R_SHARE_DIR=|" \
    90     "${destroot}${prefix}/lib/R/bin/R"
    91   reinplace "s|R_INCLUDE_DIR=${destroot}|R_INCLUDE_DIR=|" \
    92     "${destroot}${prefix}/bin/R"
    93   reinplace "s|R_INCLUDE_DIR=${destroot}|R_INCLUDE_DIR=|" \
    94     "${destroot}${prefix}/lib/R/bin/R"
    95   reinplace "s|R_DOC_DIR=${destroot}|R_DOC_DIR=|" \
    96     "${destroot}${prefix}/bin/R"
    97   reinplace "s|R_DOC_DIR=${destroot}|R_DOC_DIR=|" \
    98     "${destroot}${prefix}/lib/R/bin/R"
     82  foreach r { "/bin/R" "/lib/R/bin/R" } {
     83    foreach dir { "R_HOME_DIR" "R_SHARE_DIR" "R_INCLUDE_DIR" "R_DOC_DIR" } {
     84      reinplace "s|${dir}=${destroot}|${dir}=|" \
     85        "${destroot}${prefix}${r}"
     86    }
     87  }
     88
    9989  system "install_name_tool -id ${prefix}/lib/R/lib/libR.dylib \
    10090    ${destroot}${prefix}/lib/R/lib/libR.dylib"
    101   system "install_name_tool -id ${prefix}/lib/R/modules/R_X11.so \
    102     ${destroot}${prefix}/lib/R/modules/R_X11.so"
    103   system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/libR.dylib \
    104     ${destroot}${prefix}/lib/R/modules/R_X11.so"
    105   system "install_name_tool -id ${prefix}/lib/R/modules/internet.so \
    106     ${destroot}${prefix}/lib/R/modules/internet.so"
    107   system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/libR.dylib \
    108     ${destroot}${prefix}/lib/R/modules/internet.so"
    109   system "install_name_tool -id ${prefix}/lib/R/modules/lapack.so \
    110     ${destroot}${prefix}/lib/R/modules/lapack.so"
    111   system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/libR.dylib \
    112     ${destroot}${prefix}/lib/R/modules/lapack.so"
    113   system "install_name_tool -id ${prefix}/lib/R/modules/vfonts.so \
    114     ${destroot}${prefix}/lib/R/modules/vfonts.so"
    115   system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/libR.dylib \
    116     ${destroot}${prefix}/lib/R/modules/vfonts.so"
    117   system "install_name_tool -id ${prefix}/lib/R/library/tools/libs/tools.so \
    118     ${destroot}${prefix}/lib/R/library/tools/libs/tools.so"
    119   system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/libR.dylib \
    120     ${destroot}${prefix}/lib/R/library/tools/libs/tools.so"
    121   system "install_name_tool -id ${prefix}/lib/R/library/spatial/libs/spatial.so \
    122     ${destroot}${prefix}/lib/R/library/spatial/libs/spatial.so"
    123   system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/libR.dylib \
    124     ${destroot}${prefix}/lib/R/library/spatial/libs/spatial.so"
    125   system "install_name_tool -id ${prefix}/lib/R/library/class/libs/class.so \
    126     ${destroot}${prefix}/lib/R/library/class/libs/class.so"
    127   system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/libR.dylib \
    128     ${destroot}${prefix}/lib/R/library/class/libs/class.so"
    129   system "install_name_tool -id ${prefix}/lib/R/library/lattice/libs/lattice.so \
    130     ${destroot}${prefix}/lib/R/library/lattice/libs/lattice.so"
    131   system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/libR.dylib \
    132     ${destroot}${prefix}/lib/R/library/lattice/libs/lattice.so"
    133   system "install_name_tool -id ${prefix}/lib/R/library/tcltk/libs/tcltk.so \
    134     ${destroot}${prefix}/lib/R/library/tcltk/libs/tcltk.so"
    135   system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/libR.dylib \
    136     ${destroot}${prefix}/lib/R/library/tcltk/libs/tcltk.so"
    137   system "install_name_tool -id ${prefix}/lib/R/library/survival/libs/survival.so \
    138     ${destroot}${prefix}/lib/R/library/survival/libs/survival.so"
    139   system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/libR.dylib \
    140     ${destroot}${prefix}/lib/R/library/survival/libs/survival.so"
    141   system "install_name_tool -id ${prefix}/lib/R/library/stats/libs/stats.so \
    142     ${destroot}${prefix}/lib/R/library/stats/libs/stats.so"
    143   system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/libR.dylib \
    144     ${destroot}${prefix}/lib/R/library/stats/libs/stats.so"
    145   system "install_name_tool -id ${prefix}/lib/R/library/KernSmooth/libs/KernSmooth.so \
    146     ${destroot}${prefix}/lib/R/library/KernSmooth/libs/KernSmooth.so"
    147   system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/libR.dylib \
    148     ${destroot}${prefix}/lib/R/library/KernSmooth/libs/KernSmooth.so"
    149   system "install_name_tool -id ${prefix}/lib/R/library/mgcv/libs/mgcv.so \
    150     ${destroot}${prefix}/lib/R/library/mgcv/libs/mgcv.so"
    151   system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/libR.dylib \
    152     ${destroot}${prefix}/lib/R/library/mgcv/libs/mgcv.so"
    153   system "install_name_tool -id ${prefix}/lib/R/library/methods/libs/methods.so \
    154     ${destroot}${prefix}/lib/R/library/methods/libs/methods.so"
    155   system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/libR.dylib \
    156     ${destroot}${prefix}/lib/R/library/methods/libs/methods.so"
    157   system "install_name_tool -id ${prefix}/lib/R/library/nlme/libs/nlme.so \
    158     ${destroot}${prefix}/lib/R/library/nlme/libs/nlme.so"
    159   system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/libR.dylib \
    160     ${destroot}${prefix}/lib/R/library/nlme/libs/nlme.so"
    161   system "install_name_tool -id ${prefix}/lib/R/library/grDevices/libs/grDevices.so \
    162     ${destroot}${prefix}/lib/R/library/grDevices/libs/grDevices.so"
    163   system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/libR.dylib \
    164     ${destroot}${prefix}/lib/R/library/grDevices/libs/grDevices.so"
    165   system "install_name_tool -id ${prefix}/lib/R/library/foreign/libs/foreign.so \
    166     ${destroot}${prefix}/lib/R/library/foreign/libs/foreign.so"
    167   system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/libR.dylib \
    168     ${destroot}${prefix}/lib/R/library/foreign/libs/foreign.so"
    169   system "install_name_tool -id ${prefix}/lib/R/library/MASS/libs/MASS.so \
    170     ${destroot}${prefix}/lib/R/library/MASS/libs/MASS.so"
    171   system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/libR.dylib \
    172     ${destroot}${prefix}/lib/R/library/MASS/libs/MASS.so"
    173   system "install_name_tool -id ${prefix}/lib/R/library/nnet/libs/nnet.so \
    174     ${destroot}${prefix}/lib/R/library/nnet/libs/nnet.so"
    175   system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/libR.dylib \
    176     ${destroot}${prefix}/lib/R/library/nnet/libs/nnet.so"
    177   system "install_name_tool -id ${prefix}/lib/R/library/grid/libs/grid.so \
    178     ${destroot}${prefix}/lib/R/library/grid/libs/grid.so"
    179   system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/libR.dylib \
    180     ${destroot}${prefix}/lib/R/library/grid/libs/grid.so"
    181   system "install_name_tool -id ${prefix}/lib/R/library/rpart/libs/rpart.so \
    182     ${destroot}${prefix}/lib/R/library/rpart/libs/rpart.so"
    183   system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/libR.dylib \
    184     ${destroot}${prefix}/lib/R/library/rpart/libs/rpart.so"
    185   system "install_name_tool -id ${prefix}/lib/R/library/splines/libs/splines.so \
    186     ${destroot}${prefix}/lib/R/library/splines/libs/splines.so"
    187   system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/libR.dylib \
    188     ${destroot}${prefix}/lib/R/library/splines/libs/splines.so"
    189   system "install_name_tool -id ${prefix}/lib/R/library/cluster/libs/cluster.so \
    190     ${destroot}${prefix}/lib/R/library/cluster/libs/cluster.so"
    191   system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/libR.dylib \
    192     ${destroot}${prefix}/lib/R/library/cluster/libs/cluster.so"
     91
     92  foreach so [ exec find ${destroot}${prefix}/lib/R -name "\*.so" ] {
     93    regsub ":$" ${so} "" destroot_so_path
     94    regsub ${destroot} ${destroot_so_path} "" so_path
     95    system "install_name_tool -id ${so_path} ${destroot_so_path}"
     96    system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/libR.dylib ${destroot_so_path}"
     97  }
    19398}
    19499