File: winlibs.R

package info (click to toggle)
r-cran-v8 7.0.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 440 kB
  • sloc: javascript: 980; cpp: 432; sh: 23; makefile: 8
file content (20 lines) | stat: -rw-r--r-- 1,098 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
if(!file.exists('bindings.o') && !file.exists('../.deps/libv8/include/v8.h')){
  unlink("../.deps", recursive = TRUE)
  url <- if(grepl("aarch", R.version$platform)){
    "https://github.com/r-windows/bundles/releases/download/v8-14.0.365.4/v8-14.0.365.4-clang-aarch64.tar.xz"
  } else if(grepl("clang", Sys.getenv('R_COMPILED_BY'))){
    "https://github.com/r-windows/bundles/releases/download/v8-14.0.365.4/v8-14.0.365.4-clang-x86_64.tar.xz"
  } else if(getRversion() >= "4.3") {
    "https://github.com/r-windows/bundles/releases/download/v8-14.0.365.4/v8-14.0.365.4-ucrt-x86_64.tar.xz"
  } else if(getRversion() >= "4.2") {
    "https://github.com/r-windows/bundles/releases/download/v8-11.8.172.13/v8-9.1.269.38-win-ucrt.tar.xz"
  } else {
    "https://github.com/r-windows/bundles/releases/download/v8-11.8.172.13/v8-9.1.269.38-win-msvcrt.tar.xz"
  }
  download.file(url, basename(url), quiet = TRUE)
  dir.create("../.deps", showWarnings = FALSE)
  untar(basename(url), exdir = "../.deps", tar = 'internal')
  unlink(basename(url))
  setwd("../.deps")
  file.rename(list.files(), 'libv8')
}