Skip to content

Commit

Permalink
Support arm
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Sep 25, 2023
1 parent 2b47035 commit de16540
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 16 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: windows-latest, r: '4.1'}
- {os: windows-latest, r: '4.2'}
- {os: windows-latest, r: 'devel'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: rzmq
Title: R Bindings for 'ZeroMQ'
Version: 0.9.9
Version: 0.9.10
Authors@R: c(
person("Whit", "Armstrong", , "[email protected]", role = "aut"),
person("Michael", "Schubert", role = "ctb"),
Expand Down
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
0.9.10
- Windows: support arm64

0.9.8
- Windows: update to zermoq 4.3.4

Expand Down
10 changes: 4 additions & 6 deletions src/Makevars.win
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
GCC_VERSION = ${subst gcc,,${COMPILED_BY}}
RWINLIB = ../windows/zeromq-4.3.4

RWINLIB = ../windows/zeromq
PKG_CPPFLAGS = -DZMQ_STATIC \
-I../inst -I${RWINLIB}/include
-I../inst -I$(RWINLIB)/include

PKG_LIBS = \
-L${RWINLIB}/lib${GCC_VERSION}${R_ARCH} \
-L${RWINLIB}/lib${R_ARCH} \
-L$(RWINLIB)/lib$(R_ARCH) \
-L$(RWINLIB)/lib \
-lzmq -lsodium -liphlpapi -lws2_32

all: clean winlibs
Expand Down
25 changes: 16 additions & 9 deletions tools/winlibs.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
# Build against precompiled zeromq libs.
if(!file.exists("../windows/zeromq-4.3.4/include/zmq.h")){
if(getRversion() < "3.3.0") setInternet2()
download.file("https://github.com/rwinlib/zeromq/archive/4.3.4.zip", "lib.zip", quiet = TRUE)
if(!file.exists("../windows/zeromq/include")){
unlink("../windows", recursive = TRUE)
url <- if(grepl("aarch", R.version$platform)){
"https://github.com/r-windows/bundles/releases/download/zeromq-4.3.4/zeromq-4.3.4-clang-aarch64.tar.xz"
} else if(grepl("clang", Sys.getenv('R_COMPILED_BY'))){
"https://github.com/r-windows/bundles/releases/download/zeromq-4.3.4/zeromq-4.3.4-clang-x86_64.tar.xz"
} else if(getRversion() >= "4.3") {
"https://github.com/r-windows/bundles/releases/download/zeromq-4.3.4/zeromq-4.3.4-ucrt-x86_64.tar.xz"
} else {
"https://github.com/rwinlib/zeromq/archive/4.3.4.tar.gz"
}
download.file(url, basename(url), quiet = TRUE)
dir.create("../windows", showWarnings = FALSE)
unzip("lib.zip", exdir = "../windows")
unlink("lib.zip")

# We want to use vendored zmq.hpp from rzmq instead
unlink("../windows/zeromq-4.3.4/include/*.hpp")
untar(basename(url), exdir = "../windows", tar = 'internal')
unlink(basename(url))
setwd("../windows")
file.rename(list.files(), 'zeromq')
}

0 comments on commit de16540

Please sign in to comment.