diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index ae0f16f..d73d654 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -18,6 +18,7 @@ jobs: config: - {os: macos-latest, r: 'release'} - {os: windows-latest, r: 'release'} + - {os: windows-latest, r: '4.2'} - {os: windows-latest, r: '4.1'} - {os: windows-latest, r: '3.6'} - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} diff --git a/src/Makevars.win b/src/Makevars.win index c55196f..90d71b7 100644 --- a/src/Makevars.win +++ b/src/Makevars.win @@ -1,5 +1,4 @@ -VERSION = 1.7.0 -RWINLIB = ../windows/libgit2-$(VERSION) +RWINLIB = ../windows/libgit2 TARGET = lib$(subst gcc,,$(COMPILED_BY))$(R_ARCH) PKG_CPPFLAGS = -I$(RWINLIB)/include \ @@ -7,14 +6,14 @@ PKG_CPPFLAGS = -I$(RWINLIB)/include \ PKG_LIBS = \ -L$(RWINLIB)/$(TARGET) \ - -L$(RWINLIB)/lib$(R_ARCH) \ - -lgit2 -lssh2 -lz -lcrypto -liconv \ - -lwinhttp -lws2_32 -lcrypt32 -lole32 -lrpcrt4 + -L$(RWINLIB)/lib \ + -lgit2 -lssh2 -lssl -lcrypto -lz -liconv \ + -lwinhttp -lws2_32 -lcrypt32 -lole32 -lrpcrt4 -lsecur32 all: clean winlibs winlibs: - "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" "../tools/winlibs.R" $(VERSION) + "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" "../tools/winlibs.R" clean: rm -f $(SHLIB) $(OBJECTS) diff --git a/tools/winlibs.R b/tools/winlibs.R index 4a50530..95a15cd 100644 --- a/tools/winlibs.R +++ b/tools/winlibs.R @@ -1,8 +1,16 @@ -if(getRversion() < "3.3.0") setInternet2() -VERSION <- commandArgs(TRUE) -if(!file.exists(sprintf("../windows/libgit2-%s/include/git2.h", VERSION))){ - download.file(sprintf("https://github.com/rwinlib/libgit2/archive/v%s.zip", VERSION), "lib.zip", quiet = TRUE) +if(!file.exists("../windows/libgit2/include/git2.h")){ + unlink("../windows", recursive = TRUE) + url <- if(grepl("aarch", R.version$platform)){ + "https://github.com/r-windows/bundles/releases/download/libgit2-1.7.1/libgit2-1.7.1-clang-aarch64.tar.xz" + } else if(getRversion() >= "4.2") { + "https://github.com/r-windows/bundles/releases/download/libgit2-1.7.1/libgit2-1.7.1-ucrt-x86_64.tar.xz" + } else { + "https://github.com/rwinlib/libgit2/archive/v1.7.1.tar.gz" + } + download.file(url, basename(url), quiet = TRUE) dir.create("../windows", showWarnings = FALSE) - unzip("lib.zip", exdir = "../windows") - unlink("lib.zip") + untar(basename(url), exdir = "../windows", tar = 'internal') + unlink(basename(url)) + setwd("../windows") + file.rename(list.files(), 'libgit2') }