| 1 | # Wedge definition for R libraries
|
| 2 | #
|
| 3 | # Loaded by deps/wedge.sh.
|
| 4 |
|
| 5 | set -o nounset
|
| 6 | set -o pipefail
|
| 7 | set -o errexit
|
| 8 |
|
| 9 | # sourced
|
| 10 | WEDGE_NAME='R-libs'
|
| 11 | WEDGE_VERSION='2023-04-18'
|
| 12 |
|
| 13 | # R hits the network
|
| 14 | WEDGE_LEAKY_BUILD=1
|
| 15 |
|
| 16 | # Notes: dplyr 1.0.3 as of January 2021 made these fail on Xenial.
|
| 17 | # I did an R 4.0 installation. See build/py.sh install-new-R
|
| 18 | #
|
| 19 | # February 2023: compile errors with dplyr and Ubuntu 18.04, which has R 3.4.4.
|
| 20 | # tidyverse has minimum R of 3.6.
|
| 21 | # I need to install a new R again.
|
| 22 |
|
| 23 | wedge-make() {
|
| 24 | echo 'No make step'
|
| 25 |
|
| 26 | }
|
| 27 |
|
| 28 | wedge-install() {
|
| 29 | local build_dir=$1
|
| 30 | local install_dir=$2
|
| 31 |
|
| 32 | # 2024-02 - weird fix, I had to add "rlang" on Debian Bookworm. Otherwise
|
| 33 | # the smoke test for dplyr/tidyr would fail.
|
| 34 |
|
| 35 | echo
|
| 36 | echo '*** INFO: Rscript --version ***'
|
| 37 | echo
|
| 38 | Rscript --version
|
| 39 | echo
|
| 40 |
|
| 41 | # Gah! This "devtools" has a shitload of deps itself ... sad
|
| 42 | # #
|
| 43 | # https://support.posit.co/hc/en-us/articles/219949047-Installing-older-versions-of-packages
|
| 44 | if false; then
|
| 45 | INSTALL_DEST=$install_dir Rscript -e \
|
| 46 | 'install.packages(c("devtools"), lib=Sys.getenv("INSTALL_DEST"), repos="https://cloud.r-project.org")'
|
| 47 | fi
|
| 48 |
|
| 49 | # Also consider adding ggplot.
|
| 50 | if true; then
|
| 51 | INSTALL_DEST=$install_dir Rscript -e \
|
| 52 | 'install.packages(c("rlang", "dplyr", "tidyr", "stringr", "RUnit"), lib=Sys.getenv("INSTALL_DEST"), repos="https://cloud.r-project.org")'
|
| 53 | fi
|
| 54 | }
|
| 55 |
|
| 56 | wedge-smoke-test() {
|
| 57 | local install_dir=$1
|
| 58 |
|
| 59 | R_LIBS_USER=$install_dir Rscript -e \
|
| 60 | 'library(rlang); library(dplyr); library(tidyr); library(stringr); library("RUnit"); print("OK")'
|
| 61 | }
|