-
Notifications
You must be signed in to change notification settings - Fork 1
/
R-install.bash
146 lines (117 loc) · 2.87 KB
/
R-install.bash
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
msg_install \
-message \
"Installing the R-packages for $(pack_get -module-name $(get_parent))"
# This script will install all R packages
#exit 0
# Install packages in the base-R directory!
source R/R-basic.bash
function mk_R_install_script {
local file=$(build_get -build-path)/.R.$(pack_get -package).$(pack_get -version)
case $1 in
new)
shift 1
rm -f $file
[ $# -gt 0 ] && echo "$@" > $file
;;
get)
shift 1
printf '%s' "$file"
;;
*)
echo "$@" >> $file
;;
esac
}
archive_path=$(build_get -archive-path)
function add_R_package {
local name=$1
local v=$2
shift 2
local opt=
case $@ in
*-directory*)
noop
;;
*)
opt="-directory $name"
;;
esac
add_package -package $name -version $v $opt $@ https://cran.r-project.org/src/contrib/${name}_$v.tar.gz
pack_set -s $IS_MODULE
local _prefix=$(pack_get -prefix)
pack_set -install-query $_prefix/$(pack_get -package)
pack_cmd "mkdir -p $_prefix"
pack_cmd "$(get_parent_exec) CMD INSTALL -l $_prefix $archive_path/$(pack_get -archive)"
pack_set -module-opt "-prepend-ENV R_LIBS_SITE=$_prefix"
}
add_R_package Matrix 1.2-18
add_R_package RcppEigen 0.3.3.7.0
pack_set -mod-req Matrix
add_R_package plyr 1.8.6
# tidyverse packages
# ggplot2
# dplyr
# tidyr
# readr
# purrr
# tibble
# stringr
# forcats
add_R_package tibble 3.0.3
add_R_package bench 1.1.1
pack_set -mod-req tibble
add_R_package tidyselect 1.1.0
add_R_package dplyr 1.0.1
pack_set -mod-req tibble
pack_set -mod-req tidyselect
add_R_package stringr 1.4.0
add_R_package forcats 0.5.0
pack_set -mod-req tibble
add_R_package purrr 0.3.4
add_R_package readr 1.3.1
pack_set -mod-req tibble
add_R_package tidyr 1.1.1
pack_set -mod-req purrr
pack_set -mod-req dplyr
add_R_package MASS 7.3-51.6
add_R_package ggplot2 3.3.2
pack_set -mod-req plyr
pack_set -mod-req tibble
pack_set -mod-req dplyr
pack_set -mod-req MASS
install_all -from Matrix
function add_R_package {
local name=$1
local v=$2
shift 2
local opt=
case $@ in
*-directory*)
noop
;;
*)
opt="-directory $name"
;;
esac
add_package -package R.$name -version $v $opt $@ https://cran.r-project.org/src/contrib/${name}_$v.tar.gz
pack_set -s $IS_MODULE
local _prefix=$(pack_get -prefix)
pack_set -install-query $_prefix/$name
pack_cmd "mkdir -p $_prefix"
pack_set -module-opt "-prepend-ENV R_LIBS_SITE=$_prefix"
}
archive_path=$(build_get -archive-path)
# Now we install R packages
# Note that all packages installed like this will have an "R-" prefix.
# This is to ensure no nameclashes with parent libraries
source R/udunits2.bash
source R/units.bash
source R/sp.bash
source R/rgeos.bash
source R/sf.bash
source R/rgdal.bash
source R/lwgeom.bash
install_all -from R.udunits2
unset archive_path
unset add_R_package
unset mk_R_install_script