|
1 | | -# Build against static libraries from rwinlib |
2 | | -if(!file.exists("../windows/libxml2-2.10.3/include/libxml2/libxml/parser.h")){ |
3 | | - download.file("https://github.com/rwinlib/libxml2/archive/v2.10.3.zip","lib.zip",quiet=TRUE) |
| 1 | +if(!file.exists("../windows/libxml2/include/libxml2/libxml")){ |
| 2 | + unlink("../windows",recursive=TRUE) |
| 3 | +url<-if(grepl("aarch",R.version$platform)){ |
| 4 | +"https://github.com/r-windows/bundles/releases/download/libxml2-2.11.5/libxml2-2.11.5-clang-aarch64.tar.xz" |
| 5 | + }elseif(grepl("clang", Sys.getenv('R_COMPILED_BY'))){ |
| 6 | +"https://github.com/r-windows/bundles/releases/download/libxml2-2.11.5/libxml2-2.11.5-clang-x86_64.tar.xz" |
| 7 | + }elseif(getRversion()>="4.2") { |
| 8 | +"https://github.com/r-windows/bundles/releases/download/libxml2-2.11.5/libxml2-2.11.5-ucrt-x86_64.tar.xz" |
| 9 | + }else { |
| 10 | +"https://github.com/rwinlib/libxml2/archive/v2.10.3.tar.gz" |
| 11 | + } |
| 12 | + download.file(url, basename(url),quiet=TRUE) |
4 | 13 | dir.create("../windows",showWarnings=FALSE) |
5 | | - unzip("lib.zip",exdir="../windows") |
6 | | - unlink("lib.zip") |
| 14 | + untar(basename(url),exdir="../windows",tar='internal') |
| 15 | + unlink(basename(url)) |
| 16 | + setwd("../windows") |
| 17 | + file.rename(list.files(),'libxml2') |
7 | 18 | } |