Skip to content

Commit

Permalink
install_R_deps as seperate method
Browse files Browse the repository at this point in the history
  • Loading branch information
cboettig committed Jan 5, 2024
1 parent f15c188 commit 54a4a09
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 1 deletion.
62 changes: 62 additions & 0 deletions scripts/install_R_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/bin/bash


set -e

R_VERSION=${1:-${R_VERSION:-"latest"}}

# shellcheck source=/dev/null
source /etc/os-release

apt-get update
apt-get -y install locales

## Configure default locale
LANG=${LANG:-"en_US.UTF-8"}
/usr/sbin/locale-gen --lang "${LANG}"
/usr/sbin/update-locale --reset LANG="${LANG}"

export DEBIAN_FRONTEND=noninteractive

R_HOME=${R_HOME:-"/usr/local/lib/R"}

READLINE_VERSION=8
if [ "${UBUNTU_CODENAME}" == "bionic" ]; then
READLINE_VERSION=7
fi

apt-get install -y --no-install-recommends \
bash-completion \
ca-certificates \
file \
fonts-texgyre \
g++ \
gfortran \
gsfonts \
libblas-dev \
libbz2-* \
libcurl4 \
"libicu[0-9][0-9]" \
liblapack-dev \
libpcre2* \
libjpeg-turbo* \
libpangocairo-* \
libpng16* \
"libreadline${READLINE_VERSION}" \
libtiff* \
liblzma* \
make \
tzdata \
unzip \
zip \
zlib1g


mkdir -p "${R_HOME}/site-library"
chown root:staff "${R_HOME}/site-library"
chmod g+ws "${R_HOME}/site-library"
echo "R_LIBS=\${R_LIBS-'${R_HOME}/site-library:${R_HOME}/library'}" >>"${R_HOME}/etc/Renviron.site"

echo "PATH=${PATH}" >>"${R_HOME}/etc/Renviron.site"


2 changes: 1 addition & 1 deletion scripts/setup_R.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ if [ ! -x "$(command -v r)" ]; then

# Clean up
# shellcheck disable=SC2086
# apt-get remove --purge -y ${BUILDDEPS}
apt-get remove --purge -y ${BUILDDEPS}
apt-get autoremove -y
apt-get autoclean -y
fi
Expand Down

0 comments on commit 54a4a09

Please sign in to comment.