How to install stringi library from archive and install the local icu52l.zip

前端 未结 5 878
我寻月下人不归
我寻月下人不归 2021-01-11 16:18

We\'re bumbling through making some R code work in a production environment and as part of that we\'re installing some R packages as follows:

# Default direc         


        
5条回答
  •  一向
    一向 (楼主)
    2021-01-11 16:34


    Note: for Stringi >= 0.5-1 please check the answer by @gagolews


    From INSTALL file:

    The stringi package depends on the ICU4C >= 50 library.

    So libicu42 is far to old.

    If you check install.R file you'll find following lines:

    mirrors <- c("http://static.rexamine.com/packages/",
        "http://www.mini.pw.edu.pl/~gagolews/stringi/",
        "http://www.ibspan.waw.pl/~gagolews/stringi/")
    

    A couple of lines later you'll find something like this:

    if (!grepl("^https?://", href)) {
        # try to copy icudt from a local repo
        if (!file.exists(href)) return("no icudt in a local repo")
    

    If you add local path at the beginning of the mirrors and put downloaded libraries it seems to work as expected. Here you can a patch I've used: https://gist.github.com/zero323/338c8fb0faf46e5ac06d

    So my solution would be to:

    • clone the repostiory
    • checkout version you want
    • apply patch with a path to the local version of the ICU
    • install package from source

    There is probably a better way, but that is what I came up so far.

提交回复
热议问题