Skip to content

Commit a565496

Browse files
authored
Merge pull request #59 from jeroen/master
Windows: update to hiredix 1.2.0 + arm64 support
2 parents a080c6e + 0c14eb3 commit a565496

File tree

4 files changed

+24
-10
lines changed

4 files changed

+24
-10
lines changed

configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ elif [ `uname` = "Darwin" ]; then
3838
PKG_LIBS="-L$BREWDIR/opt/$PKG_BREW_NAME/lib $PKG_LIBS"
3939
else
4040
curl -sfL "https://autobrew.github.io/scripts/$PKG_BREW_NAME" > autobrew
41-
. autobrew
41+
. ./autobrew
4242
fi
4343
fi
4444

src/Makevars.ucrt

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/Makevars.win

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# -*- makefile -*-
2-
PKG_CPPFLAGS=-I../windows/hiredis-1.0.0/include/hiredis -DSTRICT_R_HEADERS
3-
PKG_LIBS=-L../windows/hiredis-1.0.0/lib${R_ARCH}${CRT} -lhiredis -lws2_32
2+
PKG_CPPFLAGS=-I../windows/hiredis/include/hiredis -DSTRICT_R_HEADERS
3+
4+
ifeq ($(R_COMPILED_BY),gcc 8.3.0)
5+
LEGACY_ARCH=$(R_ARCH) # Enables 32-bit support in R 4.1
6+
endif
7+
8+
PKG_LIBS=-L../windows/hiredis/lib$(LEGACY_ARCH) -lhiredis -lws2_32
49

510
all: clean winlibs
611

tools/winlibs.R

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
1-
if (!file.exists("../windows/hiredis-1.0.0/include/hiredis/hiredis.h")) {
2-
if (getRversion() < "3.3.0") setInternet2()
3-
download.file("https://github.com/rwinlib/hiredis/archive/v1.0.0.zip", "lib.zip", quiet = TRUE)
1+
if(!file.exists("../windows/hiredis/include/hiredis/hiredis.h")){
2+
unlink("../windows", recursive = TRUE)
3+
url <- if(grepl("aarch", R.version$platform)){
4+
"https://github.com/r-windows/bundles/releases/download/hiredis-1.2.0/hiredis-1.2.0-clang-aarch64.tar.xz"
5+
} else if(grepl("clang", Sys.getenv('R_COMPILED_BY'))){
6+
"https://github.com/r-windows/bundles/releases/download/hiredis-1.2.0/hiredis-1.2.0-clang-x86_64.tar.xz"
7+
} else if(getRversion() >= "4.2") {
8+
"https://github.com/r-windows/bundles/releases/download/hiredis-1.2.0/hiredis-1.2.0-ucrt-x86_64.tar.xz"
9+
} else {
10+
"https://github.com/rwinlib/hiredis/archive/v1.0.0.tar.gz"
11+
}
12+
download.file(url, basename(url), quiet = TRUE)
413
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(), 'hiredis')
718
}

0 commit comments

Comments
 (0)