-
Notifications
You must be signed in to change notification settings - Fork 181
/
install_verse.sh
executable file
·103 lines (90 loc) · 2.48 KB
/
install_verse.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/bash
set -e
## build ARGs
NCPUS=${NCPUS:--1}
# shellcheck source=/dev/null
source /etc/os-release
# always set this for scripts but don't declare as ENV..
export DEBIAN_FRONTEND=noninteractive
# a function to install apt packages only if they are not installed
function apt_install() {
if ! dpkg -s "$@" >/dev/null 2>&1; then
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
apt-get update
fi
apt-get install -y --no-install-recommends "$@"
fi
}
apt_install \
cmake \
curl \
default-jdk \
fonts-roboto \
ghostscript \
hugo \
less \
libbz2-dev \
libglpk-dev \
libgmp3-dev \
libfribidi-dev \
libharfbuzz-dev \
libhunspell-dev \
libicu-dev \
liblzma-dev \
libmagick++-dev \
libopenmpi-dev \
libpcre2-dev \
libssl-dev \
libv8-dev \
libxml2-dev \
libxslt1-dev \
libzmq3-dev \
qpdf \
texinfo \
software-properties-common \
vim \
wget
# libgit2-dev also depends on the libcurl4-gnutils in bionic but not on focal
# cran PPA is a super-stable solution to this
if [ "${UBUNTU_CODENAME}" == "bionic" ]; then
add-apt-repository -y ppa:cran/travis
fi
# librdf0-dev depends on libcurl4-gnutils-dev instead of libcurl4-openssl-dev...
# So: we can build the redland package bindings and then swap back to libcurl-openssl-dev... (ick)
# explicitly install runtime library sub-deps of librdf0-dev so they are not auto-removed.
apt_install librdf0-dev
install2.r --error --skipinstalled -n "$NCPUS" redland
apt_install \
libcurl4-openssl-dev \
libgit2-dev \
libxslt-dev \
librdf0 \
redland-utils \
rasqal-utils \
raptor2-utils
apt-get remove -y systemd
apt-get -y autoremove
## Add LaTeX, rticles and bookdown support
## tinytex recommends a dummy texlive if using tlmgr manually
if [[ ! -x "/usr/bin/latex" ]]; then
wget "https://travis-bin.yihui.name/texlive-local.deb"
dpkg -i texlive-local.deb
rm texlive-local.deb
fi
## Install texlive
/rocker_scripts/install_texlive.sh
install2.r --error --skipinstalled -n "$NCPUS" tinytex
install2.r --error --skipmissing --deps TRUE --skipinstalled -n "$NCPUS" \
blogdown \
bookdown \
distill \
rticles \
rmdshower \
rJava \
xaringan
# Clean up
rm -rf /tmp/downloaded_packages
rm -rf /var/lib/apt/lists/*
## Strip binary installed lybraries from RSPM
## https://github.com/rocker-org/rocker-versioned2/issues/340
strip /usr/local/lib/R/site-library/*/libs/*.so