| 1 |
if(!file.exists('rsvg.o') && !file.exists("../.deps/librsvg/include/librsvg-2.0/librsvg/rsvg.h")){ |
| 2 |
unlink("../.deps", recursive = TRUE) |
| 3 |
url <- if(grepl("aarch", R.version$platform)){ |
| 4 |
"https://github.com/r-windows/bundles/releases/download/librsvg-2.61.0/librsvg-2.61.0-clang-aarch64.tar.xz" |
| 5 |
} else if(grepl("clang", Sys.getenv('R_COMPILED_BY'))){ |
| 6 |
"https://github.com/r-windows/bundles/releases/download/librsvg-2.61.0/librsvg-2.61.0-clang-x86_64.tar.xz" |
| 7 |
} else if(getRversion() >= "4.2") { |
| 8 |
"https://github.com/r-windows/bundles/releases/download/librsvg-2.61.0/librsvg-2.61.0-ucrt-x86_64.tar.xz" |
| 9 |
} else { |
| 10 |
"https://github.com/rwinlib/rsvg/archive/v2.50.5.tar.gz" |
| 11 |
} |
| 12 |
download.file(url, basename(url), quiet = TRUE) |
| 13 |
dir.create("../.deps", showWarnings = FALSE) |
| 14 |
untar(basename(url), exdir = "../.deps", tar = 'internal') |
| 15 |
unlink(basename(url)) |
| 16 |
setwd("../.deps") |
| 17 |
file.rename(list.files(), 'librsvg') |
| 18 |
invisible() |
| 19 |
} |