|
1 | | -# Build against gifski libs compiled with the Rtools |
2 | | -VERSION <- commandArgs(TRUE) |
3 | | - |
4 | | -# Hack: latest gifski does not work on Windows Vista |
5 | | -if(grepl('Windows (Vista|Server 2008)', osVersion)){ |
6 | | - VERSION <- '1.4.3' |
7 | | -} |
8 | | - |
9 | | -if(!file.exists(sprintf("../windows/gifski-%s/include/gifski.h", VERSION))){ |
10 | | - if(getRversion() < "3.3.0") setInternet2() |
11 | | - download.file(sprintf("https://github.com/rwinlib/gifski/archive/v%s.zip", VERSION), "lib.zip", quiet = TRUE) |
| 1 | +if(!file.exists("../windows/libgifski/lib")){ |
| 2 | + unlink("../windows", recursive = TRUE) |
| 3 | + url <- if(grepl("aarch", R.version$platform)){ |
| 4 | + "https://github.com/r-windows/bundles/releases/download/gifski-1.12.2/gifski-1.12.2-clang-aarch64.tar.xz" |
| 5 | + } else if(grepl("clang", Sys.getenv('R_COMPILED_BY'))){ |
| 6 | + "https://github.com/r-windows/bundles/releases/download/gifski-1.12.2/gifski-1.12.2-clang-x86_64.tar.xz" |
| 7 | + } else if(getRversion() >= "4.2") { |
| 8 | + "https://github.com/r-windows/bundles/releases/download/gifski-1.12.2/gifski-1.12.2-ucrt-x86_64.tar.xz" |
| 9 | + } else { |
| 10 | + "https://github.com/r-windows/bundles/releases/download/gifski-1.12.2/gifski-1.12.0-msvcrt.tar.xz" |
| 11 | + } |
| 12 | + download.file(url, basename(url), quiet = TRUE) |
12 | 13 | dir.create("../windows", showWarnings = FALSE) |
13 | | - unzip("lib.zip", exdir = "../windows") |
14 | | - unlink("lib.zip") |
15 | | - file.rename(sprintf("../windows/gifski-%s", VERSION), '../windows/gifski-winlibs') |
| 14 | + untar(basename(url), exdir = "../windows", tar = 'internal') |
| 15 | + unlink(basename(url)) |
| 16 | + setwd("../windows") |
| 17 | + file.rename(list.files(), 'libgifski') |
16 | 18 | } |
0 commit comments